{
  "openapi": "3.1.1",
  "info": {
    "title": "Eternify Ledger API: Purchases",
    "version": "v1",
    "x-wire-version": "2026-08-31",
    "description": "Vendors, bills, purchase orders, payment runs and vendor credits. The same operations the Eternify Ledger app and its connected AI tools use, over HTTPS and JSON. Send a key or an access token as a bearer token. Each operation is stable or beta: a stable operation changes only with 365 days' notice, a beta one with 30. Changes are listed in the changelog at https://www.eternifylabs.com/resources/developers/changelog.",
    "contact": {
      "name": "Eternify Labs developer resources",
      "url": "https://www.eternifylabs.com/resources/developers"
    }
  },
  "servers": [
    {
      "url": "https://api.eternifylabs.com",
      "description": "Production"
    }
  ],
  "security": [
    {
      "apiKey": []
    },
    {
      "oauth": []
    }
  ],
  "tags": [
    {
      "name": "purchases",
      "description": "Vendors, bills, purchase orders, payment runs and vendor credits.",
      "x-display-name": "Purchases"
    }
  ],
  "paths": {
    "/v1/bill-approval-stages": {
      "get": {
        "operationId": "listBillApprovalStages",
        "summary": "Lists the approval stages bills go through, with the people at each.",
        "description": "Lists the approval stages bills go through, with the people at each. Needs the `ledger:read` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "purchases"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:read",
        "parameters": [
          {
            "name": "billId",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "ruleId",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "deskUserId",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "state",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "WAITING",
                "APPROVED",
                "DECLINED",
                "REASSIGNED",
                "ESCALATED",
                "WITHDRAWN"
              ]
            }
          },
          {
            "name": "from",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
            }
          },
          {
            "name": "to",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "default": 50,
              "type": "integer",
              "minimum": 1,
              "maximum": 200
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 512
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "billId": {
                            "type": "string"
                          },
                          "supplierName": {
                            "type": "string"
                          },
                          "entityName": {
                            "type": "string"
                          },
                          "entityTimeZone": {
                            "type": "string"
                          },
                          "subject": {
                            "type": "string",
                            "enum": [
                              "BILL",
                              "BILL_EDIT"
                            ]
                          },
                          "revision": {
                            "type": "integer",
                            "minimum": -9007199254740991,
                            "maximum": 9007199254740991
                          },
                          "position": {
                            "type": "integer",
                            "minimum": -9007199254740991,
                            "maximum": 9007199254740991
                          },
                          "stageCount": {
                            "type": "integer",
                            "minimum": -9007199254740991,
                            "maximum": 9007199254740991
                          },
                          "kind": {
                            "type": "string",
                            "enum": [
                              "REVIEW",
                              "SIGN"
                            ]
                          },
                          "desk": {
                            "$ref": "#/components/schemas/Desk"
                          },
                          "rule": {
                            "anyOf": [
                              {
                                "type": "object",
                                "properties": {
                                  "id": {
                                    "type": "string"
                                  },
                                  "version": {
                                    "type": "integer",
                                    "minimum": -9007199254740991,
                                    "maximum": 9007199254740991
                                  },
                                  "sourceText": {
                                    "type": "string"
                                  }
                                },
                                "required": [
                                  "id",
                                  "version",
                                  "sourceText"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "reason": {
                            "type": "string"
                          },
                          "routedAt": {
                            "type": "string",
                            "minLength": 20
                          },
                          "routedBy": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string"
                              },
                              "name": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "id",
                              "name"
                            ],
                            "additionalProperties": false
                          },
                          "actorType": {
                            "type": "string",
                            "enum": [
                              "USER",
                              "AGENT",
                              "SYSTEM"
                            ]
                          },
                          "state": {
                            "type": "string",
                            "enum": [
                              "WAITING",
                              "APPROVED",
                              "DECLINED",
                              "REASSIGNED",
                              "ESCALATED",
                              "WITHDRAWN"
                            ]
                          },
                          "decidedBy": {
                            "anyOf": [
                              {
                                "type": "object",
                                "properties": {
                                  "id": {
                                    "type": "string"
                                  },
                                  "name": {
                                    "type": "string"
                                  }
                                },
                                "required": [
                                  "id",
                                  "name"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "decidedAt": {
                            "anyOf": [
                              {
                                "type": "string",
                                "minLength": 20
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "onBehalfOf": {
                            "anyOf": [
                              {
                                "type": "object",
                                "properties": {
                                  "id": {
                                    "type": "string"
                                  },
                                  "name": {
                                    "type": "string"
                                  }
                                },
                                "required": [
                                  "id",
                                  "name"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "decisionNote": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "closedBy": {
                            "anyOf": [
                              {
                                "type": "object",
                                "properties": {
                                  "id": {
                                    "type": "string"
                                  },
                                  "name": {
                                    "type": "string"
                                  }
                                },
                                "required": [
                                  "id",
                                  "name"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "closedAt": {
                            "anyOf": [
                              {
                                "type": "string",
                                "minLength": 20
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "closeReason": {
                            "type": [
                              "string",
                              "null"
                            ]
                          }
                        },
                        "required": [
                          "id",
                          "billId",
                          "supplierName",
                          "entityName",
                          "entityTimeZone",
                          "subject",
                          "revision",
                          "position",
                          "stageCount",
                          "kind",
                          "desk",
                          "rule",
                          "reason",
                          "routedAt",
                          "routedBy",
                          "actorType",
                          "state",
                          "decidedBy",
                          "decidedAt",
                          "onBehalfOf",
                          "decisionNote",
                          "closedBy",
                          "closedAt",
                          "closeReason"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "nextCursor": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "total": {
                      "anyOf": [
                        {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  },
                  "required": [
                    "data",
                    "nextCursor",
                    "total"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "422": {
            "$ref": "#/components/responses/Problem422"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      }
    },
    "/v1/bill-proposals": {
      "get": {
        "operationId": "listBillProposals",
        "summary": "Lists the bills proposed from outside documents, waiting for a decision.",
        "description": "Lists the bills proposed from outside documents, waiting for a decision. Needs the `ledger:read` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "purchases"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:read",
        "parameters": [
          {
            "name": "entityId",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "kind",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "BILL",
                "BILL_EDIT"
              ]
            }
          },
          {
            "name": "awaiting",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "myApproval"
              ]
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "default": 50,
              "type": "integer",
              "minimum": 1,
              "maximum": 200
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 512
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "proposalId": {
                            "type": "string"
                          },
                          "kind": {
                            "type": "string",
                            "enum": [
                              "BILL",
                              "BILL_EDIT"
                            ]
                          },
                          "billId": {
                            "type": "string"
                          },
                          "entityId": {
                            "type": "string"
                          },
                          "entityName": {
                            "type": "string"
                          },
                          "supplierName": {
                            "type": "string"
                          },
                          "vendor": {
                            "anyOf": [
                              {
                                "type": "object",
                                "properties": {
                                  "id": {
                                    "type": "string"
                                  },
                                  "displayName": {
                                    "type": "string"
                                  }
                                },
                                "required": [
                                  "id",
                                  "displayName"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "number": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "billDate": {
                            "type": "string",
                            "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                          },
                          "dueDate": {
                            "type": "string",
                            "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                          },
                          "currency": {
                            "type": "string",
                            "pattern": "^[A-Z]{3}$"
                          },
                          "totalMinor": {
                            "type": "string",
                            "pattern": "^-?\\d+$"
                          },
                          "previousTotalMinor": {
                            "anyOf": [
                              {
                                "type": "string",
                                "pattern": "^-?\\d+$"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "lineCount": {
                            "type": "integer",
                            "minimum": 0,
                            "maximum": 9007199254740991
                          },
                          "submittedAt": {
                            "type": "string",
                            "minLength": 20
                          },
                          "submittedBy": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string"
                              },
                              "name": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "id",
                              "name"
                            ],
                            "additionalProperties": false
                          },
                          "draftedBy": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string"
                              },
                              "name": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "id",
                              "name"
                            ],
                            "additionalProperties": false
                          },
                          "source": {
                            "type": "string",
                            "enum": [
                              "INBOX_DOCUMENT",
                              "MANUAL",
                              "IMPORT",
                              "RECURRING"
                            ]
                          },
                          "note": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "desk": {
                            "$ref": "#/components/schemas/Desk2"
                          }
                        },
                        "required": [
                          "proposalId",
                          "kind",
                          "billId",
                          "entityId",
                          "entityName",
                          "supplierName",
                          "vendor",
                          "number",
                          "billDate",
                          "dueDate",
                          "currency",
                          "totalMinor",
                          "previousTotalMinor",
                          "lineCount",
                          "submittedAt",
                          "submittedBy",
                          "draftedBy",
                          "source",
                          "note",
                          "desk"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "nextCursor": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "total": {
                      "anyOf": [
                        {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  },
                  "required": [
                    "data",
                    "nextCursor",
                    "total"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "422": {
            "$ref": "#/components/responses/Problem422"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      }
    },
    "/v1/bills": {
      "get": {
        "operationId": "listBills",
        "summary": "Lists the bills on the ledger, with the server's total.",
        "description": "Lists the bills on the ledger, with the server's total. Needs the `ledger:read` permission. Stable: a change that breaks callers needs 365 days' notice.",
        "tags": [
          "purchases"
        ],
        "x-stability-level": "stable",
        "x-scope": "ledger:read",
        "parameters": [
          {
            "name": "entityId",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "vendorId",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "DRAFT",
                "IN_REVIEW",
                "DECLINED",
                "APPROVED",
                "HELD",
                "OPEN",
                "DUE",
                "OVERDUE",
                "IN_RUN",
                "PARTIALLY_PAID",
                "PAID",
                "VOID"
              ]
            }
          },
          {
            "name": "dueFrom",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
            }
          },
          {
            "name": "dueTo",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
            }
          },
          {
            "name": "q",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 100
            }
          },
          {
            "name": "view",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "due",
                "other",
                "recover"
              ]
            }
          },
          {
            "name": "when",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "all",
                "overdue",
                "week"
              ]
            }
          },
          {
            "name": "awaiting",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "myApproval"
              ]
            }
          },
          {
            "name": "held",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "only"
              ]
            }
          },
          {
            "name": "closePeriod",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^\\d{4}-(0[1-9]|1[0-2])$"
            }
          },
          {
            "name": "conversion",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "untested"
              ]
            }
          },
          {
            "name": "itc",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "fails",
                "untested",
                "passes"
              ]
            }
          },
          {
            "name": "currency",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^[A-Z]{3}$"
            }
          },
          {
            "name": "owing",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "only"
              ]
            }
          },
          {
            "name": "supersedes",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "replaceable",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "only"
              ]
            }
          },
          {
            "name": "discount",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "open"
              ]
            }
          },
          {
            "name": "holdback",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "ANY",
                "RETAINED",
                "RELEASE_DUE",
                "RELEASED"
              ]
            }
          },
          {
            "name": "question",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "WAITING",
                "ANSWERED",
                "UNRESOLVED",
                "MINE"
              ]
            }
          },
          {
            "name": "billDateFrom",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
            }
          },
          {
            "name": "billDateTo",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
            }
          },
          {
            "name": "sort",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 64
            }
          },
          {
            "name": "submittedById",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "amountFrom",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^-?\\d+$"
            }
          },
          {
            "name": "amountTo",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^-?\\d+$"
            }
          },
          {
            "name": "cf",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 4000
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "default": 50,
              "type": "integer",
              "minimum": 1,
              "maximum": 200
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 512
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/ListBillsResponseItem"
                      }
                    },
                    "nextCursor": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "total": {
                      "anyOf": [
                        {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  },
                  "required": [
                    "data",
                    "nextCursor",
                    "total"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "422": {
            "$ref": "#/components/responses/Problem422"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      },
      "post": {
        "operationId": "createBill",
        "summary": "Creates a draft bill from a vendor's invoice.",
        "description": "Creates a draft bill from a vendor's invoice. Needs the `ledger:propose` permission. Stable: a change that breaks callers needs 365 days' notice.",
        "tags": [
          "purchases"
        ],
        "x-stability-level": "stable",
        "x-scope": "ledger:propose",
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "entityId": {
                    "type": "string",
                    "minLength": 1
                  },
                  "vendorId": {
                    "anyOf": [
                      {
                        "type": "string",
                        "minLength": 1
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "supplierName": {
                    "type": "string",
                    "maxLength": 200
                  },
                  "supplierRegistrationNumber": {
                    "anyOf": [
                      {
                        "type": "string",
                        "pattern": "^\\d{9}RT\\d{4}$"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "number": {
                    "anyOf": [
                      {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 60
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "billDate": {
                    "type": "string",
                    "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                  },
                  "dueDate": {
                    "type": "string",
                    "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                  },
                  "currency": {
                    "type": "string",
                    "pattern": "^[A-Z]{3}$"
                  },
                  "memo": {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 500
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "deliveryRegion": {
                    "anyOf": [
                      {
                        "type": "string",
                        "pattern": "^(CA|US)-[A-Z]{2}$"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "lines": {
                    "$ref": "#/components/schemas/Lines3"
                  },
                  "customFields": {
                    "$ref": "#/components/schemas/CustomFields3"
                  },
                  "submit": {
                    "default": false,
                    "type": "boolean"
                  },
                  "note": {
                    "type": "string",
                    "maxLength": 500
                  },
                  "supersedesBillId": {
                    "type": "string",
                    "minLength": 1
                  }
                },
                "required": [
                  "entityId",
                  "billDate",
                  "lines"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "Ledger-Position": {
                "$ref": "#/components/headers/LedgerPosition"
              },
              "Location": {
                "$ref": "#/components/headers/Location"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RecordBillFxRateResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem400"
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "409": {
            "$ref": "#/components/responses/Problem409"
          },
          "412": {
            "$ref": "#/components/responses/Problem412"
          },
          "422": {
            "$ref": "#/components/responses/Problem422"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      }
    },
    "/v1/bills-due": {
      "get": {
        "operationId": "listBillsDue",
        "summary": "Lists the bills that fall due, by date, with the server's total.",
        "description": "Lists the bills that fall due, by date, with the server's total. Needs the `ledger:read` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "purchases"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:read",
        "parameters": [
          {
            "name": "entityId",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "when",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "all",
                "overdue",
                "week"
              ]
            }
          },
          {
            "name": "vendorId",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "q",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 100
            }
          },
          {
            "name": "sort",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 64
            }
          },
          {
            "name": "view",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "due",
                "other",
                "recover"
              ]
            }
          },
          {
            "name": "held",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "only"
              ]
            }
          },
          {
            "name": "discount",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "open"
              ]
            }
          },
          {
            "name": "plan",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "set",
                "unset",
                "slipped"
              ]
            }
          },
          {
            "name": "account",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "default": 50,
              "type": "integer",
              "minimum": 1,
              "maximum": 200
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 512
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "billId": {
                            "type": "string"
                          },
                          "extractionId": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "documentId": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "entityId": {
                            "type": "string"
                          },
                          "entityName": {
                            "type": "string"
                          },
                          "supplierName": {
                            "type": "string"
                          },
                          "vendor": {
                            "anyOf": [
                              {
                                "type": "object",
                                "properties": {
                                  "id": {
                                    "type": "string"
                                  },
                                  "displayName": {
                                    "type": "string"
                                  },
                                  "status": {
                                    "type": "string",
                                    "enum": [
                                      "ACTIVE",
                                      "ARCHIVED"
                                    ]
                                  },
                                  "bankingState": {
                                    "type": "string",
                                    "enum": [
                                      "NONE",
                                      "PENDING",
                                      "VERIFIED"
                                    ]
                                  },
                                  "bankingVerifiedOn": {
                                    "anyOf": [
                                      {
                                        "type": "string",
                                        "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                                      },
                                      {
                                        "type": "null"
                                      }
                                    ]
                                  },
                                  "acceptance": {
                                    "default": null,
                                    "anyOf": [
                                      {
                                        "type": "object",
                                        "properties": {
                                          "state": {
                                            "type": "string",
                                            "enum": [
                                              "PENDING_ACCEPTANCE",
                                              "ACCEPTED",
                                              "REFUSED",
                                              "NOT_REVIEWED"
                                            ]
                                          },
                                          "createdByName": {
                                            "type": "string"
                                          }
                                        },
                                        "required": [
                                          "state",
                                          "createdByName"
                                        ],
                                        "additionalProperties": false
                                      },
                                      {
                                        "type": "null"
                                      }
                                    ]
                                  },
                                  "paymentHold": {
                                    "anyOf": [
                                      {
                                        "type": "object",
                                        "properties": {
                                          "reason": {
                                            "type": "string"
                                          },
                                          "byName": {
                                            "type": "string"
                                          },
                                          "heldOn": {
                                            "type": "string",
                                            "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                                          }
                                        },
                                        "required": [
                                          "reason",
                                          "byName",
                                          "heldOn"
                                        ],
                                        "additionalProperties": false
                                      },
                                      {
                                        "type": "null"
                                      }
                                    ]
                                  },
                                  "bankingReturned": {
                                    "default": null,
                                    "anyOf": [
                                      {
                                        "type": "object",
                                        "properties": {
                                          "returnedOn": {
                                            "type": "string",
                                            "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                                          },
                                          "returnCode": {
                                            "type": "string",
                                            "enum": [
                                              "R900",
                                              "R902",
                                              "R903",
                                              "R904",
                                              "R905",
                                              "R909",
                                              "R910",
                                              "R911",
                                              "R912",
                                              "R922",
                                              "R990",
                                              "OTHER"
                                            ]
                                          }
                                        },
                                        "required": [
                                          "returnedOn",
                                          "returnCode"
                                        ],
                                        "additionalProperties": false
                                      },
                                      {
                                        "type": "null"
                                      }
                                    ]
                                  }
                                },
                                "required": [
                                  "id",
                                  "displayName",
                                  "status",
                                  "bankingState",
                                  "bankingVerifiedOn",
                                  "acceptance",
                                  "paymentHold",
                                  "bankingReturned"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "invoiceNumber": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "invoiceDate": {
                            "type": "string",
                            "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                          },
                          "dueDate": {
                            "type": "string",
                            "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                          },
                          "overdueDays": {
                            "type": "integer",
                            "minimum": -9007199254740991,
                            "maximum": 9007199254740991
                          },
                          "currency": {
                            "type": "string",
                            "pattern": "^[A-Z]{3}$"
                          },
                          "amountMinor": {
                            "type": "string",
                            "pattern": "^-?\\d+$"
                          },
                          "entryId": {
                            "type": "string"
                          },
                          "entryNumber": {
                            "anyOf": [
                              {
                                "type": "integer",
                                "minimum": -9007199254740991,
                                "maximum": 9007199254740991
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "payability": {
                            "type": "string",
                            "enum": [
                              "PAYABLE",
                              "BILL_HELD",
                              "NO_VENDOR",
                              "VENDOR_ARCHIVED",
                              "VENDOR_HELD",
                              "VENDOR_NOT_ACCEPTED",
                              "NO_BANKING",
                              "BANKING_PENDING",
                              "BANKING_RETURNED",
                              "BANKING_FOREIGN",
                              "IN_RUN"
                            ]
                          },
                          "inRun": {
                            "anyOf": [
                              {
                                "type": "object",
                                "properties": {
                                  "id": {
                                    "type": "string"
                                  },
                                  "status": {
                                    "type": "string",
                                    "enum": [
                                      "DRAFT",
                                      "RELEASED",
                                      "CANCELLED"
                                    ]
                                  }
                                },
                                "required": [
                                  "id",
                                  "status"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "hold": {
                            "anyOf": [
                              {
                                "type": "object",
                                "properties": {
                                  "reason": {
                                    "type": "string"
                                  },
                                  "byName": {
                                    "type": "string"
                                  },
                                  "heldOn": {
                                    "type": "string",
                                    "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                                  },
                                  "until": {
                                    "anyOf": [
                                      {
                                        "type": "string",
                                        "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                                      },
                                      {
                                        "type": "null"
                                      }
                                    ]
                                  },
                                  "untilPassed": {
                                    "type": "boolean"
                                  },
                                  "policyAuthorName": {
                                    "type": [
                                      "string",
                                      "null"
                                    ]
                                  }
                                },
                                "required": [
                                  "reason",
                                  "byName",
                                  "heldOn",
                                  "until",
                                  "untilPassed",
                                  "policyAuthorName"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "paidBy": {
                            "type": "string",
                            "enum": [
                              "RUN",
                              "CARD",
                              "PAD",
                              "ACCOUNT",
                              "CHEQUE",
                              "WIRE",
                              "ETRANSFER",
                              "OTHER"
                            ]
                          },
                          "pendingSettlement": {
                            "anyOf": [
                              {
                                "type": "object",
                                "properties": {
                                  "id": {
                                    "type": "string"
                                  },
                                  "method": {
                                    "type": "string",
                                    "enum": [
                                      "RUN",
                                      "CARD",
                                      "PAD",
                                      "ACCOUNT",
                                      "CHEQUE",
                                      "WIRE",
                                      "ETRANSFER",
                                      "OTHER"
                                    ]
                                  },
                                  "settledOn": {
                                    "type": "string",
                                    "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                                  },
                                  "recordedBy": {
                                    "type": "object",
                                    "properties": {
                                      "id": {
                                        "type": "string"
                                      },
                                      "name": {
                                        "type": "string"
                                      }
                                    },
                                    "required": [
                                      "id",
                                      "name"
                                    ],
                                    "additionalProperties": false
                                  },
                                  "recordedAt": {
                                    "type": "string",
                                    "minLength": 20
                                  },
                                  "account": {
                                    "type": "object",
                                    "properties": {
                                      "id": {
                                        "type": "string"
                                      },
                                      "displayName": {
                                        "type": "string"
                                      }
                                    },
                                    "required": [
                                      "id",
                                      "displayName"
                                    ],
                                    "additionalProperties": false
                                  },
                                  "paidAmountMinor": {
                                    "type": "string",
                                    "pattern": "^-?\\d+$"
                                  },
                                  "paidCurrency": {
                                    "type": "string",
                                    "pattern": "^[A-Z]{3}$"
                                  },
                                  "approveBlocked": {
                                    "type": [
                                      "string",
                                      "null"
                                    ]
                                  }
                                },
                                "required": [
                                  "id",
                                  "method",
                                  "settledOn",
                                  "recordedBy",
                                  "recordedAt",
                                  "account",
                                  "paidAmountMinor",
                                  "paidCurrency",
                                  "approveBlocked"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "vendorSlipKind": {
                            "anyOf": [
                              {
                                "type": "string",
                                "enum": [
                                  "T4A",
                                  "T5018",
                                  "T4A_NR"
                                ]
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "neverInRun": {
                            "type": "boolean"
                          },
                          "approvedOn": {
                            "anyOf": [
                              {
                                "type": "string",
                                "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "approvedBy": {
                            "anyOf": [
                              {
                                "type": "object",
                                "properties": {
                                  "id": {
                                    "type": "string"
                                  },
                                  "name": {
                                    "type": "string"
                                  }
                                },
                                "required": [
                                  "id",
                                  "name"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "priorMethods": {
                            "$ref": "#/components/schemas/PriorMethods"
                          },
                          "stillOwedConfirmedAt": {
                            "anyOf": [
                              {
                                "type": "string",
                                "minLength": 20
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "totalMinor": {
                            "type": "string",
                            "pattern": "^-?\\d+$"
                          },
                          "shortPaid": {
                            "anyOf": [
                              {
                                "type": "object",
                                "properties": {
                                  "runId": {
                                    "type": [
                                      "string",
                                      "null"
                                    ]
                                  },
                                  "settledOn": {
                                    "type": "string",
                                    "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                                  },
                                  "reason": {
                                    "type": "string"
                                  }
                                },
                                "required": [
                                  "runId",
                                  "settledOn",
                                  "reason"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "discount": {
                            "anyOf": [
                              {
                                "type": "object",
                                "properties": {
                                  "discountDate": {
                                    "type": "string",
                                    "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                                  },
                                  "amountMinor": {
                                    "type": "string",
                                    "pattern": "^-?\\d+$"
                                  },
                                  "words": {
                                    "type": "string"
                                  },
                                  "open": {
                                    "type": "boolean"
                                  },
                                  "closesInDays": {
                                    "type": "integer",
                                    "minimum": -9007199254740991,
                                    "maximum": 9007199254740991
                                  },
                                  "earlierSettlement": {
                                    "type": "boolean"
                                  },
                                  "terms": {
                                    "anyOf": [
                                      {
                                        "type": "object",
                                        "properties": {
                                          "id": {
                                            "type": "string"
                                          },
                                          "name": {
                                            "type": "string"
                                          }
                                        },
                                        "required": [
                                          "id",
                                          "name"
                                        ],
                                        "additionalProperties": false
                                      },
                                      {
                                        "type": "null"
                                      }
                                    ]
                                  },
                                  "account": {
                                    "anyOf": [
                                      {
                                        "type": "object",
                                        "properties": {
                                          "id": {
                                            "type": "string"
                                          },
                                          "code": {
                                            "type": "string"
                                          },
                                          "name": {
                                            "type": "string"
                                          },
                                          "type": {
                                            "type": "string",
                                            "enum": [
                                              "ASSET",
                                              "LIABILITY",
                                              "EQUITY",
                                              "REVENUE",
                                              "EXPENSE"
                                            ]
                                          }
                                        },
                                        "required": [
                                          "id",
                                          "code",
                                          "name",
                                          "type"
                                        ],
                                        "additionalProperties": false
                                      },
                                      {
                                        "type": "null"
                                      }
                                    ]
                                  }
                                },
                                "required": [
                                  "discountDate",
                                  "amountMinor",
                                  "words",
                                  "open",
                                  "closesInDays",
                                  "earlierSettlement",
                                  "terms",
                                  "account"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "methodPayability": {
                            "type": "object",
                            "properties": {
                              "EFT": {
                                "type": "string",
                                "enum": [
                                  "PAYABLE",
                                  "BILL_HELD",
                                  "NO_VENDOR",
                                  "VENDOR_ARCHIVED",
                                  "VENDOR_HELD",
                                  "VENDOR_NOT_ACCEPTED",
                                  "NO_BANKING",
                                  "BANKING_PENDING",
                                  "BANKING_RETURNED",
                                  "BANKING_FOREIGN",
                                  "IN_RUN"
                                ]
                              },
                              "CHEQUE": {
                                "type": "string",
                                "enum": [
                                  "PAYABLE",
                                  "BILL_HELD",
                                  "NO_VENDOR",
                                  "VENDOR_ARCHIVED",
                                  "VENDOR_HELD",
                                  "VENDOR_NOT_ACCEPTED",
                                  "NO_BANKING",
                                  "BANKING_PENDING",
                                  "BANKING_RETURNED",
                                  "BANKING_FOREIGN",
                                  "IN_RUN"
                                ]
                              },
                              "WIRE": {
                                "type": "string",
                                "enum": [
                                  "PAYABLE",
                                  "BILL_HELD",
                                  "NO_VENDOR",
                                  "VENDOR_ARCHIVED",
                                  "VENDOR_HELD",
                                  "VENDOR_NOT_ACCEPTED",
                                  "NO_BANKING",
                                  "BANKING_PENDING",
                                  "BANKING_RETURNED",
                                  "BANKING_FOREIGN",
                                  "IN_RUN"
                                ]
                              }
                            },
                            "required": [
                              "EFT",
                              "CHEQUE",
                              "WIRE"
                            ],
                            "additionalProperties": false
                          },
                          "feedCandidate": {
                            "$ref": "#/components/schemas/FeedCandidate"
                          },
                          "duplicateSignal": {
                            "$ref": "#/components/schemas/Stored"
                          },
                          "openCredit": {
                            "anyOf": [
                              {
                                "type": "object",
                                "properties": {
                                  "remainingMinor": {
                                    "type": "string",
                                    "pattern": "^-?\\d+$"
                                  },
                                  "credits": {
                                    "type": "integer",
                                    "minimum": 1,
                                    "maximum": 9007199254740991
                                  }
                                },
                                "required": [
                                  "remainingMinor",
                                  "credits"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "vendorPaper": {
                            "anyOf": [
                              {
                                "type": "object",
                                "properties": {
                                  "rollup": {
                                    "type": "string",
                                    "enum": [
                                      "NONE_REQUIRED",
                                      "CURRENT",
                                      "EXPIRING",
                                      "NOT_CURRENT"
                                    ]
                                  },
                                  "gaps": {
                                    "maxItems": 3,
                                    "type": "array",
                                    "items": {
                                      "type": "object",
                                      "properties": {
                                        "kind": {
                                          "type": "string",
                                          "enum": [
                                            "WSIB_CLEARANCE",
                                            "INSURANCE_CERTIFICATE",
                                            "MASTER_AGREEMENT",
                                            "W8BEN",
                                            "DIRECT_DEPOSIT_FORM",
                                            "WITHHOLDING_WAIVER",
                                            "OTHER"
                                          ]
                                        },
                                        "state": {
                                          "type": "string",
                                          "enum": [
                                            "CURRENT",
                                            "EXPIRING",
                                            "LAPSED",
                                            "MISSING"
                                          ]
                                        },
                                        "validUntil": {
                                          "anyOf": [
                                            {
                                              "type": "string",
                                              "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                                            },
                                            {
                                              "type": "null"
                                            }
                                          ]
                                        }
                                      },
                                      "required": [
                                        "kind",
                                        "state",
                                        "validUntil"
                                      ],
                                      "additionalProperties": false
                                    }
                                  },
                                  "more": {
                                    "type": "integer",
                                    "minimum": 0,
                                    "maximum": 9007199254740991
                                  }
                                },
                                "required": [
                                  "rollup",
                                  "gaps",
                                  "more"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "withholding": {
                            "type": "object",
                            "properties": {
                              "state": {
                                "type": "string",
                                "enum": [
                                  "NOT_APPLICABLE",
                                  "RESIDENCY_UNSTATED",
                                  "UNDECIDED",
                                  "NO_SERVICE_IN_CANADA",
                                  "WITHHOLDS",
                                  "WAIVED"
                                ]
                              },
                              "undecidedLines": {
                                "type": "integer",
                                "minimum": 0,
                                "maximum": 9007199254740991
                              },
                              "markedNetMinor": {
                                "type": "string",
                                "pattern": "^-?\\d+$"
                              },
                              "billTotalMinor": {
                                "type": "string",
                                "pattern": "^-?\\d+$"
                              },
                              "rateBp": {
                                "type": "integer",
                                "minimum": -9007199254740991,
                                "maximum": 9007199254740991
                              },
                              "waiver": {
                                "$ref": "#/components/schemas/Waiver"
                              }
                            },
                            "required": [
                              "state",
                              "undecidedLines",
                              "markedNetMinor",
                              "billTotalMinor",
                              "rateBp",
                              "waiver"
                            ],
                            "additionalProperties": false
                          },
                          "holdback": {
                            "anyOf": [
                              {
                                "type": "object",
                                "properties": {
                                  "state": {
                                    "type": "string",
                                    "enum": [
                                      "NONE",
                                      "RETAINED",
                                      "RELEASE_DUE",
                                      "RELEASE_DRAFTED",
                                      "PART_RELEASED",
                                      "RELEASED",
                                      "IS_RELEASE"
                                    ]
                                  },
                                  "retainedMinor": {
                                    "type": "string",
                                    "pattern": "^-?\\d+$"
                                  },
                                  "releasedMinor": {
                                    "type": "string",
                                    "pattern": "^-?\\d+$"
                                  },
                                  "remainingMinor": {
                                    "type": "string",
                                    "pattern": "^-?\\d+$"
                                  },
                                  "releaseOn": {
                                    "anyOf": [
                                      {
                                        "type": "string",
                                        "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                                      },
                                      {
                                        "type": "null"
                                      }
                                    ]
                                  },
                                  "parent": {
                                    "anyOf": [
                                      {
                                        "type": "object",
                                        "properties": {
                                          "billId": {
                                            "type": "string"
                                          },
                                          "number": {
                                            "type": [
                                              "string",
                                              "null"
                                            ]
                                          }
                                        },
                                        "required": [
                                          "billId",
                                          "number"
                                        ],
                                        "additionalProperties": false
                                      },
                                      {
                                        "type": "null"
                                      }
                                    ]
                                  }
                                },
                                "required": [
                                  "state",
                                  "retainedMinor",
                                  "releasedMinor",
                                  "remainingMinor",
                                  "releaseOn",
                                  "parent"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "plan": {
                            "$ref": "#/components/schemas/Plan"
                          },
                          "stake": {
                            "type": "object",
                            "properties": {
                              "tier": {
                                "anyOf": [
                                  {
                                    "type": "number",
                                    "const": 1
                                  },
                                  {
                                    "type": "number",
                                    "const": 2
                                  },
                                  {
                                    "type": "number",
                                    "const": 3
                                  }
                                ]
                              },
                              "reason": {
                                "type": "string",
                                "enum": [
                                  "DISCOUNT_LAPSES",
                                  "INTEREST_RUNNING",
                                  "PAST_DUE",
                                  "DUE"
                                ]
                              },
                              "closesInDays": {
                                "anyOf": [
                                  {
                                    "type": "integer",
                                    "minimum": -9007199254740991,
                                    "maximum": 9007199254740991
                                  },
                                  {
                                    "type": "null"
                                  }
                                ]
                              },
                              "discountMinor": {
                                "anyOf": [
                                  {
                                    "type": "string",
                                    "pattern": "^-?\\d+$"
                                  },
                                  {
                                    "type": "null"
                                  }
                                ]
                              },
                              "discountBp": {
                                "anyOf": [
                                  {
                                    "type": "integer",
                                    "minimum": -9007199254740991,
                                    "maximum": 9007199254740991
                                  },
                                  {
                                    "type": "null"
                                  }
                                ]
                              },
                              "interest": {
                                "anyOf": [
                                  {
                                    "type": "object",
                                    "properties": {
                                      "monthlyBp": {
                                        "type": "integer",
                                        "minimum": -9007199254740991,
                                        "maximum": 9007199254740991
                                      },
                                      "annualBp": {
                                        "type": "integer",
                                        "minimum": -9007199254740991,
                                        "maximum": 9007199254740991
                                      },
                                      "perDayMinor": {
                                        "type": "string",
                                        "pattern": "^-?\\d+$"
                                      }
                                    },
                                    "required": [
                                      "monthlyBp",
                                      "annualBp",
                                      "perDayMinor"
                                    ],
                                    "additionalProperties": false
                                  },
                                  {
                                    "type": "null"
                                  }
                                ]
                              }
                            },
                            "required": [
                              "tier",
                              "reason",
                              "closesInDays",
                              "discountMinor",
                              "discountBp",
                              "interest"
                            ],
                            "additionalProperties": false
                          }
                        },
                        "required": [
                          "billId",
                          "extractionId",
                          "documentId",
                          "entityId",
                          "entityName",
                          "supplierName",
                          "vendor",
                          "invoiceNumber",
                          "invoiceDate",
                          "dueDate",
                          "overdueDays",
                          "currency",
                          "amountMinor",
                          "entryId",
                          "entryNumber",
                          "payability",
                          "inRun",
                          "hold",
                          "paidBy",
                          "pendingSettlement",
                          "vendorSlipKind",
                          "neverInRun",
                          "approvedOn",
                          "approvedBy",
                          "priorMethods",
                          "stillOwedConfirmedAt",
                          "totalMinor",
                          "shortPaid",
                          "discount",
                          "methodPayability",
                          "feedCandidate",
                          "duplicateSignal",
                          "openCredit",
                          "vendorPaper",
                          "withholding",
                          "holdback",
                          "plan",
                          "stake"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "nextCursor": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "total": {
                      "anyOf": [
                        {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "exchangeDifferences": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "entityId": {
                            "type": "string"
                          },
                          "entityName": {
                            "type": "string"
                          },
                          "currency": {
                            "type": "string",
                            "pattern": "^[A-Z]{3}$"
                          },
                          "accountNominated": {
                            "type": "boolean"
                          },
                          "unclearedMinor": {
                            "type": "string",
                            "pattern": "^-?\\d+$"
                          }
                        },
                        "required": [
                          "entityId",
                          "entityName",
                          "currency",
                          "accountNominated",
                          "unclearedMinor"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "totals": {
                      "$ref": "#/components/schemas/Totals3"
                    },
                    "tiedOut": {
                      "type": "boolean"
                    },
                    "bankingCallbackWindowDays": {
                      "type": "integer",
                      "minimum": 1,
                      "maximum": 365
                    },
                    "heldCount": {
                      "type": "integer",
                      "minimum": 0,
                      "maximum": 9007199254740991
                    },
                    "viewTotals": {
                      "type": "object",
                      "properties": {
                        "due": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 9007199254740991
                        },
                        "other": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 9007199254740991
                        },
                        "recover": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 9007199254740991
                        }
                      },
                      "required": [
                        "due",
                        "other",
                        "recover"
                      ],
                      "additionalProperties": false
                    },
                    "tieOut": {
                      "$ref": "#/components/schemas/Rows3"
                    },
                    "discountTotals": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "entityId": {
                            "type": "string"
                          },
                          "entityName": {
                            "type": "string"
                          },
                          "currency": {
                            "type": "string",
                            "pattern": "^[A-Z]{3}$"
                          },
                          "bills": {
                            "type": "integer",
                            "minimum": 1,
                            "maximum": 9007199254740991
                          },
                          "discountMinor": {
                            "type": "string",
                            "pattern": "^-?\\d+$"
                          },
                          "firstClosesOn": {
                            "type": "string",
                            "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                          }
                        },
                        "required": [
                          "entityId",
                          "entityName",
                          "currency",
                          "bills",
                          "discountMinor",
                          "firstClosesOn"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "feedTruncated": {
                      "type": "boolean"
                    },
                    "heldBack": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "entityId": {
                            "type": "string"
                          },
                          "currency": {
                            "type": "string",
                            "pattern": "^[A-Z]{3}$"
                          },
                          "remainingMinor": {
                            "type": "string",
                            "pattern": "^-?\\d+$"
                          }
                        },
                        "required": [
                          "entityId",
                          "currency",
                          "remainingMinor"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "bridge": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "entityId": {
                            "type": "string"
                          },
                          "entityName": {
                            "type": "string"
                          },
                          "currency": {
                            "type": "string",
                            "pattern": "^[A-Z]{3}$"
                          },
                          "queueMinor": {
                            "type": "string",
                            "pattern": "^-?\\d+$"
                          },
                          "heldMinor": {
                            "type": "string",
                            "pattern": "^-?\\d+$"
                          },
                          "paidAnotherWayMinor": {
                            "type": "string",
                            "pattern": "^-?\\d+$"
                          },
                          "billsElsewhereMinor": {
                            "type": "string",
                            "pattern": "^-?\\d+$"
                          },
                          "unappliedCreditMinor": {
                            "type": "string",
                            "pattern": "^-?\\d+$"
                          },
                          "settlementResidualMinor": {
                            "type": "string",
                            "pattern": "^-?\\d+$"
                          },
                          "unexplainedMinor": {
                            "type": "string",
                            "pattern": "^-?\\d+$"
                          },
                          "controlMinor": {
                            "type": "string",
                            "pattern": "^-?\\d+$"
                          }
                        },
                        "required": [
                          "entityId",
                          "entityName",
                          "currency",
                          "queueMinor",
                          "heldMinor",
                          "paidAnotherWayMinor",
                          "billsElsewhereMinor",
                          "unappliedCreditMinor",
                          "settlementResidualMinor",
                          "unexplainedMinor",
                          "controlMinor"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "planBand": {
                      "type": "object",
                      "properties": {
                        "companies": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "entityId": {
                                "type": "string"
                              },
                              "entityName": {
                                "type": "string"
                              },
                              "today": {
                                "type": "string",
                                "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                              }
                            },
                            "required": [
                              "entityId",
                              "entityName",
                              "today"
                            ],
                            "additionalProperties": false
                          }
                        },
                        "days": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "entityId": {
                                "type": "string"
                              },
                              "currency": {
                                "type": "string",
                                "pattern": "^[A-Z]{3}$"
                              },
                              "on": {
                                "type": "string",
                                "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                              },
                              "bills": {
                                "type": "integer",
                                "minimum": 0,
                                "maximum": 9007199254740991
                              },
                              "openMinor": {
                                "type": "string",
                                "pattern": "^-?\\d+$"
                              }
                            },
                            "required": [
                              "entityId",
                              "currency",
                              "on",
                              "bills",
                              "openMinor"
                            ],
                            "additionalProperties": false
                          }
                        },
                        "later": {
                          "$ref": "#/components/schemas/Later"
                        },
                        "slipped": {
                          "$ref": "#/components/schemas/Later"
                        },
                        "unplanned": {
                          "$ref": "#/components/schemas/Later"
                        },
                        "held": {
                          "$ref": "#/components/schemas/Later"
                        }
                      },
                      "required": [
                        "companies",
                        "days",
                        "later",
                        "slipped",
                        "unplanned",
                        "held"
                      ],
                      "additionalProperties": false
                    },
                    "cash": {
                      "maxItems": 5,
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "entityId": {
                            "type": "string"
                          },
                          "entityName": {
                            "type": "string"
                          },
                          "entityTimeZone": {
                            "type": "string"
                          },
                          "state": {
                            "type": "string",
                            "enum": [
                              "OK",
                              "NO_ACCOUNT",
                              "NO_BALANCE"
                            ]
                          },
                          "account": {
                            "anyOf": [
                              {
                                "$ref": "#/components/schemas/AccountOption1"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "source": {
                            "anyOf": [
                              {
                                "type": "string",
                                "enum": [
                                  "NOMINATED",
                                  "LAST_RUN",
                                  "CHOSEN"
                                ]
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "runway": {
                            "anyOf": [
                              {
                                "$ref": "#/components/schemas/RunwayOption1"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "otherCurrencies": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "properties": {
                                "currency": {
                                  "type": "string",
                                  "pattern": "^[A-Z]{3}$"
                                },
                                "bills": {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 9007199254740991
                                }
                              },
                              "required": [
                                "currency",
                                "bills"
                              ],
                              "additionalProperties": false
                            }
                          },
                          "lastPlan": {
                            "anyOf": [
                              {
                                "type": "object",
                                "properties": {
                                  "id": {
                                    "type": "string"
                                  },
                                  "state": {
                                    "type": "string",
                                    "enum": [
                                      "PROPOSED",
                                      "APPLIED",
                                      "DISCARDED"
                                    ]
                                  },
                                  "decidedAt": {
                                    "anyOf": [
                                      {
                                        "type": "string",
                                        "minLength": 20
                                      },
                                      {
                                        "type": "null"
                                      }
                                    ]
                                  },
                                  "decidedBy": {
                                    "anyOf": [
                                      {
                                        "type": "object",
                                        "properties": {
                                          "id": {
                                            "type": "string"
                                          },
                                          "name": {
                                            "type": "string"
                                          }
                                        },
                                        "required": [
                                          "id",
                                          "name"
                                        ],
                                        "additionalProperties": false
                                      },
                                      {
                                        "type": "null"
                                      }
                                    ]
                                  },
                                  "applied": {
                                    "type": "integer",
                                    "minimum": 0,
                                    "maximum": 9007199254740991
                                  },
                                  "changed": {
                                    "type": "integer",
                                    "minimum": 0,
                                    "maximum": 9007199254740991
                                  },
                                  "declined": {
                                    "type": "integer",
                                    "minimum": 0,
                                    "maximum": 9007199254740991
                                  }
                                },
                                "required": [
                                  "id",
                                  "state",
                                  "decidedAt",
                                  "decidedBy",
                                  "applied",
                                  "changed",
                                  "declined"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "null"
                              }
                            ]
                          }
                        },
                        "required": [
                          "entityId",
                          "entityName",
                          "entityTimeZone",
                          "state",
                          "account",
                          "source",
                          "runway",
                          "otherCurrencies",
                          "lastPlan"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "stakeCaption": {
                      "type": [
                        "string",
                        "null"
                      ]
                    }
                  },
                  "required": [
                    "data",
                    "nextCursor",
                    "total",
                    "exchangeDifferences",
                    "totals",
                    "tiedOut",
                    "bankingCallbackWindowDays",
                    "heldCount",
                    "viewTotals",
                    "tieOut",
                    "discountTotals",
                    "feedTruncated",
                    "heldBack",
                    "planBand",
                    "cash",
                    "stakeCaption"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "422": {
            "$ref": "#/components/responses/Problem422"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      }
    },
    "/v1/bills/bulk/add-to-run": {
      "post": {
        "operationId": "bulkAddBillsToRun",
        "summary": "Previews adding several bills to one payment run and saves nothing.",
        "description": "Previews adding several bills to one payment run and saves nothing. Needs the `ledger:propose` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "purchases"
        ],
        "x-stability-level": "beta",
        "x-eternify-read": true,
        "x-scope": "ledger:propose",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BulkHoldVendorPaymentsRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BulkHoldVendorPaymentsResponse"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "422": {
            "$ref": "#/components/responses/Problem422"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      }
    },
    "/v1/bills/bulk/approve": {
      "post": {
        "operationId": "bulkApproveBills",
        "summary": "Approves several bills in one request, each checked on its own.",
        "description": "Approves several bills in one request, each checked on its own. Needs the `ledger:approve` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "purchases"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:approve",
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BulkHoldVendorPaymentsRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "Ledger-Position": {
                "$ref": "#/components/headers/LedgerPosition"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BulkHoldVendorPaymentsResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem400"
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "409": {
            "$ref": "#/components/responses/Problem409"
          },
          "412": {
            "$ref": "#/components/responses/Problem412"
          },
          "422": {
            "$ref": "#/components/responses/Problem422"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      }
    },
    "/v1/bills/bulk/hold": {
      "post": {
        "operationId": "bulkHoldBills",
        "summary": "Puts several bills on hold in one request.",
        "description": "Puts several bills on hold in one request. Needs the `ledger:approve` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "purchases"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:approve",
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BulkHoldVendorPaymentsRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "Ledger-Position": {
                "$ref": "#/components/headers/LedgerPosition"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BulkHoldVendorPaymentsResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem400"
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "409": {
            "$ref": "#/components/responses/Problem409"
          },
          "412": {
            "$ref": "#/components/responses/Problem412"
          },
          "422": {
            "$ref": "#/components/responses/Problem422"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      }
    },
    "/v1/bills/bulk/plan": {
      "post": {
        "operationId": "bulkPlanBills",
        "summary": "Sets the payment plan for several bills in one request.",
        "description": "Sets the payment plan for several bills in one request. Needs the `ledger:propose` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "purchases"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:propose",
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BulkHoldVendorPaymentsRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "Ledger-Position": {
                "$ref": "#/components/headers/LedgerPosition"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BulkHoldVendorPaymentsResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem400"
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "409": {
            "$ref": "#/components/responses/Problem409"
          },
          "412": {
            "$ref": "#/components/responses/Problem412"
          },
          "422": {
            "$ref": "#/components/responses/Problem422"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      }
    },
    "/v1/bills/bulk/plan/clear": {
      "post": {
        "operationId": "bulkClearBillPlans",
        "summary": "Clears the payment plans of several bills in one request.",
        "description": "Clears the payment plans of several bills in one request. Needs the `ledger:propose` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "purchases"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:propose",
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BulkHoldVendorPaymentsRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "Ledger-Position": {
                "$ref": "#/components/headers/LedgerPosition"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BulkHoldVendorPaymentsResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem400"
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "409": {
            "$ref": "#/components/responses/Problem409"
          },
          "412": {
            "$ref": "#/components/responses/Problem412"
          },
          "422": {
            "$ref": "#/components/responses/Problem422"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      }
    },
    "/v1/bills/bulk/release-hold": {
      "post": {
        "operationId": "bulkReleaseBillHolds",
        "summary": "Releases the holds on several bills in one request.",
        "description": "Releases the holds on several bills in one request. Needs the `ledger:approve` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "purchases"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:approve",
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BulkHoldVendorPaymentsRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "Ledger-Position": {
                "$ref": "#/components/headers/LedgerPosition"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BulkHoldVendorPaymentsResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem400"
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "409": {
            "$ref": "#/components/responses/Problem409"
          },
          "412": {
            "$ref": "#/components/responses/Problem412"
          },
          "422": {
            "$ref": "#/components/responses/Problem422"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      }
    },
    "/v1/bills/bulk/submit": {
      "post": {
        "operationId": "bulkSubmitBills",
        "summary": "Submits several bills for approval in one request.",
        "description": "Submits several bills for approval in one request. Needs the `ledger:propose` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "purchases"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:propose",
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BulkHoldVendorPaymentsRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "Ledger-Position": {
                "$ref": "#/components/headers/LedgerPosition"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BulkHoldVendorPaymentsResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem400"
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "409": {
            "$ref": "#/components/responses/Problem409"
          },
          "412": {
            "$ref": "#/components/responses/Problem412"
          },
          "422": {
            "$ref": "#/components/responses/Problem422"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      }
    },
    "/v1/bills/dimension-proposals": {
      "post": {
        "operationId": "proposeBillDimensions",
        "summary": "Suggests the dimensions a bill's lines belong to and saves nothing.",
        "description": "Suggests the dimensions a bill's lines belong to and saves nothing. Needs the `ledger:propose` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "purchases"
        ],
        "x-stability-level": "beta",
        "x-eternify-read": true,
        "x-scope": "ledger:propose",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "entityId": {
                    "type": "string",
                    "minLength": 1
                  },
                  "vendorId": {
                    "type": "string",
                    "minLength": 1
                  },
                  "lines": {
                    "minItems": 1,
                    "maxItems": 100,
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "key": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 40
                        },
                        "accountId": {
                          "type": "string",
                          "minLength": 1
                        },
                        "description": {
                          "type": "string",
                          "maxLength": 500
                        },
                        "taggedTypeIds": {
                          "maxItems": 20,
                          "type": "array",
                          "items": {
                            "type": "string",
                            "minLength": 1
                          }
                        }
                      },
                      "required": [
                        "key",
                        "accountId",
                        "description",
                        "taggedTypeIds"
                      ],
                      "additionalProperties": false
                    }
                  }
                },
                "required": [
                  "entityId",
                  "vendorId",
                  "lines"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "proposals": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "lineKey": {
                            "type": "string"
                          },
                          "dimensionTypeId": {
                            "type": "string"
                          },
                          "typeLabel": {
                            "type": "string"
                          },
                          "dimensionValueId": {
                            "type": "string"
                          },
                          "valueCode": {
                            "type": "string"
                          },
                          "valueName": {
                            "type": "string"
                          },
                          "basis": {
                            "type": "string",
                            "enum": [
                              "HISTORY",
                              "MODEL"
                            ]
                          },
                          "evidence": {
                            "anyOf": [
                              {
                                "type": "object",
                                "properties": {
                                  "agreeing": {
                                    "type": "integer",
                                    "minimum": 1,
                                    "maximum": 9007199254740991
                                  },
                                  "window": {
                                    "type": "integer",
                                    "minimum": 1,
                                    "maximum": 5
                                  },
                                  "bills": {
                                    "maxItems": 5,
                                    "type": "array",
                                    "items": {
                                      "type": "object",
                                      "properties": {
                                        "billId": {
                                          "type": "string"
                                        },
                                        "number": {
                                          "type": [
                                            "string",
                                            "null"
                                          ]
                                        },
                                        "billDate": {
                                          "type": "string",
                                          "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                                        }
                                      },
                                      "required": [
                                        "billId",
                                        "number",
                                        "billDate"
                                      ],
                                      "additionalProperties": false
                                    }
                                  }
                                },
                                "required": [
                                  "agreeing",
                                  "window",
                                  "bills"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "null"
                              }
                            ]
                          }
                        },
                        "required": [
                          "lineKey",
                          "dimensionTypeId",
                          "typeLabel",
                          "dimensionValueId",
                          "valueCode",
                          "valueName",
                          "basis",
                          "evidence"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "hiddenAfterDecline": {
                      "type": "integer",
                      "minimum": 0,
                      "maximum": 9007199254740991
                    },
                    "modelWhy": {
                      "anyOf": [
                        {
                          "type": "string",
                          "enum": [
                            "DISCLOSURE",
                            "BUDGET",
                            "PROVIDER",
                            "UNPARSABLE",
                            "REFUSED",
                            "UNKNOWN_REF",
                            "STOPPED_AFTER_THREE_DECLINES"
                          ]
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "modelLinesLeftOut": {
                      "type": "integer",
                      "minimum": 0,
                      "maximum": 9007199254740991
                    },
                    "skippedTypes": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "dimensionTypeId": {
                            "type": "string"
                          },
                          "typeLabel": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "dimensionTypeId",
                          "typeLabel"
                        ],
                        "additionalProperties": false
                      }
                    }
                  },
                  "required": [
                    "proposals",
                    "hiddenAfterDecline",
                    "modelWhy",
                    "modelLinesLeftOut",
                    "skippedTypes"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "422": {
            "$ref": "#/components/responses/Problem422"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      }
    },
    "/v1/bills/dimension-proposals/decline": {
      "post": {
        "operationId": "declineBillDimensionProposal",
        "summary": "Declines a proposal of dimensions for a bill.",
        "description": "Declines a proposal of dimensions for a bill. Needs the `ledger:propose` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "purchases"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:propose",
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "vendorId": {
                    "type": "string",
                    "minLength": 1
                  },
                  "accountId": {
                    "type": "string",
                    "minLength": 1
                  },
                  "dimensionTypeId": {
                    "type": "string",
                    "minLength": 1
                  },
                  "dimensionValueId": {
                    "type": "string",
                    "minLength": 1
                  },
                  "basis": {
                    "type": "string",
                    "enum": [
                      "HISTORY",
                      "MODEL"
                    ]
                  },
                  "replacedByValueId": {
                    "type": "string",
                    "minLength": 1
                  }
                },
                "required": [
                  "vendorId",
                  "accountId",
                  "dimensionTypeId",
                  "dimensionValueId",
                  "basis"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "Ledger-Position": {
                "$ref": "#/components/headers/LedgerPosition"
              },
              "Location": {
                "$ref": "#/components/headers/Location"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DeclinePurchaseOrderSuggestionResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem400"
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "409": {
            "$ref": "#/components/responses/Problem409"
          },
          "412": {
            "$ref": "#/components/responses/Problem412"
          },
          "422": {
            "$ref": "#/components/responses/Problem422"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      }
    },
    "/v1/bills/key-check": {
      "get": {
        "operationId": "checkBillKeying",
        "summary": "Checks a bill's keying for duplicates and mistakes before it is saved.",
        "description": "Checks a bill's keying for duplicates and mistakes before it is saved. Needs the `ledger:propose` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "purchases"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:propose",
        "parameters": [
          {
            "name": "entityId",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "vendorId",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "supplierName",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 200
            }
          },
          {
            "name": "number",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 60
            }
          },
          {
            "name": "billDate",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
            }
          },
          {
            "name": "currency",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[A-Z]{3}$"
            }
          },
          {
            "name": "totalMinor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^-?\\d+$"
            }
          },
          {
            "name": "documentId",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "excludeBillId",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ranNumber": {
                      "type": "boolean"
                    },
                    "ranResemblance": {
                      "type": "boolean"
                    },
                    "holders": {
                      "maxItems": 5,
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "billId": {
                            "type": "string"
                          },
                          "supplierName": {
                            "type": "string"
                          },
                          "number": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "billDate": {
                            "type": "string",
                            "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                          },
                          "status": {
                            "type": "string",
                            "enum": [
                              "DRAFT",
                              "IN_REVIEW",
                              "DECLINED",
                              "APPROVED",
                              "HELD",
                              "OPEN",
                              "DUE",
                              "OVERDUE",
                              "IN_RUN",
                              "PARTIALLY_PAID",
                              "PAID",
                              "VOID"
                            ]
                          },
                          "totalMinor": {
                            "type": "string",
                            "pattern": "^-?\\d+$"
                          },
                          "currency": {
                            "type": "string",
                            "pattern": "^[A-Z]{3}$"
                          },
                          "blocksSubmit": {
                            "type": "boolean"
                          },
                          "draftedByYou": {
                            "type": "boolean"
                          },
                          "sentence": {
                            "type": "string",
                            "minLength": 1
                          }
                        },
                        "required": [
                          "billId",
                          "supplierName",
                          "number",
                          "billDate",
                          "status",
                          "totalMinor",
                          "currency",
                          "blocksSubmit",
                          "draftedByYou",
                          "sentence"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "holdersMore": {
                      "type": "integer",
                      "minimum": 0,
                      "maximum": 9007199254740991
                    },
                    "resemblances": {
                      "maxItems": 3,
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "signal": {
                            "type": "string",
                            "enum": [
                              "CONTENT_HASH",
                              "INVOICE_NUMBER",
                              "VENDOR_AMOUNT_WINDOW",
                              "VENDOR_CADENCE",
                              "CODED_FEED_LINE"
                            ]
                          },
                          "severity": {
                            "type": "string",
                            "enum": [
                              "HARD_STOP",
                              "FLAG"
                            ]
                          },
                          "sentence": {
                            "type": "string",
                            "minLength": 1
                          },
                          "bill": {
                            "anyOf": [
                              {
                                "$ref": "#/components/schemas/BillOption1"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          }
                        },
                        "required": [
                          "signal",
                          "severity",
                          "sentence",
                          "bill"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "resemblancesMore": {
                      "type": "integer",
                      "minimum": 0,
                      "maximum": 9007199254740991
                    },
                    "usual": {
                      "anyOf": [
                        {
                          "type": "object",
                          "properties": {
                            "count": {
                              "type": "integer",
                              "minimum": 3,
                              "maximum": 9007199254740991
                            },
                            "lowMinor": {
                              "type": "string",
                              "pattern": "^-?\\d+$"
                            },
                            "highMinor": {
                              "type": "string",
                              "pattern": "^-?\\d+$"
                            },
                            "currency": {
                              "type": "string",
                              "pattern": "^[A-Z]{3}$"
                            }
                          },
                          "required": [
                            "count",
                            "lowMinor",
                            "highMinor",
                            "currency"
                          ],
                          "additionalProperties": false
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  },
                  "required": [
                    "ranNumber",
                    "ranResemblance",
                    "holders",
                    "holdersMore",
                    "resemblances",
                    "resemblancesMore",
                    "usual"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "422": {
            "$ref": "#/components/responses/Problem422"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      }
    },
    "/v1/bills/order-proposals": {
      "post": {
        "operationId": "proposeBillOrders",
        "summary": "Suggests the purchase orders a bill matches and saves nothing.",
        "description": "Suggests the purchase orders a bill matches and saves nothing. Needs the `ledger:propose` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "purchases"
        ],
        "x-stability-level": "beta",
        "x-eternify-read": true,
        "x-scope": "ledger:propose",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "entityId": {
                    "type": "string",
                    "minLength": 1
                  },
                  "vendorId": {
                    "type": "string",
                    "minLength": 1
                  },
                  "currency": {
                    "type": "string",
                    "pattern": "^[A-Z]{3}$"
                  },
                  "billId": {
                    "type": "string",
                    "minLength": 1
                  },
                  "orderReference": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 80
                  },
                  "lines": {
                    "minItems": 1,
                    "maxItems": 100,
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "key": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 40
                        },
                        "description": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 500
                        },
                        "quantity": {
                          "type": "string",
                          "pattern": "^\\d{1,10}(\\.\\d{1,4})?$"
                        },
                        "netMinor": {
                          "type": "string",
                          "pattern": "^-?\\d+$"
                        },
                        "unitPriceMinor": {
                          "type": "string",
                          "pattern": "^-?\\d+$"
                        }
                      },
                      "required": [
                        "key",
                        "description",
                        "quantity",
                        "netMinor"
                      ],
                      "additionalProperties": false
                    }
                  }
                },
                "required": [
                  "entityId",
                  "vendorId",
                  "currency",
                  "lines"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "proposals": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "lineKey": {
                            "type": "string"
                          },
                          "purchaseOrderLineId": {
                            "type": "string"
                          },
                          "orderId": {
                            "type": "string"
                          },
                          "orderNumber": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "orderLinePosition": {
                            "type": "integer",
                            "minimum": 0,
                            "maximum": 9007199254740991
                          },
                          "description": {
                            "type": "string"
                          },
                          "basis": {
                            "type": "string",
                            "enum": [
                              "DOCUMENT_NUMBER",
                              "SUPPLIER_ITEM",
                              "PRICE_AND_QUANTITY",
                              "MODEL"
                            ]
                          },
                          "evidence": {
                            "type": "object",
                            "properties": {
                              "orderQuantity": {
                                "type": "string",
                                "pattern": "^\\d{1,10}(\\.\\d{1,4})?$"
                              },
                              "billedElsewhere": {
                                "type": "string",
                                "pattern": "^\\d{1,10}(\\.\\d{1,4})?$"
                              },
                              "receivedQuantity": {
                                "anyOf": [
                                  {
                                    "type": "string",
                                    "pattern": "^\\d{1,10}(\\.\\d{1,4})?$"
                                  },
                                  {
                                    "type": "null"
                                  }
                                ]
                              },
                              "unitPriceMinor": {
                                "type": "string",
                                "pattern": "^-?\\d+$"
                              },
                              "currency": {
                                "type": "string",
                                "pattern": "^[A-Z]{3}$"
                              },
                              "descriptionScore": {
                                "type": "integer",
                                "minimum": 0,
                                "maximum": 100
                              },
                              "orderReference": {
                                "type": [
                                  "string",
                                  "null"
                                ]
                              }
                            },
                            "required": [
                              "orderQuantity",
                              "billedElsewhere",
                              "receivedQuantity",
                              "unitPriceMinor",
                              "currency",
                              "descriptionScore",
                              "orderReference"
                            ],
                            "additionalProperties": false
                          }
                        },
                        "required": [
                          "lineKey",
                          "purchaseOrderLineId",
                          "orderId",
                          "orderNumber",
                          "orderLinePosition",
                          "description",
                          "basis",
                          "evidence"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "hiddenAfterDecline": {
                      "type": "integer",
                      "minimum": 0,
                      "maximum": 9007199254740991
                    },
                    "referenceFound": {
                      "anyOf": [
                        {
                          "type": "object",
                          "properties": {
                            "text": {
                              "type": "string"
                            },
                            "found": {
                              "type": "boolean"
                            },
                            "orderNumber": {
                              "type": [
                                "string",
                                "null"
                              ]
                            }
                          },
                          "required": [
                            "text",
                            "found",
                            "orderNumber"
                          ],
                          "additionalProperties": false
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "modelWhy": {
                      "anyOf": [
                        {
                          "type": "string",
                          "enum": [
                            "DISCLOSURE",
                            "PROVIDER",
                            "BUDGET",
                            "REFUSED",
                            "UNPARSABLE",
                            "UNKNOWN_REF",
                            "STOPPED_AFTER_THREE_DECLINES",
                            "NOTHING_TO_READ",
                            "TOO_MANY_LINES"
                          ]
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "modelLinesLeftOut": {
                      "type": "integer",
                      "minimum": 0,
                      "maximum": 9007199254740991
                    }
                  },
                  "required": [
                    "proposals",
                    "hiddenAfterDecline",
                    "referenceFound",
                    "modelWhy",
                    "modelLinesLeftOut"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "422": {
            "$ref": "#/components/responses/Problem422"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      }
    },
    "/v1/bills/order-proposals/decline": {
      "post": {
        "operationId": "declineBillOrderProposal",
        "summary": "Declines a proposed purchase order match for a bill.",
        "description": "Declines a proposed purchase order match for a bill. Needs the `ledger:propose` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "purchases"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:propose",
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "entityId": {
                    "type": "string",
                    "minLength": 1
                  },
                  "vendorId": {
                    "type": "string",
                    "minLength": 1
                  },
                  "purchaseOrderLineId": {
                    "type": "string",
                    "minLength": 1
                  },
                  "basis": {
                    "type": "string",
                    "enum": [
                      "DOCUMENT_NUMBER",
                      "SUPPLIER_ITEM",
                      "PRICE_AND_QUANTITY",
                      "MODEL"
                    ]
                  },
                  "orderReference": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 80
                  }
                },
                "required": [
                  "entityId",
                  "vendorId",
                  "purchaseOrderLineId",
                  "basis"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "Ledger-Position": {
                "$ref": "#/components/headers/LedgerPosition"
              },
              "Location": {
                "$ref": "#/components/headers/Location"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DeclinePurchaseOrderSuggestionResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem400"
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "409": {
            "$ref": "#/components/responses/Problem409"
          },
          "412": {
            "$ref": "#/components/responses/Problem412"
          },
          "422": {
            "$ref": "#/components/responses/Problem422"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      }
    },
    "/v1/bills/preview": {
      "post": {
        "operationId": "previewBill",
        "summary": "Previews how a bill will post before it is saved.",
        "description": "Previews how a bill will post before it is saved. Needs the `ledger:read` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "purchases"
        ],
        "x-stability-level": "beta",
        "x-eternify-read": true,
        "x-scope": "ledger:read",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "entityId": {
                    "type": "string",
                    "minLength": 1
                  },
                  "vendorId": {
                    "anyOf": [
                      {
                        "type": "string",
                        "minLength": 1
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "supplierName": {
                    "type": "string",
                    "maxLength": 200
                  },
                  "supplierRegistrationNumber": {
                    "anyOf": [
                      {
                        "type": "string",
                        "pattern": "^\\d{9}RT\\d{4}$"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "number": {
                    "anyOf": [
                      {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 60
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "billDate": {
                    "type": "string",
                    "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                  },
                  "dueDate": {
                    "type": "string",
                    "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                  },
                  "currency": {
                    "type": "string",
                    "pattern": "^[A-Z]{3}$"
                  },
                  "memo": {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 500
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "deliveryRegion": {
                    "anyOf": [
                      {
                        "type": "string",
                        "pattern": "^(CA|US)-[A-Z]{2}$"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "lines": {
                    "$ref": "#/components/schemas/Lines3"
                  },
                  "billId": {
                    "type": "string",
                    "minLength": 1
                  }
                },
                "required": [
                  "entityId",
                  "billDate",
                  "lines"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "currency": {
                      "type": "string",
                      "pattern": "^[A-Z]{3}$"
                    },
                    "functionalCurrency": {
                      "type": "string",
                      "pattern": "^[A-Z]{3}$"
                    },
                    "subtotalMinor": {
                      "type": "string",
                      "pattern": "^-?\\d+$"
                    },
                    "taxMinor": {
                      "type": "string",
                      "pattern": "^-?\\d+$"
                    },
                    "totalMinor": {
                      "type": "string",
                      "pattern": "^-?\\d+$"
                    },
                    "dueDate": {
                      "type": "string",
                      "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                    },
                    "delivery": {
                      "type": "object",
                      "properties": {
                        "region": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "why": {
                          "type": [
                            "string",
                            "null"
                          ]
                        }
                      },
                      "required": [
                        "region",
                        "why"
                      ],
                      "additionalProperties": false
                    },
                    "lines": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "position": {
                            "type": "integer",
                            "minimum": 0,
                            "maximum": 9007199254740991
                          },
                          "netMinor": {
                            "type": "string",
                            "pattern": "^-?\\d+$"
                          },
                          "taxMinor": {
                            "type": "string",
                            "pattern": "^-?\\d+$"
                          },
                          "recoverableMinor": {
                            "type": "string",
                            "pattern": "^-?\\d+$"
                          },
                          "treatment": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "placeOfSupply": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "taxName": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "unresolved": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "overrideReason": {
                            "type": [
                              "string",
                              "null"
                            ]
                          }
                        },
                        "required": [
                          "position",
                          "netMinor",
                          "taxMinor",
                          "recoverableMinor",
                          "treatment",
                          "placeOfSupply",
                          "taxName",
                          "unresolved",
                          "overrideReason"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "taxComparison": {
                      "anyOf": [
                        {
                          "type": "object",
                          "properties": {
                            "chargedMinor": {
                              "type": "string",
                              "pattern": "^-?\\d+$"
                            },
                            "determinedMinor": {
                              "type": "string",
                              "pattern": "^-?\\d+$"
                            },
                            "agrees": {
                              "type": "boolean"
                            },
                            "applied": {
                              "type": "boolean"
                            }
                          },
                          "required": [
                            "chargedMinor",
                            "determinedMinor",
                            "agrees",
                            "applied"
                          ],
                          "additionalProperties": false
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "fx": {
                      "anyOf": [
                        {
                          "type": "object",
                          "properties": {
                            "rate": {
                              "type": "string"
                            },
                            "rateDate": {
                              "type": "string",
                              "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                            },
                            "source": {
                              "type": "string"
                            }
                          },
                          "required": [
                            "rate",
                            "rateDate",
                            "source"
                          ],
                          "additionalProperties": false
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "findings": {
                      "$ref": "#/components/schemas/Findings2"
                    },
                    "submittable": {
                      "type": "boolean"
                    },
                    "conversion": {
                      "$ref": "#/components/schemas/Conversion"
                    },
                    "holdback": {
                      "anyOf": [
                        {
                          "type": "object",
                          "properties": {
                            "grossMinor": {
                              "type": "string",
                              "pattern": "^-?\\d+$"
                            },
                            "retainedMinor": {
                              "type": "string",
                              "pattern": "^-?\\d+$"
                            },
                            "dueNowSubtotalMinor": {
                              "type": "string",
                              "pattern": "^-?\\d+$"
                            },
                            "creditNowMinor": {
                              "type": "string",
                              "pattern": "^-?\\d+$"
                            },
                            "waitingNote": {
                              "type": "string"
                            }
                          },
                          "required": [
                            "grossMinor",
                            "retainedMinor",
                            "dueNowSubtotalMinor",
                            "creditNowMinor",
                            "waitingNote"
                          ],
                          "additionalProperties": false
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  },
                  "required": [
                    "currency",
                    "functionalCurrency",
                    "subtotalMinor",
                    "taxMinor",
                    "totalMinor",
                    "dueDate",
                    "delivery",
                    "lines",
                    "taxComparison",
                    "fx",
                    "findings",
                    "submittable",
                    "conversion",
                    "holdback"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "422": {
            "$ref": "#/components/responses/Problem422"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      }
    },
    "/v1/bills/service-period-proposals": {
      "post": {
        "operationId": "proposeBillServicePeriods",
        "summary": "Suggests the service period a bill covers and saves nothing.",
        "description": "Suggests the service period a bill covers and saves nothing. Needs the `ledger:propose` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "purchases"
        ],
        "x-stability-level": "beta",
        "x-eternify-read": true,
        "x-scope": "ledger:propose",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "entityId": {
                    "type": "string",
                    "minLength": 1
                  },
                  "billDate": {
                    "type": "string",
                    "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                  },
                  "lines": {
                    "maxItems": 10,
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "key": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 9007199254740991
                        },
                        "description": {
                          "type": "string",
                          "maxLength": 500
                        }
                      },
                      "required": [
                        "key",
                        "description"
                      ],
                      "additionalProperties": false
                    }
                  }
                },
                "required": [
                  "entityId",
                  "billDate",
                  "lines"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "proposals": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "key": {
                            "type": "integer",
                            "minimum": 0,
                            "maximum": 9007199254740991
                          },
                          "start": {
                            "type": "string",
                            "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                          },
                          "end": {
                            "type": "string",
                            "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                          },
                          "descriptionDigest": {
                            "type": "string",
                            "pattern": "^[0-9a-f]{64}$"
                          }
                        },
                        "required": [
                          "key",
                          "start",
                          "end",
                          "descriptionDigest"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "modelWhy": {
                      "anyOf": [
                        {
                          "type": "string",
                          "enum": [
                            "PROVIDER_UNAVAILABLE",
                            "TIMEOUT",
                            "REFUSED",
                            "UNPARSABLE",
                            "UNSANE",
                            "BUDGET",
                            "DISCLOSURE",
                            "STOPPED_AFTER_THREE_DECLINES",
                            "NO_LINES",
                            "HIDDEN_AFTER_DECLINE"
                          ]
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "hiddenAfterDecline": {
                      "type": "integer",
                      "minimum": 0,
                      "maximum": 9007199254740991
                    }
                  },
                  "required": [
                    "proposals",
                    "modelWhy",
                    "hiddenAfterDecline"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "422": {
            "$ref": "#/components/responses/Problem422"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      }
    },
    "/v1/bills/service-period-proposals/outcome": {
      "post": {
        "operationId": "recordServicePeriodOutcome",
        "summary": "Records the outcome of a service period proposal.",
        "description": "Records the outcome of a service period proposal. Needs the `ledger:propose` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "purchases"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:propose",
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "entityId": {
                    "type": "string",
                    "minLength": 1
                  },
                  "vendorId": {
                    "type": "string",
                    "minLength": 1
                  },
                  "billId": {
                    "type": "string",
                    "minLength": 1
                  },
                  "descriptionDigest": {
                    "type": "string",
                    "pattern": "^[0-9a-f]{64}$"
                  },
                  "outcome": {
                    "type": "string",
                    "enum": [
                      "KEPT",
                      "DECLINED"
                    ]
                  },
                  "suggestedStart": {
                    "type": "string",
                    "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                  },
                  "suggestedEnd": {
                    "type": "string",
                    "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                  },
                  "keptStart": {
                    "type": "string",
                    "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                  },
                  "keptEnd": {
                    "type": "string",
                    "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                  }
                },
                "required": [
                  "entityId",
                  "descriptionDigest",
                  "outcome",
                  "suggestedStart",
                  "suggestedEnd"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "Ledger-Position": {
                "$ref": "#/components/headers/LedgerPosition"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "recorded": {
                      "type": "boolean",
                      "const": true
                    }
                  },
                  "required": [
                    "recorded"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem400"
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "409": {
            "$ref": "#/components/responses/Problem409"
          },
          "412": {
            "$ref": "#/components/responses/Problem412"
          },
          "422": {
            "$ref": "#/components/responses/Problem422"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      }
    },
    "/v1/bills/{billId}": {
      "get": {
        "operationId": "getBill",
        "summary": "Returns one bill with its lines, its status and its history.",
        "description": "Returns one bill with its lines, its status and its history. Needs the `ledger:read` permission. Stable: a change that breaks callers needs 365 days' notice.",
        "tags": [
          "purchases"
        ],
        "x-stability-level": "stable",
        "x-scope": "ledger:read",
        "parameters": [
          {
            "name": "billId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "default": 50,
              "type": "integer",
              "minimum": 1,
              "maximum": 200
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 512
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ListBillsResponseItem"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "404": {
            "$ref": "#/components/responses/Problem404"
          },
          "422": {
            "$ref": "#/components/responses/Problem422"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      },
      "patch": {
        "operationId": "updateBill",
        "summary": "Changes a draft bill.",
        "description": "Changes a draft bill. Needs the `ledger:propose` permission. Stable: a change that breaks callers needs 365 days' notice.",
        "tags": [
          "purchases"
        ],
        "x-stability-level": "stable",
        "x-scope": "ledger:propose",
        "parameters": [
          {
            "name": "billId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "vendorId": {
                    "anyOf": [
                      {
                        "type": "string",
                        "minLength": 1
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "supplierName": {
                    "type": "string",
                    "maxLength": 200
                  },
                  "supplierRegistrationNumber": {
                    "anyOf": [
                      {
                        "type": "string",
                        "pattern": "^\\d{9}RT\\d{4}$"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "number": {
                    "anyOf": [
                      {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 60
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "billDate": {
                    "type": "string",
                    "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                  },
                  "dueDate": {
                    "type": "string",
                    "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                  },
                  "currency": {
                    "type": "string",
                    "pattern": "^[A-Z]{3}$"
                  },
                  "memo": {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 500
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "deliveryRegion": {
                    "anyOf": [
                      {
                        "type": "string",
                        "pattern": "^(CA|US)-[A-Z]{2}$"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "lines": {
                    "$ref": "#/components/schemas/Lines3"
                  },
                  "customFields": {
                    "$ref": "#/components/schemas/CustomFields4"
                  },
                  "submit": {
                    "default": false,
                    "type": "boolean"
                  },
                  "note": {
                    "type": "string",
                    "maxLength": 500
                  }
                },
                "required": [
                  "billDate",
                  "lines"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "Ledger-Position": {
                "$ref": "#/components/headers/LedgerPosition"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RecordBillFxRateResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem400"
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "404": {
            "$ref": "#/components/responses/Problem404"
          },
          "409": {
            "$ref": "#/components/responses/Problem409"
          },
          "412": {
            "$ref": "#/components/responses/Problem412"
          },
          "422": {
            "$ref": "#/components/responses/Problem422"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      }
    },
    "/v1/bills/{billId}/budget-position": {
      "get": {
        "operationId": "getBillBudgetPosition",
        "summary": "Returns the budget position a bill draws on.",
        "description": "Returns the budget position a bill draws on. Needs the `statements:read` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "purchases"
        ],
        "x-stability-level": "beta",
        "x-scope": "statements:read",
        "parameters": [
          {
            "name": "billId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetPurchaseOrderBudgetPositionResponse"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "404": {
            "$ref": "#/components/responses/Problem404"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      }
    },
    "/v1/bills/{billId}/capital": {
      "get": {
        "operationId": "getBillCapital",
        "summary": "Returns the capital position of a bill.",
        "description": "Returns the capital position of a bill. Needs the `ledger:read` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "purchases"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:read",
        "parameters": [
          {
            "name": "billId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "default": 20,
              "type": "integer",
              "minimum": 1,
              "maximum": 100
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 512
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/LineOption1"
                      }
                    },
                    "nextCursor": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "total": {
                      "anyOf": [
                        {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "billId": {
                      "type": "string"
                    },
                    "billStatus": {
                      "type": "string"
                    },
                    "billNumber": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "entityId": {
                      "type": "string"
                    },
                    "entityName": {
                      "type": "string"
                    },
                    "entityTimeZone": {
                      "type": "string"
                    },
                    "functionalCurrency": {
                      "type": "string",
                      "pattern": "^[A-Z]{3}$"
                    },
                    "country": {
                      "type": "string",
                      "minLength": 2,
                      "maxLength": 2
                    },
                    "floorMinor": {
                      "type": "string",
                      "pattern": "^-?\\d+$"
                    },
                    "readOn": {
                      "type": "boolean"
                    },
                    "counts": {
                      "type": "object",
                      "properties": {
                        "flagged": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 9007199254740991
                        },
                        "registered": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 9007199254740991
                        },
                        "other": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 9007199254740991
                        }
                      },
                      "required": [
                        "flagged",
                        "registered",
                        "other"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "data",
                    "nextCursor",
                    "total",
                    "billId",
                    "billStatus",
                    "billNumber",
                    "entityId",
                    "entityName",
                    "entityTimeZone",
                    "functionalCurrency",
                    "country",
                    "floorMinor",
                    "readOn",
                    "counts"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "404": {
            "$ref": "#/components/responses/Problem404"
          },
          "422": {
            "$ref": "#/components/responses/Problem422"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      }
    },
    "/v1/bills/{billId}/capital/assets": {
      "post": {
        "operationId": "registerBillAsset",
        "summary": "Registers a capital asset from a bill.",
        "description": "Registers a capital asset from a bill. Needs the `ledger:approve` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "purchases"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:approve",
        "parameters": [
          {
            "name": "billId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "billLineId": {
                    "type": "string",
                    "minLength": 1
                  },
                  "basisDigest": {
                    "type": "string",
                    "minLength": 32,
                    "maxLength": 32
                  },
                  "asset": {
                    "$ref": "#/components/schemas/RegisterAssetRequest"
                  },
                  "readingId": {
                    "type": "string",
                    "minLength": 1
                  },
                  "costNote": {
                    "type": "string",
                    "minLength": 4,
                    "maxLength": 300
                  }
                },
                "required": [
                  "billLineId",
                  "basisDigest",
                  "asset"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "Ledger-Position": {
                "$ref": "#/components/headers/LedgerPosition"
              },
              "Location": {
                "$ref": "#/components/headers/Location"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RegisterBillAssetResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem400"
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "404": {
            "$ref": "#/components/responses/Problem404"
          },
          "409": {
            "$ref": "#/components/responses/Problem409"
          },
          "412": {
            "$ref": "#/components/responses/Problem412"
          },
          "422": {
            "$ref": "#/components/responses/Problem422"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      }
    },
    "/v1/bills/{billId}/capital/links": {
      "post": {
        "operationId": "linkBillAsset",
        "summary": "Links a bill to a capital asset.",
        "description": "Links a bill to a capital asset. Needs the `ledger:approve` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "purchases"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:approve",
        "parameters": [
          {
            "name": "billId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "billLineId": {
                    "type": "string",
                    "minLength": 1
                  },
                  "basisDigest": {
                    "type": "string",
                    "minLength": 32,
                    "maxLength": 32
                  },
                  "assetId": {
                    "type": "string",
                    "minLength": 1
                  }
                },
                "required": [
                  "billLineId",
                  "basisDigest",
                  "assetId"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "Ledger-Position": {
                "$ref": "#/components/headers/LedgerPosition"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RegisterBillAssetResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem400"
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "404": {
            "$ref": "#/components/responses/Problem404"
          },
          "409": {
            "$ref": "#/components/responses/Problem409"
          },
          "412": {
            "$ref": "#/components/responses/Problem412"
          },
          "422": {
            "$ref": "#/components/responses/Problem422"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      }
    },
    "/v1/bills/{billId}/capital/readings": {
      "post": {
        "operationId": "readBillCapital",
        "summary": "Asks for a bill's capital readings to be read again, and answers at once; the reading follows.",
        "description": "Asks for a bill's capital readings to be read again, and answers at once; the reading follows. Needs the `ledger:propose` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "purchases"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:propose",
        "parameters": [
          {
            "name": "billId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "signalId": {
                    "type": "string",
                    "minLength": 1
                  }
                },
                "required": [
                  "signalId"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Accepted: the work is done after the answer, or waits for a person's confirmation.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "Ledger-Position": {
                "$ref": "#/components/headers/LedgerPosition"
              },
              "Location": {
                "$ref": "#/components/headers/Location"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "signalId": {
                      "type": "string"
                    },
                    "attempt": {
                      "type": "integer",
                      "minimum": 1,
                      "maximum": 3
                    }
                  },
                  "required": [
                    "signalId",
                    "attempt"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem400"
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "404": {
            "$ref": "#/components/responses/Problem404"
          },
          "409": {
            "$ref": "#/components/responses/Problem409"
          },
          "412": {
            "$ref": "#/components/responses/Problem412"
          },
          "422": {
            "$ref": "#/components/responses/Problem422"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      }
    },
    "/v1/bills/{billId}/correction-prefill": {
      "get": {
        "operationId": "getBillCorrectionPrefill",
        "summary": "Returns the values a correction to a bill starts from.",
        "description": "Returns the values a correction to a bill starts from. Needs the `ledger:read` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "purchases"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:read",
        "parameters": [
          {
            "name": "billId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "flagProposalId",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "replaces": {
                      "type": "object",
                      "properties": {
                        "billId": {
                          "type": "string"
                        },
                        "supplierName": {
                          "type": "string"
                        },
                        "number": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "billDate": {
                          "type": "string",
                          "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                        },
                        "status": {
                          "type": "string",
                          "enum": [
                            "DRAFT",
                            "IN_REVIEW",
                            "DECLINED",
                            "APPROVED",
                            "HELD",
                            "OPEN",
                            "DUE",
                            "OVERDUE",
                            "IN_RUN",
                            "PARTIALLY_PAID",
                            "PAID",
                            "VOID"
                          ]
                        },
                        "totalMinor": {
                          "type": "string",
                          "pattern": "^-?\\d+$"
                        },
                        "currency": {
                          "type": "string",
                          "pattern": "^[A-Z]{3}$"
                        },
                        "voidedAt": {
                          "anyOf": [
                            {
                              "type": "string",
                              "minLength": 20
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "voidReason": {
                          "type": [
                            "string",
                            "null"
                          ]
                        }
                      },
                      "required": [
                        "billId",
                        "supplierName",
                        "number",
                        "billDate",
                        "status",
                        "totalMinor",
                        "currency",
                        "voidedAt",
                        "voidReason"
                      ],
                      "additionalProperties": false
                    },
                    "entityId": {
                      "type": "string"
                    },
                    "flag": {
                      "anyOf": [
                        {
                          "type": "object",
                          "properties": {
                            "proposalId": {
                              "type": "string"
                            },
                            "documentId": {
                              "type": "string"
                            },
                            "fileName": {
                              "type": "string"
                            }
                          },
                          "required": [
                            "proposalId",
                            "documentId",
                            "fileName"
                          ],
                          "additionalProperties": false
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "header": {
                      "type": "object",
                      "properties": {
                        "vendorId": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "supplierName": {
                          "type": "string"
                        },
                        "number": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "billDate": {
                          "anyOf": [
                            {
                              "type": "string",
                              "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "currency": {
                          "type": "string",
                          "pattern": "^[A-Z]{3}$"
                        },
                        "payableAccountId": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "deliveryRegion": {
                          "anyOf": [
                            {
                              "type": "string",
                              "pattern": "^(CA|US)-[A-Z]{2}$"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "documentId": {
                          "type": [
                            "string",
                            "null"
                          ]
                        }
                      },
                      "required": [
                        "vendorId",
                        "supplierName",
                        "number",
                        "billDate",
                        "currency",
                        "payableAccountId",
                        "deliveryRegion",
                        "documentId"
                      ],
                      "additionalProperties": false
                    },
                    "lines": {
                      "minItems": 1,
                      "maxItems": 100,
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "description": {
                            "type": "string",
                            "minLength": 1,
                            "maxLength": 500
                          },
                          "accountId": {
                            "anyOf": [
                              {
                                "type": "string",
                                "minLength": 1
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "quantity": {
                            "default": "1",
                            "type": "string",
                            "pattern": "^\\d{1,10}(\\.\\d{1,4})?$"
                          },
                          "unitPriceMinor": {
                            "type": "string",
                            "pattern": "^-?\\d+$"
                          },
                          "netMinor": {
                            "type": "string",
                            "pattern": "^-?\\d+$"
                          },
                          "taxAsPrintedMinor": {
                            "anyOf": [
                              {
                                "type": "string",
                                "pattern": "^-?\\d+$"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "supplyCategory": {
                            "type": "string",
                            "enum": [
                              "GOODS",
                              "SERVICES",
                              "INTANGIBLE_PROPERTY",
                              "REAL_PROPERTY"
                            ]
                          },
                          "itcKind": {
                            "type": "string",
                            "enum": [
                              "GENERAL",
                              "MEALS_ENTERTAINMENT",
                              "PASSENGER_VEHICLE",
                              "ZERO_EMISSION_VEHICLE",
                              "EXEMPT_ACTIVITY",
                              "NONE"
                            ]
                          },
                          "dimensions": {
                            "$ref": "#/components/schemas/Dimensions2"
                          },
                          "servicePeriodStart": {
                            "type": "string",
                            "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                          },
                          "servicePeriodEnd": {
                            "type": "string",
                            "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                          },
                          "purchaseOrderLineId": {
                            "anyOf": [
                              {
                                "type": "string",
                                "minLength": 1
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "customFields": {
                            "$ref": "#/components/schemas/CustomFields5"
                          },
                          "codedFrom": {
                            "anyOf": [
                              {
                                "type": "string",
                                "enum": [
                                  "SAME_POSITION",
                                  "SAME_DESCRIPTION",
                                  "FIRST_BILL"
                                ]
                              },
                              {
                                "type": "null"
                              }
                            ]
                          }
                        },
                        "required": [
                          "description",
                          "quantity",
                          "supplyCategory",
                          "itcKind",
                          "codedFrom"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "documentTotalMinor": {
                      "anyOf": [
                        {
                          "type": "string",
                          "pattern": "^-?\\d+$"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "differences": {
                      "$ref": "#/components/schemas/Differences"
                    }
                  },
                  "required": [
                    "replaces",
                    "entityId",
                    "flag",
                    "header",
                    "lines",
                    "documentTotalMinor",
                    "differences"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "404": {
            "$ref": "#/components/responses/Problem404"
          },
          "422": {
            "$ref": "#/components/responses/Problem422"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      }
    },
    "/v1/bills/{billId}/decide": {
      "post": {
        "operationId": "decideBill",
        "summary": "Approves, declines or sends a submitted bill back.",
        "description": "Approves, declines or sends a submitted bill back. Needs the `ledger:approve` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "purchases"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:approve",
        "parameters": [
          {
            "name": "billId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "outcome": {
                    "type": "string",
                    "enum": [
                      "APPROVE",
                      "DECLINE"
                    ]
                  },
                  "reason": {
                    "type": "string",
                    "maxLength": 500
                  },
                  "paidBy": {
                    "type": "string",
                    "enum": [
                      "RUN",
                      "CARD",
                      "PAD",
                      "CHEQUE",
                      "WIRE",
                      "ETRANSFER",
                      "OTHER"
                    ]
                  },
                  "postingDate": {
                    "type": "string",
                    "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                  },
                  "budgetVerdict": {
                    "type": "string",
                    "pattern": "^[0-9a-f]{16}$"
                  },
                  "alsoRecord": {
                    "type": "object",
                    "properties": {
                      "sourceTransactionId": {
                        "type": "string",
                        "minLength": 1
                      },
                      "feedScoreBp": {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 10000
                      }
                    },
                    "required": [
                      "sourceTransactionId",
                      "feedScoreBp"
                    ],
                    "additionalProperties": false
                  },
                  "seenTotalMinor": {
                    "type": "string",
                    "pattern": "^-?\\d+$"
                  },
                  "matchVerdict": {
                    "type": "string",
                    "pattern": "^[0-9a-f]{16}$"
                  },
                  "prepaid": {
                    "maxItems": 100,
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "position": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 9007199254740991
                        },
                        "choice": {
                          "type": "string",
                          "enum": [
                            "SCHEDULE",
                            "EXPENSE"
                          ]
                        },
                        "method": {
                          "type": "string",
                          "enum": [
                            "BY_MONTH",
                            "BY_DAY"
                          ]
                        },
                        "reason": {
                          "type": "string",
                          "maxLength": 300
                        }
                      },
                      "required": [
                        "position",
                        "choice"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "prepaidDigest": {
                    "type": "string",
                    "pattern": "^[0-9a-f]{16}$"
                  }
                },
                "required": [
                  "outcome"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "Ledger-Position": {
                "$ref": "#/components/headers/LedgerPosition"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "status": {
                      "type": "string",
                      "enum": [
                        "DRAFT",
                        "IN_REVIEW",
                        "APPROVED",
                        "PARTIALLY_PAID",
                        "PAID",
                        "VOID"
                      ]
                    },
                    "versionCount": {
                      "type": "integer",
                      "minimum": 0,
                      "maximum": 9007199254740991
                    },
                    "findings": {
                      "$ref": "#/components/schemas/Findings2"
                    },
                    "alsoRecorded": {
                      "default": null,
                      "anyOf": [
                        {
                          "oneOf": [
                            {
                              "type": "object",
                              "properties": {
                                "state": {
                                  "type": "string",
                                  "const": "POSTED"
                                },
                                "settlementId": {
                                  "type": "string"
                                },
                                "entryId": {
                                  "type": "string"
                                },
                                "sentence": {
                                  "type": "string"
                                }
                              },
                              "required": [
                                "state",
                                "settlementId",
                                "entryId",
                                "sentence"
                              ],
                              "additionalProperties": false
                            },
                            {
                              "type": "object",
                              "properties": {
                                "state": {
                                  "type": "string",
                                  "const": "WAITING"
                                },
                                "settlementId": {
                                  "type": "string"
                                },
                                "sentence": {
                                  "type": "string"
                                }
                              },
                              "required": [
                                "state",
                                "settlementId",
                                "sentence"
                              ],
                              "additionalProperties": false
                            },
                            {
                              "type": "object",
                              "properties": {
                                "state": {
                                  "type": "string",
                                  "const": "NOT_RECORDED"
                                },
                                "code": {
                                  "type": "string"
                                },
                                "sentence": {
                                  "type": "string"
                                }
                              },
                              "required": [
                                "state",
                                "code",
                                "sentence"
                              ],
                              "additionalProperties": false
                            }
                          ]
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  },
                  "required": [
                    "id",
                    "status",
                    "versionCount",
                    "findings",
                    "alsoRecorded"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem400"
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "404": {
            "$ref": "#/components/responses/Problem404"
          },
          "409": {
            "$ref": "#/components/responses/Problem409"
          },
          "412": {
            "$ref": "#/components/responses/Problem412"
          },
          "422": {
            "$ref": "#/components/responses/Problem422"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      }
    },
    "/v1/bills/{billId}/desk/reassign": {
      "post": {
        "operationId": "reassignBillDesk",
        "summary": "Moves a bill to another approval desk.",
        "description": "Moves a bill to another approval desk. Needs the `ledger:approve` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "purchases"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:approve",
        "parameters": [
          {
            "name": "billId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "toUserId": {
                    "type": "string",
                    "minLength": 1
                  },
                  "reason": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 500
                  }
                },
                "required": [
                  "toUserId",
                  "reason"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "Ledger-Position": {
                "$ref": "#/components/headers/LedgerPosition"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "stageId": {
                      "type": "string"
                    },
                    "position": {
                      "type": "integer",
                      "minimum": 1,
                      "maximum": 6
                    },
                    "stageCount": {
                      "type": "integer",
                      "minimum": 1,
                      "maximum": 6
                    },
                    "kind": {
                      "type": "string",
                      "enum": [
                        "REVIEW",
                        "SIGN"
                      ]
                    },
                    "desk": {
                      "$ref": "#/components/schemas/Desk"
                    },
                    "routedAt": {
                      "type": "string",
                      "minLength": 20
                    },
                    "forSomeoneElse": {
                      "anyOf": [
                        {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "string"
                            },
                            "name": {
                              "type": "string"
                            }
                          },
                          "required": [
                            "id",
                            "name"
                          ],
                          "additionalProperties": false
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "approver": {
                      "$ref": "#/components/schemas/Desk"
                    },
                    "group": {
                      "anyOf": [
                        {
                          "type": "object",
                          "properties": {
                            "rule": {
                              "type": "string",
                              "enum": [
                                "ANY",
                                "ALL"
                              ]
                            },
                            "members": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "id": {
                                    "type": "string"
                                  },
                                  "name": {
                                    "type": "string"
                                  }
                                },
                                "required": [
                                  "id",
                                  "name"
                                ],
                                "additionalProperties": false
                              }
                            },
                            "votes": {
                              "maxItems": 10,
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "member": {
                                    "type": "object",
                                    "properties": {
                                      "id": {
                                        "type": "string"
                                      },
                                      "name": {
                                        "type": "string"
                                      }
                                    },
                                    "required": [
                                      "id",
                                      "name"
                                    ],
                                    "additionalProperties": false
                                  },
                                  "decidedBy": {
                                    "type": "object",
                                    "properties": {
                                      "id": {
                                        "type": "string"
                                      },
                                      "name": {
                                        "type": "string"
                                      }
                                    },
                                    "required": [
                                      "id",
                                      "name"
                                    ],
                                    "additionalProperties": false
                                  },
                                  "at": {
                                    "type": "string",
                                    "minLength": 20
                                  },
                                  "decision": {
                                    "type": "string",
                                    "enum": [
                                      "APPROVE",
                                      "DECLINE"
                                    ]
                                  }
                                },
                                "required": [
                                  "member",
                                  "decidedBy",
                                  "at",
                                  "decision"
                                ],
                                "additionalProperties": false
                              }
                            }
                          },
                          "required": [
                            "rule",
                            "members",
                            "votes"
                          ],
                          "additionalProperties": false
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "workflow": {
                      "anyOf": [
                        {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "string"
                            },
                            "name": {
                              "type": "string"
                            },
                            "version": {
                              "type": "integer",
                              "minimum": 1,
                              "maximum": 9007199254740991
                            }
                          },
                          "required": [
                            "id",
                            "name",
                            "version"
                          ],
                          "additionalProperties": false
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "escalation": {
                      "anyOf": [
                        {
                          "type": "object",
                          "properties": {
                            "afterDays": {
                              "type": "integer",
                              "minimum": 1,
                              "maximum": 60
                            },
                            "to": {
                              "oneOf": [
                                {
                                  "$ref": "#/components/schemas/DeskOption1"
                                },
                                {
                                  "type": "object",
                                  "properties": {
                                    "kind": {
                                      "type": "string",
                                      "const": "AUTHORITY"
                                    }
                                  },
                                  "required": [
                                    "kind"
                                  ],
                                  "additionalProperties": false
                                }
                              ]
                            }
                          },
                          "required": [
                            "afterDays",
                            "to"
                          ],
                          "additionalProperties": false
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "subject": {
                      "type": "string",
                      "enum": [
                        "BILL",
                        "BILL_EDIT"
                      ]
                    },
                    "revision": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    "substitute": {
                      "anyOf": [
                        {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "string"
                            },
                            "name": {
                              "type": "string"
                            }
                          },
                          "required": [
                            "id",
                            "name"
                          ],
                          "additionalProperties": false
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "authorityRequiredMinor": {
                      "anyOf": [
                        {
                          "type": "string",
                          "pattern": "^-?\\d+$"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "functionalCurrency": {
                      "type": "string",
                      "pattern": "^[A-Z]{3}$"
                    },
                    "holders": {
                      "type": "object",
                      "properties": {
                        "people": {
                          "maxItems": 5,
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string"
                              },
                              "name": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "id",
                              "name"
                            ],
                            "additionalProperties": false
                          }
                        },
                        "total": {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991
                        }
                      },
                      "required": [
                        "people",
                        "total"
                      ],
                      "additionalProperties": false
                    },
                    "rule": {
                      "anyOf": [
                        {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "string"
                            },
                            "version": {
                              "type": "integer",
                              "minimum": -9007199254740991,
                              "maximum": 9007199254740991
                            },
                            "sourceText": {
                              "type": "string"
                            },
                            "author": {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string"
                                },
                                "name": {
                                  "type": "string"
                                }
                              },
                              "required": [
                                "id",
                                "name"
                              ],
                              "additionalProperties": false
                            },
                            "expiresAt": {
                              "type": "string",
                              "minLength": 20
                            }
                          },
                          "required": [
                            "id",
                            "version",
                            "sourceText",
                            "author",
                            "expiresAt"
                          ],
                          "additionalProperties": false
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "reasonCode": {
                      "type": "string",
                      "enum": [
                        "RULE_DESK",
                        "RULE_REVIEW_THEN_SIGN",
                        "NO_RULE",
                        "NOBODY",
                        "NO_RATE",
                        "RULE_OVER_AUTHOR_CAP",
                        "DESK_PREPARED_IT",
                        "BACKFILLED",
                        "REASSIGNED",
                        "ESCALATED",
                        "SECOND_STAGE"
                      ]
                    },
                    "reason": {
                      "type": "string"
                    },
                    "routedBy": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "name": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "id",
                        "name"
                      ],
                      "additionalProperties": false
                    },
                    "waitingDays": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    "nudgedAt": {
                      "anyOf": [
                        {
                          "type": "string",
                          "minLength": 20
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "openedByEscalation": {
                      "type": "boolean"
                    },
                    "firstStage": {
                      "anyOf": [
                        {
                          "type": "object",
                          "properties": {
                            "decidedBy": {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string"
                                },
                                "name": {
                                  "type": "string"
                                }
                              },
                              "required": [
                                "id",
                                "name"
                              ],
                              "additionalProperties": false
                            },
                            "decidedAt": {
                              "type": "string",
                              "minLength": 20
                            }
                          },
                          "required": [
                            "decidedBy",
                            "decidedAt"
                          ],
                          "additionalProperties": false
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  },
                  "required": [
                    "stageId",
                    "position",
                    "stageCount",
                    "kind",
                    "desk",
                    "routedAt",
                    "forSomeoneElse",
                    "approver",
                    "group",
                    "workflow",
                    "escalation",
                    "subject",
                    "revision",
                    "substitute",
                    "authorityRequiredMinor",
                    "functionalCurrency",
                    "holders",
                    "rule",
                    "reasonCode",
                    "reason",
                    "routedBy",
                    "waitingDays",
                    "nudgedAt",
                    "openedByEscalation",
                    "firstStage"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem400"
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "404": {
            "$ref": "#/components/responses/Problem404"
          },
          "409": {
            "$ref": "#/components/responses/Problem409"
          },
          "412": {
            "$ref": "#/components/responses/Problem412"
          },
          "422": {
            "$ref": "#/components/responses/Problem422"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      }
    },
    "/v1/bills/{billId}/discard": {
      "post": {
        "operationId": "discardBill",
        "summary": "Discards a draft bill that has not been submitted.",
        "description": "Discards a draft bill that has not been submitted. Needs the `ledger:propose` permission. Stable: a change that breaks callers needs 365 days' notice.",
        "tags": [
          "purchases"
        ],
        "x-stability-level": "stable",
        "x-scope": "ledger:propose",
        "parameters": [
          {
            "name": "billId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "reason": {
                    "type": "string",
                    "maxLength": 500
                  }
                },
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "Ledger-Position": {
                "$ref": "#/components/headers/LedgerPosition"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RecordBillFxRateResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem400"
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "404": {
            "$ref": "#/components/responses/Problem404"
          },
          "409": {
            "$ref": "#/components/responses/Problem409"
          },
          "412": {
            "$ref": "#/components/responses/Problem412"
          },
          "422": {
            "$ref": "#/components/responses/Problem422"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      }
    },
    "/v1/bills/{billId}/edit/decide": {
      "post": {
        "operationId": "decideBillEdit",
        "summary": "Accepts or declines a proposed edit to a bill.",
        "description": "Accepts or declines a proposed edit to a bill. Needs the `ledger:approve` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "purchases"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:approve",
        "parameters": [
          {
            "name": "billId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "outcome": {
                    "type": "string",
                    "enum": [
                      "APPROVE",
                      "DECLINE"
                    ]
                  },
                  "reason": {
                    "type": "string",
                    "maxLength": 500
                  }
                },
                "required": [
                  "outcome"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "Ledger-Position": {
                "$ref": "#/components/headers/LedgerPosition"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RecordBillFxRateResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem400"
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "404": {
            "$ref": "#/components/responses/Problem404"
          },
          "409": {
            "$ref": "#/components/responses/Problem409"
          },
          "412": {
            "$ref": "#/components/responses/Problem412"
          },
          "422": {
            "$ref": "#/components/responses/Problem422"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      }
    },
    "/v1/bills/{billId}/editable": {
      "get": {
        "operationId": "getBillEditable",
        "summary": "Returns a bill in the form needed to edit it.",
        "description": "Returns a bill in the form needed to edit it. Needs the `ledger:read` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "purchases"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:read",
        "parameters": [
          {
            "name": "billId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "entityId": {
                      "type": "string"
                    },
                    "status": {
                      "type": "string",
                      "enum": [
                        "DRAFT",
                        "IN_REVIEW",
                        "APPROVED",
                        "PARTIALLY_PAID",
                        "PAID",
                        "VOID"
                      ]
                    },
                    "source": {
                      "type": "string",
                      "enum": [
                        "INBOX_DOCUMENT",
                        "MANUAL",
                        "IMPORT",
                        "RECURRING"
                      ]
                    },
                    "vendorId": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "supplierName": {
                      "type": "string"
                    },
                    "supplierRegistrationNumber": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "number": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "billDate": {
                      "type": "string",
                      "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                    },
                    "dueDate": {
                      "type": "string",
                      "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                    },
                    "currency": {
                      "type": "string",
                      "pattern": "^[A-Z]{3}$"
                    },
                    "memo": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "payableAccountId": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "deliveryRegion": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "supplierRegion": {
                      "default": null,
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "paidBy": {
                      "type": "string",
                      "enum": [
                        "RUN",
                        "CARD",
                        "PAD",
                        "ACCOUNT",
                        "CHEQUE",
                        "WIRE",
                        "ETRANSFER",
                        "OTHER"
                      ]
                    },
                    "documentId": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "document": {
                      "default": null,
                      "anyOf": [
                        {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "string"
                            },
                            "fileName": {
                              "type": "string"
                            },
                            "mimeType": {
                              "type": "string"
                            },
                            "sizeBytes": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 9007199254740991
                            }
                          },
                          "required": [
                            "id",
                            "fileName",
                            "mimeType",
                            "sizeBytes"
                          ],
                          "additionalProperties": false
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "subtotalMinor": {
                      "type": "string",
                      "pattern": "^-?\\d+$"
                    },
                    "taxMinor": {
                      "type": "string",
                      "pattern": "^-?\\d+$"
                    },
                    "totalMinor": {
                      "type": "string",
                      "pattern": "^-?\\d+$"
                    },
                    "versionCount": {
                      "type": "integer",
                      "minimum": 0,
                      "maximum": 9007199254740991
                    },
                    "lines": {
                      "$ref": "#/components/schemas/Lines4"
                    },
                    "customFields": {
                      "$ref": "#/components/schemas/CustomFields2"
                    },
                    "draftedBy": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "name": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "id",
                        "name"
                      ],
                      "additionalProperties": false
                    },
                    "entryId": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "proposal": {
                      "anyOf": [
                        {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "string"
                            },
                            "kind": {
                              "type": "string",
                              "enum": [
                                "BILL",
                                "BILL_EDIT",
                                "JOURNAL_ENTRY"
                              ]
                            },
                            "status": {
                              "type": "string",
                              "enum": [
                                "PENDING",
                                "APPROVED",
                                "EDITED_APPROVED",
                                "REJECTED",
                                "EXPIRED",
                                "WITHDRAWN"
                              ]
                            },
                            "submittedBy": {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string"
                                },
                                "name": {
                                  "type": "string"
                                }
                              },
                              "required": [
                                "id",
                                "name"
                              ],
                              "additionalProperties": false
                            },
                            "submittedAt": {
                              "type": "string",
                              "minLength": 20
                            },
                            "note": {
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "reviewedBy": {
                              "anyOf": [
                                {
                                  "type": "object",
                                  "properties": {
                                    "id": {
                                      "type": "string"
                                    },
                                    "name": {
                                      "type": "string"
                                    }
                                  },
                                  "required": [
                                    "id",
                                    "name"
                                  ],
                                  "additionalProperties": false
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "reviewedAt": {
                              "anyOf": [
                                {
                                  "type": "string",
                                  "minLength": 20
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "rejectReason": {
                              "type": [
                                "string",
                                "null"
                              ]
                            }
                          },
                          "required": [
                            "id",
                            "kind",
                            "status",
                            "submittedBy",
                            "submittedAt",
                            "note",
                            "reviewedBy",
                            "reviewedAt",
                            "rejectReason"
                          ],
                          "additionalProperties": false
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "pendingEdit": {
                      "anyOf": [
                        {
                          "type": "object",
                          "properties": {
                            "proposalId": {
                              "type": "string"
                            },
                            "proposedBy": {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string"
                                },
                                "name": {
                                  "type": "string"
                                }
                              },
                              "required": [
                                "id",
                                "name"
                              ],
                              "additionalProperties": false
                            },
                            "proposedAt": {
                              "type": "string",
                              "minLength": 20
                            },
                            "reason": {
                              "type": "string"
                            },
                            "revision": {
                              "type": "integer",
                              "exclusiveMinimum": 0,
                              "maximum": 9007199254740991
                            },
                            "before": {
                              "$ref": "#/components/schemas/Before"
                            },
                            "after": {
                              "$ref": "#/components/schemas/Before"
                            },
                            "lines": {
                              "$ref": "#/components/schemas/Lines4"
                            },
                            "findings": {
                              "$ref": "#/components/schemas/Findings2"
                            },
                            "postsOn": {
                              "anyOf": [
                                {
                                  "type": "string",
                                  "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "reversesOn": {
                              "type": "string",
                              "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                            }
                          },
                          "required": [
                            "proposalId",
                            "proposedBy",
                            "proposedAt",
                            "reason",
                            "revision",
                            "before",
                            "after",
                            "lines",
                            "findings",
                            "postsOn",
                            "reversesOn"
                          ],
                          "additionalProperties": false
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "blocked": {
                      "type": "object",
                      "properties": {
                        "void": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "discard": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "proposeEdit": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "amountChange": {
                          "type": [
                            "string",
                            "null"
                          ]
                        }
                      },
                      "required": [
                        "void",
                        "discard",
                        "proposeEdit",
                        "amountChange"
                      ],
                      "additionalProperties": false
                    },
                    "approval": {
                      "type": "object",
                      "properties": {
                        "approvedUnder": {
                          "$ref": "#/components/schemas/ApprovedUnder"
                        }
                      },
                      "required": [
                        "approvedUnder"
                      ],
                      "additionalProperties": false
                    },
                    "desk": {
                      "$ref": "#/components/schemas/Desk2"
                    },
                    "hold": {
                      "default": null,
                      "anyOf": [
                        {
                          "type": "object",
                          "properties": {
                            "held": {
                              "default": true,
                              "type": "boolean",
                              "const": true
                            },
                            "since": {
                              "type": "string",
                              "minLength": 20
                            }
                          },
                          "required": [
                            "held",
                            "since"
                          ],
                          "additionalProperties": false
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "posting": {
                      "anyOf": [
                        {
                          "oneOf": [
                            {
                              "type": "object",
                              "properties": {
                                "kind": {
                                  "type": "string",
                                  "const": "OPEN"
                                },
                                "billDate": {
                                  "type": "string",
                                  "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                                },
                                "postsOn": {
                                  "type": "string",
                                  "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                                }
                              },
                              "required": [
                                "kind",
                                "billDate",
                                "postsOn"
                              ],
                              "additionalProperties": false
                            },
                            {
                              "type": "object",
                              "properties": {
                                "kind": {
                                  "type": "string",
                                  "const": "MOVED"
                                },
                                "billDate": {
                                  "type": "string",
                                  "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                                },
                                "postsOn": {
                                  "type": "string",
                                  "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                                },
                                "earliest": {
                                  "type": "string",
                                  "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                                },
                                "latest": {
                                  "type": "string",
                                  "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                                },
                                "closedBy": {
                                  "$ref": "#/components/schemas/ClosedBy"
                                }
                              },
                              "required": [
                                "kind",
                                "billDate",
                                "postsOn",
                                "earliest",
                                "latest",
                                "closedBy"
                              ],
                              "additionalProperties": false
                            },
                            {
                              "type": "object",
                              "properties": {
                                "kind": {
                                  "type": "string",
                                  "const": "NO_OPEN_PERIOD"
                                },
                                "billDate": {
                                  "type": "string",
                                  "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                                },
                                "billMonth": {
                                  "type": "string",
                                  "pattern": "^\\d{4}-\\d{2}$"
                                },
                                "thisMonth": {
                                  "type": "string",
                                  "pattern": "^\\d{4}-\\d{2}$"
                                },
                                "closedBy": {
                                  "$ref": "#/components/schemas/ClosedBy"
                                }
                              },
                              "required": [
                                "kind",
                                "billDate",
                                "billMonth",
                                "thisMonth",
                                "closedBy"
                              ],
                              "additionalProperties": false
                            }
                          ]
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  },
                  "required": [
                    "id",
                    "entityId",
                    "status",
                    "source",
                    "vendorId",
                    "supplierName",
                    "supplierRegistrationNumber",
                    "number",
                    "billDate",
                    "dueDate",
                    "currency",
                    "memo",
                    "payableAccountId",
                    "deliveryRegion",
                    "supplierRegion",
                    "paidBy",
                    "documentId",
                    "document",
                    "subtotalMinor",
                    "taxMinor",
                    "totalMinor",
                    "versionCount",
                    "lines",
                    "draftedBy",
                    "entryId",
                    "proposal",
                    "pendingEdit",
                    "blocked",
                    "approval",
                    "desk",
                    "hold",
                    "posting"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "404": {
            "$ref": "#/components/responses/Problem404"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      }
    },
    "/v1/bills/{billId}/feed-candidates": {
      "get": {
        "operationId": "listBillFeedCandidates",
        "summary": "Lists the bank feed lines a bill may settle.",
        "description": "Lists the bank feed lines a bill may settle. Needs the `ledger:read` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "purchases"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:read",
        "parameters": [
          {
            "name": "billId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ListBillFeedCandidatesResponse"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "404": {
            "$ref": "#/components/responses/Problem404"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      }
    },
    "/v1/bills/{billId}/feed-candidates/{sourceTransactionId}/decline": {
      "post": {
        "operationId": "declineBillFeedLine",
        "summary": "Declines a bank feed line as the settlement of a bill.",
        "description": "Declines a bank feed line as the settlement of a bill. Needs the `ledger:propose` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "purchases"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:propose",
        "parameters": [
          {
            "name": "billId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "sourceTransactionId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "reason": {
                    "type": "string",
                    "enum": [
                      "NOT_THIS_SUPPLIER",
                      "NOT_THIS_BILL",
                      "NOT_A_PAYMENT",
                      "OTHER"
                    ]
                  },
                  "note": {
                    "type": "string",
                    "maxLength": 500
                  }
                },
                "required": [
                  "reason"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "Ledger-Position": {
                "$ref": "#/components/headers/LedgerPosition"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ListBillFeedCandidatesResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem400"
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "404": {
            "$ref": "#/components/responses/Problem404"
          },
          "409": {
            "$ref": "#/components/responses/Problem409"
          },
          "412": {
            "$ref": "#/components/responses/Problem412"
          },
          "422": {
            "$ref": "#/components/responses/Problem422"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      }
    },
    "/v1/bills/{billId}/feed-candidates/{sourceTransactionId}/descriptor": {
      "post": {
        "operationId": "readFeedDescriptor",
        "summary": "Reads the descriptor of a bank feed line a bill might settle.",
        "description": "Reads the descriptor of a bank feed line a bill might settle. Needs the `ledger:propose` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "purchases"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:propose",
        "parameters": [
          {
            "name": "billId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "sourceTransactionId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "Ledger-Position": {
                "$ref": "#/components/headers/LedgerPosition"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "reading": {
                      "$ref": "#/components/schemas/Reading"
                    },
                    "why": {
                      "anyOf": [
                        {
                          "type": "string",
                          "enum": [
                            "PROVIDER",
                            "REFUSED",
                            "UNPARSABLE",
                            "QUOTE_NOT_IN_TEXT",
                            "BUDGET",
                            "DISCLOSURE"
                          ]
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  },
                  "required": [
                    "reading",
                    "why"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem400"
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "404": {
            "$ref": "#/components/responses/Problem404"
          },
          "409": {
            "$ref": "#/components/responses/Problem409"
          },
          "412": {
            "$ref": "#/components/responses/Problem412"
          },
          "422": {
            "$ref": "#/components/responses/Problem422"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      }
    },
    "/v1/bills/{billId}/fx-rate": {
      "post": {
        "operationId": "recordBillFxRate",
        "summary": "Records the exchange rate a foreign currency bill was paid at.",
        "description": "Records the exchange rate a foreign currency bill was paid at. Needs the `ledger:approve` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "purchases"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:approve",
        "parameters": [
          {
            "name": "billId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "oneOf": [
                  {
                    "type": "object",
                    "properties": {
                      "from": {
                        "type": "string",
                        "const": "METHOD"
                      },
                      "note": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 500
                      }
                    },
                    "required": [
                      "from",
                      "note"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "from": {
                        "type": "string",
                        "const": "TYPED"
                      },
                      "fxRate": {
                        "type": "string",
                        "pattern": "^\\d{1,6}(\\.\\d{1,6})?$"
                      },
                      "fxRateDate": {
                        "type": "string",
                        "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                      },
                      "note": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 500
                      }
                    },
                    "required": [
                      "from",
                      "fxRate",
                      "fxRateDate",
                      "note"
                    ],
                    "additionalProperties": false
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "Ledger-Position": {
                "$ref": "#/components/headers/LedgerPosition"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RecordBillFxRateResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem400"
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "404": {
            "$ref": "#/components/responses/Problem404"
          },
          "409": {
            "$ref": "#/components/responses/Problem409"
          },
          "412": {
            "$ref": "#/components/responses/Problem412"
          },
          "422": {
            "$ref": "#/components/responses/Problem422"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      }
    },
    "/v1/bills/{billId}/hold": {
      "post": {
        "operationId": "holdBill",
        "summary": "Puts a bill on hold so it is not paid.",
        "description": "Puts a bill on hold so it is not paid. Needs the `ledger:approve` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "purchases"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:approve",
        "parameters": [
          {
            "name": "billId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "reason": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 500
                  },
                  "until": {
                    "type": "string",
                    "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                  },
                  "reasonSource": {
                    "default": "PERSON",
                    "type": "string",
                    "enum": [
                      "PERSON",
                      "AGENT_DRAFT",
                      "AGENT_DRAFT_EDITED"
                    ]
                  },
                  "draftPromptVersion": {
                    "type": "string",
                    "maxLength": 40
                  }
                },
                "required": [
                  "reason"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "Ledger-Position": {
                "$ref": "#/components/headers/LedgerPosition"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HoldBillResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem400"
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "404": {
            "$ref": "#/components/responses/Problem404"
          },
          "409": {
            "$ref": "#/components/responses/Problem409"
          },
          "412": {
            "$ref": "#/components/responses/Problem412"
          },
          "422": {
            "$ref": "#/components/responses/Problem422"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      }
    },
    "/v1/bills/{billId}/hold-brief": {
      "post": {
        "operationId": "draftBillHoldReason",
        "summary": "Drafts the reason for putting one bill on hold.",
        "description": "Drafts the reason for putting one bill on hold. Needs the `ledger:approve` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "purchases"
        ],
        "x-stability-level": "beta",
        "x-eternify-read": true,
        "x-scope": "ledger:approve",
        "parameters": [
          {
            "name": "billId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "note": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 200
                  }
                },
                "required": [
                  "note"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DraftVendorHoldReasonResponse"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "404": {
            "$ref": "#/components/responses/Problem404"
          },
          "422": {
            "$ref": "#/components/responses/Problem422"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      }
    },
    "/v1/bills/{billId}/hold/release": {
      "post": {
        "operationId": "releaseBillHold",
        "summary": "Releases a bill from hold so it can be paid.",
        "description": "Releases a bill from hold so it can be paid. Needs the `ledger:approve` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "purchases"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:approve",
        "parameters": [
          {
            "name": "billId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "reason": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 500
                  }
                },
                "required": [
                  "reason"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "Ledger-Position": {
                "$ref": "#/components/headers/LedgerPosition"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HoldBillResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem400"
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "404": {
            "$ref": "#/components/responses/Problem404"
          },
          "409": {
            "$ref": "#/components/responses/Problem409"
          },
          "412": {
            "$ref": "#/components/responses/Problem412"
          },
          "422": {
            "$ref": "#/components/responses/Problem422"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      }
    },
    "/v1/bills/{billId}/holdback": {
      "get": {
        "operationId": "getBillHoldback",
        "summary": "Returns the holdback on a bill.",
        "description": "Returns the holdback on a bill. Needs the `ledger:read` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "purchases"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:read",
        "parameters": [
          {
            "name": "billId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 512
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Holdback"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "404": {
            "$ref": "#/components/responses/Problem404"
          },
          "422": {
            "$ref": "#/components/responses/Problem422"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      }
    },
    "/v1/bills/{billId}/holdback/draft": {
      "post": {
        "operationId": "draftBillHoldback",
        "summary": "Drafts the holdback terms for a bill.",
        "description": "Drafts the holdback terms for a bill. Needs the `ledger:propose` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "purchases"
        ],
        "x-stability-level": "beta",
        "x-eternify-read": true,
        "x-scope": "ledger:propose",
        "parameters": [
          {
            "name": "billId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "drafted": {
                          "type": "object",
                          "properties": {
                            "form": {
                              "type": "string",
                              "enum": [
                                "PERCENT",
                                "STATED_NONE",
                                "MENTIONED"
                              ]
                            },
                            "percent": {
                              "anyOf": [
                                {
                                  "type": "object",
                                  "properties": {
                                    "bp": {
                                      "type": "integer",
                                      "minimum": 1,
                                      "maximum": 5000
                                    },
                                    "quote": {
                                      "type": "string",
                                      "maxLength": 200
                                    }
                                  },
                                  "required": [
                                    "bp",
                                    "quote"
                                  ],
                                  "additionalProperties": false
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "authority": {
                              "type": "object",
                              "properties": {
                                "kind": {
                                  "anyOf": [
                                    {
                                      "type": "string",
                                      "enum": [
                                        "STATUTE",
                                        "AGREEMENT"
                                      ]
                                    },
                                    {
                                      "type": "null"
                                    }
                                  ]
                                },
                                "quote": {
                                  "anyOf": [
                                    {
                                      "type": "string",
                                      "maxLength": 200
                                    },
                                    {
                                      "type": "null"
                                    }
                                  ]
                                }
                              },
                              "required": [
                                "kind",
                                "quote"
                              ],
                              "additionalProperties": false
                            },
                            "timing": {
                              "anyOf": [
                                {
                                  "type": "object",
                                  "properties": {
                                    "quote": {
                                      "type": "string",
                                      "maxLength": 200
                                    }
                                  },
                                  "required": [
                                    "quote"
                                  ],
                                  "additionalProperties": false
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "confidenceBp": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 10000
                            },
                            "promptVersion": {
                              "type": "string"
                            }
                          },
                          "required": [
                            "form",
                            "percent",
                            "authority",
                            "timing",
                            "confidenceBp",
                            "promptVersion"
                          ],
                          "additionalProperties": false
                        },
                        "why": {
                          "type": "null"
                        }
                      },
                      "required": [
                        "drafted",
                        "why"
                      ],
                      "additionalProperties": false
                    },
                    {
                      "type": "object",
                      "properties": {
                        "drafted": {
                          "type": "null"
                        },
                        "why": {
                          "type": "string",
                          "enum": [
                            "DISCLOSURE",
                            "BUDGET",
                            "PROVIDER",
                            "UNPARSABLE",
                            "REFUSED",
                            "NO_DOCUMENT",
                            "NOTHING_STATED",
                            "STOPPED_AFTER_THREE_OVERRIDES",
                            "TRUNCATED",
                            "UNSAFE_ANSWER",
                            "DECLINED_BEFORE",
                            "NOT_A_DRAFT"
                          ]
                        }
                      },
                      "required": [
                        "drafted",
                        "why"
                      ],
                      "additionalProperties": false
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "404": {
            "$ref": "#/components/responses/Problem404"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      }
    },
    "/v1/bills/{billId}/holdback/none": {
      "post": {
        "operationId": "markBillHoldbackNone",
        "summary": "Records that a bill has no holdback.",
        "description": "Records that a bill has no holdback. Needs the `ledger:propose` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "purchases"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:propose",
        "parameters": [
          {
            "name": "billId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "note": {
                    "type": "string",
                    "minLength": 10,
                    "maxLength": 200
                  }
                },
                "required": [
                  "note"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "Ledger-Position": {
                "$ref": "#/components/headers/LedgerPosition"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "billId": {
                      "type": "string"
                    },
                    "holdback": {
                      "$ref": "#/components/schemas/Holdback"
                    }
                  },
                  "required": [
                    "billId",
                    "holdback"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem400"
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "404": {
            "$ref": "#/components/responses/Problem404"
          },
          "409": {
            "$ref": "#/components/responses/Problem409"
          },
          "412": {
            "$ref": "#/components/responses/Problem412"
          },
          "422": {
            "$ref": "#/components/responses/Problem422"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      }
    },
    "/v1/bills/{billId}/holdback/release": {
      "post": {
        "operationId": "prepareBillHoldbackRelease",
        "summary": "Prepares the release of a bill's holdback.",
        "description": "Prepares the release of a bill's holdback. Needs the `ledger:propose` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "purchases"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:propose",
        "parameters": [
          {
            "name": "billId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "amountMinor": {
                    "type": "string",
                    "pattern": "^-?\\d+$"
                  },
                  "releasedOn": {
                    "type": "string",
                    "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                  },
                  "note": {
                    "type": "string",
                    "maxLength": 200
                  },
                  "submit": {
                    "default": false,
                    "type": "boolean"
                  }
                },
                "required": [
                  "releasedOn"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "Ledger-Position": {
                "$ref": "#/components/headers/LedgerPosition"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "releaseBillId": {
                      "type": "string"
                    },
                    "holdback": {
                      "$ref": "#/components/schemas/Holdback"
                    }
                  },
                  "required": [
                    "releaseBillId",
                    "holdback"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem400"
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "404": {
            "$ref": "#/components/responses/Problem404"
          },
          "409": {
            "$ref": "#/components/responses/Problem409"
          },
          "412": {
            "$ref": "#/components/responses/Problem412"
          },
          "422": {
            "$ref": "#/components/responses/Problem422"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      }
    },
    "/v1/bills/{billId}/itc-evidence": {
      "post": {
        "operationId": "stateBillItcEvidence",
        "summary": "Records the evidence that supports the input tax credit on a bill.",
        "description": "Records the evidence that supports the input tax credit on a bill. Needs the `ledger:propose` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "purchases"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:propose",
        "parameters": [
          {
            "name": "billId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "recipientShown": {
                    "type": "boolean"
                  },
                  "recipientAsPrinted": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 200
                  },
                  "termsShown": {
                    "type": "boolean"
                  },
                  "termsAsPrinted": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 120
                  },
                  "descriptionsShown": {
                    "type": "boolean"
                  },
                  "registrationSeen": {
                    "type": "string",
                    "pattern": "^\\d{9}RT\\d{4}$"
                  },
                  "heldElsewhere": {
                    "default": false,
                    "type": "boolean"
                  },
                  "note": {
                    "type": "string",
                    "maxLength": 500
                  },
                  "afterStatementId": {
                    "anyOf": [
                      {
                        "type": "string",
                        "minLength": 1
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "source": {
                    "default": "PERSON",
                    "type": "string",
                    "enum": [
                      "PERSON",
                      "AGENT_DRAFT",
                      "AGENT_DRAFT_EDITED"
                    ]
                  },
                  "draftPromptVersion": {
                    "type": "string",
                    "maxLength": 40
                  }
                },
                "required": [
                  "recipientShown",
                  "termsShown",
                  "afterStatementId"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "Ledger-Position": {
                "$ref": "#/components/headers/LedgerPosition"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "result": {
                      "type": "string",
                      "enum": [
                        "NOT_CLAIMED",
                        "PASSES",
                        "FAILS",
                        "UNTESTED"
                      ]
                    },
                    "basis": {
                      "anyOf": [
                        {
                          "type": "string",
                          "enum": [
                            "DOCUMENT",
                            "READING_MODEL",
                            "STATEMENT"
                          ]
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "claimedMinor": {
                      "type": "string",
                      "pattern": "^-?\\d+$"
                    },
                    "currency": {
                      "type": "string",
                      "pattern": "^[A-Z]{3}$"
                    },
                    "functionalTotalMinor": {
                      "anyOf": [
                        {
                          "type": "string",
                          "pattern": "^-?\\d+$"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "functionalCurrency": {
                      "type": "string",
                      "pattern": "^[A-Z]{3}$"
                    },
                    "tier": {
                      "anyOf": [
                        {
                          "type": "string",
                          "enum": [
                            "UNDER_LOWER",
                            "LOWER",
                            "UPPER"
                          ]
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "schedule": {
                      "type": "object",
                      "properties": {
                        "effectiveFrom": {
                          "type": "string",
                          "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                        },
                        "lowerMinor": {
                          "type": "string",
                          "pattern": "^-?\\d+$"
                        },
                        "upperMinor": {
                          "type": "string",
                          "pattern": "^-?\\d+$"
                        },
                        "source": {
                          "type": "string"
                        },
                        "amendedBy": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "status": {
                          "type": "string",
                          "enum": [
                            "READ",
                            "AWAITING_CPA"
                          ]
                        }
                      },
                      "required": [
                        "effectiveFrom",
                        "lowerMinor",
                        "upperMinor",
                        "source",
                        "amendedBy",
                        "status"
                      ],
                      "additionalProperties": false
                    },
                    "elements": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "element": {
                            "type": "string",
                            "enum": [
                              "DOCUMENT",
                              "SUPPLIER_NAME",
                              "DATE",
                              "TOTAL",
                              "REGISTRATION",
                              "TAX_SHOWN",
                              "RECIPIENT",
                              "TERMS",
                              "DESCRIPTIONS"
                            ]
                          },
                          "requiredFrom": {
                            "type": "string",
                            "enum": [
                              "ALWAYS",
                              "LOWER",
                              "UPPER"
                            ]
                          },
                          "state": {
                            "type": "string",
                            "enum": [
                              "SHOWN",
                              "MISSING",
                              "OTHER_NAME",
                              "NOT_READ",
                              "NOT_REQUIRED"
                            ]
                          },
                          "basis": {
                            "anyOf": [
                              {
                                "type": "string",
                                "enum": [
                                  "BILL",
                                  "RULE",
                                  "MODEL",
                                  "PERSON"
                                ]
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "asPrinted": {
                            "type": [
                              "string",
                              "null"
                            ]
                          }
                        },
                        "required": [
                          "element",
                          "requiredFrom",
                          "state",
                          "basis",
                          "asPrinted"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "untestedReason": {
                      "anyOf": [
                        {
                          "type": "string",
                          "enum": [
                            "NO_FUNCTIONAL_TOTAL",
                            "ELEMENTS_NOT_READ"
                          ]
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "statement": {
                      "anyOf": [
                        {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "string"
                            },
                            "by": {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string"
                                },
                                "name": {
                                  "type": "string"
                                }
                              },
                              "required": [
                                "id",
                                "name"
                              ],
                              "additionalProperties": false
                            },
                            "at": {
                              "type": "string",
                              "minLength": 20
                            },
                            "heldElsewhere": {
                              "type": "boolean"
                            },
                            "note": {
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "draftSource": {
                              "type": "string",
                              "enum": [
                                "PERSON",
                                "AGENT_DRAFT",
                                "AGENT_DRAFT_EDITED"
                              ]
                            }
                          },
                          "required": [
                            "id",
                            "by",
                            "at",
                            "heldElsewhere",
                            "note",
                            "draftSource"
                          ],
                          "additionalProperties": false
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "reading": {
                      "anyOf": [
                        {
                          "type": "object",
                          "properties": {
                            "at": {
                              "type": "string",
                              "minLength": 20
                            },
                            "recipientReadBy": {
                              "anyOf": [
                                {
                                  "type": "string",
                                  "enum": [
                                    "RULE",
                                    "MODEL"
                                  ]
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "termsReadBy": {
                              "anyOf": [
                                {
                                  "type": "string",
                                  "enum": [
                                    "RULE",
                                    "MODEL"
                                  ]
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "notReadReason": {
                              "anyOf": [
                                {
                                  "type": "string",
                                  "enum": [
                                    "BELOW_UPPER",
                                    "NOT_CLAIMED",
                                    "DISCLOSURE",
                                    "BUDGET",
                                    "PROVIDER",
                                    "REFUSED",
                                    "TRUNCATED",
                                    "UNPARSABLE",
                                    "QUOTE_NOT_IN_TEXT",
                                    "INSTRUCTION_IN_QUOTE",
                                    "RUN_TIME",
                                    "NOTHING_FOUND"
                                  ]
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "promptVersion": {
                              "type": [
                                "string",
                                "null"
                              ]
                            }
                          },
                          "required": [
                            "at",
                            "recipientReadBy",
                            "termsReadBy",
                            "notReadReason",
                            "promptVersion"
                          ],
                          "additionalProperties": false
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "window": {
                      "$ref": "#/components/schemas/Window2"
                    },
                    "windowUnavailable": {
                      "anyOf": [
                        {
                          "type": "string",
                          "enum": [
                            "NO_REGISTRATION",
                            "NOT_CLAIMED"
                          ]
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "mayState": {
                      "type": "boolean"
                    }
                  },
                  "required": [
                    "result",
                    "basis",
                    "claimedMinor",
                    "currency",
                    "functionalTotalMinor",
                    "functionalCurrency",
                    "tier",
                    "schedule",
                    "elements",
                    "untestedReason",
                    "statement",
                    "reading",
                    "window",
                    "windowUnavailable",
                    "mayState"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem400"
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "404": {
            "$ref": "#/components/responses/Problem404"
          },
          "409": {
            "$ref": "#/components/responses/Problem409"
          },
          "412": {
            "$ref": "#/components/responses/Problem412"
          },
          "422": {
            "$ref": "#/components/responses/Problem422"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      }
    },
    "/v1/bills/{billId}/itc-evidence/draft": {
      "post": {
        "operationId": "draftBillItcEvidence",
        "summary": "Drafts the evidence that supports the input tax credit on a bill.",
        "description": "Drafts the evidence that supports the input tax credit on a bill. Needs the `ledger:propose` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "purchases"
        ],
        "x-stability-level": "beta",
        "x-eternify-read": true,
        "x-scope": "ledger:propose",
        "parameters": [
          {
            "name": "billId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {},
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "drafted": {
                      "anyOf": [
                        {
                          "type": "object",
                          "properties": {
                            "recipientShown": {
                              "type": "boolean"
                            },
                            "recipientAsPrinted": {
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "termsShown": {
                              "type": "boolean"
                            },
                            "termsAsPrinted": {
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "recipientReadBy": {
                              "anyOf": [
                                {
                                  "type": "string",
                                  "enum": [
                                    "RULE",
                                    "MODEL"
                                  ]
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "termsReadBy": {
                              "anyOf": [
                                {
                                  "type": "string",
                                  "enum": [
                                    "RULE",
                                    "MODEL"
                                  ]
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            }
                          },
                          "required": [
                            "recipientShown",
                            "recipientAsPrinted",
                            "termsShown",
                            "termsAsPrinted",
                            "recipientReadBy",
                            "termsReadBy"
                          ],
                          "additionalProperties": false
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "why": {
                      "anyOf": [
                        {
                          "type": "string",
                          "enum": [
                            "NO_DOCUMENT",
                            "NOT_CLAIMED",
                            "DISCLOSURE",
                            "BUDGET",
                            "PROVIDER",
                            "UNREADABLE",
                            "UNPARSABLE",
                            "REFUSED",
                            "TRUNCATED",
                            "QUOTE_NOT_IN_TEXT",
                            "INSTRUCTION_IN_QUOTE",
                            "NOTHING_FOUND"
                          ]
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "promptVersion": {
                      "type": [
                        "string",
                        "null"
                      ]
                    }
                  },
                  "required": [
                    "drafted",
                    "why",
                    "promptVersion"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "404": {
            "$ref": "#/components/responses/Problem404"
          },
          "422": {
            "$ref": "#/components/responses/Problem422"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      }
    },
    "/v1/bills/{billId}/lines": {
      "get": {
        "operationId": "listBillLines",
        "summary": "Lists the lines of a bill.",
        "description": "Lists the lines of a bill. Needs the `ledger:read` permission. Stable: a change that breaks callers needs 365 days' notice.",
        "tags": [
          "purchases"
        ],
        "x-stability-level": "stable",
        "x-scope": "ledger:read",
        "parameters": [
          {
            "name": "billId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "revision",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 0,
              "maximum": 1000000
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "default": 50,
              "type": "integer",
              "minimum": 1,
              "maximum": 200
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 512
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "position": {
                            "type": "integer",
                            "minimum": 0,
                            "maximum": 9007199254740991
                          },
                          "description": {
                            "type": "string"
                          },
                          "account": {
                            "$ref": "#/components/schemas/Account"
                          },
                          "quantity": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "unitPriceMinor": {
                            "anyOf": [
                              {
                                "type": "string",
                                "pattern": "^-?\\d+$"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "amountMinor": {
                            "type": "string",
                            "pattern": "^-?\\d+$"
                          },
                          "taxAsPrintedMinor": {
                            "anyOf": [
                              {
                                "type": "string",
                                "pattern": "^-?\\d+$"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "supplyCategory": {
                            "anyOf": [
                              {
                                "type": "string",
                                "enum": [
                                  "GOODS",
                                  "SERVICES",
                                  "INTANGIBLE_PROPERTY",
                                  "REAL_PROPERTY"
                                ]
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "taxAmountMinor": {
                            "anyOf": [
                              {
                                "type": "string",
                                "pattern": "^-?\\d+$"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "taxProvincialAmountMinor": {
                            "anyOf": [
                              {
                                "type": "string",
                                "pattern": "^-?\\d+$"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "dimensions": {
                            "$ref": "#/components/schemas/Dimensions"
                          },
                          "servicePeriodStart": {
                            "anyOf": [
                              {
                                "type": "string",
                                "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "servicePeriodEnd": {
                            "anyOf": [
                              {
                                "type": "string",
                                "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "purchaseOrderLine": {
                            "$ref": "#/components/schemas/PurchaseOrderLine"
                          },
                          "customFields": {
                            "description": "The line's own fields, by the field's key.",
                            "type": "object",
                            "propertyNames": {
                              "type": "string"
                            },
                            "additionalProperties": {
                              "type": [
                                "string",
                                "boolean"
                              ]
                            },
                            "x-stability-level": "beta"
                          },
                          "carriedFrom": {
                            "$ref": "#/components/schemas/CarriedFrom"
                          }
                        },
                        "required": [
                          "id",
                          "position",
                          "description",
                          "account",
                          "quantity",
                          "unitPriceMinor",
                          "amountMinor",
                          "taxAsPrintedMinor",
                          "supplyCategory",
                          "taxAmountMinor",
                          "taxProvincialAmountMinor",
                          "dimensions",
                          "servicePeriodStart",
                          "servicePeriodEnd",
                          "purchaseOrderLine"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "nextCursor": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "total": {
                      "anyOf": [
                        {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  },
                  "required": [
                    "data",
                    "nextCursor",
                    "total"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "404": {
            "$ref": "#/components/responses/Problem404"
          },
          "422": {
            "$ref": "#/components/responses/Problem422"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      }
    },
    "/v1/bills/{billId}/match": {
      "get": {
        "operationId": "getBillMatch",
        "summary": "Returns how a bill matches the purchase orders and receipts it refers to.",
        "description": "Returns how a bill matches the purchase orders and receipts it refers to. Needs the `ledger:read` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "purchases"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:read",
        "parameters": [
          {
            "name": "billId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetBillMatchResponse"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "404": {
            "$ref": "#/components/responses/Problem404"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      }
    },
    "/v1/bills/{billId}/order-links": {
      "post": {
        "operationId": "setBillOrderLinks",
        "summary": "Sets the purchase order lines a bill is matched to.",
        "description": "Sets the purchase order lines a bill is matched to. Needs the `ledger:propose` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "purchases"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:propose",
        "parameters": [
          {
            "name": "billId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "links": {
                    "minItems": 1,
                    "maxItems": 100,
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "position": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 9007199254740991
                        },
                        "purchaseOrderLineId": {
                          "anyOf": [
                            {
                              "type": "string",
                              "minLength": 1
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "proposedOrder": {
                          "type": "object",
                          "properties": {
                            "basis": {
                              "type": "string",
                              "enum": [
                                "DOCUMENT_NUMBER",
                                "SUPPLIER_ITEM",
                                "PRICE_AND_QUANTITY",
                                "MODEL"
                              ]
                            },
                            "orderReference": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 80
                            }
                          },
                          "required": [
                            "basis"
                          ],
                          "additionalProperties": false
                        }
                      },
                      "required": [
                        "position",
                        "purchaseOrderLineId"
                      ],
                      "additionalProperties": false
                    }
                  }
                },
                "required": [
                  "links"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "Ledger-Position": {
                "$ref": "#/components/headers/LedgerPosition"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetBillMatchResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem400"
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "404": {
            "$ref": "#/components/responses/Problem404"
          },
          "409": {
            "$ref": "#/components/responses/Problem409"
          },
          "412": {
            "$ref": "#/components/responses/Problem412"
          },
          "422": {
            "$ref": "#/components/responses/Problem422"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      }
    },
    "/v1/bills/{billId}/plan": {
      "post": {
        "operationId": "planBill",
        "summary": "Sets the payment plan of a bill.",
        "description": "Sets the payment plan of a bill. Needs the `ledger:propose` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "purchases"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:propose",
        "parameters": [
          {
            "name": "billId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "on": {
                    "type": "string",
                    "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                  }
                },
                "required": [
                  "on"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "Ledger-Position": {
                "$ref": "#/components/headers/LedgerPosition"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PlanBillResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem400"
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "404": {
            "$ref": "#/components/responses/Problem404"
          },
          "409": {
            "$ref": "#/components/responses/Problem409"
          },
          "412": {
            "$ref": "#/components/responses/Problem412"
          },
          "422": {
            "$ref": "#/components/responses/Problem422"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      }
    },
    "/v1/bills/{billId}/plan/clear": {
      "post": {
        "operationId": "clearBillPlan",
        "summary": "Clears the payment plan of a bill.",
        "description": "Clears the payment plan of a bill. Needs the `ledger:propose` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "purchases"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:propose",
        "parameters": [
          {
            "name": "billId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {},
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "Ledger-Position": {
                "$ref": "#/components/headers/LedgerPosition"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PlanBillResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem400"
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "404": {
            "$ref": "#/components/responses/Problem404"
          },
          "409": {
            "$ref": "#/components/responses/Problem409"
          },
          "412": {
            "$ref": "#/components/responses/Problem412"
          },
          "422": {
            "$ref": "#/components/responses/Problem422"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      }
    },
    "/v1/bills/{billId}/prepaid-plan": {
      "get": {
        "operationId": "getBillPrepaidPlan",
        "summary": "Returns the prepaid plan a bill is spread over.",
        "description": "Returns the prepaid plan a bill is spread over. Needs the `statements:read` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "purchases"
        ],
        "x-stability-level": "beta",
        "x-scope": "statements:read",
        "parameters": [
          {
            "name": "billId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "billId": {
                      "type": "string"
                    },
                    "entityId": {
                      "type": "string"
                    },
                    "entityName": {
                      "type": "string"
                    },
                    "entityTimeZone": {
                      "type": "string"
                    },
                    "currency": {
                      "type": "string",
                      "pattern": "^[A-Z]{3}$"
                    },
                    "measuredOn": {
                      "type": "string",
                      "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                    },
                    "postingMoved": {
                      "type": "boolean"
                    },
                    "floorMinor": {
                      "type": "string",
                      "pattern": "^-?\\d+$"
                    },
                    "planned": {
                      "maxItems": 100,
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "position": {
                            "type": "integer",
                            "minimum": 0,
                            "maximum": 9007199254740991
                          },
                          "lineNumber": {
                            "type": "integer",
                            "minimum": 1,
                            "maximum": 9007199254740991
                          },
                          "description": {
                            "type": "string"
                          },
                          "prepaidAccount": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string"
                              },
                              "code": {
                                "type": "string"
                              },
                              "name": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "id",
                              "code",
                              "name"
                            ],
                            "additionalProperties": false
                          },
                          "releaseAccount": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string"
                              },
                              "code": {
                                "type": "string"
                              },
                              "name": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "id",
                              "code",
                              "name"
                            ],
                            "additionalProperties": false
                          },
                          "servicePeriodStart": {
                            "type": "string",
                            "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                          },
                          "servicePeriodEnd": {
                            "type": "string",
                            "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                          },
                          "monthCount": {
                            "type": "integer",
                            "minimum": 1,
                            "maximum": 60
                          },
                          "method": {
                            "type": "string",
                            "enum": [
                              "BY_MONTH",
                              "BY_DAY"
                            ]
                          },
                          "foldedMonths": {
                            "type": "integer",
                            "minimum": 0,
                            "maximum": 9007199254740991
                          },
                          "estimatedMinor": {
                            "type": "string",
                            "pattern": "^-?\\d+$"
                          },
                          "rows": {
                            "maxItems": 60,
                            "type": "array",
                            "items": {
                              "type": "object",
                              "properties": {
                                "position": {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 9007199254740991
                                },
                                "periodStart": {
                                  "type": "string",
                                  "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                                },
                                "amountMinor": {
                                  "type": "string",
                                  "pattern": "^-?\\d+$"
                                },
                                "foldedMonths": {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 9007199254740991
                                }
                              },
                              "required": [
                                "position",
                                "periodStart",
                                "amountMinor",
                                "foldedMonths"
                              ],
                              "additionalProperties": false
                            }
                          },
                          "currency": {
                            "type": "string",
                            "pattern": "^[A-Z]{3}$"
                          }
                        },
                        "required": [
                          "position",
                          "lineNumber",
                          "description",
                          "prepaidAccount",
                          "releaseAccount",
                          "servicePeriodStart",
                          "servicePeriodEnd",
                          "monthCount",
                          "method",
                          "foldedMonths",
                          "estimatedMinor",
                          "rows",
                          "currency"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "notPlanned": {
                      "maxItems": 100,
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "position": {
                            "type": "integer",
                            "minimum": 0,
                            "maximum": 9007199254740991
                          },
                          "lineNumber": {
                            "type": "integer",
                            "minimum": 1,
                            "maximum": 9007199254740991
                          },
                          "reason": {
                            "type": "string",
                            "enum": [
                              "NO_PERIOD",
                              "NOT_EXPENSE",
                              "PERIOD_ENDS_BY_POSTING",
                              "PERIOD_BEFORE_POSTING",
                              "NO_PREPAID_ACCOUNT",
                              "NO_RATE",
                              "TOO_LONG",
                              "BELOW_FLOOR",
                              "TOO_SMALL",
                              "LINE_UNCODED"
                            ]
                          }
                        },
                        "required": [
                          "position",
                          "lineNumber",
                          "reason"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "digest": {
                      "anyOf": [
                        {
                          "type": "string",
                          "pattern": "^[0-9a-f]{16}$"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "readAt": {
                      "type": "string",
                      "minLength": 20
                    }
                  },
                  "required": [
                    "billId",
                    "entityId",
                    "entityName",
                    "entityTimeZone",
                    "currency",
                    "measuredOn",
                    "postingMoved",
                    "floorMinor",
                    "planned",
                    "notPlanned",
                    "digest",
                    "readAt"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "404": {
            "$ref": "#/components/responses/Problem404"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      }
    },
    "/v1/bills/{billId}/prepaid-schedules": {
      "get": {
        "operationId": "listBillPrepaidSchedules",
        "summary": "Lists the prepaid schedules a bill creates.",
        "description": "Lists the prepaid schedules a bill creates. Needs the `statements:read` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "purchases"
        ],
        "x-stability-level": "beta",
        "x-scope": "statements:read",
        "parameters": [
          {
            "name": "billId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "default": 20,
              "type": "integer",
              "minimum": 1,
              "maximum": 50
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 512
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "items": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "billId": {
                            "type": "string"
                          },
                          "linePosition": {
                            "type": "integer",
                            "minimum": 0,
                            "maximum": 9007199254740991
                          },
                          "lineNumber": {
                            "type": "integer",
                            "minimum": 1,
                            "maximum": 9007199254740991
                          },
                          "description": {
                            "type": "string"
                          },
                          "status": {
                            "type": "string",
                            "enum": [
                              "ACTIVE",
                              "COMPLETE",
                              "DECLINED",
                              "VOID"
                            ]
                          },
                          "method": {
                            "type": "string",
                            "enum": [
                              "BY_MONTH",
                              "BY_DAY"
                            ]
                          },
                          "periodStart": {
                            "type": "string",
                            "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                          },
                          "periodEnd": {
                            "type": "string",
                            "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                          },
                          "prepaidAccount": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string"
                              },
                              "code": {
                                "type": "string"
                              },
                              "name": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "id",
                              "code",
                              "name"
                            ],
                            "additionalProperties": false
                          },
                          "releaseAccount": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string"
                              },
                              "code": {
                                "type": "string"
                              },
                              "name": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "id",
                              "code",
                              "name"
                            ],
                            "additionalProperties": false
                          },
                          "totalMinor": {
                            "anyOf": [
                              {
                                "type": "string",
                                "pattern": "^-?\\d+$"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "releasedMinor": {
                            "type": "string",
                            "pattern": "^-?\\d+$"
                          },
                          "remainingMinor": {
                            "type": "string",
                            "pattern": "^-?\\d+$"
                          },
                          "monthsReleased": {
                            "type": "integer",
                            "minimum": 0,
                            "maximum": 9007199254740991
                          },
                          "monthCount": {
                            "type": "integer",
                            "minimum": 1,
                            "maximum": 9007199254740991
                          },
                          "decidedBy": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string"
                              },
                              "name": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "id",
                              "name"
                            ],
                            "additionalProperties": false
                          },
                          "decidedAt": {
                            "type": "string",
                            "minLength": 20
                          },
                          "declineReason": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "endedEarlyAt": {
                            "anyOf": [
                              {
                                "type": "string",
                                "minLength": 20
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "completedAt": {
                            "anyOf": [
                              {
                                "type": "string",
                                "minLength": 20
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "restoredByScheduleId": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "rows": {
                            "maxItems": 60,
                            "type": "array",
                            "items": {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string"
                                },
                                "position": {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 9007199254740991
                                },
                                "periodStart": {
                                  "type": "string",
                                  "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                                },
                                "amountMinor": {
                                  "type": "string",
                                  "pattern": "^-?\\d+$"
                                },
                                "foldedMonths": {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 9007199254740991
                                },
                                "status": {
                                  "type": "string",
                                  "enum": [
                                    "SCHEDULED",
                                    "PROPOSED",
                                    "POSTED",
                                    "VOID"
                                  ]
                                },
                                "endedEarly": {
                                  "type": "boolean"
                                },
                                "entryId": {
                                  "type": [
                                    "string",
                                    "null"
                                  ]
                                },
                                "entryNumber": {
                                  "anyOf": [
                                    {
                                      "type": "integer",
                                      "minimum": -9007199254740991,
                                      "maximum": 9007199254740991
                                    },
                                    {
                                      "type": "null"
                                    }
                                  ]
                                },
                                "proposalId": {
                                  "type": [
                                    "string",
                                    "null"
                                  ]
                                },
                                "effectiveState": {
                                  "type": "string",
                                  "enum": [
                                    "SCHEDULED",
                                    "PROPOSED",
                                    "POSTED",
                                    "VOID"
                                  ]
                                }
                              },
                              "required": [
                                "id",
                                "position",
                                "periodStart",
                                "amountMinor",
                                "foldedMonths",
                                "status",
                                "endedEarly",
                                "entryId",
                                "entryNumber",
                                "proposalId",
                                "effectiveState"
                              ],
                              "additionalProperties": false
                            }
                          },
                          "identityOk": {
                            "type": "boolean"
                          }
                        },
                        "required": [
                          "id",
                          "billId",
                          "linePosition",
                          "lineNumber",
                          "description",
                          "status",
                          "method",
                          "periodStart",
                          "periodEnd",
                          "prepaidAccount",
                          "releaseAccount",
                          "totalMinor",
                          "releasedMinor",
                          "remainingMinor",
                          "monthsReleased",
                          "monthCount",
                          "decidedBy",
                          "decidedAt",
                          "declineReason",
                          "endedEarlyAt",
                          "completedAt",
                          "rows",
                          "identityOk"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "total": {
                      "type": "integer",
                      "minimum": 0,
                      "maximum": 9007199254740991
                    },
                    "nextCursor": {
                      "type": [
                        "string",
                        "null"
                      ]
                    }
                  },
                  "required": [
                    "items",
                    "total",
                    "nextCursor"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "404": {
            "$ref": "#/components/responses/Problem404"
          },
          "422": {
            "$ref": "#/components/responses/Problem422"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      }
    },
    "/v1/bills/{billId}/question-brief": {
      "post": {
        "operationId": "draftBillQuestion",
        "summary": "Drafts a question about a bill for a person to send to the vendor.",
        "description": "Drafts a question about a bill for a person to send to the vendor. Needs the `ledger:propose` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "purchases"
        ],
        "x-stability-level": "beta",
        "x-eternify-read": true,
        "x-scope": "ledger:propose",
        "parameters": [
          {
            "name": "billId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "topic": {
                    "type": "string",
                    "enum": [
                      "AMOUNT",
                      "SUPPLIER",
                      "CODING",
                      "TAX",
                      "DUPLICATE"
                    ]
                  }
                },
                "required": [
                  "topic"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "drafted": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "why": {
                      "type": "string",
                      "enum": [
                        "DISCLOSURE",
                        "BUDGET",
                        "PROVIDER",
                        "UNPARSABLE",
                        "REFUSED",
                        "FIGURE_INVENTED",
                        "UNCITED",
                        "NO_FACTS",
                        "STOPPED_AFTER_THREE_DISCARDS"
                      ]
                    },
                    "promptVersion": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "usedFacts": {
                      "$ref": "#/components/schemas/Facts"
                    }
                  },
                  "required": [
                    "drafted",
                    "promptVersion",
                    "usedFacts"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "404": {
            "$ref": "#/components/responses/Problem404"
          },
          "422": {
            "$ref": "#/components/responses/Problem422"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      }
    },
    "/v1/bills/{billId}/question-facts": {
      "get": {
        "operationId": "getBillQuestionFacts",
        "summary": "Returns the facts a question about a bill is built from.",
        "description": "Returns the facts a question about a bill is built from. Needs the `ledger:read` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "purchases"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:read",
        "parameters": [
          {
            "name": "billId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "billId": {
                      "type": "string"
                    },
                    "billName": {
                      "type": "string"
                    },
                    "promptVersion": {
                      "type": "string"
                    },
                    "topics": {
                      "minItems": 6,
                      "maxItems": 6,
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "topic": {
                            "type": "string",
                            "enum": [
                              "AMOUNT",
                              "SUPPLIER",
                              "CODING",
                              "TAX",
                              "DUPLICATE",
                              "OTHER"
                            ]
                          },
                          "facts": {
                            "$ref": "#/components/schemas/Facts"
                          },
                          "starter": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "open": {
                            "anyOf": [
                              {
                                "type": "object",
                                "properties": {
                                  "questionId": {
                                    "type": "string"
                                  },
                                  "askedBy": {
                                    "type": "object",
                                    "properties": {
                                      "id": {
                                        "type": "string"
                                      },
                                      "name": {
                                        "type": "string"
                                      }
                                    },
                                    "required": [
                                      "id",
                                      "name"
                                    ],
                                    "additionalProperties": false
                                  },
                                  "askedOf": {
                                    "anyOf": [
                                      {
                                        "type": "object",
                                        "properties": {
                                          "id": {
                                            "type": "string"
                                          },
                                          "name": {
                                            "type": "string"
                                          }
                                        },
                                        "required": [
                                          "id",
                                          "name"
                                        ],
                                        "additionalProperties": false
                                      },
                                      {
                                        "type": "null"
                                      }
                                    ]
                                  },
                                  "askedAt": {
                                    "type": "string",
                                    "minLength": 20
                                  },
                                  "status": {
                                    "type": "string",
                                    "enum": [
                                      "OPEN",
                                      "ANSWERED"
                                    ]
                                  }
                                },
                                "required": [
                                  "questionId",
                                  "askedBy",
                                  "askedOf",
                                  "askedAt",
                                  "status"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "draft": {
                            "type": "object",
                            "properties": {
                              "offered": {
                                "type": "boolean"
                              },
                              "why": {
                                "anyOf": [
                                  {
                                    "type": "string",
                                    "enum": [
                                      "DISCLOSURE",
                                      "BUDGET",
                                      "PROVIDER",
                                      "UNPARSABLE",
                                      "REFUSED",
                                      "FIGURE_INVENTED",
                                      "UNCITED",
                                      "NO_FACTS",
                                      "STOPPED_AFTER_THREE_DISCARDS"
                                    ]
                                  },
                                  {
                                    "type": "null"
                                  }
                                ]
                              }
                            },
                            "required": [
                              "offered",
                              "why"
                            ],
                            "additionalProperties": false
                          }
                        },
                        "required": [
                          "topic",
                          "facts",
                          "starter",
                          "open",
                          "draft"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "facts": {
                      "type": "array",
                      "items": {
                        "oneOf": [
                          {
                            "type": "object",
                            "properties": {
                              "topic": {
                                "type": "string",
                                "enum": [
                                  "AMOUNT",
                                  "SUPPLIER",
                                  "CODING",
                                  "TAX",
                                  "DUPLICATE",
                                  "OTHER"
                                ]
                              },
                              "sources": {
                                "$ref": "#/components/schemas/Sources"
                              },
                              "kind": {
                                "type": "string",
                                "const": "AMOUNT_ABOVE_RECENT"
                              },
                              "totalMinor": {
                                "type": "string",
                                "pattern": "^-?\\d+$"
                              },
                              "currency": {
                                "type": "string",
                                "pattern": "^[A-Z]{3}$"
                              },
                              "priorCount": {
                                "type": "integer",
                                "minimum": 2,
                                "maximum": 3
                              },
                              "largestPriorMinor": {
                                "type": "string",
                                "pattern": "^-?\\d+$"
                              },
                              "aboveByMinor": {
                                "type": "string",
                                "pattern": "^-?\\d+$"
                              }
                            },
                            "required": [
                              "topic",
                              "sources",
                              "kind",
                              "totalMinor",
                              "currency",
                              "priorCount",
                              "largestPriorMinor",
                              "aboveByMinor"
                            ],
                            "additionalProperties": false
                          },
                          {
                            "type": "object",
                            "properties": {
                              "topic": {
                                "type": "string",
                                "enum": [
                                  "AMOUNT",
                                  "SUPPLIER",
                                  "CODING",
                                  "TAX",
                                  "DUPLICATE",
                                  "OTHER"
                                ]
                              },
                              "sources": {
                                "$ref": "#/components/schemas/Sources"
                              },
                              "kind": {
                                "type": "string",
                                "const": "FIRST_FROM_SUPPLIER"
                              }
                            },
                            "required": [
                              "topic",
                              "sources",
                              "kind"
                            ],
                            "additionalProperties": false
                          },
                          {
                            "type": "object",
                            "properties": {
                              "topic": {
                                "type": "string",
                                "enum": [
                                  "AMOUNT",
                                  "SUPPLIER",
                                  "CODING",
                                  "TAX",
                                  "DUPLICATE",
                                  "OTHER"
                                ]
                              },
                              "sources": {
                                "$ref": "#/components/schemas/Sources"
                              },
                              "kind": {
                                "type": "string",
                                "const": "SUPPLIER_NOT_ON_LIST"
                              }
                            },
                            "required": [
                              "topic",
                              "sources",
                              "kind"
                            ],
                            "additionalProperties": false
                          },
                          {
                            "type": "object",
                            "properties": {
                              "topic": {
                                "type": "string",
                                "enum": [
                                  "AMOUNT",
                                  "SUPPLIER",
                                  "CODING",
                                  "TAX",
                                  "DUPLICATE",
                                  "OTHER"
                                ]
                              },
                              "sources": {
                                "$ref": "#/components/schemas/Sources"
                              },
                              "kind": {
                                "type": "string",
                                "const": "SENDER_OR_BANKING_CHECK_OPEN"
                              },
                              "signalKinds": {
                                "type": "array",
                                "items": {
                                  "type": "string"
                                }
                              }
                            },
                            "required": [
                              "topic",
                              "sources",
                              "kind",
                              "signalKinds"
                            ],
                            "additionalProperties": false
                          },
                          {
                            "type": "object",
                            "properties": {
                              "topic": {
                                "type": "string",
                                "enum": [
                                  "AMOUNT",
                                  "SUPPLIER",
                                  "CODING",
                                  "TAX",
                                  "DUPLICATE",
                                  "OTHER"
                                ]
                              },
                              "sources": {
                                "$ref": "#/components/schemas/Sources"
                              },
                              "kind": {
                                "type": "string",
                                "const": "ACCOUNT_NEW_FOR_SUPPLIER"
                              },
                              "accounts": {
                                "maxItems": 3,
                                "type": "array",
                                "items": {
                                  "type": "object",
                                  "properties": {
                                    "code": {
                                      "type": "string"
                                    },
                                    "name": {
                                      "type": "string"
                                    }
                                  },
                                  "required": [
                                    "code",
                                    "name"
                                  ],
                                  "additionalProperties": false
                                }
                              },
                              "moreAccounts": {
                                "type": "integer",
                                "minimum": 0,
                                "maximum": 9007199254740991
                              }
                            },
                            "required": [
                              "topic",
                              "sources",
                              "kind",
                              "accounts",
                              "moreAccounts"
                            ],
                            "additionalProperties": false
                          },
                          {
                            "type": "object",
                            "properties": {
                              "topic": {
                                "type": "string",
                                "enum": [
                                  "AMOUNT",
                                  "SUPPLIER",
                                  "CODING",
                                  "TAX",
                                  "DUPLICATE",
                                  "OTHER"
                                ]
                              },
                              "sources": {
                                "$ref": "#/components/schemas/Sources"
                              },
                              "kind": {
                                "type": "string",
                                "const": "TAX_DIFFERS_FROM_PAPER"
                              },
                              "findingCodes": {
                                "type": "array",
                                "items": {
                                  "type": "string"
                                }
                              }
                            },
                            "required": [
                              "topic",
                              "sources",
                              "kind",
                              "findingCodes"
                            ],
                            "additionalProperties": false
                          },
                          {
                            "type": "object",
                            "properties": {
                              "topic": {
                                "type": "string",
                                "enum": [
                                  "AMOUNT",
                                  "SUPPLIER",
                                  "CODING",
                                  "TAX",
                                  "DUPLICATE",
                                  "OTHER"
                                ]
                              },
                              "sources": {
                                "$ref": "#/components/schemas/Sources"
                              },
                              "kind": {
                                "type": "string",
                                "const": "LOOKS_LIKE_A_DUPLICATE"
                              }
                            },
                            "required": [
                              "topic",
                              "sources",
                              "kind"
                            ],
                            "additionalProperties": false
                          }
                        ]
                      }
                    },
                    "defaultTopic": {
                      "type": "string",
                      "enum": [
                        "AMOUNT",
                        "SUPPLIER",
                        "CODING",
                        "TAX",
                        "DUPLICATE",
                        "OTHER"
                      ]
                    }
                  },
                  "required": [
                    "billId",
                    "billName",
                    "promptVersion",
                    "topics",
                    "facts",
                    "defaultTopic"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "404": {
            "$ref": "#/components/responses/Problem404"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      }
    },
    "/v1/bills/{billId}/questions": {
      "get": {
        "operationId": "listBillQuestions",
        "summary": "Lists the questions asked about a bill.",
        "description": "Lists the questions asked about a bill. Needs the `ledger:read` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "purchases"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:read",
        "parameters": [
          {
            "name": "billId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "default": 50,
              "type": "integer",
              "minimum": 1,
              "maximum": 200
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 512
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ListQuestionsResponse"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "404": {
            "$ref": "#/components/responses/Problem404"
          },
          "422": {
            "$ref": "#/components/responses/Problem422"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      }
    },
    "/v1/bills/{billId}/reading-record": {
      "get": {
        "operationId": "getBillReadingRecord",
        "summary": "Returns the record of how a bill was read from its document.",
        "description": "Returns the record of how a bill was read from its document. Needs the `ledger:read` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "purchases"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:read",
        "parameters": [
          {
            "name": "billId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "default": 50,
              "type": "integer",
              "minimum": 1,
              "maximum": 200
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 512
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "billId": {
                      "type": "string"
                    },
                    "documentId": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "extraction": {
                      "anyOf": [
                        {
                          "type": "object",
                          "properties": {
                            "readerId": {
                              "type": "string"
                            },
                            "readerLocation": {
                              "type": "string"
                            },
                            "pageCount": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 9007199254740991
                            },
                            "model": {
                              "type": "string"
                            },
                            "promptName": {
                              "type": "string"
                            },
                            "promptVersion": {
                              "type": "string"
                            },
                            "at": {
                              "type": "string",
                              "minLength": 20
                            }
                          },
                          "required": [
                            "readerId",
                            "readerLocation",
                            "pageCount",
                            "model",
                            "promptName",
                            "promptVersion",
                            "at"
                          ],
                          "additionalProperties": false
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "calls": {
                      "type": "object",
                      "properties": {
                        "data": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "at": {
                                "type": "string",
                                "minLength": 20
                              },
                              "feature": {
                                "type": "string"
                              },
                              "providerId": {
                                "type": "string"
                              },
                              "model": {
                                "type": "string"
                              },
                              "modelLocation": {
                                "type": "string"
                              },
                              "promptName": {
                                "type": "string"
                              },
                              "promptVersion": {
                                "type": "string"
                              },
                              "attempts": {
                                "type": "integer",
                                "minimum": 1,
                                "maximum": 9007199254740991
                              },
                              "providerCalls": {
                                "anyOf": [
                                  {
                                    "type": "integer",
                                    "minimum": 1,
                                    "maximum": 9007199254740991
                                  },
                                  {
                                    "type": "null"
                                  }
                                ]
                              },
                              "success": {
                                "type": "boolean"
                              },
                              "latencyMs": {
                                "type": "integer",
                                "minimum": 0,
                                "maximum": 9007199254740991
                              },
                              "costMicroCad": {
                                "type": "string",
                                "pattern": "^\\d{1,18}$"
                              },
                              "withheld": {
                                "type": "array",
                                "items": {
                                  "type": "string"
                                }
                              }
                            },
                            "required": [
                              "at",
                              "feature",
                              "providerId",
                              "model",
                              "modelLocation",
                              "promptName",
                              "promptVersion",
                              "attempts",
                              "providerCalls",
                              "success",
                              "latencyMs",
                              "costMicroCad",
                              "withheld"
                            ],
                            "additionalProperties": false
                          }
                        },
                        "nextCursor": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "total": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "minimum": -9007199254740991,
                              "maximum": 9007199254740991
                            },
                            {
                              "type": "null"
                            }
                          ]
                        }
                      },
                      "required": [
                        "data",
                        "nextCursor",
                        "total"
                      ],
                      "additionalProperties": false
                    },
                    "faults": {
                      "maxItems": 50,
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/ListAiProviderFaultsResponseItem"
                      }
                    },
                    "entityTimeZone": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "billId",
                    "documentId",
                    "extraction",
                    "calls",
                    "faults",
                    "entityTimeZone"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "404": {
            "$ref": "#/components/responses/Problem404"
          },
          "422": {
            "$ref": "#/components/responses/Problem422"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      }
    },
    "/v1/bills/{billId}/settlement-hint": {
      "post": {
        "operationId": "readBillSettlementHint",
        "summary": "Reads the hint that suggests how a bill's payment settles.",
        "description": "Reads the hint that suggests how a bill's payment settles. Needs the `ledger:propose` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "purchases"
        ],
        "x-stability-level": "beta",
        "x-eternify-read": true,
        "x-scope": "ledger:propose",
        "parameters": [
          {
            "name": "billId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "hint": {
                      "anyOf": [
                        {
                          "type": "object",
                          "properties": {
                            "method": {
                              "type": "string",
                              "enum": [
                                "CARD",
                                "PAD",
                                "CHEQUE",
                                "WIRE",
                                "ETRANSFER",
                                "OTHER",
                                "NOT_STATED"
                              ]
                            },
                            "settledOn": {
                              "anyOf": [
                                {
                                  "type": "string",
                                  "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "alreadyPaid": {
                              "type": "boolean"
                            },
                            "quote": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 300
                            },
                            "note": {
                              "type": "string",
                              "maxLength": 200
                            },
                            "lastFour": {
                              "anyOf": [
                                {
                                  "type": "string",
                                  "pattern": "^\\d{4}$"
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "matchedAccount": {
                              "anyOf": [
                                {
                                  "type": "object",
                                  "properties": {
                                    "id": {
                                      "type": "string"
                                    },
                                    "displayName": {
                                      "type": "string"
                                    }
                                  },
                                  "required": [
                                    "id",
                                    "displayName"
                                  ],
                                  "additionalProperties": false
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "priorMethods": {
                              "$ref": "#/components/schemas/PriorMethods"
                            },
                            "documentChars": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 9007199254740991
                            },
                            "readChars": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 9007199254740991
                            },
                            "promptVersion": {
                              "type": "string"
                            }
                          },
                          "required": [
                            "method",
                            "settledOn",
                            "alreadyPaid",
                            "quote",
                            "note",
                            "lastFour",
                            "matchedAccount",
                            "priorMethods",
                            "documentChars",
                            "readChars",
                            "promptVersion"
                          ],
                          "additionalProperties": false
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "why": {
                      "anyOf": [
                        {
                          "type": "string",
                          "enum": [
                            "NO_DOCUMENT",
                            "NO_PAYMENT_WORDS",
                            "UNREADABLE",
                            "DISCLOSURE",
                            "BUDGET",
                            "REFUSED",
                            "UNPARSABLE",
                            "QUOTE_NOT_IN_TEXT",
                            "PROVIDER"
                          ]
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  },
                  "required": [
                    "hint",
                    "why"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "404": {
            "$ref": "#/components/responses/Problem404"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      }
    },
    "/v1/bills/{billId}/settlements": {
      "get": {
        "operationId": "listBillSettlements",
        "summary": "Lists the settlements recorded against a bill.",
        "description": "Lists the settlements recorded against a bill. Needs the `ledger:read` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "purchases"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:read",
        "parameters": [
          {
            "name": "billId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "default": 50,
              "type": "integer",
              "minimum": 1,
              "maximum": 200
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 512
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/ListBillSettlementsResponseItem"
                      }
                    },
                    "nextCursor": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "total": {
                      "anyOf": [
                        {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  },
                  "required": [
                    "data",
                    "nextCursor",
                    "total"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "404": {
            "$ref": "#/components/responses/Problem404"
          },
          "422": {
            "$ref": "#/components/responses/Problem422"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      }
    },
    "/v1/bills/{billId}/settlements/{settlementId}/approve": {
      "post": {
        "operationId": "approveBillSettlement",
        "summary": "Approves a recorded settlement against a bill.",
        "description": "Approves a recorded settlement against a bill. Needs the `ledger:approve` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "purchases"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:approve",
        "parameters": [
          {
            "name": "billId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "settlementId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {},
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "Ledger-Position": {
                "$ref": "#/components/headers/LedgerPosition"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApproveBillSettlementResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem400"
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "404": {
            "$ref": "#/components/responses/Problem404"
          },
          "409": {
            "$ref": "#/components/responses/Problem409"
          },
          "412": {
            "$ref": "#/components/responses/Problem412"
          },
          "422": {
            "$ref": "#/components/responses/Problem422"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      }
    },
    "/v1/bills/{billId}/settlements/{settlementId}/void": {
      "post": {
        "operationId": "voidBillSettlement",
        "summary": "Voids a settlement recorded against a bill.",
        "description": "Voids a settlement recorded against a bill. Needs the `ledger:approve` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "purchases"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:approve",
        "parameters": [
          {
            "name": "billId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "settlementId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "reason": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 500
                  }
                },
                "required": [
                  "reason"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "Ledger-Position": {
                "$ref": "#/components/headers/LedgerPosition"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApproveBillSettlementResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem400"
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "404": {
            "$ref": "#/components/responses/Problem404"
          },
          "409": {
            "$ref": "#/components/responses/Problem409"
          },
          "412": {
            "$ref": "#/components/responses/Problem412"
          },
          "422": {
            "$ref": "#/components/responses/Problem422"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      }
    },
    "/v1/bills/{billId}/short-pay-brief": {
      "post": {
        "operationId": "draftShortPayReason",
        "summary": "Drafts the reason for a short payment on a bill.",
        "description": "Drafts the reason for a short payment on a bill. Needs the `ledger:propose` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "purchases"
        ],
        "x-stability-level": "beta",
        "x-eternify-read": true,
        "x-scope": "ledger:propose",
        "parameters": [
          {
            "name": "billId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "note": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 200
                  }
                },
                "required": [
                  "note"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "drafted": {
                      "anyOf": [
                        {
                          "type": "object",
                          "properties": {
                            "reason": {
                              "type": "string"
                            },
                            "language": {
                              "type": "string",
                              "enum": [
                                "en",
                                "fr"
                              ]
                            },
                            "gloss": {
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "promptVersion": {
                              "type": "string"
                            }
                          },
                          "required": [
                            "reason",
                            "language",
                            "gloss",
                            "promptVersion"
                          ],
                          "additionalProperties": false
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "why": {
                      "type": "string",
                      "enum": [
                        "DISCLOSURE",
                        "BUDGET",
                        "PROVIDER",
                        "UNPARSABLE",
                        "REFUSED",
                        "FIGURE_INVENTED",
                        "STOPPED_AFTER_THREE_REWRITES"
                      ]
                    }
                  },
                  "required": [
                    "drafted"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "404": {
            "$ref": "#/components/responses/Problem404"
          },
          "422": {
            "$ref": "#/components/responses/Problem422"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      }
    },
    "/v1/bills/{billId}/still-owed": {
      "post": {
        "operationId": "confirmBillStillOwed",
        "summary": "Confirms that a bill is still owed after a payment was looked at.",
        "description": "Confirms that a bill is still owed after a payment was looked at. Needs the `ledger:propose` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "purchases"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:propose",
        "parameters": [
          {
            "name": "billId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "note": {
                    "type": "string",
                    "maxLength": 500
                  }
                },
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "Ledger-Position": {
                "$ref": "#/components/headers/LedgerPosition"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RecordBillFxRateResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem400"
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "404": {
            "$ref": "#/components/responses/Problem404"
          },
          "409": {
            "$ref": "#/components/responses/Problem409"
          },
          "412": {
            "$ref": "#/components/responses/Problem412"
          },
          "422": {
            "$ref": "#/components/responses/Problem422"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      }
    },
    "/v1/bills/{billId}/submit": {
      "post": {
        "operationId": "submitBill",
        "summary": "Submits a bill for approval.",
        "description": "Submits a bill for approval. Needs the `ledger:propose` permission. Stable: a change that breaks callers needs 365 days' notice.",
        "tags": [
          "purchases"
        ],
        "x-stability-level": "stable",
        "x-scope": "ledger:propose",
        "parameters": [
          {
            "name": "billId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "note": {
                    "type": "string",
                    "maxLength": 500
                  }
                },
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "Ledger-Position": {
                "$ref": "#/components/headers/LedgerPosition"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RecordBillFxRateResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem400"
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "404": {
            "$ref": "#/components/responses/Problem404"
          },
          "409": {
            "$ref": "#/components/responses/Problem409"
          },
          "412": {
            "$ref": "#/components/responses/Problem412"
          },
          "422": {
            "$ref": "#/components/responses/Problem422"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      }
    },
    "/v1/bills/{billId}/supersede": {
      "post": {
        "operationId": "linkBillSupersede",
        "summary": "Records that one bill supersedes an earlier one.",
        "description": "Records that one bill supersedes an earlier one. Needs the `ledger:propose` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "purchases"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:propose",
        "parameters": [
          {
            "name": "billId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "supersedesBillId": {
                    "type": "string",
                    "minLength": 1
                  },
                  "note": {
                    "type": "string",
                    "maxLength": 500
                  }
                },
                "required": [
                  "supersedesBillId"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "Ledger-Position": {
                "$ref": "#/components/headers/LedgerPosition"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LinkBillSupersedeResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem400"
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "404": {
            "$ref": "#/components/responses/Problem404"
          },
          "409": {
            "$ref": "#/components/responses/Problem409"
          },
          "412": {
            "$ref": "#/components/responses/Problem412"
          },
          "422": {
            "$ref": "#/components/responses/Problem422"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      }
    },
    "/v1/bills/{billId}/supersede/remove": {
      "post": {
        "operationId": "removeBillSupersede",
        "summary": "Removes the record that one bill supersedes another.",
        "description": "Removes the record that one bill supersedes another. Needs the `ledger:propose` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "purchases"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:propose",
        "parameters": [
          {
            "name": "billId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "reason": {
                    "type": "string",
                    "maxLength": 500
                  }
                },
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "Ledger-Position": {
                "$ref": "#/components/headers/LedgerPosition"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LinkBillSupersedeResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem400"
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "404": {
            "$ref": "#/components/responses/Problem404"
          },
          "409": {
            "$ref": "#/components/responses/Problem409"
          },
          "412": {
            "$ref": "#/components/responses/Problem412"
          },
          "422": {
            "$ref": "#/components/responses/Problem422"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      }
    },
    "/v1/bills/{billId}/supplier": {
      "post": {
        "operationId": "setBillSupplier",
        "summary": "Sets the vendor a bill belongs to.",
        "description": "Sets the vendor a bill belongs to. Needs the `ledger:propose` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "purchases"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:propose",
        "parameters": [
          {
            "name": "billId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "vendorId": {
                    "type": "string",
                    "minLength": 1
                  },
                  "matchId": {
                    "type": "string",
                    "minLength": 1
                  },
                  "addAlias": {
                    "type": "boolean"
                  }
                },
                "required": [
                  "vendorId"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "Ledger-Position": {
                "$ref": "#/components/headers/LedgerPosition"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ListBillSupplierMatchesResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem400"
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "404": {
            "$ref": "#/components/responses/Problem404"
          },
          "409": {
            "$ref": "#/components/responses/Problem409"
          },
          "412": {
            "$ref": "#/components/responses/Problem412"
          },
          "422": {
            "$ref": "#/components/responses/Problem422"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      }
    },
    "/v1/bills/{billId}/supplier-matches": {
      "get": {
        "operationId": "listBillSupplierMatches",
        "summary": "Lists the vendors a bill may belong to.",
        "description": "Lists the vendors a bill may belong to. Needs the `ledger:read` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "purchases"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:read",
        "parameters": [
          {
            "name": "billId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ListBillSupplierMatchesResponse"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "404": {
            "$ref": "#/components/responses/Problem404"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      }
    },
    "/v1/bills/{billId}/supplier-matches/{matchId}/decline": {
      "post": {
        "operationId": "declineSupplierMatch",
        "summary": "Declines a suggested vendor match for a bill.",
        "description": "Declines a suggested vendor match for a bill. Needs the `ledger:propose` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "purchases"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:propose",
        "parameters": [
          {
            "name": "billId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "matchId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "reason": {
                    "type": "string",
                    "maxLength": 200
                  }
                },
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "Ledger-Position": {
                "$ref": "#/components/headers/LedgerPosition"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ListBillSupplierMatchesResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem400"
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "404": {
            "$ref": "#/components/responses/Problem404"
          },
          "409": {
            "$ref": "#/components/responses/Problem409"
          },
          "412": {
            "$ref": "#/components/responses/Problem412"
          },
          "422": {
            "$ref": "#/components/responses/Problem422"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      }
    },
    "/v1/bills/{billId}/supplier-notice-facts": {
      "get": {
        "operationId": "getSupplierNoticeFacts",
        "summary": "Returns the facts a supplier notice about a bill is built from.",
        "description": "Returns the facts a supplier notice about a bill is built from. Needs the `ledger:read` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "purchases"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:read",
        "parameters": [
          {
            "name": "billId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "kind",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "BILL_APPROVED",
                "BILL_HELD",
                "BILL_DECLINED",
                "CORRECTION_ASKED"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "kind": {
                      "type": "string",
                      "enum": [
                        "BILL_APPROVED",
                        "BILL_HELD",
                        "BILL_DECLINED",
                        "CORRECTION_ASKED"
                      ]
                    },
                    "offer": {
                      "oneOf": [
                        {
                          "type": "object",
                          "properties": {
                            "offered": {
                              "type": "boolean",
                              "const": true
                            },
                            "ticked": {
                              "type": "boolean"
                            }
                          },
                          "required": [
                            "offered",
                            "ticked"
                          ],
                          "additionalProperties": false
                        },
                        {
                          "type": "object",
                          "properties": {
                            "offered": {
                              "type": "boolean",
                              "const": false
                            },
                            "why": {
                              "type": "string",
                              "enum": [
                                "NO_SUPPLIER",
                                "SUPPLIER_ARCHIVED",
                                "SUPPLIER_REFUSED",
                                "NO_RECIPIENT",
                                "NO_CONTACT",
                                "MODE_OFF"
                              ]
                            },
                            "sentence": {
                              "type": "string"
                            }
                          },
                          "required": [
                            "offered",
                            "why",
                            "sentence"
                          ],
                          "additionalProperties": false
                        }
                      ]
                    },
                    "vendor": {
                      "anyOf": [
                        {
                          "$ref": "#/components/schemas/VendorOption1"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "defaultRecipient": {
                      "anyOf": [
                        {
                          "$ref": "#/components/schemas/RecipientsItem"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "contact": {
                      "anyOf": [
                        {
                          "type": "object",
                          "properties": {
                            "name": {
                              "type": "string"
                            },
                            "telephone": {
                              "type": "string"
                            },
                            "source": {
                              "type": "string",
                              "enum": [
                                "SETTINGS",
                                "ADDRESS_WATCHER"
                              ]
                            }
                          },
                          "required": [
                            "name",
                            "telephone",
                            "source"
                          ],
                          "additionalProperties": false
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "facts": {
                      "$ref": "#/components/schemas/DecisionFacts"
                    },
                    "items": {
                      "type": "array",
                      "items": {
                        "type": "string",
                        "enum": [
                          "DOCUMENT",
                          "SUPPLIER_NAME",
                          "DATE",
                          "TOTAL",
                          "REGISTRATION",
                          "TAX_SHOWN",
                          "RECIPIENT",
                          "TERMS",
                          "DESCRIPTIONS",
                          "TAX_DIFFERS",
                          "DOES_NOT_ADD_UP"
                        ]
                      }
                    },
                    "alreadyTold": {
                      "anyOf": [
                        {
                          "type": "object",
                          "properties": {
                            "recipientEmail": {
                              "type": "string"
                            },
                            "by": {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string"
                                },
                                "name": {
                                  "type": "string"
                                }
                              },
                              "required": [
                                "id",
                                "name"
                              ],
                              "additionalProperties": false
                            },
                            "on": {
                              "type": "string",
                              "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                            }
                          },
                          "required": [
                            "recipientEmail",
                            "by",
                            "on"
                          ],
                          "additionalProperties": false
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "openDraft": {
                      "anyOf": [
                        {
                          "type": "object",
                          "properties": {
                            "noticeId": {
                              "type": "string"
                            },
                            "recipientEmail": {
                              "type": "string"
                            },
                            "by": {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string"
                                },
                                "name": {
                                  "type": "string"
                                }
                              },
                              "required": [
                                "id",
                                "name"
                              ],
                              "additionalProperties": false
                            },
                            "on": {
                              "type": "string",
                              "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                            }
                          },
                          "required": [
                            "noticeId",
                            "recipientEmail",
                            "by",
                            "on"
                          ],
                          "additionalProperties": false
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "outboundApproved": {
                      "type": "boolean"
                    },
                    "entityTimeZone": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "kind",
                    "offer",
                    "vendor",
                    "defaultRecipient",
                    "contact",
                    "facts",
                    "items",
                    "alreadyTold",
                    "openDraft",
                    "outboundApproved",
                    "entityTimeZone"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "404": {
            "$ref": "#/components/responses/Problem404"
          },
          "422": {
            "$ref": "#/components/responses/Problem422"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      }
    },
    "/v1/bills/{billId}/supplier-notice-paragraph": {
      "post": {
        "operationId": "draftSupplierNoticeParagraph",
        "summary": "Drafts the paragraph of a supplier notice for one bill.",
        "description": "Drafts the paragraph of a supplier notice for one bill. Needs the `ledger:propose` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "purchases"
        ],
        "x-stability-level": "beta",
        "x-eternify-read": true,
        "x-scope": "ledger:propose",
        "parameters": [
          {
            "name": "billId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "kind": {
                    "type": "string",
                    "enum": [
                      "BILL_HELD",
                      "BILL_DECLINED",
                      "CORRECTION_ASKED"
                    ]
                  },
                  "note": {
                    "type": "string",
                    "maxLength": 280
                  }
                },
                "required": [
                  "kind",
                  "note"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "drafted": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "promptVersion": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "why": {
                      "anyOf": [
                        {
                          "type": "string",
                          "enum": [
                            "DISCLOSURE",
                            "BUDGET",
                            "PROVIDER",
                            "UNPARSABLE",
                            "REFUSED",
                            "FIGURE_INVENTED",
                            "CONTACT_DETAIL",
                            "BANKING_WORDS",
                            "DECISION_PROMISE",
                            "PAUSED_AFTER_THREE_UNUSED"
                          ]
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "resumesOn": {
                      "type": "string",
                      "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                    }
                  },
                  "required": [
                    "drafted",
                    "promptVersion",
                    "why"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "404": {
            "$ref": "#/components/responses/Problem404"
          },
          "422": {
            "$ref": "#/components/responses/Problem422"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      }
    },
    "/v1/bills/{billId}/supplier-notices": {
      "post": {
        "operationId": "draftBillNotice",
        "summary": "Drafts a notice to the supplier about a bill.",
        "description": "Drafts a notice to the supplier about a bill. Needs the `ledger:propose` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "purchases"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:propose",
        "parameters": [
          {
            "name": "billId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "kind": {
                    "type": "string",
                    "enum": [
                      "BILL_APPROVED",
                      "BILL_HELD",
                      "BILL_DECLINED",
                      "CORRECTION_ASKED"
                    ]
                  },
                  "recipientEmail": {
                    "type": "string",
                    "maxLength": 320,
                    "format": "email",
                    "pattern": "^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"
                  },
                  "sentence": {
                    "type": "object",
                    "properties": {
                      "text": {
                        "type": "string",
                        "minLength": 8,
                        "maxLength": 600
                      },
                      "source": {
                        "type": "string",
                        "enum": [
                          "STANDARD",
                          "AGENT_DRAFT",
                          "AGENT_DRAFT_EDITED",
                          "PERSON"
                        ]
                      },
                      "promptVersion": {
                        "type": "string",
                        "maxLength": 60
                      }
                    },
                    "required": [
                      "text",
                      "source"
                    ],
                    "additionalProperties": false
                  },
                  "draftRequested": {
                    "default": false,
                    "type": "boolean"
                  }
                },
                "required": [
                  "kind",
                  "recipientEmail"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "Ledger-Position": {
                "$ref": "#/components/headers/LedgerPosition"
              },
              "Location": {
                "$ref": "#/components/headers/Location"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DraftBankingNoticeResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem400"
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "404": {
            "$ref": "#/components/responses/Problem404"
          },
          "409": {
            "$ref": "#/components/responses/Problem409"
          },
          "412": {
            "$ref": "#/components/responses/Problem412"
          },
          "422": {
            "$ref": "#/components/responses/Problem422"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      }
    },
    "/v1/bills/{billId}/vendor-prefill": {
      "get": {
        "operationId": "getBillVendorPrefill",
        "summary": "Returns the vendor details a bill starts from.",
        "description": "Returns the vendor details a bill starts from. Needs the `ledger:read` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "purchases"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:read",
        "parameters": [
          {
            "name": "billId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "billId": {
                      "type": "string"
                    },
                    "displayName": {
                      "type": "string"
                    },
                    "taxNumber": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "region": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "country": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "fromDocument": {
                      "type": "boolean"
                    }
                  },
                  "required": [
                    "billId",
                    "displayName",
                    "taxNumber",
                    "region",
                    "country",
                    "fromDocument"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "404": {
            "$ref": "#/components/responses/Problem404"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      }
    },
    "/v1/bills/{billId}/versions": {
      "get": {
        "operationId": "listBillVersions",
        "summary": "Lists the earlier versions of a bill.",
        "description": "Lists the earlier versions of a bill. Needs the `ledger:read` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "purchases"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:read",
        "parameters": [
          {
            "name": "billId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "default": 50,
              "type": "integer",
              "minimum": 1,
              "maximum": 200
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 512
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "number": {
                            "type": "integer",
                            "minimum": 1,
                            "maximum": 9007199254740991
                          },
                          "revision": {
                            "type": "integer",
                            "minimum": 0,
                            "maximum": 9007199254740991
                          },
                          "kind": {
                            "type": "string",
                            "enum": [
                              "SUBMITTED",
                              "APPROVED",
                              "EDITED"
                            ]
                          },
                          "createdBy": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string"
                              },
                              "name": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "id",
                              "name"
                            ],
                            "additionalProperties": false
                          },
                          "createdAt": {
                            "type": "string",
                            "minLength": 20
                          },
                          "vendor": {
                            "anyOf": [
                              {
                                "type": "object",
                                "properties": {
                                  "id": {
                                    "type": "string"
                                  },
                                  "displayName": {
                                    "type": "string"
                                  }
                                },
                                "required": [
                                  "id",
                                  "displayName"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "billNumber": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "billDate": {
                            "type": "string",
                            "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                          },
                          "dueDate": {
                            "type": "string",
                            "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                          },
                          "currency": {
                            "type": "string",
                            "pattern": "^[A-Z]{3}$"
                          },
                          "subtotalMinor": {
                            "type": "string",
                            "pattern": "^-?\\d+$"
                          },
                          "taxMinor": {
                            "type": "string",
                            "pattern": "^-?\\d+$"
                          },
                          "totalMinor": {
                            "type": "string",
                            "pattern": "^-?\\d+$"
                          },
                          "entry": {
                            "anyOf": [
                              {
                                "type": "object",
                                "properties": {
                                  "id": {
                                    "type": "string"
                                  },
                                  "entryNumber": {
                                    "anyOf": [
                                      {
                                        "type": "integer",
                                        "minimum": -9007199254740991,
                                        "maximum": 9007199254740991
                                      },
                                      {
                                        "type": "null"
                                      }
                                    ]
                                  },
                                  "status": {
                                    "type": "string",
                                    "enum": [
                                      "DRAFT",
                                      "PROPOSED",
                                      "IN_REVIEW",
                                      "APPROVED",
                                      "POSTED",
                                      "DECLINED",
                                      "REVERSED"
                                    ]
                                  }
                                },
                                "required": [
                                  "id",
                                  "entryNumber",
                                  "status"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "reason": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "decision": {
                            "anyOf": [
                              {
                                "type": "object",
                                "properties": {
                                  "status": {
                                    "type": "string",
                                    "enum": [
                                      "PENDING",
                                      "APPROVED",
                                      "EDITED_APPROVED",
                                      "REJECTED",
                                      "EXPIRED",
                                      "WITHDRAWN"
                                    ]
                                  },
                                  "reviewedBy": {
                                    "anyOf": [
                                      {
                                        "type": "object",
                                        "properties": {
                                          "id": {
                                            "type": "string"
                                          },
                                          "name": {
                                            "type": "string"
                                          }
                                        },
                                        "required": [
                                          "id",
                                          "name"
                                        ],
                                        "additionalProperties": false
                                      },
                                      {
                                        "type": "null"
                                      }
                                    ]
                                  },
                                  "reviewedAt": {
                                    "anyOf": [
                                      {
                                        "type": "string",
                                        "minLength": 20
                                      },
                                      {
                                        "type": "null"
                                      }
                                    ]
                                  },
                                  "rejectReason": {
                                    "type": [
                                      "string",
                                      "null"
                                    ]
                                  },
                                  "withdrawn": {
                                    "type": "boolean"
                                  }
                                },
                                "required": [
                                  "status",
                                  "reviewedBy",
                                  "reviewedAt",
                                  "rejectReason",
                                  "withdrawn"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "findings": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "properties": {
                                "severity": {
                                  "type": "string",
                                  "enum": [
                                    "BLOCKING",
                                    "WARNING",
                                    "NOTE"
                                  ]
                                },
                                "code": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "message": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "line": {
                                  "anyOf": [
                                    {
                                      "type": "integer",
                                      "minimum": 0,
                                      "maximum": 9007199254740991
                                    },
                                    {
                                      "type": "null"
                                    }
                                  ]
                                },
                                "figures": {
                                  "type": "array",
                                  "items": {
                                    "$ref": "#/components/schemas/FiguresItem"
                                  }
                                },
                                "reference": {
                                  "type": [
                                    "string",
                                    "null"
                                  ]
                                }
                              },
                              "required": [
                                "severity",
                                "code",
                                "message",
                                "line",
                                "figures",
                                "reference"
                              ],
                              "additionalProperties": false
                            }
                          },
                          "lineCount": {
                            "type": "integer",
                            "minimum": 0,
                            "maximum": 9007199254740991
                          },
                          "linesMissing": {
                            "type": "boolean"
                          },
                          "diff": {
                            "anyOf": [
                              {
                                "type": "object",
                                "properties": {
                                  "head": {
                                    "$ref": "#/components/schemas/Head"
                                  },
                                  "lines": {
                                    "$ref": "#/components/schemas/Lines2"
                                  },
                                  "subtotalBeforeMinor": {
                                    "type": "string",
                                    "pattern": "^-?\\d+$"
                                  },
                                  "subtotalAfterMinor": {
                                    "type": "string",
                                    "pattern": "^-?\\d+$"
                                  },
                                  "taxBeforeMinor": {
                                    "type": "string",
                                    "pattern": "^-?\\d+$"
                                  },
                                  "taxAfterMinor": {
                                    "type": "string",
                                    "pattern": "^-?\\d+$"
                                  },
                                  "totalBeforeMinor": {
                                    "type": "string",
                                    "pattern": "^-?\\d+$"
                                  },
                                  "totalAfterMinor": {
                                    "type": "string",
                                    "pattern": "^-?\\d+$"
                                  },
                                  "currency": {
                                    "type": "string",
                                    "pattern": "^[A-Z]{3}$"
                                  }
                                },
                                "required": [
                                  "head",
                                  "lines",
                                  "subtotalBeforeMinor",
                                  "subtotalAfterMinor",
                                  "taxBeforeMinor",
                                  "taxAfterMinor",
                                  "totalBeforeMinor",
                                  "totalAfterMinor",
                                  "currency"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "null"
                              }
                            ]
                          }
                        },
                        "required": [
                          "id",
                          "number",
                          "revision",
                          "kind",
                          "createdBy",
                          "createdAt",
                          "vendor",
                          "billNumber",
                          "billDate",
                          "dueDate",
                          "currency",
                          "subtotalMinor",
                          "taxMinor",
                          "totalMinor",
                          "entry",
                          "reason",
                          "decision",
                          "findings",
                          "lineCount",
                          "linesMissing",
                          "diff"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "nextCursor": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "total": {
                      "anyOf": [
                        {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  },
                  "required": [
                    "data",
                    "nextCursor",
                    "total"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "404": {
            "$ref": "#/components/responses/Problem404"
          },
          "422": {
            "$ref": "#/components/responses/Problem422"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      }
    },
    "/v1/bills/{billId}/void": {
      "post": {
        "operationId": "voidBill",
        "summary": "Voids a bill, reversing its posting.",
        "description": "Voids a bill, reversing its posting. Needs the `ledger:approve` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "purchases"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:approve",
        "parameters": [
          {
            "name": "billId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "reason": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 500
                  }
                },
                "required": [
                  "reason"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "Ledger-Position": {
                "$ref": "#/components/headers/LedgerPosition"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RecordBillFxRateResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem400"
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "404": {
            "$ref": "#/components/responses/Problem404"
          },
          "409": {
            "$ref": "#/components/responses/Problem409"
          },
          "412": {
            "$ref": "#/components/responses/Problem412"
          },
          "422": {
            "$ref": "#/components/responses/Problem422"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      }
    },
    "/v1/bills/{billId}/withholding": {
      "get": {
        "operationId": "getBillWithholding",
        "summary": "Returns the withholding on a bill.",
        "description": "Returns the withholding on a bill. Needs the `ledger:read` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "purchases"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:read",
        "parameters": [
          {
            "name": "billId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "default": 40,
              "type": "integer",
              "minimum": 1,
              "maximum": 40
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 512
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetBillWithholdingResponse"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "404": {
            "$ref": "#/components/responses/Problem404"
          },
          "422": {
            "$ref": "#/components/responses/Problem422"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      },
      "post": {
        "operationId": "stateBillWithholding",
        "summary": "Records the withholding on a bill.",
        "description": "Records the withholding on a bill. Needs the `ledger:approve` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "purchases"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:approve",
        "parameters": [
          {
            "name": "billId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "afterDecisionId": {
                    "anyOf": [
                      {
                        "type": "string",
                        "minLength": 1
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "decisions": {
                    "minItems": 1,
                    "maxItems": 200,
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "lineId": {
                          "anyOf": [
                            {
                              "type": "string",
                              "minLength": 1
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "decision": {
                          "type": "string",
                          "enum": [
                            "IN_CANADA",
                            "OUTSIDE_CANADA",
                            "NOT_A_SERVICE"
                          ]
                        },
                        "note": {
                          "default": null,
                          "anyOf": [
                            {
                              "type": "string",
                              "maxLength": 500
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "source": {
                          "type": "string",
                          "enum": [
                            "PERSON",
                            "AGENT_DRAFT",
                            "AGENT_DRAFT_EDITED"
                          ]
                        },
                        "proposedDecision": {
                          "default": null,
                          "anyOf": [
                            {
                              "type": "string",
                              "enum": [
                                "IN_CANADA",
                                "OUTSIDE_CANADA",
                                "NOT_A_SERVICE"
                              ]
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "promptVersion": {
                          "default": null,
                          "anyOf": [
                            {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 40
                            },
                            {
                              "type": "null"
                            }
                          ]
                        }
                      },
                      "required": [
                        "lineId",
                        "decision",
                        "source"
                      ],
                      "additionalProperties": false
                    }
                  }
                },
                "required": [
                  "afterDecisionId",
                  "decisions"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "Ledger-Position": {
                "$ref": "#/components/headers/LedgerPosition"
              },
              "Location": {
                "$ref": "#/components/headers/Location"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetBillWithholdingResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem400"
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "404": {
            "$ref": "#/components/responses/Problem404"
          },
          "409": {
            "$ref": "#/components/responses/Problem409"
          },
          "412": {
            "$ref": "#/components/responses/Problem412"
          },
          "422": {
            "$ref": "#/components/responses/Problem422"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      }
    },
    "/v1/bills/{billId}/withholding/draft": {
      "post": {
        "operationId": "draftBillWithholding",
        "summary": "Drafts the withholding for a bill.",
        "description": "Drafts the withholding for a bill. Needs the `ledger:approve` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "purchases"
        ],
        "x-stability-level": "beta",
        "x-eternify-read": true,
        "x-scope": "ledger:approve",
        "parameters": [
          {
            "name": "billId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "lineIds": {
                    "minItems": 1,
                    "maxItems": 40,
                    "type": "array",
                    "items": {
                      "type": "string",
                      "minLength": 1
                    }
                  }
                },
                "required": [
                  "lineIds"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "drafted": {
                      "anyOf": [
                        {
                          "type": "object",
                          "properties": {
                            "lines": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "lineId": {
                                    "type": [
                                      "string",
                                      "null"
                                    ]
                                  },
                                  "proposal": {
                                    "type": "string",
                                    "enum": [
                                      "IN_CANADA",
                                      "OUTSIDE_CANADA",
                                      "NOT_A_SERVICE",
                                      "CANNOT_TELL"
                                    ]
                                  },
                                  "quote": {
                                    "type": [
                                      "string",
                                      "null"
                                    ]
                                  },
                                  "confidenceBp": {
                                    "type": "integer",
                                    "minimum": 0,
                                    "maximum": 10000
                                  }
                                },
                                "required": [
                                  "lineId",
                                  "proposal",
                                  "quote",
                                  "confidenceBp"
                                ],
                                "additionalProperties": false
                              }
                            }
                          },
                          "required": [
                            "lines"
                          ],
                          "additionalProperties": false
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "skipped": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "lineId": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "because": {
                            "type": "string",
                            "const": "DECLINED_BEFORE"
                          }
                        },
                        "required": [
                          "lineId",
                          "because"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "why": {
                      "anyOf": [
                        {
                          "type": "string",
                          "enum": [
                            "DISCLOSURE",
                            "PROVIDER",
                            "BUDGET",
                            "REFUSED",
                            "TRUNCATED",
                            "UNPARSABLE",
                            "UNSAFE_ANSWER",
                            "NOTHING_TO_DRAFT",
                            "STOPPED_AFTER_THREE_OVERRIDES",
                            "SLOW"
                          ]
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "promptVersion": {
                      "type": [
                        "string",
                        "null"
                      ]
                    }
                  },
                  "required": [
                    "drafted",
                    "skipped",
                    "why",
                    "promptVersion"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "404": {
            "$ref": "#/components/responses/Problem404"
          },
          "422": {
            "$ref": "#/components/responses/Problem422"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      }
    },
    "/v1/capital-purchases/look-back": {
      "post": {
        "operationId": "capitalLookBack",
        "summary": "Starts a look back over a company's bills for capital purchases the ledger missed, and answers the job to follow.",
        "description": "Starts a look back over a company's bills for capital purchases the ledger missed, and answers the job to follow. Needs the `ledger:approve` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "purchases"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:approve",
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "entityId": {
                    "type": "string",
                    "minLength": 1
                  },
                  "from": {
                    "type": "string",
                    "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                  }
                },
                "required": [
                  "entityId",
                  "from"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Accepted: the work is done after the answer, or waits for a person's confirmation.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "Ledger-Position": {
                "$ref": "#/components/headers/LedgerPosition"
              },
              "Location": {
                "$ref": "#/components/headers/Location"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UndoAgentBatchResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem400"
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "409": {
            "$ref": "#/components/responses/Problem409"
          },
          "412": {
            "$ref": "#/components/responses/Problem412"
          },
          "422": {
            "$ref": "#/components/responses/Problem422"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      }
    },
    "/v1/card-receipts": {
      "get": {
        "operationId": "listCardReceipts",
        "summary": "Lists the card receipts, with the server's total.",
        "description": "Lists the card receipts, with the server's total. Needs the `ledger:read` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "purchases"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:read",
        "parameters": [
          {
            "name": "status",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "MATCH_FOUND",
                "WAITING_FOR_FEED",
                "NO_LINE_FOUND"
              ]
            }
          },
          {
            "name": "vendorId",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "q",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 200
            }
          },
          {
            "name": "sort",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "date_desc",
                "date_asc",
                "amount_desc"
              ]
            }
          },
          {
            "name": "entityId",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "financialAccountId",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "from",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
            }
          },
          {
            "name": "to",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "default": 50,
              "type": "integer",
              "minimum": 1,
              "maximum": 200
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 512
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "billId": {
                            "type": "string"
                          },
                          "number": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "status": {
                            "type": "string",
                            "enum": [
                              "IN_REVIEW",
                              "APPROVED"
                            ]
                          },
                          "supplier": {
                            "type": "object",
                            "properties": {
                              "name": {
                                "type": "string"
                              },
                              "vendorId": {
                                "type": [
                                  "string",
                                  "null"
                                ]
                              }
                            },
                            "required": [
                              "name",
                              "vendorId"
                            ],
                            "additionalProperties": false
                          },
                          "entity": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string"
                              },
                              "name": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "id",
                              "name"
                            ],
                            "additionalProperties": false
                          },
                          "billDate": {
                            "type": "string",
                            "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                          },
                          "currency": {
                            "type": "string",
                            "pattern": "^[A-Z]{3}$"
                          },
                          "totalMinor": {
                            "type": "string",
                            "pattern": "^-?\\d+$"
                          },
                          "tender": {
                            "type": "object",
                            "properties": {
                              "kind": {
                                "type": "string",
                                "const": "CARD"
                              },
                              "brand": {
                                "anyOf": [
                                  {
                                    "type": "string",
                                    "enum": [
                                      "VISA",
                                      "MASTERCARD",
                                      "AMEX",
                                      "DEBIT",
                                      "OTHER"
                                    ]
                                  },
                                  {
                                    "type": "null"
                                  }
                                ]
                              },
                              "last4": {
                                "anyOf": [
                                  {
                                    "type": "string",
                                    "pattern": "^[0-9]{4}$"
                                  },
                                  {
                                    "type": "null"
                                  }
                                ]
                              }
                            },
                            "required": [
                              "kind",
                              "brand",
                              "last4"
                            ],
                            "additionalProperties": false
                          },
                          "documentId": {
                            "type": "string"
                          },
                          "state": {
                            "type": "string",
                            "enum": [
                              "MATCH_FOUND",
                              "WAITING_FOR_FEED",
                              "NO_LINE_FOUND"
                            ]
                          },
                          "candidate": {
                            "$ref": "#/components/schemas/FeedCandidate"
                          },
                          "candidatesTotal": {
                            "type": "integer",
                            "minimum": 0,
                            "maximum": 9007199254740991
                          },
                          "inPaymentQueue": {
                            "type": "boolean"
                          },
                          "nearMiss": {
                            "anyOf": [
                              {
                                "type": "object",
                                "properties": {
                                  "sourceTransactionId": {
                                    "type": "string"
                                  },
                                  "txnDate": {
                                    "type": "string",
                                    "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                                  },
                                  "description": {
                                    "type": "string"
                                  },
                                  "accountName": {
                                    "type": "string"
                                  },
                                  "amountMinor": {
                                    "type": "string",
                                    "pattern": "^-?\\d+$"
                                  },
                                  "differenceMinor": {
                                    "type": "string",
                                    "pattern": "^-?\\d+$"
                                  }
                                },
                                "required": [
                                  "sourceTransactionId",
                                  "txnDate",
                                  "description",
                                  "accountName",
                                  "amountMinor",
                                  "differenceMinor"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "otherCurrencyLines": {
                            "type": "integer",
                            "minimum": 0,
                            "maximum": 9007199254740991
                          }
                        },
                        "required": [
                          "billId",
                          "number",
                          "status",
                          "supplier",
                          "entity",
                          "billDate",
                          "currency",
                          "totalMinor",
                          "tender",
                          "documentId",
                          "state",
                          "candidate",
                          "candidatesTotal",
                          "inPaymentQueue",
                          "nearMiss",
                          "otherCurrencyLines"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "nextCursor": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "total": {
                      "anyOf": [
                        {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "counts": {
                      "type": "object",
                      "properties": {
                        "all": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 9007199254740991
                        },
                        "matchFound": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 9007199254740991
                        },
                        "waitingForFeed": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 9007199254740991
                        },
                        "noLineFound": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 9007199254740991
                        }
                      },
                      "required": [
                        "all",
                        "matchFound",
                        "waitingForFeed",
                        "noLineFound"
                      ],
                      "additionalProperties": false
                    },
                    "cardFeeds": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "financialAccountId": {
                            "type": "string"
                          },
                          "displayName": {
                            "type": "string"
                          },
                          "entityId": {
                            "type": "string"
                          },
                          "lastLineOn": {
                            "anyOf": [
                              {
                                "type": "string",
                                "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "lastReadAt": {
                            "anyOf": [
                              {
                                "type": "string",
                                "minLength": 20
                              },
                              {
                                "type": "null"
                              }
                            ]
                          }
                        },
                        "required": [
                          "financialAccountId",
                          "displayName",
                          "entityId",
                          "lastLineOn",
                          "lastReadAt"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "truncated": {
                      "type": "boolean"
                    },
                    "entityTimeZone": {
                      "type": [
                        "string",
                        "null"
                      ]
                    }
                  },
                  "required": [
                    "data",
                    "nextCursor",
                    "total",
                    "counts",
                    "cardFeeds",
                    "truncated",
                    "entityTimeZone"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "422": {
            "$ref": "#/components/responses/Problem422"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      }
    },
    "/v1/card-receipts/lines": {
      "get": {
        "operationId": "listCardLines",
        "summary": "Lists the lines of card receipts.",
        "description": "Lists the lines of card receipts. Needs the `ledger:read` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "purchases"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:read",
        "parameters": [
          {
            "name": "status",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "MATCH_FOUND",
                "NEEDS_RECEIPT",
                "RECENT"
              ]
            }
          },
          {
            "name": "q",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 200
            }
          },
          {
            "name": "sort",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "date_desc",
                "date_asc",
                "amount_desc"
              ]
            }
          },
          {
            "name": "entityId",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "financialAccountId",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "from",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
            }
          },
          {
            "name": "to",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "default": 50,
              "type": "integer",
              "minimum": 1,
              "maximum": 200
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 512
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "sourceTransactionId": {
                            "type": "string"
                          },
                          "account": {
                            "$ref": "#/components/schemas/Account2"
                          },
                          "entity": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string"
                              },
                              "name": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "id",
                              "name"
                            ],
                            "additionalProperties": false
                          },
                          "txnDate": {
                            "type": "string",
                            "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                          },
                          "description": {
                            "type": "string"
                          },
                          "counterparty": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "amountMinor": {
                            "type": "string",
                            "pattern": "^-?\\d+$"
                          },
                          "currency": {
                            "type": "string",
                            "pattern": "^[A-Z]{3}$"
                          },
                          "ageDays": {
                            "type": "integer",
                            "minimum": 0,
                            "maximum": 9007199254740991
                          },
                          "state": {
                            "type": "string",
                            "enum": [
                              "MATCH_FOUND",
                              "NEEDS_RECEIPT",
                              "RECENT"
                            ]
                          },
                          "proposedFor": {
                            "anyOf": [
                              {
                                "type": "object",
                                "properties": {
                                  "billId": {
                                    "type": "string"
                                  },
                                  "number": {
                                    "type": [
                                      "string",
                                      "null"
                                    ]
                                  },
                                  "supplierName": {
                                    "type": "string"
                                  },
                                  "isReceipt": {
                                    "type": "boolean"
                                  },
                                  "status": {
                                    "type": "string",
                                    "enum": [
                                      "IN_REVIEW",
                                      "APPROVED"
                                    ]
                                  },
                                  "scoreBp": {
                                    "type": "integer",
                                    "minimum": -9007199254740991,
                                    "maximum": 9007199254740991
                                  }
                                },
                                "required": [
                                  "billId",
                                  "number",
                                  "supplierName",
                                  "isReceipt",
                                  "status",
                                  "scoreBp"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "likelySupplier": {
                            "anyOf": [
                              {
                                "type": "object",
                                "properties": {
                                  "vendorId": {
                                    "type": "string"
                                  },
                                  "name": {
                                    "type": "string"
                                  },
                                  "earlierPayments": {
                                    "type": "integer",
                                    "minimum": 1,
                                    "maximum": 9007199254740991
                                  }
                                },
                                "required": [
                                  "vendorId",
                                  "name",
                                  "earlierPayments"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "documentary": {
                            "anyOf": [
                              {
                                "type": "object",
                                "properties": {
                                  "tier": {
                                    "type": "string",
                                    "enum": [
                                      "UNDER_LOWER",
                                      "LOWER",
                                      "UPPER"
                                    ]
                                  },
                                  "thresholdMinor": {
                                    "type": "string",
                                    "pattern": "^-?\\d+$"
                                  },
                                  "effectiveFrom": {
                                    "type": "string",
                                    "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                                  },
                                  "awaitingCpa": {
                                    "type": "boolean"
                                  }
                                },
                                "required": [
                                  "tier",
                                  "thresholdMinor",
                                  "effectiveFrom",
                                  "awaitingCpa"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "null"
                              }
                            ]
                          }
                        },
                        "required": [
                          "sourceTransactionId",
                          "account",
                          "entity",
                          "txnDate",
                          "description",
                          "counterparty",
                          "amountMinor",
                          "currency",
                          "ageDays",
                          "state",
                          "proposedFor",
                          "likelySupplier",
                          "documentary"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "nextCursor": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "total": {
                      "anyOf": [
                        {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "counts": {
                      "type": "object",
                      "properties": {
                        "all": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 9007199254740991
                        },
                        "matchFound": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 9007199254740991
                        },
                        "needsReceipt": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 9007199254740991
                        },
                        "recent": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 9007199254740991
                        }
                      },
                      "required": [
                        "all",
                        "matchFound",
                        "needsReceipt",
                        "recent"
                      ],
                      "additionalProperties": false
                    },
                    "truncated": {
                      "type": "boolean"
                    },
                    "entityTimeZone": {
                      "type": [
                        "string",
                        "null"
                      ]
                    }
                  },
                  "required": [
                    "data",
                    "nextCursor",
                    "total",
                    "counts",
                    "truncated",
                    "entityTimeZone"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "422": {
            "$ref": "#/components/responses/Problem422"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      }
    },
    "/v1/expected-bills": {
      "get": {
        "operationId": "listExpectedBills",
        "summary": "Lists the bills the ledger expects to receive.",
        "description": "Lists the bills the ledger expects to receive. Needs the `ledger:read` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "purchases"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:read",
        "parameters": [
          {
            "name": "entityId",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "month",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^\\d{4}-(0[1-9]|1[0-2])$"
            }
          },
          {
            "name": "state",
            "in": "query",
            "required": false,
            "description": "One or more of WAITING, ARRIVED, ACCRUED, ACCRUAL_DECLINED, DISMISSED, separated by commas.",
            "schema": {
              "type": "string",
              "description": "One or more of WAITING, ARRIVED, ACCRUED, ACCRUAL_DECLINED, DISMISSED, separated by commas."
            }
          },
          {
            "name": "vendorId",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "default": 50,
              "type": "integer",
              "minimum": 1,
              "maximum": 200
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 512
            }
          },
          {
            "name": "sort",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 64
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "signalId": {
                            "type": "string"
                          },
                          "vendor": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string"
                              },
                              "displayName": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "id",
                              "displayName"
                            ],
                            "additionalProperties": false
                          },
                          "month": {
                            "type": "string",
                            "pattern": "^\\d{4}-(0[1-9]|1[0-2])$"
                          },
                          "state": {
                            "type": "string",
                            "enum": [
                              "WAITING",
                              "ARRIVED",
                              "ACCRUED",
                              "ACCRUAL_DECLINED",
                              "DISMISSED"
                            ]
                          },
                          "severity": {
                            "type": "string"
                          },
                          "observedAt": {
                            "type": "string",
                            "minLength": 20
                          },
                          "usualDay": {
                            "type": "integer",
                            "minimum": 1,
                            "maximum": 31
                          },
                          "intervalMonths": {
                            "type": "integer",
                            "minimum": 1,
                            "maximum": 9007199254740991
                          },
                          "currency": {
                            "type": "string",
                            "pattern": "^[A-Z]{3}$"
                          },
                          "medianSubtotalMinor": {
                            "type": "string",
                            "pattern": "^-?\\d+$"
                          },
                          "lastBillDate": {
                            "type": "string",
                            "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                          },
                          "accrual": {
                            "anyOf": [
                              {
                                "type": "object",
                                "properties": {
                                  "amountMinor": {
                                    "type": "string",
                                    "pattern": "^-?\\d+$"
                                  },
                                  "functionalAmountMinor": {
                                    "type": "string",
                                    "pattern": "^-?\\d+$"
                                  },
                                  "currency": {
                                    "type": "string",
                                    "pattern": "^[A-Z]{3}$"
                                  },
                                  "entryId": {
                                    "type": "string"
                                  },
                                  "entryStatus": {
                                    "type": "string"
                                  }
                                },
                                "required": [
                                  "amountMinor",
                                  "functionalAmountMinor",
                                  "currency",
                                  "entryId",
                                  "entryStatus"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "proposed": {
                            "anyOf": [
                              {
                                "type": "object",
                                "properties": {
                                  "amountMinor": {
                                    "type": "string",
                                    "pattern": "^-?\\d+$"
                                  },
                                  "functionalAmountMinor": {
                                    "anyOf": [
                                      {
                                        "type": "string",
                                        "pattern": "^-?\\d+$"
                                      },
                                      {
                                        "type": "null"
                                      }
                                    ]
                                  }
                                },
                                "required": [
                                  "amountMinor",
                                  "functionalAmountMinor"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "whyNot": {
                            "anyOf": [
                              {
                                "type": "string",
                                "enum": [
                                  "ARRIVED",
                                  "ALREADY_ACCRUED",
                                  "ACCRUAL_DECLINED",
                                  "DISMISSED",
                                  "RATE_MISSING",
                                  "NOT_OPEN"
                                ]
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "whyNotWords": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "selectable": {
                            "type": "boolean"
                          },
                          "entityTimeZone": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "signalId",
                          "vendor",
                          "month",
                          "state",
                          "severity",
                          "observedAt",
                          "usualDay",
                          "intervalMonths",
                          "currency",
                          "medianSubtotalMinor",
                          "lastBillDate",
                          "accrual",
                          "proposed",
                          "whyNot",
                          "whyNotWords",
                          "selectable",
                          "entityTimeZone"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "total": {
                      "type": "integer",
                      "minimum": 0,
                      "maximum": 9007199254740991
                    },
                    "nextCursor": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "entity": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "name": {
                          "type": "string"
                        },
                        "functionalCurrency": {
                          "type": "string",
                          "pattern": "^[A-Z]{3}$"
                        },
                        "timeZone": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "id",
                        "name",
                        "functionalCurrency",
                        "timeZone"
                      ],
                      "additionalProperties": false
                    },
                    "month": {
                      "type": "string",
                      "pattern": "^\\d{4}-(0[1-9]|1[0-2])$"
                    },
                    "monthLabel": {
                      "type": "string"
                    },
                    "lastCheckedOn": {
                      "anyOf": [
                        {
                          "type": "string",
                          "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "accruedAccount": {
                      "$ref": "#/components/schemas/Account"
                    },
                    "refusal": {
                      "$ref": "#/components/schemas/Refusal"
                    },
                    "counts": {
                      "type": "object",
                      "properties": {
                        "waiting": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 9007199254740991
                        },
                        "arrived": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 9007199254740991
                        },
                        "accrued": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 9007199254740991
                        },
                        "declined": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 9007199254740991
                        },
                        "dismissed": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 9007199254740991
                        }
                      },
                      "required": [
                        "waiting",
                        "arrived",
                        "accrued",
                        "declined",
                        "dismissed"
                      ],
                      "additionalProperties": false
                    },
                    "waitingTotals": {
                      "$ref": "#/components/schemas/WaitingTotals"
                    },
                    "patterns": {
                      "type": "integer",
                      "minimum": 0,
                      "maximum": 9007199254740991
                    }
                  },
                  "required": [
                    "data",
                    "total",
                    "nextCursor",
                    "entity",
                    "month",
                    "monthLabel",
                    "lastCheckedOn",
                    "accruedAccount",
                    "refusal",
                    "counts",
                    "waitingTotals",
                    "patterns"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "422": {
            "$ref": "#/components/responses/Problem422"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      }
    },
    "/v1/expected-bills/accruals": {
      "post": {
        "operationId": "proposeExpectedBillAccrual",
        "summary": "Proposes an accrual for an expected bill, for a person to decide.",
        "description": "Proposes an accrual for an expected bill, for a person to decide. Needs the `ledger:propose` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "purchases"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:propose",
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "entityId": {
                    "type": "string",
                    "minLength": 1
                  },
                  "periodYear": {
                    "type": "integer",
                    "minimum": 2000,
                    "maximum": 2100
                  },
                  "periodMonth": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 12
                  },
                  "signalIds": {
                    "minItems": 1,
                    "maxItems": 200,
                    "type": "array",
                    "items": {
                      "type": "string",
                      "minLength": 1
                    }
                  }
                },
                "required": [
                  "entityId",
                  "periodYear",
                  "periodMonth",
                  "signalIds"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "Ledger-Position": {
                "$ref": "#/components/headers/LedgerPosition"
              },
              "Location": {
                "$ref": "#/components/headers/Location"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "entryId": {
                      "type": "string"
                    },
                    "created": {
                      "type": "boolean"
                    },
                    "status": {
                      "type": "string"
                    },
                    "currency": {
                      "type": "string",
                      "pattern": "^[A-Z]{3}$"
                    },
                    "totalFunctionalMinor": {
                      "type": "string",
                      "pattern": "^-?\\d+$"
                    },
                    "suppliers": {
                      "type": "integer",
                      "minimum": 0,
                      "maximum": 9007199254740991
                    },
                    "entryDate": {
                      "type": "string",
                      "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                    },
                    "reversalDate": {
                      "type": "string",
                      "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                    },
                    "rows": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "vendorId": {
                            "type": "string"
                          },
                          "signalId": {
                            "type": "string"
                          },
                          "amountMinor": {
                            "type": "string",
                            "pattern": "^-?\\d+$"
                          },
                          "currency": {
                            "type": "string",
                            "pattern": "^[A-Z]{3}$"
                          }
                        },
                        "required": [
                          "vendorId",
                          "signalId",
                          "amountMinor",
                          "currency"
                        ],
                        "additionalProperties": false
                      }
                    }
                  },
                  "required": [
                    "entryId",
                    "created",
                    "status",
                    "currency",
                    "totalFunctionalMinor",
                    "suppliers",
                    "entryDate",
                    "reversalDate",
                    "rows"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem400"
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "409": {
            "$ref": "#/components/responses/Problem409"
          },
          "412": {
            "$ref": "#/components/responses/Problem412"
          },
          "422": {
            "$ref": "#/components/responses/Problem422"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      }
    },
    "/v1/goods-receipts": {
      "get": {
        "operationId": "listGoodsReceipts",
        "summary": "Lists the goods receipts, with the server's total.",
        "description": "Lists the goods receipts, with the server's total. Needs the `ledger:read` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "purchases"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:read",
        "parameters": [
          {
            "name": "entityId",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "purchaseOrderId",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "PROPOSED",
                "CONFIRMED",
                "VOID",
                "DISCARDED"
              ]
            }
          },
          {
            "name": "source",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "MANUAL",
                "SLIP_READ",
                "SLIP_MAILED"
              ]
            }
          },
          {
            "name": "receivedById",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "awaiting",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "const": "confirm"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "default": 50,
              "type": "integer",
              "minimum": 1,
              "maximum": 200
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 512
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "purchaseOrderId": {
                            "type": "string"
                          },
                          "orderNumber": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "sequence": {
                            "type": "integer",
                            "minimum": 1,
                            "maximum": 9007199254740991
                          },
                          "status": {
                            "type": "string",
                            "enum": [
                              "PROPOSED",
                              "CONFIRMED",
                              "VOID",
                              "DISCARDED"
                            ]
                          },
                          "source": {
                            "type": "string",
                            "enum": [
                              "MANUAL",
                              "SLIP_READ",
                              "SLIP_MAILED"
                            ]
                          },
                          "entity": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string"
                              },
                              "name": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "id",
                              "name"
                            ],
                            "additionalProperties": false
                          },
                          "entityTimeZone": {
                            "type": "string"
                          },
                          "receivedOn": {
                            "anyOf": [
                              {
                                "type": "string",
                                "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "receivedBy": {
                            "anyOf": [
                              {
                                "type": "object",
                                "properties": {
                                  "id": {
                                    "type": "string"
                                  },
                                  "name": {
                                    "type": "string"
                                  }
                                },
                                "required": [
                                  "id",
                                  "name"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "onBehalfOf": {
                            "anyOf": [
                              {
                                "type": "object",
                                "properties": {
                                  "id": {
                                    "type": "string"
                                  },
                                  "name": {
                                    "type": "string"
                                  }
                                },
                                "required": [
                                  "id",
                                  "name"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "lineCount": {
                            "type": "integer",
                            "minimum": 0,
                            "maximum": 9007199254740991
                          },
                          "attachmentCount": {
                            "type": "integer",
                            "minimum": 0,
                            "maximum": 9007199254740991
                          },
                          "proposedAt": {
                            "anyOf": [
                              {
                                "type": "string",
                                "minLength": 20
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "voided": {
                            "$ref": "#/components/schemas/Retired"
                          },
                          "discarded": {
                            "$ref": "#/components/schemas/Retired"
                          }
                        },
                        "required": [
                          "id",
                          "purchaseOrderId",
                          "orderNumber",
                          "sequence",
                          "status",
                          "source",
                          "entity",
                          "entityTimeZone",
                          "receivedOn",
                          "receivedBy",
                          "onBehalfOf",
                          "lineCount",
                          "attachmentCount",
                          "proposedAt",
                          "voided",
                          "discarded"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "total": {
                      "type": "integer",
                      "minimum": 0,
                      "maximum": 9007199254740991
                    },
                    "nextCursor": {
                      "type": [
                        "string",
                        "null"
                      ]
                    }
                  },
                  "required": [
                    "data",
                    "total",
                    "nextCursor"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "422": {
            "$ref": "#/components/responses/Problem422"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      },
      "post": {
        "operationId": "recordGoodsReceipt",
        "summary": "Records the goods received against a purchase order.",
        "description": "Records the goods received against a purchase order. Needs the `ledger:propose` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "purchases"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:propose",
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "purchaseOrderId": {
                    "type": "string",
                    "minLength": 1
                  },
                  "receivedOn": {
                    "type": "string",
                    "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                  },
                  "signedForBy": {
                    "default": null,
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 120
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "note": {
                    "default": null,
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 500
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "lines": {
                    "$ref": "#/components/schemas/Lines7"
                  },
                  "onBehalfOfId": {
                    "default": null,
                    "anyOf": [
                      {
                        "type": "string",
                        "minLength": 1
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "evidenceDocumentIds": {
                    "default": [],
                    "maxItems": 8,
                    "type": "array",
                    "items": {
                      "type": "string",
                      "minLength": 1
                    }
                  },
                  "seenSequence": {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 9007199254740991
                  },
                  "slip": {
                    "default": null,
                    "anyOf": [
                      {
                        "type": "object",
                        "properties": {
                          "promptVersion": {
                            "type": "string",
                            "minLength": 1,
                            "maxLength": 60
                          },
                          "linesRead": {
                            "type": "integer",
                            "minimum": 0,
                            "maximum": 200
                          },
                          "linesKept": {
                            "type": "integer",
                            "minimum": 0,
                            "maximum": 200
                          }
                        },
                        "required": [
                          "promptVersion",
                          "linesRead",
                          "linesKept"
                        ],
                        "additionalProperties": false
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                },
                "required": [
                  "purchaseOrderId",
                  "receivedOn",
                  "lines",
                  "seenSequence"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "Ledger-Position": {
                "$ref": "#/components/headers/LedgerPosition"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RecordGoodsReceiptResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem400"
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "409": {
            "$ref": "#/components/responses/Problem409"
          },
          "412": {
            "$ref": "#/components/responses/Problem412"
          },
          "422": {
            "$ref": "#/components/responses/Problem422"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      }
    },
    "/v1/goods-receipts/slip-read": {
      "post": {
        "operationId": "readGoodsReceiptSlip",
        "summary": "Reads the packing slip a goods receipt was taken from.",
        "description": "Reads the packing slip a goods receipt was taken from. Needs the `ledger:propose` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "purchases"
        ],
        "x-stability-level": "beta",
        "x-eternify-read": true,
        "x-scope": "ledger:propose",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "documentId": {
                    "type": "string",
                    "minLength": 1
                  },
                  "entityId": {
                    "type": "string",
                    "minLength": 1
                  },
                  "purchaseOrderId": {
                    "type": "string",
                    "minLength": 1
                  }
                },
                "required": [
                  "documentId",
                  "entityId"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "read": {
                          "type": "object",
                          "properties": {
                            "supplier": {
                              "type": "object",
                              "properties": {
                                "name": {
                                  "type": [
                                    "string",
                                    "null"
                                  ]
                                }
                              },
                              "required": [
                                "name"
                              ],
                              "additionalProperties": false
                            },
                            "orderReference": {
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "slipNumber": {
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "shipDate": {
                              "anyOf": [
                                {
                                  "type": "string",
                                  "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "matchedBy": {
                              "anyOf": [
                                {
                                  "type": "string",
                                  "enum": [
                                    "REFERENCE",
                                    "SUPPLIER_ONLY"
                                  ]
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "lines": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "purchaseOrderLineId": {
                                    "type": [
                                      "string",
                                      "null"
                                    ]
                                  },
                                  "slipDescription": {
                                    "type": "string"
                                  },
                                  "shippedQuantity": {
                                    "type": "string",
                                    "pattern": "^\\d{1,10}(\\.\\d{1,4})?$"
                                  },
                                  "orderedQuantity": {
                                    "anyOf": [
                                      {
                                        "type": "string",
                                        "pattern": "^\\d{1,10}(\\.\\d{1,4})?$"
                                      },
                                      {
                                        "type": "null"
                                      }
                                    ]
                                  },
                                  "backorderedQuantity": {
                                    "anyOf": [
                                      {
                                        "type": "string",
                                        "pattern": "^\\d{1,10}(\\.\\d{1,4})?$"
                                      },
                                      {
                                        "type": "null"
                                      }
                                    ]
                                  },
                                  "evidence": {
                                    "type": "string"
                                  },
                                  "unread": {
                                    "type": "array",
                                    "items": {
                                      "type": "string"
                                    }
                                  }
                                },
                                "required": [
                                  "purchaseOrderLineId",
                                  "slipDescription",
                                  "shippedQuantity",
                                  "orderedQuantity",
                                  "backorderedQuantity",
                                  "evidence",
                                  "unread"
                                ],
                                "additionalProperties": false
                              }
                            },
                            "unmatchedSlipLines": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 9007199254740991
                            },
                            "warnings": {
                              "type": "array",
                              "items": {
                                "type": "string"
                              }
                            },
                            "pagesRead": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 9007199254740991
                            },
                            "charsRead": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 9007199254740991
                            },
                            "charsThere": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 9007199254740991
                            },
                            "promptVersion": {
                              "type": "string"
                            }
                          },
                          "required": [
                            "supplier",
                            "orderReference",
                            "slipNumber",
                            "shipDate",
                            "matchedBy",
                            "lines",
                            "unmatchedSlipLines",
                            "warnings",
                            "pagesRead",
                            "charsRead",
                            "charsThere",
                            "promptVersion"
                          ],
                          "additionalProperties": false
                        },
                        "why": {
                          "type": "null"
                        }
                      },
                      "required": [
                        "read",
                        "why"
                      ],
                      "additionalProperties": false
                    },
                    {
                      "type": "object",
                      "properties": {
                        "read": {
                          "type": "null"
                        },
                        "why": {
                          "type": "string",
                          "enum": [
                            "DISCLOSURE",
                            "BUDGET",
                            "PROVIDER",
                            "UNPARSABLE",
                            "REFUSED",
                            "UNREADABLE",
                            "NOT_A_SLIP",
                            "PAUSED"
                          ]
                        },
                        "resumesOn": {
                          "type": "string",
                          "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                        }
                      },
                      "required": [
                        "read",
                        "why"
                      ],
                      "additionalProperties": false
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "422": {
            "$ref": "#/components/responses/Problem422"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      }
    },
    "/v1/goods-receipts/{goodsReceiptId}": {
      "get": {
        "operationId": "getGoodsReceipt",
        "summary": "Returns one goods receipt with its lines.",
        "description": "Returns one goods receipt with its lines. Needs the `ledger:read` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "purchases"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:read",
        "parameters": [
          {
            "name": "goodsReceiptId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Receipt"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "404": {
            "$ref": "#/components/responses/Problem404"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      }
    },
    "/v1/goods-receipts/{goodsReceiptId}/confirm": {
      "post": {
        "operationId": "confirmGoodsReceipt",
        "summary": "Confirms a goods receipt so it counts against the purchase order.",
        "description": "Confirms a goods receipt so it counts against the purchase order. Needs the `ledger:propose` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "purchases"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:propose",
        "parameters": [
          {
            "name": "goodsReceiptId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "receivedOn": {
                    "type": "string",
                    "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                  },
                  "signedForBy": {
                    "default": null,
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 120
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "note": {
                    "default": null,
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 500
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "lines": {
                    "$ref": "#/components/schemas/Lines7"
                  },
                  "onBehalfOfId": {
                    "default": null,
                    "anyOf": [
                      {
                        "type": "string",
                        "minLength": 1
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "evidenceDocumentIds": {
                    "default": [],
                    "maxItems": 8,
                    "type": "array",
                    "items": {
                      "type": "string",
                      "minLength": 1
                    }
                  },
                  "seenSequence": {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 9007199254740991
                  }
                },
                "required": [
                  "receivedOn",
                  "lines",
                  "seenSequence"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "Ledger-Position": {
                "$ref": "#/components/headers/LedgerPosition"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RecordGoodsReceiptResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem400"
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "404": {
            "$ref": "#/components/responses/Problem404"
          },
          "409": {
            "$ref": "#/components/responses/Problem409"
          },
          "412": {
            "$ref": "#/components/responses/Problem412"
          },
          "422": {
            "$ref": "#/components/responses/Problem422"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      }
    },
    "/v1/goods-receipts/{goodsReceiptId}/discard": {
      "post": {
        "operationId": "discardGoodsReceipt",
        "summary": "Discards a goods receipt that has not been confirmed.",
        "description": "Discards a goods receipt that has not been confirmed. Needs the `ledger:propose` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "purchases"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:propose",
        "parameters": [
          {
            "name": "goodsReceiptId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "reason": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 500
                  }
                },
                "required": [
                  "reason"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "Ledger-Position": {
                "$ref": "#/components/headers/LedgerPosition"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RecordGoodsReceiptResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem400"
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "404": {
            "$ref": "#/components/responses/Problem404"
          },
          "409": {
            "$ref": "#/components/responses/Problem409"
          },
          "412": {
            "$ref": "#/components/responses/Problem412"
          },
          "422": {
            "$ref": "#/components/responses/Problem422"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      }
    },
    "/v1/goods-receipts/{goodsReceiptId}/evidence": {
      "post": {
        "operationId": "attachGoodsReceiptEvidence",
        "summary": "Attaches evidence to a goods receipt.",
        "description": "Attaches evidence to a goods receipt. Needs the `ledger:propose` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "purchases"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:propose",
        "parameters": [
          {
            "name": "goodsReceiptId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "documentId": {
                    "type": "string",
                    "minLength": 1
                  },
                  "caption": {
                    "default": null,
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 200
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                },
                "required": [
                  "documentId"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "Ledger-Position": {
                "$ref": "#/components/headers/LedgerPosition"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Receipt"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem400"
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "404": {
            "$ref": "#/components/responses/Problem404"
          },
          "409": {
            "$ref": "#/components/responses/Problem409"
          },
          "412": {
            "$ref": "#/components/responses/Problem412"
          },
          "422": {
            "$ref": "#/components/responses/Problem422"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      }
    },
    "/v1/goods-receipts/{goodsReceiptId}/evidence/{evidenceId}/withdraw": {
      "post": {
        "operationId": "withdrawGoodsReceiptEvidence",
        "summary": "Withdraws evidence attached to a goods receipt.",
        "description": "Withdraws evidence attached to a goods receipt. Needs the `ledger:propose` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "purchases"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:propose",
        "parameters": [
          {
            "name": "goodsReceiptId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "evidenceId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "reason": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 500
                  }
                },
                "required": [
                  "reason"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "Ledger-Position": {
                "$ref": "#/components/headers/LedgerPosition"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Receipt"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem400"
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "404": {
            "$ref": "#/components/responses/Problem404"
          },
          "409": {
            "$ref": "#/components/responses/Problem409"
          },
          "412": {
            "$ref": "#/components/responses/Problem412"
          },
          "422": {
            "$ref": "#/components/responses/Problem422"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      }
    },
    "/v1/goods-receipts/{goodsReceiptId}/void": {
      "post": {
        "operationId": "voidGoodsReceipt",
        "summary": "Voids a confirmed goods receipt.",
        "description": "Voids a confirmed goods receipt. Needs the `ledger:propose` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "purchases"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:propose",
        "parameters": [
          {
            "name": "goodsReceiptId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "reason": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 500
                  }
                },
                "required": [
                  "reason"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "Ledger-Position": {
                "$ref": "#/components/headers/LedgerPosition"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RecordGoodsReceiptResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem400"
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "404": {
            "$ref": "#/components/responses/Problem404"
          },
          "409": {
            "$ref": "#/components/responses/Problem409"
          },
          "412": {
            "$ref": "#/components/responses/Problem412"
          },
          "422": {
            "$ref": "#/components/responses/Problem422"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      }
    },
    "/v1/payables-ageing": {
      "get": {
        "operationId": "getPayablesAgeing",
        "summary": "Returns the payables ageing of the ledger.",
        "description": "Returns the payables ageing of the ledger. Needs the `statements:read` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "purchases"
        ],
        "x-stability-level": "beta",
        "x-scope": "statements:read",
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "default": 50,
              "type": "integer",
              "minimum": 1,
              "maximum": 200
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 512
            }
          },
          {
            "name": "entityId",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "asOf",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
            }
          },
          {
            "name": "vendor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 40
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "current": {
                            "type": "string",
                            "pattern": "^-?\\d+$"
                          },
                          "d1to30": {
                            "type": "string",
                            "pattern": "^-?\\d+$"
                          },
                          "d31to60": {
                            "type": "string",
                            "pattern": "^-?\\d+$"
                          },
                          "d61to90": {
                            "type": "string",
                            "pattern": "^-?\\d+$"
                          },
                          "over90": {
                            "type": "string",
                            "pattern": "^-?\\d+$"
                          },
                          "held": {
                            "type": "string",
                            "pattern": "^-?\\d+$"
                          },
                          "total": {
                            "type": "string",
                            "pattern": "^-?\\d+$"
                          },
                          "key": {
                            "type": "string"
                          },
                          "vendor": {
                            "anyOf": [
                              {
                                "type": "object",
                                "properties": {
                                  "id": {
                                    "type": "string"
                                  },
                                  "displayName": {
                                    "type": "string"
                                  },
                                  "paymentHold": {
                                    "type": "boolean"
                                  }
                                },
                                "required": [
                                  "id",
                                  "displayName",
                                  "paymentHold"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "supplierNames": {
                            "maxItems": 3,
                            "type": "array",
                            "items": {
                              "type": "string"
                            }
                          },
                          "supplierCount": {
                            "type": "integer",
                            "minimum": 0,
                            "maximum": 9007199254740991
                          },
                          "billCount": {
                            "type": "integer",
                            "minimum": 1,
                            "maximum": 9007199254740991
                          },
                          "heldBillCount": {
                            "type": "integer",
                            "minimum": 0,
                            "maximum": 9007199254740991
                          },
                          "oldestDueDate": {
                            "anyOf": [
                              {
                                "type": "string",
                                "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "daysLate": {
                            "anyOf": [
                              {
                                "type": "integer",
                                "exclusiveMinimum": 0,
                                "maximum": 9007199254740991
                              },
                              {
                                "type": "null"
                              }
                            ]
                          }
                        },
                        "required": [
                          "current",
                          "d1to30",
                          "d31to60",
                          "d61to90",
                          "over90",
                          "held",
                          "total",
                          "key",
                          "vendor",
                          "supplierNames",
                          "supplierCount",
                          "billCount",
                          "heldBillCount",
                          "oldestDueDate",
                          "daysLate"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "nextCursor": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "total": {
                      "anyOf": [
                        {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "asOf": {
                      "type": "string",
                      "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                    },
                    "entity": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "name": {
                          "type": "string"
                        },
                        "timeZone": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "id",
                        "name",
                        "timeZone"
                      ],
                      "additionalProperties": false
                    },
                    "currency": {
                      "type": "string",
                      "pattern": "^[A-Z]{3}$"
                    },
                    "totals": {
                      "$ref": "#/components/schemas/Totals4"
                    },
                    "openBillCount": {
                      "type": "integer",
                      "minimum": 0,
                      "maximum": 9007199254740991
                    },
                    "heldBillCount": {
                      "type": "integer",
                      "minimum": 0,
                      "maximum": 9007199254740991
                    },
                    "tie": {
                      "$ref": "#/components/schemas/TieOption1"
                    },
                    "filteredTotals": {
                      "anyOf": [
                        {
                          "$ref": "#/components/schemas/FilteredTotalsOption1"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  },
                  "required": [
                    "data",
                    "nextCursor",
                    "total",
                    "asOf",
                    "entity",
                    "currency",
                    "totals",
                    "openBillCount",
                    "heldBillCount",
                    "tie",
                    "filteredTotals"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "422": {
            "$ref": "#/components/responses/Problem422"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      }
    },
    "/v1/payables-ageing/bills": {
      "get": {
        "operationId": "listPayablesAgeingBills",
        "summary": "Lists the bills that make up the payables ageing.",
        "description": "Lists the bills that make up the payables ageing. Needs the `statements:read` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "purchases"
        ],
        "x-stability-level": "beta",
        "x-scope": "statements:read",
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "default": 50,
              "type": "integer",
              "minimum": 1,
              "maximum": 200
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 512
            }
          },
          {
            "name": "entityId",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "asOf",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
            }
          },
          {
            "name": "vendor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 40
            }
          },
          {
            "name": "column",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "current",
                "d1to30",
                "d31to60",
                "d61to90",
                "over90",
                "held"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "billId": {
                            "type": "string"
                          },
                          "number": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "supplierName": {
                            "type": "string"
                          },
                          "vendor": {
                            "anyOf": [
                              {
                                "type": "object",
                                "properties": {
                                  "id": {
                                    "type": "string"
                                  },
                                  "displayName": {
                                    "type": "string"
                                  }
                                },
                                "required": [
                                  "id",
                                  "displayName"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "billDate": {
                            "type": "string",
                            "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                          },
                          "dueDate": {
                            "type": "string",
                            "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                          },
                          "currency": {
                            "type": "string",
                            "pattern": "^[A-Z]{3}$"
                          },
                          "totalMinor": {
                            "type": "string",
                            "pattern": "^-?\\d+$"
                          },
                          "openMinor": {
                            "type": "string",
                            "pattern": "^-?\\d+$"
                          },
                          "functionalOpenMinor": {
                            "type": "string",
                            "pattern": "^-?\\d+$"
                          },
                          "column": {
                            "type": "string",
                            "enum": [
                              "current",
                              "d1to30",
                              "d31to60",
                              "d61to90",
                              "over90",
                              "held"
                            ]
                          },
                          "daysLate": {
                            "anyOf": [
                              {
                                "type": "integer",
                                "exclusiveMinimum": 0,
                                "maximum": 9007199254740991
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "hold": {
                            "anyOf": [
                              {
                                "type": "object",
                                "properties": {
                                  "reason": {
                                    "type": "string"
                                  },
                                  "heldAt": {
                                    "type": "string"
                                  },
                                  "heldBy": {
                                    "type": "object",
                                    "properties": {
                                      "id": {
                                        "type": "string"
                                      },
                                      "name": {
                                        "type": "string"
                                      }
                                    },
                                    "required": [
                                      "id",
                                      "name"
                                    ],
                                    "additionalProperties": false
                                  },
                                  "heldUntil": {
                                    "anyOf": [
                                      {
                                        "type": "string",
                                        "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                                      },
                                      {
                                        "type": "null"
                                      }
                                    ]
                                  },
                                  "byPolicy": {
                                    "type": "boolean"
                                  }
                                },
                                "required": [
                                  "reason",
                                  "heldAt",
                                  "heldBy",
                                  "heldUntil",
                                  "byPolicy"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "null"
                              }
                            ]
                          }
                        },
                        "required": [
                          "billId",
                          "number",
                          "supplierName",
                          "vendor",
                          "billDate",
                          "dueDate",
                          "currency",
                          "totalMinor",
                          "openMinor",
                          "functionalOpenMinor",
                          "column",
                          "daysLate",
                          "hold"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "nextCursor": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "total": {
                      "anyOf": [
                        {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "asOf": {
                      "type": "string",
                      "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                    },
                    "entity": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "name": {
                          "type": "string"
                        },
                        "timeZone": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "id",
                        "name",
                        "timeZone"
                      ],
                      "additionalProperties": false
                    },
                    "currency": {
                      "type": "string",
                      "pattern": "^[A-Z]{3}$"
                    },
                    "vendorLabel": {
                      "type": [
                        "string",
                        "null"
                      ]
                    }
                  },
                  "required": [
                    "data",
                    "nextCursor",
                    "total",
                    "asOf",
                    "entity",
                    "currency",
                    "vendorLabel"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "422": {
            "$ref": "#/components/responses/Problem422"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      }
    },
    "/v1/payables-ageing/tie": {
      "get": {
        "operationId": "getPayablesTie",
        "summary": "Returns how the payables ageing ties to the general ledger.",
        "description": "Returns how the payables ageing ties to the general ledger. Needs the `statements:read` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "purchases"
        ],
        "x-stability-level": "beta",
        "x-scope": "statements:read",
        "parameters": [
          {
            "name": "entityId",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "accountId",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "asOf",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "rows": {
                      "$ref": "#/components/schemas/Rows3"
                    }
                  },
                  "required": [
                    "rows"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "422": {
            "$ref": "#/components/responses/Problem422"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      }
    },
    "/v1/payables-ageing/unexplained": {
      "get": {
        "operationId": "listPayablesUnexplained",
        "summary": "Lists the payables differences the ageing cannot explain yet.",
        "description": "Lists the payables differences the ageing cannot explain yet. Needs the `statements:read` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "purchases"
        ],
        "x-stability-level": "beta",
        "x-scope": "statements:read",
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "default": 50,
              "type": "integer",
              "minimum": 1,
              "maximum": 200
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 512
            }
          },
          {
            "name": "entityId",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "asOf",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
            }
          },
          {
            "name": "source",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "MANUAL",
                "AGENT_PROPOSAL",
                "RECURRING",
                "REVERSAL",
                "IMPORT",
                "CHAT",
                "MIGRATION",
                "PAYMENT_RUN",
                "INVOICE",
                "RECEIPT",
                "BILL",
                "BILL_SETTLEMENT",
                "VENDOR_CREDIT"
              ]
            }
          },
          {
            "name": "side",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "ADDED",
                "TAKEN_OFF"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "lineId": {
                            "type": "string"
                          },
                          "entry": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string"
                              },
                              "entryNumber": {
                                "anyOf": [
                                  {
                                    "type": "integer",
                                    "minimum": -9007199254740991,
                                    "maximum": 9007199254740991
                                  },
                                  {
                                    "type": "null"
                                  }
                                ]
                              },
                              "entryDate": {
                                "type": "string",
                                "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                              },
                              "memo": {
                                "type": [
                                  "string",
                                  "null"
                                ]
                              },
                              "sourceKind": {
                                "type": "string",
                                "enum": [
                                  "MANUAL",
                                  "AGENT_PROPOSAL",
                                  "RECURRING",
                                  "REVERSAL",
                                  "IMPORT",
                                  "CHAT",
                                  "MIGRATION",
                                  "PAYMENT_RUN",
                                  "INVOICE",
                                  "RECEIPT",
                                  "BILL",
                                  "BILL_SETTLEMENT",
                                  "VENDOR_CREDIT"
                                ]
                              },
                              "status": {
                                "type": "string",
                                "enum": [
                                  "DRAFT",
                                  "PROPOSED",
                                  "IN_REVIEW",
                                  "APPROVED",
                                  "POSTED",
                                  "DECLINED",
                                  "REVERSED"
                                ]
                              }
                            },
                            "required": [
                              "id",
                              "entryNumber",
                              "entryDate",
                              "memo",
                              "sourceKind",
                              "status"
                            ],
                            "additionalProperties": false
                          },
                          "account": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string"
                              },
                              "code": {
                                "type": "string"
                              },
                              "name": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "id",
                              "code",
                              "name"
                            ],
                            "additionalProperties": false
                          },
                          "payableMinor": {
                            "type": "string",
                            "pattern": "^-?\\d+$"
                          },
                          "currency": {
                            "type": "string",
                            "pattern": "^[A-Z]{3}$"
                          },
                          "amountMinor": {
                            "type": "string",
                            "pattern": "^-?\\d+$"
                          }
                        },
                        "required": [
                          "lineId",
                          "entry",
                          "account",
                          "payableMinor",
                          "currency",
                          "amountMinor"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "nextCursor": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "total": {
                      "anyOf": [
                        {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "asOf": {
                      "type": "string",
                      "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                    },
                    "entity": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "name": {
                          "type": "string"
                        },
                        "timeZone": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "id",
                        "name",
                        "timeZone"
                      ],
                      "additionalProperties": false
                    },
                    "currency": {
                      "type": "string",
                      "pattern": "^[A-Z]{3}$"
                    },
                    "unexplainedMinor": {
                      "type": "string",
                      "pattern": "^-?\\d+$"
                    },
                    "groups": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "sourceKind": {
                            "type": "string",
                            "enum": [
                              "MANUAL",
                              "AGENT_PROPOSAL",
                              "RECURRING",
                              "REVERSAL",
                              "IMPORT",
                              "CHAT",
                              "MIGRATION",
                              "PAYMENT_RUN",
                              "INVOICE",
                              "RECEIPT",
                              "BILL",
                              "BILL_SETTLEMENT",
                              "VENDOR_CREDIT"
                            ]
                          },
                          "reversedPair": {
                            "type": "boolean"
                          },
                          "side": {
                            "type": "string",
                            "enum": [
                              "ADDED",
                              "TAKEN_OFF"
                            ]
                          },
                          "lineCount": {
                            "type": "integer",
                            "minimum": 1,
                            "maximum": 9007199254740991
                          },
                          "payableMinor": {
                            "type": "string",
                            "pattern": "^-?\\d+$"
                          }
                        },
                        "required": [
                          "sourceKind",
                          "reversedPair",
                          "side",
                          "lineCount",
                          "payableMinor"
                        ],
                        "additionalProperties": false
                      }
                    }
                  },
                  "required": [
                    "data",
                    "nextCursor",
                    "total",
                    "asOf",
                    "entity",
                    "currency",
                    "unexplainedMinor",
                    "groups"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "422": {
            "$ref": "#/components/responses/Problem422"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      }
    },
    "/v1/prepaid-schedules/{prepaidScheduleId}/end-early": {
      "post": {
        "operationId": "endPrepaidScheduleEarly",
        "summary": "Ends a prepaid schedule before its last period.",
        "description": "Ends a prepaid schedule before its last period. Needs the `ledger:propose` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "purchases"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:propose",
        "parameters": [
          {
            "name": "prepaidScheduleId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "destinationAccountId": {
                    "type": "string",
                    "minLength": 1
                  },
                  "reason": {
                    "type": "string",
                    "enum": [
                      "CANCELLED",
                      "REFUNDED",
                      "WRITTEN_OFF",
                      "OTHER"
                    ]
                  },
                  "note": {
                    "type": "string",
                    "maxLength": 300
                  }
                },
                "required": [
                  "destinationAccountId",
                  "reason"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "Ledger-Position": {
                "$ref": "#/components/headers/LedgerPosition"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "scheduleId": {
                      "type": "string"
                    },
                    "entryId": {
                      "type": "string"
                    },
                    "proposalId": {
                      "type": "string"
                    },
                    "rowCount": {
                      "type": "integer",
                      "minimum": 1,
                      "maximum": 9007199254740991
                    },
                    "amountMinor": {
                      "type": "string",
                      "pattern": "^-?\\d+$"
                    }
                  },
                  "required": [
                    "scheduleId",
                    "entryId",
                    "proposalId",
                    "rowCount",
                    "amountMinor"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem400"
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "404": {
            "$ref": "#/components/responses/Problem404"
          },
          "409": {
            "$ref": "#/components/responses/Problem409"
          },
          "412": {
            "$ref": "#/components/responses/Problem412"
          },
          "422": {
            "$ref": "#/components/responses/Problem422"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      }
    },
    "/v1/purchase-order-lines": {
      "get": {
        "operationId": "listPurchaseOrderLines",
        "summary": "Lists the purchase order lines, with the server's total.",
        "description": "Lists the purchase order lines, with the server's total. Needs the `ledger:read` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "purchases"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:read",
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "default": 50,
              "type": "integer",
              "minimum": 1,
              "maximum": 200
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 512
            }
          },
          {
            "name": "entityId",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "vendorId",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "currency",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^[A-Z]{3}$"
            }
          },
          {
            "name": "billId",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "q",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 100
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "orderId": {
                            "type": "string"
                          },
                          "orderNumber": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "position": {
                            "type": "integer",
                            "minimum": 0,
                            "maximum": 9007199254740991
                          },
                          "description": {
                            "type": "string"
                          },
                          "remainingQuantity": {
                            "type": "string",
                            "pattern": "^\\d{1,10}(\\.\\d{1,4})?$"
                          },
                          "unitPriceMinor": {
                            "type": "string",
                            "pattern": "^-?\\d+$"
                          },
                          "currency": {
                            "type": "string",
                            "pattern": "^[A-Z]{3}$"
                          },
                          "orderStatus": {
                            "type": "string",
                            "enum": [
                              "DRAFT",
                              "IN_APPROVAL",
                              "APPROVED",
                              "SENT",
                              "PART_RECEIVED",
                              "RECEIVED",
                              "CLOSED",
                              "CANCELLED"
                            ]
                          },
                          "fullyBilled": {
                            "type": "boolean"
                          }
                        },
                        "required": [
                          "id",
                          "orderId",
                          "orderNumber",
                          "position",
                          "description",
                          "remainingQuantity",
                          "unitPriceMinor",
                          "currency",
                          "orderStatus",
                          "fullyBilled"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "total": {
                      "type": "integer",
                      "minimum": 0,
                      "maximum": 9007199254740991
                    },
                    "nextCursor": {
                      "type": [
                        "string",
                        "null"
                      ]
                    }
                  },
                  "required": [
                    "data",
                    "total",
                    "nextCursor"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "422": {
            "$ref": "#/components/responses/Problem422"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      }
    },
    "/v1/purchase-orders": {
      "get": {
        "operationId": "listPurchaseOrders",
        "summary": "Lists the purchase orders, with the server's total.",
        "description": "Lists the purchase orders, with the server's total. Needs the `ledger:read` permission. Stable: a change that breaks callers needs 365 days' notice.",
        "tags": [
          "purchases"
        ],
        "x-stability-level": "stable",
        "x-scope": "ledger:read",
        "parameters": [
          {
            "name": "status",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "enum": [
                    "DRAFT",
                    "IN_APPROVAL",
                    "APPROVED",
                    "SENT",
                    "PART_RECEIVED",
                    "RECEIVED",
                    "CLOSED",
                    "CANCELLED"
                  ]
                },
                {
                  "type": "string",
                  "const": "open"
                }
              ]
            }
          },
          {
            "name": "entityId",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "vendorId",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "requestedById",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "awaiting",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "myApproval",
                "receipt"
              ]
            }
          },
          {
            "name": "q",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 100
            }
          },
          {
            "name": "orderFrom",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
            }
          },
          {
            "name": "orderTo",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
            }
          },
          {
            "name": "sort",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 64
            }
          },
          {
            "name": "cf",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 4000
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "default": 50,
              "type": "integer",
              "minimum": 1,
              "maximum": 200
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 512
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "number": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "status": {
                            "type": "string",
                            "enum": [
                              "DRAFT",
                              "IN_APPROVAL",
                              "APPROVED",
                              "SENT",
                              "PART_RECEIVED",
                              "RECEIVED",
                              "CLOSED",
                              "CANCELLED"
                            ]
                          },
                          "source": {
                            "type": "string",
                            "enum": [
                              "MANUAL",
                              "QUOTE_READ",
                              "PATTERN",
                              "IMPORT"
                            ]
                          },
                          "revision": {
                            "type": "integer",
                            "minimum": 0,
                            "maximum": 9007199254740991
                          },
                          "entity": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string"
                              },
                              "name": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "id",
                              "name"
                            ],
                            "additionalProperties": false
                          },
                          "entityTimeZone": {
                            "type": "string"
                          },
                          "vendor": {
                            "anyOf": [
                              {
                                "type": "object",
                                "properties": {
                                  "id": {
                                    "type": "string"
                                  },
                                  "displayName": {
                                    "type": "string"
                                  }
                                },
                                "required": [
                                  "id",
                                  "displayName"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "supplierReference": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "currency": {
                            "type": "string",
                            "pattern": "^[A-Z]{3}$"
                          },
                          "totalMinor": {
                            "type": "string",
                            "pattern": "^-?\\d+$"
                          },
                          "functionalTotalMinor": {
                            "anyOf": [
                              {
                                "type": "string",
                                "pattern": "^-?\\d+$"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "lineCount": {
                            "type": "integer",
                            "minimum": 0,
                            "maximum": 9007199254740991
                          },
                          "expectedBy": {
                            "anyOf": [
                              {
                                "type": "string",
                                "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "orderDate": {
                            "anyOf": [
                              {
                                "type": "string",
                                "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "createdAt": {
                            "type": "string",
                            "minLength": 20
                          },
                          "requestedBy": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string"
                              },
                              "name": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "id",
                              "name"
                            ],
                            "additionalProperties": false
                          },
                          "submittedAt": {
                            "anyOf": [
                              {
                                "type": "string",
                                "minLength": 20
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "sentAt": {
                            "anyOf": [
                              {
                                "type": "string",
                                "minLength": 20
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "declined": {
                            "$ref": "#/components/schemas/Retired"
                          },
                          "customFields": {
                            "$ref": "#/components/schemas/CustomFields2"
                          }
                        },
                        "required": [
                          "id",
                          "number",
                          "status",
                          "source",
                          "revision",
                          "entity",
                          "entityTimeZone",
                          "vendor",
                          "supplierReference",
                          "currency",
                          "totalMinor",
                          "functionalTotalMinor",
                          "lineCount",
                          "expectedBy",
                          "orderDate",
                          "createdAt",
                          "requestedBy",
                          "submittedAt",
                          "sentAt",
                          "declined"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "total": {
                      "type": "integer",
                      "minimum": 0,
                      "maximum": 9007199254740991
                    },
                    "nextCursor": {
                      "type": [
                        "string",
                        "null"
                      ]
                    }
                  },
                  "required": [
                    "data",
                    "total",
                    "nextCursor"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "422": {
            "$ref": "#/components/responses/Problem422"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      },
      "post": {
        "operationId": "createPurchaseOrder",
        "summary": "Creates a draft purchase order for a vendor.",
        "description": "Creates a draft purchase order for a vendor. Needs the `ledger:propose` permission. Stable: a change that breaks callers needs 365 days' notice.",
        "tags": [
          "purchases"
        ],
        "x-stability-level": "stable",
        "x-scope": "ledger:propose",
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "entityId": {
                    "type": "string",
                    "minLength": 1
                  },
                  "vendorId": {
                    "anyOf": [
                      {
                        "type": "string",
                        "minLength": 1
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "currency": {
                    "type": "string",
                    "pattern": "^[A-Z]{3}$"
                  },
                  "supplierReference": {
                    "default": null,
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 120
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "deliveryNote": {
                    "default": null,
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 500
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "memo": {
                    "default": null,
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 500
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "lines": {
                    "default": [],
                    "maxItems": 200,
                    "type": "array",
                    "items": {
                      "$ref": "#/components/schemas/LinesItem"
                    }
                  },
                  "customFields": {
                    "$ref": "#/components/schemas/CustomFields3"
                  }
                },
                "required": [
                  "entityId",
                  "vendorId",
                  "currency"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "Ledger-Position": {
                "$ref": "#/components/headers/LedgerPosition"
              },
              "Location": {
                "$ref": "#/components/headers/Location"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CreatePurchaseOrderResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem400"
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "409": {
            "$ref": "#/components/responses/Problem409"
          },
          "412": {
            "$ref": "#/components/responses/Problem412"
          },
          "422": {
            "$ref": "#/components/responses/Problem422"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      }
    },
    "/v1/purchase-orders/bulk/submit": {
      "post": {
        "operationId": "bulkSubmitPurchaseOrders",
        "summary": "Submits several purchase orders for approval in one request.",
        "description": "Submits several purchase orders for approval in one request. Needs the `ledger:propose` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "purchases"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:propose",
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BulkHoldVendorPaymentsRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "Ledger-Position": {
                "$ref": "#/components/headers/LedgerPosition"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BulkHoldVendorPaymentsResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem400"
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "409": {
            "$ref": "#/components/responses/Problem409"
          },
          "412": {
            "$ref": "#/components/responses/Problem412"
          },
          "422": {
            "$ref": "#/components/responses/Problem422"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      }
    },
    "/v1/purchase-orders/number-series": {
      "get": {
        "operationId": "getPurchaseOrderNumberSeries",
        "summary": "Returns the numbering series purchase orders are raised under.",
        "description": "Returns the numbering series purchase orders are raised under. Needs the `ledger:read` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "purchases"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:read",
        "parameters": [
          {
            "name": "entityId",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetPurchaseOrderNumberSeriesResponse"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "422": {
            "$ref": "#/components/responses/Problem422"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      },
      "put": {
        "operationId": "updatePurchaseOrderNumberSeries",
        "summary": "Changes the numbering series purchase orders are raised under.",
        "description": "Changes the numbering series purchase orders are raised under. Needs the `ledger:admin` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "purchases"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:admin",
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "entityId": {
                    "type": "string",
                    "minLength": 1
                  },
                  "prefix": {
                    "type": "string",
                    "pattern": "^[A-Za-z0-9-]{1,12}$"
                  },
                  "padding": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 12
                  },
                  "next": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 9007199254740991
                  }
                },
                "required": [
                  "entityId",
                  "prefix",
                  "padding",
                  "next"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "Ledger-Position": {
                "$ref": "#/components/headers/LedgerPosition"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetPurchaseOrderNumberSeriesResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem400"
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "409": {
            "$ref": "#/components/responses/Problem409"
          },
          "412": {
            "$ref": "#/components/responses/Problem412"
          },
          "422": {
            "$ref": "#/components/responses/Problem422"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      }
    },
    "/v1/purchase-orders/quote-read": {
      "post": {
        "operationId": "readPurchaseOrderQuote",
        "summary": "Reads a vendor quote against a purchase order draft.",
        "description": "Reads a vendor quote against a purchase order draft. Needs the `ledger:propose` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "purchases"
        ],
        "x-stability-level": "beta",
        "x-eternify-read": true,
        "x-scope": "ledger:propose",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "documentId": {
                    "type": "string",
                    "minLength": 1
                  },
                  "entityId": {
                    "type": "string",
                    "minLength": 1
                  }
                },
                "required": [
                  "documentId",
                  "entityId"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "read": {
                          "type": "object",
                          "properties": {
                            "supplier": {
                              "type": "object",
                              "properties": {
                                "name": {
                                  "type": [
                                    "string",
                                    "null"
                                  ]
                                },
                                "candidates": {
                                  "type": "array",
                                  "items": {
                                    "type": "object",
                                    "properties": {
                                      "id": {
                                        "type": "string"
                                      },
                                      "displayName": {
                                        "type": "string"
                                      }
                                    },
                                    "required": [
                                      "id",
                                      "displayName"
                                    ],
                                    "additionalProperties": false
                                  }
                                }
                              },
                              "required": [
                                "name",
                                "candidates"
                              ],
                              "additionalProperties": false
                            },
                            "quoteNumber": {
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "quoteDate": {
                              "anyOf": [
                                {
                                  "type": "string",
                                  "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "validUntil": {
                              "anyOf": [
                                {
                                  "type": "string",
                                  "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "currency": {
                              "anyOf": [
                                {
                                  "type": "string",
                                  "pattern": "^[A-Z]{3}$"
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "printedTotalMinor": {
                              "anyOf": [
                                {
                                  "type": "string",
                                  "pattern": "^-?\\d+$"
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "lines": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "description": {
                                    "type": "string"
                                  },
                                  "quantity": {
                                    "type": [
                                      "string",
                                      "null"
                                    ]
                                  },
                                  "unitPriceMinor": {
                                    "anyOf": [
                                      {
                                        "type": "string",
                                        "pattern": "^-?\\d+$"
                                      },
                                      {
                                        "type": "null"
                                      }
                                    ]
                                  },
                                  "expectedDate": {
                                    "anyOf": [
                                      {
                                        "type": "string",
                                        "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                                      },
                                      {
                                        "type": "null"
                                      }
                                    ]
                                  },
                                  "evidence": {
                                    "type": "string"
                                  },
                                  "unread": {
                                    "type": "array",
                                    "items": {
                                      "type": "string"
                                    }
                                  }
                                },
                                "required": [
                                  "description",
                                  "quantity",
                                  "unitPriceMinor",
                                  "expectedDate",
                                  "evidence",
                                  "unread"
                                ],
                                "additionalProperties": false
                              }
                            },
                            "warnings": {
                              "type": "array",
                              "items": {
                                "type": "string"
                              }
                            },
                            "pagesRead": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 9007199254740991
                            },
                            "charsRead": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 9007199254740991
                            },
                            "charsThere": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 9007199254740991
                            },
                            "promptVersion": {
                              "type": "string"
                            }
                          },
                          "required": [
                            "supplier",
                            "quoteNumber",
                            "quoteDate",
                            "validUntil",
                            "currency",
                            "printedTotalMinor",
                            "lines",
                            "warnings",
                            "pagesRead",
                            "charsRead",
                            "charsThere",
                            "promptVersion"
                          ],
                          "additionalProperties": false
                        },
                        "why": {
                          "type": "null"
                        }
                      },
                      "required": [
                        "read",
                        "why"
                      ],
                      "additionalProperties": false
                    },
                    {
                      "type": "object",
                      "properties": {
                        "read": {
                          "type": "null"
                        },
                        "why": {
                          "type": "string",
                          "enum": [
                            "DISCLOSURE",
                            "BUDGET",
                            "PROVIDER",
                            "UNPARSABLE",
                            "REFUSED",
                            "UNREADABLE",
                            "NOT_A_QUOTE",
                            "PAUSED_AFTER_THREE_EDITED"
                          ]
                        },
                        "resumesOn": {
                          "type": "string",
                          "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                        }
                      },
                      "required": [
                        "read",
                        "why"
                      ],
                      "additionalProperties": false
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "422": {
            "$ref": "#/components/responses/Problem422"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      }
    },
    "/v1/purchase-orders/suggestions": {
      "get": {
        "operationId": "listPurchaseOrderSuggestions",
        "summary": "Lists the purchase orders the ledger suggests raising, waiting for a decision.",
        "description": "Lists the purchase orders the ledger suggests raising, waiting for a decision. Needs the `ledger:read` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "purchases"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:read",
        "parameters": [
          {
            "name": "entityId",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "maxItems": 5,
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "entityId": {
                            "type": "string"
                          },
                          "vendor": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string"
                              },
                              "displayName": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "id",
                              "displayName"
                            ],
                            "additionalProperties": false
                          },
                          "patternBillId": {
                            "type": "string"
                          },
                          "cadenceDays": {
                            "type": "integer",
                            "minimum": 1,
                            "maximum": 9007199254740991
                          },
                          "lastBills": {
                            "maxItems": 3,
                            "type": "array",
                            "items": {
                              "type": "object",
                              "properties": {
                                "number": {
                                  "type": [
                                    "string",
                                    "null"
                                  ]
                                },
                                "billDate": {
                                  "type": "string",
                                  "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                                }
                              },
                              "required": [
                                "number",
                                "billDate"
                              ],
                              "additionalProperties": false
                            }
                          },
                          "lastSubtotalMinor": {
                            "type": "string",
                            "pattern": "^-?\\d+$"
                          },
                          "currency": {
                            "type": "string",
                            "pattern": "^[A-Z]{3}$"
                          },
                          "dueOn": {
                            "type": "string",
                            "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                          },
                          "sentence": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "entityId",
                          "vendor",
                          "patternBillId",
                          "cadenceDays",
                          "lastBills",
                          "lastSubtotalMinor",
                          "currency",
                          "dueOn",
                          "sentence"
                        ],
                        "additionalProperties": false
                      }
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "422": {
            "$ref": "#/components/responses/Problem422"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      }
    },
    "/v1/purchase-orders/suggestions/decline": {
      "post": {
        "operationId": "declinePurchaseOrderSuggestion",
        "summary": "Declines a suggested purchase order with a reason.",
        "description": "Declines a suggested purchase order with a reason. Needs the `ledger:propose` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "purchases"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:propose",
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "entityId": {
                    "type": "string",
                    "minLength": 1
                  },
                  "vendorId": {
                    "type": "string",
                    "minLength": 1
                  },
                  "patternBillId": {
                    "type": "string",
                    "minLength": 1
                  },
                  "reason": {
                    "default": null,
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 500
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                },
                "required": [
                  "entityId",
                  "vendorId",
                  "patternBillId"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "Ledger-Position": {
                "$ref": "#/components/headers/LedgerPosition"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DeclinePurchaseOrderSuggestionResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem400"
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "409": {
            "$ref": "#/components/responses/Problem409"
          },
          "412": {
            "$ref": "#/components/responses/Problem412"
          },
          "422": {
            "$ref": "#/components/responses/Problem422"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      }
    },
    "/v1/purchase-orders/{purchaseOrderId}": {
      "get": {
        "operationId": "getPurchaseOrder",
        "summary": "Returns one purchase order with its lines and status.",
        "description": "Returns one purchase order with its lines and status. Needs the `ledger:read` permission. Stable: a change that breaks callers needs 365 days' notice.",
        "tags": [
          "purchases"
        ],
        "x-stability-level": "stable",
        "x-scope": "ledger:read",
        "parameters": [
          {
            "name": "purchaseOrderId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "number": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "status": {
                      "type": "string",
                      "enum": [
                        "DRAFT",
                        "IN_APPROVAL",
                        "APPROVED",
                        "SENT",
                        "PART_RECEIVED",
                        "RECEIVED",
                        "CLOSED",
                        "CANCELLED"
                      ]
                    },
                    "source": {
                      "type": "string",
                      "enum": [
                        "MANUAL",
                        "QUOTE_READ",
                        "PATTERN",
                        "IMPORT"
                      ]
                    },
                    "revision": {
                      "type": "integer",
                      "minimum": 0,
                      "maximum": 9007199254740991
                    },
                    "entity": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "name": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "id",
                        "name"
                      ],
                      "additionalProperties": false
                    },
                    "entityTimeZone": {
                      "type": "string"
                    },
                    "vendor": {
                      "anyOf": [
                        {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "string"
                            },
                            "displayName": {
                              "type": "string"
                            }
                          },
                          "required": [
                            "id",
                            "displayName"
                          ],
                          "additionalProperties": false
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "supplierReference": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "currency": {
                      "type": "string",
                      "pattern": "^[A-Z]{3}$"
                    },
                    "totalMinor": {
                      "type": "string",
                      "pattern": "^-?\\d+$"
                    },
                    "functionalTotalMinor": {
                      "anyOf": [
                        {
                          "type": "string",
                          "pattern": "^-?\\d+$"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "lineCount": {
                      "type": "integer",
                      "minimum": 0,
                      "maximum": 9007199254740991
                    },
                    "expectedBy": {
                      "anyOf": [
                        {
                          "type": "string",
                          "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "orderDate": {
                      "anyOf": [
                        {
                          "type": "string",
                          "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "createdAt": {
                      "type": "string",
                      "minLength": 20
                    },
                    "requestedBy": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "name": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "id",
                        "name"
                      ],
                      "additionalProperties": false
                    },
                    "submittedAt": {
                      "anyOf": [
                        {
                          "type": "string",
                          "minLength": 20
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "sentAt": {
                      "anyOf": [
                        {
                          "type": "string",
                          "minLength": 20
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "declined": {
                      "$ref": "#/components/schemas/Retired"
                    },
                    "customFields": {
                      "$ref": "#/components/schemas/CustomFields2"
                    },
                    "deliveryNote": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "memo": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "lines": {
                      "$ref": "#/components/schemas/Lines6"
                    },
                    "gaps": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "quote": {
                      "$ref": "#/components/schemas/Quote"
                    },
                    "pattern": {
                      "$ref": "#/components/schemas/Pattern"
                    },
                    "counts": {
                      "type": "object",
                      "properties": {
                        "audit": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 9007199254740991
                        }
                      },
                      "required": [
                        "audit"
                      ],
                      "additionalProperties": false
                    },
                    "closed": {
                      "$ref": "#/components/schemas/Closed"
                    }
                  },
                  "required": [
                    "id",
                    "number",
                    "status",
                    "source",
                    "revision",
                    "entity",
                    "entityTimeZone",
                    "vendor",
                    "supplierReference",
                    "currency",
                    "totalMinor",
                    "functionalTotalMinor",
                    "lineCount",
                    "expectedBy",
                    "orderDate",
                    "createdAt",
                    "requestedBy",
                    "submittedAt",
                    "sentAt",
                    "declined",
                    "deliveryNote",
                    "memo",
                    "lines",
                    "gaps",
                    "quote",
                    "pattern",
                    "counts",
                    "closed"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "404": {
            "$ref": "#/components/responses/Problem404"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      },
      "patch": {
        "operationId": "updatePurchaseOrder",
        "summary": "Changes a draft purchase order.",
        "description": "Changes a draft purchase order. Needs the `ledger:propose` permission. Stable: a change that breaks callers needs 365 days' notice.",
        "tags": [
          "purchases"
        ],
        "x-stability-level": "stable",
        "x-scope": "ledger:propose",
        "parameters": [
          {
            "name": "purchaseOrderId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "vendorId": {
                    "anyOf": [
                      {
                        "type": "string",
                        "minLength": 1
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "currency": {
                    "type": "string",
                    "pattern": "^[A-Z]{3}$"
                  },
                  "supplierReference": {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 120
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "deliveryNote": {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 500
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "memo": {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 500
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "lines": {
                    "maxItems": 200,
                    "type": "array",
                    "items": {
                      "$ref": "#/components/schemas/LinesItem"
                    }
                  },
                  "customFields": {
                    "$ref": "#/components/schemas/CustomFields4"
                  }
                },
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "Ledger-Position": {
                "$ref": "#/components/headers/LedgerPosition"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CreatePurchaseOrderResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem400"
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "404": {
            "$ref": "#/components/responses/Problem404"
          },
          "409": {
            "$ref": "#/components/responses/Problem409"
          },
          "412": {
            "$ref": "#/components/responses/Problem412"
          },
          "422": {
            "$ref": "#/components/responses/Problem422"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      }
    },
    "/v1/purchase-orders/{purchaseOrderId}/approve": {
      "post": {
        "operationId": "approvePurchaseOrder",
        "summary": "Approves a purchase order so it can be sent to the vendor.",
        "description": "Approves a purchase order so it can be sent to the vendor. Needs the `ledger:approve` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "purchases"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:approve",
        "parameters": [
          {
            "name": "purchaseOrderId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "seenTotalMinor": {
                    "type": "string",
                    "pattern": "^-?\\d+$"
                  }
                },
                "required": [
                  "seenTotalMinor"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "Ledger-Position": {
                "$ref": "#/components/headers/LedgerPosition"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CreatePurchaseOrderResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem400"
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "404": {
            "$ref": "#/components/responses/Problem404"
          },
          "409": {
            "$ref": "#/components/responses/Problem409"
          },
          "412": {
            "$ref": "#/components/responses/Problem412"
          },
          "422": {
            "$ref": "#/components/responses/Problem422"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      }
    },
    "/v1/purchase-orders/{purchaseOrderId}/approvers": {
      "get": {
        "operationId": "listPurchaseOrderApprovers",
        "summary": "Lists the people who may approve one purchase order.",
        "description": "Lists the people who may approve one purchase order. Needs the `ledger:read` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "purchases"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:read",
        "parameters": [
          {
            "name": "purchaseOrderId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "default": 50,
              "type": "integer",
              "minimum": 1,
              "maximum": 200
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 512
            }
          },
          {
            "name": "q",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 80
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "name": {
                            "type": "string"
                          },
                          "capText": {
                            "type": "string"
                          },
                          "ownWorkText": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "unavailable": {
                            "type": [
                              "string",
                              "null"
                            ]
                          }
                        },
                        "required": [
                          "id",
                          "name",
                          "capText",
                          "ownWorkText",
                          "unavailable"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "nextCursor": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "total": {
                      "anyOf": [
                        {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  },
                  "required": [
                    "data",
                    "nextCursor",
                    "total"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "404": {
            "$ref": "#/components/responses/Problem404"
          },
          "422": {
            "$ref": "#/components/responses/Problem422"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      }
    },
    "/v1/purchase-orders/{purchaseOrderId}/audit": {
      "get": {
        "operationId": "listPurchaseOrderAudit",
        "summary": "Lists the audit trail of one purchase order.",
        "description": "Lists the audit trail of one purchase order. Needs the `ledger:read` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "purchases"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:read",
        "parameters": [
          {
            "name": "purchaseOrderId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "action",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "prefix",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^[a-z][A-Za-z]*\\.$"
            }
          },
          {
            "name": "actions",
            "in": "query",
            "required": false,
            "description": "Exact audit action names, separated by commas, at most 20.",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 600,
              "description": "Exact audit action names, separated by commas, at most 20."
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "default": 50,
              "type": "integer",
              "minimum": 1,
              "maximum": 200
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 512
            }
          },
          {
            "name": "origin",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "ALL",
                "NATIVE",
                "IMPORTED"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AuditLogResponse"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "404": {
            "$ref": "#/components/responses/Problem404"
          },
          "422": {
            "$ref": "#/components/responses/Problem422"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      }
    },
    "/v1/purchase-orders/{purchaseOrderId}/billing": {
      "get": {
        "operationId": "getPurchaseOrderBilling",
        "summary": "Returns the billing position of a purchase order.",
        "description": "Returns the billing position of a purchase order. Needs the `ledger:read` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "purchases"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:read",
        "parameters": [
          {
            "name": "purchaseOrderId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "default": 50,
              "type": "integer",
              "minimum": 1,
              "maximum": 200
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 512
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "lines": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "position": {
                            "type": "integer",
                            "minimum": 0,
                            "maximum": 9007199254740991
                          },
                          "description": {
                            "type": "string"
                          },
                          "orderedQuantity": {
                            "type": "string",
                            "pattern": "^\\d{1,10}(\\.\\d{1,4})?$"
                          },
                          "receivedQuantity": {
                            "type": "string",
                            "pattern": "^\\d{1,10}(\\.\\d{1,4})?$"
                          },
                          "billedQuantity": {
                            "type": "string",
                            "pattern": "^\\d{1,10}(\\.\\d{1,4})?$"
                          },
                          "billedNetMinor": {
                            "type": "string",
                            "pattern": "^-?\\d+$"
                          },
                          "unitPriceMinor": {
                            "type": "string",
                            "pattern": "^-?\\d+$"
                          },
                          "fullyBilled": {
                            "type": "boolean"
                          }
                        },
                        "required": [
                          "id",
                          "position",
                          "description",
                          "orderedQuantity",
                          "receivedQuantity",
                          "billedQuantity",
                          "billedNetMinor",
                          "unitPriceMinor",
                          "fullyBilled"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "foot": {
                      "type": "object",
                      "properties": {
                        "orderedMinor": {
                          "type": "string",
                          "pattern": "^-?\\d+$"
                        },
                        "billedNetMinor": {
                          "type": "string",
                          "pattern": "^-?\\d+$"
                        },
                        "currency": {
                          "type": "string",
                          "pattern": "^[A-Z]{3}$"
                        }
                      },
                      "required": [
                        "orderedMinor",
                        "billedNetMinor",
                        "currency"
                      ],
                      "additionalProperties": false
                    },
                    "bills": {
                      "type": "object",
                      "properties": {
                        "items": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "billId": {
                                "type": "string"
                              },
                              "supplierName": {
                                "type": "string"
                              },
                              "number": {
                                "type": [
                                  "string",
                                  "null"
                                ]
                              },
                              "status": {
                                "type": "string"
                              },
                              "billDate": {
                                "type": "string",
                                "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                              },
                              "netOnThisOrderMinor": {
                                "type": "string",
                                "pattern": "^-?\\d+$"
                              },
                              "currency": {
                                "type": "string",
                                "pattern": "^[A-Z]{3}$"
                              },
                              "findings": {
                                "type": "integer",
                                "minimum": 0,
                                "maximum": 9007199254740991
                              }
                            },
                            "required": [
                              "billId",
                              "supplierName",
                              "number",
                              "status",
                              "billDate",
                              "netOnThisOrderMinor",
                              "currency",
                              "findings"
                            ],
                            "additionalProperties": false
                          }
                        },
                        "nextCursor": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "total": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 9007199254740991
                        }
                      },
                      "required": [
                        "items",
                        "nextCursor",
                        "total"
                      ],
                      "additionalProperties": false
                    },
                    "entityTimeZone": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "lines",
                    "foot",
                    "bills",
                    "entityTimeZone"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "404": {
            "$ref": "#/components/responses/Problem404"
          },
          "422": {
            "$ref": "#/components/responses/Problem422"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      }
    },
    "/v1/purchase-orders/{purchaseOrderId}/budget-position": {
      "get": {
        "operationId": "getPurchaseOrderBudgetPosition",
        "summary": "Returns the budget position a purchase order would draw on.",
        "description": "Returns the budget position a purchase order would draw on. Needs the `statements:read` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "purchases"
        ],
        "x-stability-level": "beta",
        "x-scope": "statements:read",
        "parameters": [
          {
            "name": "purchaseOrderId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetPurchaseOrderBudgetPositionResponse"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "404": {
            "$ref": "#/components/responses/Problem404"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      }
    },
    "/v1/purchase-orders/{purchaseOrderId}/cancel": {
      "post": {
        "operationId": "cancelPurchaseOrder",
        "summary": "Cancels a purchase order that has not been fully received.",
        "description": "Cancels a purchase order that has not been fully received. Needs the `ledger:propose` permission. Stable: a change that breaks callers needs 365 days' notice.",
        "tags": [
          "purchases"
        ],
        "x-stability-level": "stable",
        "x-scope": "ledger:propose",
        "parameters": [
          {
            "name": "purchaseOrderId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "reason": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 500
                  }
                },
                "required": [
                  "reason"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "Ledger-Position": {
                "$ref": "#/components/headers/LedgerPosition"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CreatePurchaseOrderResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem400"
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "404": {
            "$ref": "#/components/responses/Problem404"
          },
          "409": {
            "$ref": "#/components/responses/Problem409"
          },
          "412": {
            "$ref": "#/components/responses/Problem412"
          },
          "422": {
            "$ref": "#/components/responses/Problem422"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      }
    },
    "/v1/purchase-orders/{purchaseOrderId}/close": {
      "post": {
        "operationId": "closePurchaseOrder",
        "summary": "Closes a purchase order so no more can be received or billed against it.",
        "description": "Closes a purchase order so no more can be received or billed against it. Needs the `ledger:propose` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "purchases"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:propose",
        "parameters": [
          {
            "name": "purchaseOrderId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "reason": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 500
                  }
                },
                "required": [
                  "reason"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "Ledger-Position": {
                "$ref": "#/components/headers/LedgerPosition"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ClosePurchaseOrderResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem400"
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "404": {
            "$ref": "#/components/responses/Problem404"
          },
          "409": {
            "$ref": "#/components/responses/Problem409"
          },
          "412": {
            "$ref": "#/components/responses/Problem412"
          },
          "422": {
            "$ref": "#/components/responses/Problem422"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      }
    },
    "/v1/purchase-orders/{purchaseOrderId}/close/lift": {
      "post": {
        "operationId": "liftPurchaseOrderClose",
        "summary": "Lifts the close on a purchase order so it can be received against again.",
        "description": "Lifts the close on a purchase order so it can be received against again. Needs the `ledger:propose` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "purchases"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:propose",
        "parameters": [
          {
            "name": "purchaseOrderId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "reason": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 500
                  }
                },
                "required": [
                  "reason"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "Ledger-Position": {
                "$ref": "#/components/headers/LedgerPosition"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ClosePurchaseOrderResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem400"
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "404": {
            "$ref": "#/components/responses/Problem404"
          },
          "409": {
            "$ref": "#/components/responses/Problem409"
          },
          "412": {
            "$ref": "#/components/responses/Problem412"
          },
          "422": {
            "$ref": "#/components/responses/Problem422"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      }
    },
    "/v1/purchase-orders/{purchaseOrderId}/decline": {
      "post": {
        "operationId": "declinePurchaseOrder",
        "summary": "Declines a submitted purchase order with a reason.",
        "description": "Declines a submitted purchase order with a reason. Needs the `ledger:approve` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "purchases"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:approve",
        "parameters": [
          {
            "name": "purchaseOrderId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "reason": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 500
                  }
                },
                "required": [
                  "reason"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "Ledger-Position": {
                "$ref": "#/components/headers/LedgerPosition"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CreatePurchaseOrderResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem400"
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "404": {
            "$ref": "#/components/responses/Problem404"
          },
          "409": {
            "$ref": "#/components/responses/Problem409"
          },
          "412": {
            "$ref": "#/components/responses/Problem412"
          },
          "422": {
            "$ref": "#/components/responses/Problem422"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      }
    },
    "/v1/purchase-orders/{purchaseOrderId}/notices": {
      "post": {
        "operationId": "draftPurchaseOrderNotice",
        "summary": "Drafts a notice to the vendor about a purchase order.",
        "description": "Drafts a notice to the vendor about a purchase order. Needs the `ledger:propose` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "purchases"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:propose",
        "parameters": [
          {
            "name": "purchaseOrderId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "kind": {
                    "type": "string",
                    "enum": [
                      "PURCHASE_ORDER",
                      "PURCHASE_ORDER_CANCELLED"
                    ]
                  },
                  "recipientEmail": {
                    "type": "string",
                    "maxLength": 254,
                    "format": "email",
                    "pattern": "^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"
                  },
                  "paragraph": {
                    "default": null,
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 600
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                },
                "required": [
                  "kind",
                  "recipientEmail"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "Ledger-Position": {
                "$ref": "#/components/headers/LedgerPosition"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CreatePurchaseOrderResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem400"
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "404": {
            "$ref": "#/components/responses/Problem404"
          },
          "409": {
            "$ref": "#/components/responses/Problem409"
          },
          "412": {
            "$ref": "#/components/responses/Problem412"
          },
          "422": {
            "$ref": "#/components/responses/Problem422"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      }
    },
    "/v1/purchase-orders/{purchaseOrderId}/receiving": {
      "get": {
        "operationId": "getPurchaseOrderReceiving",
        "summary": "Returns how much of a purchase order has been received.",
        "description": "Returns how much of a purchase order has been received. Needs the `ledger:read` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "purchases"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:read",
        "parameters": [
          {
            "name": "purchaseOrderId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "purchaseOrderId": {
                      "type": "string"
                    },
                    "status": {
                      "type": "string",
                      "enum": [
                        "DRAFT",
                        "IN_APPROVAL",
                        "APPROVED",
                        "SENT",
                        "PART_RECEIVED",
                        "RECEIVED",
                        "CLOSED",
                        "CANCELLED"
                      ]
                    },
                    "receivable": {
                      "type": "boolean"
                    },
                    "notReceivableWhy": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "tolerance": {
                      "type": "object",
                      "properties": {
                        "percent": {
                          "type": "string"
                        },
                        "sentence": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "percent",
                        "sentence"
                      ],
                      "additionalProperties": false
                    },
                    "separation": {
                      "type": "object",
                      "properties": {
                        "applies": {
                          "type": "boolean"
                        },
                        "approver": {
                          "anyOf": [
                            {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string"
                                },
                                "name": {
                                  "type": "string"
                                }
                              },
                              "required": [
                                "id",
                                "name"
                              ],
                              "additionalProperties": false
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "sentence": {
                          "type": [
                            "string",
                            "null"
                          ]
                        }
                      },
                      "required": [
                        "applies",
                        "approver",
                        "sentence"
                      ],
                      "additionalProperties": false
                    },
                    "lines": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "purchaseOrderLineId": {
                            "type": "string"
                          },
                          "position": {
                            "type": "integer",
                            "minimum": 0,
                            "maximum": 9007199254740991
                          },
                          "description": {
                            "type": "string"
                          },
                          "supplyCategory": {
                            "anyOf": [
                              {
                                "type": "string",
                                "enum": [
                                  "GOODS",
                                  "SERVICES",
                                  "INTANGIBLE_PROPERTY",
                                  "REAL_PROPERTY"
                                ]
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "isService": {
                            "type": "boolean"
                          },
                          "unit": {
                            "type": "string",
                            "const": "quantity"
                          },
                          "ordered": {
                            "type": "string",
                            "pattern": "^\\d{1,10}(\\.\\d{1,4})?$"
                          },
                          "received": {
                            "type": "string",
                            "pattern": "^\\d{1,10}(\\.\\d{1,4})?$"
                          },
                          "outstanding": {
                            "type": "string",
                            "pattern": "^\\d{1,10}(\\.\\d{1,4})?$"
                          },
                          "mostAcceptable": {
                            "type": "string",
                            "pattern": "^\\d{1,10}(\\.\\d{1,4})?$"
                          },
                          "confirmer": {
                            "type": "object",
                            "properties": {
                              "rule": {
                                "type": "string",
                                "enum": [
                                  "ANYONE",
                                  "REQUESTER"
                                ]
                              },
                              "requester": {
                                "anyOf": [
                                  {
                                    "type": "object",
                                    "properties": {
                                      "id": {
                                        "type": "string"
                                      },
                                      "name": {
                                        "type": "string"
                                      }
                                    },
                                    "required": [
                                      "id",
                                      "name"
                                    ],
                                    "additionalProperties": false
                                  },
                                  {
                                    "type": "null"
                                  }
                                ]
                              }
                            },
                            "required": [
                              "rule",
                              "requester"
                            ],
                            "additionalProperties": false
                          }
                        },
                        "required": [
                          "purchaseOrderLineId",
                          "position",
                          "description",
                          "supplyCategory",
                          "isService",
                          "unit",
                          "ordered",
                          "received",
                          "outstanding",
                          "mostAcceptable",
                          "confirmer"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "highestSequence": {
                      "type": "integer",
                      "minimum": 0,
                      "maximum": 9007199254740991
                    },
                    "proposals": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "sequence": {
                            "type": "integer",
                            "minimum": 1,
                            "maximum": 9007199254740991
                          },
                          "proposedAt": {
                            "type": "string",
                            "minLength": 20
                          },
                          "senderDomain": {
                            "type": [
                              "string",
                              "null"
                            ]
                          }
                        },
                        "required": [
                          "id",
                          "sequence",
                          "proposedAt",
                          "senderDomain"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "mayRecord": {
                      "type": "boolean"
                    },
                    "mayConfirmForOthers": {
                      "type": "boolean"
                    },
                    "today": {
                      "type": "string",
                      "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                    },
                    "entityTimeZone": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "purchaseOrderId",
                    "status",
                    "receivable",
                    "notReceivableWhy",
                    "tolerance",
                    "separation",
                    "lines",
                    "highestSequence",
                    "proposals",
                    "mayRecord",
                    "mayConfirmForOthers",
                    "today",
                    "entityTimeZone"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "404": {
            "$ref": "#/components/responses/Problem404"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      }
    },
    "/v1/purchase-orders/{purchaseOrderId}/send-facts": {
      "get": {
        "operationId": "getPurchaseOrderSendFacts",
        "summary": "Returns the facts a notice about a purchase order is built from.",
        "description": "Returns the facts a notice about a purchase order is built from. Needs the `ledger:read` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "purchases"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:read",
        "parameters": [
          {
            "name": "purchaseOrderId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "recipients": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "email": {
                            "type": "string"
                          },
                          "role": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "source": {
                            "type": "string"
                          },
                          "new": {
                            "type": "boolean"
                          },
                          "stopped": {
                            "type": "boolean"
                          }
                        },
                        "required": [
                          "email",
                          "role",
                          "source",
                          "new",
                          "stopped"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "language": {
                      "type": "string"
                    },
                    "frenchReviewed": {
                      "type": "boolean"
                    },
                    "sender": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "name": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "id",
                        "name"
                      ],
                      "additionalProperties": false
                    },
                    "supplierContact": {
                      "anyOf": [
                        {
                          "type": "object",
                          "properties": {
                            "name": {
                              "type": "string"
                            },
                            "telephone": {
                              "type": [
                                "string",
                                "null"
                              ]
                            }
                          },
                          "required": [
                            "name",
                            "telephone"
                          ],
                          "additionalProperties": false
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "outboundApproved": {
                      "type": "boolean"
                    },
                    "preview": {
                      "type": "object",
                      "properties": {
                        "subject": {
                          "type": "string"
                        },
                        "text": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "subject",
                        "text"
                      ],
                      "additionalProperties": false
                    },
                    "documentUrl": {
                      "type": "string"
                    },
                    "alreadySent": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "recipientDomain": {
                            "type": "string"
                          },
                          "sentAt": {
                            "type": "string",
                            "minLength": 20
                          },
                          "sentBy": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string"
                              },
                              "name": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "id",
                              "name"
                            ],
                            "additionalProperties": false
                          },
                          "revision": {
                            "type": "integer",
                            "minimum": 0,
                            "maximum": 9007199254740991
                          }
                        },
                        "required": [
                          "recipientDomain",
                          "sentAt",
                          "sentBy",
                          "revision"
                        ],
                        "additionalProperties": false
                      }
                    }
                  },
                  "required": [
                    "recipients",
                    "language",
                    "frenchReviewed",
                    "sender",
                    "supplierContact",
                    "outboundApproved",
                    "preview",
                    "documentUrl",
                    "alreadySent"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "404": {
            "$ref": "#/components/responses/Problem404"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      }
    },
    "/v1/purchase-orders/{purchaseOrderId}/submit": {
      "post": {
        "operationId": "submitPurchaseOrder",
        "summary": "Submits a purchase order for approval.",
        "description": "Submits a purchase order for approval. Needs the `ledger:propose` permission. Stable: a change that breaks callers needs 365 days' notice.",
        "tags": [
          "purchases"
        ],
        "x-stability-level": "stable",
        "x-scope": "ledger:propose",
        "parameters": [
          {
            "name": "purchaseOrderId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "askedApproverId": {
                    "default": null,
                    "anyOf": [
                      {
                        "type": "string",
                        "minLength": 1
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "fxRate": {
                    "default": null,
                    "anyOf": [
                      {
                        "type": "string",
                        "pattern": "^\\d{1,6}(\\.\\d{1,6})?$"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                },
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "Ledger-Position": {
                "$ref": "#/components/headers/LedgerPosition"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CreatePurchaseOrderResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem400"
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "404": {
            "$ref": "#/components/responses/Problem404"
          },
          "409": {
            "$ref": "#/components/responses/Problem409"
          },
          "412": {
            "$ref": "#/components/responses/Problem412"
          },
          "422": {
            "$ref": "#/components/responses/Problem422"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      }
    },
    "/v1/purchases-exports": {
      "post": {
        "operationId": "requestPurchasesExport",
        "summary": "Requests an export of the purchases lists.",
        "description": "Requests an export of the purchases lists. Needs the `ledger:read` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "purchases"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:read",
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "kind": {
                    "type": "string",
                    "enum": [
                      "BILLS",
                      "VENDORS",
                      "PAYMENT_RUNS"
                    ]
                  },
                  "format": {
                    "type": "string",
                    "enum": [
                      "CSV",
                      "XLSX"
                    ]
                  },
                  "query": {
                    "type": "object",
                    "propertyNames": {
                      "type": "string"
                    },
                    "additionalProperties": {
                      "type": "string"
                    }
                  }
                },
                "required": [
                  "kind",
                  "format",
                  "query"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Accepted: the work is done after the answer, or waits for a person's confirmation.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "Ledger-Position": {
                "$ref": "#/components/headers/LedgerPosition"
              },
              "Location": {
                "$ref": "#/components/headers/Location"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/RequestPurchasesExportResponseOption1"
                    },
                    {
                      "$ref": "#/components/schemas/UndoAgentBatchResponse"
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem400"
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "409": {
            "$ref": "#/components/responses/Problem409"
          },
          "412": {
            "$ref": "#/components/responses/Problem412"
          },
          "422": {
            "$ref": "#/components/responses/Problem422"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      },
      "get": {
        "operationId": "listPurchasesExports",
        "summary": "Lists the purchases exports, with the server's total.",
        "description": "Lists the purchases exports, with the server's total. Needs the `ledger:read` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "purchases"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:read",
        "parameters": [
          {
            "name": "state",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "QUEUED",
                "RUNNING",
                "READY",
                "FAILED",
                "EXPIRED"
              ]
            }
          },
          {
            "name": "kind",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "BILLS",
                "VENDORS",
                "PAYMENT_RUNS"
              ]
            }
          },
          {
            "name": "show",
            "in": "query",
            "required": false,
            "schema": {
              "default": "mine",
              "type": "string",
              "enum": [
                "mine",
                "all"
              ]
            }
          },
          {
            "name": "q",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 200
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "default": 50,
              "type": "integer",
              "minimum": 1,
              "maximum": 200
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 512
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/RequestPurchasesExportResponseOption1"
                      }
                    },
                    "nextCursor": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "total": {
                      "anyOf": [
                        {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  },
                  "required": [
                    "data",
                    "nextCursor",
                    "total"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "422": {
            "$ref": "#/components/responses/Problem422"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      }
    },
    "/v1/purchases-exports/{exportId}": {
      "get": {
        "operationId": "getPurchasesExport",
        "summary": "Returns one purchases export and its status.",
        "description": "Returns one purchases export and its status. Needs the `ledger:read` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "purchases"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:read",
        "parameters": [
          {
            "name": "exportId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "export": {
                      "$ref": "#/components/schemas/RequestPurchasesExportResponseOption1"
                    },
                    "downloads": {
                      "type": "object",
                      "properties": {
                        "total": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 9007199254740991
                        },
                        "recent": {
                          "maxItems": 10,
                          "type": "array",
                          "items": {
                            "$ref": "#/components/schemas/LastReplayOption1"
                          }
                        }
                      },
                      "required": [
                        "total",
                        "recent"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "export",
                    "downloads"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "404": {
            "$ref": "#/components/responses/Problem404"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      }
    },
    "/v1/purchases-exports/{exportId}/link": {
      "get": {
        "operationId": "linkPurchasesExport",
        "summary": "Returns the link to download a purchases export.",
        "description": "Returns the link to download a purchases export. Needs the `ledger:read` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "purchases"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:read",
        "parameters": [
          {
            "name": "exportId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "url": {
                      "type": "string",
                      "format": "uri"
                    },
                    "expiresAt": {
                      "type": "string",
                      "minLength": 20
                    },
                    "fileName": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "url",
                    "expiresAt",
                    "fileName"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "404": {
            "$ref": "#/components/responses/Problem404"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      }
    },
    "/v1/purchases-list-views": {
      "get": {
        "operationId": "listPurchasesListViews",
        "summary": "Lists the saved views of the purchases lists.",
        "description": "Lists the saved views of the purchases lists. Needs the `ledger:read` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "purchases"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:read",
        "parameters": [
          {
            "name": "list",
            "in": "query",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/List"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "views": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/ViewsItem3"
                      }
                    },
                    "mineCount": {
                      "type": "integer",
                      "minimum": 0,
                      "maximum": 9007199254740991
                    },
                    "sharedCount": {
                      "type": "integer",
                      "minimum": 0,
                      "maximum": 9007199254740991
                    },
                    "perListLimit": {
                      "type": "integer",
                      "minimum": 1,
                      "maximum": 9007199254740991
                    },
                    "sharedLimit": {
                      "type": "integer",
                      "minimum": 1,
                      "maximum": 9007199254740991
                    },
                    "notReady": {
                      "default": null,
                      "type": [
                        "string",
                        "null"
                      ]
                    }
                  },
                  "required": [
                    "views",
                    "mineCount",
                    "sharedCount",
                    "perListLimit",
                    "sharedLimit",
                    "notReady"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "422": {
            "$ref": "#/components/responses/Problem422"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      },
      "post": {
        "operationId": "savePurchasesListView",
        "summary": "Saves a view of a purchases list under a name.",
        "description": "Saves a view of a purchases list under a name. Needs the `ledger:read` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "purchases"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:read",
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "list": {
                    "$ref": "#/components/schemas/List"
                  },
                  "name": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 80
                  },
                  "filters": {
                    "type": "object",
                    "propertyNames": {
                      "type": "string"
                    },
                    "additionalProperties": {
                      "type": "string"
                    }
                  },
                  "source": {
                    "default": "PERSON",
                    "type": "string",
                    "enum": [
                      "PERSON",
                      "DRAFT"
                    ]
                  },
                  "draftPromptVersion": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 40
                  }
                },
                "required": [
                  "list",
                  "name",
                  "filters"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "Ledger-Position": {
                "$ref": "#/components/headers/LedgerPosition"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ViewsItem3"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem400"
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "409": {
            "$ref": "#/components/responses/Problem409"
          },
          "412": {
            "$ref": "#/components/responses/Problem412"
          },
          "422": {
            "$ref": "#/components/responses/Problem422"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      }
    },
    "/v1/purchases-list-views/{viewId}": {
      "patch": {
        "operationId": "updatePurchasesListView",
        "summary": "Changes a saved purchases list view.",
        "description": "Changes a saved purchases list view. Needs the `ledger:read` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "purchases"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:read",
        "parameters": [
          {
            "name": "viewId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 80
                  },
                  "filters": {
                    "type": "object",
                    "propertyNames": {
                      "type": "string"
                    },
                    "additionalProperties": {
                      "type": "string"
                    }
                  }
                },
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "Ledger-Position": {
                "$ref": "#/components/headers/LedgerPosition"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ViewsItem3"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem400"
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "404": {
            "$ref": "#/components/responses/Problem404"
          },
          "409": {
            "$ref": "#/components/responses/Problem409"
          },
          "412": {
            "$ref": "#/components/responses/Problem412"
          },
          "422": {
            "$ref": "#/components/responses/Problem422"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      },
      "delete": {
        "operationId": "deletePurchasesListView",
        "summary": "Deletes a saved purchases list view.",
        "description": "Deletes a saved purchases list view. Needs the `ledger:read` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "purchases"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:read",
        "parameters": [
          {
            "name": "viewId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "Ledger-Position": {
                "$ref": "#/components/headers/LedgerPosition"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "name": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "id",
                    "name"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem400"
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "404": {
            "$ref": "#/components/responses/Problem404"
          },
          "409": {
            "$ref": "#/components/responses/Problem409"
          },
          "412": {
            "$ref": "#/components/responses/Problem412"
          },
          "422": {
            "$ref": "#/components/responses/Problem422"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      }
    },
    "/v1/purchases-list-views/{viewId}/share": {
      "post": {
        "operationId": "sharePurchasesListView",
        "summary": "Shares a saved purchases list view with other seats.",
        "description": "Shares a saved purchases list view with other seats. Needs the `ledger:propose` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "purchases"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:propose",
        "parameters": [
          {
            "name": "viewId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "Ledger-Position": {
                "$ref": "#/components/headers/LedgerPosition"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ViewsItem3"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem400"
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "404": {
            "$ref": "#/components/responses/Problem404"
          },
          "409": {
            "$ref": "#/components/responses/Problem409"
          },
          "412": {
            "$ref": "#/components/responses/Problem412"
          },
          "422": {
            "$ref": "#/components/responses/Problem422"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      }
    },
    "/v1/purchases-list-views/{viewId}/unshare": {
      "post": {
        "operationId": "unsharePurchasesListView",
        "summary": "Stops sharing a purchases list view.",
        "description": "Stops sharing a purchases list view. Needs the `ledger:read` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "purchases"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:read",
        "parameters": [
          {
            "name": "viewId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "Ledger-Position": {
                "$ref": "#/components/headers/LedgerPosition"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ViewsItem3"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem400"
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "404": {
            "$ref": "#/components/responses/Problem404"
          },
          "409": {
            "$ref": "#/components/responses/Problem409"
          },
          "412": {
            "$ref": "#/components/responses/Problem412"
          },
          "422": {
            "$ref": "#/components/responses/Problem422"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      }
    },
    "/v1/purchases-report-views": {
      "get": {
        "operationId": "listPurchasesReportViews",
        "summary": "Lists the saved views of the purchases reports.",
        "description": "Lists the saved views of the purchases reports. Needs the `ledger:read` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "purchases"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:read",
        "parameters": [
          {
            "name": "report",
            "in": "query",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/Report"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "views": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/ViewsItem2"
                      }
                    },
                    "total": {
                      "type": "integer",
                      "minimum": 0,
                      "maximum": 9007199254740991
                    },
                    "perReportLimit": {
                      "type": "integer",
                      "minimum": 1,
                      "maximum": 9007199254740991
                    }
                  },
                  "required": [
                    "views",
                    "total",
                    "perReportLimit"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "422": {
            "$ref": "#/components/responses/Problem422"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      },
      "post": {
        "operationId": "savePurchasesReportView",
        "summary": "Saves a view of a purchases report under a name.",
        "description": "Saves a view of a purchases report under a name. Needs the `ledger:read` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "purchases"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:read",
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "report": {
                    "$ref": "#/components/schemas/Report"
                  },
                  "name": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 80
                  },
                  "filters": {
                    "type": "object",
                    "propertyNames": {
                      "type": "string"
                    },
                    "additionalProperties": {
                      "type": "string"
                    }
                  }
                },
                "required": [
                  "report",
                  "name",
                  "filters"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "Ledger-Position": {
                "$ref": "#/components/headers/LedgerPosition"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ViewsItem2"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem400"
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "409": {
            "$ref": "#/components/responses/Problem409"
          },
          "412": {
            "$ref": "#/components/responses/Problem412"
          },
          "422": {
            "$ref": "#/components/responses/Problem422"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      }
    },
    "/v1/purchases-report-views/{viewId}": {
      "patch": {
        "operationId": "renamePurchasesReportView",
        "summary": "Renames a saved purchases report view.",
        "description": "Renames a saved purchases report view. Needs the `ledger:read` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "purchases"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:read",
        "parameters": [
          {
            "name": "viewId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 80
                  }
                },
                "required": [
                  "name"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "Ledger-Position": {
                "$ref": "#/components/headers/LedgerPosition"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ViewsItem2"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem400"
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "404": {
            "$ref": "#/components/responses/Problem404"
          },
          "409": {
            "$ref": "#/components/responses/Problem409"
          },
          "412": {
            "$ref": "#/components/responses/Problem412"
          },
          "422": {
            "$ref": "#/components/responses/Problem422"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      },
      "delete": {
        "operationId": "deletePurchasesReportView",
        "summary": "Deletes a saved purchases report view.",
        "description": "Deletes a saved purchases report view. Needs the `ledger:read` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "purchases"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:read",
        "parameters": [
          {
            "name": "viewId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "Ledger-Position": {
                "$ref": "#/components/headers/LedgerPosition"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "name": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "id",
                    "name"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem400"
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "404": {
            "$ref": "#/components/responses/Problem404"
          },
          "409": {
            "$ref": "#/components/responses/Problem409"
          },
          "412": {
            "$ref": "#/components/responses/Problem412"
          },
          "422": {
            "$ref": "#/components/responses/Problem422"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      }
    },
    "/v1/purchases-reports/{reportKey}": {
      "get": {
        "operationId": "purchasesReport",
        "summary": "Returns one purchases report for the period chosen.",
        "description": "Returns one purchases report for the period chosen. Needs the `statements:read` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "purchases"
        ],
        "x-stability-level": "beta",
        "x-scope": "statements:read",
        "parameters": [
          {
            "name": "reportKey",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "entityId",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "vendorId",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "accountId",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "dimensionTypeId",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "dimensionValueId",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "personId",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 200,
              "pattern": "^[A-Za-z_][A-Za-z0-9_]*(\\s*,\\s*[A-Za-z_][A-Za-z0-9_]*)*,?$"
            }
          },
          {
            "name": "from",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
            }
          },
          {
            "name": "to",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
            }
          },
          {
            "name": "currency",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^[A-Z]{3}$"
            }
          },
          {
            "name": "slipKind",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "T4A",
                "T5018"
              ]
            }
          },
          {
            "name": "days",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 400
            }
          },
          {
            "name": "groupBy",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "VENDOR",
                "ACCOUNT",
                "DIMENSION",
                "COMPANY",
                "ORDER"
              ]
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "default": 50,
              "type": "integer",
              "minimum": 1,
              "maximum": 200
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 512
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "report": {
                      "$ref": "#/components/schemas/Report"
                    },
                    "group": {
                      "type": "string",
                      "enum": [
                        "SPEND",
                        "REGISTERS",
                        "EXCEPTIONS",
                        "CONTROLS"
                      ]
                    },
                    "title": {
                      "type": "string"
                    },
                    "description": {
                      "type": "string"
                    },
                    "currency": {
                      "anyOf": [
                        {
                          "type": "string",
                          "pattern": "^[A-Z]{3}$"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "asOf": {
                      "type": "string",
                      "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                    },
                    "entityTimeZone": {
                      "type": "string"
                    },
                    "dateMeaning": {
                      "type": "string",
                      "enum": [
                        "POSTED",
                        "BILL_DATE",
                        "PAID_ON",
                        "PERIOD_CONTAINING",
                        "AS_AT",
                        "PERIOD_END",
                        "WHEN",
                        "APPROVED",
                        "NONE",
                        "EXPECTED_BY"
                      ]
                    },
                    "columns": {
                      "minItems": 1,
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "field": {
                            "type": "string"
                          },
                          "label": {
                            "type": "string"
                          },
                          "kind": {
                            "type": "string",
                            "enum": [
                              "text",
                              "ref",
                              "money",
                              "count",
                              "quantity",
                              "date",
                              "state",
                              "actor"
                            ]
                          },
                          "total": {
                            "type": "boolean"
                          }
                        },
                        "required": [
                          "field",
                          "label",
                          "kind",
                          "total"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "rows": {
                      "type": "array",
                      "items": {
                        "oneOf": [
                          {
                            "type": "object",
                            "properties": {
                              "spendMinor": {
                                "type": "string",
                                "pattern": "^-?\\d+$"
                              },
                              "itcMinor": {
                                "type": "string",
                                "pattern": "^-?\\d+$"
                              },
                              "billCount": {
                                "type": "integer",
                                "minimum": 0,
                                "maximum": 9007199254740991
                              },
                              "key": {
                                "type": "string"
                              },
                              "report": {
                                "type": "string",
                                "const": "spend-by-vendor"
                              },
                              "vendor": {
                                "$ref": "#/components/schemas/Vendor2"
                              }
                            },
                            "required": [
                              "spendMinor",
                              "itcMinor",
                              "billCount",
                              "key",
                              "report",
                              "vendor"
                            ],
                            "additionalProperties": false
                          },
                          {
                            "type": "object",
                            "properties": {
                              "spendMinor": {
                                "type": "string",
                                "pattern": "^-?\\d+$"
                              },
                              "budgetMinor": {
                                "anyOf": [
                                  {
                                    "type": "string",
                                    "pattern": "^-?\\d+$"
                                  },
                                  {
                                    "type": "null"
                                  }
                                ]
                              },
                              "budgetLeftMinor": {
                                "anyOf": [
                                  {
                                    "type": "string",
                                    "pattern": "^-?\\d+$"
                                  },
                                  {
                                    "type": "null"
                                  }
                                ]
                              },
                              "billCount": {
                                "type": "integer",
                                "minimum": 0,
                                "maximum": 9007199254740991
                              },
                              "key": {
                                "type": "string"
                              },
                              "report": {
                                "type": "string",
                                "const": "spend-by-account"
                              },
                              "account": {
                                "$ref": "#/components/schemas/Vendor2Option1"
                              }
                            },
                            "required": [
                              "spendMinor",
                              "budgetMinor",
                              "budgetLeftMinor",
                              "billCount",
                              "key",
                              "report",
                              "account"
                            ],
                            "additionalProperties": false
                          },
                          {
                            "type": "object",
                            "properties": {
                              "spendMinor": {
                                "type": "string",
                                "pattern": "^-?\\d+$"
                              },
                              "budgetMinor": {
                                "anyOf": [
                                  {
                                    "type": "string",
                                    "pattern": "^-?\\d+$"
                                  },
                                  {
                                    "type": "null"
                                  }
                                ]
                              },
                              "budgetLeftMinor": {
                                "anyOf": [
                                  {
                                    "type": "string",
                                    "pattern": "^-?\\d+$"
                                  },
                                  {
                                    "type": "null"
                                  }
                                ]
                              },
                              "billCount": {
                                "type": "integer",
                                "minimum": 0,
                                "maximum": 9007199254740991
                              },
                              "key": {
                                "type": "string"
                              },
                              "report": {
                                "type": "string",
                                "const": "spend-by-month"
                              },
                              "month": {
                                "type": "string",
                                "pattern": "^\\d{4}-(0[1-9]|1[0-2])$"
                              }
                            },
                            "required": [
                              "spendMinor",
                              "budgetMinor",
                              "budgetLeftMinor",
                              "billCount",
                              "key",
                              "report",
                              "month"
                            ],
                            "additionalProperties": false
                          },
                          {
                            "type": "object",
                            "properties": {
                              "spendMinor": {
                                "type": "string",
                                "pattern": "^-?\\d+$"
                              },
                              "budgetMinor": {
                                "anyOf": [
                                  {
                                    "type": "string",
                                    "pattern": "^-?\\d+$"
                                  },
                                  {
                                    "type": "null"
                                  }
                                ]
                              },
                              "budgetLeftMinor": {
                                "anyOf": [
                                  {
                                    "type": "string",
                                    "pattern": "^-?\\d+$"
                                  },
                                  {
                                    "type": "null"
                                  }
                                ]
                              },
                              "billCount": {
                                "type": "integer",
                                "minimum": 0,
                                "maximum": 9007199254740991
                              },
                              "key": {
                                "type": "string"
                              },
                              "report": {
                                "type": "string",
                                "const": "spend-by-company"
                              },
                              "company": {
                                "$ref": "#/components/schemas/Vendor2Option1"
                              }
                            },
                            "required": [
                              "spendMinor",
                              "budgetMinor",
                              "budgetLeftMinor",
                              "billCount",
                              "key",
                              "report",
                              "company"
                            ],
                            "additionalProperties": false
                          },
                          {
                            "type": "object",
                            "properties": {
                              "spendMinor": {
                                "type": "string",
                                "pattern": "^-?\\d+$"
                              },
                              "budgetMinor": {
                                "anyOf": [
                                  {
                                    "type": "string",
                                    "pattern": "^-?\\d+$"
                                  },
                                  {
                                    "type": "null"
                                  }
                                ]
                              },
                              "budgetLeftMinor": {
                                "anyOf": [
                                  {
                                    "type": "string",
                                    "pattern": "^-?\\d+$"
                                  },
                                  {
                                    "type": "null"
                                  }
                                ]
                              },
                              "billCount": {
                                "type": "integer",
                                "minimum": 0,
                                "maximum": 9007199254740991
                              },
                              "key": {
                                "type": "string"
                              },
                              "report": {
                                "type": "string",
                                "const": "spend-by-dimension"
                              },
                              "value": {
                                "$ref": "#/components/schemas/Vendor2"
                              },
                              "waitingMinor": {
                                "type": "string",
                                "pattern": "^-?\\d+$"
                              },
                              "waitingBillCount": {
                                "type": "integer",
                                "minimum": 0,
                                "maximum": 9007199254740991
                              }
                            },
                            "required": [
                              "spendMinor",
                              "budgetMinor",
                              "budgetLeftMinor",
                              "billCount",
                              "key",
                              "report",
                              "value",
                              "waitingMinor",
                              "waitingBillCount"
                            ],
                            "additionalProperties": false
                          },
                          {
                            "type": "object",
                            "properties": {
                              "netMinor": {
                                "type": "string",
                                "pattern": "^-?\\d+$"
                              },
                              "taxMinor": {
                                "type": "string",
                                "pattern": "^-?\\d+$"
                              },
                              "totalMinor": {
                                "type": "string",
                                "pattern": "^-?\\d+$"
                              },
                              "openMinor": {
                                "type": "string",
                                "pattern": "^-?\\d+$"
                              },
                              "key": {
                                "type": "string"
                              },
                              "report": {
                                "type": "string",
                                "const": "bill-register"
                              },
                              "bill": {
                                "$ref": "#/components/schemas/Vendor2Option1"
                              },
                              "company": {
                                "$ref": "#/components/schemas/Vendor2Option1"
                              },
                              "vendor": {
                                "$ref": "#/components/schemas/Vendor2"
                              },
                              "supplierName": {
                                "type": "string"
                              },
                              "number": {
                                "type": [
                                  "string",
                                  "null"
                                ]
                              },
                              "source": {
                                "type": "string"
                              },
                              "billDate": {
                                "type": "string",
                                "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                              },
                              "dueDate": {
                                "type": "string",
                                "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                              },
                              "status": {
                                "type": "string",
                                "enum": [
                                  "DRAFT",
                                  "IN_REVIEW",
                                  "DECLINED",
                                  "APPROVED",
                                  "HELD",
                                  "OPEN",
                                  "DUE",
                                  "OVERDUE",
                                  "IN_RUN",
                                  "PARTIALLY_PAID",
                                  "PAID",
                                  "VOID"
                                ]
                              },
                              "onBooks": {
                                "type": "boolean"
                              },
                              "heldBackMinor": {
                                "type": "string",
                                "pattern": "^-?\\d+$"
                              },
                              "releasedMinor": {
                                "type": "string",
                                "pattern": "^-?\\d+$"
                              },
                              "releaseOn": {
                                "anyOf": [
                                  {
                                    "type": "string",
                                    "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                                  },
                                  {
                                    "type": "null"
                                  }
                                ]
                              }
                            },
                            "required": [
                              "netMinor",
                              "taxMinor",
                              "totalMinor",
                              "openMinor",
                              "key",
                              "report",
                              "bill",
                              "company",
                              "vendor",
                              "supplierName",
                              "number",
                              "source",
                              "billDate",
                              "dueDate",
                              "status",
                              "onBooks",
                              "heldBackMinor",
                              "releasedMinor",
                              "releaseOn"
                            ],
                            "additionalProperties": false
                          },
                          {
                            "type": "object",
                            "properties": {
                              "paidMinor": {
                                "type": "string",
                                "pattern": "^-?\\d+$"
                              },
                              "notCountedMinor": {
                                "type": "string",
                                "pattern": "^-?\\d+$"
                              },
                              "key": {
                                "type": "string"
                              },
                              "report": {
                                "type": "string",
                                "const": "payment-register"
                              },
                              "paidOn": {
                                "type": "string",
                                "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                              },
                              "vendor": {
                                "$ref": "#/components/schemas/Vendor2"
                              },
                              "bill": {
                                "$ref": "#/components/schemas/Vendor2Option1"
                              },
                              "method": {
                                "type": "string",
                                "enum": [
                                  "RUN",
                                  "CARD",
                                  "PAD",
                                  "ACCOUNT",
                                  "CHEQUE",
                                  "WIRE",
                                  "ETRANSFER",
                                  "OTHER"
                                ]
                              },
                              "run": {
                                "$ref": "#/components/schemas/Vendor2"
                              },
                              "reference": {
                                "type": [
                                  "string",
                                  "null"
                                ]
                              },
                              "state": {
                                "type": "string",
                                "enum": [
                                  "PAID",
                                  "AWAITING_APPROVAL",
                                  "REVERSED",
                                  "VOIDED"
                                ]
                              },
                              "runReversal": {
                                "anyOf": [
                                  {
                                    "type": "string",
                                    "enum": [
                                      "REVERSED",
                                      "PARTLY_REVERSED"
                                    ]
                                  },
                                  {
                                    "type": "null"
                                  }
                                ]
                              }
                            },
                            "required": [
                              "paidMinor",
                              "notCountedMinor",
                              "key",
                              "report",
                              "paidOn",
                              "vendor",
                              "bill",
                              "method",
                              "run",
                              "reference",
                              "state",
                              "runReversal"
                            ],
                            "additionalProperties": false
                          },
                          {
                            "type": "object",
                            "properties": {
                              "baseMinor": {
                                "type": "string",
                                "pattern": "^-?\\d+$"
                              },
                              "taxPaidMinor": {
                                "type": "string",
                                "pattern": "^-?\\d+$"
                              },
                              "itcMinor": {
                                "type": "string",
                                "pattern": "^-?\\d+$"
                              },
                              "notClaimedMinor": {
                                "type": "string",
                                "pattern": "^-?\\d+$"
                              },
                              "key": {
                                "type": "string"
                              },
                              "report": {
                                "type": "string",
                                "const": "tax-paid"
                              },
                              "source": {
                                "$ref": "#/components/schemas/Vendor2Option1"
                              },
                              "vendor": {
                                "$ref": "#/components/schemas/Vendor2"
                              },
                              "entryDate": {
                                "type": "string",
                                "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                              }
                            },
                            "required": [
                              "baseMinor",
                              "taxPaidMinor",
                              "itcMinor",
                              "notClaimedMinor",
                              "key",
                              "report",
                              "source",
                              "vendor",
                              "entryDate"
                            ],
                            "additionalProperties": false
                          },
                          {
                            "type": "object",
                            "properties": {
                              "dueMinor": {
                                "type": "string",
                                "pattern": "^-?\\d+$"
                              },
                              "heldMinor": {
                                "type": "string",
                                "pattern": "^-?\\d+$"
                              },
                              "inRunMinor": {
                                "type": "string",
                                "pattern": "^-?\\d+$"
                              },
                              "discountDeadlineMinor": {
                                "type": "string",
                                "pattern": "^-?\\d+$"
                              },
                              "discountKeptMinor": {
                                "type": "string",
                                "pattern": "^-?\\d+$"
                              },
                              "billCount": {
                                "type": "integer",
                                "minimum": 0,
                                "maximum": 9007199254740991
                              },
                              "key": {
                                "type": "string"
                              },
                              "report": {
                                "type": "string",
                                "const": "cash-required"
                              },
                              "bucket": {
                                "type": "string",
                                "enum": [
                                  "OVERDUE",
                                  "WEEK",
                                  "LATER"
                                ]
                              },
                              "weekStart": {
                                "anyOf": [
                                  {
                                    "type": "string",
                                    "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                                  },
                                  {
                                    "type": "null"
                                  }
                                ]
                              }
                            },
                            "required": [
                              "dueMinor",
                              "heldMinor",
                              "inRunMinor",
                              "discountDeadlineMinor",
                              "discountKeptMinor",
                              "billCount",
                              "key",
                              "report",
                              "bucket",
                              "weekStart"
                            ],
                            "additionalProperties": false
                          },
                          {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "report": {
                                "type": "string",
                                "const": "itc-at-risk"
                              },
                              "source": {
                                "$ref": "#/components/schemas/Vendor2Option1"
                              },
                              "vendor": {
                                "$ref": "#/components/schemas/Vendor2"
                              },
                              "billDate": {
                                "anyOf": [
                                  {
                                    "type": "string",
                                    "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                                  },
                                  {
                                    "type": "null"
                                  }
                                ]
                              },
                              "outcome": {
                                "type": "string",
                                "enum": [
                                  "FAILS",
                                  "UNTESTED",
                                  "NOT_TESTED",
                                  "PASSES"
                                ]
                              },
                              "reasons": {
                                "type": "array",
                                "items": {
                                  "type": "string"
                                }
                              },
                              "itcMinor": {
                                "type": "string",
                                "pattern": "^-?\\d+$"
                              }
                            },
                            "required": [
                              "key",
                              "report",
                              "source",
                              "vendor",
                              "billDate",
                              "outcome",
                              "reasons",
                              "itcMinor"
                            ],
                            "additionalProperties": false
                          },
                          {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "report": {
                                "type": "string",
                                "const": "unexplained-payable"
                              },
                              "entry": {
                                "$ref": "#/components/schemas/Vendor2Option1"
                              },
                              "entryDate": {
                                "type": "string",
                                "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                              },
                              "account": {
                                "$ref": "#/components/schemas/Vendor2Option1"
                              },
                              "memo": {
                                "type": [
                                  "string",
                                  "null"
                                ]
                              },
                              "sourceKind": {
                                "type": "string",
                                "enum": [
                                  "MANUAL",
                                  "AGENT_PROPOSAL",
                                  "RECURRING",
                                  "REVERSAL",
                                  "IMPORT",
                                  "CHAT",
                                  "MIGRATION",
                                  "PAYMENT_RUN",
                                  "INVOICE",
                                  "RECEIPT",
                                  "BILL",
                                  "BILL_SETTLEMENT",
                                  "VENDOR_CREDIT"
                                ]
                              },
                              "amountMinor": {
                                "type": "string",
                                "pattern": "^-?\\d+$"
                              }
                            },
                            "required": [
                              "key",
                              "report",
                              "entry",
                              "entryDate",
                              "account",
                              "memo",
                              "sourceKind",
                              "amountMinor"
                            ],
                            "additionalProperties": false
                          },
                          {
                            "type": "object",
                            "properties": {
                              "amountMinor": {
                                "type": "string",
                                "pattern": "^-?\\d+$"
                              },
                              "exceptionMinor": {
                                "type": "string",
                                "pattern": "^-?\\d+$"
                              },
                              "key": {
                                "type": "string"
                              },
                              "report": {
                                "type": "string",
                                "const": "subsequent-payments"
                              },
                              "paidOn": {
                                "type": "string",
                                "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                              },
                              "payee": {
                                "$ref": "#/components/schemas/Vendor2"
                              },
                              "payeeName": {
                                "type": "string"
                              },
                              "bill": {
                                "$ref": "#/components/schemas/Vendor2"
                              },
                              "billDate": {
                                "anyOf": [
                                  {
                                    "type": "string",
                                    "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                                  },
                                  {
                                    "type": "null"
                                  }
                                ]
                              },
                              "servicePeriodEnd": {
                                "anyOf": [
                                  {
                                    "type": "string",
                                    "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                                  },
                                  {
                                    "type": "null"
                                  }
                                ]
                              },
                              "booksDate": {
                                "anyOf": [
                                  {
                                    "type": "string",
                                    "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                                  },
                                  {
                                    "type": "null"
                                  }
                                ]
                              },
                              "class": {
                                "type": "string",
                                "enum": [
                                  "NOT_IN_PERIOD_BOOKS",
                                  "NO_BILL",
                                  "ENTERED_LATE",
                                  "IN_BOOKS",
                                  "AFTER_PERIOD_END"
                                ]
                              }
                            },
                            "required": [
                              "amountMinor",
                              "exceptionMinor",
                              "key",
                              "report",
                              "paidOn",
                              "payee",
                              "payeeName",
                              "bill",
                              "billDate",
                              "servicePeriodEnd",
                              "booksDate",
                              "class"
                            ],
                            "additionalProperties": false
                          },
                          {
                            "type": "object",
                            "properties": {
                              "paidMinor": {
                                "type": "string",
                                "pattern": "^-?\\d+$"
                              },
                              "computedBoxMinor": {
                                "type": "string",
                                "pattern": "^-?\\d+$"
                              },
                              "boxMinor": {
                                "type": "string",
                                "pattern": "^-?\\d+$"
                              },
                              "key": {
                                "type": "string"
                              },
                              "report": {
                                "type": "string",
                                "const": "slip-reconciliation"
                              },
                              "vendor": {
                                "$ref": "#/components/schemas/Vendor2Option1"
                              },
                              "slipKind": {
                                "anyOf": [
                                  {
                                    "type": "string",
                                    "enum": [
                                      "T4A",
                                      "T5018"
                                    ]
                                  },
                                  {
                                    "type": "null"
                                  }
                                ]
                              },
                              "outcome": {
                                "type": "string",
                                "enum": [
                                  "IN_FILE",
                                  "BLOCKED",
                                  "UNDER_THRESHOLD",
                                  "NOT_FLAGGED_OVER",
                                  "NOT_FLAGGED"
                                ]
                              },
                              "reasons": {
                                "type": "array",
                                "items": {
                                  "type": "string"
                                }
                              }
                            },
                            "required": [
                              "paidMinor",
                              "computedBoxMinor",
                              "boxMinor",
                              "key",
                              "report",
                              "vendor",
                              "slipKind",
                              "outcome",
                              "reasons"
                            ],
                            "additionalProperties": false
                          },
                          {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "report": {
                                "type": "string",
                                "const": "approvals"
                              },
                              "at": {
                                "type": "string",
                                "minLength": 20
                              },
                              "action": {
                                "type": "string"
                              },
                              "what": {
                                "type": "string"
                              },
                              "kind": {
                                "type": "string",
                                "enum": [
                                  "ATTESTATION",
                                  "REFUSAL",
                                  "FIRING"
                                ]
                              },
                              "subject": {
                                "$ref": "#/components/schemas/Vendor2"
                              },
                              "actor": {
                                "type": "object",
                                "properties": {
                                  "type": {
                                    "type": "string",
                                    "enum": [
                                      "PERSON",
                                      "ASSISTANT",
                                      "SYSTEM",
                                      "LINK"
                                    ]
                                  },
                                  "person": {
                                    "$ref": "#/components/schemas/Vendor2"
                                  }
                                },
                                "required": [
                                  "type",
                                  "person"
                                ],
                                "additionalProperties": false
                              },
                              "rule": {
                                "type": [
                                  "string",
                                  "null"
                                ]
                              },
                              "detail": {
                                "type": [
                                  "string",
                                  "null"
                                ]
                              }
                            },
                            "required": [
                              "key",
                              "report",
                              "at",
                              "action",
                              "what",
                              "kind",
                              "subject",
                              "actor",
                              "rule",
                              "detail"
                            ],
                            "additionalProperties": false
                          },
                          {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "report": {
                                "type": "string",
                                "const": "own-work-approvals"
                              },
                              "bill": {
                                "$ref": "#/components/schemas/Vendor2Option1"
                              },
                              "company": {
                                "$ref": "#/components/schemas/Vendor2Option1"
                              },
                              "supplierName": {
                                "type": "string"
                              },
                              "billDate": {
                                "type": "string",
                                "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                              },
                              "currency": {
                                "type": "string",
                                "pattern": "^[A-Z]{3}$"
                              },
                              "totalMinor": {
                                "type": "string",
                                "pattern": "^-?\\d+$"
                              },
                              "approvedAt": {
                                "type": "string",
                                "minLength": 20
                              },
                              "approvedBy": {
                                "$ref": "#/components/schemas/Vendor2Option1"
                              },
                              "coincidence": {
                                "type": "string",
                                "enum": [
                                  "DRAFTER",
                                  "SUBMITTER",
                                  "BOTH"
                                ]
                              },
                              "allowedBy": {
                                "$ref": "#/components/schemas/Vendor2"
                              }
                            },
                            "required": [
                              "key",
                              "report",
                              "bill",
                              "company",
                              "supplierName",
                              "billDate",
                              "currency",
                              "totalMinor",
                              "approvedAt",
                              "approvedBy",
                              "coincidence",
                              "allowedBy"
                            ],
                            "additionalProperties": false
                          },
                          {
                            "type": "object",
                            "properties": {
                              "orderCount": {
                                "type": "integer",
                                "minimum": 0,
                                "maximum": 9007199254740991
                              },
                              "orderedMinor": {
                                "type": "string",
                                "pattern": "^-?\\d+$"
                              },
                              "invoicedMinor": {
                                "type": "string",
                                "pattern": "^-?\\d+$"
                              },
                              "openMinor": {
                                "type": "string",
                                "pattern": "^-?\\d+$"
                              },
                              "receivedNotInvoicedMinor": {
                                "type": "string",
                                "pattern": "^-?\\d+$"
                              },
                              "onOrderMinor": {
                                "type": "string",
                                "pattern": "^-?\\d+$"
                              },
                              "key": {
                                "type": "string"
                              },
                              "report": {
                                "type": "string",
                                "const": "open-commitments"
                              },
                              "groupBy": {
                                "type": "string",
                                "enum": [
                                  "VENDOR",
                                  "ACCOUNT",
                                  "DIMENSION",
                                  "COMPANY",
                                  "ORDER"
                                ]
                              },
                              "group": {
                                "$ref": "#/components/schemas/Vendor2"
                              }
                            },
                            "required": [
                              "orderCount",
                              "orderedMinor",
                              "invoicedMinor",
                              "openMinor",
                              "receivedNotInvoicedMinor",
                              "onOrderMinor",
                              "key",
                              "report",
                              "groupBy",
                              "group"
                            ],
                            "additionalProperties": false
                          },
                          {
                            "type": "object",
                            "properties": {
                              "totalMinor": {
                                "type": "string",
                                "pattern": "^-?\\d+$"
                              },
                              "releasedMinor": {
                                "type": "string",
                                "pattern": "^-?\\d+$"
                              },
                              "remainingMinor": {
                                "type": "string",
                                "pattern": "^-?\\d+$"
                              },
                              "key": {
                                "type": "string"
                              },
                              "report": {
                                "type": "string",
                                "const": "prepaid-schedule"
                              },
                              "scheduleId": {
                                "type": "string"
                              },
                              "bill": {
                                "$ref": "#/components/schemas/Vendor2Option1"
                              },
                              "vendorName": {
                                "type": "string"
                              },
                              "lineNumber": {
                                "type": "integer",
                                "minimum": 1,
                                "maximum": 9007199254740991
                              },
                              "prepaidAccount": {
                                "$ref": "#/components/schemas/Vendor2Option1"
                              },
                              "releaseAccount": {
                                "$ref": "#/components/schemas/Vendor2Option1"
                              },
                              "status": {
                                "type": "string",
                                "enum": [
                                  "ACTIVE",
                                  "COMPLETE",
                                  "DECLINED",
                                  "VOID"
                                ]
                              },
                              "periodStart": {
                                "type": "string",
                                "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                              },
                              "periodEnd": {
                                "type": "string",
                                "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                              },
                              "nextRelease": {
                                "anyOf": [
                                  {
                                    "type": "string",
                                    "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                                  },
                                  {
                                    "type": "null"
                                  }
                                ]
                              }
                            },
                            "required": [
                              "totalMinor",
                              "releasedMinor",
                              "remainingMinor",
                              "key",
                              "report",
                              "scheduleId",
                              "bill",
                              "vendorName",
                              "lineNumber",
                              "prepaidAccount",
                              "releaseAccount",
                              "status",
                              "periodStart",
                              "periodEnd",
                              "nextRelease"
                            ],
                            "additionalProperties": false
                          },
                          {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "report": {
                                "type": "string",
                                "const": "cut-off"
                              },
                              "bill": {
                                "$ref": "#/components/schemas/Vendor2Option1"
                              },
                              "vendorName": {
                                "type": "string"
                              },
                              "lineNumber": {
                                "type": "integer",
                                "minimum": 1,
                                "maximum": 9007199254740991
                              },
                              "accountCode": {
                                "type": [
                                  "string",
                                  "null"
                                ]
                              },
                              "belongsOn": {
                                "type": "string",
                                "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                              },
                              "booksOn": {
                                "anyOf": [
                                  {
                                    "type": "string",
                                    "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                                  },
                                  {
                                    "type": "null"
                                  }
                                ]
                              },
                              "class": {
                                "type": "string",
                                "enum": [
                                  "IN_REVIEW",
                                  "POSTED_LATER"
                                ]
                              },
                              "amountMinor": {
                                "type": "string",
                                "pattern": "^-?\\d+$"
                              }
                            },
                            "required": [
                              "key",
                              "report",
                              "bill",
                              "vendorName",
                              "lineNumber",
                              "accountCode",
                              "belongsOn",
                              "booksOn",
                              "class",
                              "amountMinor"
                            ],
                            "additionalProperties": false
                          },
                          {
                            "type": "object",
                            "properties": {
                              "retainedMinor": {
                                "type": "string",
                                "pattern": "^-?\\d+$"
                              },
                              "releasedMinor": {
                                "type": "string",
                                "pattern": "^-?\\d+$"
                              },
                              "remainingMinor": {
                                "type": "string",
                                "pattern": "^-?\\d+$"
                              },
                              "key": {
                                "type": "string"
                              },
                              "report": {
                                "type": "string",
                                "const": "holdbacks-held"
                              },
                              "bill": {
                                "$ref": "#/components/schemas/Vendor2Option1"
                              },
                              "vendor": {
                                "$ref": "#/components/schemas/Vendor2"
                              },
                              "company": {
                                "$ref": "#/components/schemas/Vendor2Option1"
                              },
                              "currency": {
                                "type": "string",
                                "pattern": "^[A-Z]{3}$"
                              },
                              "releaseOn": {
                                "anyOf": [
                                  {
                                    "type": "string",
                                    "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                                  },
                                  {
                                    "type": "null"
                                  }
                                ]
                              },
                              "state": {
                                "type": "string",
                                "enum": [
                                  "RETAINED",
                                  "RELEASE_DUE",
                                  "RELEASE_DRAFTED",
                                  "PART_RELEASED"
                                ]
                              }
                            },
                            "required": [
                              "retainedMinor",
                              "releasedMinor",
                              "remainingMinor",
                              "key",
                              "report",
                              "bill",
                              "vendor",
                              "company",
                              "currency",
                              "releaseOn",
                              "state"
                            ],
                            "additionalProperties": false
                          }
                        ]
                      }
                    },
                    "nextCursor": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "rowCount": {
                      "type": "integer",
                      "minimum": 0,
                      "maximum": 9007199254740991
                    },
                    "totalRow": {
                      "oneOf": [
                        {
                          "type": "object",
                          "properties": {
                            "spendMinor": {
                              "type": "string",
                              "pattern": "^-?\\d+$"
                            },
                            "itcMinor": {
                              "type": "string",
                              "pattern": "^-?\\d+$"
                            },
                            "billCount": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 9007199254740991
                            },
                            "report": {
                              "type": "string",
                              "const": "spend-by-vendor"
                            }
                          },
                          "required": [
                            "spendMinor",
                            "itcMinor",
                            "billCount",
                            "report"
                          ],
                          "additionalProperties": false
                        },
                        {
                          "type": "object",
                          "properties": {
                            "spendMinor": {
                              "type": "string",
                              "pattern": "^-?\\d+$"
                            },
                            "budgetMinor": {
                              "anyOf": [
                                {
                                  "type": "string",
                                  "pattern": "^-?\\d+$"
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "budgetLeftMinor": {
                              "anyOf": [
                                {
                                  "type": "string",
                                  "pattern": "^-?\\d+$"
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "billCount": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 9007199254740991
                            },
                            "report": {
                              "type": "string",
                              "const": "spend-by-account"
                            }
                          },
                          "required": [
                            "spendMinor",
                            "budgetMinor",
                            "budgetLeftMinor",
                            "billCount",
                            "report"
                          ],
                          "additionalProperties": false
                        },
                        {
                          "type": "object",
                          "properties": {
                            "spendMinor": {
                              "type": "string",
                              "pattern": "^-?\\d+$"
                            },
                            "budgetMinor": {
                              "anyOf": [
                                {
                                  "type": "string",
                                  "pattern": "^-?\\d+$"
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "budgetLeftMinor": {
                              "anyOf": [
                                {
                                  "type": "string",
                                  "pattern": "^-?\\d+$"
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "billCount": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 9007199254740991
                            },
                            "report": {
                              "type": "string",
                              "const": "spend-by-month"
                            }
                          },
                          "required": [
                            "spendMinor",
                            "budgetMinor",
                            "budgetLeftMinor",
                            "billCount",
                            "report"
                          ],
                          "additionalProperties": false
                        },
                        {
                          "type": "object",
                          "properties": {
                            "spendMinor": {
                              "type": "string",
                              "pattern": "^-?\\d+$"
                            },
                            "budgetMinor": {
                              "anyOf": [
                                {
                                  "type": "string",
                                  "pattern": "^-?\\d+$"
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "budgetLeftMinor": {
                              "anyOf": [
                                {
                                  "type": "string",
                                  "pattern": "^-?\\d+$"
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "billCount": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 9007199254740991
                            },
                            "report": {
                              "type": "string",
                              "const": "spend-by-company"
                            }
                          },
                          "required": [
                            "spendMinor",
                            "budgetMinor",
                            "budgetLeftMinor",
                            "billCount",
                            "report"
                          ],
                          "additionalProperties": false
                        },
                        {
                          "type": "object",
                          "properties": {
                            "spendMinor": {
                              "type": "string",
                              "pattern": "^-?\\d+$"
                            },
                            "budgetMinor": {
                              "anyOf": [
                                {
                                  "type": "string",
                                  "pattern": "^-?\\d+$"
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "budgetLeftMinor": {
                              "anyOf": [
                                {
                                  "type": "string",
                                  "pattern": "^-?\\d+$"
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "billCount": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 9007199254740991
                            },
                            "report": {
                              "type": "string",
                              "const": "spend-by-dimension"
                            },
                            "waitingMinor": {
                              "type": "string",
                              "pattern": "^-?\\d+$"
                            },
                            "waitingBillCount": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 9007199254740991
                            }
                          },
                          "required": [
                            "spendMinor",
                            "budgetMinor",
                            "budgetLeftMinor",
                            "billCount",
                            "report",
                            "waitingMinor",
                            "waitingBillCount"
                          ],
                          "additionalProperties": false
                        },
                        {
                          "type": "object",
                          "properties": {
                            "netMinor": {
                              "type": "string",
                              "pattern": "^-?\\d+$"
                            },
                            "taxMinor": {
                              "type": "string",
                              "pattern": "^-?\\d+$"
                            },
                            "totalMinor": {
                              "type": "string",
                              "pattern": "^-?\\d+$"
                            },
                            "openMinor": {
                              "type": "string",
                              "pattern": "^-?\\d+$"
                            },
                            "report": {
                              "type": "string",
                              "const": "bill-register"
                            },
                            "billCount": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 9007199254740991
                            }
                          },
                          "required": [
                            "netMinor",
                            "taxMinor",
                            "totalMinor",
                            "openMinor",
                            "report",
                            "billCount"
                          ],
                          "additionalProperties": false
                        },
                        {
                          "type": "object",
                          "properties": {
                            "paidMinor": {
                              "type": "string",
                              "pattern": "^-?\\d+$"
                            },
                            "notCountedMinor": {
                              "type": "string",
                              "pattern": "^-?\\d+$"
                            },
                            "report": {
                              "type": "string",
                              "const": "payment-register"
                            },
                            "paymentCount": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 9007199254740991
                            }
                          },
                          "required": [
                            "paidMinor",
                            "notCountedMinor",
                            "report",
                            "paymentCount"
                          ],
                          "additionalProperties": false
                        },
                        {
                          "type": "object",
                          "properties": {
                            "baseMinor": {
                              "type": "string",
                              "pattern": "^-?\\d+$"
                            },
                            "taxPaidMinor": {
                              "type": "string",
                              "pattern": "^-?\\d+$"
                            },
                            "itcMinor": {
                              "type": "string",
                              "pattern": "^-?\\d+$"
                            },
                            "notClaimedMinor": {
                              "type": "string",
                              "pattern": "^-?\\d+$"
                            },
                            "report": {
                              "type": "string",
                              "const": "tax-paid"
                            },
                            "sourceCount": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 9007199254740991
                            }
                          },
                          "required": [
                            "baseMinor",
                            "taxPaidMinor",
                            "itcMinor",
                            "notClaimedMinor",
                            "report",
                            "sourceCount"
                          ],
                          "additionalProperties": false
                        },
                        {
                          "type": "object",
                          "properties": {
                            "dueMinor": {
                              "type": "string",
                              "pattern": "^-?\\d+$"
                            },
                            "heldMinor": {
                              "type": "string",
                              "pattern": "^-?\\d+$"
                            },
                            "inRunMinor": {
                              "type": "string",
                              "pattern": "^-?\\d+$"
                            },
                            "discountDeadlineMinor": {
                              "type": "string",
                              "pattern": "^-?\\d+$"
                            },
                            "discountKeptMinor": {
                              "type": "string",
                              "pattern": "^-?\\d+$"
                            },
                            "billCount": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 9007199254740991
                            },
                            "report": {
                              "type": "string",
                              "const": "cash-required"
                            }
                          },
                          "required": [
                            "dueMinor",
                            "heldMinor",
                            "inRunMinor",
                            "discountDeadlineMinor",
                            "discountKeptMinor",
                            "billCount",
                            "report"
                          ],
                          "additionalProperties": false
                        },
                        {
                          "type": "object",
                          "properties": {
                            "report": {
                              "type": "string",
                              "const": "itc-at-risk"
                            },
                            "itcMinor": {
                              "type": "string",
                              "pattern": "^-?\\d+$"
                            },
                            "failCount": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 9007199254740991
                            },
                            "untestedCount": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 9007199254740991
                            },
                            "notTestedCount": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 9007199254740991
                            },
                            "passCount": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 9007199254740991
                            },
                            "failItcMinor": {
                              "type": "string",
                              "pattern": "^-?\\d+$"
                            },
                            "untestedItcMinor": {
                              "type": "string",
                              "pattern": "^-?\\d+$"
                            },
                            "notTestedItcMinor": {
                              "type": "string",
                              "pattern": "^-?\\d+$"
                            },
                            "passItcMinor": {
                              "type": "string",
                              "pattern": "^-?\\d+$"
                            }
                          },
                          "required": [
                            "report",
                            "itcMinor",
                            "failCount",
                            "untestedCount",
                            "notTestedCount",
                            "passCount",
                            "failItcMinor",
                            "untestedItcMinor",
                            "notTestedItcMinor",
                            "passItcMinor"
                          ],
                          "additionalProperties": false
                        },
                        {
                          "type": "object",
                          "properties": {
                            "report": {
                              "type": "string",
                              "const": "unexplained-payable"
                            },
                            "amountMinor": {
                              "type": "string",
                              "pattern": "^-?\\d+$"
                            },
                            "lineCount": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 9007199254740991
                            }
                          },
                          "required": [
                            "report",
                            "amountMinor",
                            "lineCount"
                          ],
                          "additionalProperties": false
                        },
                        {
                          "type": "object",
                          "properties": {
                            "amountMinor": {
                              "type": "string",
                              "pattern": "^-?\\d+$"
                            },
                            "exceptionMinor": {
                              "type": "string",
                              "pattern": "^-?\\d+$"
                            },
                            "report": {
                              "type": "string",
                              "const": "subsequent-payments"
                            },
                            "paymentCount": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 9007199254740991
                            },
                            "exceptionCount": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 9007199254740991
                            }
                          },
                          "required": [
                            "amountMinor",
                            "exceptionMinor",
                            "report",
                            "paymentCount",
                            "exceptionCount"
                          ],
                          "additionalProperties": false
                        },
                        {
                          "type": "object",
                          "properties": {
                            "paidMinor": {
                              "type": "string",
                              "pattern": "^-?\\d+$"
                            },
                            "computedBoxMinor": {
                              "type": "string",
                              "pattern": "^-?\\d+$"
                            },
                            "boxMinor": {
                              "type": "string",
                              "pattern": "^-?\\d+$"
                            },
                            "report": {
                              "type": "string",
                              "const": "slip-reconciliation"
                            },
                            "vendorCount": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 9007199254740991
                            },
                            "inFileCount": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 9007199254740991
                            }
                          },
                          "required": [
                            "paidMinor",
                            "computedBoxMinor",
                            "boxMinor",
                            "report",
                            "vendorCount",
                            "inFileCount"
                          ],
                          "additionalProperties": false
                        },
                        {
                          "type": "object",
                          "properties": {
                            "report": {
                              "type": "string",
                              "const": "approvals"
                            },
                            "rowCount": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 9007199254740991
                            },
                            "attestationCount": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 9007199254740991
                            },
                            "refusalCount": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 9007199254740991
                            },
                            "firingCount": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 9007199254740991
                            }
                          },
                          "required": [
                            "report",
                            "rowCount",
                            "attestationCount",
                            "refusalCount",
                            "firingCount"
                          ],
                          "additionalProperties": false
                        },
                        {
                          "type": "object",
                          "properties": {
                            "report": {
                              "type": "string",
                              "const": "own-work-approvals"
                            },
                            "billCount": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 9007199254740991
                            }
                          },
                          "required": [
                            "report",
                            "billCount"
                          ],
                          "additionalProperties": false
                        },
                        {
                          "type": "object",
                          "properties": {
                            "orderCount": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 9007199254740991
                            },
                            "orderedMinor": {
                              "type": "string",
                              "pattern": "^-?\\d+$"
                            },
                            "invoicedMinor": {
                              "type": "string",
                              "pattern": "^-?\\d+$"
                            },
                            "openMinor": {
                              "type": "string",
                              "pattern": "^-?\\d+$"
                            },
                            "receivedNotInvoicedMinor": {
                              "type": "string",
                              "pattern": "^-?\\d+$"
                            },
                            "onOrderMinor": {
                              "type": "string",
                              "pattern": "^-?\\d+$"
                            },
                            "report": {
                              "type": "string",
                              "const": "open-commitments"
                            }
                          },
                          "required": [
                            "orderCount",
                            "orderedMinor",
                            "invoicedMinor",
                            "openMinor",
                            "receivedNotInvoicedMinor",
                            "onOrderMinor",
                            "report"
                          ],
                          "additionalProperties": false
                        },
                        {
                          "type": "object",
                          "properties": {
                            "totalMinor": {
                              "type": "string",
                              "pattern": "^-?\\d+$"
                            },
                            "releasedMinor": {
                              "type": "string",
                              "pattern": "^-?\\d+$"
                            },
                            "remainingMinor": {
                              "type": "string",
                              "pattern": "^-?\\d+$"
                            },
                            "report": {
                              "type": "string",
                              "const": "prepaid-schedule"
                            },
                            "scheduleCount": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 9007199254740991
                            }
                          },
                          "required": [
                            "totalMinor",
                            "releasedMinor",
                            "remainingMinor",
                            "report",
                            "scheduleCount"
                          ],
                          "additionalProperties": false
                        },
                        {
                          "type": "object",
                          "properties": {
                            "report": {
                              "type": "string",
                              "const": "cut-off"
                            },
                            "amountMinor": {
                              "type": "string",
                              "pattern": "^-?\\d+$"
                            },
                            "lineCount": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 9007199254740991
                            }
                          },
                          "required": [
                            "report",
                            "amountMinor",
                            "lineCount"
                          ],
                          "additionalProperties": false
                        },
                        {
                          "type": "object",
                          "properties": {
                            "retainedMinor": {
                              "type": "string",
                              "pattern": "^-?\\d+$"
                            },
                            "releasedMinor": {
                              "type": "string",
                              "pattern": "^-?\\d+$"
                            },
                            "remainingMinor": {
                              "type": "string",
                              "pattern": "^-?\\d+$"
                            },
                            "report": {
                              "type": "string",
                              "const": "holdbacks-held"
                            },
                            "billCount": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 9007199254740991
                            }
                          },
                          "required": [
                            "retainedMinor",
                            "releasedMinor",
                            "remainingMinor",
                            "report",
                            "billCount"
                          ],
                          "additionalProperties": false
                        }
                      ]
                    },
                    "tieOut": {
                      "anyOf": [
                        {
                          "type": "object",
                          "properties": {
                            "label": {
                              "type": "string"
                            },
                            "reportMinor": {
                              "type": "string",
                              "pattern": "^-?\\d+$"
                            },
                            "againstMinor": {
                              "type": "string",
                              "pattern": "^-?\\d+$"
                            },
                            "differenceMinor": {
                              "type": "string",
                              "pattern": "^-?\\d+$"
                            }
                          },
                          "required": [
                            "label",
                            "reportMinor",
                            "againstMinor",
                            "differenceMinor"
                          ],
                          "additionalProperties": false
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "exceptionNote": {
                      "anyOf": [
                        {
                          "type": "object",
                          "properties": {
                            "sentence": {
                              "type": "string"
                            },
                            "citation": {
                              "type": [
                                "string",
                                "null"
                              ]
                            }
                          },
                          "required": [
                            "sentence",
                            "citation"
                          ],
                          "additionalProperties": false
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "notes": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "filters": {
                      "type": "object",
                      "propertyNames": {
                        "type": "string"
                      },
                      "additionalProperties": {
                        "type": "string"
                      }
                    }
                  },
                  "required": [
                    "report",
                    "group",
                    "title",
                    "description",
                    "currency",
                    "asOf",
                    "entityTimeZone",
                    "dateMeaning",
                    "columns",
                    "rows",
                    "nextCursor",
                    "rowCount",
                    "totalRow",
                    "tieOut",
                    "exceptionNote",
                    "notes",
                    "filters"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "404": {
            "$ref": "#/components/responses/Problem404"
          },
          "422": {
            "$ref": "#/components/responses/Problem422"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      }
    },
    "/v1/purchases-settings": {
      "get": {
        "operationId": "getPurchasesSettings",
        "summary": "Returns the purchases settings of the ledger.",
        "description": "Returns the purchases settings of the ledger. Needs the `ledger:read` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "purchases"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:read",
        "parameters": [
          {
            "name": "entityId",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetPurchasesSettingsResponse"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "422": {
            "$ref": "#/components/responses/Problem422"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      }
    },
    "/v1/purchases-settings/inbox-advice/dismiss": {
      "post": {
        "operationId": "dismissInboxPolicyAdvice",
        "summary": "Dismisses advice about the inbox policy.",
        "description": "Dismisses advice about the inbox policy. Needs the `ledger:admin` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "purchases"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:admin",
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "entityId": {
                    "type": "string",
                    "minLength": 1
                  },
                  "digest": {
                    "type": "string",
                    "pattern": "^[0-9a-f]{64}$"
                  }
                },
                "required": [
                  "entityId",
                  "digest"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "Ledger-Position": {
                "$ref": "#/components/headers/LedgerPosition"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetPurchasesSettingsResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem400"
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "409": {
            "$ref": "#/components/responses/Problem409"
          },
          "412": {
            "$ref": "#/components/responses/Problem412"
          },
          "422": {
            "$ref": "#/components/responses/Problem422"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      }
    },
    "/v1/purchases-settings/paper-requirements/apply": {
      "post": {
        "operationId": "applyPaperRequirements",
        "summary": "Starts applying the paper requirements to the vendors they name, as a job you follow.",
        "description": "Starts applying the paper requirements to the vendors they name, as a job you follow. Needs the `ledger:admin` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "purchases"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:admin",
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "kinds": {
                    "minItems": 1,
                    "maxItems": 8,
                    "type": "array",
                    "items": {
                      "type": "string",
                      "enum": [
                        "WSIB_CLEARANCE",
                        "INSURANCE_CERTIFICATE",
                        "MASTER_AGREEMENT",
                        "W8BEN",
                        "DIRECT_DEPOSIT_FORM",
                        "WITHHOLDING_WAIVER",
                        "OTHER"
                      ]
                    }
                  },
                  "slipKind": {
                    "type": "string",
                    "enum": [
                      "NONE",
                      "T4A",
                      "T5018",
                      "T4A_NR"
                    ]
                  },
                  "expectedCount": {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 9007199254740991
                  }
                },
                "required": [
                  "kinds",
                  "expectedCount"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Accepted: the work is done after the answer, or waits for a person's confirmation.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "Ledger-Position": {
                "$ref": "#/components/headers/LedgerPosition"
              },
              "Location": {
                "$ref": "#/components/headers/Location"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UndoAgentBatchResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem400"
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "409": {
            "$ref": "#/components/responses/Problem409"
          },
          "412": {
            "$ref": "#/components/responses/Problem412"
          },
          "422": {
            "$ref": "#/components/responses/Problem422"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      }
    },
    "/v1/purchases-settings/paper-requirements/preview": {
      "get": {
        "operationId": "previewPaperRequirements",
        "summary": "Previews the paper requirements before they are applied.",
        "description": "Previews the paper requirements before they are applied. Needs the `ledger:admin` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "purchases"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:admin",
        "parameters": [
          {
            "name": "kinds",
            "in": "query",
            "required": true,
            "description": "One or more document kinds, separated by commas.",
            "schema": {
              "type": "string",
              "description": "One or more document kinds, separated by commas."
            }
          },
          {
            "name": "slipKind",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "NONE",
                "T4A",
                "T5018",
                "T4A_NR"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "kinds": {
                      "type": "array",
                      "items": {
                        "type": "string",
                        "enum": [
                          "WSIB_CLEARANCE",
                          "INSURANCE_CERTIFICATE",
                          "MASTER_AGREEMENT",
                          "W8BEN",
                          "DIRECT_DEPOSIT_FORM",
                          "WITHHOLDING_WAIVER",
                          "OTHER"
                        ]
                      }
                    },
                    "slipKind": {
                      "anyOf": [
                        {
                          "type": "string",
                          "enum": [
                            "NONE",
                            "T4A",
                            "T5018",
                            "T4A_NR"
                          ]
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "wouldChange": {
                      "type": "integer",
                      "minimum": 0,
                      "maximum": 9007199254740991
                    },
                    "withoutPaper": {
                      "type": "integer",
                      "minimum": 0,
                      "maximum": 9007199254740991
                    },
                    "sample": {
                      "maxItems": 10,
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "displayName": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "id",
                          "displayName"
                        ],
                        "additionalProperties": false
                      }
                    }
                  },
                  "required": [
                    "kinds",
                    "slipKind",
                    "wouldChange",
                    "withoutPaper",
                    "sample"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "422": {
            "$ref": "#/components/responses/Problem422"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      }
    },
    "/v1/purchases-settings/self-approved-bills": {
      "get": {
        "operationId": "listSelfApprovedBills",
        "summary": "Lists the bills a person approved themselves.",
        "description": "Lists the bills a person approved themselves. Needs the `audit:read` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "purchases"
        ],
        "x-stability-level": "beta",
        "x-scope": "audit:read",
        "parameters": [
          {
            "name": "entityId",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "approvedFrom",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
            }
          },
          {
            "name": "approvedTo",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
            }
          },
          {
            "name": "coincidence",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "DRAFTER",
                "SUBMITTER",
                "BOTH"
              ]
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "default": 50,
              "type": "integer",
              "minimum": 1,
              "maximum": 200
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 512
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "billId": {
                            "type": "string"
                          },
                          "entityId": {
                            "type": "string"
                          },
                          "entityName": {
                            "type": "string"
                          },
                          "entityTimeZone": {
                            "type": "string"
                          },
                          "supplierName": {
                            "type": "string"
                          },
                          "number": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "billDate": {
                            "type": "string",
                            "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                          },
                          "currency": {
                            "type": "string",
                            "pattern": "^[A-Z]{3}$"
                          },
                          "totalMinor": {
                            "type": "string",
                            "pattern": "^-?\\d+$"
                          },
                          "approvedAt": {
                            "type": "string",
                            "minLength": 20
                          },
                          "approvedBy": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string"
                              },
                              "name": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "id",
                              "name"
                            ],
                            "additionalProperties": false
                          },
                          "preparedBy": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string"
                              },
                              "name": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "id",
                              "name"
                            ],
                            "additionalProperties": false
                          },
                          "submittedBy": {
                            "anyOf": [
                              {
                                "type": "object",
                                "properties": {
                                  "id": {
                                    "type": "string"
                                  },
                                  "name": {
                                    "type": "string"
                                  }
                                },
                                "required": [
                                  "id",
                                  "name"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "coincidence": {
                            "type": "string",
                            "enum": [
                              "DRAFTER",
                              "SUBMITTER",
                              "BOTH"
                            ]
                          },
                          "allowedBy": {
                            "$ref": "#/components/schemas/ApprovedUnder"
                          },
                          "ownWorkAuthority": {
                            "anyOf": [
                              {
                                "type": "object",
                                "properties": {
                                  "id": {
                                    "type": "string"
                                  },
                                  "origin": {
                                    "type": "string",
                                    "enum": [
                                      "CARRIED_OVER",
                                      "PERSON",
                                      "IMPORT"
                                    ]
                                  },
                                  "ownWorkCapMinor": {
                                    "type": "string",
                                    "pattern": "^-?\\d+$"
                                  },
                                  "currency": {
                                    "type": "string",
                                    "pattern": "^[A-Z]{3}$"
                                  },
                                  "setBy": {
                                    "anyOf": [
                                      {
                                        "type": "object",
                                        "properties": {
                                          "id": {
                                            "type": "string"
                                          },
                                          "name": {
                                            "type": "string"
                                          }
                                        },
                                        "required": [
                                          "id",
                                          "name"
                                        ],
                                        "additionalProperties": false
                                      },
                                      {
                                        "type": "null"
                                      }
                                    ]
                                  },
                                  "effectiveFrom": {
                                    "type": "string",
                                    "minLength": 20
                                  }
                                },
                                "required": [
                                  "id",
                                  "origin",
                                  "ownWorkCapMinor",
                                  "currency",
                                  "setBy",
                                  "effectiveFrom"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "null"
                              }
                            ]
                          }
                        },
                        "required": [
                          "billId",
                          "entityId",
                          "entityName",
                          "entityTimeZone",
                          "supplierName",
                          "number",
                          "billDate",
                          "currency",
                          "totalMinor",
                          "approvedAt",
                          "approvedBy",
                          "preparedBy",
                          "submittedBy",
                          "coincidence",
                          "allowedBy",
                          "ownWorkAuthority"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "nextCursor": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "total": {
                      "anyOf": [
                        {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  },
                  "required": [
                    "data",
                    "nextCursor",
                    "total"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "422": {
            "$ref": "#/components/responses/Problem422"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      }
    },
    "/v1/purchases-summary": {
      "get": {
        "operationId": "getPurchasesSummary",
        "summary": "Returns the purchases summary for the ledger over a period.",
        "description": "Returns the purchases summary for the ledger over a period. Needs the `ledger:read` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "purchases"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:read",
        "parameters": [
          {
            "name": "entityId",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "entity": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "name": {
                          "type": "string"
                        },
                        "functionalCurrency": {
                          "type": "string",
                          "pattern": "^[A-Z]{3}$"
                        }
                      },
                      "required": [
                        "id",
                        "name",
                        "functionalCurrency"
                      ],
                      "additionalProperties": false
                    },
                    "entityTimeZone": {
                      "type": "string"
                    },
                    "readAt": {
                      "type": "string",
                      "minLength": 20
                    },
                    "today": {
                      "type": "string",
                      "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                    },
                    "weekEnd": {
                      "type": "string",
                      "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                    },
                    "money": {
                      "oneOf": [
                        {
                          "type": "object",
                          "properties": {
                            "state": {
                              "type": "string",
                              "const": "READ"
                            },
                            "owed": {
                              "$ref": "#/components/schemas/Totals3"
                            },
                            "overdue": {
                              "$ref": "#/components/schemas/Totals3"
                            },
                            "dueThisWeek": {
                              "$ref": "#/components/schemas/Totals3"
                            },
                            "draftRuns": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "currency": {
                                    "type": "string",
                                    "pattern": "^[A-Z]{3}$"
                                  },
                                  "totalMinor": {
                                    "type": "string",
                                    "pattern": "^-?\\d+$"
                                  },
                                  "runCount": {
                                    "type": "integer",
                                    "minimum": 1,
                                    "maximum": 9007199254740991
                                  }
                                },
                                "required": [
                                  "currency",
                                  "totalMinor",
                                  "runCount"
                                ],
                                "additionalProperties": false
                              }
                            },
                            "heldInWeek": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 9007199254740991
                            },
                            "paidOtherWayInWeek": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 9007199254740991
                            },
                            "heldBack": {
                              "anyOf": [
                                {
                                  "type": "array",
                                  "items": {
                                    "type": "object",
                                    "properties": {
                                      "entityId": {
                                        "type": "string"
                                      },
                                      "currency": {
                                        "type": "string"
                                      },
                                      "remainingMinor": {
                                        "type": "string",
                                        "pattern": "^-?\\d+$"
                                      }
                                    },
                                    "required": [
                                      "entityId",
                                      "currency",
                                      "remainingMinor"
                                    ],
                                    "additionalProperties": false
                                  }
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            }
                          },
                          "required": [
                            "state",
                            "owed",
                            "overdue",
                            "dueThisWeek",
                            "draftRuns",
                            "heldInWeek",
                            "paidOtherWayInWeek",
                            "heldBack"
                          ],
                          "additionalProperties": false
                        },
                        {
                          "type": "object",
                          "properties": {
                            "state": {
                              "type": "string",
                              "const": "UNREAD"
                            }
                          },
                          "required": [
                            "state"
                          ],
                          "additionalProperties": false
                        }
                      ]
                    },
                    "ageing": {
                      "oneOf": [
                        {
                          "type": "object",
                          "properties": {
                            "asOf": {
                              "type": "string",
                              "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                            },
                            "entity": {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string"
                                },
                                "name": {
                                  "type": "string"
                                },
                                "timeZone": {
                                  "type": "string"
                                }
                              },
                              "required": [
                                "id",
                                "name",
                                "timeZone"
                              ],
                              "additionalProperties": false
                            },
                            "currency": {
                              "type": "string",
                              "pattern": "^[A-Z]{3}$"
                            },
                            "totals": {
                              "$ref": "#/components/schemas/Totals4"
                            },
                            "openBillCount": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 9007199254740991
                            },
                            "heldBillCount": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 9007199254740991
                            },
                            "tie": {
                              "$ref": "#/components/schemas/TieOption1"
                            },
                            "state": {
                              "type": "string",
                              "const": "READ"
                            }
                          },
                          "required": [
                            "asOf",
                            "entity",
                            "currency",
                            "totals",
                            "openBillCount",
                            "heldBillCount",
                            "tie",
                            "state"
                          ],
                          "additionalProperties": false
                        },
                        {
                          "type": "object",
                          "properties": {
                            "state": {
                              "type": "string",
                              "const": "UNREAD"
                            }
                          },
                          "required": [
                            "state"
                          ],
                          "additionalProperties": false
                        }
                      ]
                    },
                    "dueFirst": {
                      "oneOf": [
                        {
                          "type": "object",
                          "properties": {
                            "state": {
                              "type": "string",
                              "const": "READ"
                            },
                            "rows": {
                              "maxItems": 5,
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "billId": {
                                    "type": "string"
                                  },
                                  "number": {
                                    "type": [
                                      "string",
                                      "null"
                                    ]
                                  },
                                  "supplierName": {
                                    "type": "string"
                                  },
                                  "vendor": {
                                    "anyOf": [
                                      {
                                        "type": "object",
                                        "properties": {
                                          "id": {
                                            "type": "string"
                                          },
                                          "displayName": {
                                            "type": "string"
                                          }
                                        },
                                        "required": [
                                          "id",
                                          "displayName"
                                        ],
                                        "additionalProperties": false
                                      },
                                      {
                                        "type": "null"
                                      }
                                    ]
                                  },
                                  "dueDate": {
                                    "type": "string",
                                    "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                                  },
                                  "overdueDays": {
                                    "type": "integer",
                                    "minimum": -9007199254740991,
                                    "maximum": 9007199254740991
                                  },
                                  "currency": {
                                    "type": "string",
                                    "pattern": "^[A-Z]{3}$"
                                  },
                                  "openMinor": {
                                    "type": "string",
                                    "pattern": "^-?\\d+$"
                                  }
                                },
                                "required": [
                                  "billId",
                                  "number",
                                  "supplierName",
                                  "vendor",
                                  "dueDate",
                                  "overdueDays",
                                  "currency",
                                  "openMinor"
                                ],
                                "additionalProperties": false
                              }
                            },
                            "total": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 9007199254740991
                            }
                          },
                          "required": [
                            "state",
                            "rows",
                            "total"
                          ],
                          "additionalProperties": false
                        },
                        {
                          "type": "object",
                          "properties": {
                            "state": {
                              "type": "string",
                              "const": "UNREAD"
                            }
                          },
                          "required": [
                            "state"
                          ],
                          "additionalProperties": false
                        }
                      ]
                    },
                    "work": {
                      "type": "object",
                      "properties": {
                        "waitingOnYou": {
                          "anyOf": [
                            {
                              "$ref": "#/components/schemas/WaitingOnYouOption1"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "inReview": {
                          "$ref": "#/components/schemas/WaitingOnYouOption1"
                        },
                        "runsToRelease": {
                          "$ref": "#/components/schemas/WaitingOnYouOption1"
                        },
                        "bankingToVerify": {
                          "$ref": "#/components/schemas/WaitingOnYouOption1"
                        },
                        "toAccept": {
                          "$ref": "#/components/schemas/WaitingOnYouOption1"
                        },
                        "notReviewed": {
                          "$ref": "#/components/schemas/WaitingOnYouOption1"
                        },
                        "mergesWaiting": {
                          "$ref": "#/components/schemas/WaitingOnYouOption1"
                        },
                        "lookAlikes": {
                          "$ref": "#/components/schemas/WaitingOnYouOption1"
                        },
                        "documentsStopped": {
                          "oneOf": [
                            {
                              "type": "object",
                              "properties": {
                                "state": {
                                  "type": "string",
                                  "const": "READ"
                                },
                                "count": {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 9007199254740991
                                },
                                "unreadable": {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 9007199254740991
                                },
                                "oldestOn": {
                                  "anyOf": [
                                    {
                                      "type": "string",
                                      "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                                    },
                                    {
                                      "type": "null"
                                    }
                                  ]
                                },
                                "oldestDays": {
                                  "anyOf": [
                                    {
                                      "type": "integer",
                                      "minimum": 0,
                                      "maximum": 9007199254740991
                                    },
                                    {
                                      "type": "null"
                                    }
                                  ]
                                }
                              },
                              "required": [
                                "state",
                                "count",
                                "unreadable",
                                "oldestOn",
                                "oldestDays"
                              ],
                              "additionalProperties": false
                            },
                            {
                              "type": "object",
                              "properties": {
                                "state": {
                                  "type": "string",
                                  "const": "UNREAD"
                                }
                              },
                              "required": [
                                "state"
                              ],
                              "additionalProperties": false
                            }
                          ]
                        },
                        "signalsOpen": {
                          "$ref": "#/components/schemas/WaitingOnYouOption1"
                        },
                        "discountsOpen": {
                          "oneOf": [
                            {
                              "type": "object",
                              "properties": {
                                "state": {
                                  "type": "string",
                                  "const": "READ"
                                },
                                "count": {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 9007199254740991
                                },
                                "firstClosesOn": {
                                  "anyOf": [
                                    {
                                      "type": "string",
                                      "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                                    },
                                    {
                                      "type": "null"
                                    }
                                  ]
                                },
                                "kept": {
                                  "type": "array",
                                  "items": {
                                    "type": "object",
                                    "properties": {
                                      "currency": {
                                        "type": "string",
                                        "pattern": "^[A-Z]{3}$"
                                      },
                                      "discountMinor": {
                                        "type": "string",
                                        "pattern": "^-?\\d+$"
                                      }
                                    },
                                    "required": [
                                      "currency",
                                      "discountMinor"
                                    ],
                                    "additionalProperties": false
                                  }
                                }
                              },
                              "required": [
                                "state",
                                "count",
                                "firstClosesOn",
                                "kept"
                              ],
                              "additionalProperties": false
                            },
                            {
                              "type": "object",
                              "properties": {
                                "state": {
                                  "type": "string",
                                  "const": "UNREAD"
                                }
                              },
                              "required": [
                                "state"
                              ],
                              "additionalProperties": false
                            }
                          ]
                        },
                        "toReceive": {
                          "$ref": "#/components/schemas/WaitingOnYouOption1"
                        },
                        "slipsProposed": {
                          "$ref": "#/components/schemas/WaitingOnYouOption1"
                        },
                        "billsNotArrived": {
                          "$ref": "#/components/schemas/WaitingOnYouOption1"
                        },
                        "holdbacksDue": {
                          "$ref": "#/components/schemas/WaitingOnYouOption1"
                        },
                        "privacyDue": {
                          "oneOf": [
                            {
                              "type": "object",
                              "properties": {
                                "state": {
                                  "type": "string",
                                  "const": "READ"
                                },
                                "count": {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 9007199254740991
                                },
                                "overdue": {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 9007199254740991
                                },
                                "soonestDueOn": {
                                  "anyOf": [
                                    {
                                      "type": "string",
                                      "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                                    },
                                    {
                                      "type": "null"
                                    }
                                  ]
                                }
                              },
                              "required": [
                                "state",
                                "count",
                                "overdue",
                                "soonestDueOn"
                              ],
                              "additionalProperties": false
                            },
                            {
                              "type": "object",
                              "properties": {
                                "state": {
                                  "type": "string",
                                  "const": "UNREAD"
                                }
                              },
                              "required": [
                                "state"
                              ],
                              "additionalProperties": false
                            }
                          ]
                        },
                        "portalWaiting": {
                          "$ref": "#/components/schemas/WaitingOnYouOption1"
                        },
                        "billQuestionsOnYou": {
                          "$ref": "#/components/schemas/WaitingOnYouOption1"
                        },
                        "supplierQuestions": {
                          "$ref": "#/components/schemas/WaitingOnYouOption1"
                        },
                        "statementsToReview": {
                          "$ref": "#/components/schemas/WaitingOnYouOption1"
                        },
                        "cardReceiptsNoLine": {
                          "$ref": "#/components/schemas/WaitingOnYouOption1"
                        },
                        "cardLinesNeedReceipt": {
                          "$ref": "#/components/schemas/WaitingOnYouOption1"
                        }
                      },
                      "required": [
                        "waitingOnYou",
                        "inReview",
                        "runsToRelease",
                        "bankingToVerify",
                        "toAccept",
                        "notReviewed",
                        "mergesWaiting",
                        "lookAlikes",
                        "documentsStopped",
                        "signalsOpen",
                        "discountsOpen",
                        "toReceive",
                        "slipsProposed",
                        "billsNotArrived",
                        "holdbacksDue",
                        "privacyDue",
                        "portalWaiting",
                        "billQuestionsOnYou",
                        "supplierQuestions",
                        "statementsToReview",
                        "cardReceiptsNoLine",
                        "cardLinesNeedReceipt"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "entity",
                    "entityTimeZone",
                    "readAt",
                    "today",
                    "weekEnd",
                    "money",
                    "ageing",
                    "dueFirst",
                    "work"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "422": {
            "$ref": "#/components/responses/Problem422"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      }
    },
    "/v1/purchases/custom-field-values/{recordKind}/{recordId}": {
      "put": {
        "operationId": "setPurchasesCustomFieldValues",
        "summary": "Sets custom field values on a vendor, bill or purchase order. Send only changed fields: null clears one, one left out is kept.",
        "description": "Sets custom field values on a vendor, bill or purchase order. Send only changed fields: null clears one, one left out is kept. Needs the `ledger:propose` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "purchases"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:propose",
        "parameters": [
          {
            "name": "recordKind",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "recordId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SetCustomFieldValuesRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "Ledger-Position": {
                "$ref": "#/components/headers/LedgerPosition"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "recordKind": {
                      "type": "string",
                      "enum": [
                        "VENDOR",
                        "BILL",
                        "PURCHASE_ORDER"
                      ]
                    },
                    "recordId": {
                      "type": "string"
                    },
                    "customFields": {
                      "type": "object",
                      "propertyNames": {
                        "type": "string"
                      },
                      "additionalProperties": {
                        "anyOf": [
                          {
                            "type": "string"
                          },
                          {
                            "type": "boolean"
                          },
                          {
                            "type": "array",
                            "items": {
                              "type": "string"
                            }
                          }
                        ]
                      }
                    }
                  },
                  "required": [
                    "recordKind",
                    "recordId",
                    "customFields"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem400"
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "404": {
            "$ref": "#/components/responses/Problem404"
          },
          "409": {
            "$ref": "#/components/responses/Problem409"
          },
          "412": {
            "$ref": "#/components/responses/Problem412"
          },
          "422": {
            "$ref": "#/components/responses/Problem422"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      }
    },
    "/v1/slips/copies/{copyId}": {
      "get": {
        "operationId": "getSlipCopy",
        "summary": "Returns one copy of a slip file.",
        "description": "Returns one copy of a slip file. Needs the `ledger:read` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "purchases"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:read",
        "parameters": [
          {
            "name": "copyId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "reference": {
                      "type": "string"
                    },
                    "state": {
                      "type": "string",
                      "enum": [
                        "NOT_PRODUCED",
                        "PRODUCED",
                        "DRAFTED",
                        "BOUNCED",
                        "EMAILED",
                        "POSTED"
                      ]
                    },
                    "language": {
                      "type": "string",
                      "enum": [
                        "en",
                        "fr",
                        "bilingual"
                      ]
                    },
                    "kind": {
                      "type": "string",
                      "enum": [
                        "T4A",
                        "T5018"
                      ]
                    },
                    "taxYear": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    "reportTypeCode": {
                      "type": "string",
                      "enum": [
                        "O",
                        "A"
                      ]
                    },
                    "file": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "fileName": {
                          "type": "string"
                        },
                        "producedOn": {
                          "type": "string",
                          "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                        }
                      },
                      "required": [
                        "id",
                        "fileName",
                        "producedOn"
                      ],
                      "additionalProperties": false
                    },
                    "entity": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "name": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "id",
                        "name"
                      ],
                      "additionalProperties": false
                    },
                    "vendor": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "displayName": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "id",
                        "displayName"
                      ],
                      "additionalProperties": false
                    },
                    "recipientType": {
                      "anyOf": [
                        {
                          "type": "string",
                          "enum": [
                            "INDIVIDUAL",
                            "CORPORATION",
                            "PARTNERSHIP"
                          ]
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "producedBy": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "name": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "id",
                        "name"
                      ],
                      "additionalProperties": false
                    },
                    "producedAt": {
                      "type": "string",
                      "minLength": 20
                    },
                    "documentSha256": {
                      "type": "string",
                      "minLength": 64,
                      "maxLength": 64
                    },
                    "boxes": {
                      "minItems": 1,
                      "maxItems": 2,
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "box": {
                            "type": "string"
                          },
                          "amountMinor": {
                            "type": "string",
                            "pattern": "^-?\\d+$"
                          }
                        },
                        "required": [
                          "box",
                          "amountMinor"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "recipient": {
                      "type": "object",
                      "properties": {
                        "nameLines": {
                          "minItems": 1,
                          "maxItems": 3,
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        },
                        "addressLines": {
                          "maxItems": 4,
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        },
                        "sinHeld": {
                          "type": "boolean"
                        },
                        "programAccount": {
                          "type": "string",
                          "minLength": 15,
                          "maxLength": 15
                        }
                      },
                      "required": [
                        "nameLines",
                        "addressLines",
                        "sinHeld",
                        "programAccount"
                      ],
                      "additionalProperties": false
                    },
                    "posted": {
                      "anyOf": [
                        {
                          "type": "object",
                          "properties": {
                            "on": {
                              "type": "string",
                              "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                            },
                            "by": {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string"
                                },
                                "name": {
                                  "type": "string"
                                }
                              },
                              "required": [
                                "id",
                                "name"
                              ],
                              "additionalProperties": false
                            },
                            "recordedAt": {
                              "type": "string",
                              "minLength": 20
                            },
                            "note": {
                              "type": [
                                "string",
                                "null"
                              ]
                            }
                          },
                          "required": [
                            "on",
                            "by",
                            "recordedAt",
                            "note"
                          ],
                          "additionalProperties": false
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "deliveries": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "notice": {
                            "$ref": "#/components/schemas/ListVendorNoticesResponseItem"
                          },
                          "consent": {
                            "anyOf": [
                              {
                                "type": "object",
                                "properties": {
                                  "basis": {
                                    "type": "string",
                                    "enum": [
                                      "WRITTEN",
                                      "ELECTRONIC"
                                    ]
                                  },
                                  "givenOn": {
                                    "type": "string",
                                    "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                                  },
                                  "recordedBy": {
                                    "type": "object",
                                    "properties": {
                                      "id": {
                                        "type": "string"
                                      },
                                      "name": {
                                        "type": "string"
                                      }
                                    },
                                    "required": [
                                      "id",
                                      "name"
                                    ],
                                    "additionalProperties": false
                                  },
                                  "recordedAt": {
                                    "type": "string",
                                    "minLength": 20
                                  }
                                },
                                "required": [
                                  "basis",
                                  "givenOn",
                                  "recordedBy",
                                  "recordedAt"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "null"
                              }
                            ]
                          }
                        },
                        "required": [
                          "notice",
                          "consent"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "email": {
                      "$ref": "#/components/schemas/Email2"
                    },
                    "entityTimeZone": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "id",
                    "reference",
                    "state",
                    "language",
                    "kind",
                    "taxYear",
                    "reportTypeCode",
                    "file",
                    "entity",
                    "vendor",
                    "recipientType",
                    "producedBy",
                    "producedAt",
                    "documentSha256",
                    "boxes",
                    "recipient",
                    "posted",
                    "deliveries",
                    "email",
                    "entityTimeZone"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "404": {
            "$ref": "#/components/responses/Problem404"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      }
    },
    "/v1/slips/files": {
      "get": {
        "operationId": "listSlipFiles",
        "summary": "Lists the slip files produced, with the server's total.",
        "description": "Lists the slip files produced, with the server's total. Needs the `ledger:read` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "purchases"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:read",
        "parameters": [
          {
            "name": "entityId",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "kind",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "T4A",
                "T5018"
              ]
            }
          },
          {
            "name": "periodEnd",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "default": 50,
              "type": "integer",
              "minimum": 1,
              "maximum": 200
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 512
            }
          },
          {
            "name": "origin",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "ALL",
                "NATIVE",
                "IMPORTED"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "kind": {
                            "type": "string",
                            "enum": [
                              "T4A",
                              "T5018"
                            ]
                          },
                          "periodEnd": {
                            "type": "string",
                            "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                          },
                          "taxYear": {
                            "type": "integer",
                            "minimum": -9007199254740991,
                            "maximum": 9007199254740991
                          },
                          "slipCount": {
                            "type": "integer",
                            "minimum": -9007199254740991,
                            "maximum": 9007199254740991
                          },
                          "totalMinor": {
                            "type": "string"
                          },
                          "sha256": {
                            "type": "string"
                          },
                          "fileName": {
                            "type": "string"
                          },
                          "producedBy": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string"
                              },
                              "name": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "id",
                              "name"
                            ],
                            "additionalProperties": false
                          },
                          "producedAt": {
                            "type": "string",
                            "minLength": 20
                          },
                          "amends": {
                            "$ref": "#/components/schemas/LatestFile"
                          },
                          "recipientsKept": {
                            "type": "boolean"
                          },
                          "copies": {
                            "type": "object",
                            "properties": {
                              "produced": {
                                "type": "integer",
                                "minimum": 0,
                                "maximum": 9007199254740991
                              },
                              "delivered": {
                                "type": "integer",
                                "minimum": 0,
                                "maximum": 9007199254740991
                              },
                              "total": {
                                "type": "integer",
                                "minimum": 0,
                                "maximum": 9007199254740991
                              }
                            },
                            "required": [
                              "produced",
                              "delivered",
                              "total"
                            ],
                            "additionalProperties": false
                          }
                        },
                        "required": [
                          "id",
                          "kind",
                          "periodEnd",
                          "taxYear",
                          "slipCount",
                          "totalMinor",
                          "sha256",
                          "fileName",
                          "producedBy",
                          "producedAt",
                          "amends",
                          "recipientsKept",
                          "copies"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "nextCursor": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "total": {
                      "anyOf": [
                        {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "imported": {
                      "$ref": "#/components/schemas/Imported"
                    },
                    "totals": {
                      "$ref": "#/components/schemas/Totals"
                    },
                    "origin": {
                      "type": "string",
                      "enum": [
                        "ALL",
                        "NATIVE",
                        "IMPORTED"
                      ]
                    },
                    "zone": {
                      "type": [
                        "string",
                        "null"
                      ]
                    }
                  },
                  "required": [
                    "data",
                    "nextCursor",
                    "total",
                    "imported",
                    "totals",
                    "origin",
                    "zone"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "422": {
            "$ref": "#/components/responses/Problem422"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      }
    },
    "/v1/slips/files/{fileId}/copies": {
      "get": {
        "operationId": "listSlipCopies",
        "summary": "Lists the copies of a slip file, with the server's total.",
        "description": "Lists the copies of a slip file, with the server's total. Needs the `ledger:read` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "purchases"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:read",
        "parameters": [
          {
            "name": "fileId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "default": 50,
              "type": "integer",
              "minimum": 1,
              "maximum": 200
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 512
            }
          },
          {
            "name": "state",
            "in": "query",
            "required": false,
            "description": "One or more of NOT_PRODUCED, PRODUCED, DRAFTED, BOUNCED, EMAILED, POSTED, separated by commas.",
            "schema": {
              "type": "string",
              "description": "One or more of NOT_PRODUCED, PRODUCED, DRAFTED, BOUNCED, EMAILED, POSTED, separated by commas."
            }
          },
          {
            "name": "needs",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "EMAIL",
                "PAPER"
              ]
            }
          },
          {
            "name": "q",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 100
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "recipientId": {
                            "type": "string"
                          },
                          "position": {
                            "type": "integer",
                            "minimum": 0,
                            "maximum": 9007199254740991
                          },
                          "vendor": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string"
                              },
                              "displayName": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "id",
                              "displayName"
                            ],
                            "additionalProperties": false
                          },
                          "recipientType": {
                            "anyOf": [
                              {
                                "type": "string",
                                "enum": [
                                  "INDIVIDUAL",
                                  "CORPORATION",
                                  "PARTNERSHIP"
                                ]
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "boxMinor": {
                            "type": "string",
                            "pattern": "^-?\\d+$"
                          },
                          "copy": {
                            "anyOf": [
                              {
                                "type": "object",
                                "properties": {
                                  "id": {
                                    "type": "string"
                                  },
                                  "reference": {
                                    "type": "string"
                                  },
                                  "state": {
                                    "type": "string",
                                    "enum": [
                                      "NOT_PRODUCED",
                                      "PRODUCED",
                                      "DRAFTED",
                                      "BOUNCED",
                                      "EMAILED",
                                      "POSTED"
                                    ]
                                  },
                                  "language": {
                                    "type": "string",
                                    "enum": [
                                      "en",
                                      "fr",
                                      "bilingual"
                                    ]
                                  },
                                  "producedBy": {
                                    "type": "object",
                                    "properties": {
                                      "id": {
                                        "type": "string"
                                      },
                                      "name": {
                                        "type": "string"
                                      }
                                    },
                                    "required": [
                                      "id",
                                      "name"
                                    ],
                                    "additionalProperties": false
                                  },
                                  "producedAt": {
                                    "type": "string",
                                    "minLength": 20
                                  },
                                  "mailedOn": {
                                    "anyOf": [
                                      {
                                        "type": "string",
                                        "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                                      },
                                      {
                                        "type": "null"
                                      }
                                    ]
                                  },
                                  "mailedBy": {
                                    "anyOf": [
                                      {
                                        "type": "object",
                                        "properties": {
                                          "id": {
                                            "type": "string"
                                          },
                                          "name": {
                                            "type": "string"
                                          }
                                        },
                                        "required": [
                                          "id",
                                          "name"
                                        ],
                                        "additionalProperties": false
                                      },
                                      {
                                        "type": "null"
                                      }
                                    ]
                                  },
                                  "documentSha256": {
                                    "type": "string",
                                    "minLength": 64,
                                    "maxLength": 64
                                  }
                                },
                                "required": [
                                  "id",
                                  "reference",
                                  "state",
                                  "language",
                                  "producedBy",
                                  "producedAt",
                                  "mailedOn",
                                  "mailedBy",
                                  "documentSha256"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "email": {
                            "$ref": "#/components/schemas/Email2"
                          },
                          "entityTimeZone": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "recipientId",
                          "position",
                          "vendor",
                          "recipientType",
                          "boxMinor",
                          "copy",
                          "email",
                          "entityTimeZone"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "nextCursor": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "total": {
                      "anyOf": [
                        {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "file": {
                      "$ref": "#/components/schemas/LatestFileOption1"
                    },
                    "required": {
                      "type": "boolean"
                    },
                    "outboundApproved": {
                      "type": "boolean"
                    },
                    "emailPreview": {
                      "anyOf": [
                        {
                          "type": "object",
                          "properties": {
                            "subject": {
                              "type": "string"
                            },
                            "text": {
                              "type": "string"
                            },
                            "replyTo": {
                              "anyOf": [
                                {
                                  "type": "object",
                                  "properties": {
                                    "name": {
                                      "type": "string"
                                    },
                                    "telephone": {
                                      "type": "string"
                                    }
                                  },
                                  "required": [
                                    "name",
                                    "telephone"
                                  ],
                                  "additionalProperties": false
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            }
                          },
                          "required": [
                            "subject",
                            "text",
                            "replyTo"
                          ],
                          "additionalProperties": false
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "counts": {
                      "type": "object",
                      "properties": {
                        "total": {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991
                        },
                        "notProduced": {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991
                        },
                        "produced": {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991
                        },
                        "drafted": {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991
                        },
                        "emailed": {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991
                        },
                        "bounced": {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991
                        },
                        "posted": {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991
                        },
                        "needsEmail": {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991
                        },
                        "needsPaper": {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991
                        },
                        "documentsUnstored": {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991
                        }
                      },
                      "required": [
                        "total",
                        "notProduced",
                        "produced",
                        "drafted",
                        "emailed",
                        "bounced",
                        "posted",
                        "needsEmail",
                        "needsPaper",
                        "documentsUnstored"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "data",
                    "nextCursor",
                    "total",
                    "file",
                    "required",
                    "outboundApproved",
                    "emailPreview",
                    "counts"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "404": {
            "$ref": "#/components/responses/Problem404"
          },
          "422": {
            "$ref": "#/components/responses/Problem422"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      },
      "post": {
        "operationId": "produceSlipCopies",
        "summary": "Produces the copies of a slip file for the recipients.",
        "description": "Produces the copies of a slip file for the recipients. Needs the `ledger:propose` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "purchases"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:propose",
        "parameters": [
          {
            "name": "fileId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "limit": {
                    "default": 100,
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 100
                  }
                },
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "Ledger-Position": {
                "$ref": "#/components/headers/LedgerPosition"
              },
              "Location": {
                "$ref": "#/components/headers/Location"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "produced": {
                      "type": "integer",
                      "minimum": 0,
                      "maximum": 9007199254740991
                    },
                    "remaining": {
                      "type": "integer",
                      "minimum": 0,
                      "maximum": 9007199254740991
                    },
                    "alreadyProduced": {
                      "type": "integer",
                      "minimum": 0,
                      "maximum": 9007199254740991
                    }
                  },
                  "required": [
                    "produced",
                    "remaining",
                    "alreadyProduced"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem400"
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "404": {
            "$ref": "#/components/responses/Problem404"
          },
          "409": {
            "$ref": "#/components/responses/Problem409"
          },
          "412": {
            "$ref": "#/components/responses/Problem412"
          },
          "422": {
            "$ref": "#/components/responses/Problem422"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      }
    },
    "/v1/slips/files/{fileId}/copies/mailed": {
      "post": {
        "operationId": "recordSlipCopiesMailed",
        "summary": "Records that copies of a slip file were mailed.",
        "description": "Records that copies of a slip file were mailed. Needs the `ledger:propose` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "purchases"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:propose",
        "parameters": [
          {
            "name": "fileId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "anyOf": [
                  {
                    "type": "object",
                    "properties": {
                      "copyIds": {
                        "minItems": 1,
                        "maxItems": 200,
                        "type": "array",
                        "items": {
                          "type": "string",
                          "minLength": 1
                        }
                      },
                      "mailedOn": {
                        "type": "string",
                        "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                      },
                      "note": {
                        "type": "string",
                        "maxLength": 500
                      }
                    },
                    "required": [
                      "copyIds",
                      "mailedOn"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "all": {
                        "type": "boolean",
                        "const": true
                      },
                      "expectedCount": {
                        "type": "integer",
                        "minimum": 1,
                        "maximum": 500
                      },
                      "mailedOn": {
                        "type": "string",
                        "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                      },
                      "note": {
                        "type": "string",
                        "maxLength": 500
                      }
                    },
                    "required": [
                      "all",
                      "expectedCount",
                      "mailedOn"
                    ],
                    "additionalProperties": false
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "Ledger-Position": {
                "$ref": "#/components/headers/LedgerPosition"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "posted": {
                      "type": "integer",
                      "minimum": 0,
                      "maximum": 9007199254740991
                    }
                  },
                  "required": [
                    "posted"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem400"
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "404": {
            "$ref": "#/components/responses/Problem404"
          },
          "409": {
            "$ref": "#/components/responses/Problem409"
          },
          "412": {
            "$ref": "#/components/responses/Problem412"
          },
          "422": {
            "$ref": "#/components/responses/Problem422"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      }
    },
    "/v1/slips/files/{fileId}/copy-notices": {
      "post": {
        "operationId": "draftSlipCopyNotices",
        "summary": "Drafts the notices that go with the copies of a slip file.",
        "description": "Drafts the notices that go with the copies of a slip file. Needs the `ledger:propose` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "purchases"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:propose",
        "parameters": [
          {
            "name": "fileId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "limit": {
                    "default": 100,
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 100
                  }
                },
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "Ledger-Position": {
                "$ref": "#/components/headers/LedgerPosition"
              },
              "Location": {
                "$ref": "#/components/headers/Location"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "drafted": {
                      "type": "integer",
                      "minimum": 0,
                      "maximum": 9007199254740991
                    },
                    "noticeIds": {
                      "maxItems": 100,
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "remaining": {
                      "type": "integer",
                      "minimum": 0,
                      "maximum": 9007199254740991
                    },
                    "skipped": {
                      "type": "object",
                      "properties": {
                        "noConsent": {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991
                        },
                        "consentWithdrawn": {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991
                        },
                        "addressChanged": {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991
                        },
                        "noEmail": {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991
                        },
                        "alreadyTold": {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991
                        },
                        "draftOpen": {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991
                        }
                      },
                      "required": [
                        "noConsent",
                        "consentWithdrawn",
                        "addressChanged",
                        "noEmail",
                        "alreadyTold",
                        "draftOpen"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "drafted",
                    "noticeIds",
                    "remaining",
                    "skipped"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem400"
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "404": {
            "$ref": "#/components/responses/Problem404"
          },
          "409": {
            "$ref": "#/components/responses/Problem409"
          },
          "412": {
            "$ref": "#/components/responses/Problem412"
          },
          "422": {
            "$ref": "#/components/responses/Problem422"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      }
    },
    "/v1/slips/non-resident": {
      "get": {
        "operationId": "getNonResidentSlipRegister",
        "summary": "Returns the register of slips for non-resident vendors.",
        "description": "Returns the register of slips for non-resident vendors. Needs the `ledger:read` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "purchases"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:read",
        "parameters": [
          {
            "name": "entityId",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "periodEnd",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "default": 50,
              "type": "integer",
              "minimum": 1,
              "maximum": 200
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 512
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "entity": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "name": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "id",
                        "name"
                      ],
                      "additionalProperties": false
                    },
                    "periodStart": {
                      "type": "string",
                      "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                    },
                    "periodEnd": {
                      "type": "string",
                      "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                    },
                    "dueDate": {
                      "type": "string",
                      "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                    },
                    "currency": {
                      "type": "string",
                      "const": "CAD"
                    },
                    "rows": {
                      "type": "object",
                      "properties": {
                        "data": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "vendor": {
                                "$ref": "#/components/schemas/Vendor3"
                              },
                              "recipientType": {
                                "anyOf": [
                                  {
                                    "type": "string",
                                    "enum": [
                                      "INDIVIDUAL",
                                      "CORPORATION",
                                      "PARTNERSHIP"
                                    ]
                                  },
                                  {
                                    "type": "null"
                                  }
                                ]
                              },
                              "country": {
                                "type": "string"
                              },
                              "grossFeesMinor": {
                                "type": "string",
                                "pattern": "^-?\\d+$"
                              },
                              "withheldMinor": {
                                "type": "string",
                                "pattern": "^-?\\d+$"
                              },
                              "waivedFeesMinor": {
                                "type": "string",
                                "pattern": "^-?\\d+$"
                              },
                              "paymentCount": {
                                "type": "integer",
                                "minimum": -9007199254740991,
                                "maximum": 9007199254740991
                              },
                              "firstPaidOn": {
                                "type": "string",
                                "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                              },
                              "lastPaidOn": {
                                "type": "string",
                                "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                              },
                              "flagged": {
                                "type": "boolean"
                              },
                              "blocking": {
                                "type": "array",
                                "items": {
                                  "type": "string"
                                }
                              },
                              "caveats": {
                                "type": "array",
                                "items": {
                                  "type": "string"
                                }
                              },
                              "included": {
                                "type": "boolean"
                              }
                            },
                            "required": [
                              "vendor",
                              "recipientType",
                              "country",
                              "grossFeesMinor",
                              "withheldMinor",
                              "waivedFeesMinor",
                              "paymentCount",
                              "firstPaidOn",
                              "lastPaidOn",
                              "flagged",
                              "blocking",
                              "caveats",
                              "included"
                            ],
                            "additionalProperties": false
                          }
                        },
                        "nextCursor": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "total": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "minimum": -9007199254740991,
                              "maximum": 9007199254740991
                            },
                            {
                              "type": "null"
                            }
                          ]
                        }
                      },
                      "required": [
                        "data",
                        "nextCursor",
                        "total"
                      ],
                      "additionalProperties": false
                    },
                    "totals": {
                      "type": "object",
                      "properties": {
                        "grossFeesMinor": {
                          "type": "string",
                          "pattern": "^-?\\d+$"
                        },
                        "withheldMinor": {
                          "type": "string",
                          "pattern": "^-?\\d+$"
                        },
                        "included": {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991
                        },
                        "blocked": {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991
                        }
                      },
                      "required": [
                        "grossFeesMinor",
                        "withheldMinor",
                        "included",
                        "blocked"
                      ],
                      "additionalProperties": false
                    },
                    "unpaidFlagged": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    "reversedPayments": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    "entityTimeZone": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "entity",
                    "periodStart",
                    "periodEnd",
                    "dueDate",
                    "currency",
                    "rows",
                    "totals",
                    "unpaidFlagged",
                    "reversedPayments",
                    "entityTimeZone"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "422": {
            "$ref": "#/components/responses/Problem422"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      }
    },
    "/v1/slips/register": {
      "get": {
        "operationId": "getSlipRegister",
        "summary": "Returns the register of slips the company must file.",
        "description": "Returns the register of slips the company must file. Needs the `ledger:read` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "purchases"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:read",
        "parameters": [
          {
            "name": "entityId",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "kind",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "T4A",
                "T5018"
              ]
            }
          },
          {
            "name": "periodEnd",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "default": 50,
              "type": "integer",
              "minimum": 1,
              "maximum": 200
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 512
            }
          },
          {
            "name": "readiness",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "NEEDS_DETAILS"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "entity": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "name": {
                          "type": "string"
                        },
                        "fiscalYearEndMonth": {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991
                        }
                      },
                      "required": [
                        "id",
                        "name",
                        "fiscalYearEndMonth"
                      ],
                      "additionalProperties": false
                    },
                    "kind": {
                      "type": "string",
                      "enum": [
                        "T4A",
                        "T5018"
                      ]
                    },
                    "periodStart": {
                      "type": "string",
                      "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                    },
                    "periodEnd": {
                      "type": "string",
                      "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                    },
                    "taxYear": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    "dueDate": {
                      "type": "string",
                      "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                    },
                    "filer": {
                      "type": "object",
                      "properties": {
                        "complete": {
                          "type": "boolean"
                        },
                        "missing": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        }
                      },
                      "required": [
                        "complete",
                        "missing"
                      ],
                      "additionalProperties": false
                    },
                    "rows": {
                      "type": "object",
                      "properties": {
                        "data": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "vendor": {
                                "$ref": "#/components/schemas/Vendor3"
                              },
                              "recipientType": {
                                "anyOf": [
                                  {
                                    "type": "string",
                                    "enum": [
                                      "INDIVIDUAL",
                                      "CORPORATION",
                                      "PARTNERSHIP"
                                    ]
                                  },
                                  {
                                    "type": "null"
                                  }
                                ]
                              },
                              "paidMinor": {
                                "type": "string"
                              },
                              "taxMinor": {
                                "type": "string"
                              },
                              "unsplitMinor": {
                                "type": "string"
                              },
                              "boxMinor": {
                                "type": "string"
                              },
                              "paymentCount": {
                                "type": "integer",
                                "minimum": -9007199254740991,
                                "maximum": 9007199254740991
                              },
                              "methods": {
                                "type": "array",
                                "items": {
                                  "type": "object",
                                  "properties": {
                                    "method": {
                                      "type": "string",
                                      "enum": [
                                        "RUN",
                                        "CARD",
                                        "PAD",
                                        "ACCOUNT",
                                        "CHEQUE",
                                        "WIRE",
                                        "ETRANSFER",
                                        "OTHER"
                                      ]
                                    },
                                    "count": {
                                      "type": "integer",
                                      "minimum": -9007199254740991,
                                      "maximum": 9007199254740991
                                    },
                                    "paidMinor": {
                                      "type": "string",
                                      "pattern": "^-?\\d+$"
                                    }
                                  },
                                  "required": [
                                    "method",
                                    "count",
                                    "paidMinor"
                                  ],
                                  "additionalProperties": false
                                }
                              },
                              "overThreshold": {
                                "type": "boolean"
                              },
                              "blocking": {
                                "type": "array",
                                "items": {
                                  "type": "string"
                                }
                              },
                              "caveats": {
                                "type": "array",
                                "items": {
                                  "type": "string"
                                }
                              },
                              "included": {
                                "type": "boolean"
                              },
                              "measuredMinor": {
                                "type": "string"
                              },
                              "projectedMinor": {
                                "type": "string"
                              },
                              "gapCodes": {
                                "type": "array",
                                "items": {
                                  "type": "string",
                                  "enum": [
                                    "RECIPIENT_TYPE",
                                    "SURNAME",
                                    "LEGAL_NAME",
                                    "BUSINESS_NUMBER",
                                    "PROVINCE",
                                    "COUNTRY"
                                  ]
                                }
                              },
                              "addressIncomplete": {
                                "type": "boolean"
                              },
                              "readiness": {
                                "type": "string",
                                "enum": [
                                  "NEEDS_DETAILS",
                                  "GAPS_UNDER_THRESHOLD",
                                  "READY"
                                ]
                              }
                            },
                            "required": [
                              "vendor",
                              "recipientType",
                              "paidMinor",
                              "taxMinor",
                              "unsplitMinor",
                              "boxMinor",
                              "paymentCount",
                              "methods",
                              "overThreshold",
                              "blocking",
                              "caveats",
                              "included",
                              "measuredMinor",
                              "projectedMinor",
                              "gapCodes",
                              "addressIncomplete",
                              "readiness"
                            ],
                            "additionalProperties": false
                          }
                        },
                        "nextCursor": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "total": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "minimum": -9007199254740991,
                              "maximum": 9007199254740991
                            },
                            {
                              "type": "null"
                            }
                          ]
                        }
                      },
                      "required": [
                        "data",
                        "nextCursor",
                        "total"
                      ],
                      "additionalProperties": false
                    },
                    "totals": {
                      "type": "object",
                      "properties": {
                        "paidMinor": {
                          "type": "string"
                        },
                        "boxMinor": {
                          "type": "string"
                        },
                        "included": {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991
                        },
                        "underThreshold": {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991
                        },
                        "blocked": {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991
                        }
                      },
                      "required": [
                        "paidMinor",
                        "boxMinor",
                        "included",
                        "underThreshold",
                        "blocked"
                      ],
                      "additionalProperties": false
                    },
                    "filesProduced": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    "latestFile": {
                      "$ref": "#/components/schemas/LatestFile"
                    },
                    "unpaidFlagged": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    "reversedPayments": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    "voidedSettlements": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    "window": {
                      "type": "object",
                      "properties": {
                        "state": {
                          "type": "string",
                          "enum": [
                            "BEFORE",
                            "OPEN",
                            "FILING",
                            "PAST"
                          ]
                        },
                        "opensOn": {
                          "type": "string",
                          "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                        },
                        "dueDate": {
                          "type": "string",
                          "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                        }
                      },
                      "required": [
                        "state",
                        "opensOn",
                        "dueDate"
                      ],
                      "additionalProperties": false
                    },
                    "today": {
                      "type": "string",
                      "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                    },
                    "periodVendors": {
                      "type": "integer",
                      "minimum": 0,
                      "maximum": 9007199254740991
                    },
                    "readiness": {
                      "type": "object",
                      "properties": {
                        "needsDetails": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 9007199254740991
                        },
                        "gapsUnderThreshold": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 9007199254740991
                        },
                        "projectedOver": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 9007199254740991
                        },
                        "openSignals": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 9007199254740991
                        }
                      },
                      "required": [
                        "needsDetails",
                        "gapsUnderThreshold",
                        "projectedOver",
                        "openSignals"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "entity",
                    "kind",
                    "periodStart",
                    "periodEnd",
                    "taxYear",
                    "dueDate",
                    "filer",
                    "rows",
                    "totals",
                    "filesProduced",
                    "latestFile",
                    "unpaidFlagged",
                    "reversedPayments",
                    "voidedSettlements",
                    "window",
                    "today",
                    "periodVendors",
                    "readiness"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "422": {
            "$ref": "#/components/responses/Problem422"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      }
    },
    "/v1/vendor-agreements/deadlines": {
      "get": {
        "operationId": "listVendorAgreementDeadlines",
        "summary": "Lists the deadlines of vendor agreements.",
        "description": "Lists the deadlines of vendor agreements. Needs the `ledger:read` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "purchases"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:read",
        "parameters": [
          {
            "name": "from",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
            }
          },
          {
            "name": "to",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
            }
          },
          {
            "name": "entityId",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "default": 50,
              "type": "integer",
              "minimum": 1,
              "maximum": 200
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 512
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "agreementId": {
                            "type": "string"
                          },
                          "vendor": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string"
                              },
                              "displayName": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "id",
                              "displayName"
                            ],
                            "additionalProperties": false
                          },
                          "entity": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string"
                              },
                              "name": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "id",
                              "name"
                            ],
                            "additionalProperties": false
                          },
                          "name": {
                            "type": "string"
                          },
                          "kind": {
                            "type": "string",
                            "enum": [
                              "ACT_BY",
                              "ENDS"
                            ]
                          },
                          "date": {
                            "type": "string",
                            "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                          },
                          "daysUntil": {
                            "type": "integer",
                            "minimum": -9007199254740991,
                            "maximum": 9007199254740991
                          },
                          "status": {
                            "type": "string",
                            "enum": [
                              "OVERDUE",
                              "DUE_SOON",
                              "UPCOMING",
                              "DONE"
                            ]
                          },
                          "owner": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string"
                              },
                              "name": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "id",
                              "name"
                            ],
                            "additionalProperties": false
                          },
                          "decision": {
                            "anyOf": [
                              {
                                "type": "string",
                                "enum": [
                                  "RENEW",
                                  "LET_END"
                                ]
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "timeZone": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "agreementId",
                          "vendor",
                          "entity",
                          "name",
                          "kind",
                          "date",
                          "daysUntil",
                          "status",
                          "owner",
                          "decision",
                          "timeZone"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "nextCursor": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "total": {
                      "anyOf": [
                        {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  },
                  "required": [
                    "data",
                    "nextCursor",
                    "total"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "422": {
            "$ref": "#/components/responses/Problem422"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      }
    },
    "/v1/vendor-credits": {
      "get": {
        "operationId": "listVendorCredits",
        "summary": "Lists the vendor credits, with the server's total.",
        "description": "Lists the vendor credits, with the server's total. Needs the `ledger:read` permission. Stable: a change that breaks callers needs 365 days' notice.",
        "tags": [
          "purchases"
        ],
        "x-stability-level": "stable",
        "x-scope": "ledger:read",
        "parameters": [
          {
            "name": "entityId",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "vendorId",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "DRAFT",
                "IN_REVIEW",
                "APPROVED",
                "APPLIED",
                "VOID"
              ]
            }
          },
          {
            "name": "open",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "only"
              ]
            }
          },
          {
            "name": "currency",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^[A-Z]{3}$"
            }
          },
          {
            "name": "q",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 100
            }
          },
          {
            "name": "from",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
            }
          },
          {
            "name": "to",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
            }
          },
          {
            "name": "sort",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 64
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "default": 50,
              "type": "integer",
              "minimum": 1,
              "maximum": 200
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 512
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "number": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "status": {
                            "type": "string",
                            "enum": [
                              "DRAFT",
                              "IN_REVIEW",
                              "APPROVED",
                              "APPLIED",
                              "VOID"
                            ]
                          },
                          "entityId": {
                            "type": "string"
                          },
                          "entityName": {
                            "type": "string"
                          },
                          "vendorId": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "vendorName": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "supplierName": {
                            "type": "string"
                          },
                          "creditDate": {
                            "type": "string",
                            "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                          },
                          "postingDate": {
                            "anyOf": [
                              {
                                "type": "string",
                                "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "currency": {
                            "type": "string",
                            "pattern": "^[A-Z]{3}$"
                          },
                          "totalMinor": {
                            "type": "string",
                            "pattern": "^-?\\d+$"
                          },
                          "remainingMinor": {
                            "type": "string",
                            "pattern": "^-?\\d+$"
                          },
                          "adjustsBill": {
                            "anyOf": [
                              {
                                "type": "object",
                                "properties": {
                                  "id": {
                                    "type": "string"
                                  },
                                  "number": {
                                    "type": [
                                      "string",
                                      "null"
                                    ]
                                  }
                                },
                                "required": [
                                  "id",
                                  "number"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "source": {
                            "type": "string",
                            "enum": [
                              "INBOX_DOCUMENT",
                              "MANUAL",
                              "IMPORT"
                            ]
                          },
                          "actorType": {
                            "type": "string",
                            "enum": [
                              "USER",
                              "AGENT"
                            ]
                          }
                        },
                        "required": [
                          "id",
                          "number",
                          "status",
                          "entityId",
                          "entityName",
                          "vendorId",
                          "vendorName",
                          "supplierName",
                          "creditDate",
                          "postingDate",
                          "currency",
                          "totalMinor",
                          "remainingMinor",
                          "adjustsBill",
                          "source",
                          "actorType"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "nextCursor": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "total": {
                      "anyOf": [
                        {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  },
                  "required": [
                    "data",
                    "nextCursor",
                    "total"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "422": {
            "$ref": "#/components/responses/Problem422"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      },
      "post": {
        "operationId": "createVendorCredit",
        "summary": "Creates a draft vendor credit from a vendor.",
        "description": "Creates a draft vendor credit from a vendor. Needs the `ledger:propose` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "purchases"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:propose",
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "entityId": {
                    "type": "string",
                    "minLength": 1
                  },
                  "vendorId": {
                    "anyOf": [
                      {
                        "type": "string",
                        "minLength": 1
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "number": {
                    "anyOf": [
                      {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 60
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "creditDate": {
                    "type": "string",
                    "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                  },
                  "currency": {
                    "type": "string",
                    "pattern": "^[A-Z]{3}$"
                  },
                  "reason": {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 500
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "memo": {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 500
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "payableAccountId": {
                    "anyOf": [
                      {
                        "type": "string",
                        "minLength": 1
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "adjustsBillId": {
                    "anyOf": [
                      {
                        "type": "string",
                        "minLength": 1
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "deliveryRegion": {
                    "anyOf": [
                      {
                        "type": "string",
                        "pattern": "^(CA|US)-[A-Z]{2}$"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "documentId": {
                    "anyOf": [
                      {
                        "type": "string",
                        "minLength": 1
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "lines": {
                    "$ref": "#/components/schemas/Lines8"
                  }
                },
                "required": [
                  "entityId",
                  "creditDate",
                  "currency",
                  "lines"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "Ledger-Position": {
                "$ref": "#/components/headers/LedgerPosition"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CreateVendorCreditResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem400"
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "409": {
            "$ref": "#/components/responses/Problem409"
          },
          "412": {
            "$ref": "#/components/responses/Problem412"
          },
          "422": {
            "$ref": "#/components/responses/Problem422"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      }
    },
    "/v1/vendor-credits/applications": {
      "get": {
        "operationId": "listVendorCreditApplications",
        "summary": "Lists the applications of vendor credits against bills.",
        "description": "Lists the applications of vendor credits against bills. Needs the `ledger:read` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "purchases"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:read",
        "parameters": [
          {
            "name": "billId",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "vendorCreditId",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "default": 50,
              "type": "integer",
              "minimum": 1,
              "maximum": 200
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 512
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "vendorCreditId": {
                            "type": "string"
                          },
                          "vendorCreditNumber": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "billId": {
                            "type": "string"
                          },
                          "billNumber": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "billDate": {
                            "type": "string",
                            "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                          },
                          "amountMinor": {
                            "type": "string",
                            "pattern": "^-?\\d+$"
                          },
                          "currency": {
                            "type": "string",
                            "pattern": "^[A-Z]{3}$"
                          },
                          "appliedOn": {
                            "type": "string",
                            "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                          },
                          "state": {
                            "type": "string",
                            "enum": [
                              "LIVE",
                              "IN_DRAFT_RUN",
                              "WITH_PAYMENT",
                              "LAPSED",
                              "UNAPPLIED"
                            ]
                          },
                          "run": {
                            "anyOf": [
                              {
                                "type": "object",
                                "properties": {
                                  "id": {
                                    "type": "string"
                                  },
                                  "number": {
                                    "type": "string"
                                  }
                                },
                                "required": [
                                  "id",
                                  "number"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "applied": {
                            "type": "object",
                            "properties": {
                              "byName": {
                                "type": "string"
                              },
                              "at": {
                                "type": "string",
                                "minLength": 20
                              }
                            },
                            "required": [
                              "byName",
                              "at"
                            ],
                            "additionalProperties": false
                          },
                          "voided": {
                            "$ref": "#/components/schemas/Retired2"
                          },
                          "proposed": {
                            "type": "boolean"
                          }
                        },
                        "required": [
                          "id",
                          "vendorCreditId",
                          "vendorCreditNumber",
                          "billId",
                          "billNumber",
                          "billDate",
                          "amountMinor",
                          "currency",
                          "appliedOn",
                          "state",
                          "run",
                          "applied",
                          "voided",
                          "proposed"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "nextCursor": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "total": {
                      "anyOf": [
                        {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  },
                  "required": [
                    "data",
                    "nextCursor",
                    "total"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "422": {
            "$ref": "#/components/responses/Problem422"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      }
    },
    "/v1/vendor-credits/{vendorCreditId}": {
      "get": {
        "operationId": "getVendorCredit",
        "summary": "Returns one vendor credit with its lines and status.",
        "description": "Returns one vendor credit with its lines and status. Needs the `ledger:read` permission. Stable: a change that breaks callers needs 365 days' notice.",
        "tags": [
          "purchases"
        ],
        "x-stability-level": "stable",
        "x-scope": "ledger:read",
        "parameters": [
          {
            "name": "vendorCreditId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "number": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "status": {
                      "type": "string",
                      "enum": [
                        "DRAFT",
                        "IN_REVIEW",
                        "APPROVED",
                        "APPLIED",
                        "VOID"
                      ]
                    },
                    "entityId": {
                      "type": "string"
                    },
                    "entityName": {
                      "type": "string"
                    },
                    "vendorId": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "vendorName": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "supplierName": {
                      "type": "string"
                    },
                    "creditDate": {
                      "type": "string",
                      "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                    },
                    "postingDate": {
                      "anyOf": [
                        {
                          "type": "string",
                          "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "currency": {
                      "type": "string",
                      "pattern": "^[A-Z]{3}$"
                    },
                    "totalMinor": {
                      "type": "string",
                      "pattern": "^-?\\d+$"
                    },
                    "remainingMinor": {
                      "type": "string",
                      "pattern": "^-?\\d+$"
                    },
                    "adjustsBill": {
                      "anyOf": [
                        {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "string"
                            },
                            "number": {
                              "type": [
                                "string",
                                "null"
                              ]
                            }
                          },
                          "required": [
                            "id",
                            "number"
                          ],
                          "additionalProperties": false
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "source": {
                      "type": "string",
                      "enum": [
                        "INBOX_DOCUMENT",
                        "MANUAL",
                        "IMPORT"
                      ]
                    },
                    "actorType": {
                      "type": "string",
                      "enum": [
                        "USER",
                        "AGENT"
                      ]
                    },
                    "appliedMinor": {
                      "type": "string",
                      "pattern": "^-?\\d+$"
                    },
                    "refundedMinor": {
                      "type": "string",
                      "pattern": "^-?\\d+$"
                    },
                    "subtotalMinor": {
                      "type": "string",
                      "pattern": "^-?\\d+$"
                    },
                    "taxMinor": {
                      "type": "string",
                      "pattern": "^-?\\d+$"
                    },
                    "reason": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "memo": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "payableAccount": {
                      "$ref": "#/components/schemas/Account"
                    },
                    "lines": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "position": {
                            "type": "integer",
                            "minimum": 0,
                            "maximum": 9007199254740991
                          },
                          "description": {
                            "type": "string"
                          },
                          "account": {
                            "$ref": "#/components/schemas/Account"
                          },
                          "quantity": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "unitPriceMinor": {
                            "anyOf": [
                              {
                                "type": "string",
                                "pattern": "^-?\\d+$"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "amountMinor": {
                            "type": "string",
                            "pattern": "^-?\\d+$"
                          },
                          "taxAsPrintedMinor": {
                            "anyOf": [
                              {
                                "type": "string",
                                "pattern": "^-?\\d+$"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "supplyCategory": {
                            "anyOf": [
                              {
                                "type": "string",
                                "enum": [
                                  "GOODS",
                                  "SERVICES",
                                  "INTANGIBLE_PROPERTY",
                                  "REAL_PROPERTY"
                                ]
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "taxAmountMinor": {
                            "anyOf": [
                              {
                                "type": "string",
                                "pattern": "^-?\\d+$"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "taxProvincialAmountMinor": {
                            "anyOf": [
                              {
                                "type": "string",
                                "pattern": "^-?\\d+$"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "dimensions": {
                            "$ref": "#/components/schemas/Dimensions"
                          },
                          "servicePeriodStart": {
                            "anyOf": [
                              {
                                "type": "string",
                                "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "servicePeriodEnd": {
                            "anyOf": [
                              {
                                "type": "string",
                                "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "purchaseOrderLine": {
                            "$ref": "#/components/schemas/PurchaseOrderLine"
                          },
                          "customFields": {
                            "description": "The line's own fields, by the field's key.",
                            "type": "object",
                            "propertyNames": {
                              "type": "string"
                            },
                            "additionalProperties": {
                              "type": [
                                "string",
                                "boolean"
                              ]
                            },
                            "x-stability-level": "beta"
                          },
                          "carriedFrom": {
                            "$ref": "#/components/schemas/CarriedFrom"
                          },
                          "adjustsBillLineId": {
                            "type": [
                              "string",
                              "null"
                            ]
                          }
                        },
                        "required": [
                          "id",
                          "position",
                          "description",
                          "account",
                          "quantity",
                          "unitPriceMinor",
                          "amountMinor",
                          "taxAsPrintedMinor",
                          "supplyCategory",
                          "taxAmountMinor",
                          "taxProvincialAmountMinor",
                          "dimensions",
                          "servicePeriodStart",
                          "servicePeriodEnd",
                          "purchaseOrderLine",
                          "adjustsBillLineId"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "findings": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/FindingsItem"
                      }
                    },
                    "deliveryRegion": {
                      "anyOf": [
                        {
                          "type": "string",
                          "pattern": "^(CA|US)-[A-Z]{2}$"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "drafted": {
                      "type": "object",
                      "properties": {
                        "byName": {
                          "type": "string"
                        },
                        "at": {
                          "type": "string",
                          "minLength": 20
                        },
                        "actorType": {
                          "type": "string",
                          "enum": [
                            "USER",
                            "AGENT"
                          ]
                        },
                        "agentLabel": {
                          "type": [
                            "string",
                            "null"
                          ]
                        }
                      },
                      "required": [
                        "byName",
                        "at",
                        "actorType",
                        "agentLabel"
                      ],
                      "additionalProperties": false
                    },
                    "approved": {
                      "anyOf": [
                        {
                          "type": "object",
                          "properties": {
                            "byName": {
                              "type": "string"
                            },
                            "at": {
                              "type": "string",
                              "minLength": 20
                            }
                          },
                          "required": [
                            "byName",
                            "at"
                          ],
                          "additionalProperties": false
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "voided": {
                      "$ref": "#/components/schemas/Retired2"
                    },
                    "entry": {
                      "$ref": "#/components/schemas/Entry2"
                    },
                    "voidEntry": {
                      "$ref": "#/components/schemas/Entry2"
                    },
                    "document": {
                      "$ref": "#/components/schemas/Document"
                    },
                    "fx": {
                      "anyOf": [
                        {
                          "$ref": "#/components/schemas/Conversion"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "entityTimeZone": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "id",
                    "number",
                    "status",
                    "entityId",
                    "entityName",
                    "vendorId",
                    "vendorName",
                    "supplierName",
                    "creditDate",
                    "postingDate",
                    "currency",
                    "totalMinor",
                    "remainingMinor",
                    "adjustsBill",
                    "source",
                    "actorType",
                    "appliedMinor",
                    "refundedMinor",
                    "subtotalMinor",
                    "taxMinor",
                    "reason",
                    "memo",
                    "payableAccount",
                    "lines",
                    "findings",
                    "deliveryRegion",
                    "drafted",
                    "approved",
                    "voided",
                    "entry",
                    "voidEntry",
                    "document",
                    "fx",
                    "entityTimeZone"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "404": {
            "$ref": "#/components/responses/Problem404"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      },
      "patch": {
        "operationId": "updateVendorCredit",
        "summary": "Changes a draft vendor credit.",
        "description": "Changes a draft vendor credit. Needs the `ledger:propose` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "purchases"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:propose",
        "parameters": [
          {
            "name": "vendorCreditId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "vendorId": {
                    "anyOf": [
                      {
                        "type": "string",
                        "minLength": 1
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "number": {
                    "anyOf": [
                      {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 60
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "creditDate": {
                    "type": "string",
                    "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                  },
                  "currency": {
                    "type": "string",
                    "pattern": "^[A-Z]{3}$"
                  },
                  "reason": {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 500
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "memo": {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 500
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "payableAccountId": {
                    "anyOf": [
                      {
                        "type": "string",
                        "minLength": 1
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "adjustsBillId": {
                    "anyOf": [
                      {
                        "type": "string",
                        "minLength": 1
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "deliveryRegion": {
                    "anyOf": [
                      {
                        "type": "string",
                        "pattern": "^(CA|US)-[A-Z]{2}$"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "documentId": {
                    "anyOf": [
                      {
                        "type": "string",
                        "minLength": 1
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "lines": {
                    "$ref": "#/components/schemas/Lines8"
                  }
                },
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "Ledger-Position": {
                "$ref": "#/components/headers/LedgerPosition"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CreateVendorCreditResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem400"
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "404": {
            "$ref": "#/components/responses/Problem404"
          },
          "409": {
            "$ref": "#/components/responses/Problem409"
          },
          "412": {
            "$ref": "#/components/responses/Problem412"
          },
          "422": {
            "$ref": "#/components/responses/Problem422"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      }
    },
    "/v1/vendor-credits/{vendorCreditId}/applications": {
      "post": {
        "operationId": "applyVendorCredit",
        "summary": "Applies a vendor credit against a bill.",
        "description": "Applies a vendor credit against a bill. Needs the `ledger:propose` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "purchases"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:propose",
        "parameters": [
          {
            "name": "vendorCreditId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "applications": {
                    "minItems": 1,
                    "maxItems": 50,
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "billId": {
                          "type": "string",
                          "minLength": 1
                        },
                        "amountMinor": {
                          "type": "string",
                          "pattern": "^-?\\d+$"
                        }
                      },
                      "required": [
                        "billId",
                        "amountMinor"
                      ],
                      "additionalProperties": false
                    }
                  }
                },
                "required": [
                  "applications"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "Ledger-Position": {
                "$ref": "#/components/headers/LedgerPosition"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CreateVendorCreditResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem400"
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "404": {
            "$ref": "#/components/responses/Problem404"
          },
          "409": {
            "$ref": "#/components/responses/Problem409"
          },
          "412": {
            "$ref": "#/components/responses/Problem412"
          },
          "422": {
            "$ref": "#/components/responses/Problem422"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      }
    },
    "/v1/vendor-credits/{vendorCreditId}/applications/{applicationId}/void": {
      "post": {
        "operationId": "voidVendorCreditApplication",
        "summary": "Voids one application of a vendor credit.",
        "description": "Voids one application of a vendor credit. Needs the `ledger:approve` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "purchases"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:approve",
        "parameters": [
          {
            "name": "vendorCreditId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "applicationId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "reason": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 500
                  }
                },
                "required": [
                  "reason"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "Ledger-Position": {
                "$ref": "#/components/headers/LedgerPosition"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CreateVendorCreditResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem400"
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "404": {
            "$ref": "#/components/responses/Problem404"
          },
          "409": {
            "$ref": "#/components/responses/Problem409"
          },
          "412": {
            "$ref": "#/components/responses/Problem412"
          },
          "422": {
            "$ref": "#/components/responses/Problem422"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      }
    },
    "/v1/vendor-credits/{vendorCreditId}/approve": {
      "post": {
        "operationId": "approveVendorCredit",
        "summary": "Approves a vendor credit so that it can be applied or refunded.",
        "description": "Approves a vendor credit so that it can be applied or refunded. Needs the `ledger:approve` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "purchases"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:approve",
        "parameters": [
          {
            "name": "vendorCreditId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "postingDate": {
                    "type": "string",
                    "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                  },
                  "applications": {
                    "default": [],
                    "maxItems": 50,
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "billId": {
                          "type": "string",
                          "minLength": 1
                        },
                        "amountMinor": {
                          "type": "string",
                          "pattern": "^-?\\d+$"
                        }
                      },
                      "required": [
                        "billId",
                        "amountMinor"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "declineSuggestion": {
                    "type": "boolean"
                  }
                },
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "Ledger-Position": {
                "$ref": "#/components/headers/LedgerPosition"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CreateVendorCreditResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem400"
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "404": {
            "$ref": "#/components/responses/Problem404"
          },
          "409": {
            "$ref": "#/components/responses/Problem409"
          },
          "412": {
            "$ref": "#/components/responses/Problem412"
          },
          "422": {
            "$ref": "#/components/responses/Problem422"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      }
    },
    "/v1/vendor-credits/{vendorCreditId}/audit": {
      "get": {
        "operationId": "listVendorCreditAudit",
        "summary": "Lists the audit trail of one vendor credit.",
        "description": "Lists the audit trail of one vendor credit. Needs the `ledger:read` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "purchases"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:read",
        "parameters": [
          {
            "name": "vendorCreditId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "action",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "default": 50,
              "type": "integer",
              "minimum": 1,
              "maximum": 200
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 512
            }
          },
          {
            "name": "origin",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "ALL",
                "NATIVE",
                "IMPORTED"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AuditLogResponse"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "404": {
            "$ref": "#/components/responses/Problem404"
          },
          "422": {
            "$ref": "#/components/responses/Problem422"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      }
    },
    "/v1/vendor-credits/{vendorCreditId}/decline": {
      "post": {
        "operationId": "declineVendorCredit",
        "summary": "Declines a submitted vendor credit with a reason.",
        "description": "Declines a submitted vendor credit with a reason. Needs the `ledger:approve` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "purchases"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:approve",
        "parameters": [
          {
            "name": "vendorCreditId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "kind": {
                    "type": "string",
                    "enum": [
                      "NOT_A_CREDIT",
                      "WRONG_FIGURES",
                      "WRONG_SUPPLIER",
                      "OTHER"
                    ]
                  },
                  "reason": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 500
                  }
                },
                "required": [
                  "kind",
                  "reason"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "Ledger-Position": {
                "$ref": "#/components/headers/LedgerPosition"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CreateVendorCreditResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem400"
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "404": {
            "$ref": "#/components/responses/Problem404"
          },
          "409": {
            "$ref": "#/components/responses/Problem409"
          },
          "412": {
            "$ref": "#/components/responses/Problem412"
          },
          "422": {
            "$ref": "#/components/responses/Problem422"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      }
    },
    "/v1/vendor-credits/{vendorCreditId}/discard": {
      "post": {
        "operationId": "discardVendorCredit",
        "summary": "Discards a draft vendor credit that has not been submitted.",
        "description": "Discards a draft vendor credit that has not been submitted. Needs the `ledger:propose` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "purchases"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:propose",
        "parameters": [
          {
            "name": "vendorCreditId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "reason": {
                    "type": "string",
                    "maxLength": 500
                  }
                },
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "Ledger-Position": {
                "$ref": "#/components/headers/LedgerPosition"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CreateVendorCreditResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem400"
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "404": {
            "$ref": "#/components/responses/Problem404"
          },
          "409": {
            "$ref": "#/components/responses/Problem409"
          },
          "412": {
            "$ref": "#/components/responses/Problem412"
          },
          "422": {
            "$ref": "#/components/responses/Problem422"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      }
    },
    "/v1/vendor-credits/{vendorCreditId}/refunds": {
      "get": {
        "operationId": "listVendorCreditRefunds",
        "summary": "Lists the refunds received for a vendor credit.",
        "description": "Lists the refunds received for a vendor credit. Needs the `ledger:read` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "purchases"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:read",
        "parameters": [
          {
            "name": "vendorCreditId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "default": 50,
              "type": "integer",
              "minimum": 1,
              "maximum": 200
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 512
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/ListVendorCreditRefundsResponseItem"
                      }
                    },
                    "nextCursor": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "total": {
                      "anyOf": [
                        {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  },
                  "required": [
                    "data",
                    "nextCursor",
                    "total"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "404": {
            "$ref": "#/components/responses/Problem404"
          },
          "422": {
            "$ref": "#/components/responses/Problem422"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      },
      "post": {
        "operationId": "recordVendorCreditRefund",
        "summary": "Records a refund received from a vendor for a vendor credit.",
        "description": "Records a refund received from a vendor for a vendor credit. Needs the `ledger:propose` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "purchases"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:propose",
        "parameters": [
          {
            "name": "vendorCreditId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "receivedOn": {
                    "type": "string",
                    "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                  },
                  "financialAccountId": {
                    "type": "string",
                    "minLength": 1
                  },
                  "amountMinor": {
                    "type": "string",
                    "pattern": "^-?\\d+$"
                  },
                  "receivedAmountMinor": {
                    "type": "string",
                    "pattern": "^-?\\d+$"
                  },
                  "reference": {
                    "type": "string",
                    "maxLength": 60
                  },
                  "note": {
                    "type": "string",
                    "maxLength": 500
                  },
                  "sourceTransactionId": {
                    "type": "string",
                    "minLength": 1
                  }
                },
                "required": [
                  "receivedOn",
                  "financialAccountId",
                  "amountMinor"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "Ledger-Position": {
                "$ref": "#/components/headers/LedgerPosition"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ListVendorCreditRefundsResponseItem"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem400"
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "404": {
            "$ref": "#/components/responses/Problem404"
          },
          "409": {
            "$ref": "#/components/responses/Problem409"
          },
          "412": {
            "$ref": "#/components/responses/Problem412"
          },
          "422": {
            "$ref": "#/components/responses/Problem422"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      }
    },
    "/v1/vendor-credits/{vendorCreditId}/refunds/{refundId}/approve": {
      "post": {
        "operationId": "approveVendorCreditRefund",
        "summary": "Approves a refund received from a vendor.",
        "description": "Approves a refund received from a vendor. Needs the `ledger:approve` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "purchases"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:approve",
        "parameters": [
          {
            "name": "vendorCreditId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "refundId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {},
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "Ledger-Position": {
                "$ref": "#/components/headers/LedgerPosition"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ListVendorCreditRefundsResponseItem"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem400"
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "404": {
            "$ref": "#/components/responses/Problem404"
          },
          "409": {
            "$ref": "#/components/responses/Problem409"
          },
          "412": {
            "$ref": "#/components/responses/Problem412"
          },
          "422": {
            "$ref": "#/components/responses/Problem422"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      }
    },
    "/v1/vendor-credits/{vendorCreditId}/refunds/{refundId}/void": {
      "post": {
        "operationId": "voidVendorCreditRefund",
        "summary": "Voids a refund received from a vendor.",
        "description": "Voids a refund received from a vendor. Needs the `ledger:approve` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "purchases"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:approve",
        "parameters": [
          {
            "name": "vendorCreditId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "refundId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "reason": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 500
                  }
                },
                "required": [
                  "reason"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "Ledger-Position": {
                "$ref": "#/components/headers/LedgerPosition"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ListVendorCreditRefundsResponseItem"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem400"
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "404": {
            "$ref": "#/components/responses/Problem404"
          },
          "409": {
            "$ref": "#/components/responses/Problem409"
          },
          "412": {
            "$ref": "#/components/responses/Problem412"
          },
          "422": {
            "$ref": "#/components/responses/Problem422"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      }
    },
    "/v1/vendor-credits/{vendorCreditId}/submit": {
      "post": {
        "operationId": "submitVendorCredit",
        "summary": "Submits a vendor credit for approval.",
        "description": "Submits a vendor credit for approval. Needs the `ledger:propose` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "purchases"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:propose",
        "parameters": [
          {
            "name": "vendorCreditId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "note": {
                    "type": "string",
                    "maxLength": 500
                  }
                },
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "Ledger-Position": {
                "$ref": "#/components/headers/LedgerPosition"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CreateVendorCreditResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem400"
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "404": {
            "$ref": "#/components/responses/Problem404"
          },
          "409": {
            "$ref": "#/components/responses/Problem409"
          },
          "412": {
            "$ref": "#/components/responses/Problem412"
          },
          "422": {
            "$ref": "#/components/responses/Problem422"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      }
    },
    "/v1/vendor-credits/{vendorCreditId}/void": {
      "post": {
        "operationId": "voidVendorCredit",
        "summary": "Voids a vendor credit, reversing its posting.",
        "description": "Voids a vendor credit, reversing its posting. Needs the `ledger:approve` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "purchases"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:approve",
        "parameters": [
          {
            "name": "vendorCreditId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "reason": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 500
                  }
                },
                "required": [
                  "reason"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "Ledger-Position": {
                "$ref": "#/components/headers/LedgerPosition"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CreateVendorCreditResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem400"
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "404": {
            "$ref": "#/components/responses/Problem404"
          },
          "409": {
            "$ref": "#/components/responses/Problem409"
          },
          "412": {
            "$ref": "#/components/responses/Problem412"
          },
          "422": {
            "$ref": "#/components/responses/Problem422"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      }
    },
    "/v1/vendor-look-alikes": {
      "get": {
        "operationId": "listVendorLookAlikes",
        "summary": "Lists the vendors that look alike, so duplicates can be found.",
        "description": "Lists the vendors that look alike, so duplicates can be found. Needs the `ledger:propose` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "purchases"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:propose",
        "parameters": [
          {
            "name": "name",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 200
            }
          },
          {
            "name": "taxNumber",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 20
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "default": 8,
              "type": "integer",
              "minimum": 1,
              "maximum": 8
            }
          },
          {
            "name": "exceptId",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "matches": {
                      "maxItems": 8,
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "kind": {
                            "type": "string",
                            "enum": [
                              "SAME_BUSINESS_NUMBER",
                              "KNOWN_AS",
                              "SIMILAR_NAME"
                            ]
                          },
                          "vendorId": {
                            "type": "string"
                          },
                          "displayName": {
                            "type": "string"
                          },
                          "status": {
                            "type": "string",
                            "enum": [
                              "ACTIVE",
                              "ARCHIVED"
                            ]
                          },
                          "matchedName": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "businessNumber": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "billCount": {
                            "type": "integer",
                            "minimum": 0,
                            "maximum": 9007199254740991
                          },
                          "lastBilledOn": {
                            "anyOf": [
                              {
                                "type": "string",
                                "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          }
                        },
                        "required": [
                          "kind",
                          "vendorId",
                          "displayName",
                          "status",
                          "matchedName",
                          "businessNumber",
                          "billCount",
                          "lastBilledOn"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "more": {
                      "type": "integer",
                      "minimum": 0,
                      "maximum": 9007199254740991
                    }
                  },
                  "required": [
                    "matches",
                    "more"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "422": {
            "$ref": "#/components/responses/Problem422"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      }
    },
    "/v1/vendor-merge-suggestions": {
      "get": {
        "operationId": "listVendorMergeSuggestions",
        "summary": "Lists the vendor merges the ledger suggests.",
        "description": "Lists the vendor merges the ledger suggests. Needs the `ledger:propose` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "purchases"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:propose",
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "default": 50,
              "type": "integer",
              "minimum": 1,
              "maximum": 200
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 512
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "survivor": {
                            "$ref": "#/components/schemas/Survivor3"
                          },
                          "absorbed": {
                            "$ref": "#/components/schemas/Survivor3"
                          },
                          "kinds": {
                            "type": "array",
                            "items": {
                              "type": "string",
                              "enum": [
                                "SAME_BUSINESS_NUMBER",
                                "SAME_BANK_ACCOUNT",
                                "SIMILAR_NAME"
                              ]
                            }
                          },
                          "sentence": {
                            "type": "string"
                          },
                          "suggestedKeepId": {
                            "type": "string"
                          },
                          "suggestedKeepWhy": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "survivor",
                          "absorbed",
                          "kinds",
                          "sentence",
                          "suggestedKeepId",
                          "suggestedKeepWhy"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "nextCursor": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "total": {
                      "anyOf": [
                        {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  },
                  "required": [
                    "data",
                    "nextCursor",
                    "total"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "422": {
            "$ref": "#/components/responses/Problem422"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      }
    },
    "/v1/vendor-merge-suggestions/dismiss": {
      "post": {
        "operationId": "dismissVendorMergeSuggestion",
        "summary": "Dismisses a suggested vendor merge.",
        "description": "Dismisses a suggested vendor merge. Needs the `ledger:propose` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "purchases"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:propose",
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "vendorAId": {
                    "type": "string",
                    "minLength": 1
                  },
                  "vendorBId": {
                    "type": "string",
                    "minLength": 1
                  },
                  "note": {
                    "type": "string",
                    "minLength": 10,
                    "maxLength": 500
                  }
                },
                "required": [
                  "vendorAId",
                  "vendorBId",
                  "note"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "Ledger-Position": {
                "$ref": "#/components/headers/LedgerPosition"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "vendorAId": {
                      "type": "string"
                    },
                    "vendorBId": {
                      "type": "string"
                    },
                    "dismissedBy": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "name": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "id",
                        "name"
                      ],
                      "additionalProperties": false
                    },
                    "dismissedAt": {
                      "type": "string",
                      "minLength": 20
                    }
                  },
                  "required": [
                    "vendorAId",
                    "vendorBId",
                    "dismissedBy",
                    "dismissedAt"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem400"
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "409": {
            "$ref": "#/components/responses/Problem409"
          },
          "412": {
            "$ref": "#/components/responses/Problem412"
          },
          "422": {
            "$ref": "#/components/responses/Problem422"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      }
    },
    "/v1/vendor-merges": {
      "get": {
        "operationId": "listVendorMerges",
        "summary": "Lists the vendor merges, with the server's total.",
        "description": "Lists the vendor merges, with the server's total. Needs the `ledger:read` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "purchases"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:read",
        "parameters": [
          {
            "name": "state",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "PROPOSED",
                "APPROVED",
                "REJECTED",
                "WITHDRAWN",
                "EXPIRED"
              ]
            }
          },
          {
            "name": "vendorId",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "q",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 100
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "default": 50,
              "type": "integer",
              "minimum": 1,
              "maximum": 200
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 512
            }
          },
          {
            "name": "sort",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 64
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/ListVendorMergesResponseItem"
                      }
                    },
                    "nextCursor": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "total": {
                      "anyOf": [
                        {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "counts": {
                      "type": "object",
                      "properties": {
                        "proposed": {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991
                        },
                        "expired": {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991
                        }
                      },
                      "required": [
                        "proposed",
                        "expired"
                      ],
                      "additionalProperties": false
                    },
                    "entityTimeZone": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "data",
                    "nextCursor",
                    "total",
                    "counts",
                    "entityTimeZone"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "422": {
            "$ref": "#/components/responses/Problem422"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      }
    },
    "/v1/vendor-merges/{mergeId}": {
      "get": {
        "operationId": "getVendorMerge",
        "summary": "Returns one vendor merge with what it moves.",
        "description": "Returns one vendor merge with what it moves. Needs the `ledger:read` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "purchases"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:read",
        "parameters": [
          {
            "name": "mergeId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ListVendorMergesResponseItem"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "404": {
            "$ref": "#/components/responses/Problem404"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      }
    },
    "/v1/vendor-merges/{mergeId}/reject": {
      "post": {
        "operationId": "rejectVendorMerge",
        "summary": "Rejects a vendor merge with a reason.",
        "description": "Rejects a vendor merge with a reason. Needs the `ledger:approve` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "purchases"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:approve",
        "parameters": [
          {
            "name": "mergeId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "note": {
                    "type": "string",
                    "minLength": 10,
                    "maxLength": 500
                  }
                },
                "required": [
                  "note"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "Ledger-Position": {
                "$ref": "#/components/headers/LedgerPosition"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ListVendorMergesResponseItem"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem400"
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "404": {
            "$ref": "#/components/responses/Problem404"
          },
          "409": {
            "$ref": "#/components/responses/Problem409"
          },
          "412": {
            "$ref": "#/components/responses/Problem412"
          },
          "422": {
            "$ref": "#/components/responses/Problem422"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      }
    },
    "/v1/vendor-merges/{mergeId}/withdraw": {
      "post": {
        "operationId": "withdrawVendorMerge",
        "summary": "Withdraws a proposed vendor merge.",
        "description": "Withdraws a proposed vendor merge. Needs the `ledger:propose` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "purchases"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:propose",
        "parameters": [
          {
            "name": "mergeId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "note": {
                    "type": "string",
                    "maxLength": 500
                  }
                },
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "Ledger-Position": {
                "$ref": "#/components/headers/LedgerPosition"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ListVendorMergesResponseItem"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem400"
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "404": {
            "$ref": "#/components/responses/Problem404"
          },
          "409": {
            "$ref": "#/components/responses/Problem409"
          },
          "412": {
            "$ref": "#/components/responses/Problem412"
          },
          "422": {
            "$ref": "#/components/responses/Problem422"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      }
    },
    "/v1/vendor-notices": {
      "get": {
        "operationId": "listVendorNotices",
        "summary": "Lists the notices sent or waiting to be sent to vendors, with the server's total.",
        "description": "Lists the notices sent or waiting to be sent to vendors, with the server's total. Needs the `ledger:read` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "purchases"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:read",
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "default": 50,
              "type": "integer",
              "minimum": 1,
              "maximum": 200
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 512
            }
          },
          {
            "name": "q",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 120
            }
          },
          {
            "name": "state",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "DRAFTED",
                "SENT",
                "SUPPRESSED",
                "BOUNCED"
              ]
            }
          },
          {
            "name": "kind",
            "in": "query",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/Kind5"
            }
          },
          {
            "name": "under",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "SETTING",
                "PERSON"
              ]
            }
          },
          {
            "name": "addressId",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "entityId",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "vendorId",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "inboundEmailId",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "inboundRefusalId",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "digestNoticeId",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "paymentRunId",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "paymentId",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "billId",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "vendorBankingChangeId",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "from",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
            }
          },
          {
            "name": "to",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
            }
          },
          {
            "name": "sort",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 64
            }
          },
          {
            "name": "inboundRefusalIds",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 12800
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/ListVendorNoticesResponseItem"
                      }
                    },
                    "nextCursor": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "total": {
                      "anyOf": [
                        {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  },
                  "required": [
                    "data",
                    "nextCursor",
                    "total"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "422": {
            "$ref": "#/components/responses/Problem422"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      }
    },
    "/v1/vendor-notices/closing-drafts": {
      "post": {
        "operationId": "draftClosingNotices",
        "summary": "Drafts the notices that close out a vendor's account for a batch.",
        "description": "Drafts the notices that close out a vendor's account for a batch. Needs the `ledger:admin` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "purchases"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:admin",
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "inboundAddressId": {
                    "type": "string",
                    "minLength": 1
                  }
                },
                "required": [
                  "inboundAddressId"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "Ledger-Position": {
                "$ref": "#/components/headers/LedgerPosition"
              },
              "Location": {
                "$ref": "#/components/headers/Location"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "drafted": {
                      "type": "integer",
                      "minimum": 0,
                      "maximum": 9007199254740991
                    },
                    "noticeIds": {
                      "maxItems": 200,
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "skipped": {
                      "type": "object",
                      "properties": {
                        "alreadyTold": {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991
                        },
                        "stopped": {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991
                        },
                        "bounced": {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991
                        },
                        "overCap": {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991
                        }
                      },
                      "required": [
                        "alreadyTold",
                        "stopped",
                        "bounced",
                        "overCap"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "drafted",
                    "noticeIds",
                    "skipped"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem400"
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "409": {
            "$ref": "#/components/responses/Problem409"
          },
          "412": {
            "$ref": "#/components/responses/Problem412"
          },
          "422": {
            "$ref": "#/components/responses/Problem422"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      }
    },
    "/v1/vendor-notices/discard-batch": {
      "post": {
        "operationId": "discardNoticeBatch",
        "summary": "Discards a batch of drafted vendor notices that has not been sent.",
        "description": "Discards a batch of drafted vendor notices that has not been sent. Needs the `ledger:propose` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "purchases"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:propose",
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "noticeIds": {
                    "minItems": 1,
                    "maxItems": 100,
                    "type": "array",
                    "items": {
                      "type": "string",
                      "minLength": 1
                    }
                  },
                  "reason": {
                    "type": "string",
                    "minLength": 4,
                    "maxLength": 500
                  }
                },
                "required": [
                  "noticeIds",
                  "reason"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "Ledger-Position": {
                "$ref": "#/components/headers/LedgerPosition"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "discarded": {
                      "type": "integer",
                      "minimum": 0,
                      "maximum": 9007199254740991
                    },
                    "skipped": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    }
                  },
                  "required": [
                    "discarded",
                    "skipped"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem400"
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "409": {
            "$ref": "#/components/responses/Problem409"
          },
          "412": {
            "$ref": "#/components/responses/Problem412"
          },
          "422": {
            "$ref": "#/components/responses/Problem422"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      }
    },
    "/v1/vendor-notices/send-batch": {
      "post": {
        "operationId": "sendVendorNoticeBatch",
        "summary": "Sends a batch of vendor notices.",
        "description": "Sends a batch of vendor notices. Needs the `ledger:propose` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "purchases"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:propose",
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "noticeIds": {
                    "minItems": 1,
                    "maxItems": 100,
                    "type": "array",
                    "items": {
                      "type": "string",
                      "minLength": 1
                    }
                  }
                },
                "required": [
                  "noticeIds"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "Ledger-Position": {
                "$ref": "#/components/headers/LedgerPosition"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "requested": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "noticeId": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "noticeId"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "held": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "noticeId": {
                            "type": "string"
                          },
                          "why": {
                            "type": "string",
                            "enum": [
                              "RECIPIENT_STOPPED",
                              "RECIPIENT_BOUNCED",
                              "NO_NAMED_CONTACT",
                              "NEEDS_SECOND_PERSON",
                              "ALREADY_ASKED",
                              "NOT_DRAFTED"
                            ]
                          },
                          "sentence": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "noticeId",
                          "why",
                          "sentence"
                        ],
                        "additionalProperties": false
                      }
                    }
                  },
                  "required": [
                    "requested",
                    "held"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem400"
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "409": {
            "$ref": "#/components/responses/Problem409"
          },
          "412": {
            "$ref": "#/components/responses/Problem412"
          },
          "422": {
            "$ref": "#/components/responses/Problem422"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      }
    },
    "/v1/vendor-notices/{noticeId}": {
      "get": {
        "operationId": "getVendorNotice",
        "summary": "Returns one vendor notice with its text and its delivery status.",
        "description": "Returns one vendor notice with its text and its delivery status. Needs the `ledger:read` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "purchases"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:read",
        "parameters": [
          {
            "name": "noticeId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetVendorNoticeResponse"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "404": {
            "$ref": "#/components/responses/Problem404"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      }
    },
    "/v1/vendor-notices/{noticeId}/discard": {
      "post": {
        "operationId": "discardNotice",
        "summary": "Discards a vendor notice that has not been sent.",
        "description": "Discards a vendor notice that has not been sent. Needs the `ledger:propose` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "purchases"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:propose",
        "parameters": [
          {
            "name": "noticeId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "reason": {
                    "type": "string",
                    "minLength": 4,
                    "maxLength": 500
                  }
                },
                "required": [
                  "reason"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "Ledger-Position": {
                "$ref": "#/components/headers/LedgerPosition"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetVendorNoticeResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem400"
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "404": {
            "$ref": "#/components/responses/Problem404"
          },
          "409": {
            "$ref": "#/components/responses/Problem409"
          },
          "412": {
            "$ref": "#/components/responses/Problem412"
          },
          "422": {
            "$ref": "#/components/responses/Problem422"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      }
    },
    "/v1/vendor-notices/{noticeId}/send": {
      "post": {
        "operationId": "sendVendorNotice",
        "summary": "Sends one vendor notice.",
        "description": "Sends one vendor notice. Needs the `ledger:propose` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "purchases"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:propose",
        "parameters": [
          {
            "name": "noticeId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "portalUrl": {
                    "type": "string",
                    "maxLength": 2048,
                    "format": "uri"
                  }
                },
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "Ledger-Position": {
                "$ref": "#/components/headers/LedgerPosition"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetVendorNoticeResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem400"
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "404": {
            "$ref": "#/components/responses/Problem404"
          },
          "409": {
            "$ref": "#/components/responses/Problem409"
          },
          "412": {
            "$ref": "#/components/responses/Problem412"
          },
          "422": {
            "$ref": "#/components/responses/Problem422"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      }
    },
    "/v1/vendor-notices/{noticeId}/sent": {
      "post": {
        "operationId": "recordNoticeSent",
        "summary": "Records that a vendor notice was sent outside the product.",
        "description": "Records that a vendor notice was sent outside the product. Needs the `ledger:propose` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "purchases"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:propose",
        "parameters": [
          {
            "name": "noticeId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "note": {
                    "type": "string",
                    "minLength": 4,
                    "maxLength": 500
                  }
                },
                "required": [
                  "note"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "Ledger-Position": {
                "$ref": "#/components/headers/LedgerPosition"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetVendorNoticeResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem400"
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "404": {
            "$ref": "#/components/responses/Problem404"
          },
          "409": {
            "$ref": "#/components/responses/Problem409"
          },
          "412": {
            "$ref": "#/components/responses/Problem412"
          },
          "422": {
            "$ref": "#/components/responses/Problem422"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      }
    },
    "/v1/vendor-portal-submissions": {
      "get": {
        "operationId": "listVendorPortalSubmissions",
        "summary": "Lists the submissions made through the vendor portal, with the server's total.",
        "description": "Lists the submissions made through the vendor portal, with the server's total. Needs the `ledger:read` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "purchases"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:read",
        "parameters": [
          {
            "name": "vendorId",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "kind",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "DOCUMENT",
                "FACTS",
                "PAPER",
                "BANKING"
              ]
            }
          },
          {
            "name": "state",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "RECEIVED",
                "ACCEPTED",
                "DECLINED",
                "WITHDRAWN",
                "ALL"
              ]
            }
          },
          {
            "name": "q",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 100
            }
          },
          {
            "name": "sort",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 40
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "default": 50,
              "type": "integer",
              "minimum": 1,
              "maximum": 200
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 512
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "vendor": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string"
                              },
                              "displayName": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "id",
                              "displayName"
                            ],
                            "additionalProperties": false
                          },
                          "kind": {
                            "type": "string",
                            "enum": [
                              "DOCUMENT",
                              "FACTS",
                              "PAPER",
                              "BANKING"
                            ]
                          },
                          "summary": {
                            "type": "string"
                          },
                          "receivedAt": {
                            "type": "string",
                            "minLength": 20
                          },
                          "waitingDays": {
                            "anyOf": [
                              {
                                "type": "integer",
                                "minimum": 0,
                                "maximum": 9007199254740991
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "state": {
                            "type": "string",
                            "enum": [
                              "RECEIVED",
                              "ACCEPTED",
                              "DECLINED",
                              "WITHDRAWN"
                            ]
                          },
                          "decidedBy": {
                            "anyOf": [
                              {
                                "type": "object",
                                "properties": {
                                  "id": {
                                    "type": "string"
                                  },
                                  "name": {
                                    "type": "string"
                                  }
                                },
                                "required": [
                                  "id",
                                  "name"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "entityTimeZone": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "id",
                          "vendor",
                          "kind",
                          "summary",
                          "receivedAt",
                          "waitingDays",
                          "state",
                          "decidedBy",
                          "entityTimeZone"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "nextCursor": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "total": {
                      "anyOf": [
                        {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "counts": {
                      "type": "object",
                      "properties": {
                        "RECEIVED": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 9007199254740991
                        },
                        "ACCEPTED": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 9007199254740991
                        },
                        "DECLINED": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 9007199254740991
                        },
                        "WITHDRAWN": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 9007199254740991
                        },
                        "DOCUMENTS": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 9007199254740991
                        }
                      },
                      "required": [
                        "RECEIVED",
                        "ACCEPTED",
                        "DECLINED",
                        "WITHDRAWN",
                        "DOCUMENTS"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "data",
                    "nextCursor",
                    "total",
                    "counts"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "422": {
            "$ref": "#/components/responses/Problem422"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      }
    },
    "/v1/vendor-portal-submissions/{submissionId}": {
      "get": {
        "operationId": "getVendorPortalSubmission",
        "summary": "Returns one vendor portal submission with its status.",
        "description": "Returns one vendor portal submission with its status. Needs the `ledger:read` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "purchases"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:read",
        "parameters": [
          {
            "name": "submissionId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetVendorPortalSubmissionResponse"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "404": {
            "$ref": "#/components/responses/Problem404"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      }
    },
    "/v1/vendor-portal-submissions/{submissionId}/decline": {
      "post": {
        "operationId": "declineVendorPortalSubmission",
        "summary": "Declines a vendor portal submission with a reason.",
        "description": "Declines a vendor portal submission with a reason. Needs the `ledger:propose` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "purchases"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:propose",
        "parameters": [
          {
            "name": "submissionId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "reasonCode": {
                    "type": "string",
                    "enum": [
                      "UNCLEAR_COPY",
                      "WRONG_DOCUMENT",
                      "ALREADY_ON_FILE",
                      "WILL_CALL",
                      "WRITE_TO_US"
                    ]
                  },
                  "note": {
                    "type": "string",
                    "maxLength": 500
                  }
                },
                "required": [
                  "reasonCode"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "Ledger-Position": {
                "$ref": "#/components/headers/LedgerPosition"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetVendorPortalSubmissionResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem400"
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "404": {
            "$ref": "#/components/responses/Problem404"
          },
          "409": {
            "$ref": "#/components/responses/Problem409"
          },
          "412": {
            "$ref": "#/components/responses/Problem412"
          },
          "422": {
            "$ref": "#/components/responses/Problem422"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      }
    },
    "/v1/vendor-privacy-requests": {
      "get": {
        "operationId": "listVendorPrivacyRequests",
        "summary": "Lists the privacy requests made about vendors, with the server's total.",
        "description": "Lists the privacy requests made about vendors, with the server's total. Needs the `ledger:propose` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "purchases"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:propose",
        "parameters": [
          {
            "name": "state",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "enum": [
                    "OPEN",
                    "PACK_TAKEN",
                    "WAITING",
                    "DONE",
                    "DECLINED",
                    "ANSWERED",
                    "WITHDRAWN"
                  ]
                },
                {
                  "type": "string",
                  "const": "OVERDUE"
                },
                {
                  "type": "string",
                  "const": "OPEN_ALL"
                },
                {
                  "type": "string",
                  "const": "ALL"
                }
              ]
            }
          },
          {
            "name": "kind",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "ACCESS",
                "CONTACT_REDACTION",
                "BANKING_DIGITS_DESTRUCTION"
              ]
            }
          },
          {
            "name": "vendorId",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "q",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 100
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "default": 50,
              "type": "integer",
              "minimum": 1,
              "maximum": 200
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 512
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "vendor": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string"
                              },
                              "displayName": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "id",
                              "displayName"
                            ],
                            "additionalProperties": false
                          },
                          "kind": {
                            "type": "string",
                            "enum": [
                              "ACCESS",
                              "CONTACT_REDACTION",
                              "BANKING_DIGITS_DESTRUCTION"
                            ]
                          },
                          "state": {
                            "type": "string",
                            "enum": [
                              "OPEN",
                              "PACK_TAKEN",
                              "WAITING",
                              "DONE",
                              "DECLINED",
                              "ANSWERED",
                              "WITHDRAWN"
                            ]
                          },
                          "overdue": {
                            "type": "boolean"
                          },
                          "daysLeft": {
                            "type": "integer",
                            "minimum": -9007199254740991,
                            "maximum": 9007199254740991
                          },
                          "receivedOn": {
                            "type": "string",
                            "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                          },
                          "respondBy": {
                            "type": "string",
                            "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                          },
                          "requesterName": {
                            "type": "string"
                          },
                          "requestedBy": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string"
                              },
                              "name": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "id",
                              "name"
                            ],
                            "additionalProperties": false
                          },
                          "requestedAt": {
                            "type": "string",
                            "minLength": 20
                          },
                          "entityTimeZone": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "id",
                          "vendor",
                          "kind",
                          "state",
                          "overdue",
                          "daysLeft",
                          "receivedOn",
                          "respondBy",
                          "requesterName",
                          "requestedBy",
                          "requestedAt",
                          "entityTimeZone"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "nextCursor": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "total": {
                      "anyOf": [
                        {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  },
                  "required": [
                    "data",
                    "nextCursor",
                    "total"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "422": {
            "$ref": "#/components/responses/Problem422"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      }
    },
    "/v1/vendor-privacy-requests/{requestId}": {
      "get": {
        "operationId": "getVendorPrivacyRequest",
        "summary": "Returns one vendor privacy request with its status.",
        "description": "Returns one vendor privacy request with its status. Needs the `ledger:propose` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "purchases"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:propose",
        "parameters": [
          {
            "name": "requestId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "vendor": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "displayName": {
                          "type": "string"
                        },
                        "recipientType": {
                          "type": "string"
                        },
                        "language": {
                          "type": "string",
                          "enum": [
                            "en",
                            "fr"
                          ]
                        }
                      },
                      "required": [
                        "id",
                        "displayName",
                        "recipientType",
                        "language"
                      ],
                      "additionalProperties": false
                    },
                    "kind": {
                      "type": "string",
                      "enum": [
                        "ACCESS",
                        "CONTACT_REDACTION",
                        "BANKING_DIGITS_DESTRUCTION"
                      ]
                    },
                    "state": {
                      "type": "string",
                      "enum": [
                        "OPEN",
                        "PACK_TAKEN",
                        "WAITING",
                        "DONE",
                        "DECLINED",
                        "ANSWERED",
                        "WITHDRAWN"
                      ]
                    },
                    "overdue": {
                      "type": "boolean"
                    },
                    "daysLeft": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    "receivedOn": {
                      "type": "string",
                      "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                    },
                    "respondBy": {
                      "type": "string",
                      "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                    },
                    "requesterName": {
                      "type": "string"
                    },
                    "requestedBy": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "name": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "id",
                        "name"
                      ],
                      "additionalProperties": false
                    },
                    "requestedAt": {
                      "type": "string",
                      "minLength": 20
                    },
                    "entityTimeZone": {
                      "type": "string"
                    },
                    "channel": {
                      "type": "string",
                      "enum": [
                        "EMAIL",
                        "LETTER",
                        "PHONE",
                        "IN_PERSON",
                        "OTHER"
                      ]
                    },
                    "identityCheck": {
                      "type": "string",
                      "enum": [
                        "REPLIED_FROM_ADDRESS_ON_FILE",
                        "CALLED_NUMBER_ON_FILE",
                        "DOCUMENT_SEEN",
                        "OTHER_STATED"
                      ]
                    },
                    "identityNote": {
                      "type": "string"
                    },
                    "message": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "read": {
                      "anyOf": [
                        {
                          "type": "object",
                          "properties": {
                            "promptVersion": {
                              "type": "string"
                            },
                            "proposed": {
                              "type": "array",
                              "items": {
                                "type": "string",
                                "enum": [
                                  "SEE_WHAT_YOU_HOLD",
                                  "REMOVE_CONTACT_DETAILS",
                                  "REMOVE_BANK_ACCOUNT",
                                  "REMOVE_EVERYTHING",
                                  "CORRECT_DETAILS",
                                  "OTHER"
                                ]
                              }
                            },
                            "quotes": {
                              "$ref": "#/components/schemas/Quotes"
                            },
                            "language": {
                              "anyOf": [
                                {
                                  "type": "string",
                                  "enum": [
                                    "en",
                                    "fr"
                                  ]
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "addressedToSystem": {
                              "type": [
                                "boolean",
                                "null"
                              ]
                            },
                            "accepted": {
                              "type": "array",
                              "items": {
                                "type": "string",
                                "enum": [
                                  "SEE_WHAT_YOU_HOLD",
                                  "REMOVE_CONTACT_DETAILS",
                                  "REMOVE_BANK_ACCOUNT",
                                  "REMOVE_EVERYTHING",
                                  "CORRECT_DETAILS",
                                  "OTHER"
                                ]
                              }
                            },
                            "declined": {
                              "type": "array",
                              "items": {
                                "type": "string",
                                "enum": [
                                  "SEE_WHAT_YOU_HOLD",
                                  "REMOVE_CONTACT_DETAILS",
                                  "REMOVE_BANK_ACCOUNT",
                                  "REMOVE_EVERYTHING",
                                  "CORRECT_DETAILS",
                                  "OTHER"
                                ]
                              }
                            },
                            "added": {
                              "type": "array",
                              "items": {
                                "type": "string",
                                "enum": [
                                  "SEE_WHAT_YOU_HOLD",
                                  "REMOVE_CONTACT_DETAILS",
                                  "REMOVE_BANK_ACCOUNT",
                                  "REMOVE_EVERYTHING",
                                  "CORRECT_DETAILS",
                                  "OTHER"
                                ]
                              }
                            }
                          },
                          "required": [
                            "promptVersion",
                            "proposed",
                            "quotes",
                            "language",
                            "addressedToSystem",
                            "accepted",
                            "declined",
                            "added"
                          ],
                          "additionalProperties": false
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "packContents": {
                      "anyOf": [
                        {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "section": {
                                "type": "string"
                              },
                              "rows": {
                                "type": "integer",
                                "minimum": 0,
                                "maximum": 9007199254740991
                              }
                            },
                            "required": [
                              "section",
                              "rows"
                            ],
                            "additionalProperties": false
                          }
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "bankingChange": {
                      "anyOf": [
                        {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "string"
                            },
                            "summary": {
                              "type": "string"
                            }
                          },
                          "required": [
                            "id",
                            "summary"
                          ],
                          "additionalProperties": false
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "permission": {
                      "anyOf": [
                        {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "string"
                            },
                            "craReference": {
                              "type": "string"
                            },
                            "grantedOn": {
                              "type": "string",
                              "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                            },
                            "covers": {
                              "type": "string"
                            },
                            "voided": {
                              "type": "boolean"
                            }
                          },
                          "required": [
                            "id",
                            "craReference",
                            "grantedOn",
                            "covers",
                            "voided"
                          ],
                          "additionalProperties": false
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "approval": {
                      "anyOf": [
                        {
                          "type": "object",
                          "properties": {
                            "by": {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string"
                                },
                                "name": {
                                  "type": "string"
                                }
                              },
                              "required": [
                                "id",
                                "name"
                              ],
                              "additionalProperties": false
                            },
                            "at": {
                              "type": "string",
                              "minLength": 20
                            },
                            "note": {
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "planSha256": {
                              "type": "string",
                              "pattern": "^[0-9a-f]{64}$"
                            }
                          },
                          "required": [
                            "by",
                            "at",
                            "note",
                            "planSha256"
                          ],
                          "additionalProperties": false
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "decline": {
                      "$ref": "#/components/schemas/Retired"
                    },
                    "withdrawal": {
                      "anyOf": [
                        {
                          "type": "object",
                          "properties": {
                            "at": {
                              "type": "string",
                              "minLength": 20
                            },
                            "reason": {
                              "type": "string"
                            }
                          },
                          "required": [
                            "at",
                            "reason"
                          ],
                          "additionalProperties": false
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "pack": {
                      "anyOf": [
                        {
                          "type": "object",
                          "properties": {
                            "downloadedAt": {
                              "type": "string",
                              "minLength": 20
                            },
                            "by": {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string"
                                },
                                "name": {
                                  "type": "string"
                                }
                              },
                              "required": [
                                "id",
                                "name"
                              ],
                              "additionalProperties": false
                            },
                            "rowCount": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 9007199254740991
                            }
                          },
                          "required": [
                            "downloadedAt",
                            "by",
                            "rowCount"
                          ],
                          "additionalProperties": false
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "packJob": {
                      "$ref": "#/components/schemas/Job2"
                    },
                    "answer": {
                      "anyOf": [
                        {
                          "type": "object",
                          "properties": {
                            "at": {
                              "type": "string",
                              "minLength": 20
                            },
                            "by": {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string"
                                },
                                "name": {
                                  "type": "string"
                                }
                              },
                              "required": [
                                "id",
                                "name"
                              ],
                              "additionalProperties": false
                            },
                            "via": {
                              "type": "string",
                              "enum": [
                                "EMAIL",
                                "LETTER",
                                "PHONE",
                                "IN_PERSON",
                                "OTHER"
                              ]
                            },
                            "note": {
                              "type": [
                                "string",
                                "null"
                              ]
                            }
                          },
                          "required": [
                            "at",
                            "by",
                            "via",
                            "note"
                          ],
                          "additionalProperties": false
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "executed": {
                      "anyOf": [
                        {
                          "type": "object",
                          "properties": {
                            "cleared": {
                              "type": "object",
                              "propertyNames": {
                                "type": "string"
                              },
                              "additionalProperties": {
                                "anyOf": [
                                  {
                                    "type": "integer",
                                    "minimum": -9007199254740991,
                                    "maximum": 9007199254740991
                                  },
                                  {
                                    "type": "boolean"
                                  }
                                ]
                              }
                            },
                            "kept": {
                              "type": "array",
                              "items": {
                                "type": "string"
                              }
                            }
                          },
                          "required": [
                            "cleared",
                            "kept"
                          ],
                          "additionalProperties": false
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "plan": {
                      "anyOf": [
                        {
                          "type": "object",
                          "properties": {
                            "rows": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "key": {
                                    "type": "string"
                                  },
                                  "item": {
                                    "type": "string"
                                  },
                                  "treatment": {
                                    "type": "string",
                                    "enum": [
                                      "CLEAR",
                                      "KEEP_ACT",
                                      "KEEP_EVIDENCE",
                                      "NOTHING_HELD"
                                    ]
                                  },
                                  "held": {
                                    "anyOf": [
                                      {
                                        "type": "integer",
                                        "minimum": 0,
                                        "maximum": 9007199254740991
                                      },
                                      {
                                        "type": "null"
                                      }
                                    ]
                                  },
                                  "because": {
                                    "type": "string"
                                  },
                                  "until": {
                                    "anyOf": [
                                      {
                                        "type": "string",
                                        "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                                      },
                                      {
                                        "type": "null"
                                      }
                                    ]
                                  }
                                },
                                "required": [
                                  "key",
                                  "item",
                                  "treatment",
                                  "held",
                                  "because",
                                  "until"
                                ],
                                "additionalProperties": false
                              }
                            },
                            "retainUntil": {
                              "anyOf": [
                                {
                                  "type": "string",
                                  "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "sha256": {
                              "type": "string",
                              "pattern": "^[0-9a-f]{64}$"
                            },
                            "moved": {
                              "type": "boolean"
                            }
                          },
                          "required": [
                            "rows",
                            "retainUntil",
                            "sha256"
                          ],
                          "additionalProperties": false
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "answerDraft": {
                      "anyOf": [
                        {
                          "type": "object",
                          "properties": {
                            "language": {
                              "type": "string",
                              "enum": [
                                "en",
                                "fr"
                              ]
                            },
                            "subject": {
                              "type": "string"
                            },
                            "body": {
                              "type": "string"
                            }
                          },
                          "required": [
                            "language",
                            "subject",
                            "body"
                          ],
                          "additionalProperties": false
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  },
                  "required": [
                    "id",
                    "vendor",
                    "kind",
                    "state",
                    "overdue",
                    "daysLeft",
                    "receivedOn",
                    "respondBy",
                    "requesterName",
                    "requestedBy",
                    "requestedAt",
                    "entityTimeZone",
                    "channel",
                    "identityCheck",
                    "identityNote",
                    "message",
                    "read",
                    "packContents",
                    "bankingChange",
                    "permission",
                    "approval",
                    "decline",
                    "withdrawal",
                    "pack",
                    "packJob",
                    "answer",
                    "executed",
                    "plan",
                    "answerDraft"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "404": {
            "$ref": "#/components/responses/Problem404"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      }
    },
    "/v1/vendor-queries": {
      "get": {
        "operationId": "listVendorQueries",
        "summary": "Lists the vendor queries, with the server's total.",
        "description": "Lists the vendor queries, with the server's total. Needs the `ledger:read` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "purchases"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:read",
        "parameters": [
          {
            "name": "status",
            "in": "query",
            "required": false,
            "description": "One or more values, separated by commas.",
            "schema": {
              "type": "string",
              "description": "One or more values, separated by commas."
            }
          },
          {
            "name": "turn",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "US",
                "SUPPLIER"
              ]
            }
          },
          {
            "name": "owner",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 64
            }
          },
          {
            "name": "vendorId",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "entityId",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "billId",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "aboutBillId",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "paymentId",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "vendorCreditId",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "runId",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "policyId",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "origin",
            "in": "query",
            "required": false,
            "description": "One or more values, separated by commas.",
            "schema": {
              "type": "string",
              "description": "One or more values, separated by commas."
            }
          },
          {
            "name": "filedBy",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "policy",
                "person",
                "supplier"
              ]
            }
          },
          {
            "name": "mentionsBanking",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "true",
                "false"
              ]
            }
          },
          {
            "name": "from",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
            }
          },
          {
            "name": "to",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
            }
          },
          {
            "name": "q",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 100
            }
          },
          {
            "name": "sort",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 40
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "default": 50,
              "type": "integer",
              "minimum": 1,
              "maximum": 200
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 512
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "reference": {
                            "type": "string",
                            "pattern": "^Q-[0-9A-F]{10}$"
                          },
                          "title": {
                            "type": "string"
                          },
                          "status": {
                            "type": "string",
                            "enum": [
                              "OPEN",
                              "RESOLVED",
                              "SET_ASIDE"
                            ]
                          },
                          "turn": {
                            "anyOf": [
                              {
                                "type": "string",
                                "enum": [
                                  "US",
                                  "SUPPLIER"
                                ]
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "vendor": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string"
                              },
                              "displayName": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "id",
                              "displayName"
                            ],
                            "additionalProperties": false
                          },
                          "entityId": {
                            "type": "string"
                          },
                          "entityName": {
                            "type": "string"
                          },
                          "entityTimeZone": {
                            "type": "string"
                          },
                          "subject": {
                            "$ref": "#/components/schemas/Subject2"
                          },
                          "origin": {
                            "type": "string",
                            "enum": [
                              "PORTAL",
                              "EMAIL",
                              "RECORDED",
                              "OURS"
                            ]
                          },
                          "raisedAt": {
                            "type": "string",
                            "minLength": 20
                          },
                          "lastMessageAt": {
                            "type": "string",
                            "minLength": 20
                          },
                          "messageCount": {
                            "type": "integer",
                            "minimum": 1,
                            "maximum": 9007199254740991
                          },
                          "owner": {
                            "$ref": "#/components/schemas/Owner"
                          },
                          "mentionsBanking": {
                            "type": "boolean"
                          },
                          "filedUnder": {
                            "$ref": "#/components/schemas/FiledUnder"
                          },
                          "questionId": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "followsQueryId": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "aboutMinor": {
                            "anyOf": [
                              {
                                "type": "string",
                                "pattern": "^-?\\d+$"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "aboutCurrency": {
                            "anyOf": [
                              {
                                "type": "string",
                                "pattern": "^[A-Z]{3}$"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "waitingSince": {
                            "anyOf": [
                              {
                                "type": "string",
                                "minLength": 20
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "closedAt": {
                            "anyOf": [
                              {
                                "type": "string",
                                "minLength": 20
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "sentence": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "id",
                          "reference",
                          "title",
                          "status",
                          "turn",
                          "vendor",
                          "entityId",
                          "entityName",
                          "entityTimeZone",
                          "subject",
                          "origin",
                          "raisedAt",
                          "lastMessageAt",
                          "messageCount",
                          "owner",
                          "mentionsBanking",
                          "filedUnder",
                          "questionId",
                          "followsQueryId",
                          "aboutMinor",
                          "aboutCurrency",
                          "waitingSince",
                          "closedAt",
                          "sentence"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "nextCursor": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "total": {
                      "anyOf": [
                        {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "counts": {
                      "type": "object",
                      "properties": {
                        "open": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 9007199254740991
                        },
                        "waitingOnUs": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 9007199254740991
                        },
                        "waitingOnSupplier": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 9007199254740991
                        },
                        "resolved": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 9007199254740991
                        },
                        "setAside": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 9007199254740991
                        }
                      },
                      "required": [
                        "open",
                        "waitingOnUs",
                        "waitingOnSupplier",
                        "resolved",
                        "setAside"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "data",
                    "nextCursor",
                    "total",
                    "counts"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "422": {
            "$ref": "#/components/responses/Problem422"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      },
      "post": {
        "operationId": "raiseVendorQuery",
        "summary": "Raises a query with a vendor about a bill or invoice, in our words, as a recorded conversation, or from an arrival's kept words.",
        "description": "Raises a query with a vendor about a bill or invoice, in our words, as a recorded conversation, or from an arrival's kept words. Needs the `ledger:propose` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "purchases"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:propose",
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "oneOf": [
                  {
                    "type": "object",
                    "properties": {
                      "kind": {
                        "type": "string",
                        "const": "FROM_ARRIVAL"
                      },
                      "inboundEmailId": {
                        "type": "string",
                        "minLength": 1
                      },
                      "vendorId": {
                        "type": "string",
                        "minLength": 1
                      },
                      "subject": {
                        "$ref": "#/components/schemas/Subject3"
                      },
                      "title": {
                        "type": "string",
                        "minLength": 4,
                        "maxLength": 200
                      },
                      "ownerId": {
                        "type": "string",
                        "minLength": 1
                      },
                      "addToQueryId": {
                        "type": "string",
                        "minLength": 1
                      }
                    },
                    "required": [
                      "kind",
                      "inboundEmailId",
                      "subject"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "kind": {
                        "type": "string",
                        "const": "RECORDED"
                      },
                      "vendorId": {
                        "type": "string",
                        "minLength": 1
                      },
                      "subject": {
                        "$ref": "#/components/schemas/Subject3"
                      },
                      "title": {
                        "type": "string",
                        "minLength": 4,
                        "maxLength": 200
                      },
                      "body": {
                        "type": "string",
                        "minLength": 4,
                        "maxLength": 4000
                      },
                      "channel": {
                        "type": "string",
                        "enum": [
                          "EMAIL",
                          "BY_HAND"
                        ]
                      },
                      "ownerId": {
                        "type": "string",
                        "minLength": 1
                      },
                      "entityId": {
                        "type": "string",
                        "minLength": 1
                      },
                      "followsQueryId": {
                        "type": "string",
                        "minLength": 1
                      }
                    },
                    "required": [
                      "kind",
                      "vendorId",
                      "subject",
                      "title",
                      "body",
                      "channel"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "kind": {
                        "type": "string",
                        "const": "OURS"
                      },
                      "vendorId": {
                        "type": "string",
                        "minLength": 1
                      },
                      "subject": {
                        "$ref": "#/components/schemas/Subject3"
                      },
                      "title": {
                        "type": "string",
                        "minLength": 4,
                        "maxLength": 200
                      },
                      "body": {
                        "type": "string",
                        "minLength": 4,
                        "maxLength": 4000
                      },
                      "delivery": {
                        "$ref": "#/components/schemas/Delivery"
                      },
                      "ownerId": {
                        "type": "string",
                        "minLength": 1
                      },
                      "questionId": {
                        "type": "string",
                        "minLength": 1
                      },
                      "entityId": {
                        "type": "string",
                        "minLength": 1
                      },
                      "followsQueryId": {
                        "type": "string",
                        "minLength": 1
                      }
                    },
                    "required": [
                      "kind",
                      "vendorId",
                      "subject",
                      "title",
                      "body",
                      "delivery"
                    ],
                    "additionalProperties": false
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "Ledger-Position": {
                "$ref": "#/components/headers/LedgerPosition"
              },
              "Location": {
                "$ref": "#/components/headers/Location"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RaiseVendorQueryResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem400"
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "409": {
            "$ref": "#/components/responses/Problem409"
          },
          "412": {
            "$ref": "#/components/responses/Problem412"
          },
          "422": {
            "$ref": "#/components/responses/Problem422"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      }
    },
    "/v1/vendor-queries/from-arrival/{inboundEmailId}": {
      "get": {
        "operationId": "getArrivalQueryFacts",
        "summary": "Returns the facts a query about an arrived email is built from.",
        "description": "Returns the facts a query about an arrived email is built from. Needs the `ledger:read` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "purchases"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:read",
        "parameters": [
          {
            "name": "inboundEmailId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "inboundEmailId": {
                      "type": "string"
                    },
                    "receivedAt": {
                      "type": "string",
                      "minLength": 20
                    },
                    "senderDomain": {
                      "type": "string"
                    },
                    "authenticated": {
                      "type": "boolean"
                    },
                    "reading": {
                      "anyOf": [
                        {
                          "type": "object",
                          "properties": {
                            "verdict": {
                              "type": "string"
                            },
                            "decidedBy": {
                              "type": "string"
                            },
                            "reasonCode": {
                              "type": [
                                "string",
                                "null"
                              ]
                            }
                          },
                          "required": [
                            "verdict",
                            "decidedBy",
                            "reasonCode"
                          ],
                          "additionalProperties": false
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "suppliers": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "vendorId": {
                            "type": "string"
                          },
                          "displayName": {
                            "type": "string"
                          },
                          "matchedOn": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "vendorId",
                          "displayName",
                          "matchedOn"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "suggestedSubject": {
                      "type": "object",
                      "properties": {
                        "kind": {
                          "type": "string",
                          "enum": [
                            "BILL",
                            "VENDOR_CREDIT",
                            "AMBIGUOUS",
                            "VENDOR"
                          ]
                        },
                        "ids": {
                          "maxItems": 5,
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        },
                        "label": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "kind",
                        "ids",
                        "label"
                      ],
                      "additionalProperties": false
                    },
                    "reference": {
                      "anyOf": [
                        {
                          "type": "object",
                          "properties": {
                            "reference": {
                              "type": "string"
                            },
                            "queryId": {
                              "type": [
                                "string",
                                "null"
                              ]
                            }
                          },
                          "required": [
                            "reference",
                            "queryId"
                          ],
                          "additionalProperties": false
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "text": {
                      "type": "string"
                    },
                    "title": {
                      "type": "string",
                      "maxLength": 200
                    },
                    "owner": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "name": {
                          "type": "string"
                        },
                        "because": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "id",
                        "name",
                        "because"
                      ],
                      "additionalProperties": false
                    },
                    "existingQuery": {
                      "anyOf": [
                        {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "string"
                            },
                            "reference": {
                              "type": "string"
                            }
                          },
                          "required": [
                            "id",
                            "reference"
                          ],
                          "additionalProperties": false
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "wouldBeFiled": {
                      "type": "object",
                      "properties": {
                        "yes": {
                          "type": "boolean"
                        },
                        "skip": {
                          "anyOf": [
                            {
                              "$ref": "#/components/schemas/SkipOption1"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        }
                      },
                      "required": [
                        "yes",
                        "skip"
                      ],
                      "additionalProperties": false
                    },
                    "notOffered": {
                      "type": [
                        "string",
                        "null"
                      ]
                    }
                  },
                  "required": [
                    "inboundEmailId",
                    "receivedAt",
                    "senderDomain",
                    "authenticated",
                    "reading",
                    "suppliers",
                    "suggestedSubject",
                    "reference",
                    "text",
                    "title",
                    "owner",
                    "existingQuery",
                    "wouldBeFiled",
                    "notOffered"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "404": {
            "$ref": "#/components/responses/Problem404"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      }
    },
    "/v1/vendor-queries/payment-options": {
      "get": {
        "operationId": "listVendorQueryPaymentOptions",
        "summary": "Lists the payment options offered on vendor queries.",
        "description": "Lists the payment options offered on vendor queries. Needs the `ledger:read` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "purchases"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:read",
        "parameters": [
          {
            "name": "vendorId",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "entityId",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "q",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 100
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "default": 50,
              "type": "integer",
              "minimum": 1,
              "maximum": 200
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 512
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "vendorId": {
                            "type": "string"
                          },
                          "entityId": {
                            "type": "string"
                          },
                          "runId": {
                            "type": "string"
                          },
                          "paidOn": {
                            "type": "string",
                            "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                          },
                          "amountMinor": {
                            "type": "string",
                            "pattern": "^-?\\d+$"
                          },
                          "currency": {
                            "type": "string",
                            "pattern": "^[A-Z]{3}$"
                          },
                          "chequeNumber": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "billNumbers": {
                            "maxItems": 5,
                            "type": "array",
                            "items": {
                              "type": "string"
                            }
                          },
                          "billsMore": {
                            "type": "integer",
                            "minimum": 0,
                            "maximum": 9007199254740991
                          },
                          "entityTimeZone": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "id",
                          "vendorId",
                          "entityId",
                          "runId",
                          "paidOn",
                          "amountMinor",
                          "currency",
                          "chequeNumber",
                          "billNumbers",
                          "billsMore",
                          "entityTimeZone"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "nextCursor": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "total": {
                      "anyOf": [
                        {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  },
                  "required": [
                    "data",
                    "nextCursor",
                    "total"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "422": {
            "$ref": "#/components/responses/Problem422"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      }
    },
    "/v1/vendor-queries/policies": {
      "get": {
        "operationId": "listVendorQueryPolicies",
        "summary": "Lists the policies that raise vendor queries automatically.",
        "description": "Lists the policies that raise vendor queries automatically. Needs the `ledger:read` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "purchases"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:read",
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "default": 50,
              "type": "integer",
              "minimum": 1,
              "maximum": 200
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 512
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/ListVendorQueryPoliciesResponseItem"
                      }
                    },
                    "nextCursor": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "total": {
                      "anyOf": [
                        {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  },
                  "required": [
                    "data",
                    "nextCursor",
                    "total"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "422": {
            "$ref": "#/components/responses/Problem422"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      }
    },
    "/v1/vendor-queries/policies/preview": {
      "get": {
        "operationId": "previewVendorQueryPolicy",
        "summary": "Previews a policy that raises vendor queries before it is started.",
        "description": "Previews a policy that raises vendor queries before it is started. Needs the `ledger:admin` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "purchases"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:admin",
        "parameters": [
          {
            "name": "dailyCap",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 200
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "windowDays": {
                      "type": "number",
                      "const": 14
                    },
                    "wouldFile": {
                      "maxItems": 25,
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "inboundEmailId": {
                            "type": "string"
                          },
                          "receivedAt": {
                            "type": "string",
                            "minLength": 20
                          },
                          "vendorName": {
                            "type": "string"
                          },
                          "readingReasonCode": {
                            "type": [
                              "string",
                              "null"
                            ]
                          }
                        },
                        "required": [
                          "inboundEmailId",
                          "receivedAt",
                          "vendorName",
                          "readingReasonCode"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "wouldFileTotal": {
                      "type": "integer",
                      "minimum": 0,
                      "maximum": 9007199254740991
                    },
                    "wouldSkip": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "reason": {
                            "$ref": "#/components/schemas/SkipOption1"
                          },
                          "count": {
                            "type": "integer",
                            "minimum": 1,
                            "maximum": 9007199254740991
                          }
                        },
                        "required": [
                          "reason",
                          "count"
                        ],
                        "additionalProperties": false
                      }
                    }
                  },
                  "required": [
                    "windowDays",
                    "wouldFile",
                    "wouldFileTotal",
                    "wouldSkip"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "422": {
            "$ref": "#/components/responses/Problem422"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      }
    },
    "/v1/vendor-queries/policies/{policyId}/end": {
      "post": {
        "operationId": "endVendorQueryPolicy",
        "summary": "Ends a policy that raises vendor queries.",
        "description": "Ends a policy that raises vendor queries. Needs the `ledger:admin` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "purchases"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:admin",
        "parameters": [
          {
            "name": "policyId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "reason": {
                    "type": "string",
                    "minLength": 4,
                    "maxLength": 500
                  }
                },
                "required": [
                  "reason"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "Ledger-Position": {
                "$ref": "#/components/headers/LedgerPosition"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ListVendorQueryPoliciesResponseItem"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem400"
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "404": {
            "$ref": "#/components/responses/Problem404"
          },
          "409": {
            "$ref": "#/components/responses/Problem409"
          },
          "412": {
            "$ref": "#/components/responses/Problem412"
          },
          "422": {
            "$ref": "#/components/responses/Problem422"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      }
    },
    "/v1/vendor-queries/{queryId}": {
      "get": {
        "operationId": "getVendorQuery",
        "summary": "Returns one vendor query with its status.",
        "description": "Returns one vendor query with its status. Needs the `ledger:read` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "purchases"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:read",
        "parameters": [
          {
            "name": "queryId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RaiseVendorQueryResponse"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "404": {
            "$ref": "#/components/responses/Problem404"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      }
    },
    "/v1/vendor-queries/{queryId}/answer": {
      "post": {
        "operationId": "answerVendorQuery",
        "summary": "Answers a vendor query on behalf of the ledger.",
        "description": "Answers a vendor query on behalf of the ledger. Needs the `ledger:propose` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "purchases"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:propose",
        "parameters": [
          {
            "name": "queryId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "delivery": {
                    "$ref": "#/components/schemas/Delivery"
                  },
                  "factKeys": {
                    "$ref": "#/components/schemas/Keys"
                  },
                  "sentence": {
                    "type": "object",
                    "properties": {
                      "text": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 600
                      },
                      "source": {
                        "type": "string",
                        "enum": [
                          "STANDARD",
                          "AGENT_DRAFT",
                          "AGENT_DRAFT_EDITED",
                          "PERSON"
                        ]
                      },
                      "promptVersion": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 80
                      }
                    },
                    "required": [
                      "text",
                      "source"
                    ],
                    "additionalProperties": false
                  },
                  "expectedSeq": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 9007199254740991
                  },
                  "draft": {
                    "default": {
                      "requested": false,
                      "proposedKeys": []
                    },
                    "type": "object",
                    "properties": {
                      "requested": {
                        "type": "boolean"
                      },
                      "category": {
                        "type": "string",
                        "enum": [
                          "PAYMENT_STATUS",
                          "SHORT_PAID",
                          "NOT_RECEIVED",
                          "DUE_DATE",
                          "AMOUNT_DIFFERS",
                          "REMITTANCE_ADVICE",
                          "CREDIT",
                          "OTHER"
                        ]
                      },
                      "proposedKeys": {
                        "default": [],
                        "maxItems": 11,
                        "type": "array",
                        "items": {
                          "$ref": "#/components/schemas/KeysItem"
                        }
                      }
                    },
                    "required": [
                      "requested"
                    ],
                    "additionalProperties": false
                  }
                },
                "required": [
                  "delivery",
                  "factKeys",
                  "expectedSeq"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "Ledger-Position": {
                "$ref": "#/components/headers/LedgerPosition"
              },
              "Location": {
                "$ref": "#/components/headers/Location"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "reference": {
                      "type": "string",
                      "pattern": "^Q-[0-9A-F]{10}$"
                    },
                    "title": {
                      "type": "string"
                    },
                    "status": {
                      "type": "string",
                      "enum": [
                        "OPEN",
                        "RESOLVED",
                        "SET_ASIDE"
                      ]
                    },
                    "turn": {
                      "anyOf": [
                        {
                          "type": "string",
                          "enum": [
                            "US",
                            "SUPPLIER"
                          ]
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "vendor": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "displayName": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "id",
                        "displayName"
                      ],
                      "additionalProperties": false
                    },
                    "entityId": {
                      "type": "string"
                    },
                    "entityName": {
                      "type": "string"
                    },
                    "entityTimeZone": {
                      "type": "string"
                    },
                    "subject": {
                      "$ref": "#/components/schemas/Subject2"
                    },
                    "origin": {
                      "type": "string",
                      "enum": [
                        "PORTAL",
                        "EMAIL",
                        "RECORDED",
                        "OURS"
                      ]
                    },
                    "raisedAt": {
                      "type": "string",
                      "minLength": 20
                    },
                    "lastMessageAt": {
                      "type": "string",
                      "minLength": 20
                    },
                    "messageCount": {
                      "type": "integer",
                      "minimum": 1,
                      "maximum": 9007199254740991
                    },
                    "owner": {
                      "$ref": "#/components/schemas/Owner"
                    },
                    "mentionsBanking": {
                      "type": "boolean"
                    },
                    "filedUnder": {
                      "$ref": "#/components/schemas/FiledUnder"
                    },
                    "questionId": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "followsQueryId": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "aboutMinor": {
                      "anyOf": [
                        {
                          "type": "string",
                          "pattern": "^-?\\d+$"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "aboutCurrency": {
                      "anyOf": [
                        {
                          "type": "string",
                          "pattern": "^[A-Z]{3}$"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "waitingSince": {
                      "anyOf": [
                        {
                          "type": "string",
                          "minLength": 20
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "closedAt": {
                      "anyOf": [
                        {
                          "type": "string",
                          "minLength": 20
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "sentence": {
                      "type": "string"
                    },
                    "draftPausedUntil": {
                      "anyOf": [
                        {
                          "type": "string",
                          "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "raisedBy": {
                      "anyOf": [
                        {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "string"
                            },
                            "name": {
                              "type": "string"
                            }
                          },
                          "required": [
                            "id",
                            "name"
                          ],
                          "additionalProperties": false
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "arrival": {
                      "$ref": "#/components/schemas/Arrival"
                    },
                    "linkIssuer": {
                      "anyOf": [
                        {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "string"
                            },
                            "name": {
                              "type": "string"
                            }
                          },
                          "required": [
                            "id",
                            "name"
                          ],
                          "additionalProperties": false
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "closure": {
                      "$ref": "#/components/schemas/Closure"
                    },
                    "follows": {
                      "$ref": "#/components/schemas/Follows"
                    },
                    "blocked": {
                      "$ref": "#/components/schemas/Blocked"
                    },
                    "answerableBy": {
                      "$ref": "#/components/schemas/AnswerableBy"
                    },
                    "query": {
                      "$ref": "#/components/schemas/RaiseVendorQueryResponse"
                    },
                    "message": {
                      "$ref": "#/components/schemas/ListVendorQueryMessagesResponseItem"
                    },
                    "notice": {
                      "anyOf": [
                        {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "string"
                            }
                          },
                          "required": [
                            "id"
                          ],
                          "additionalProperties": false
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  },
                  "required": [
                    "id",
                    "reference",
                    "title",
                    "status",
                    "turn",
                    "vendor",
                    "entityId",
                    "entityName",
                    "entityTimeZone",
                    "subject",
                    "origin",
                    "raisedAt",
                    "lastMessageAt",
                    "messageCount",
                    "owner",
                    "mentionsBanking",
                    "filedUnder",
                    "questionId",
                    "followsQueryId",
                    "aboutMinor",
                    "aboutCurrency",
                    "waitingSince",
                    "closedAt",
                    "sentence",
                    "draftPausedUntil",
                    "raisedBy",
                    "arrival",
                    "linkIssuer",
                    "closure",
                    "follows",
                    "blocked",
                    "answerableBy",
                    "query",
                    "message",
                    "notice"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem400"
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "404": {
            "$ref": "#/components/responses/Problem404"
          },
          "409": {
            "$ref": "#/components/responses/Problem409"
          },
          "412": {
            "$ref": "#/components/responses/Problem412"
          },
          "422": {
            "$ref": "#/components/responses/Problem422"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      }
    },
    "/v1/vendor-queries/{queryId}/answer-draft": {
      "post": {
        "operationId": "draftVendorQueryAnswer",
        "summary": "Drafts the answer to a vendor query for a person to send.",
        "description": "Drafts the answer to a vendor query for a person to send. Needs the `ledger:propose` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "purchases"
        ],
        "x-stability-level": "beta",
        "x-eternify-read": true,
        "x-scope": "ledger:propose",
        "parameters": [
          {
            "name": "queryId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "availableFactKeys": {
                    "$ref": "#/components/schemas/ProposedKeys"
                  },
                  "note": {
                    "type": "string",
                    "maxLength": 280
                  }
                },
                "required": [
                  "availableFactKeys"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "drafted": {
                      "anyOf": [
                        {
                          "type": "object",
                          "properties": {
                            "category": {
                              "type": "string",
                              "enum": [
                                "PAYMENT_STATUS",
                                "SHORT_PAID",
                                "NOT_RECEIVED",
                                "DUE_DATE",
                                "AMOUNT_DIFFERS",
                                "REMITTANCE_ADVICE",
                                "CREDIT",
                                "OTHER"
                              ]
                            },
                            "factKeys": {
                              "$ref": "#/components/schemas/Keys"
                            },
                            "sentence": {
                              "type": "string",
                              "maxLength": 600
                            },
                            "promptVersion": {
                              "type": "string"
                            }
                          },
                          "required": [
                            "category",
                            "factKeys",
                            "sentence",
                            "promptVersion"
                          ],
                          "additionalProperties": false
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "why": {
                      "anyOf": [
                        {
                          "type": "string",
                          "enum": [
                            "DISCLOSURE",
                            "BUDGET",
                            "PROVIDER",
                            "UNPARSABLE",
                            "REFUSED",
                            "FIGURE_INVENTED",
                            "CONTACT_DETAIL",
                            "BANKING_WORDS",
                            "DECISION_PROMISE",
                            "PAUSED_AFTER_THREE_UNUSED",
                            "FACT_NOT_OFFERED",
                            "BANKING_MENTIONED",
                            "NOTHING_TO_ANSWER"
                          ]
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "resumesOn": {
                      "type": "string",
                      "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                    }
                  },
                  "required": [
                    "drafted",
                    "why"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "404": {
            "$ref": "#/components/responses/Problem404"
          },
          "422": {
            "$ref": "#/components/responses/Problem422"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      }
    },
    "/v1/vendor-queries/{queryId}/assign": {
      "post": {
        "operationId": "assignVendorQuery",
        "summary": "Assigns a vendor query to a person.",
        "description": "Assigns a vendor query to a person. Needs the `ledger:propose` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "purchases"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:propose",
        "parameters": [
          {
            "name": "queryId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "ownerId": {
                    "type": "string",
                    "minLength": 1
                  },
                  "expectedOwnerId": {
                    "type": "string",
                    "minLength": 1
                  }
                },
                "required": [
                  "ownerId",
                  "expectedOwnerId"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "Ledger-Position": {
                "$ref": "#/components/headers/LedgerPosition"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RaiseVendorQueryResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem400"
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "404": {
            "$ref": "#/components/responses/Problem404"
          },
          "409": {
            "$ref": "#/components/responses/Problem409"
          },
          "412": {
            "$ref": "#/components/responses/Problem412"
          },
          "422": {
            "$ref": "#/components/responses/Problem422"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      }
    },
    "/v1/vendor-queries/{queryId}/evidence": {
      "get": {
        "operationId": "getVendorQueryEvidence",
        "summary": "Returns the evidence attached to one vendor query.",
        "description": "Returns the evidence attached to one vendor query. Needs the `ledger:read` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "purchases"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:read",
        "parameters": [
          {
            "name": "queryId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "subject": {
                      "type": "object",
                      "properties": {
                        "kind": {
                          "type": "string",
                          "enum": [
                            "BILL",
                            "PAYMENT",
                            "VENDOR_CREDIT",
                            "VENDOR"
                          ]
                        },
                        "label": {
                          "type": "string"
                        },
                        "href": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "remittanceHref": {
                          "type": [
                            "string",
                            "null"
                          ]
                        }
                      },
                      "required": [
                        "kind",
                        "label",
                        "href",
                        "remittanceHref"
                      ],
                      "additionalProperties": false
                    },
                    "facts": {
                      "minItems": 11,
                      "maxItems": 11,
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "key": {
                            "$ref": "#/components/schemas/KeysItem"
                          },
                          "tellable": {
                            "type": "boolean"
                          },
                          "text": {
                            "type": "string"
                          },
                          "why": {
                            "type": [
                              "string",
                              "null"
                            ]
                          }
                        },
                        "required": [
                          "key",
                          "tellable",
                          "text",
                          "why"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "internal": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "label": {
                            "type": "string"
                          },
                          "text": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "label",
                          "text"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "language": {
                      "type": "string",
                      "enum": [
                        "en",
                        "fr"
                      ]
                    },
                    "evidenceAt": {
                      "type": "string",
                      "minLength": 20
                    },
                    "mentionsBanking": {
                      "type": "boolean"
                    },
                    "contact": {
                      "$ref": "#/components/schemas/AnswerableBy"
                    },
                    "recipients": {
                      "maxItems": 20,
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/RecipientsItem"
                      }
                    },
                    "canEmail": {
                      "type": "object",
                      "properties": {
                        "yes": {
                          "type": "boolean"
                        },
                        "why": {
                          "type": [
                            "string",
                            "null"
                          ]
                        }
                      },
                      "required": [
                        "yes",
                        "why"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "subject",
                    "facts",
                    "internal",
                    "language",
                    "evidenceAt",
                    "mentionsBanking",
                    "contact",
                    "recipients",
                    "canEmail"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "404": {
            "$ref": "#/components/responses/Problem404"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      }
    },
    "/v1/vendor-queries/{queryId}/messages": {
      "get": {
        "operationId": "listVendorQueryMessages",
        "summary": "Lists the messages on one vendor query.",
        "description": "Lists the messages on one vendor query. Needs the `ledger:read` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "purchases"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:read",
        "parameters": [
          {
            "name": "queryId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "default": 50,
              "type": "integer",
              "minimum": 1,
              "maximum": 200
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 512
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/ListVendorQueryMessagesResponseItem"
                      }
                    },
                    "nextCursor": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "total": {
                      "anyOf": [
                        {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  },
                  "required": [
                    "data",
                    "nextCursor",
                    "total"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "404": {
            "$ref": "#/components/responses/Problem404"
          },
          "422": {
            "$ref": "#/components/responses/Problem422"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      }
    },
    "/v1/vendor-queries/{queryId}/resolve": {
      "post": {
        "operationId": "resolveVendorQuery",
        "summary": "Resolves a vendor query with the outcome recorded.",
        "description": "Resolves a vendor query with the outcome recorded. Needs the `ledger:propose` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "purchases"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:propose",
        "parameters": [
          {
            "name": "queryId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "resolution": {
                    "type": "string",
                    "minLength": 4,
                    "maxLength": 2000
                  },
                  "expectedSeq": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 9007199254740991
                  },
                  "questionOutcome": {
                    "type": "string",
                    "enum": [
                      "NO_CHANGE",
                      "APPROVED",
                      "HELD",
                      "SENT_BACK",
                      "EDITED",
                      "SUPPLIER_ASKED",
                      "VOIDED"
                    ]
                  }
                },
                "required": [
                  "resolution",
                  "expectedSeq"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "Ledger-Position": {
                "$ref": "#/components/headers/LedgerPosition"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RaiseVendorQueryResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem400"
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "404": {
            "$ref": "#/components/responses/Problem404"
          },
          "409": {
            "$ref": "#/components/responses/Problem409"
          },
          "412": {
            "$ref": "#/components/responses/Problem412"
          },
          "422": {
            "$ref": "#/components/responses/Problem422"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      }
    },
    "/v1/vendor-queries/{queryId}/set-aside": {
      "post": {
        "operationId": "setAsideVendorQuery",
        "summary": "Sets a vendor query aside until a date.",
        "description": "Sets a vendor query aside until a date. Needs the `ledger:propose` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "purchases"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:propose",
        "parameters": [
          {
            "name": "queryId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "reason": {
                    "type": "string",
                    "minLength": 4,
                    "maxLength": 500
                  }
                },
                "required": [
                  "reason"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "Ledger-Position": {
                "$ref": "#/components/headers/LedgerPosition"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RaiseVendorQueryResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem400"
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "404": {
            "$ref": "#/components/responses/Problem404"
          },
          "409": {
            "$ref": "#/components/responses/Problem409"
          },
          "412": {
            "$ref": "#/components/responses/Problem412"
          },
          "422": {
            "$ref": "#/components/responses/Problem422"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      }
    },
    "/v1/vendor-queries/{queryId}/supplier-reply": {
      "post": {
        "operationId": "recordVendorQuerySupplierReply",
        "summary": "Records the reply a vendor sent to a query.",
        "description": "Records the reply a vendor sent to a query. Needs the `ledger:propose` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "purchases"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:propose",
        "parameters": [
          {
            "name": "queryId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "body": {
                    "type": "string",
                    "minLength": 4,
                    "maxLength": 4000
                  },
                  "channel": {
                    "type": "string",
                    "enum": [
                      "EMAIL",
                      "BY_HAND"
                    ]
                  },
                  "expectedSeq": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 9007199254740991
                  }
                },
                "required": [
                  "body",
                  "channel",
                  "expectedSeq"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "Ledger-Position": {
                "$ref": "#/components/headers/LedgerPosition"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RaiseVendorQueryResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem400"
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "404": {
            "$ref": "#/components/responses/Problem404"
          },
          "409": {
            "$ref": "#/components/responses/Problem409"
          },
          "412": {
            "$ref": "#/components/responses/Problem412"
          },
          "422": {
            "$ref": "#/components/responses/Problem422"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      }
    },
    "/v1/vendor-slip-identity-brief": {
      "post": {
        "operationId": "draftVendorSlipIdentity",
        "summary": "Drafts the identity details a vendor's slip filing needs.",
        "description": "Drafts the identity details a vendor's slip filing needs. Needs the `ledger:propose` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "purchases"
        ],
        "x-stability-level": "beta",
        "x-eternify-read": true,
        "x-scope": "ledger:propose",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "displayName": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 200
                  },
                  "legalName": {
                    "type": "string",
                    "maxLength": 200
                  },
                  "addressLine": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 500
                  }
                },
                "required": [
                  "displayName",
                  "addressLine"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "drafted": {
                      "anyOf": [
                        {
                          "type": "object",
                          "properties": {
                            "recipientType": {
                              "type": "string",
                              "enum": [
                                "INDIVIDUAL",
                                "CORPORATION",
                                "PARTNERSHIP"
                              ]
                            },
                            "surname": {
                              "type": "string",
                              "maxLength": 20
                            },
                            "givenName": {
                              "type": "string",
                              "maxLength": 12
                            },
                            "addressLine1": {
                              "type": "string",
                              "maxLength": 30
                            },
                            "addressLine2": {
                              "type": "string",
                              "maxLength": 30
                            },
                            "city": {
                              "type": "string",
                              "maxLength": 28
                            },
                            "region": {
                              "type": "string",
                              "pattern": "^[A-Z]{2}-[A-Z0-9]{1,3}$"
                            },
                            "postalCode": {
                              "type": "string",
                              "maxLength": 10
                            }
                          },
                          "required": [
                            "recipientType",
                            "addressLine1"
                          ],
                          "additionalProperties": false
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "why": {
                      "type": "string",
                      "enum": [
                        "DISCLOSURE",
                        "BUDGET",
                        "PROVIDER",
                        "UNPARSABLE",
                        "REFUSED",
                        "PART_INVENTED",
                        "STOPPED_AFTER_THREE_REWRITES"
                      ]
                    }
                  },
                  "required": [
                    "drafted"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "422": {
            "$ref": "#/components/responses/Problem422"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      }
    },
    "/v1/vendor-statements": {
      "post": {
        "operationId": "createVendorStatement",
        "summary": "Creates a statement of account received from a vendor.",
        "description": "Creates a statement of account received from a vendor. Needs the `ledger:propose` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "purchases"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:propose",
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "entityId": {
                    "type": "string",
                    "minLength": 1
                  },
                  "vendorId": {
                    "type": "string",
                    "minLength": 1
                  },
                  "source": {
                    "type": "string",
                    "enum": [
                      "UPLOAD",
                      "TYPED"
                    ]
                  },
                  "documentId": {
                    "type": "string",
                    "minLength": 1
                  },
                  "inboundEmailId": {
                    "type": "string",
                    "minLength": 1
                  },
                  "statementDate": {
                    "type": "string",
                    "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                  },
                  "closingMinor": {
                    "type": "string",
                    "pattern": "^-?\\d+$"
                  },
                  "basis": {
                    "type": "string",
                    "enum": [
                      "OPEN_ITEMS",
                      "ACTIVITY"
                    ]
                  },
                  "periodFrom": {
                    "type": "string",
                    "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                  }
                },
                "required": [
                  "entityId",
                  "source"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "Ledger-Position": {
                "$ref": "#/components/headers/LedgerPosition"
              },
              "Location": {
                "$ref": "#/components/headers/Location"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CreateVendorStatementResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem400"
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "409": {
            "$ref": "#/components/responses/Problem409"
          },
          "412": {
            "$ref": "#/components/responses/Problem412"
          },
          "422": {
            "$ref": "#/components/responses/Problem422"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      },
      "get": {
        "operationId": "listVendorStatements",
        "summary": "Lists the vendor statements received, with the server's total.",
        "description": "Lists the vendor statements received, with the server's total. Needs the `ledger:read` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "purchases"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:read",
        "parameters": [
          {
            "name": "q",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 200
            }
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "description": "One or more of READING, IN_REVIEW, ACCEPTED, DISCARDED, separated by commas.",
            "schema": {
              "type": "string",
              "description": "One or more of READING, IN_REVIEW, ACCEPTED, DISCARDED, separated by commas."
            }
          },
          {
            "name": "vendorId",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "entityId",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "from",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
            }
          },
          {
            "name": "to",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
            }
          },
          {
            "name": "awaiting",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "const": "review"
            }
          },
          {
            "name": "sort",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "date_desc",
                "date_asc",
                "vendor_asc",
                "status_asc"
              ]
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "default": 50,
              "type": "integer",
              "minimum": 1,
              "maximum": 200
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 512
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "entityId": {
                            "type": "string"
                          },
                          "entityName": {
                            "type": "string"
                          },
                          "entityTimeZone": {
                            "type": "string"
                          },
                          "vendor": {
                            "anyOf": [
                              {
                                "type": "object",
                                "properties": {
                                  "id": {
                                    "type": "string"
                                  },
                                  "displayName": {
                                    "type": "string"
                                  }
                                },
                                "required": [
                                  "id",
                                  "displayName"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "source": {
                            "type": "string",
                            "enum": [
                              "UPLOAD",
                              "MAILED",
                              "TYPED"
                            ]
                          },
                          "status": {
                            "type": "string",
                            "enum": [
                              "READING",
                              "IN_REVIEW",
                              "ACCEPTED",
                              "DISCARDED"
                            ]
                          },
                          "stalled": {
                            "type": "boolean"
                          },
                          "statementDate": {
                            "anyOf": [
                              {
                                "type": "string",
                                "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "statementNumber": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "supplierNamePrinted": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "addedBy": {
                            "anyOf": [
                              {
                                "type": "object",
                                "properties": {
                                  "id": {
                                    "type": "string"
                                  },
                                  "name": {
                                    "type": "string"
                                  }
                                },
                                "required": [
                                  "id",
                                  "name"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "currency": {
                            "anyOf": [
                              {
                                "type": "string",
                                "pattern": "^[A-Z]{3}$"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "readOutcome": {
                            "anyOf": [
                              {
                                "type": "string",
                                "enum": [
                                  "OK",
                                  "NOT_A_STATEMENT",
                                  "UNREADABLE",
                                  "DISCLOSURE",
                                  "BUDGET",
                                  "PROVIDER",
                                  "UNPARSABLE",
                                  "REFUSED",
                                  "FILE_COLUMNS",
                                  "TOO_LONG"
                                ]
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "linesKept": {
                            "type": "integer",
                            "minimum": 0,
                            "maximum": 9007199254740991
                          },
                          "acceptedBy": {
                            "anyOf": [
                              {
                                "type": "object",
                                "properties": {
                                  "id": {
                                    "type": "string"
                                  },
                                  "name": {
                                    "type": "string"
                                  }
                                },
                                "required": [
                                  "id",
                                  "name"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "acceptedAt": {
                            "anyOf": [
                              {
                                "type": "string",
                                "minLength": 20
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "addedAt": {
                            "type": "string",
                            "minLength": 20
                          },
                          "differenceMinor": {
                            "anyOf": [
                              {
                                "type": "string",
                                "pattern": "^-?\\d+$"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "closing": {
                            "anyOf": [
                              {
                                "type": "string",
                                "pattern": "^-?\\d+$"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "askingCounts": {
                            "anyOf": [
                              {
                                "type": "object",
                                "properties": {
                                  "differentOrTheirs": {
                                    "type": "integer",
                                    "minimum": 0,
                                    "maximum": 9007199254740991
                                  },
                                  "oursOnly": {
                                    "type": "integer",
                                    "minimum": 0,
                                    "maximum": 9007199254740991
                                  }
                                },
                                "required": [
                                  "differentOrTheirs",
                                  "oursOnly"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "null"
                              }
                            ]
                          }
                        },
                        "required": [
                          "id",
                          "entityId",
                          "entityName",
                          "entityTimeZone",
                          "vendor",
                          "source",
                          "status",
                          "stalled",
                          "statementDate",
                          "statementNumber",
                          "supplierNamePrinted",
                          "addedBy",
                          "currency",
                          "readOutcome",
                          "linesKept",
                          "acceptedBy",
                          "acceptedAt",
                          "addedAt",
                          "differenceMinor",
                          "closing",
                          "askingCounts"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "nextCursor": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "total": {
                      "anyOf": [
                        {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "counts": {
                      "type": "object",
                      "properties": {
                        "reading": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 9007199254740991
                        },
                        "inReview": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 9007199254740991
                        },
                        "accepted": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 9007199254740991
                        },
                        "discarded": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 9007199254740991
                        }
                      },
                      "required": [
                        "reading",
                        "inReview",
                        "accepted",
                        "discarded"
                      ],
                      "additionalProperties": false
                    },
                    "entityTimeZone": {
                      "type": [
                        "string",
                        "null"
                      ]
                    }
                  },
                  "required": [
                    "data",
                    "nextCursor",
                    "total",
                    "counts",
                    "entityTimeZone"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "422": {
            "$ref": "#/components/responses/Problem422"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      }
    },
    "/v1/vendor-statements/{vendorStatementId}": {
      "get": {
        "operationId": "getVendorStatement",
        "summary": "Returns one vendor statement with its status.",
        "description": "Returns one vendor statement with its status. Needs the `ledger:read` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "purchases"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:read",
        "parameters": [
          {
            "name": "vendorStatementId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Statement2"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "404": {
            "$ref": "#/components/responses/Problem404"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      },
      "patch": {
        "operationId": "updateVendorStatement",
        "summary": "Changes a vendor statement.",
        "description": "Changes a vendor statement. Needs the `ledger:propose` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "purchases"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:propose",
        "parameters": [
          {
            "name": "vendorStatementId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "seenRevision": {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 9007199254740991
                  },
                  "vendorId": {
                    "type": "string",
                    "minLength": 1
                  },
                  "basis": {
                    "type": "string",
                    "enum": [
                      "OPEN_ITEMS",
                      "ACTIVITY"
                    ]
                  },
                  "periodFrom": {
                    "anyOf": [
                      {
                        "type": "string",
                        "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "statementDate": {
                    "type": "string",
                    "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                  },
                  "currency": {
                    "type": "string",
                    "pattern": "^[A-Z]{3}$"
                  },
                  "openingMinor": {
                    "anyOf": [
                      {
                        "type": "string",
                        "pattern": "^-?\\d+$"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "closingMinor": {
                    "type": "string",
                    "pattern": "^-?\\d+$"
                  },
                  "statementNumber": {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 60
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                },
                "required": [
                  "seenRevision"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "Ledger-Position": {
                "$ref": "#/components/headers/LedgerPosition"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CreateVendorStatementResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem400"
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "404": {
            "$ref": "#/components/responses/Problem404"
          },
          "409": {
            "$ref": "#/components/responses/Problem409"
          },
          "412": {
            "$ref": "#/components/responses/Problem412"
          },
          "422": {
            "$ref": "#/components/responses/Problem422"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      }
    },
    "/v1/vendor-statements/{vendorStatementId}/accept": {
      "post": {
        "operationId": "acceptVendorStatement",
        "summary": "Accepts a vendor statement as reconciled.",
        "description": "Accepts a vendor statement as reconciled. Needs the `ledger:propose` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "purchases"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:propose",
        "parameters": [
          {
            "name": "vendorStatementId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "seenRevision": {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 9007199254740991
                  },
                  "reconciliationDigest": {
                    "type": "string",
                    "pattern": "^[0-9a-f]{64}$"
                  },
                  "supplierNameConfirmed": {
                    "default": false,
                    "type": "boolean"
                  }
                },
                "required": [
                  "seenRevision",
                  "reconciliationDigest"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "Ledger-Position": {
                "$ref": "#/components/headers/LedgerPosition"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CreateVendorStatementResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem400"
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "404": {
            "$ref": "#/components/responses/Problem404"
          },
          "409": {
            "$ref": "#/components/responses/Problem409"
          },
          "412": {
            "$ref": "#/components/responses/Problem412"
          },
          "422": {
            "$ref": "#/components/responses/Problem422"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      }
    },
    "/v1/vendor-statements/{vendorStatementId}/discard": {
      "post": {
        "operationId": "discardVendorStatement",
        "summary": "Discards a vendor statement.",
        "description": "Discards a vendor statement. Needs the `ledger:propose` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "purchases"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:propose",
        "parameters": [
          {
            "name": "vendorStatementId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "reason": {
                    "type": "string",
                    "minLength": 8,
                    "maxLength": 500
                  }
                },
                "required": [
                  "reason"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "Ledger-Position": {
                "$ref": "#/components/headers/LedgerPosition"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Statement2"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem400"
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "404": {
            "$ref": "#/components/responses/Problem404"
          },
          "409": {
            "$ref": "#/components/responses/Problem409"
          },
          "412": {
            "$ref": "#/components/responses/Problem412"
          },
          "422": {
            "$ref": "#/components/responses/Problem422"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      }
    },
    "/v1/vendor-statements/{vendorStatementId}/lines": {
      "put": {
        "operationId": "replaceVendorStatementLines",
        "summary": "Replaces the lines of a vendor statement.",
        "description": "Replaces the lines of a vendor statement. Needs the `ledger:propose` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "purchases"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:propose",
        "parameters": [
          {
            "name": "vendorStatementId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "seenRevision": {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 9007199254740991
                  },
                  "lines": {
                    "maxItems": 2000,
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "lineKind": {
                          "type": "string",
                          "enum": [
                            "INVOICE",
                            "CREDIT",
                            "PAYMENT",
                            "OTHER"
                          ]
                        },
                        "reference": {
                          "type": "string",
                          "maxLength": 100
                        },
                        "docDate": {
                          "type": "string",
                          "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                        },
                        "dueDate": {
                          "type": "string",
                          "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                        },
                        "amountMinor": {
                          "type": "string",
                          "pattern": "^-?\\d+$"
                        },
                        "taxMinor": {
                          "type": "string",
                          "pattern": "^-?\\d+$"
                        },
                        "excerpt": {
                          "type": "string",
                          "maxLength": 300
                        },
                        "confirmFigure": {
                          "type": "boolean"
                        }
                      },
                      "required": [
                        "lineKind",
                        "amountMinor"
                      ],
                      "additionalProperties": false
                    }
                  }
                },
                "required": [
                  "seenRevision",
                  "lines"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "Ledger-Position": {
                "$ref": "#/components/headers/LedgerPosition"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CreateVendorStatementResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem400"
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "404": {
            "$ref": "#/components/responses/Problem404"
          },
          "409": {
            "$ref": "#/components/responses/Problem409"
          },
          "412": {
            "$ref": "#/components/responses/Problem412"
          },
          "422": {
            "$ref": "#/components/responses/Problem422"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      }
    },
    "/v1/vendor-statements/{vendorStatementId}/lines/{lineId}/candidates": {
      "get": {
        "operationId": "listVendorStatementLineCandidates",
        "summary": "Lists the bills and payments a statement line may match.",
        "description": "Lists the bills and payments a statement line may match. Needs the `ledger:read` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "purchases"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:read",
        "parameters": [
          {
            "name": "vendorStatementId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "lineId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "q",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 100
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "default": 50,
              "type": "integer",
              "minimum": 1,
              "maximum": 200
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 512
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "kind": {
                            "type": "string",
                            "enum": [
                              "BILL",
                              "CREDIT",
                              "PAYMENT"
                            ]
                          },
                          "id": {
                            "type": "string"
                          },
                          "number": {
                            "type": "string"
                          },
                          "date": {
                            "anyOf": [
                              {
                                "type": "string",
                                "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "amountMinor": {
                            "type": "string",
                            "pattern": "^-?\\d+$"
                          },
                          "currency": {
                            "type": "string",
                            "pattern": "^[A-Z]{3}$"
                          },
                          "status": {
                            "type": "string"
                          },
                          "available": {
                            "type": "boolean"
                          },
                          "why": {
                            "type": [
                              "string",
                              "null"
                            ]
                          }
                        },
                        "required": [
                          "kind",
                          "id",
                          "number",
                          "date",
                          "amountMinor",
                          "currency",
                          "status",
                          "available",
                          "why"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "nextCursor": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "total": {
                      "anyOf": [
                        {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  },
                  "required": [
                    "data",
                    "nextCursor",
                    "total"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "404": {
            "$ref": "#/components/responses/Problem404"
          },
          "422": {
            "$ref": "#/components/responses/Problem422"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      }
    },
    "/v1/vendor-statements/{vendorStatementId}/lines/{lineId}/decline": {
      "post": {
        "operationId": "declineVendorStatementMatch",
        "summary": "Declines a suggested match for a vendor statement line.",
        "description": "Declines a suggested match for a vendor statement line. Needs the `ledger:propose` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "purchases"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:propose",
        "parameters": [
          {
            "name": "vendorStatementId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "lineId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "seenRevision": {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 9007199254740991
                  },
                  "reason": {
                    "type": "string",
                    "minLength": 8,
                    "maxLength": 300
                  }
                },
                "required": [
                  "seenRevision",
                  "reason"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "Ledger-Position": {
                "$ref": "#/components/headers/LedgerPosition"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CreateVendorStatementResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem400"
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "404": {
            "$ref": "#/components/responses/Problem404"
          },
          "409": {
            "$ref": "#/components/responses/Problem409"
          },
          "412": {
            "$ref": "#/components/responses/Problem412"
          },
          "422": {
            "$ref": "#/components/responses/Problem422"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      }
    },
    "/v1/vendor-statements/{vendorStatementId}/lines/{lineId}/link": {
      "post": {
        "operationId": "linkVendorStatementLine",
        "summary": "Links a statement line to the bill or payment it describes.",
        "description": "Links a statement line to the bill or payment it describes. Needs the `ledger:propose` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "purchases"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:propose",
        "parameters": [
          {
            "name": "vendorStatementId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "lineId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "seenRevision": {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 9007199254740991
                  },
                  "billId": {
                    "type": "string",
                    "minLength": 1
                  },
                  "vendorCreditId": {
                    "type": "string",
                    "minLength": 1
                  },
                  "paymentId": {
                    "type": "string",
                    "minLength": 1
                  },
                  "billSettlementId": {
                    "type": "string",
                    "minLength": 1
                  }
                },
                "required": [
                  "seenRevision"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "Ledger-Position": {
                "$ref": "#/components/headers/LedgerPosition"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CreateVendorStatementResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem400"
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "404": {
            "$ref": "#/components/responses/Problem404"
          },
          "409": {
            "$ref": "#/components/responses/Problem409"
          },
          "412": {
            "$ref": "#/components/responses/Problem412"
          },
          "422": {
            "$ref": "#/components/responses/Problem422"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      }
    },
    "/v1/vendor-statements/{vendorStatementId}/lines/{lineId}/unlink": {
      "post": {
        "operationId": "unlinkVendorStatementLine",
        "summary": "Removes the link between a statement line and its bill or payment.",
        "description": "Removes the link between a statement line and its bill or payment. Needs the `ledger:propose` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "purchases"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:propose",
        "parameters": [
          {
            "name": "vendorStatementId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "lineId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "seenRevision": {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 9007199254740991
                  }
                },
                "required": [
                  "seenRevision"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "Ledger-Position": {
                "$ref": "#/components/headers/LedgerPosition"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CreateVendorStatementResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem400"
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "404": {
            "$ref": "#/components/responses/Problem404"
          },
          "409": {
            "$ref": "#/components/responses/Problem409"
          },
          "412": {
            "$ref": "#/components/responses/Problem412"
          },
          "422": {
            "$ref": "#/components/responses/Problem422"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      }
    },
    "/v1/vendor-statements/{vendorStatementId}/notice-facts": {
      "get": {
        "operationId": "getVendorStatementNoticeFacts",
        "summary": "Returns the facts a notice about a vendor statement is built from.",
        "description": "Returns the facts a notice about a vendor statement is built from. Needs the `ledger:read` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "purchases"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:read",
        "parameters": [
          {
            "name": "vendorStatementId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetVendorStatementNoticeFactsResponse"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "404": {
            "$ref": "#/components/responses/Problem404"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      }
    },
    "/v1/vendor-statements/{vendorStatementId}/notices": {
      "post": {
        "operationId": "draftVendorStatementNotice",
        "summary": "Drafts a notice to a vendor about their statement.",
        "description": "Drafts a notice to a vendor about their statement. Needs the `ledger:propose` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "purchases"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:propose",
        "parameters": [
          {
            "name": "vendorStatementId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "recipientEmail": {
                    "type": "string",
                    "maxLength": 320,
                    "format": "email",
                    "pattern": "^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"
                  },
                  "sentence": {
                    "$ref": "#/components/schemas/Sentence"
                  },
                  "language": {
                    "type": "string",
                    "enum": [
                      "en",
                      "fr"
                    ]
                  }
                },
                "required": [
                  "recipientEmail"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "Ledger-Position": {
                "$ref": "#/components/headers/LedgerPosition"
              },
              "Location": {
                "$ref": "#/components/headers/Location"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DraftBankingNoticeResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem400"
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "404": {
            "$ref": "#/components/responses/Problem404"
          },
          "409": {
            "$ref": "#/components/responses/Problem409"
          },
          "412": {
            "$ref": "#/components/responses/Problem412"
          },
          "422": {
            "$ref": "#/components/responses/Problem422"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      }
    },
    "/v1/vendor-statements/{vendorStatementId}/read-again": {
      "post": {
        "operationId": "readVendorStatementAgain",
        "summary": "Reads a vendor statement again after it was corrected.",
        "description": "Reads a vendor statement again after it was corrected. Needs the `ledger:propose` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "purchases"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:propose",
        "parameters": [
          {
            "name": "vendorStatementId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "seenRevision": {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 9007199254740991
                  },
                  "replaceEdits": {
                    "type": "boolean"
                  }
                },
                "required": [
                  "seenRevision",
                  "replaceEdits"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "Ledger-Position": {
                "$ref": "#/components/headers/LedgerPosition"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CreateVendorStatementResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem400"
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "404": {
            "$ref": "#/components/responses/Problem404"
          },
          "409": {
            "$ref": "#/components/responses/Problem409"
          },
          "412": {
            "$ref": "#/components/responses/Problem412"
          },
          "422": {
            "$ref": "#/components/responses/Problem422"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      }
    },
    "/v1/vendor-statements/{vendorStatementId}/recheck": {
      "get": {
        "operationId": "recheckVendorStatement",
        "summary": "Rechecks a vendor statement against the ledger.",
        "description": "Rechecks a vendor statement against the ledger. Needs the `ledger:read` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "purchases"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:read",
        "parameters": [
          {
            "name": "vendorStatementId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "column",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "both",
                "different",
                "theirs",
                "ours"
              ]
            }
          },
          {
            "name": "q",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 200
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "default": 50,
              "type": "integer",
              "minimum": 1,
              "maximum": 200
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 512
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Rows2"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "404": {
            "$ref": "#/components/responses/Problem404"
          },
          "422": {
            "$ref": "#/components/responses/Problem422"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      }
    },
    "/v1/vendor-statements/{vendorStatementId}/rows": {
      "get": {
        "operationId": "listVendorStatementRows",
        "summary": "Lists the rows of one vendor statement.",
        "description": "Lists the rows of one vendor statement. Needs the `ledger:read` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "purchases"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:read",
        "parameters": [
          {
            "name": "vendorStatementId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "column",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "both",
                "different",
                "theirs",
                "ours"
              ]
            }
          },
          {
            "name": "q",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 200
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "default": 50,
              "type": "integer",
              "minimum": 1,
              "maximum": 200
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 512
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Rows2"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "404": {
            "$ref": "#/components/responses/Problem404"
          },
          "422": {
            "$ref": "#/components/responses/Problem422"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      }
    },
    "/v1/vendors": {
      "get": {
        "operationId": "listVendors",
        "summary": "Lists the vendors on the ledger, with the server's total.",
        "description": "Lists the vendors on the ledger, with the server's total. Needs the `ledger:read` permission. Stable: a change that breaks callers needs 365 days' notice.",
        "tags": [
          "purchases"
        ],
        "x-stability-level": "stable",
        "x-scope": "ledger:read",
        "parameters": [
          {
            "name": "status",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "ACTIVE",
                "ARCHIVED"
              ]
            }
          },
          {
            "name": "bankingPending",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "true",
                "false"
              ]
            }
          },
          {
            "name": "paymentHold",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "true",
                "false"
              ]
            }
          },
          {
            "name": "q",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 100
            }
          },
          {
            "name": "entityId",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "money",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "true",
                "false"
              ]
            }
          },
          {
            "name": "notice",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "owed"
              ]
            }
          },
          {
            "name": "acceptance",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "PENDING_ACCEPTANCE",
                "ACCEPTED",
                "REFUSED",
                "NOT_REVIEWED"
              ]
            }
          },
          {
            "name": "handoff",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "notTold"
              ]
            }
          },
          {
            "name": "bankingAwaiting",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "myVerification"
              ]
            }
          },
          {
            "name": "registration",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "unconfirmed"
              ]
            }
          },
          {
            "name": "paper",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "notCurrent",
                "expiring"
              ]
            }
          },
          {
            "name": "portal",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "waiting"
              ]
            }
          },
          {
            "name": "sort",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 64
            }
          },
          {
            "name": "cf",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 4000
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "default": 50,
              "type": "integer",
              "minimum": 1,
              "maximum": 200
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 512
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/ListVendorsResponseItem"
                      }
                    },
                    "nextCursor": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "total": {
                      "anyOf": [
                        {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  },
                  "required": [
                    "data",
                    "nextCursor",
                    "total"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "422": {
            "$ref": "#/components/responses/Problem422"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      },
      "post": {
        "operationId": "createVendor",
        "summary": "Creates a vendor on the ledger.",
        "description": "Creates a vendor on the ledger. Needs the `ledger:propose` permission. Stable: a change that breaks callers needs 365 days' notice.",
        "tags": [
          "purchases"
        ],
        "x-stability-level": "stable",
        "x-scope": "ledger:propose",
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "displayName": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 200
                  },
                  "legalName": {
                    "type": "string",
                    "maxLength": 200
                  },
                  "taxNumber": {
                    "type": "string",
                    "pattern": "^[0-9]{9}RT[0-9]{4}$"
                  },
                  "slipKind": {
                    "default": "NONE",
                    "type": "string",
                    "enum": [
                      "NONE",
                      "T4A",
                      "T5018",
                      "T4A_NR"
                    ]
                  },
                  "defaultAccountId": {
                    "type": "string",
                    "minLength": 1
                  },
                  "paymentTermsId": {
                    "type": "string",
                    "minLength": 1
                  },
                  "email": {
                    "type": "string",
                    "maxLength": 200,
                    "format": "email",
                    "pattern": "^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"
                  },
                  "phone": {
                    "type": "string",
                    "maxLength": 50
                  },
                  "address": {
                    "type": "string",
                    "maxLength": 500
                  },
                  "recipientType": {
                    "type": "string",
                    "enum": [
                      "INDIVIDUAL",
                      "CORPORATION",
                      "PARTNERSHIP"
                    ]
                  },
                  "surname": {
                    "type": "string",
                    "maxLength": 20
                  },
                  "givenName": {
                    "type": "string",
                    "maxLength": 12
                  },
                  "addressLine1": {
                    "type": "string",
                    "maxLength": 30
                  },
                  "addressLine2": {
                    "type": "string",
                    "maxLength": 30
                  },
                  "city": {
                    "type": "string",
                    "maxLength": 28
                  },
                  "region": {
                    "type": "string",
                    "pattern": "^[A-Z]{2}-[A-Z0-9]{1,3}$"
                  },
                  "postalCode": {
                    "type": "string",
                    "pattern": "^[A-Z0-9 ]{1,10}$"
                  },
                  "country": {
                    "type": "string",
                    "pattern": "^[A-Z]{2}$"
                  },
                  "notes": {
                    "type": "string",
                    "maxLength": 2000
                  },
                  "defaultCurrency": {
                    "type": "string",
                    "pattern": "^[A-Z]{3}$"
                  },
                  "language": {
                    "type": "string",
                    "enum": [
                      "en",
                      "fr"
                    ]
                  },
                  "qstNumber": {
                    "type": "string",
                    "maxLength": 32,
                    "pattern": "^[0-9]{10}TQ[0-9]{4}$"
                  },
                  "gstRegistrationState": {
                    "default": "UNKNOWN",
                    "type": "string",
                    "enum": [
                      "REGISTERED",
                      "NOT_REGISTERED",
                      "UNKNOWN"
                    ]
                  },
                  "residency": {
                    "default": "UNKNOWN",
                    "type": "string",
                    "enum": [
                      "CANADA",
                      "NON_RESIDENT",
                      "UNKNOWN"
                    ]
                  },
                  "contacts": {
                    "maxItems": 20,
                    "type": "array",
                    "items": {
                      "$ref": "#/components/schemas/ContactsItem"
                    }
                  },
                  "customFields": {
                    "$ref": "#/components/schemas/CustomFields3"
                  }
                },
                "required": [
                  "displayName"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "Ledger-Position": {
                "$ref": "#/components/headers/LedgerPosition"
              },
              "Location": {
                "$ref": "#/components/headers/Location"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CreateVendorResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem400"
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "409": {
            "$ref": "#/components/responses/Problem409"
          },
          "412": {
            "$ref": "#/components/responses/Problem412"
          },
          "422": {
            "$ref": "#/components/responses/Problem422"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      }
    },
    "/v1/vendors/bulk/payment-hold": {
      "post": {
        "operationId": "bulkHoldVendorPayments",
        "summary": "Puts the payments to several vendors on hold in one request.",
        "description": "Puts the payments to several vendors on hold in one request. Needs the `ledger:approve` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "purchases"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:approve",
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BulkHoldVendorPaymentsRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "Ledger-Position": {
                "$ref": "#/components/headers/LedgerPosition"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BulkHoldVendorPaymentsResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem400"
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "409": {
            "$ref": "#/components/responses/Problem409"
          },
          "412": {
            "$ref": "#/components/responses/Problem412"
          },
          "422": {
            "$ref": "#/components/responses/Problem422"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      }
    },
    "/v1/vendors/bulk/payment-hold/release": {
      "post": {
        "operationId": "bulkReleaseVendorHolds",
        "summary": "Releases the payment holds on several vendors in one request.",
        "description": "Releases the payment holds on several vendors in one request. Needs the `ledger:approve` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "purchases"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:approve",
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BulkHoldVendorPaymentsRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "Ledger-Position": {
                "$ref": "#/components/headers/LedgerPosition"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BulkHoldVendorPaymentsResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem400"
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "409": {
            "$ref": "#/components/responses/Problem409"
          },
          "412": {
            "$ref": "#/components/responses/Problem412"
          },
          "422": {
            "$ref": "#/components/responses/Problem422"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      }
    },
    "/v1/vendors/provider-links": {
      "post": {
        "operationId": "linkVendorPairs",
        "summary": "Links vendors that are the same supplier in two systems.",
        "description": "Links vendors that are the same supplier in two systems. Needs the `ledger:propose` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "purchases"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:propose",
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "provider": {
                    "type": "string",
                    "enum": [
                      "QBO",
                      "XERO"
                    ]
                  },
                  "connectionId": {
                    "type": "string",
                    "minLength": 1
                  },
                  "pairs": {
                    "minItems": 1,
                    "maxItems": 200,
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "vendorId": {
                          "type": "string",
                          "minLength": 1
                        },
                        "externalId": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 255
                        },
                        "externalLabel": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 255
                        }
                      },
                      "required": [
                        "vendorId",
                        "externalId",
                        "externalLabel"
                      ],
                      "additionalProperties": false
                    }
                  }
                },
                "required": [
                  "provider",
                  "pairs"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "Ledger-Position": {
                "$ref": "#/components/headers/LedgerPosition"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "linked": {
                      "type": "integer",
                      "minimum": 0,
                      "maximum": 9007199254740991
                    }
                  },
                  "required": [
                    "linked"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem400"
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "409": {
            "$ref": "#/components/responses/Problem409"
          },
          "412": {
            "$ref": "#/components/responses/Problem412"
          },
          "422": {
            "$ref": "#/components/responses/Problem422"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      }
    },
    "/v1/vendors/review": {
      "get": {
        "operationId": "listVendorsForReview",
        "summary": "Lists the vendors waiting for a person to review them.",
        "description": "Lists the vendors waiting for a person to review them. Needs the `ledger:read` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "purchases"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:read",
        "parameters": [
          {
            "name": "state",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "NOT_REVIEWED",
                "PENDING_ACCEPTANCE",
                "REFUSED"
              ]
            }
          },
          {
            "name": "q",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 100
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "default": 50,
              "type": "integer",
              "minimum": 1,
              "maximum": 200
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 512
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "rows": {
                      "type": "object",
                      "properties": {
                        "data": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "vendor": {
                                "$ref": "#/components/schemas/ListVendorsResponseItem"
                              },
                              "paid": {
                                "type": "array",
                                "items": {
                                  "type": "object",
                                  "properties": {
                                    "currency": {
                                      "type": "string",
                                      "pattern": "^[A-Z]{3}$"
                                    },
                                    "paidMinor": {
                                      "type": "string",
                                      "pattern": "^-?\\d+$"
                                    }
                                  },
                                  "required": [
                                    "currency",
                                    "paidMinor"
                                  ],
                                  "additionalProperties": false
                                }
                              },
                              "paymentCount": {
                                "type": "integer",
                                "minimum": 0,
                                "maximum": 9007199254740991
                              }
                            },
                            "required": [
                              "vendor",
                              "paid",
                              "paymentCount"
                            ],
                            "additionalProperties": false
                          }
                        },
                        "nextCursor": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "total": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "minimum": -9007199254740991,
                              "maximum": 9007199254740991
                            },
                            {
                              "type": "null"
                            }
                          ]
                        }
                      },
                      "required": [
                        "data",
                        "nextCursor",
                        "total"
                      ],
                      "additionalProperties": false
                    },
                    "ranked": {
                      "type": "boolean"
                    },
                    "awaitingAcceptance": {
                      "type": "integer",
                      "minimum": 0,
                      "maximum": 9007199254740991
                    },
                    "notReviewed": {
                      "type": "integer",
                      "minimum": 0,
                      "maximum": 9007199254740991
                    }
                  },
                  "required": [
                    "rows",
                    "ranked",
                    "awaitingAcceptance",
                    "notReviewed"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "422": {
            "$ref": "#/components/responses/Problem422"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      }
    },
    "/v1/vendors/{vendorId}": {
      "get": {
        "operationId": "getVendor",
        "summary": "Returns one vendor with its terms, contacts and status.",
        "description": "Returns one vendor with its terms, contacts and status. Needs the `ledger:read` permission. Stable: a change that breaks callers needs 365 days' notice.",
        "tags": [
          "purchases"
        ],
        "x-stability-level": "stable",
        "x-scope": "ledger:read",
        "parameters": [
          {
            "name": "vendorId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "default": 50,
              "type": "integer",
              "minimum": 1,
              "maximum": 200
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 512
            }
          },
          {
            "name": "coordinates",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "true",
                "false"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CreateVendorResponse"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "404": {
            "$ref": "#/components/responses/Problem404"
          },
          "422": {
            "$ref": "#/components/responses/Problem422"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      },
      "patch": {
        "operationId": "updateVendor",
        "summary": "Changes a vendor's details or terms.",
        "description": "Changes a vendor's details or terms. Needs the `ledger:propose` permission. Stable: a change that breaks callers needs 365 days' notice.",
        "tags": [
          "purchases"
        ],
        "x-stability-level": "stable",
        "x-scope": "ledger:propose",
        "parameters": [
          {
            "name": "vendorId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "displayName": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 200
                  },
                  "legalName": {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 200
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "email": {
                    "$ref": "#/components/schemas/Email"
                  },
                  "phone": {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 50
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "address": {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 500
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "addressLine1": {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 30
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "addressLine2": {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 30
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "city": {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 28
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "region": {
                    "anyOf": [
                      {
                        "type": "string",
                        "pattern": "^[A-Z]{2}-[A-Z0-9]{1,3}$"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "postalCode": {
                    "anyOf": [
                      {
                        "type": "string",
                        "pattern": "^[A-Z0-9 ]{1,10}$"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "country": {
                    "type": "string",
                    "pattern": "^[A-Z]{2}$"
                  },
                  "notes": {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 2000
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "defaultCurrency": {
                    "anyOf": [
                      {
                        "type": "string",
                        "pattern": "^[A-Z]{3}$"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "language": {
                    "type": "string",
                    "enum": [
                      "en",
                      "fr"
                    ]
                  },
                  "customFields": {
                    "$ref": "#/components/schemas/CustomFields4"
                  }
                },
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "Ledger-Position": {
                "$ref": "#/components/headers/LedgerPosition"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ListVendorsResponseItem"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem400"
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "404": {
            "$ref": "#/components/responses/Problem404"
          },
          "409": {
            "$ref": "#/components/responses/Problem409"
          },
          "412": {
            "$ref": "#/components/responses/Problem412"
          },
          "422": {
            "$ref": "#/components/responses/Problem422"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      }
    },
    "/v1/vendors/{vendorId}/accept": {
      "post": {
        "operationId": "acceptVendor",
        "summary": "Accepts a vendor onto the ledger after its details are checked.",
        "description": "Accepts a vendor onto the ledger after its details are checked. Needs the `ledger:approve` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "purchases"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:approve",
        "parameters": [
          {
            "name": "vendorId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "note": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 500
                  },
                  "duplicatesShown": {
                    "default": [],
                    "maxItems": 8,
                    "type": "array",
                    "items": {
                      "type": "string",
                      "minLength": 1
                    }
                  },
                  "similarNameShown": {
                    "default": false,
                    "type": "boolean"
                  }
                },
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "Ledger-Position": {
                "$ref": "#/components/headers/LedgerPosition"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ListVendorsResponseItem"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem400"
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "404": {
            "$ref": "#/components/responses/Problem404"
          },
          "409": {
            "$ref": "#/components/responses/Problem409"
          },
          "412": {
            "$ref": "#/components/responses/Problem412"
          },
          "422": {
            "$ref": "#/components/responses/Problem422"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      }
    },
    "/v1/vendors/{vendorId}/account-statement": {
      "get": {
        "operationId": "getVendorAccountStatement",
        "summary": "Returns the account statement the ledger holds for a vendor.",
        "description": "Returns the account statement the ledger holds for a vendor. Needs the `ledger:read` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "purchases"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:read",
        "parameters": [
          {
            "name": "vendorId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "entityId",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "currency",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^[A-Z]{3}$"
            }
          },
          {
            "name": "asAt",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "vendor": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "displayName": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "id",
                        "displayName"
                      ],
                      "additionalProperties": false
                    },
                    "company": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "name": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "id",
                        "name"
                      ],
                      "additionalProperties": false
                    },
                    "currency": {
                      "type": "string",
                      "pattern": "^[A-Z]{3}$"
                    },
                    "asAt": {
                      "type": "string",
                      "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                    },
                    "rows": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "kind": {
                            "type": "string",
                            "enum": [
                              "BILL",
                              "CREDIT"
                            ]
                          },
                          "id": {
                            "type": "string"
                          },
                          "number": {
                            "type": "string"
                          },
                          "billDate": {
                            "type": "string",
                            "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                          },
                          "dueDate": {
                            "anyOf": [
                              {
                                "type": "string",
                                "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "bookedMinor": {
                            "type": "string",
                            "pattern": "^-?\\d+$"
                          },
                          "openMinor": {
                            "type": "string",
                            "pattern": "^-?\\d+$"
                          },
                          "column": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "kind",
                          "id",
                          "number",
                          "billDate",
                          "dueDate",
                          "bookedMinor",
                          "openMinor",
                          "column"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "payments": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "date": {
                            "type": "string",
                            "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                          },
                          "amountMinor": {
                            "type": "string",
                            "pattern": "^-?\\d+$"
                          },
                          "reference": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "method": {
                            "type": "string"
                          },
                          "billNumbers": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            }
                          }
                        },
                        "required": [
                          "date",
                          "amountMinor",
                          "reference",
                          "method",
                          "billNumbers"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "ageing": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "column": {
                            "type": "string"
                          },
                          "minor": {
                            "type": "string",
                            "pattern": "^-?\\d+$"
                          }
                        },
                        "required": [
                          "column",
                          "minor"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "closingMinor": {
                      "type": "string",
                      "pattern": "^-?\\d+$"
                    },
                    "ties": {
                      "type": "boolean",
                      "const": true
                    },
                    "supplierAgeingMinor": {
                      "type": "string",
                      "pattern": "^-?\\d+$"
                    },
                    "rowCount": {
                      "type": "integer",
                      "minimum": 0,
                      "maximum": 9007199254740991
                    },
                    "entityTimeZone": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "vendor",
                    "company",
                    "currency",
                    "asAt",
                    "rows",
                    "payments",
                    "ageing",
                    "closingMinor",
                    "ties",
                    "supplierAgeingMinor",
                    "rowCount",
                    "entityTimeZone"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "404": {
            "$ref": "#/components/responses/Problem404"
          },
          "422": {
            "$ref": "#/components/responses/Problem422"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      }
    },
    "/v1/vendors/{vendorId}/account-statement/notice-facts": {
      "get": {
        "operationId": "getVendorAccountStatementNoticeFacts",
        "summary": "Returns the facts a notice about a vendor's account statement is built from.",
        "description": "Returns the facts a notice about a vendor's account statement is built from. Needs the `ledger:read` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "purchases"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:read",
        "parameters": [
          {
            "name": "vendorId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "entityId",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "currency",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^[A-Z]{3}$"
            }
          },
          {
            "name": "asAt",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetVendorStatementNoticeFactsResponse"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "404": {
            "$ref": "#/components/responses/Problem404"
          },
          "422": {
            "$ref": "#/components/responses/Problem422"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      }
    },
    "/v1/vendors/{vendorId}/account-statement/notices": {
      "post": {
        "operationId": "draftVendorAccountStatement",
        "summary": "Drafts a notice that sends a vendor their account statement.",
        "description": "Drafts a notice that sends a vendor their account statement. Needs the `ledger:propose` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "purchases"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:propose",
        "parameters": [
          {
            "name": "vendorId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "entityId": {
                    "type": "string",
                    "minLength": 1
                  },
                  "currency": {
                    "type": "string",
                    "pattern": "^[A-Z]{3}$"
                  },
                  "asAt": {
                    "type": "string",
                    "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                  },
                  "recipientEmail": {
                    "type": "string",
                    "maxLength": 320,
                    "format": "email",
                    "pattern": "^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"
                  },
                  "sentence": {
                    "$ref": "#/components/schemas/Sentence"
                  },
                  "language": {
                    "type": "string",
                    "enum": [
                      "en",
                      "fr"
                    ]
                  }
                },
                "required": [
                  "entityId",
                  "currency",
                  "asAt",
                  "recipientEmail"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "Ledger-Position": {
                "$ref": "#/components/headers/LedgerPosition"
              },
              "Location": {
                "$ref": "#/components/headers/Location"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DraftBankingNoticeResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem400"
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "404": {
            "$ref": "#/components/responses/Problem404"
          },
          "409": {
            "$ref": "#/components/responses/Problem409"
          },
          "412": {
            "$ref": "#/components/responses/Problem412"
          },
          "422": {
            "$ref": "#/components/responses/Problem422"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      }
    },
    "/v1/vendors/{vendorId}/agreements": {
      "get": {
        "operationId": "listVendorAgreements",
        "summary": "Lists the agreements held with a vendor.",
        "description": "Lists the agreements held with a vendor. Needs the `ledger:read` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "purchases"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:read",
        "parameters": [
          {
            "name": "vendorId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "default": 50,
              "type": "integer",
              "minimum": 1,
              "maximum": 200
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 512
            }
          },
          {
            "name": "state",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "UPCOMING",
                "ACTIVE",
                "ACT_SOON",
                "ACT_BY_PASSED",
                "TERM_PASSED",
                "RENEWED",
                "ENDED"
              ]
            }
          },
          {
            "name": "entityId",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/ListVendorAgreementsResponseItem"
                      }
                    },
                    "nextCursor": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "total": {
                      "anyOf": [
                        {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "entityTimeZone": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "data",
                    "nextCursor",
                    "total",
                    "entityTimeZone"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "404": {
            "$ref": "#/components/responses/Problem404"
          },
          "422": {
            "$ref": "#/components/responses/Problem422"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      },
      "post": {
        "operationId": "recordVendorAgreement",
        "summary": "Records an agreement with a vendor.",
        "description": "Records an agreement with a vendor. Needs the `ledger:propose` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "purchases"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:propose",
        "parameters": [
          {
            "name": "vendorId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "entityId": {
                    "type": "string",
                    "minLength": 1
                  },
                  "name": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 160
                  },
                  "startsOn": {
                    "type": "string",
                    "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                  },
                  "endsOn": {
                    "type": "string",
                    "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                  },
                  "renewal": {
                    "type": "string",
                    "enum": [
                      "AUTO_RENEWS",
                      "ENDS",
                      "OPEN_ENDED"
                    ]
                  },
                  "noticeDays": {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 730
                  },
                  "committedAmount": {
                    "$ref": "#/components/schemas/CommittedOption1"
                  },
                  "accountId": {
                    "type": "string",
                    "minLength": 1
                  },
                  "vendorDocumentId": {
                    "type": "string",
                    "minLength": 1
                  },
                  "ownerUserId": {
                    "type": "string",
                    "minLength": 1
                  },
                  "note": {
                    "type": "string",
                    "maxLength": 500
                  },
                  "renewsAgreementId": {
                    "type": "string",
                    "minLength": 1
                  }
                },
                "required": [
                  "entityId",
                  "name",
                  "startsOn",
                  "renewal",
                  "ownerUserId"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "Ledger-Position": {
                "$ref": "#/components/headers/LedgerPosition"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ListVendorAgreementsResponseItem"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem400"
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "404": {
            "$ref": "#/components/responses/Problem404"
          },
          "409": {
            "$ref": "#/components/responses/Problem409"
          },
          "412": {
            "$ref": "#/components/responses/Problem412"
          },
          "422": {
            "$ref": "#/components/responses/Problem422"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      }
    },
    "/v1/vendors/{vendorId}/agreements/{agreementId}/decide": {
      "post": {
        "operationId": "decideVendorAgreement",
        "summary": "Approves or declines an agreement with a vendor.",
        "description": "Approves or declines an agreement with a vendor. Needs the `ledger:propose` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "purchases"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:propose",
        "parameters": [
          {
            "name": "vendorId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "agreementId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "decision": {
                    "type": "string",
                    "enum": [
                      "RENEW",
                      "LET_END"
                    ]
                  },
                  "note": {
                    "type": "string",
                    "maxLength": 500
                  }
                },
                "required": [
                  "decision"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "Ledger-Position": {
                "$ref": "#/components/headers/LedgerPosition"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ListVendorAgreementsResponseItem"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem400"
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "404": {
            "$ref": "#/components/responses/Problem404"
          },
          "409": {
            "$ref": "#/components/responses/Problem409"
          },
          "412": {
            "$ref": "#/components/responses/Problem412"
          },
          "422": {
            "$ref": "#/components/responses/Problem422"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      }
    },
    "/v1/vendors/{vendorId}/agreements/{agreementId}/end": {
      "post": {
        "operationId": "endVendorAgreement",
        "summary": "Ends an agreement with a vendor.",
        "description": "Ends an agreement with a vendor. Needs the `ledger:approve` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "purchases"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:approve",
        "parameters": [
          {
            "name": "vendorId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "agreementId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "reason": {
                    "type": "string",
                    "minLength": 4,
                    "maxLength": 500
                  }
                },
                "required": [
                  "reason"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "Ledger-Position": {
                "$ref": "#/components/headers/LedgerPosition"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ListVendorAgreementsResponseItem"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem400"
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "404": {
            "$ref": "#/components/responses/Problem404"
          },
          "409": {
            "$ref": "#/components/responses/Problem409"
          },
          "412": {
            "$ref": "#/components/responses/Problem412"
          },
          "422": {
            "$ref": "#/components/responses/Problem422"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      }
    },
    "/v1/vendors/{vendorId}/aliases": {
      "get": {
        "operationId": "listVendorAliases",
        "summary": "Lists the names a vendor is known by.",
        "description": "Lists the names a vendor is known by. Needs the `ledger:read` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "purchases"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:read",
        "parameters": [
          {
            "name": "vendorId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "default": 50,
              "type": "integer",
              "minimum": 1,
              "maximum": 200
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 512
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/ListVendorAliasesResponseItem"
                      }
                    },
                    "nextCursor": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "total": {
                      "anyOf": [
                        {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "entityTimeZone": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "data",
                    "nextCursor",
                    "total",
                    "entityTimeZone"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "404": {
            "$ref": "#/components/responses/Problem404"
          },
          "422": {
            "$ref": "#/components/responses/Problem422"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      },
      "post": {
        "operationId": "addVendorAlias",
        "summary": "Adds a name a vendor is known by.",
        "description": "Adds a name a vendor is known by. Needs the `ledger:approve` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "purchases"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:approve",
        "parameters": [
          {
            "name": "vendorId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "alias": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 200
                  }
                },
                "required": [
                  "alias"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "Ledger-Position": {
                "$ref": "#/components/headers/LedgerPosition"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ListVendorAliasesResponseItem"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem400"
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "404": {
            "$ref": "#/components/responses/Problem404"
          },
          "409": {
            "$ref": "#/components/responses/Problem409"
          },
          "412": {
            "$ref": "#/components/responses/Problem412"
          },
          "422": {
            "$ref": "#/components/responses/Problem422"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      }
    },
    "/v1/vendors/{vendorId}/archive": {
      "post": {
        "operationId": "archiveVendor",
        "summary": "Archives a vendor so no new bills can be raised against it.",
        "description": "Archives a vendor so no new bills can be raised against it. Needs the `ledger:approve` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "purchases"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:approve",
        "parameters": [
          {
            "name": "vendorId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "reason": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 500
                  }
                },
                "required": [
                  "reason"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "Ledger-Position": {
                "$ref": "#/components/headers/LedgerPosition"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ListVendorsResponseItem"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem400"
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "404": {
            "$ref": "#/components/responses/Problem404"
          },
          "409": {
            "$ref": "#/components/responses/Problem409"
          },
          "412": {
            "$ref": "#/components/responses/Problem412"
          },
          "422": {
            "$ref": "#/components/responses/Problem422"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      }
    },
    "/v1/vendors/{vendorId}/audit": {
      "get": {
        "operationId": "listVendorAudit",
        "summary": "Lists the audit trail of one vendor.",
        "description": "Lists the audit trail of one vendor. Needs the `ledger:read` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "purchases"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:read",
        "parameters": [
          {
            "name": "vendorId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "action",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "default": 50,
              "type": "integer",
              "minimum": 1,
              "maximum": 200
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 512
            }
          },
          {
            "name": "origin",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "ALL",
                "NATIVE",
                "IMPORTED"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AuditLogResponse"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "404": {
            "$ref": "#/components/responses/Problem404"
          },
          "422": {
            "$ref": "#/components/responses/Problem422"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      }
    },
    "/v1/vendors/{vendorId}/banking/{changeId}/brief": {
      "get": {
        "operationId": "getBankingChangeBrief",
        "summary": "Returns the brief a person reads before verifying a banking change.",
        "description": "Returns the brief a person reads before verifying a banking change. Needs the `ledger:approve` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "purchases"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:approve",
        "parameters": [
          {
            "name": "vendorId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "changeId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "changeId": {
                      "type": "string"
                    },
                    "vendorId": {
                      "type": "string"
                    },
                    "computedAt": {
                      "type": "string",
                      "minLength": 20
                    },
                    "entityTimeZone": {
                      "type": "string"
                    },
                    "signals": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "kind": {
                            "$ref": "#/components/schemas/Kind3"
                          },
                          "label": {
                            "type": "string"
                          },
                          "sentence": {
                            "type": "string"
                          },
                          "stored": {
                            "$ref": "#/components/schemas/Stored"
                          },
                          "cameUpAfterProposal": {
                            "type": "boolean"
                          },
                          "confirmedBefore": {
                            "type": "integer",
                            "minimum": 0,
                            "maximum": 9007199254740991
                          }
                        },
                        "required": [
                          "kind",
                          "label",
                          "sentence",
                          "stored",
                          "cameUpAfterProposal",
                          "confirmedBefore"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "suppressions": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "kind": {
                            "$ref": "#/components/schemas/Kind3"
                          },
                          "code": {
                            "type": "string",
                            "enum": [
                              "NO_PRIORS",
                              "OTHER_CURRENCY",
                              "FIRST_CHANGE"
                            ]
                          },
                          "sentence": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "kind",
                          "code",
                          "sentence"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "priorsExamined": {
                      "type": "object",
                      "properties": {
                        "knownDomains": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 9007199254740991
                        },
                        "earlierChanges": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 9007199254740991
                        },
                        "unpaidBillsRead": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 9007199254740991
                        },
                        "messagesRead": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 9007199254740991
                        }
                      },
                      "required": [
                        "knownDomains",
                        "earlierChanges",
                        "unpaidBillsRead",
                        "messagesRead"
                      ],
                      "additionalProperties": false
                    },
                    "printedOn": {
                      "maxItems": 5,
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "billId": {
                            "type": "string"
                          },
                          "number": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "receivedAt": {
                            "anyOf": [
                              {
                                "type": "string",
                                "minLength": 20
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "domain": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "standing": {
                            "type": "string",
                            "enum": [
                              "KNOWN",
                              "RETIRED",
                              "FIRST_TIME",
                              "NO_PRIORS",
                              "NO_VENDOR",
                              "NOT_MAILED",
                              "NOT_CHECKED"
                            ]
                          }
                        },
                        "required": [
                          "billId",
                          "number",
                          "receivedAt",
                          "domain",
                          "standing"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "printedOnTotal": {
                      "type": "integer",
                      "minimum": 0,
                      "maximum": 9007199254740991
                    },
                    "related": {
                      "maxItems": 10,
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/StoredOption1"
                      }
                    },
                    "relatedTotal": {
                      "type": "integer",
                      "minimum": 0,
                      "maximum": 9007199254740991
                    },
                    "history": {
                      "type": "object",
                      "properties": {
                        "earlierChanges": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 9007199254740991
                        },
                        "sameAccountRefusedBefore": {
                          "anyOf": [
                            {
                              "type": "object",
                              "properties": {
                                "changeId": {
                                  "type": "string"
                                },
                                "decidedAt": {
                                  "type": "string",
                                  "minLength": 20
                                },
                                "byName": {
                                  "type": "string"
                                },
                                "reason": {
                                  "type": "string"
                                }
                              },
                              "required": [
                                "changeId",
                                "decidedAt",
                                "byName",
                                "reason"
                              ],
                              "additionalProperties": false
                            },
                            {
                              "type": "null"
                            }
                          ]
                        }
                      },
                      "required": [
                        "earlierChanges",
                        "sameAccountRefusedBefore"
                      ],
                      "additionalProperties": false
                    },
                    "callback": {
                      "type": "object",
                      "properties": {
                        "numbers": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "number": {
                                "type": "string"
                              },
                              "source": {
                                "type": "string",
                                "enum": [
                                  "VENDOR_PHONE",
                                  "CONTACT"
                                ]
                              },
                              "label": {
                                "type": "string"
                              },
                              "onFileSince": {
                                "anyOf": [
                                  {
                                    "type": "string",
                                    "minLength": 20
                                  },
                                  {
                                    "type": "null"
                                  }
                                ]
                              }
                            },
                            "required": [
                              "number",
                              "source",
                              "label",
                              "onFileSince"
                            ],
                            "additionalProperties": false
                          }
                        },
                        "addedAfter": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "number": {
                                "type": "string"
                              },
                              "source": {
                                "type": "string",
                                "enum": [
                                  "VENDOR_PHONE",
                                  "CONTACT"
                                ]
                              },
                              "label": {
                                "type": "string"
                              },
                              "changedAt": {
                                "type": "string",
                                "minLength": 20
                              }
                            },
                            "required": [
                              "number",
                              "source",
                              "label",
                              "changedAt"
                            ],
                            "additionalProperties": false
                          }
                        },
                        "none": {
                          "type": "boolean"
                        }
                      },
                      "required": [
                        "numbers",
                        "addedAfter",
                        "none"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "changeId",
                    "vendorId",
                    "computedAt",
                    "entityTimeZone",
                    "signals",
                    "suppressions",
                    "priorsExamined",
                    "printedOn",
                    "printedOnTotal",
                    "related",
                    "relatedTotal",
                    "history",
                    "callback"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "404": {
            "$ref": "#/components/responses/Problem404"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      }
    },
    "/v1/vendors/{vendorId}/banking/{changeId}/evidence-read": {
      "post": {
        "operationId": "readBankingEvidence",
        "summary": "Reads the evidence a vendor's banking change arrived with.",
        "description": "Reads the evidence a vendor's banking change arrived with. Needs the `ledger:approve` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "purchases"
        ],
        "x-stability-level": "beta",
        "x-eternify-read": true,
        "x-scope": "ledger:approve",
        "parameters": [
          {
            "name": "vendorId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "changeId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "read": {
                      "anyOf": [
                        {
                          "type": "object",
                          "properties": {
                            "documentKind": {
                              "type": "string",
                              "enum": [
                                "VOID_CHEQUE",
                                "BANK_LETTER",
                                "STATEMENT",
                                "OTHER"
                              ]
                            },
                            "holderNamePrinted": {
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "namesTheSupplier": {
                              "type": "boolean"
                            },
                            "documentDate": {
                              "anyOf": [
                                {
                                  "type": "string",
                                  "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "legible": {
                              "type": "boolean"
                            },
                            "routing": {
                              "type": "string",
                              "enum": [
                                "AGREES",
                                "DIFFERS",
                                "NOT_FOUND"
                              ]
                            },
                            "holderName": {
                              "type": "string",
                              "enum": [
                                "AGREES",
                                "DIFFERS",
                                "NOT_FOUND"
                              ]
                            },
                            "promptVersion": {
                              "type": "string"
                            }
                          },
                          "required": [
                            "documentKind",
                            "holderNamePrinted",
                            "namesTheSupplier",
                            "documentDate",
                            "legible",
                            "routing",
                            "holderName",
                            "promptVersion"
                          ],
                          "additionalProperties": false
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "why": {
                      "type": "string",
                      "enum": [
                        "NO_EVIDENCE",
                        "UNREADABLE",
                        "DISCLOSURE",
                        "BUDGET",
                        "PROVIDER",
                        "UNPARSABLE",
                        "REFUSED"
                      ]
                    }
                  },
                  "required": [
                    "read"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "404": {
            "$ref": "#/components/responses/Problem404"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      }
    },
    "/v1/vendors/{vendorId}/banking/{changeId}/notice": {
      "post": {
        "operationId": "draftBankingNotice",
        "summary": "Drafts the notice that tells a vendor their banking details changed.",
        "description": "Drafts the notice that tells a vendor their banking details changed. Needs the `ledger:propose` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "purchases"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:propose",
        "parameters": [
          {
            "name": "vendorId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "changeId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "recipientEmail": {
                    "type": "string",
                    "maxLength": 320,
                    "format": "email",
                    "pattern": "^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"
                  }
                },
                "required": [
                  "recipientEmail"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "Ledger-Position": {
                "$ref": "#/components/headers/LedgerPosition"
              },
              "Location": {
                "$ref": "#/components/headers/Location"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DraftBankingNoticeResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem400"
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "404": {
            "$ref": "#/components/responses/Problem404"
          },
          "409": {
            "$ref": "#/components/responses/Problem409"
          },
          "412": {
            "$ref": "#/components/responses/Problem412"
          },
          "422": {
            "$ref": "#/components/responses/Problem422"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      }
    },
    "/v1/vendors/{vendorId}/banking/{changeId}/notice-sent": {
      "post": {
        "operationId": "markBankingNoticeSent",
        "summary": "Records that the notice of a vendor's banking change was sent.",
        "description": "Records that the notice of a vendor's banking change was sent. Needs the `ledger:propose` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "purchases"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:propose",
        "parameters": [
          {
            "name": "vendorId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "changeId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "recipient": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 320
                  },
                  "note": {
                    "type": "string",
                    "maxLength": 500
                  }
                },
                "required": [
                  "recipient"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "Ledger-Position": {
                "$ref": "#/components/headers/LedgerPosition"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ListVendorsResponseItem"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem400"
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "404": {
            "$ref": "#/components/responses/Problem404"
          },
          "409": {
            "$ref": "#/components/responses/Problem409"
          },
          "412": {
            "$ref": "#/components/responses/Problem412"
          },
          "422": {
            "$ref": "#/components/responses/Problem422"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      }
    },
    "/v1/vendors/{vendorId}/banking/{changeId}/reject": {
      "post": {
        "operationId": "rejectBankingChange",
        "summary": "Rejects a proposed change to a vendor's banking details.",
        "description": "Rejects a proposed change to a vendor's banking details. Needs the `ledger:approve` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "purchases"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:approve",
        "parameters": [
          {
            "name": "vendorId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "changeId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "reason": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 1000
                  },
                  "becauseOf": {
                    "default": [],
                    "maxItems": 6,
                    "type": "array",
                    "items": {
                      "type": "string",
                      "enum": [
                        "HOLDER_NAME_MISMATCH",
                        "NO_EVIDENCE",
                        "NEW_SENDER_DOMAIN",
                        "CHANGE_BEFORE_A_LARGE_BILL",
                        "SHORT_INTERVAL",
                        "SHARED_ACCOUNT"
                      ]
                    }
                  }
                },
                "required": [
                  "reason"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "Ledger-Position": {
                "$ref": "#/components/headers/LedgerPosition"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ListVendorsResponseItem"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem400"
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "404": {
            "$ref": "#/components/responses/Problem404"
          },
          "409": {
            "$ref": "#/components/responses/Problem409"
          },
          "412": {
            "$ref": "#/components/responses/Problem412"
          },
          "422": {
            "$ref": "#/components/responses/Problem422"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      }
    },
    "/v1/vendors/{vendorId}/banking/{changeId}/withdraw": {
      "post": {
        "operationId": "withdrawBankingChange",
        "summary": "Withdraws a proposed change to a vendor's banking details.",
        "description": "Withdraws a proposed change to a vendor's banking details. Needs the `ledger:propose` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "purchases"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:propose",
        "parameters": [
          {
            "name": "vendorId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "changeId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "reason": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 1000
                  }
                },
                "required": [
                  "reason"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "Ledger-Position": {
                "$ref": "#/components/headers/LedgerPosition"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ListVendorsResponseItem"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem400"
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "404": {
            "$ref": "#/components/responses/Problem404"
          },
          "409": {
            "$ref": "#/components/responses/Problem409"
          },
          "412": {
            "$ref": "#/components/responses/Problem412"
          },
          "422": {
            "$ref": "#/components/responses/Problem422"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      }
    },
    "/v1/vendors/{vendorId}/contacts": {
      "post": {
        "operationId": "addVendorContact",
        "summary": "Adds a contact person to a vendor.",
        "description": "Adds a contact person to a vendor. Needs the `ledger:propose` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "purchases"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:propose",
        "parameters": [
          {
            "name": "vendorId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ContactsItem"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "Ledger-Position": {
                "$ref": "#/components/headers/LedgerPosition"
              },
              "Location": {
                "$ref": "#/components/headers/Location"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AddVendorContactResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem400"
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "404": {
            "$ref": "#/components/responses/Problem404"
          },
          "409": {
            "$ref": "#/components/responses/Problem409"
          },
          "412": {
            "$ref": "#/components/responses/Problem412"
          },
          "422": {
            "$ref": "#/components/responses/Problem422"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      },
      "get": {
        "operationId": "listVendorContacts",
        "summary": "Lists the contacts of a vendor.",
        "description": "Lists the contacts of a vendor. Needs the `ledger:read` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "purchases"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:read",
        "parameters": [
          {
            "name": "vendorId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "q",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 100
            }
          },
          {
            "name": "withEmail",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "true",
                "false"
              ]
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "default": 50,
              "type": "integer",
              "minimum": 1,
              "maximum": 200
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 512
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "name": {
                            "type": "string"
                          },
                          "email": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "role": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "hasLiveLink": {
                            "type": "boolean"
                          }
                        },
                        "required": [
                          "id",
                          "name",
                          "email",
                          "role",
                          "hasLiveLink"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "nextCursor": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "total": {
                      "anyOf": [
                        {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  },
                  "required": [
                    "data",
                    "nextCursor",
                    "total"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "404": {
            "$ref": "#/components/responses/Problem404"
          },
          "422": {
            "$ref": "#/components/responses/Problem422"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      }
    },
    "/v1/vendors/{vendorId}/contacts/{contactId}": {
      "patch": {
        "operationId": "updateVendorContact",
        "summary": "Changes a vendor contact's details.",
        "description": "Changes a vendor contact's details. Needs the `ledger:propose` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "purchases"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:propose",
        "parameters": [
          {
            "name": "vendorId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "contactId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 120
                  },
                  "email": {
                    "$ref": "#/components/schemas/Email"
                  },
                  "phone": {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 50
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "role": {
                    "type": "string",
                    "enum": [
                      "BILLING",
                      "ACCOUNT_MANAGER",
                      "ESCALATION",
                      "REMITTANCE"
                    ]
                  },
                  "note": {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 500
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                },
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "Ledger-Position": {
                "$ref": "#/components/headers/LedgerPosition"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AddVendorContactResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem400"
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "404": {
            "$ref": "#/components/responses/Problem404"
          },
          "409": {
            "$ref": "#/components/responses/Problem409"
          },
          "412": {
            "$ref": "#/components/responses/Problem412"
          },
          "422": {
            "$ref": "#/components/responses/Problem422"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      },
      "delete": {
        "operationId": "removeVendorContact",
        "summary": "Removes a contact person from a vendor.",
        "description": "Removes a contact person from a vendor. Needs the `ledger:propose` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "purchases"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:propose",
        "parameters": [
          {
            "name": "vendorId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "contactId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "Ledger-Position": {
                "$ref": "#/components/headers/LedgerPosition"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/AddVendorContactResponse"
                      }
                    },
                    "nextCursor": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "total": {
                      "anyOf": [
                        {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  },
                  "required": [
                    "data",
                    "nextCursor",
                    "total"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem400"
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "404": {
            "$ref": "#/components/responses/Problem404"
          },
          "409": {
            "$ref": "#/components/responses/Problem409"
          },
          "412": {
            "$ref": "#/components/responses/Problem412"
          },
          "422": {
            "$ref": "#/components/responses/Problem422"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      }
    },
    "/v1/vendors/{vendorId}/contacts/{contactId}/slip-consent": {
      "post": {
        "operationId": "recordSlipConsent",
        "summary": "Records a vendor contact's consent to receive slips electronically.",
        "description": "Records a vendor contact's consent to receive slips electronically. Needs the `ledger:propose` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "purchases"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:propose",
        "parameters": [
          {
            "name": "vendorId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "contactId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "basis": {
                    "type": "string",
                    "enum": [
                      "WRITTEN",
                      "ELECTRONIC"
                    ]
                  },
                  "givenOn": {
                    "type": "string",
                    "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                  },
                  "note": {
                    "type": "string",
                    "minLength": 4,
                    "maxLength": 500
                  }
                },
                "required": [
                  "basis",
                  "givenOn",
                  "note"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "Ledger-Position": {
                "$ref": "#/components/headers/LedgerPosition"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AddVendorContactResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem400"
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "404": {
            "$ref": "#/components/responses/Problem404"
          },
          "409": {
            "$ref": "#/components/responses/Problem409"
          },
          "412": {
            "$ref": "#/components/responses/Problem412"
          },
          "422": {
            "$ref": "#/components/responses/Problem422"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      }
    },
    "/v1/vendors/{vendorId}/contacts/{contactId}/slip-consent/withdraw": {
      "post": {
        "operationId": "withdrawSlipConsent",
        "summary": "Withdraws a vendor contact's consent to receive slips electronically.",
        "description": "Withdraws a vendor contact's consent to receive slips electronically. Needs the `ledger:propose` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "purchases"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:propose",
        "parameters": [
          {
            "name": "vendorId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "contactId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "reason": {
                    "type": "string",
                    "minLength": 4,
                    "maxLength": 280
                  }
                },
                "required": [
                  "reason"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "Ledger-Position": {
                "$ref": "#/components/headers/LedgerPosition"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AddVendorContactResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem400"
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "404": {
            "$ref": "#/components/responses/Problem404"
          },
          "409": {
            "$ref": "#/components/responses/Problem409"
          },
          "412": {
            "$ref": "#/components/responses/Problem412"
          },
          "422": {
            "$ref": "#/components/responses/Problem422"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      }
    },
    "/v1/vendors/{vendorId}/destroyable-banking": {
      "get": {
        "operationId": "listDestroyableBanking",
        "summary": "Lists the banking details of a vendor that may be destroyed.",
        "description": "Lists the banking details of a vendor that may be destroyed. Needs the `ledger:admin` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "purchases"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:admin",
        "parameters": [
          {
            "name": "vendorId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "changes": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "changeId": {
                            "type": "string"
                          },
                          "scheme": {
                            "type": "string"
                          },
                          "accountNumberLast4": {
                            "anyOf": [
                              {
                                "type": "string",
                                "pattern": "^\\d{4}$"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "verifiedOn": {
                            "anyOf": [
                              {
                                "type": "string",
                                "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "replacedOn": {
                            "anyOf": [
                              {
                                "type": "string",
                                "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "paymentCount": {
                            "type": "integer",
                            "minimum": 0,
                            "maximum": 9007199254740991
                          },
                          "lastPaidOn": {
                            "anyOf": [
                              {
                                "type": "string",
                                "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "bankFileCount": {
                            "type": "integer",
                            "minimum": 0,
                            "maximum": 9007199254740991
                          }
                        },
                        "required": [
                          "changeId",
                          "scheme",
                          "accountNumberLast4",
                          "verifiedOn",
                          "replacedOn",
                          "paymentCount",
                          "lastPaidOn",
                          "bankFileCount"
                        ],
                        "additionalProperties": false
                      }
                    }
                  },
                  "required": [
                    "changes"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "404": {
            "$ref": "#/components/responses/Problem404"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      }
    },
    "/v1/vendors/{vendorId}/documents": {
      "get": {
        "operationId": "listVendorDocuments",
        "summary": "Lists the documents held for a vendor.",
        "description": "Lists the documents held for a vendor. Needs the `ledger:read` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "purchases"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:read",
        "parameters": [
          {
            "name": "vendorId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "default": 50,
              "type": "integer",
              "minimum": 1,
              "maximum": 200
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 512
            }
          },
          {
            "name": "view",
            "in": "query",
            "required": false,
            "schema": {
              "default": "live",
              "type": "string",
              "enum": [
                "live",
                "history"
              ]
            }
          },
          {
            "name": "kind",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "WSIB_CLEARANCE",
                "INSURANCE_CERTIFICATE",
                "MASTER_AGREEMENT",
                "W8BEN",
                "DIRECT_DEPOSIT_FORM",
                "WITHHOLDING_WAIVER",
                "OTHER"
              ]
            }
          },
          {
            "name": "withoutTerms",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "true",
                "false"
              ]
            }
          },
          {
            "name": "entityId",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/ListVendorDocumentsResponseItem"
                      }
                    },
                    "nextCursor": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "total": {
                      "anyOf": [
                        {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "standing": {
                      "$ref": "#/components/schemas/Standing"
                    },
                    "live": {
                      "type": "integer",
                      "minimum": 0,
                      "maximum": 200
                    },
                    "entityTimeZone": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "data",
                    "nextCursor",
                    "total",
                    "standing",
                    "live",
                    "entityTimeZone"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "404": {
            "$ref": "#/components/responses/Problem404"
          },
          "422": {
            "$ref": "#/components/responses/Problem422"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      },
      "post": {
        "operationId": "recordVendorDocument",
        "summary": "Records a document held for a vendor.",
        "description": "Records a document held for a vendor. Needs the `ledger:propose` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "purchases"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:propose",
        "parameters": [
          {
            "name": "vendorId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "documentId": {
                    "type": "string",
                    "minLength": 1
                  },
                  "kind": {
                    "type": "string",
                    "enum": [
                      "WSIB_CLEARANCE",
                      "INSURANCE_CERTIFICATE",
                      "MASTER_AGREEMENT",
                      "W8BEN",
                      "DIRECT_DEPOSIT_FORM",
                      "WITHHOLDING_WAIVER",
                      "OTHER"
                    ]
                  },
                  "title": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 160
                  },
                  "reference": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 120
                  },
                  "validFrom": {
                    "type": "string",
                    "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                  },
                  "validUntil": {
                    "type": "string",
                    "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                  },
                  "note": {
                    "type": "string",
                    "maxLength": 500
                  },
                  "replacesDocumentId": {
                    "type": "string",
                    "minLength": 1
                  },
                  "reading": {
                    "type": "object",
                    "properties": {
                      "promptVersion": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 60
                      },
                      "kindAgrees": {
                        "type": "boolean"
                      },
                      "validFromRead": {
                        "anyOf": [
                          {
                            "type": "string",
                            "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "validUntilRead": {
                        "anyOf": [
                          {
                            "type": "string",
                            "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                          },
                          {
                            "type": "null"
                          }
                        ]
                      }
                    },
                    "required": [
                      "promptVersion",
                      "kindAgrees",
                      "validFromRead",
                      "validUntilRead"
                    ],
                    "additionalProperties": false
                  },
                  "portalSubmissionId": {
                    "type": "string",
                    "minLength": 1
                  }
                },
                "required": [
                  "documentId",
                  "kind"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "Ledger-Position": {
                "$ref": "#/components/headers/LedgerPosition"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ListVendorDocumentsResponseItem"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem400"
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "404": {
            "$ref": "#/components/responses/Problem404"
          },
          "409": {
            "$ref": "#/components/responses/Problem409"
          },
          "412": {
            "$ref": "#/components/responses/Problem412"
          },
          "422": {
            "$ref": "#/components/responses/Problem422"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      }
    },
    "/v1/vendors/{vendorId}/documents/read": {
      "post": {
        "operationId": "readVendorPaper",
        "summary": "Reads the paper a vendor provided, such as a W-9 or a contract.",
        "description": "Reads the paper a vendor provided, such as a W-9 or a contract. Needs the `ledger:propose` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "purchases"
        ],
        "x-stability-level": "beta",
        "x-eternify-read": true,
        "x-scope": "ledger:propose",
        "parameters": [
          {
            "name": "vendorId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "documentId": {
                    "type": "string",
                    "minLength": 1
                  },
                  "kind": {
                    "type": "string",
                    "enum": [
                      "WSIB_CLEARANCE",
                      "INSURANCE_CERTIFICATE",
                      "MASTER_AGREEMENT",
                      "W8BEN",
                      "DIRECT_DEPOSIT_FORM",
                      "WITHHOLDING_WAIVER",
                      "OTHER"
                    ]
                  }
                },
                "required": [
                  "documentId",
                  "kind"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "read": {
                      "anyOf": [
                        {
                          "type": "object",
                          "properties": {
                            "promptVersion": {
                              "type": "string"
                            },
                            "kindAgrees": {
                              "type": "boolean"
                            },
                            "pageKind": {
                              "anyOf": [
                                {
                                  "type": "string",
                                  "enum": [
                                    "WSIB_CLEARANCE",
                                    "INSURANCE_CERTIFICATE",
                                    "MASTER_AGREEMENT",
                                    "W8BEN",
                                    "DIRECT_DEPOSIT_FORM",
                                    "WITHHOLDING_WAIVER",
                                    "OTHER"
                                  ]
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "validFrom": {
                              "$ref": "#/components/schemas/ValidFrom"
                            },
                            "validUntil": {
                              "$ref": "#/components/schemas/ValidFrom"
                            }
                          },
                          "required": [
                            "promptVersion",
                            "kindAgrees",
                            "pageKind",
                            "validFrom",
                            "validUntil"
                          ],
                          "additionalProperties": false
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "why": {
                      "anyOf": [
                        {
                          "type": "string",
                          "enum": [
                            "DISCLOSURE",
                            "BUDGET",
                            "PROVIDER",
                            "UNPARSABLE",
                            "REFUSED",
                            "UNREADABLE",
                            "SENSITIVE_KIND",
                            "PAUSED_AFTER_THREE_EDITED"
                          ]
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "pausedUntil": {
                      "anyOf": [
                        {
                          "type": "string",
                          "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  },
                  "required": [
                    "read",
                    "why",
                    "pausedUntil"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "404": {
            "$ref": "#/components/responses/Problem404"
          },
          "422": {
            "$ref": "#/components/responses/Problem422"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      }
    },
    "/v1/vendors/{vendorId}/documents/{documentId}/withdraw": {
      "post": {
        "operationId": "withdrawVendorDocument",
        "summary": "Withdraws a document held for a vendor.",
        "description": "Withdraws a document held for a vendor. Needs the `ledger:approve` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "purchases"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:approve",
        "parameters": [
          {
            "name": "vendorId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "documentId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "reason": {
                    "type": "string",
                    "minLength": 4,
                    "maxLength": 500
                  }
                },
                "required": [
                  "reason"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "Ledger-Position": {
                "$ref": "#/components/headers/LedgerPosition"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ListVendorDocumentsResponseItem"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem400"
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "404": {
            "$ref": "#/components/responses/Problem404"
          },
          "409": {
            "$ref": "#/components/responses/Problem409"
          },
          "412": {
            "$ref": "#/components/responses/Problem412"
          },
          "422": {
            "$ref": "#/components/responses/Problem422"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      }
    },
    "/v1/vendors/{vendorId}/duplicate-brief": {
      "post": {
        "operationId": "draftVendorDuplicateBrief",
        "summary": "Drafts the brief a person reads to decide whether two vendors are the same.",
        "description": "Drafts the brief a person reads to decide whether two vendors are the same. Needs the `ledger:approve` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "purchases"
        ],
        "x-stability-level": "beta",
        "x-eternify-read": true,
        "x-scope": "ledger:approve",
        "parameters": [
          {
            "name": "vendorId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DraftVendorDuplicateBriefResponse"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "404": {
            "$ref": "#/components/responses/Problem404"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      }
    },
    "/v1/vendors/{vendorId}/handoff-facts": {
      "get": {
        "operationId": "getHandoffFacts",
        "summary": "Returns the facts a handoff notice to a vendor's contact is built from.",
        "description": "Returns the facts a handoff notice to a vendor's contact is built from. Needs the `ledger:read` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "purchases"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:read",
        "parameters": [
          {
            "name": "vendorId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "entityId",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "vendor": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "displayName": {
                          "type": "string"
                        },
                        "language": {
                          "type": "string",
                          "enum": [
                            "en",
                            "fr"
                          ]
                        },
                        "status": {
                          "type": "string",
                          "enum": [
                            "ACTIVE",
                            "ARCHIVED"
                          ]
                        },
                        "acceptanceState": {
                          "type": "string",
                          "enum": [
                            "PENDING_ACCEPTANCE",
                            "ACCEPTED",
                            "REFUSED",
                            "NOT_REVIEWED"
                          ]
                        },
                        "paymentTermsName": {
                          "type": [
                            "string",
                            "null"
                          ]
                        }
                      },
                      "required": [
                        "id",
                        "displayName",
                        "language",
                        "status",
                        "acceptanceState",
                        "paymentTermsName"
                      ],
                      "additionalProperties": false
                    },
                    "entity": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "name": {
                          "type": "string"
                        },
                        "billTo": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "timeZone": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "id",
                        "name",
                        "billTo",
                        "timeZone"
                      ],
                      "additionalProperties": false
                    },
                    "addresses": {
                      "type": "object",
                      "properties": {
                        "data": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string"
                              },
                              "address": {
                                "type": "string"
                              },
                              "label": {
                                "type": "string"
                              },
                              "boundToThisVendor": {
                                "type": "boolean"
                              },
                              "watcher": {
                                "type": "object",
                                "properties": {
                                  "id": {
                                    "type": "string"
                                  },
                                  "name": {
                                    "type": "string"
                                  }
                                },
                                "required": [
                                  "id",
                                  "name"
                                ],
                                "additionalProperties": false
                              },
                              "watcherEmail": {
                                "type": "string"
                              },
                              "contact": {
                                "$ref": "#/components/schemas/Contact"
                              }
                            },
                            "required": [
                              "id",
                              "address",
                              "label",
                              "boundToThisVendor",
                              "watcher",
                              "watcherEmail",
                              "contact"
                            ],
                            "additionalProperties": false
                          }
                        },
                        "nextCursor": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "total": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "minimum": -9007199254740991,
                              "maximum": 9007199254740991
                            },
                            {
                              "type": "null"
                            }
                          ]
                        }
                      },
                      "required": [
                        "data",
                        "nextCursor",
                        "total"
                      ],
                      "additionalProperties": false
                    },
                    "recipients": {
                      "$ref": "#/components/schemas/Recipients"
                    },
                    "situation": {
                      "type": "string",
                      "enum": [
                        "NEW_SUPPLIER",
                        "NOT_USING_AN_INBOX",
                        "ALREADY_USING_AN_INBOX"
                      ]
                    },
                    "billCount": {
                      "type": "integer",
                      "minimum": 0,
                      "maximum": 9007199254740991
                    },
                    "inboxBillCount": {
                      "type": "integer",
                      "minimum": 0,
                      "maximum": 9007199254740991
                    },
                    "lastTold": {
                      "anyOf": [
                        {
                          "type": "object",
                          "properties": {
                            "at": {
                              "type": "string",
                              "minLength": 20
                            },
                            "by": {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string"
                                },
                                "name": {
                                  "type": "string"
                                }
                              },
                              "required": [
                                "id",
                                "name"
                              ],
                              "additionalProperties": false
                            },
                            "recipientEmail": {
                              "type": "string"
                            }
                          },
                          "required": [
                            "at",
                            "by",
                            "recipientEmail"
                          ],
                          "additionalProperties": false
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "openDrafts": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "noticeId": {
                            "type": "string"
                          },
                          "recipientEmail": {
                            "type": "string"
                          },
                          "inboundAddressId": {
                            "type": "string"
                          },
                          "createdAt": {
                            "type": "string",
                            "minLength": 20
                          },
                          "createdBy": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string"
                              },
                              "name": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "id",
                              "name"
                            ],
                            "additionalProperties": false
                          }
                        },
                        "required": [
                          "noticeId",
                          "recipientEmail",
                          "inboundAddressId",
                          "createdAt",
                          "createdBy"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "outboundApproved": {
                      "type": "boolean"
                    },
                    "entityTimeZone": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "vendor",
                    "entity",
                    "addresses",
                    "recipients",
                    "situation",
                    "billCount",
                    "inboxBillCount",
                    "lastTold",
                    "openDrafts",
                    "outboundApproved",
                    "entityTimeZone"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "404": {
            "$ref": "#/components/responses/Problem404"
          },
          "422": {
            "$ref": "#/components/responses/Problem422"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      }
    },
    "/v1/vendors/{vendorId}/handoff-paragraph": {
      "post": {
        "operationId": "draftHandoffParagraph",
        "summary": "Drafts the paragraph a handoff notice carries for one vendor.",
        "description": "Drafts the paragraph a handoff notice carries for one vendor. Needs the `ledger:propose` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "purchases"
        ],
        "x-stability-level": "beta",
        "x-eternify-read": true,
        "x-scope": "ledger:propose",
        "parameters": [
          {
            "name": "vendorId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "entityId": {
                    "type": "string",
                    "minLength": 1
                  },
                  "note": {
                    "default": "",
                    "type": "string",
                    "maxLength": 200
                  }
                },
                "required": [
                  "entityId"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "drafted": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "why": {
                      "type": "string",
                      "enum": [
                        "DISCLOSURE",
                        "BUDGET",
                        "PROVIDER",
                        "UNPARSABLE",
                        "REFUSED",
                        "FIGURE_INVENTED",
                        "CONTACT_DETAIL",
                        "BANKING_WORDS",
                        "PAUSED_AFTER_THREE_UNUSED"
                      ]
                    },
                    "promptVersion": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "resumesOn": {
                      "type": "string",
                      "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                    }
                  },
                  "required": [
                    "drafted",
                    "promptVersion"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "404": {
            "$ref": "#/components/responses/Problem404"
          },
          "422": {
            "$ref": "#/components/responses/Problem422"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      }
    },
    "/v1/vendors/{vendorId}/handoffs": {
      "post": {
        "operationId": "createHandoff",
        "summary": "Creates a handoff notice that passes a vendor's open items to its contact.",
        "description": "Creates a handoff notice that passes a vendor's open items to its contact. Needs the `ledger:propose` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "purchases"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:propose",
        "parameters": [
          {
            "name": "vendorId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "entityId": {
                    "type": "string",
                    "minLength": 1
                  },
                  "inboundAddressId": {
                    "type": "string",
                    "minLength": 1
                  },
                  "recipientEmail": {
                    "type": "string",
                    "maxLength": 320,
                    "format": "email",
                    "pattern": "^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"
                  },
                  "paragraph": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 600
                  },
                  "paragraphSource": {
                    "type": "string",
                    "enum": [
                      "STANDARD",
                      "AGENT_DRAFT",
                      "AGENT_DRAFT_EDITED",
                      "PERSON"
                    ]
                  },
                  "promptVersion": {
                    "type": "string",
                    "maxLength": 40
                  },
                  "draftRequested": {
                    "default": false,
                    "type": "boolean"
                  }
                },
                "required": [
                  "entityId",
                  "inboundAddressId",
                  "recipientEmail",
                  "paragraph",
                  "paragraphSource"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "Ledger-Position": {
                "$ref": "#/components/headers/LedgerPosition"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CreateHandoffResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem400"
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "404": {
            "$ref": "#/components/responses/Problem404"
          },
          "409": {
            "$ref": "#/components/responses/Problem409"
          },
          "412": {
            "$ref": "#/components/responses/Problem412"
          },
          "422": {
            "$ref": "#/components/responses/Problem422"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      }
    },
    "/v1/vendors/{vendorId}/handoffs/{noticeId}/discard": {
      "post": {
        "operationId": "discardHandoff",
        "summary": "Discards a handoff notice that has not been sent.",
        "description": "Discards a handoff notice that has not been sent. Needs the `ledger:propose` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "purchases"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:propose",
        "parameters": [
          {
            "name": "vendorId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "noticeId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "reason": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 500
                  }
                },
                "required": [
                  "reason"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "Ledger-Position": {
                "$ref": "#/components/headers/LedgerPosition"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CreateHandoffResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem400"
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "404": {
            "$ref": "#/components/responses/Problem404"
          },
          "409": {
            "$ref": "#/components/responses/Problem409"
          },
          "412": {
            "$ref": "#/components/responses/Problem412"
          },
          "422": {
            "$ref": "#/components/responses/Problem422"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      }
    },
    "/v1/vendors/{vendorId}/handoffs/{noticeId}/sent": {
      "post": {
        "operationId": "recordHandoffSent",
        "summary": "Records that a handoff notice was sent outside the product.",
        "description": "Records that a handoff notice was sent outside the product. Needs the `ledger:propose` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "purchases"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:propose",
        "parameters": [
          {
            "name": "vendorId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "noticeId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "note": {
                    "type": "string",
                    "maxLength": 500
                  }
                },
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "Ledger-Position": {
                "$ref": "#/components/headers/LedgerPosition"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CreateHandoffResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem400"
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "404": {
            "$ref": "#/components/responses/Problem404"
          },
          "409": {
            "$ref": "#/components/responses/Problem409"
          },
          "412": {
            "$ref": "#/components/responses/Problem412"
          },
          "422": {
            "$ref": "#/components/responses/Problem422"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      }
    },
    "/v1/vendors/{vendorId}/history": {
      "get": {
        "operationId": "listVendorHistory",
        "summary": "Lists the history of a vendor, newest first.",
        "description": "Lists the history of a vendor, newest first. Needs the `ledger:read` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "purchases"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:read",
        "parameters": [
          {
            "name": "vendorId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "default": 50,
              "type": "integer",
              "minimum": 1,
              "maximum": 200
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 512
            }
          },
          {
            "name": "kind",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "PAID_BILL",
                "VENDOR_PAYMENT"
              ]
            }
          },
          {
            "name": "from",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
            }
          },
          {
            "name": "to",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/ListImportedHistoryResponse"
                    },
                    "nextCursor": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "total": {
                      "anyOf": [
                        {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "entityTimeZone": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "data",
                    "nextCursor",
                    "total",
                    "entityTimeZone"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "404": {
            "$ref": "#/components/responses/Problem404"
          },
          "422": {
            "$ref": "#/components/responses/Problem422"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      }
    },
    "/v1/vendors/{vendorId}/hold-brief": {
      "post": {
        "operationId": "draftVendorHoldReason",
        "summary": "Drafts the reason for a payment hold on a vendor.",
        "description": "Drafts the reason for a payment hold on a vendor. Needs the `ledger:approve` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "purchases"
        ],
        "x-stability-level": "beta",
        "x-eternify-read": true,
        "x-scope": "ledger:approve",
        "parameters": [
          {
            "name": "vendorId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "note": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 200
                  }
                },
                "required": [
                  "note"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DraftVendorHoldReasonResponse"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "404": {
            "$ref": "#/components/responses/Problem404"
          },
          "422": {
            "$ref": "#/components/responses/Problem422"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      }
    },
    "/v1/vendors/{vendorId}/line-profile": {
      "get": {
        "operationId": "getVendorLineProfile",
        "summary": "Returns the line profile of a vendor, which says how its bills are coded.",
        "description": "Returns the line profile of a vendor, which says how its bills are coded. Needs the `ledger:read` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "purchases"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:read",
        "parameters": [
          {
            "name": "vendorId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "vendorId": {
                      "type": "string"
                    },
                    "vendorName": {
                      "type": "string"
                    },
                    "archived": {
                      "type": "boolean"
                    },
                    "entityTimeZone": {
                      "type": "string"
                    },
                    "agreement": {
                      "type": "number",
                      "const": 3
                    },
                    "lookbackDays": {
                      "type": "number",
                      "const": 400
                    },
                    "approvedInWindow": {
                      "type": "integer",
                      "minimum": 0,
                      "maximum": 9007199254740991
                    },
                    "newest": {
                      "maxItems": 3,
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "billId": {
                            "type": "string"
                          },
                          "number": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "billDate": {
                            "type": "string",
                            "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                          },
                          "approvedAt": {
                            "type": "string",
                            "minLength": 20
                          },
                          "entityId": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "billId",
                          "number",
                          "billDate",
                          "approvedAt",
                          "entityId"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "fields": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "field": {
                            "type": "string",
                            "enum": [
                              "ACCOUNT",
                              "SUPPLY_CATEGORY",
                              "ITC_KIND",
                              "COMMERCIAL_USE",
                              "PROVINCIAL_SERVICE",
                              "PROPERTY_REGION",
                              "DIMENSION"
                            ]
                          },
                          "dimensionTypeId": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "dimensionLabel": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "state": {
                            "type": "string",
                            "enum": [
                              "AGREED",
                              "NOT_OFFERED",
                              "COVERED",
                              "DECLINED"
                            ]
                          },
                          "valueLabel": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "why": {
                            "anyOf": [
                              {
                                "type": "string",
                                "enum": [
                                  "TOO_FEW_BILLS",
                                  "TOO_OLD",
                                  "MIXED",
                                  "DIFFERS",
                                  "BLANK",
                                  "GENERAL_KIND",
                                  "FULL_USE",
                                  "NOT_REAL_PROPERTY"
                                ]
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "whyText": {
                            "type": [
                              "string",
                              "null"
                            ]
                          }
                        },
                        "required": [
                          "field",
                          "dimensionTypeId",
                          "dimensionLabel",
                          "state",
                          "valueLabel",
                          "why",
                          "whyText"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "suggestion": {
                      "anyOf": [
                        {
                          "type": "object",
                          "properties": {
                            "fields": {
                              "type": "array",
                              "items": {
                                "type": "string",
                                "enum": [
                                  "ACCOUNT",
                                  "SUPPLY_CATEGORY",
                                  "ITC_KIND",
                                  "COMMERCIAL_USE",
                                  "PROVINCIAL_SERVICE",
                                  "PROPERTY_REGION",
                                  "DIMENSION"
                                ]
                              }
                            },
                            "replaces": {
                              "anyOf": [
                                {
                                  "type": "object",
                                  "properties": {
                                    "ruleId": {
                                      "type": "string"
                                    },
                                    "authorName": {
                                      "type": "string"
                                    },
                                    "setOn": {
                                      "type": "string",
                                      "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                                    }
                                  },
                                  "required": [
                                    "ruleId",
                                    "authorName",
                                    "setOn"
                                  ],
                                  "additionalProperties": false
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            }
                          },
                          "required": [
                            "fields",
                            "replaces"
                          ],
                          "additionalProperties": false
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "live": {
                      "anyOf": [
                        {
                          "$ref": "#/components/schemas/LiveOption1"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "waiting": {
                      "maxItems": 5,
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/LiveOption1"
                      }
                    },
                    "decided": {
                      "type": "object",
                      "properties": {
                        "items": {
                          "maxItems": 10,
                          "type": "array",
                          "items": {
                            "$ref": "#/components/schemas/LiveOption1"
                          }
                        },
                        "total": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 9007199254740991
                        }
                      },
                      "required": [
                        "items",
                        "total"
                      ],
                      "additionalProperties": false
                    },
                    "corrections": {
                      "type": "object",
                      "properties": {
                        "items": {
                          "maxItems": 5,
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string"
                              },
                              "kind": {
                                "type": "string",
                                "enum": [
                                  "BILL_CODING_CORRECTED",
                                  "BILL_DECLINED_WITH_FILLS"
                                ]
                              },
                              "billId": {
                                "type": "string"
                              },
                              "billNumber": {
                                "type": [
                                  "string",
                                  "null"
                                ]
                              },
                              "at": {
                                "type": "string",
                                "minLength": 20
                              },
                              "byName": {
                                "type": "string"
                              },
                              "lines": {
                                "type": "array",
                                "items": {
                                  "type": "object",
                                  "properties": {
                                    "description": {
                                      "type": "string"
                                    },
                                    "from": {
                                      "anyOf": [
                                        {
                                          "type": "object",
                                          "properties": {
                                            "code": {
                                              "type": "string"
                                            },
                                            "name": {
                                              "type": "string"
                                            }
                                          },
                                          "required": [
                                            "code",
                                            "name"
                                          ],
                                          "additionalProperties": false
                                        },
                                        {
                                          "type": "null"
                                        }
                                      ]
                                    },
                                    "to": {
                                      "type": "object",
                                      "properties": {
                                        "code": {
                                          "type": "string"
                                        },
                                        "name": {
                                          "type": "string"
                                        }
                                      },
                                      "required": [
                                        "code",
                                        "name"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "fromItcKind": {
                                      "anyOf": [
                                        {
                                          "type": "string",
                                          "enum": [
                                            "GENERAL",
                                            "MEALS_ENTERTAINMENT",
                                            "PASSENGER_VEHICLE",
                                            "ZERO_EMISSION_VEHICLE",
                                            "EXEMPT_ACTIVITY",
                                            "NONE"
                                          ]
                                        },
                                        {
                                          "type": "null"
                                        }
                                      ]
                                    },
                                    "toItcKind": {
                                      "anyOf": [
                                        {
                                          "type": "string",
                                          "enum": [
                                            "GENERAL",
                                            "MEALS_ENTERTAINMENT",
                                            "PASSENGER_VEHICLE",
                                            "ZERO_EMISSION_VEHICLE",
                                            "EXEMPT_ACTIVITY",
                                            "NONE"
                                          ]
                                        },
                                        {
                                          "type": "null"
                                        }
                                      ]
                                    }
                                  },
                                  "required": [
                                    "description",
                                    "from",
                                    "to",
                                    "fromItcKind",
                                    "toItcKind"
                                  ],
                                  "additionalProperties": false
                                }
                              }
                            },
                            "required": [
                              "id",
                              "kind",
                              "billId",
                              "billNumber",
                              "at",
                              "byName",
                              "lines"
                            ],
                            "additionalProperties": false
                          }
                        },
                        "total": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 9007199254740991
                        }
                      },
                      "required": [
                        "items",
                        "total"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "vendorId",
                    "vendorName",
                    "archived",
                    "entityTimeZone",
                    "agreement",
                    "lookbackDays",
                    "approvedInWindow",
                    "newest",
                    "fields",
                    "suggestion",
                    "live",
                    "waiting",
                    "decided",
                    "corrections"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "404": {
            "$ref": "#/components/responses/Problem404"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      },
      "post": {
        "operationId": "proposeVendorLineProfile",
        "summary": "Proposes the line profile of a vendor for a person to decide.",
        "description": "Proposes the line profile of a vendor for a person to decide. Needs the `ledger:admin` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "purchases"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:admin",
        "parameters": [
          {
            "name": "vendorId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "fields": {
                    "minItems": 1,
                    "maxItems": 7,
                    "type": "array",
                    "items": {
                      "type": "string",
                      "enum": [
                        "ACCOUNT",
                        "SUPPLY_CATEGORY",
                        "ITC_KIND",
                        "COMMERCIAL_USE",
                        "PROVINCIAL_SERVICE",
                        "PROPERTY_REGION",
                        "DIMENSION"
                      ]
                    }
                  },
                  "entityId": {
                    "default": null,
                    "anyOf": [
                      {
                        "type": "string",
                        "minLength": 1
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "expiresOn": {
                    "type": "string",
                    "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                  },
                  "replacesRuleId": {
                    "type": "string",
                    "minLength": 1
                  }
                },
                "required": [
                  "fields",
                  "expiresOn"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "Ledger-Position": {
                "$ref": "#/components/headers/LedgerPosition"
              },
              "Location": {
                "$ref": "#/components/headers/Location"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "rule": {
                      "$ref": "#/components/schemas/ListRulesResponseItem"
                    },
                    "preview": {
                      "$ref": "#/components/schemas/PreviewRuleResponse"
                    }
                  },
                  "required": [
                    "rule",
                    "preview"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem400"
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "404": {
            "$ref": "#/components/responses/Problem404"
          },
          "409": {
            "$ref": "#/components/responses/Problem409"
          },
          "412": {
            "$ref": "#/components/responses/Problem412"
          },
          "422": {
            "$ref": "#/components/responses/Problem422"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      }
    },
    "/v1/vendors/{vendorId}/line-profile/dismiss": {
      "post": {
        "operationId": "dismissVendorLineProfile",
        "summary": "Dismisses a proposed line profile for a vendor.",
        "description": "Dismisses a proposed line profile for a vendor. Needs the `ledger:admin` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "purchases"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:admin",
        "parameters": [
          {
            "name": "vendorId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "fields": {
                    "minItems": 1,
                    "maxItems": 7,
                    "type": "array",
                    "items": {
                      "type": "string",
                      "enum": [
                        "ACCOUNT",
                        "SUPPLY_CATEGORY",
                        "ITC_KIND",
                        "COMMERCIAL_USE",
                        "PROVINCIAL_SERVICE",
                        "PROPERTY_REGION",
                        "DIMENSION"
                      ]
                    }
                  }
                },
                "required": [
                  "fields"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "Ledger-Position": {
                "$ref": "#/components/headers/LedgerPosition"
              },
              "Location": {
                "$ref": "#/components/headers/Location"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "rule": {
                      "$ref": "#/components/schemas/ListRulesResponseItem"
                    }
                  },
                  "required": [
                    "rule"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem400"
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "404": {
            "$ref": "#/components/responses/Problem404"
          },
          "409": {
            "$ref": "#/components/responses/Problem409"
          },
          "412": {
            "$ref": "#/components/responses/Problem412"
          },
          "422": {
            "$ref": "#/components/responses/Problem422"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      }
    },
    "/v1/vendors/{vendorId}/link-bills": {
      "post": {
        "operationId": "linkVendorBills",
        "summary": "Links bills to a vendor.",
        "description": "Links bills to a vendor. Needs the `ledger:propose` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "purchases"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:propose",
        "parameters": [
          {
            "name": "vendorId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "expectedCount": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 9007199254740991
                  }
                },
                "required": [
                  "expectedCount"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "Ledger-Position": {
                "$ref": "#/components/headers/LedgerPosition"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "linked": {
                      "type": "integer",
                      "minimum": 0,
                      "maximum": 9007199254740991
                    },
                    "remaining": {
                      "type": "integer",
                      "minimum": 0,
                      "maximum": 9007199254740991
                    },
                    "skipped": {
                      "type": "object",
                      "properties": {
                        "inReview": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 9007199254740991
                        },
                        "voided": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 9007199254740991
                        }
                      },
                      "required": [
                        "inReview",
                        "voided"
                      ],
                      "additionalProperties": false
                    },
                    "entityTimeZone": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "linked",
                    "remaining",
                    "skipped",
                    "entityTimeZone"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem400"
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "404": {
            "$ref": "#/components/responses/Problem404"
          },
          "409": {
            "$ref": "#/components/responses/Problem409"
          },
          "412": {
            "$ref": "#/components/responses/Problem412"
          },
          "422": {
            "$ref": "#/components/responses/Problem422"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      }
    },
    "/v1/vendors/{vendorId}/links": {
      "post": {
        "operationId": "linkVendor",
        "summary": "Links a vendor to its record in an outside system.",
        "description": "Links a vendor to its record in an outside system. Needs the `ledger:propose` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "purchases"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:propose",
        "parameters": [
          {
            "name": "vendorId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "provider": {
                    "type": "string",
                    "enum": [
                      "QBO",
                      "XERO"
                    ]
                  },
                  "externalId": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 255
                  },
                  "externalLabel": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 255
                  }
                },
                "required": [
                  "provider",
                  "externalId"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "Ledger-Position": {
                "$ref": "#/components/headers/LedgerPosition"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LinkVendorResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem400"
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "404": {
            "$ref": "#/components/responses/Problem404"
          },
          "409": {
            "$ref": "#/components/responses/Problem409"
          },
          "412": {
            "$ref": "#/components/responses/Problem412"
          },
          "422": {
            "$ref": "#/components/responses/Problem422"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      }
    },
    "/v1/vendors/{vendorId}/links/{linkId}/unlink": {
      "post": {
        "operationId": "unlinkVendor",
        "summary": "Removes a vendor's link to its record in an outside system.",
        "description": "Removes a vendor's link to its record in an outside system. Needs the `ledger:propose` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "purchases"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:propose",
        "parameters": [
          {
            "name": "vendorId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "linkId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "Ledger-Position": {
                "$ref": "#/components/headers/LedgerPosition"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LinkVendorResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem400"
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "404": {
            "$ref": "#/components/responses/Problem404"
          },
          "409": {
            "$ref": "#/components/responses/Problem409"
          },
          "412": {
            "$ref": "#/components/responses/Problem412"
          },
          "422": {
            "$ref": "#/components/responses/Problem422"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      }
    },
    "/v1/vendors/{vendorId}/merge-brief": {
      "post": {
        "operationId": "draftVendorMergeBrief",
        "summary": "Drafts the brief a person reads before approving a vendor merge.",
        "description": "Drafts the brief a person reads before approving a vendor merge. Needs the `ledger:propose` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "purchases"
        ],
        "x-stability-level": "beta",
        "x-eternify-read": true,
        "x-scope": "ledger:propose",
        "parameters": [
          {
            "name": "vendorId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "absorbVendorId": {
                    "type": "string",
                    "minLength": 1
                  }
                },
                "required": [
                  "absorbVendorId"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DraftVendorDuplicateBriefResponse"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "404": {
            "$ref": "#/components/responses/Problem404"
          },
          "422": {
            "$ref": "#/components/responses/Problem422"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      }
    },
    "/v1/vendors/{vendorId}/merge-preview": {
      "get": {
        "operationId": "previewVendorMerge",
        "summary": "Previews merging one vendor into another before it is proposed.",
        "description": "Previews merging one vendor into another before it is proposed. Needs the `ledger:propose` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "purchases"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:propose",
        "parameters": [
          {
            "name": "vendorId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "absorbVendorId",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "survivor": {
                      "$ref": "#/components/schemas/Survivor"
                    },
                    "absorbed": {
                      "$ref": "#/components/schemas/Survivor"
                    },
                    "moves": {
                      "type": "object",
                      "properties": {
                        "bills": {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991
                        },
                        "contacts": {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991
                        },
                        "senderDomains": {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991
                        },
                        "schedules": {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991
                        },
                        "aliases": {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991
                        },
                        "documents": {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991
                        },
                        "agreements": {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991
                        },
                        "withholdingWaivers": {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991
                        }
                      },
                      "required": [
                        "bills",
                        "contacts",
                        "senderDomains",
                        "schedules",
                        "aliases",
                        "documents",
                        "agreements",
                        "withholdingWaivers"
                      ],
                      "additionalProperties": false
                    },
                    "stays": {
                      "type": "object",
                      "properties": {
                        "payments": {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991
                        },
                        "bankingChanges": {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991
                        },
                        "voidBills": {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991
                        },
                        "billsInReview": {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991
                        }
                      },
                      "required": [
                        "payments",
                        "bankingChanges",
                        "voidBills",
                        "billsInReview"
                      ],
                      "additionalProperties": false
                    },
                    "duplicateInvoices": {
                      "type": "object",
                      "properties": {
                        "total": {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991
                        },
                        "sample": {
                          "maxItems": 10,
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "number": {
                                "type": "string"
                              },
                              "survivorBillId": {
                                "type": "string"
                              },
                              "absorbedBillId": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "number",
                              "survivorBillId",
                              "absorbedBillId"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "total",
                        "sample"
                      ],
                      "additionalProperties": false
                    },
                    "slipYearsProduced": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "taxYear": {
                            "type": "integer",
                            "minimum": -9007199254740991,
                            "maximum": 9007199254740991
                          },
                          "kind": {
                            "type": "string",
                            "enum": [
                              "T4A",
                              "T5018"
                            ]
                          }
                        },
                        "required": [
                          "taxYear",
                          "kind"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "blockers": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "code": {
                            "type": "string",
                            "enum": [
                              "SAME_RECORD",
                              "ABSORBED_ARCHIVED",
                              "SURVIVOR_ARCHIVED",
                              "ABSORBED_REFUSED",
                              "SURVIVOR_REFUSED",
                              "BANKING_OPEN",
                              "BANKING_DIFFERS",
                              "HOLD_WOULD_LIFT",
                              "IN_DRAFT_RUN",
                              "BILLS_IN_REVIEW",
                              "OPEN_CREDIT",
                              "AUTHORITY_SCOPE",
                              "COUNTERPARTY",
                              "COUNTERPARTY_OWN_BILLS",
                              "SLIP_KIND_DIFFERS",
                              "RESIDENCY_DIFFERS",
                              "SLIP_CONSENT_BOTH_LIVE",
                              "ALREADY_PROPOSED",
                              "SURVIVOR_IS_ABSORBED",
                              "PAPER_OVER_CAP",
                              "PRIVACY_REQUEST_OPEN",
                              "PORTAL_SUBMISSION_WAITING",
                              "VENDOR_QUERY_OPEN",
                              "VENDOR_STATEMENT_OPEN"
                            ]
                          },
                          "sentence": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "code",
                          "sentence"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "warnings": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "code": {
                            "type": "string",
                            "enum": [
                              "BUSINESS_NUMBER_DIFFERS",
                              "DUPLICATE_INVOICE_NUMBERS",
                              "SLIP_YEAR_PRODUCED",
                              "SURVIVOR_LACKS",
                              "ABSORBED_HAS_BANKING_IN_FORCE",
                              "PAPER_REQUIREMENTS_NOT_CARRIED"
                            ]
                          },
                          "sentence": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "code",
                          "sentence"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "evidence": {
                      "type": "object",
                      "properties": {
                        "kinds": {
                          "type": "array",
                          "items": {
                            "type": "string",
                            "enum": [
                              "SAME_BUSINESS_NUMBER",
                              "SAME_BANK_ACCOUNT",
                              "SIMILAR_NAME"
                            ]
                          }
                        },
                        "sentence": {
                          "type": [
                            "string",
                            "null"
                          ]
                        }
                      },
                      "required": [
                        "kinds",
                        "sentence"
                      ],
                      "additionalProperties": false
                    },
                    "seenSha256": {
                      "type": "string",
                      "pattern": "^[0-9a-f]{64}$"
                    },
                    "entityTimeZone": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "survivor",
                    "absorbed",
                    "moves",
                    "stays",
                    "duplicateInvoices",
                    "slipYearsProduced",
                    "blockers",
                    "warnings",
                    "evidence",
                    "seenSha256",
                    "entityTimeZone"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "404": {
            "$ref": "#/components/responses/Problem404"
          },
          "422": {
            "$ref": "#/components/responses/Problem422"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      }
    },
    "/v1/vendors/{vendorId}/notice-recipients": {
      "get": {
        "operationId": "listNoticeRecipients",
        "summary": "Lists who will receive notices for a vendor.",
        "description": "Lists who will receive notices for a vendor. Needs the `ledger:read` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "purchases"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:read",
        "parameters": [
          {
            "name": "vendorId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "default": 50,
              "type": "integer",
              "minimum": 1,
              "maximum": 200
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 512
            }
          },
          {
            "name": "q",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 100
            }
          },
          {
            "name": "bankingChangeId",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 64
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Recipients"
                    },
                    "nextCursor": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "total": {
                      "anyOf": [
                        {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  },
                  "required": [
                    "data",
                    "nextCursor",
                    "total"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "404": {
            "$ref": "#/components/responses/Problem404"
          },
          "422": {
            "$ref": "#/components/responses/Problem422"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      }
    },
    "/v1/vendors/{vendorId}/order-exemption": {
      "post": {
        "operationId": "setVendorOrderExemption",
        "summary": "Exempts a vendor from purchase order requirements.",
        "description": "Exempts a vendor from purchase order requirements. Needs the `ledger:approve` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "purchases"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:approve",
        "parameters": [
          {
            "name": "vendorId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "anyOf": [
                  {
                    "type": "object",
                    "properties": {
                      "exempt": {
                        "type": "boolean",
                        "const": true
                      },
                      "reason": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 500
                      }
                    },
                    "required": [
                      "exempt",
                      "reason"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "exempt": {
                        "type": "boolean",
                        "const": false
                      }
                    },
                    "required": [
                      "exempt"
                    ],
                    "additionalProperties": false
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "Ledger-Position": {
                "$ref": "#/components/headers/LedgerPosition"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "vendorId": {
                      "type": "string"
                    },
                    "exemption": {
                      "$ref": "#/components/schemas/Retired"
                    }
                  },
                  "required": [
                    "vendorId",
                    "exemption"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem400"
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "404": {
            "$ref": "#/components/responses/Problem404"
          },
          "409": {
            "$ref": "#/components/responses/Problem409"
          },
          "412": {
            "$ref": "#/components/responses/Problem412"
          },
          "422": {
            "$ref": "#/components/responses/Problem422"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      }
    },
    "/v1/vendors/{vendorId}/paper-notice-facts": {
      "get": {
        "operationId": "paperNoticeFacts",
        "summary": "Returns the facts a notice about a vendor's paper is built from.",
        "description": "Returns the facts a notice about a vendor's paper is built from. Needs the `ledger:read` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "purchases"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:read",
        "parameters": [
          {
            "name": "vendorId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "kind",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "DOCUMENT_REQUESTED",
                "NON_RENEWAL_NOTICE"
              ]
            }
          },
          {
            "name": "entityId",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "agreementId",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "kind": {
                      "type": "string",
                      "enum": [
                        "DOCUMENT_REQUESTED",
                        "NON_RENEWAL_NOTICE"
                      ]
                    },
                    "facts": {
                      "$ref": "#/components/schemas/PaperFacts"
                    },
                    "preview": {
                      "anyOf": [
                        {
                          "type": "object",
                          "properties": {
                            "subject": {
                              "type": "string"
                            },
                            "text": {
                              "type": "string"
                            }
                          },
                          "required": [
                            "subject",
                            "text"
                          ],
                          "additionalProperties": false
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "recipients": {
                      "maxItems": 50,
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "email": {
                            "type": "string"
                          },
                          "name": {
                            "type": [
                              "string",
                              "null"
                            ]
                          }
                        },
                        "required": [
                          "email",
                          "name"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "openDraft": {
                      "$ref": "#/components/schemas/OpenDraft"
                    },
                    "lastSent": {
                      "$ref": "#/components/schemas/LastSent"
                    },
                    "outboundApproved": {
                      "type": "boolean"
                    },
                    "entityTimeZone": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "kind",
                    "facts",
                    "preview",
                    "recipients",
                    "openDraft",
                    "lastSent",
                    "outboundApproved",
                    "entityTimeZone"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "404": {
            "$ref": "#/components/responses/Problem404"
          },
          "422": {
            "$ref": "#/components/responses/Problem422"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      }
    },
    "/v1/vendors/{vendorId}/paper-notices": {
      "post": {
        "operationId": "draftPaperNotice",
        "summary": "Drafts a notice to a vendor about their paper.",
        "description": "Drafts a notice to a vendor about their paper. Needs the `ledger:propose` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "purchases"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:propose",
        "parameters": [
          {
            "name": "vendorId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "kind": {
                    "type": "string",
                    "enum": [
                      "DOCUMENT_REQUESTED",
                      "NON_RENEWAL_NOTICE"
                    ]
                  },
                  "entityId": {
                    "type": "string",
                    "minLength": 1
                  },
                  "agreementId": {
                    "type": "string",
                    "minLength": 1
                  },
                  "recipientEmail": {
                    "type": "string",
                    "maxLength": 320,
                    "format": "email",
                    "pattern": "^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"
                  },
                  "kinds": {
                    "minItems": 1,
                    "maxItems": 12,
                    "type": "array",
                    "items": {
                      "type": "string",
                      "enum": [
                        "WSIB_CLEARANCE",
                        "INSURANCE_CERTIFICATE",
                        "MASTER_AGREEMENT",
                        "W8BEN",
                        "DIRECT_DEPOSIT_FORM",
                        "WITHHOLDING_WAIVER",
                        "OTHER"
                      ]
                    }
                  },
                  "sentence": {
                    "$ref": "#/components/schemas/Sentence"
                  }
                },
                "required": [
                  "kind",
                  "entityId",
                  "recipientEmail"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "Ledger-Position": {
                "$ref": "#/components/headers/LedgerPosition"
              },
              "Location": {
                "$ref": "#/components/headers/Location"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DraftBankingNoticeResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem400"
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "404": {
            "$ref": "#/components/responses/Problem404"
          },
          "409": {
            "$ref": "#/components/responses/Problem409"
          },
          "412": {
            "$ref": "#/components/responses/Problem412"
          },
          "422": {
            "$ref": "#/components/responses/Problem422"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      }
    },
    "/v1/vendors/{vendorId}/paper-requirements": {
      "post": {
        "operationId": "setVendorPaperRequirements",
        "summary": "Sets the paper a vendor must provide.",
        "description": "Sets the paper a vendor must provide. Needs the `ledger:approve` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "purchases"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:approve",
        "parameters": [
          {
            "name": "vendorId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "kinds": {
                    "maxItems": 8,
                    "type": "array",
                    "items": {
                      "type": "string",
                      "enum": [
                        "WSIB_CLEARANCE",
                        "INSURANCE_CERTIFICATE",
                        "MASTER_AGREEMENT",
                        "W8BEN",
                        "DIRECT_DEPOSIT_FORM",
                        "WITHHOLDING_WAIVER",
                        "OTHER"
                      ]
                    }
                  }
                },
                "required": [
                  "kinds"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "Ledger-Position": {
                "$ref": "#/components/headers/LedgerPosition"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Standing"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem400"
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "404": {
            "$ref": "#/components/responses/Problem404"
          },
          "409": {
            "$ref": "#/components/responses/Problem409"
          },
          "412": {
            "$ref": "#/components/responses/Problem412"
          },
          "422": {
            "$ref": "#/components/responses/Problem422"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      }
    },
    "/v1/vendors/{vendorId}/payment-hold": {
      "post": {
        "operationId": "holdVendor",
        "summary": "Puts all payments to a vendor on hold.",
        "description": "Puts all payments to a vendor on hold. Needs the `ledger:approve` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "purchases"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:approve",
        "parameters": [
          {
            "name": "vendorId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "reason": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 500
                  },
                  "reasonSource": {
                    "default": "PERSON",
                    "type": "string",
                    "enum": [
                      "PERSON",
                      "AGENT_DRAFT",
                      "AGENT_DRAFT_EDITED"
                    ]
                  },
                  "draftPromptVersion": {
                    "type": "string",
                    "maxLength": 40
                  }
                },
                "required": [
                  "reason"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "Ledger-Position": {
                "$ref": "#/components/headers/LedgerPosition"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ListVendorsResponseItem"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem400"
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "404": {
            "$ref": "#/components/responses/Problem404"
          },
          "409": {
            "$ref": "#/components/responses/Problem409"
          },
          "412": {
            "$ref": "#/components/responses/Problem412"
          },
          "422": {
            "$ref": "#/components/responses/Problem422"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      }
    },
    "/v1/vendors/{vendorId}/payment-hold/release": {
      "post": {
        "operationId": "releaseVendorHold",
        "summary": "Releases the payment hold on a vendor.",
        "description": "Releases the payment hold on a vendor. Needs the `ledger:approve` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "purchases"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:approve",
        "parameters": [
          {
            "name": "vendorId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "reason": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 500
                  }
                },
                "required": [
                  "reason"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "Ledger-Position": {
                "$ref": "#/components/headers/LedgerPosition"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ListVendorsResponseItem"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem400"
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "404": {
            "$ref": "#/components/responses/Problem404"
          },
          "409": {
            "$ref": "#/components/responses/Problem409"
          },
          "412": {
            "$ref": "#/components/responses/Problem412"
          },
          "422": {
            "$ref": "#/components/responses/Problem422"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      }
    },
    "/v1/vendors/{vendorId}/payment-terms": {
      "put": {
        "operationId": "setVendorPaymentTerms",
        "summary": "Sets or clears the payment terms of one supplier.",
        "description": "Sets or clears the payment terms of one supplier. Needs the `ledger:propose` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "purchases"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:propose",
        "parameters": [
          {
            "name": "vendorId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "paymentTermsId": {
                    "anyOf": [
                      {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 64
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                },
                "required": [
                  "paymentTermsId"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "Ledger-Position": {
                "$ref": "#/components/headers/LedgerPosition"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "vendorId": {
                      "type": "string"
                    },
                    "paymentTermsId": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "paymentTermsName": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "changed": {
                      "type": "boolean"
                    }
                  },
                  "required": [
                    "vendorId",
                    "paymentTermsId",
                    "paymentTermsName",
                    "changed"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem400"
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "404": {
            "$ref": "#/components/responses/Problem404"
          },
          "409": {
            "$ref": "#/components/responses/Problem409"
          },
          "412": {
            "$ref": "#/components/responses/Problem412"
          },
          "422": {
            "$ref": "#/components/responses/Problem422"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      }
    },
    "/v1/vendors/{vendorId}/payments": {
      "get": {
        "operationId": "listVendorPayments",
        "summary": "Lists the payments made to one vendor, newest first.",
        "description": "Lists the payments made to one vendor, newest first. Needs the `ledger:read` permission. Stable: a change that breaks callers needs 365 days' notice.",
        "tags": [
          "purchases"
        ],
        "x-stability-level": "stable",
        "x-scope": "ledger:read",
        "parameters": [
          {
            "name": "vendorId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "default": 50,
              "type": "integer",
              "minimum": 1,
              "maximum": 200
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 512
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "method": {
                            "type": "string",
                            "enum": [
                              "RUN",
                              "CARD",
                              "PAD",
                              "ACCOUNT",
                              "CHEQUE",
                              "WIRE",
                              "ETRANSFER",
                              "OTHER"
                            ]
                          },
                          "billId": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "billNumber": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "runId": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "runStatus": {
                            "anyOf": [
                              {
                                "type": "string",
                                "enum": [
                                  "DRAFT",
                                  "RELEASED",
                                  "CANCELLED"
                                ]
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "entityId": {
                            "type": "string"
                          },
                          "entityName": {
                            "type": "string"
                          },
                          "entityTimeZone": {
                            "type": "string"
                          },
                          "paidOn": {
                            "type": "string",
                            "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                          },
                          "currency": {
                            "type": "string",
                            "pattern": "^[A-Z]{3}$"
                          },
                          "amountMinor": {
                            "type": "string",
                            "pattern": "^-?\\d+$"
                          },
                          "entryNumber": {
                            "anyOf": [
                              {
                                "type": "integer",
                                "minimum": -9007199254740991,
                                "maximum": 9007199254740991
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "entryStatus": {
                            "anyOf": [
                              {
                                "type": "string",
                                "enum": [
                                  "DRAFT",
                                  "PROPOSED",
                                  "IN_REVIEW",
                                  "APPROVED",
                                  "POSTED",
                                  "DECLINED",
                                  "REVERSED"
                                ]
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "billCount": {
                            "type": "integer",
                            "minimum": 0,
                            "maximum": 9007199254740991
                          },
                          "runMethod": {
                            "anyOf": [
                              {
                                "type": "string",
                                "enum": [
                                  "EFT",
                                  "CHEQUE",
                                  "WIRE"
                                ]
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "chequeNumber": {
                            "anyOf": [
                              {
                                "type": "integer",
                                "minimum": -9007199254740991,
                                "maximum": 9007199254740991
                              },
                              {
                                "type": "null"
                              }
                            ]
                          }
                        },
                        "required": [
                          "id",
                          "method",
                          "billId",
                          "billNumber",
                          "runId",
                          "runStatus",
                          "entityId",
                          "entityName",
                          "entityTimeZone",
                          "paidOn",
                          "currency",
                          "amountMinor",
                          "entryNumber",
                          "entryStatus",
                          "billCount",
                          "runMethod",
                          "chequeNumber"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "nextCursor": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "total": {
                      "anyOf": [
                        {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  },
                  "required": [
                    "data",
                    "nextCursor",
                    "total"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "404": {
            "$ref": "#/components/responses/Problem404"
          },
          "422": {
            "$ref": "#/components/responses/Problem422"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      }
    },
    "/v1/vendors/{vendorId}/portal-links": {
      "get": {
        "operationId": "listVendorPortalLinks",
        "summary": "Lists the vendor portal links issued for a vendor.",
        "description": "Lists the vendor portal links issued for a vendor. Needs the `ledger:read` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "purchases"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:read",
        "parameters": [
          {
            "name": "vendorId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "default": 50,
              "type": "integer",
              "minimum": 1,
              "maximum": 200
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 512
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/ListVendorPortalLinksResponseItem"
                      }
                    },
                    "nextCursor": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "total": {
                      "anyOf": [
                        {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  },
                  "required": [
                    "data",
                    "nextCursor",
                    "total"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "404": {
            "$ref": "#/components/responses/Problem404"
          },
          "422": {
            "$ref": "#/components/responses/Problem422"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      }
    },
    "/v1/vendors/{vendorId}/portal-links/{linkId}/access": {
      "get": {
        "operationId": "listVendorPortalAccess",
        "summary": "Lists when a vendor portal link was opened.",
        "description": "Lists when a vendor portal link was opened. Needs the `ledger:read` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "purchases"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:read",
        "parameters": [
          {
            "name": "vendorId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "linkId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "default": 50,
              "type": "integer",
              "minimum": 1,
              "maximum": 200
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 512
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "event": {
                            "type": "string",
                            "enum": [
                              "OPENED",
                              "DOCUMENT_DOWNLOADED",
                              "FILE_STORED",
                              "PAGE_READ",
                              "INVOICE_SENT",
                              "FACTS_SENT",
                              "PAPER_SENT",
                              "BANKING_SENT",
                              "SUBMISSION_WITHDRAWN",
                              "QUERY_RAISED",
                              "QUERY_MESSAGE_SENT"
                            ]
                          },
                          "at": {
                            "type": "string",
                            "minLength": 20
                          },
                          "userAgent": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "documentName": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "submissionId": {
                            "type": [
                              "string",
                              "null"
                            ]
                          }
                        },
                        "required": [
                          "id",
                          "event",
                          "at",
                          "userAgent",
                          "documentName",
                          "submissionId"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "nextCursor": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "total": {
                      "anyOf": [
                        {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  },
                  "required": [
                    "data",
                    "nextCursor",
                    "total"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "404": {
            "$ref": "#/components/responses/Problem404"
          },
          "422": {
            "$ref": "#/components/responses/Problem422"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      }
    },
    "/v1/vendors/{vendorId}/portal-links/{linkId}/revoke": {
      "post": {
        "operationId": "revokeVendorPortalLink",
        "summary": "Revokes a vendor portal link.",
        "description": "Revokes a vendor portal link. Needs the `ledger:propose` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "purchases"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:propose",
        "parameters": [
          {
            "name": "vendorId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "linkId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "reason": {
                    "type": "string",
                    "minLength": 3,
                    "maxLength": 500
                  }
                },
                "required": [
                  "reason"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "Ledger-Position": {
                "$ref": "#/components/headers/LedgerPosition"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ListVendorPortalLinksResponseItem"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem400"
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "404": {
            "$ref": "#/components/responses/Problem404"
          },
          "409": {
            "$ref": "#/components/responses/Problem409"
          },
          "412": {
            "$ref": "#/components/responses/Problem412"
          },
          "422": {
            "$ref": "#/components/responses/Problem422"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      }
    },
    "/v1/vendors/{vendorId}/privacy-read": {
      "post": {
        "operationId": "readVendorPrivacyMessage",
        "summary": "Reads a privacy message a vendor sent.",
        "description": "Reads a privacy message a vendor sent. Needs the `ledger:propose` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "purchases"
        ],
        "x-stability-level": "beta",
        "x-eternify-read": true,
        "x-scope": "ledger:propose",
        "parameters": [
          {
            "name": "vendorId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "message": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 2000
                  }
                },
                "required": [
                  "message"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "reading": {
                      "anyOf": [
                        {
                          "type": "object",
                          "properties": {
                            "asks": {
                              "type": "array",
                              "items": {
                                "type": "string",
                                "enum": [
                                  "SEE_WHAT_YOU_HOLD",
                                  "REMOVE_CONTACT_DETAILS",
                                  "REMOVE_BANK_ACCOUNT",
                                  "REMOVE_EVERYTHING",
                                  "CORRECT_DETAILS",
                                  "OTHER"
                                ]
                              }
                            },
                            "quotes": {
                              "$ref": "#/components/schemas/Quotes"
                            },
                            "language": {
                              "type": "string",
                              "enum": [
                                "en",
                                "fr",
                                "other"
                              ]
                            },
                            "addressedToSystem": {
                              "type": "boolean"
                            },
                            "summary": {
                              "type": "string"
                            },
                            "promptVersion": {
                              "type": "string"
                            }
                          },
                          "required": [
                            "asks",
                            "quotes",
                            "language",
                            "addressedToSystem",
                            "summary",
                            "promptVersion"
                          ],
                          "additionalProperties": false
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "why": {
                      "anyOf": [
                        {
                          "type": "string",
                          "enum": [
                            "PROVIDER",
                            "DISCLOSURE",
                            "BUDGET",
                            "UNPARSABLE",
                            "REFUSED",
                            "FIGURE_INVENTED",
                            "QUOTE_NOT_IN_MESSAGE",
                            "TOO_LONG"
                          ]
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  },
                  "required": [
                    "reading",
                    "why"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "404": {
            "$ref": "#/components/responses/Problem404"
          },
          "422": {
            "$ref": "#/components/responses/Problem422"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      }
    },
    "/v1/vendors/{vendorId}/refuse": {
      "post": {
        "operationId": "refuseVendor",
        "summary": "Refuses a vendor that is waiting for acceptance, with a reason.",
        "description": "Refuses a vendor that is waiting for acceptance, with a reason. Needs the `ledger:approve` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "purchases"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:approve",
        "parameters": [
          {
            "name": "vendorId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "reason": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 500
                  }
                },
                "required": [
                  "reason"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "Ledger-Position": {
                "$ref": "#/components/headers/LedgerPosition"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ListVendorsResponseItem"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem400"
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "404": {
            "$ref": "#/components/responses/Problem404"
          },
          "409": {
            "$ref": "#/components/responses/Problem409"
          },
          "412": {
            "$ref": "#/components/responses/Problem412"
          },
          "422": {
            "$ref": "#/components/responses/Problem422"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      }
    },
    "/v1/vendors/{vendorId}/registration-checks": {
      "post": {
        "operationId": "recordVendorRegistrationCheck",
        "summary": "Records the result of a registration check on a vendor.",
        "description": "Records the result of a registration check on a vendor. Needs the `ledger:propose` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "purchases"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:propose",
        "parameters": [
          {
            "name": "vendorId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "taxNumber": {
                    "type": "string",
                    "pattern": "^[0-9]{9}RT[0-9]{4}$"
                  },
                  "legalNameChecked": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 200
                  },
                  "confirmedFor": {
                    "type": "string",
                    "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                  },
                  "outcome": {
                    "type": "string",
                    "enum": [
                      "REGISTERED",
                      "NOT_REGISTERED",
                      "NO_MATCH"
                    ]
                  },
                  "evidenceDocumentId": {
                    "type": "string",
                    "minLength": 1
                  },
                  "evidenceRead": {
                    "type": "string",
                    "enum": [
                      "AGREES",
                      "DIFFERS",
                      "NOT_READ",
                      "NO_EVIDENCE"
                    ]
                  },
                  "evidenceReadPromptVersion": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 60
                  },
                  "note": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 500
                  }
                },
                "required": [
                  "taxNumber",
                  "legalNameChecked",
                  "confirmedFor",
                  "outcome",
                  "evidenceRead"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "Ledger-Position": {
                "$ref": "#/components/headers/LedgerPosition"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "check": {
                      "$ref": "#/components/schemas/Check"
                    },
                    "registration": {
                      "type": "object",
                      "properties": {
                        "standing": {
                          "type": "string",
                          "enum": [
                            "NO_NUMBER",
                            "UNCHECKED",
                            "CONFIRMED",
                            "NOT_REGISTERED",
                            "NO_MATCH"
                          ]
                        },
                        "inForce": {
                          "anyOf": [
                            {
                              "$ref": "#/components/schemas/Check"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        }
                      },
                      "required": [
                        "standing",
                        "inForce"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "check",
                    "registration"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem400"
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "404": {
            "$ref": "#/components/responses/Problem404"
          },
          "409": {
            "$ref": "#/components/responses/Problem409"
          },
          "412": {
            "$ref": "#/components/responses/Problem412"
          },
          "422": {
            "$ref": "#/components/responses/Problem422"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      },
      "get": {
        "operationId": "listVendorRegistrationChecks",
        "summary": "Lists the registration checks made on a vendor.",
        "description": "Lists the registration checks made on a vendor. Needs the `ledger:read` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "purchases"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:read",
        "parameters": [
          {
            "name": "vendorId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "default": 50,
              "type": "integer",
              "minimum": 1,
              "maximum": 200
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 512
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Check"
                      }
                    },
                    "nextCursor": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "total": {
                      "anyOf": [
                        {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "entityTimeZone": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "data",
                    "nextCursor",
                    "total",
                    "entityTimeZone"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "404": {
            "$ref": "#/components/responses/Problem404"
          },
          "422": {
            "$ref": "#/components/responses/Problem422"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      }
    },
    "/v1/vendors/{vendorId}/registration-evidence/read": {
      "post": {
        "operationId": "readRegistrationEvidence",
        "summary": "Reads the evidence a vendor's registration arrived with.",
        "description": "Reads the evidence a vendor's registration arrived with. Needs the `ledger:propose` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "purchases"
        ],
        "x-stability-level": "beta",
        "x-eternify-read": true,
        "x-scope": "ledger:propose",
        "parameters": [
          {
            "name": "vendorId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "documentId": {
                    "type": "string",
                    "minLength": 1
                  }
                },
                "required": [
                  "documentId"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "read": {
                      "anyOf": [
                        {
                          "type": "object",
                          "properties": {
                            "pageKind": {
                              "type": "string",
                              "enum": [
                                "GST_HST_REGISTRY_RESULT",
                                "OTHER"
                              ]
                            },
                            "statusPrinted": {
                              "type": "string",
                              "enum": [
                                "REGISTERED",
                                "NOT_REGISTERED",
                                "NO_MATCH",
                                "NOT_STATED"
                              ]
                            },
                            "namePrinted": {
                              "anyOf": [
                                {
                                  "type": "string",
                                  "maxLength": 200
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "datePrinted": {
                              "anyOf": [
                                {
                                  "type": "string",
                                  "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "legible": {
                              "type": "boolean"
                            },
                            "note": {
                              "type": "string",
                              "maxLength": 200
                            },
                            "numberOnPage": {
                              "type": "string",
                              "enum": [
                                "AGREES",
                                "DIFFERS",
                                "NOT_FOUND"
                              ]
                            },
                            "nameOnPage": {
                              "type": "string",
                              "enum": [
                                "AGREES",
                                "DIFFERS",
                                "NOT_FOUND"
                              ]
                            },
                            "promptVersion": {
                              "type": "string"
                            },
                            "documentChars": {
                              "type": "integer",
                              "minimum": 1,
                              "maximum": 9007199254740991
                            },
                            "readChars": {
                              "type": "integer",
                              "minimum": 1,
                              "maximum": 9007199254740991
                            }
                          },
                          "required": [
                            "pageKind",
                            "statusPrinted",
                            "namePrinted",
                            "datePrinted",
                            "legible",
                            "note",
                            "numberOnPage",
                            "nameOnPage",
                            "promptVersion",
                            "documentChars",
                            "readChars"
                          ],
                          "additionalProperties": false
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "why": {
                      "type": "string",
                      "enum": [
                        "UNREADABLE",
                        "DISCLOSURE",
                        "BUDGET",
                        "PROVIDER",
                        "UNPARSABLE",
                        "REFUSED"
                      ]
                    }
                  },
                  "required": [
                    "read"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "404": {
            "$ref": "#/components/responses/Problem404"
          },
          "422": {
            "$ref": "#/components/responses/Problem422"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      }
    },
    "/v1/vendors/{vendorId}/restore": {
      "post": {
        "operationId": "restoreVendor",
        "summary": "Restores an archived vendor so bills can be raised against it again.",
        "description": "Restores an archived vendor so bills can be raised against it again. Needs the `ledger:approve` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "purchases"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:approve",
        "parameters": [
          {
            "name": "vendorId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "Ledger-Position": {
                "$ref": "#/components/headers/LedgerPosition"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ListVendorsResponseItem"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem400"
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "404": {
            "$ref": "#/components/responses/Problem404"
          },
          "409": {
            "$ref": "#/components/responses/Problem409"
          },
          "412": {
            "$ref": "#/components/responses/Problem412"
          },
          "422": {
            "$ref": "#/components/responses/Problem422"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      }
    },
    "/v1/vendors/{vendorId}/sender-domains": {
      "get": {
        "operationId": "listVendorSenderDomains",
        "summary": "Lists the email domains a vendor is known to send from.",
        "description": "Lists the email domains a vendor is known to send from. Needs the `ledger:read` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "purchases"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:read",
        "parameters": [
          {
            "name": "vendorId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "state",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "KNOWN",
                "RETIRED"
              ]
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "default": 20,
              "type": "integer",
              "minimum": 1,
              "maximum": 100
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 512
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/ListVendorSenderDomainsResponseItem"
                      }
                    },
                    "nextCursor": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "total": {
                      "anyOf": [
                        {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "entityTimeZone": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "data",
                    "nextCursor",
                    "total",
                    "entityTimeZone"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "404": {
            "$ref": "#/components/responses/Problem404"
          },
          "422": {
            "$ref": "#/components/responses/Problem422"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      }
    },
    "/v1/vendors/{vendorId}/sender-domains/{senderDomainId}/restore": {
      "post": {
        "operationId": "restoreVendorSenderDomain",
        "summary": "Restores a retired email domain to a vendor.",
        "description": "Restores a retired email domain to a vendor. Needs the `ledger:approve` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "purchases"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:approve",
        "parameters": [
          {
            "name": "vendorId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "senderDomainId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "reason": {
                    "type": "string",
                    "minLength": 4,
                    "maxLength": 500
                  }
                },
                "required": [
                  "reason"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "Ledger-Position": {
                "$ref": "#/components/headers/LedgerPosition"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RetireVendorSenderDomainResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem400"
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "404": {
            "$ref": "#/components/responses/Problem404"
          },
          "409": {
            "$ref": "#/components/responses/Problem409"
          },
          "412": {
            "$ref": "#/components/responses/Problem412"
          },
          "422": {
            "$ref": "#/components/responses/Problem422"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      }
    },
    "/v1/vendors/{vendorId}/sender-domains/{senderDomainId}/retire": {
      "post": {
        "operationId": "retireVendorSenderDomain",
        "summary": "Retires an email domain a vendor no longer sends from.",
        "description": "Retires an email domain a vendor no longer sends from. Needs the `ledger:approve` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "purchases"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:approve",
        "parameters": [
          {
            "name": "vendorId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "senderDomainId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "reason": {
                    "type": "string",
                    "minLength": 4,
                    "maxLength": 500
                  }
                },
                "required": [
                  "reason"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "Ledger-Position": {
                "$ref": "#/components/headers/LedgerPosition"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RetireVendorSenderDomainResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem400"
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "404": {
            "$ref": "#/components/responses/Problem404"
          },
          "409": {
            "$ref": "#/components/responses/Problem409"
          },
          "412": {
            "$ref": "#/components/responses/Problem412"
          },
          "422": {
            "$ref": "#/components/responses/Problem422"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      }
    },
    "/v1/vendors/{vendorId}/slip-identity-ask": {
      "post": {
        "operationId": "draftSlipIdentityAsk",
        "summary": "Drafts the request asking a vendor for their slip identity.",
        "description": "Drafts the request asking a vendor for their slip identity. Needs the `ledger:propose` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "purchases"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:propose",
        "parameters": [
          {
            "name": "vendorId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "entityId": {
                    "type": "string",
                    "minLength": 1
                  },
                  "kind": {
                    "type": "string",
                    "enum": [
                      "T4A",
                      "T5018"
                    ]
                  },
                  "periodEnd": {
                    "type": "string",
                    "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                  },
                  "recipientEmail": {
                    "type": "string",
                    "maxLength": 320,
                    "format": "email",
                    "pattern": "^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"
                  }
                },
                "required": [
                  "entityId",
                  "kind",
                  "recipientEmail"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "Ledger-Position": {
                "$ref": "#/components/headers/LedgerPosition"
              },
              "Location": {
                "$ref": "#/components/headers/Location"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DraftBankingNoticeResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem400"
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "404": {
            "$ref": "#/components/responses/Problem404"
          },
          "409": {
            "$ref": "#/components/responses/Problem409"
          },
          "412": {
            "$ref": "#/components/responses/Problem412"
          },
          "422": {
            "$ref": "#/components/responses/Problem422"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      }
    },
    "/v1/vendors/{vendorId}/slip-identity-ask-facts": {
      "get": {
        "operationId": "getSlipIdentityAskFacts",
        "summary": "Returns the facts a request for a vendor's slip identity is built from.",
        "description": "Returns the facts a request for a vendor's slip identity is built from. Needs the `ledger:read` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "purchases"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:read",
        "parameters": [
          {
            "name": "vendorId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "entityId",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "kind",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "T4A",
                "T5018"
              ]
            }
          },
          {
            "name": "periodEnd",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "vendor": {
                      "$ref": "#/components/schemas/VendorOption1"
                    },
                    "items": {
                      "type": "array",
                      "items": {
                        "type": "string",
                        "enum": [
                          "RECIPIENT_TYPE",
                          "SURNAME",
                          "LEGAL_NAME",
                          "BUSINESS_NUMBER",
                          "PROVINCE",
                          "COUNTRY",
                          "ADDRESS"
                        ]
                      }
                    },
                    "addressIncomplete": {
                      "type": "boolean"
                    },
                    "defaultRecipient": {
                      "anyOf": [
                        {
                          "type": "object",
                          "properties": {
                            "email": {
                              "type": "string"
                            },
                            "name": {
                              "type": [
                                "string",
                                "null"
                              ]
                            }
                          },
                          "required": [
                            "email",
                            "name"
                          ],
                          "additionalProperties": false
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "contact": {
                      "anyOf": [
                        {
                          "type": "object",
                          "properties": {
                            "name": {
                              "type": "string"
                            },
                            "telephone": {
                              "type": "string"
                            },
                            "replyTo": {
                              "type": "string"
                            },
                            "source": {
                              "type": "string",
                              "enum": [
                                "SETTINGS",
                                "ADDRESS_WATCHER"
                              ]
                            }
                          },
                          "required": [
                            "name",
                            "telephone",
                            "replyTo",
                            "source"
                          ],
                          "additionalProperties": false
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "facts": {
                      "anyOf": [
                        {
                          "type": "object",
                          "properties": {
                            "kind": {
                              "type": "string",
                              "const": "SLIP_IDENTITY_ASK"
                            },
                            "common": {
                              "$ref": "#/components/schemas/Common"
                            },
                            "slipKind": {
                              "type": "string",
                              "enum": [
                                "T4A",
                                "T5018"
                              ]
                            },
                            "taxYear": {
                              "type": "integer",
                              "minimum": -9007199254740991,
                              "maximum": 9007199254740991
                            },
                            "entityId": {
                              "type": "string"
                            },
                            "items": {
                              "minItems": 1,
                              "maxItems": 7,
                              "type": "array",
                              "items": {
                                "type": "string",
                                "enum": [
                                  "RECIPIENT_TYPE",
                                  "SURNAME",
                                  "LEGAL_NAME",
                                  "BUSINESS_NUMBER",
                                  "PROVINCE",
                                  "COUNTRY",
                                  "ADDRESS"
                                ]
                              }
                            }
                          },
                          "required": [
                            "kind",
                            "common",
                            "slipKind",
                            "taxYear",
                            "entityId",
                            "items"
                          ],
                          "additionalProperties": false
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "alreadyAsked": {
                      "anyOf": [
                        {
                          "type": "object",
                          "properties": {
                            "by": {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string"
                                },
                                "name": {
                                  "type": "string"
                                }
                              },
                              "required": [
                                "id",
                                "name"
                              ],
                              "additionalProperties": false
                            },
                            "on": {
                              "type": "string",
                              "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                            },
                            "recipientEmail": {
                              "type": "string"
                            }
                          },
                          "required": [
                            "by",
                            "on",
                            "recipientEmail"
                          ],
                          "additionalProperties": false
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "openDraft": {
                      "anyOf": [
                        {
                          "type": "object",
                          "properties": {
                            "noticeId": {
                              "type": "string"
                            },
                            "by": {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string"
                                },
                                "name": {
                                  "type": "string"
                                }
                              },
                              "required": [
                                "id",
                                "name"
                              ],
                              "additionalProperties": false
                            },
                            "on": {
                              "type": "string",
                              "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                            }
                          },
                          "required": [
                            "noticeId",
                            "by",
                            "on"
                          ],
                          "additionalProperties": false
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "outboundApproved": {
                      "type": "boolean"
                    },
                    "entityTimeZone": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "vendor",
                    "items",
                    "addressIncomplete",
                    "defaultRecipient",
                    "contact",
                    "facts",
                    "alreadyAsked",
                    "openDraft",
                    "outboundApproved",
                    "entityTimeZone"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "404": {
            "$ref": "#/components/responses/Problem404"
          },
          "422": {
            "$ref": "#/components/responses/Problem422"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      }
    },
    "/v1/vendors/{vendorId}/slip-position": {
      "get": {
        "operationId": "getVendorSlipPosition",
        "summary": "Returns the slip position of a vendor.",
        "description": "Returns the slip position of a vendor. Needs the `ledger:read` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "purchases"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:read",
        "parameters": [
          {
            "name": "vendorId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "taxYear",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 2000,
              "maximum": 2100
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "entityTimeZone": {
                      "type": "string"
                    },
                    "positions": {
                      "maxItems": 40,
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "entity": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string"
                              },
                              "name": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "id",
                              "name"
                            ],
                            "additionalProperties": false
                          },
                          "kind": {
                            "type": "string",
                            "enum": [
                              "T4A",
                              "T5018"
                            ]
                          },
                          "taxYear": {
                            "type": "integer",
                            "minimum": -9007199254740991,
                            "maximum": 9007199254740991
                          },
                          "measuredMinor": {
                            "type": "string",
                            "pattern": "^-?\\d+$"
                          },
                          "projectedMinor": {
                            "type": "string",
                            "pattern": "^-?\\d+$"
                          },
                          "thresholdMinor": {
                            "type": "string",
                            "pattern": "^-?\\d+$"
                          },
                          "gapCodes": {
                            "type": "array",
                            "items": {
                              "type": "string",
                              "enum": [
                                "RECIPIENT_TYPE",
                                "SURNAME",
                                "LEGAL_NAME",
                                "BUSINESS_NUMBER",
                                "PROVINCE",
                                "COUNTRY"
                              ]
                            }
                          },
                          "readiness": {
                            "type": "string",
                            "enum": [
                              "NEEDS_DETAILS",
                              "GAPS_UNDER_THRESHOLD",
                              "READY"
                            ]
                          },
                          "copy": {
                            "anyOf": [
                              {
                                "type": "object",
                                "properties": {
                                  "id": {
                                    "type": "string"
                                  },
                                  "state": {
                                    "type": "string",
                                    "enum": [
                                      "NOT_PRODUCED",
                                      "PRODUCED",
                                      "DRAFTED",
                                      "BOUNCED",
                                      "EMAILED",
                                      "POSTED"
                                    ]
                                  }
                                },
                                "required": [
                                  "id",
                                  "state"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "null"
                              }
                            ]
                          }
                        },
                        "required": [
                          "entity",
                          "kind",
                          "taxYear",
                          "measuredMinor",
                          "projectedMinor",
                          "thresholdMinor",
                          "gapCodes",
                          "readiness",
                          "copy"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "total": {
                      "type": "integer",
                      "minimum": 0,
                      "maximum": 9007199254740991
                    }
                  },
                  "required": [
                    "entityTimeZone",
                    "positions",
                    "total"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "404": {
            "$ref": "#/components/responses/Problem404"
          },
          "422": {
            "$ref": "#/components/responses/Problem422"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      }
    },
    "/v1/vendors/{vendorId}/unlinked-bills": {
      "get": {
        "operationId": "listVendorUnlinkedBills",
        "summary": "Lists the bills of a vendor that are not linked to it.",
        "description": "Lists the bills of a vendor that are not linked to it. Needs the `ledger:read` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "purchases"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:read",
        "parameters": [
          {
            "name": "vendorId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "default": 50,
              "type": "integer",
              "minimum": 1,
              "maximum": 200
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 512
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "billId": {
                            "type": "string"
                          },
                          "number": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "supplierName": {
                            "type": "string"
                          },
                          "billDate": {
                            "type": "string",
                            "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                          },
                          "status": {
                            "type": "string",
                            "enum": [
                              "DRAFT",
                              "IN_REVIEW",
                              "DECLINED",
                              "APPROVED",
                              "HELD",
                              "OPEN",
                              "DUE",
                              "OVERDUE",
                              "IN_RUN",
                              "PARTIALLY_PAID",
                              "PAID",
                              "VOID"
                            ]
                          },
                          "totalMinor": {
                            "type": "string",
                            "pattern": "^-?\\d+$"
                          },
                          "currency": {
                            "type": "string",
                            "pattern": "^[A-Z]{3}$"
                          },
                          "entityName": {
                            "type": "string"
                          },
                          "linkable": {
                            "type": "boolean"
                          },
                          "why": {
                            "type": [
                              "string",
                              "null"
                            ]
                          }
                        },
                        "required": [
                          "billId",
                          "number",
                          "supplierName",
                          "billDate",
                          "status",
                          "totalMinor",
                          "currency",
                          "entityName",
                          "linkable",
                          "why"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "nextCursor": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "total": {
                      "anyOf": [
                        {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "linkableTotal": {
                      "type": "integer",
                      "minimum": 0,
                      "maximum": 9007199254740991
                    },
                    "inReview": {
                      "type": "integer",
                      "minimum": 0,
                      "maximum": 9007199254740991
                    },
                    "voided": {
                      "type": "integer",
                      "minimum": 0,
                      "maximum": 9007199254740991
                    },
                    "needsApprover": {
                      "type": "integer",
                      "minimum": 0,
                      "maximum": 9007199254740991
                    },
                    "entityTimeZone": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "data",
                    "nextCursor",
                    "total",
                    "linkableTotal",
                    "inReview",
                    "voided",
                    "needsApprover",
                    "entityTimeZone"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "404": {
            "$ref": "#/components/responses/Problem404"
          },
          "422": {
            "$ref": "#/components/responses/Problem422"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      }
    },
    "/v1/vendors/{vendorId}/withholding-bills": {
      "get": {
        "operationId": "listVendorWithholdingBills",
        "summary": "Lists the bills of a vendor that carry withholding.",
        "description": "Lists the bills of a vendor that carry withholding. Needs the `ledger:read` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "purchases"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:read",
        "parameters": [
          {
            "name": "vendorId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "default": 50,
              "type": "integer",
              "minimum": 1,
              "maximum": 200
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 512
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "number": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "billDate": {
                            "type": "string",
                            "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                          },
                          "totalMinor": {
                            "type": "string",
                            "pattern": "^-?\\d+$"
                          },
                          "currency": {
                            "type": "string",
                            "pattern": "^[A-Z]{3}$"
                          },
                          "undecidedLines": {
                            "type": "integer",
                            "exclusiveMinimum": 0,
                            "maximum": 9007199254740991
                          }
                        },
                        "required": [
                          "id",
                          "number",
                          "billDate",
                          "totalMinor",
                          "currency",
                          "undecidedLines"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "nextCursor": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "total": {
                      "anyOf": [
                        {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  },
                  "required": [
                    "data",
                    "nextCursor",
                    "total"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "404": {
            "$ref": "#/components/responses/Problem404"
          },
          "422": {
            "$ref": "#/components/responses/Problem422"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      }
    },
    "/v1/vendors/{vendorId}/withholding-waivers": {
      "get": {
        "operationId": "listVendorWithholdingWaivers",
        "summary": "Lists the withholding waivers granted to a vendor.",
        "description": "Lists the withholding waivers granted to a vendor. Needs the `ledger:read` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "purchases"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:read",
        "parameters": [
          {
            "name": "vendorId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "default": 50,
              "type": "integer",
              "minimum": 1,
              "maximum": 200
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 512
            }
          },
          {
            "name": "entityId",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/ListVendorWithholdingWaiversResponseItem"
                      }
                    },
                    "nextCursor": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "total": {
                      "anyOf": [
                        {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  },
                  "required": [
                    "data",
                    "nextCursor",
                    "total"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "404": {
            "$ref": "#/components/responses/Problem404"
          },
          "422": {
            "$ref": "#/components/responses/Problem422"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      },
      "post": {
        "operationId": "recordVendorWithholdingWaiver",
        "summary": "Records a withholding waiver granted to a vendor.",
        "description": "Records a withholding waiver granted to a vendor. Needs the `ledger:approve` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "purchases"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:approve",
        "parameters": [
          {
            "name": "vendorId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "entityId": {
                    "type": "string",
                    "minLength": 1
                  },
                  "vendorDocumentId": {
                    "type": "string",
                    "minLength": 1
                  },
                  "craReference": {
                    "type": "string",
                    "minLength": 3,
                    "maxLength": 40
                  },
                  "rateBp": {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 1499
                  },
                  "validFrom": {
                    "type": "string",
                    "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                  },
                  "validTo": {
                    "type": "string",
                    "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                  }
                },
                "required": [
                  "entityId",
                  "vendorDocumentId",
                  "craReference",
                  "rateBp",
                  "validFrom",
                  "validTo"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "Ledger-Position": {
                "$ref": "#/components/headers/LedgerPosition"
              },
              "Location": {
                "$ref": "#/components/headers/Location"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ListVendorWithholdingWaiversResponseItem"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem400"
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "404": {
            "$ref": "#/components/responses/Problem404"
          },
          "409": {
            "$ref": "#/components/responses/Problem409"
          },
          "412": {
            "$ref": "#/components/responses/Problem412"
          },
          "422": {
            "$ref": "#/components/responses/Problem422"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      }
    },
    "/v1/vendors/{vendorId}/withholding-waivers/{waiverId}/end": {
      "post": {
        "operationId": "endVendorWithholdingWaiver",
        "summary": "Ends a withholding waiver granted to a vendor.",
        "description": "Ends a withholding waiver granted to a vendor. Needs the `ledger:approve` permission. Beta: it can change with 30 days' notice.",
        "tags": [
          "purchases"
        ],
        "x-stability-level": "beta",
        "x-scope": "ledger:approve",
        "parameters": [
          {
            "name": "vendorId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "waiverId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "endedOn": {
                    "type": "string",
                    "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                  },
                  "reason": {
                    "type": "string",
                    "minLength": 3,
                    "maxLength": 500
                  }
                },
                "required": [
                  "endedOn",
                  "reason"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimitPolicy"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "Ledger-Position": {
                "$ref": "#/components/headers/LedgerPosition"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ListVendorWithholdingWaiversResponseItem"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem400"
          },
          "401": {
            "$ref": "#/components/responses/Problem401"
          },
          "403": {
            "$ref": "#/components/responses/Problem403"
          },
          "404": {
            "$ref": "#/components/responses/Problem404"
          },
          "409": {
            "$ref": "#/components/responses/Problem409"
          },
          "412": {
            "$ref": "#/components/responses/Problem412"
          },
          "422": {
            "$ref": "#/components/responses/Problem422"
          },
          "429": {
            "$ref": "#/components/responses/Problem429"
          },
          "500": {
            "$ref": "#/components/responses/Problem500"
          }
        }
      }
    }
  },
  "webhooks": {
    "bill.approved.v1": {
      "post": {
        "summary": "Bill event: approved.",
        "description": "Delivered to your webhook endpoint when this happens. The body is a pointer: read the record with getBill (GET /v1/bills/{billId}). Return a 2xx status to acknowledge it; a 410 pauses the endpoint.",
        "tags": [
          "purchases"
        ],
        "x-stability-level": "stable",
        "x-subject": "Bill",
        "x-read-operation": "getBill",
        "parameters": [
          {
            "name": "webhook-id",
            "in": "header",
            "required": true,
            "description": "The delivery's id; the same on every retry.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "webhook-timestamp",
            "in": "header",
            "required": true,
            "description": "Unix seconds when the delivery was signed.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "webhook-signature",
            "in": "header",
            "required": true,
            "description": "One or more `v1,` signatures over id, timestamp and the raw body (two during a secret rotation).",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string",
                    "format": "starts_with",
                    "pattern": "^evt_.*"
                  },
                  "type": {
                    "type": "string",
                    "const": "bill.approved.v1"
                  },
                  "timestamp": {
                    "type": "string",
                    "minLength": 20
                  },
                  "apiVersion": {
                    "type": "string",
                    "const": "v1"
                  },
                  "ledgerId": {
                    "type": "string",
                    "minLength": 1
                  },
                  "position": {
                    "type": "string",
                    "pattern": "^(0|[1-9]\\d{0,18})$"
                  },
                  "data": {
                    "$ref": "#/components/schemas/Data3"
                  }
                },
                "required": [
                  "id",
                  "type",
                  "timestamp",
                  "apiVersion",
                  "ledgerId",
                  "position",
                  "data"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "410": {
            "description": "The receiver is gone. The endpoint is paused."
          },
          "2XX": {
            "description": "The delivery was received."
          }
        }
      }
    },
    "bill.declined.v1": {
      "post": {
        "summary": "Bill event: declined.",
        "description": "Delivered to your webhook endpoint when this happens. The body is a pointer: read the record with getBill (GET /v1/bills/{billId}). Return a 2xx status to acknowledge it; a 410 pauses the endpoint.",
        "tags": [
          "purchases"
        ],
        "x-stability-level": "stable",
        "x-subject": "Bill",
        "x-read-operation": "getBill",
        "parameters": [
          {
            "name": "webhook-id",
            "in": "header",
            "required": true,
            "description": "The delivery's id; the same on every retry.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "webhook-timestamp",
            "in": "header",
            "required": true,
            "description": "Unix seconds when the delivery was signed.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "webhook-signature",
            "in": "header",
            "required": true,
            "description": "One or more `v1,` signatures over id, timestamp and the raw body (two during a secret rotation).",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string",
                    "format": "starts_with",
                    "pattern": "^evt_.*"
                  },
                  "type": {
                    "type": "string",
                    "const": "bill.declined.v1"
                  },
                  "timestamp": {
                    "type": "string",
                    "minLength": 20
                  },
                  "apiVersion": {
                    "type": "string",
                    "const": "v1"
                  },
                  "ledgerId": {
                    "type": "string",
                    "minLength": 1
                  },
                  "position": {
                    "type": "string",
                    "pattern": "^(0|[1-9]\\d{0,18})$"
                  },
                  "data": {
                    "$ref": "#/components/schemas/Data3"
                  }
                },
                "required": [
                  "id",
                  "type",
                  "timestamp",
                  "apiVersion",
                  "ledgerId",
                  "position",
                  "data"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "410": {
            "description": "The receiver is gone. The endpoint is paused."
          },
          "2XX": {
            "description": "The delivery was received."
          }
        }
      }
    },
    "bill.drafted.v1": {
      "post": {
        "summary": "Bill event: drafted.",
        "description": "Delivered to your webhook endpoint when this happens. The body is a pointer: read the record with getBill (GET /v1/bills/{billId}). Return a 2xx status to acknowledge it; a 410 pauses the endpoint.",
        "tags": [
          "purchases"
        ],
        "x-stability-level": "stable",
        "x-subject": "Bill",
        "x-read-operation": "getBill",
        "parameters": [
          {
            "name": "webhook-id",
            "in": "header",
            "required": true,
            "description": "The delivery's id; the same on every retry.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "webhook-timestamp",
            "in": "header",
            "required": true,
            "description": "Unix seconds when the delivery was signed.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "webhook-signature",
            "in": "header",
            "required": true,
            "description": "One or more `v1,` signatures over id, timestamp and the raw body (two during a secret rotation).",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string",
                    "format": "starts_with",
                    "pattern": "^evt_.*"
                  },
                  "type": {
                    "type": "string",
                    "const": "bill.drafted.v1"
                  },
                  "timestamp": {
                    "type": "string",
                    "minLength": 20
                  },
                  "apiVersion": {
                    "type": "string",
                    "const": "v1"
                  },
                  "ledgerId": {
                    "type": "string",
                    "minLength": 1
                  },
                  "position": {
                    "type": "string",
                    "pattern": "^(0|[1-9]\\d{0,18})$"
                  },
                  "data": {
                    "$ref": "#/components/schemas/Data3"
                  }
                },
                "required": [
                  "id",
                  "type",
                  "timestamp",
                  "apiVersion",
                  "ledgerId",
                  "position",
                  "data"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "410": {
            "description": "The receiver is gone. The endpoint is paused."
          },
          "2XX": {
            "description": "The delivery was received."
          }
        }
      }
    },
    "bill.held.v1": {
      "post": {
        "summary": "Bill event: held.",
        "description": "Delivered to your webhook endpoint when this happens. The body is a pointer: read the record with getBill (GET /v1/bills/{billId}). Return a 2xx status to acknowledge it; a 410 pauses the endpoint.",
        "tags": [
          "purchases"
        ],
        "x-stability-level": "stable",
        "x-subject": "Bill",
        "x-read-operation": "getBill",
        "parameters": [
          {
            "name": "webhook-id",
            "in": "header",
            "required": true,
            "description": "The delivery's id; the same on every retry.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "webhook-timestamp",
            "in": "header",
            "required": true,
            "description": "Unix seconds when the delivery was signed.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "webhook-signature",
            "in": "header",
            "required": true,
            "description": "One or more `v1,` signatures over id, timestamp and the raw body (two during a secret rotation).",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string",
                    "format": "starts_with",
                    "pattern": "^evt_.*"
                  },
                  "type": {
                    "type": "string",
                    "const": "bill.held.v1"
                  },
                  "timestamp": {
                    "type": "string",
                    "minLength": 20
                  },
                  "apiVersion": {
                    "type": "string",
                    "const": "v1"
                  },
                  "ledgerId": {
                    "type": "string",
                    "minLength": 1
                  },
                  "position": {
                    "type": "string",
                    "pattern": "^(0|[1-9]\\d{0,18})$"
                  },
                  "data": {
                    "$ref": "#/components/schemas/Data3"
                  }
                },
                "required": [
                  "id",
                  "type",
                  "timestamp",
                  "apiVersion",
                  "ledgerId",
                  "position",
                  "data"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "410": {
            "description": "The receiver is gone. The endpoint is paused."
          },
          "2XX": {
            "description": "The delivery was received."
          }
        }
      }
    },
    "bill.holdReleased.v1": {
      "post": {
        "summary": "Bill event: hold released.",
        "description": "Delivered to your webhook endpoint when this happens. The body is a pointer: read the record with getBill (GET /v1/bills/{billId}). Return a 2xx status to acknowledge it; a 410 pauses the endpoint.",
        "tags": [
          "purchases"
        ],
        "x-stability-level": "stable",
        "x-subject": "Bill",
        "x-read-operation": "getBill",
        "parameters": [
          {
            "name": "webhook-id",
            "in": "header",
            "required": true,
            "description": "The delivery's id; the same on every retry.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "webhook-timestamp",
            "in": "header",
            "required": true,
            "description": "Unix seconds when the delivery was signed.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "webhook-signature",
            "in": "header",
            "required": true,
            "description": "One or more `v1,` signatures over id, timestamp and the raw body (two during a secret rotation).",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string",
                    "format": "starts_with",
                    "pattern": "^evt_.*"
                  },
                  "type": {
                    "type": "string",
                    "const": "bill.holdReleased.v1"
                  },
                  "timestamp": {
                    "type": "string",
                    "minLength": 20
                  },
                  "apiVersion": {
                    "type": "string",
                    "const": "v1"
                  },
                  "ledgerId": {
                    "type": "string",
                    "minLength": 1
                  },
                  "position": {
                    "type": "string",
                    "pattern": "^(0|[1-9]\\d{0,18})$"
                  },
                  "data": {
                    "$ref": "#/components/schemas/Data3"
                  }
                },
                "required": [
                  "id",
                  "type",
                  "timestamp",
                  "apiVersion",
                  "ledgerId",
                  "position",
                  "data"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "410": {
            "description": "The receiver is gone. The endpoint is paused."
          },
          "2XX": {
            "description": "The delivery was received."
          }
        }
      }
    },
    "bill.paymentApplied.v1": {
      "post": {
        "summary": "Bill event: payment applied.",
        "description": "Delivered to your webhook endpoint when this happens. The body is a pointer: read the record with getBill (GET /v1/bills/{billId}). Return a 2xx status to acknowledge it; a 410 pauses the endpoint.",
        "tags": [
          "purchases"
        ],
        "x-stability-level": "stable",
        "x-subject": "Bill",
        "x-read-operation": "getBill",
        "parameters": [
          {
            "name": "webhook-id",
            "in": "header",
            "required": true,
            "description": "The delivery's id; the same on every retry.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "webhook-timestamp",
            "in": "header",
            "required": true,
            "description": "Unix seconds when the delivery was signed.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "webhook-signature",
            "in": "header",
            "required": true,
            "description": "One or more `v1,` signatures over id, timestamp and the raw body (two during a secret rotation).",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string",
                    "format": "starts_with",
                    "pattern": "^evt_.*"
                  },
                  "type": {
                    "type": "string",
                    "const": "bill.paymentApplied.v1"
                  },
                  "timestamp": {
                    "type": "string",
                    "minLength": 20
                  },
                  "apiVersion": {
                    "type": "string",
                    "const": "v1"
                  },
                  "ledgerId": {
                    "type": "string",
                    "minLength": 1
                  },
                  "position": {
                    "type": "string",
                    "pattern": "^(0|[1-9]\\d{0,18})$"
                  },
                  "data": {
                    "$ref": "#/components/schemas/Data3"
                  }
                },
                "required": [
                  "id",
                  "type",
                  "timestamp",
                  "apiVersion",
                  "ledgerId",
                  "position",
                  "data"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "410": {
            "description": "The receiver is gone. The endpoint is paused."
          },
          "2XX": {
            "description": "The delivery was received."
          }
        }
      }
    },
    "bill.paymentReturned.v1": {
      "post": {
        "summary": "Bill event: payment returned.",
        "description": "Delivered to your webhook endpoint when this happens. The body is a pointer: read the record with getBill (GET /v1/bills/{billId}). Return a 2xx status to acknowledge it; a 410 pauses the endpoint.",
        "tags": [
          "purchases"
        ],
        "x-stability-level": "stable",
        "x-subject": "Bill",
        "x-read-operation": "getBill",
        "parameters": [
          {
            "name": "webhook-id",
            "in": "header",
            "required": true,
            "description": "The delivery's id; the same on every retry.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "webhook-timestamp",
            "in": "header",
            "required": true,
            "description": "Unix seconds when the delivery was signed.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "webhook-signature",
            "in": "header",
            "required": true,
            "description": "One or more `v1,` signatures over id, timestamp and the raw body (two during a secret rotation).",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string",
                    "format": "starts_with",
                    "pattern": "^evt_.*"
                  },
                  "type": {
                    "type": "string",
                    "const": "bill.paymentReturned.v1"
                  },
                  "timestamp": {
                    "type": "string",
                    "minLength": 20
                  },
                  "apiVersion": {
                    "type": "string",
                    "const": "v1"
                  },
                  "ledgerId": {
                    "type": "string",
                    "minLength": 1
                  },
                  "position": {
                    "type": "string",
                    "pattern": "^(0|[1-9]\\d{0,18})$"
                  },
                  "data": {
                    "$ref": "#/components/schemas/Data3"
                  }
                },
                "required": [
                  "id",
                  "type",
                  "timestamp",
                  "apiVersion",
                  "ledgerId",
                  "position",
                  "data"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "410": {
            "description": "The receiver is gone. The endpoint is paused."
          },
          "2XX": {
            "description": "The delivery was received."
          }
        }
      }
    },
    "bill.submitted.v1": {
      "post": {
        "summary": "Bill event: submitted.",
        "description": "Delivered to your webhook endpoint when this happens. The body is a pointer: read the record with getBill (GET /v1/bills/{billId}). Return a 2xx status to acknowledge it; a 410 pauses the endpoint.",
        "tags": [
          "purchases"
        ],
        "x-stability-level": "stable",
        "x-subject": "Bill",
        "x-read-operation": "getBill",
        "parameters": [
          {
            "name": "webhook-id",
            "in": "header",
            "required": true,
            "description": "The delivery's id; the same on every retry.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "webhook-timestamp",
            "in": "header",
            "required": true,
            "description": "Unix seconds when the delivery was signed.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "webhook-signature",
            "in": "header",
            "required": true,
            "description": "One or more `v1,` signatures over id, timestamp and the raw body (two during a secret rotation).",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string",
                    "format": "starts_with",
                    "pattern": "^evt_.*"
                  },
                  "type": {
                    "type": "string",
                    "const": "bill.submitted.v1"
                  },
                  "timestamp": {
                    "type": "string",
                    "minLength": 20
                  },
                  "apiVersion": {
                    "type": "string",
                    "const": "v1"
                  },
                  "ledgerId": {
                    "type": "string",
                    "minLength": 1
                  },
                  "position": {
                    "type": "string",
                    "pattern": "^(0|[1-9]\\d{0,18})$"
                  },
                  "data": {
                    "$ref": "#/components/schemas/Data3"
                  }
                },
                "required": [
                  "id",
                  "type",
                  "timestamp",
                  "apiVersion",
                  "ledgerId",
                  "position",
                  "data"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "410": {
            "description": "The receiver is gone. The endpoint is paused."
          },
          "2XX": {
            "description": "The delivery was received."
          }
        }
      }
    },
    "bill.voided.v1": {
      "post": {
        "summary": "Bill event: voided.",
        "description": "Delivered to your webhook endpoint when this happens. The body is a pointer: read the record with getBill (GET /v1/bills/{billId}). Return a 2xx status to acknowledge it; a 410 pauses the endpoint.",
        "tags": [
          "purchases"
        ],
        "x-stability-level": "stable",
        "x-subject": "Bill",
        "x-read-operation": "getBill",
        "parameters": [
          {
            "name": "webhook-id",
            "in": "header",
            "required": true,
            "description": "The delivery's id; the same on every retry.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "webhook-timestamp",
            "in": "header",
            "required": true,
            "description": "Unix seconds when the delivery was signed.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "webhook-signature",
            "in": "header",
            "required": true,
            "description": "One or more `v1,` signatures over id, timestamp and the raw body (two during a secret rotation).",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string",
                    "format": "starts_with",
                    "pattern": "^evt_.*"
                  },
                  "type": {
                    "type": "string",
                    "const": "bill.voided.v1"
                  },
                  "timestamp": {
                    "type": "string",
                    "minLength": 20
                  },
                  "apiVersion": {
                    "type": "string",
                    "const": "v1"
                  },
                  "ledgerId": {
                    "type": "string",
                    "minLength": 1
                  },
                  "position": {
                    "type": "string",
                    "pattern": "^(0|[1-9]\\d{0,18})$"
                  },
                  "data": {
                    "$ref": "#/components/schemas/Data3"
                  }
                },
                "required": [
                  "id",
                  "type",
                  "timestamp",
                  "apiVersion",
                  "ledgerId",
                  "position",
                  "data"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "410": {
            "description": "The receiver is gone. The endpoint is paused."
          },
          "2XX": {
            "description": "The delivery was received."
          }
        }
      }
    },
    "purchaseOrder.approved.v1": {
      "post": {
        "summary": "Purchase order event: approved.",
        "description": "Delivered to your webhook endpoint when this happens. The body is a pointer: read the record with getPurchaseOrder (GET /v1/purchase-orders/{purchaseOrderId}). Return a 2xx status to acknowledge it; a 410 pauses the endpoint.",
        "tags": [
          "purchases"
        ],
        "x-stability-level": "stable",
        "x-subject": "PurchaseOrder",
        "x-read-operation": "getPurchaseOrder",
        "parameters": [
          {
            "name": "webhook-id",
            "in": "header",
            "required": true,
            "description": "The delivery's id; the same on every retry.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "webhook-timestamp",
            "in": "header",
            "required": true,
            "description": "Unix seconds when the delivery was signed.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "webhook-signature",
            "in": "header",
            "required": true,
            "description": "One or more `v1,` signatures over id, timestamp and the raw body (two during a secret rotation).",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string",
                    "format": "starts_with",
                    "pattern": "^evt_.*"
                  },
                  "type": {
                    "type": "string",
                    "const": "purchaseOrder.approved.v1"
                  },
                  "timestamp": {
                    "type": "string",
                    "minLength": 20
                  },
                  "apiVersion": {
                    "type": "string",
                    "const": "v1"
                  },
                  "ledgerId": {
                    "type": "string",
                    "minLength": 1
                  },
                  "position": {
                    "type": "string",
                    "pattern": "^(0|[1-9]\\d{0,18})$"
                  },
                  "data": {
                    "$ref": "#/components/schemas/Data5"
                  }
                },
                "required": [
                  "id",
                  "type",
                  "timestamp",
                  "apiVersion",
                  "ledgerId",
                  "position",
                  "data"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "410": {
            "description": "The receiver is gone. The endpoint is paused."
          },
          "2XX": {
            "description": "The delivery was received."
          }
        }
      }
    },
    "purchaseOrder.cancelled.v1": {
      "post": {
        "summary": "Purchase order event: cancelled.",
        "description": "Delivered to your webhook endpoint when this happens. The body is a pointer: read the record with getPurchaseOrder (GET /v1/purchase-orders/{purchaseOrderId}). Return a 2xx status to acknowledge it; a 410 pauses the endpoint.",
        "tags": [
          "purchases"
        ],
        "x-stability-level": "stable",
        "x-subject": "PurchaseOrder",
        "x-read-operation": "getPurchaseOrder",
        "parameters": [
          {
            "name": "webhook-id",
            "in": "header",
            "required": true,
            "description": "The delivery's id; the same on every retry.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "webhook-timestamp",
            "in": "header",
            "required": true,
            "description": "Unix seconds when the delivery was signed.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "webhook-signature",
            "in": "header",
            "required": true,
            "description": "One or more `v1,` signatures over id, timestamp and the raw body (two during a secret rotation).",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string",
                    "format": "starts_with",
                    "pattern": "^evt_.*"
                  },
                  "type": {
                    "type": "string",
                    "const": "purchaseOrder.cancelled.v1"
                  },
                  "timestamp": {
                    "type": "string",
                    "minLength": 20
                  },
                  "apiVersion": {
                    "type": "string",
                    "const": "v1"
                  },
                  "ledgerId": {
                    "type": "string",
                    "minLength": 1
                  },
                  "position": {
                    "type": "string",
                    "pattern": "^(0|[1-9]\\d{0,18})$"
                  },
                  "data": {
                    "$ref": "#/components/schemas/Data5"
                  }
                },
                "required": [
                  "id",
                  "type",
                  "timestamp",
                  "apiVersion",
                  "ledgerId",
                  "position",
                  "data"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "410": {
            "description": "The receiver is gone. The endpoint is paused."
          },
          "2XX": {
            "description": "The delivery was received."
          }
        }
      }
    },
    "purchaseOrder.sent.v1": {
      "post": {
        "summary": "Purchase order event: sent.",
        "description": "Delivered to your webhook endpoint when this happens. The body is a pointer: read the record with getPurchaseOrder (GET /v1/purchase-orders/{purchaseOrderId}). Return a 2xx status to acknowledge it; a 410 pauses the endpoint.",
        "tags": [
          "purchases"
        ],
        "x-stability-level": "stable",
        "x-subject": "PurchaseOrder",
        "x-read-operation": "getPurchaseOrder",
        "parameters": [
          {
            "name": "webhook-id",
            "in": "header",
            "required": true,
            "description": "The delivery's id; the same on every retry.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "webhook-timestamp",
            "in": "header",
            "required": true,
            "description": "Unix seconds when the delivery was signed.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "webhook-signature",
            "in": "header",
            "required": true,
            "description": "One or more `v1,` signatures over id, timestamp and the raw body (two during a secret rotation).",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string",
                    "format": "starts_with",
                    "pattern": "^evt_.*"
                  },
                  "type": {
                    "type": "string",
                    "const": "purchaseOrder.sent.v1"
                  },
                  "timestamp": {
                    "type": "string",
                    "minLength": 20
                  },
                  "apiVersion": {
                    "type": "string",
                    "const": "v1"
                  },
                  "ledgerId": {
                    "type": "string",
                    "minLength": 1
                  },
                  "position": {
                    "type": "string",
                    "pattern": "^(0|[1-9]\\d{0,18})$"
                  },
                  "data": {
                    "$ref": "#/components/schemas/Data5"
                  }
                },
                "required": [
                  "id",
                  "type",
                  "timestamp",
                  "apiVersion",
                  "ledgerId",
                  "position",
                  "data"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "410": {
            "description": "The receiver is gone. The endpoint is paused."
          },
          "2XX": {
            "description": "The delivery was received."
          }
        }
      }
    },
    "vendor.accepted.v1": {
      "post": {
        "summary": "Vendor event: accepted.",
        "description": "Delivered to your webhook endpoint when this happens. The body is a pointer: read the record with getVendor (GET /v1/vendors/{vendorId}). Return a 2xx status to acknowledge it; a 410 pauses the endpoint.",
        "tags": [
          "purchases"
        ],
        "x-stability-level": "stable",
        "x-subject": "Vendor",
        "x-read-operation": "getVendor",
        "parameters": [
          {
            "name": "webhook-id",
            "in": "header",
            "required": true,
            "description": "The delivery's id; the same on every retry.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "webhook-timestamp",
            "in": "header",
            "required": true,
            "description": "Unix seconds when the delivery was signed.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "webhook-signature",
            "in": "header",
            "required": true,
            "description": "One or more `v1,` signatures over id, timestamp and the raw body (two during a secret rotation).",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string",
                    "format": "starts_with",
                    "pattern": "^evt_.*"
                  },
                  "type": {
                    "type": "string",
                    "const": "vendor.accepted.v1"
                  },
                  "timestamp": {
                    "type": "string",
                    "minLength": 20
                  },
                  "apiVersion": {
                    "type": "string",
                    "const": "v1"
                  },
                  "ledgerId": {
                    "type": "string",
                    "minLength": 1
                  },
                  "position": {
                    "type": "string",
                    "pattern": "^(0|[1-9]\\d{0,18})$"
                  },
                  "data": {
                    "$ref": "#/components/schemas/Data2"
                  }
                },
                "required": [
                  "id",
                  "type",
                  "timestamp",
                  "apiVersion",
                  "ledgerId",
                  "position",
                  "data"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "410": {
            "description": "The receiver is gone. The endpoint is paused."
          },
          "2XX": {
            "description": "The delivery was received."
          }
        }
      }
    },
    "vendor.archived.v1": {
      "post": {
        "summary": "Vendor event: archived.",
        "description": "Delivered to your webhook endpoint when this happens. The body is a pointer: read the record with getVendor (GET /v1/vendors/{vendorId}). Return a 2xx status to acknowledge it; a 410 pauses the endpoint.",
        "tags": [
          "purchases"
        ],
        "x-stability-level": "stable",
        "x-subject": "Vendor",
        "x-read-operation": "getVendor",
        "parameters": [
          {
            "name": "webhook-id",
            "in": "header",
            "required": true,
            "description": "The delivery's id; the same on every retry.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "webhook-timestamp",
            "in": "header",
            "required": true,
            "description": "Unix seconds when the delivery was signed.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "webhook-signature",
            "in": "header",
            "required": true,
            "description": "One or more `v1,` signatures over id, timestamp and the raw body (two during a secret rotation).",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string",
                    "format": "starts_with",
                    "pattern": "^evt_.*"
                  },
                  "type": {
                    "type": "string",
                    "const": "vendor.archived.v1"
                  },
                  "timestamp": {
                    "type": "string",
                    "minLength": 20
                  },
                  "apiVersion": {
                    "type": "string",
                    "const": "v1"
                  },
                  "ledgerId": {
                    "type": "string",
                    "minLength": 1
                  },
                  "position": {
                    "type": "string",
                    "pattern": "^(0|[1-9]\\d{0,18})$"
                  },
                  "data": {
                    "$ref": "#/components/schemas/Data2"
                  }
                },
                "required": [
                  "id",
                  "type",
                  "timestamp",
                  "apiVersion",
                  "ledgerId",
                  "position",
                  "data"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "410": {
            "description": "The receiver is gone. The endpoint is paused."
          },
          "2XX": {
            "description": "The delivery was received."
          }
        }
      }
    },
    "vendor.bankingChangeProposed.v1": {
      "post": {
        "summary": "Vendor event: banking change proposed.",
        "description": "Delivered to your webhook endpoint when this happens. The body is a pointer: read the record with getVendor (GET /v1/vendors/{vendorId}). Return a 2xx status to acknowledge it; a 410 pauses the endpoint.",
        "tags": [
          "purchases"
        ],
        "x-stability-level": "stable",
        "x-subject": "Vendor",
        "x-read-operation": "getVendor",
        "parameters": [
          {
            "name": "webhook-id",
            "in": "header",
            "required": true,
            "description": "The delivery's id; the same on every retry.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "webhook-timestamp",
            "in": "header",
            "required": true,
            "description": "Unix seconds when the delivery was signed.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "webhook-signature",
            "in": "header",
            "required": true,
            "description": "One or more `v1,` signatures over id, timestamp and the raw body (two during a secret rotation).",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string",
                    "format": "starts_with",
                    "pattern": "^evt_.*"
                  },
                  "type": {
                    "type": "string",
                    "const": "vendor.bankingChangeProposed.v1"
                  },
                  "timestamp": {
                    "type": "string",
                    "minLength": 20
                  },
                  "apiVersion": {
                    "type": "string",
                    "const": "v1"
                  },
                  "ledgerId": {
                    "type": "string",
                    "minLength": 1
                  },
                  "position": {
                    "type": "string",
                    "pattern": "^(0|[1-9]\\d{0,18})$"
                  },
                  "data": {
                    "$ref": "#/components/schemas/Data2"
                  }
                },
                "required": [
                  "id",
                  "type",
                  "timestamp",
                  "apiVersion",
                  "ledgerId",
                  "position",
                  "data"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "410": {
            "description": "The receiver is gone. The endpoint is paused."
          },
          "2XX": {
            "description": "The delivery was received."
          }
        }
      }
    },
    "vendor.bankingVerified.v1": {
      "post": {
        "summary": "Vendor event: banking verified.",
        "description": "Delivered to your webhook endpoint when this happens. The body is a pointer: read the record with getVendor (GET /v1/vendors/{vendorId}). Return a 2xx status to acknowledge it; a 410 pauses the endpoint.",
        "tags": [
          "purchases"
        ],
        "x-stability-level": "stable",
        "x-subject": "Vendor",
        "x-read-operation": "getVendor",
        "parameters": [
          {
            "name": "webhook-id",
            "in": "header",
            "required": true,
            "description": "The delivery's id; the same on every retry.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "webhook-timestamp",
            "in": "header",
            "required": true,
            "description": "Unix seconds when the delivery was signed.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "webhook-signature",
            "in": "header",
            "required": true,
            "description": "One or more `v1,` signatures over id, timestamp and the raw body (two during a secret rotation).",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string",
                    "format": "starts_with",
                    "pattern": "^evt_.*"
                  },
                  "type": {
                    "type": "string",
                    "const": "vendor.bankingVerified.v1"
                  },
                  "timestamp": {
                    "type": "string",
                    "minLength": 20
                  },
                  "apiVersion": {
                    "type": "string",
                    "const": "v1"
                  },
                  "ledgerId": {
                    "type": "string",
                    "minLength": 1
                  },
                  "position": {
                    "type": "string",
                    "pattern": "^(0|[1-9]\\d{0,18})$"
                  },
                  "data": {
                    "$ref": "#/components/schemas/Data2"
                  }
                },
                "required": [
                  "id",
                  "type",
                  "timestamp",
                  "apiVersion",
                  "ledgerId",
                  "position",
                  "data"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "410": {
            "description": "The receiver is gone. The endpoint is paused."
          },
          "2XX": {
            "description": "The delivery was received."
          }
        }
      }
    },
    "vendor.created.v1": {
      "post": {
        "summary": "Vendor event: created.",
        "description": "Delivered to your webhook endpoint when this happens. The body is a pointer: read the record with getVendor (GET /v1/vendors/{vendorId}). Return a 2xx status to acknowledge it; a 410 pauses the endpoint.",
        "tags": [
          "purchases"
        ],
        "x-stability-level": "stable",
        "x-subject": "Vendor",
        "x-read-operation": "getVendor",
        "parameters": [
          {
            "name": "webhook-id",
            "in": "header",
            "required": true,
            "description": "The delivery's id; the same on every retry.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "webhook-timestamp",
            "in": "header",
            "required": true,
            "description": "Unix seconds when the delivery was signed.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "webhook-signature",
            "in": "header",
            "required": true,
            "description": "One or more `v1,` signatures over id, timestamp and the raw body (two during a secret rotation).",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string",
                    "format": "starts_with",
                    "pattern": "^evt_.*"
                  },
                  "type": {
                    "type": "string",
                    "const": "vendor.created.v1"
                  },
                  "timestamp": {
                    "type": "string",
                    "minLength": 20
                  },
                  "apiVersion": {
                    "type": "string",
                    "const": "v1"
                  },
                  "ledgerId": {
                    "type": "string",
                    "minLength": 1
                  },
                  "position": {
                    "type": "string",
                    "pattern": "^(0|[1-9]\\d{0,18})$"
                  },
                  "data": {
                    "$ref": "#/components/schemas/Data2"
                  }
                },
                "required": [
                  "id",
                  "type",
                  "timestamp",
                  "apiVersion",
                  "ledgerId",
                  "position",
                  "data"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "410": {
            "description": "The receiver is gone. The endpoint is paused."
          },
          "2XX": {
            "description": "The delivery was received."
          }
        }
      }
    },
    "vendor.paymentHeld.v1": {
      "post": {
        "summary": "Vendor event: payment held.",
        "description": "Delivered to your webhook endpoint when this happens. The body is a pointer: read the record with getVendor (GET /v1/vendors/{vendorId}). Return a 2xx status to acknowledge it; a 410 pauses the endpoint.",
        "tags": [
          "purchases"
        ],
        "x-stability-level": "stable",
        "x-subject": "Vendor",
        "x-read-operation": "getVendor",
        "parameters": [
          {
            "name": "webhook-id",
            "in": "header",
            "required": true,
            "description": "The delivery's id; the same on every retry.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "webhook-timestamp",
            "in": "header",
            "required": true,
            "description": "Unix seconds when the delivery was signed.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "webhook-signature",
            "in": "header",
            "required": true,
            "description": "One or more `v1,` signatures over id, timestamp and the raw body (two during a secret rotation).",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string",
                    "format": "starts_with",
                    "pattern": "^evt_.*"
                  },
                  "type": {
                    "type": "string",
                    "const": "vendor.paymentHeld.v1"
                  },
                  "timestamp": {
                    "type": "string",
                    "minLength": 20
                  },
                  "apiVersion": {
                    "type": "string",
                    "const": "v1"
                  },
                  "ledgerId": {
                    "type": "string",
                    "minLength": 1
                  },
                  "position": {
                    "type": "string",
                    "pattern": "^(0|[1-9]\\d{0,18})$"
                  },
                  "data": {
                    "$ref": "#/components/schemas/Data2"
                  }
                },
                "required": [
                  "id",
                  "type",
                  "timestamp",
                  "apiVersion",
                  "ledgerId",
                  "position",
                  "data"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "410": {
            "description": "The receiver is gone. The endpoint is paused."
          },
          "2XX": {
            "description": "The delivery was received."
          }
        }
      }
    },
    "vendor.paymentHoldReleased.v1": {
      "post": {
        "summary": "Vendor event: payment hold released.",
        "description": "Delivered to your webhook endpoint when this happens. The body is a pointer: read the record with getVendor (GET /v1/vendors/{vendorId}). Return a 2xx status to acknowledge it; a 410 pauses the endpoint.",
        "tags": [
          "purchases"
        ],
        "x-stability-level": "stable",
        "x-subject": "Vendor",
        "x-read-operation": "getVendor",
        "parameters": [
          {
            "name": "webhook-id",
            "in": "header",
            "required": true,
            "description": "The delivery's id; the same on every retry.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "webhook-timestamp",
            "in": "header",
            "required": true,
            "description": "Unix seconds when the delivery was signed.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "webhook-signature",
            "in": "header",
            "required": true,
            "description": "One or more `v1,` signatures over id, timestamp and the raw body (two during a secret rotation).",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string",
                    "format": "starts_with",
                    "pattern": "^evt_.*"
                  },
                  "type": {
                    "type": "string",
                    "const": "vendor.paymentHoldReleased.v1"
                  },
                  "timestamp": {
                    "type": "string",
                    "minLength": 20
                  },
                  "apiVersion": {
                    "type": "string",
                    "const": "v1"
                  },
                  "ledgerId": {
                    "type": "string",
                    "minLength": 1
                  },
                  "position": {
                    "type": "string",
                    "pattern": "^(0|[1-9]\\d{0,18})$"
                  },
                  "data": {
                    "$ref": "#/components/schemas/Data2"
                  }
                },
                "required": [
                  "id",
                  "type",
                  "timestamp",
                  "apiVersion",
                  "ledgerId",
                  "position",
                  "data"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "410": {
            "description": "The receiver is gone. The endpoint is paused."
          },
          "2XX": {
            "description": "The delivery was received."
          }
        }
      }
    },
    "vendor.restored.v1": {
      "post": {
        "summary": "Vendor event: restored.",
        "description": "Delivered to your webhook endpoint when this happens. The body is a pointer: read the record with getVendor (GET /v1/vendors/{vendorId}). Return a 2xx status to acknowledge it; a 410 pauses the endpoint.",
        "tags": [
          "purchases"
        ],
        "x-stability-level": "stable",
        "x-subject": "Vendor",
        "x-read-operation": "getVendor",
        "parameters": [
          {
            "name": "webhook-id",
            "in": "header",
            "required": true,
            "description": "The delivery's id; the same on every retry.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "webhook-timestamp",
            "in": "header",
            "required": true,
            "description": "Unix seconds when the delivery was signed.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "webhook-signature",
            "in": "header",
            "required": true,
            "description": "One or more `v1,` signatures over id, timestamp and the raw body (two during a secret rotation).",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string",
                    "format": "starts_with",
                    "pattern": "^evt_.*"
                  },
                  "type": {
                    "type": "string",
                    "const": "vendor.restored.v1"
                  },
                  "timestamp": {
                    "type": "string",
                    "minLength": 20
                  },
                  "apiVersion": {
                    "type": "string",
                    "const": "v1"
                  },
                  "ledgerId": {
                    "type": "string",
                    "minLength": 1
                  },
                  "position": {
                    "type": "string",
                    "pattern": "^(0|[1-9]\\d{0,18})$"
                  },
                  "data": {
                    "$ref": "#/components/schemas/Data2"
                  }
                },
                "required": [
                  "id",
                  "type",
                  "timestamp",
                  "apiVersion",
                  "ledgerId",
                  "position",
                  "data"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "410": {
            "description": "The receiver is gone. The endpoint is paused."
          },
          "2XX": {
            "description": "The delivery was received."
          }
        }
      }
    },
    "vendor.updated.v1": {
      "post": {
        "summary": "Vendor event: updated.",
        "description": "Delivered to your webhook endpoint when this happens. The body is a pointer: read the record with getVendor (GET /v1/vendors/{vendorId}). Return a 2xx status to acknowledge it; a 410 pauses the endpoint.",
        "tags": [
          "purchases"
        ],
        "x-stability-level": "stable",
        "x-subject": "Vendor",
        "x-read-operation": "getVendor",
        "parameters": [
          {
            "name": "webhook-id",
            "in": "header",
            "required": true,
            "description": "The delivery's id; the same on every retry.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "webhook-timestamp",
            "in": "header",
            "required": true,
            "description": "Unix seconds when the delivery was signed.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "webhook-signature",
            "in": "header",
            "required": true,
            "description": "One or more `v1,` signatures over id, timestamp and the raw body (two during a secret rotation).",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string",
                    "format": "starts_with",
                    "pattern": "^evt_.*"
                  },
                  "type": {
                    "type": "string",
                    "const": "vendor.updated.v1"
                  },
                  "timestamp": {
                    "type": "string",
                    "minLength": 20
                  },
                  "apiVersion": {
                    "type": "string",
                    "const": "v1"
                  },
                  "ledgerId": {
                    "type": "string",
                    "minLength": 1
                  },
                  "position": {
                    "type": "string",
                    "pattern": "^(0|[1-9]\\d{0,18})$"
                  },
                  "data": {
                    "$ref": "#/components/schemas/Data2"
                  }
                },
                "required": [
                  "id",
                  "type",
                  "timestamp",
                  "apiVersion",
                  "ledgerId",
                  "position",
                  "data"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "410": {
            "description": "The receiver is gone. The endpoint is paused."
          },
          "2XX": {
            "description": "The delivery was received."
          }
        }
      }
    },
    "vendorCredit.applied.v1": {
      "post": {
        "summary": "Vendor credit event: applied.",
        "description": "Delivered to your webhook endpoint when this happens. The body is a pointer: read the record with getVendorCredit (GET /v1/vendor-credits/{vendorCreditId}). Return a 2xx status to acknowledge it; a 410 pauses the endpoint.",
        "tags": [
          "purchases"
        ],
        "x-stability-level": "stable",
        "x-subject": "VendorCredit",
        "x-read-operation": "getVendorCredit",
        "parameters": [
          {
            "name": "webhook-id",
            "in": "header",
            "required": true,
            "description": "The delivery's id; the same on every retry.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "webhook-timestamp",
            "in": "header",
            "required": true,
            "description": "Unix seconds when the delivery was signed.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "webhook-signature",
            "in": "header",
            "required": true,
            "description": "One or more `v1,` signatures over id, timestamp and the raw body (two during a secret rotation).",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string",
                    "format": "starts_with",
                    "pattern": "^evt_.*"
                  },
                  "type": {
                    "type": "string",
                    "const": "vendorCredit.applied.v1"
                  },
                  "timestamp": {
                    "type": "string",
                    "minLength": 20
                  },
                  "apiVersion": {
                    "type": "string",
                    "const": "v1"
                  },
                  "ledgerId": {
                    "type": "string",
                    "minLength": 1
                  },
                  "position": {
                    "type": "string",
                    "pattern": "^(0|[1-9]\\d{0,18})$"
                  },
                  "data": {
                    "$ref": "#/components/schemas/Data6"
                  }
                },
                "required": [
                  "id",
                  "type",
                  "timestamp",
                  "apiVersion",
                  "ledgerId",
                  "position",
                  "data"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "410": {
            "description": "The receiver is gone. The endpoint is paused."
          },
          "2XX": {
            "description": "The delivery was received."
          }
        }
      }
    },
    "vendorCredit.approved.v1": {
      "post": {
        "summary": "Vendor credit event: approved.",
        "description": "Delivered to your webhook endpoint when this happens. The body is a pointer: read the record with getVendorCredit (GET /v1/vendor-credits/{vendorCreditId}). Return a 2xx status to acknowledge it; a 410 pauses the endpoint.",
        "tags": [
          "purchases"
        ],
        "x-stability-level": "stable",
        "x-subject": "VendorCredit",
        "x-read-operation": "getVendorCredit",
        "parameters": [
          {
            "name": "webhook-id",
            "in": "header",
            "required": true,
            "description": "The delivery's id; the same on every retry.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "webhook-timestamp",
            "in": "header",
            "required": true,
            "description": "Unix seconds when the delivery was signed.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "webhook-signature",
            "in": "header",
            "required": true,
            "description": "One or more `v1,` signatures over id, timestamp and the raw body (two during a secret rotation).",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string",
                    "format": "starts_with",
                    "pattern": "^evt_.*"
                  },
                  "type": {
                    "type": "string",
                    "const": "vendorCredit.approved.v1"
                  },
                  "timestamp": {
                    "type": "string",
                    "minLength": 20
                  },
                  "apiVersion": {
                    "type": "string",
                    "const": "v1"
                  },
                  "ledgerId": {
                    "type": "string",
                    "minLength": 1
                  },
                  "position": {
                    "type": "string",
                    "pattern": "^(0|[1-9]\\d{0,18})$"
                  },
                  "data": {
                    "$ref": "#/components/schemas/Data6"
                  }
                },
                "required": [
                  "id",
                  "type",
                  "timestamp",
                  "apiVersion",
                  "ledgerId",
                  "position",
                  "data"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "410": {
            "description": "The receiver is gone. The endpoint is paused."
          },
          "2XX": {
            "description": "The delivery was received."
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "apiKey": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "evk_ API key",
        "description": "A key an administrator of the books made in the app. It reads, or reads and drafts, on one ledger."
      },
      "oauth": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "JWT",
        "description": "An access token for a person who connected an app. Its audience is https://api.eternifylabs.com/v1. The app acts with that person's own role, inside what they allowed."
      }
    },
    "schemas": {
      "Account": {
        "anyOf": [
          {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "code": {
                "type": "string"
              },
              "name": {
                "type": "string"
              }
            },
            "required": [
              "id",
              "code",
              "name"
            ],
            "additionalProperties": false
          },
          {
            "type": "null"
          }
        ]
      },
      "Account2": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "displayName": {
            "type": "string"
          },
          "kind": {
            "type": "string",
            "enum": [
              "BANK",
              "CARD"
            ]
          }
        },
        "required": [
          "id",
          "displayName",
          "kind"
        ],
        "additionalProperties": false
      },
      "Account3": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "code": {
            "type": "string",
            "maxLength": 40
          },
          "name": {
            "type": "string",
            "maxLength": 200
          },
          "type": {
            "type": "string",
            "enum": [
              "ASSET",
              "LIABILITY",
              "EQUITY",
              "REVENUE",
              "EXPENSE"
            ]
          },
          "gifiCode": {
            "anyOf": [
              {
                "type": "string",
                "minLength": 4,
                "maxLength": 4
              },
              {
                "type": "null"
              }
            ]
          },
          "currency": {
            "anyOf": [
              {
                "type": "string",
                "pattern": "^[A-Z]{3}$"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "id",
          "code",
          "name",
          "type",
          "gifiCode",
          "currency"
        ],
        "additionalProperties": false
      },
      "AccountOption1": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "displayName": {
            "type": "string"
          },
          "currency": {
            "type": "string",
            "pattern": "^[A-Z]{3}$"
          }
        },
        "required": [
          "id",
          "displayName",
          "currency"
        ],
        "additionalProperties": false
      },
      "AccumulatedAccount": {
        "anyOf": [
          {
            "$ref": "#/components/schemas/Account3"
          },
          {
            "type": "null"
          }
        ]
      },
      "Act": {
        "type": "string",
        "enum": [
          "bills.submit",
          "bills.approve",
          "bills.hold",
          "bills.releaseHold",
          "bills.addToRun",
          "bills.plan",
          "bills.unplan",
          "vendors.holdPayments",
          "vendors.releasePaymentHolds",
          "paymentRuns.cancelDrafts",
          "purchaseOrders.submit",
          "arrivals.notABill",
          "arrivals.handled"
        ]
      },
      "AddVendorContactResponse": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "email": {
            "type": [
              "string",
              "null"
            ]
          },
          "phone": {
            "type": [
              "string",
              "null"
            ]
          },
          "role": {
            "type": "string",
            "enum": [
              "BILLING",
              "ACCOUNT_MANAGER",
              "ESCALATION",
              "REMITTANCE"
            ]
          },
          "note": {
            "type": [
              "string",
              "null"
            ]
          },
          "slipConsent": {
            "default": null,
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "state": {
                    "type": "string",
                    "enum": [
                      "NONE",
                      "GIVEN",
                      "WITHDRAWN",
                      "ADDRESS_CHANGED"
                    ]
                  },
                  "basis": {
                    "type": "string",
                    "enum": [
                      "WRITTEN",
                      "ELECTRONIC"
                    ]
                  },
                  "givenOn": {
                    "type": "string",
                    "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                  },
                  "email": {
                    "type": "string"
                  },
                  "recordedBy": {
                    "type": "object",
                    "properties": {
                      "id": {
                        "type": "string"
                      },
                      "name": {
                        "type": "string"
                      }
                    },
                    "required": [
                      "id",
                      "name"
                    ],
                    "additionalProperties": false
                  },
                  "recordedAt": {
                    "type": "string",
                    "minLength": 20
                  },
                  "withdrawnBy": {
                    "anyOf": [
                      {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "name": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "id",
                          "name"
                        ],
                        "additionalProperties": false
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "withdrawnAt": {
                    "anyOf": [
                      {
                        "type": "string",
                        "minLength": 20
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                },
                "required": [
                  "state",
                  "basis",
                  "givenOn",
                  "email",
                  "recordedBy",
                  "recordedAt",
                  "withdrawnBy",
                  "withdrawnAt"
                ],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "id",
          "name",
          "email",
          "phone",
          "role",
          "note",
          "slipConsent"
        ],
        "additionalProperties": false
      },
      "Address": {
        "anyOf": [
          {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "address": {
                "type": "string"
              },
              "label": {
                "type": "string"
              }
            },
            "required": [
              "id",
              "address",
              "label"
            ],
            "additionalProperties": false
          },
          {
            "type": "null"
          }
        ]
      },
      "AnswerableBy": {
        "type": "object",
        "properties": {
          "state": {
            "type": "string",
            "enum": [
              "SETTINGS",
              "ADDRESS_WATCHER",
              "NOBODY"
            ]
          },
          "name": {
            "type": [
              "string",
              "null"
            ]
          },
          "telephone": {
            "type": [
              "string",
              "null"
            ]
          },
          "replyTo": {
            "type": [
              "string",
              "null"
            ]
          },
          "settingsPersonWithoutSeat": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "state",
          "name",
          "telephone",
          "replyTo",
          "settingsPersonWithoutSeat"
        ],
        "additionalProperties": false
      },
      "AppliedOption1": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "billId": {
            "type": "string"
          },
          "vendorId": {
            "type": "string"
          },
          "vendorName": {
            "type": "string"
          },
          "state": {
            "type": "string",
            "enum": [
              "PROPOSED",
              "APPLIED",
              "ACCEPTED",
              "DECLINED",
              "SUPERSEDED"
            ]
          },
          "source": {
            "type": "string",
            "enum": [
              "RESOLVER",
              "MODEL_READ"
            ]
          },
          "evidence": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "kind": {
                  "type": "string",
                  "enum": [
                    "VENDOR_KEY",
                    "ALIAS_KEY",
                    "BUSINESS_NUMBER",
                    "SENDER_DOMAIN",
                    "PRINTED_ACCOUNT",
                    "NAME_RESEMBLES"
                  ]
                },
                "value": {
                  "type": [
                    "string",
                    "null"
                  ]
                }
              },
              "required": [
                "kind",
                "value"
              ],
              "additionalProperties": false
            }
          },
          "sentence": {
            "type": "string"
          },
          "promptVersion": {
            "type": [
              "string",
              "null"
            ]
          },
          "decidedBy": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string"
                  },
                  "name": {
                    "type": "string"
                  }
                },
                "required": [
                  "id",
                  "name"
                ],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ]
          },
          "decidedAt": {
            "anyOf": [
              {
                "type": "string",
                "minLength": 20
              },
              {
                "type": "null"
              }
            ]
          },
          "declineReason": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "id",
          "billId",
          "vendorId",
          "vendorName",
          "state",
          "source",
          "evidence",
          "sentence",
          "promptVersion",
          "decidedBy",
          "decidedAt",
          "declineReason"
        ],
        "additionalProperties": false
      },
      "ApproveBillSettlementResponse": {
        "type": "object",
        "properties": {
          "settlement": {
            "$ref": "#/components/schemas/ListBillSettlementsResponseItem"
          },
          "bill": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "status": {
                "type": "string"
              },
              "paidBy": {
                "type": "string",
                "enum": [
                  "RUN",
                  "CARD",
                  "PAD",
                  "ACCOUNT",
                  "CHEQUE",
                  "WIRE",
                  "ETRANSFER",
                  "OTHER"
                ]
              },
              "openMinor": {
                "type": "string",
                "pattern": "^-?\\d+$"
              }
            },
            "required": [
              "id",
              "status",
              "paidBy",
              "openMinor"
            ],
            "additionalProperties": false
          },
          "postingMoved": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "settlement",
          "bill",
          "postingMoved"
        ],
        "additionalProperties": false
      },
      "ApprovedUnder": {
        "anyOf": [
          {
            "type": "object",
            "properties": {
              "firingId": {
                "type": "string"
              },
              "authorityId": {
                "type": "string"
              },
              "approvedByName": {
                "type": "string"
              },
              "setByName": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "origin": {
                "type": "string",
                "enum": [
                  "CARRIED_OVER",
                  "PERSON",
                  "IMPORT"
                ]
              },
              "scopeLabel": {
                "type": "string"
              },
              "entityName": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "capMinor": {
                "anyOf": [
                  {
                    "type": "string",
                    "pattern": "^-?\\d+$"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "currency": {
                "type": "string"
              },
              "firedAt": {
                "type": "string",
                "minLength": 20
              },
              "subject": {
                "type": "object",
                "properties": {
                  "kind": {
                    "type": "string",
                    "enum": [
                      "BILL",
                      "ORDER",
                      "RUN"
                    ]
                  },
                  "id": {
                    "type": "string"
                  },
                  "number": {
                    "type": [
                      "string",
                      "null"
                    ]
                  }
                },
                "required": [
                  "kind",
                  "id",
                  "number"
                ],
                "additionalProperties": false
              }
            },
            "required": [
              "firingId",
              "authorityId",
              "approvedByName",
              "setByName",
              "origin",
              "scopeLabel",
              "entityName",
              "capMinor",
              "currency",
              "firedAt"
            ],
            "additionalProperties": false
          },
          {
            "type": "null"
          }
        ]
      },
      "Arrival": {
        "anyOf": [
          {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "receivedAt": {
                "type": "string",
                "minLength": 20
              },
              "subject": {
                "type": "string"
              }
            },
            "required": [
              "id",
              "receivedAt",
              "subject"
            ],
            "additionalProperties": false
          },
          {
            "type": "null"
          }
        ]
      },
      "AuditLogResponse": {
        "type": "object",
        "properties": {
          "data": {
            "$ref": "#/components/schemas/History"
          },
          "nextCursor": {
            "type": [
              "string",
              "null"
            ]
          },
          "total": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991
              },
              {
                "type": "null"
              }
            ]
          },
          "imported": {
            "$ref": "#/components/schemas/Imported"
          },
          "totals": {
            "$ref": "#/components/schemas/Totals"
          },
          "origin": {
            "type": "string",
            "enum": [
              "ALL",
              "NATIVE",
              "IMPORTED"
            ]
          },
          "zone": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "data",
          "nextCursor",
          "total",
          "imported",
          "totals",
          "origin",
          "zone"
        ],
        "additionalProperties": false
      },
      "Before": {
        "type": "object",
        "properties": {
          "billDate": {
            "type": "string",
            "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
          },
          "dueDate": {
            "type": "string",
            "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
          },
          "number": {
            "type": [
              "string",
              "null"
            ]
          },
          "vendorId": {
            "type": [
              "string",
              "null"
            ]
          },
          "totalMinor": {
            "type": "string",
            "pattern": "^-?\\d+$"
          },
          "taxMinor": {
            "type": "string",
            "pattern": "^-?\\d+$"
          }
        },
        "required": [
          "billDate",
          "dueDate",
          "number",
          "vendorId",
          "totalMinor",
          "taxMinor"
        ],
        "additionalProperties": false
      },
      "BillOption1": {
        "type": "object",
        "properties": {
          "billId": {
            "type": "string"
          },
          "supplierName": {
            "type": "string"
          },
          "number": {
            "type": [
              "string",
              "null"
            ]
          },
          "billDate": {
            "type": "string",
            "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
          },
          "status": {
            "type": "string",
            "enum": [
              "DRAFT",
              "IN_REVIEW",
              "DECLINED",
              "APPROVED",
              "HELD",
              "OPEN",
              "DUE",
              "OVERDUE",
              "IN_RUN",
              "PARTIALLY_PAID",
              "PAID",
              "VOID"
            ]
          },
          "totalMinor": {
            "type": "string",
            "pattern": "^-?\\d+$"
          },
          "currency": {
            "type": "string",
            "pattern": "^[A-Z]{3}$"
          }
        },
        "required": [
          "billId",
          "supplierName",
          "number",
          "billDate",
          "status",
          "totalMinor",
          "currency"
        ],
        "additionalProperties": false
      },
      "Blocked": {
        "type": "object",
        "properties": {
          "answer": {
            "type": [
              "string",
              "null"
            ]
          },
          "assign": {
            "type": [
              "string",
              "null"
            ]
          },
          "resolve": {
            "type": [
              "string",
              "null"
            ]
          },
          "setAside": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "answer",
          "assign",
          "resolve",
          "setAside"
        ],
        "additionalProperties": false
      },
      "BulkHoldVendorPaymentsRequest": {
        "type": "object",
        "properties": {
          "mode": {
            "type": "string",
            "enum": [
              "PREVIEW",
              "RUN"
            ]
          },
          "selection": {
            "oneOf": [
              {
                "type": "object",
                "properties": {
                  "kind": {
                    "type": "string",
                    "const": "ids"
                  },
                  "ids": {
                    "minItems": 1,
                    "maxItems": 500,
                    "type": "array",
                    "items": {
                      "type": "string",
                      "minLength": 1
                    }
                  }
                },
                "required": [
                  "kind",
                  "ids"
                ],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "kind": {
                    "type": "string",
                    "const": "filter"
                  },
                  "query": {
                    "type": "object",
                    "propertyNames": {
                      "type": "string"
                    },
                    "additionalProperties": {
                      "type": "string"
                    }
                  },
                  "expectedTotal": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 9007199254740991
                  }
                },
                "required": [
                  "kind",
                  "query",
                  "expectedTotal"
                ],
                "additionalProperties": false
              }
            ]
          },
          "reason": {
            "type": "string",
            "minLength": 1,
            "maxLength": 500
          },
          "until": {
            "type": "string",
            "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
          },
          "on": {
            "type": "string",
            "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
          },
          "note": {
            "type": "string",
            "minLength": 1,
            "maxLength": 500
          },
          "confirmed": {
            "type": "object",
            "properties": {
              "count": {
                "type": "integer",
                "minimum": 1,
                "maximum": 9007199254740991
              },
              "totals": {
                "$ref": "#/components/schemas/Totals2"
              }
            },
            "required": [
              "count",
              "totals"
            ],
            "additionalProperties": false
          }
        },
        "required": [
          "mode",
          "selection"
        ],
        "additionalProperties": false
      },
      "BulkHoldVendorPaymentsResponse": {
        "oneOf": [
          {
            "type": "object",
            "properties": {
              "mode": {
                "type": "string",
                "const": "PREVIEW"
              },
              "act": {
                "$ref": "#/components/schemas/Act"
              },
              "matching": {
                "anyOf": [
                  {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 9007199254740991
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "taken": {
                "type": "integer",
                "minimum": 0,
                "maximum": 9007199254740991
              },
              "eligible": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "label": {
                      "type": "string"
                    },
                    "entityId": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "currency": {
                      "anyOf": [
                        {
                          "type": "string",
                          "pattern": "^[A-Z]{3}$"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "minor": {
                      "anyOf": [
                        {
                          "type": "string",
                          "pattern": "^-?\\d+$"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "href": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "id",
                    "label",
                    "entityId",
                    "currency",
                    "minor",
                    "href"
                  ],
                  "additionalProperties": false
                }
              },
              "skipped": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "label": {
                      "type": "string"
                    },
                    "code": {
                      "type": "string"
                    },
                    "sentence": {
                      "type": "string"
                    },
                    "href": {
                      "type": [
                        "string",
                        "null"
                      ]
                    }
                  },
                  "required": [
                    "id",
                    "label",
                    "code",
                    "sentence",
                    "href"
                  ],
                  "additionalProperties": false
                }
              },
              "figures": {
                "type": "object",
                "properties": {
                  "count": {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 9007199254740991
                  },
                  "entries": {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 9007199254740991
                  },
                  "totals": {
                    "$ref": "#/components/schemas/Totals2"
                  },
                  "basis": {
                    "type": "string",
                    "enum": [
                      "FUNCTIONAL_TOTAL",
                      "DOCUMENT_TOTAL",
                      "STILL_OWED",
                      "NONE"
                    ]
                  }
                },
                "required": [
                  "count",
                  "entries",
                  "totals",
                  "basis"
                ],
                "additionalProperties": false
              },
              "authority": {
                "anyOf": [
                  {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "authorityId": {
                          "type": "string"
                        },
                        "scopeLabel": {
                          "type": "string"
                        },
                        "entityId": {
                          "type": "string"
                        },
                        "currency": {
                          "type": "string",
                          "pattern": "^[A-Z]{3}$"
                        },
                        "capMinor": {
                          "anyOf": [
                            {
                              "type": "string",
                              "pattern": "^-?\\d+$"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "usedMinor": {
                          "type": "string",
                          "pattern": "^-?\\d+$"
                        },
                        "over": {
                          "type": "boolean"
                        }
                      },
                      "required": [
                        "authorityId",
                        "scopeLabel",
                        "entityId",
                        "currency",
                        "capMinor",
                        "usedMinor",
                        "over"
                      ],
                      "additionalProperties": false
                    }
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "blocked": {
                "anyOf": [
                  {
                    "type": "object",
                    "properties": {
                      "code": {
                        "type": "string"
                      },
                      "sentence": {
                        "type": "string"
                      }
                    },
                    "required": [
                      "code",
                      "sentence"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "confirm": {
                "type": "string"
              },
              "handoff": {
                "anyOf": [
                  {
                    "type": "object",
                    "properties": {
                      "entityId": {
                        "type": "string"
                      },
                      "entityName": {
                        "type": "string"
                      },
                      "ids": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    },
                    "required": [
                      "entityId",
                      "entityName",
                      "ids"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "null"
                  }
                ]
              }
            },
            "required": [
              "mode",
              "act",
              "matching",
              "taken",
              "eligible",
              "skipped",
              "figures",
              "authority",
              "blocked",
              "confirm",
              "handoff"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "mode": {
                "type": "string",
                "const": "RUN"
              },
              "act": {
                "$ref": "#/components/schemas/Act"
              },
              "rows": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "label": {
                      "type": "string"
                    },
                    "outcome": {
                      "type": "string",
                      "enum": [
                        "DONE",
                        "REFUSED",
                        "NOT_ATTEMPTED"
                      ]
                    },
                    "code": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "sentence": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "href": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "id",
                    "label",
                    "outcome",
                    "code",
                    "sentence",
                    "href"
                  ],
                  "additionalProperties": false
                }
              },
              "done": {
                "type": "integer",
                "minimum": 0,
                "maximum": 9007199254740991
              },
              "refused": {
                "type": "integer",
                "minimum": 0,
                "maximum": 9007199254740991
              },
              "notAttempted": {
                "type": "integer",
                "minimum": 0,
                "maximum": 9007199254740991
              }
            },
            "required": [
              "mode",
              "act",
              "rows",
              "done",
              "refused",
              "notAttempted"
            ],
            "additionalProperties": false
          }
        ]
      },
      "CarriedFrom": {
        "description": "Where the line's values were carried from: the source line's kind, a colon and its id (\"PURCHASE_ORDER_LINE:ln_1\"), or null when the caller sent every value itself.",
        "x-stability-level": "beta",
        "type": [
          "string",
          "null"
        ]
      },
      "Check": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "taxNumber": {
            "type": "string"
          },
          "legalNameChecked": {
            "type": "string"
          },
          "confirmedFor": {
            "type": "string",
            "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
          },
          "outcome": {
            "type": "string",
            "enum": [
              "REGISTERED",
              "NOT_REGISTERED",
              "NO_MATCH"
            ]
          },
          "evidence": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "documentId": {
                    "type": "string"
                  },
                  "fileName": {
                    "type": "string"
                  }
                },
                "required": [
                  "documentId",
                  "fileName"
                ],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ]
          },
          "evidenceRead": {
            "type": "string",
            "enum": [
              "AGREES",
              "DIFFERS",
              "NOT_READ",
              "NO_EVIDENCE"
            ]
          },
          "evidenceReadPromptVersion": {
            "type": [
              "string",
              "null"
            ]
          },
          "note": {
            "type": [
              "string",
              "null"
            ]
          },
          "checkedBy": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "name": {
                "type": "string"
              }
            },
            "required": [
              "id",
              "name"
            ],
            "additionalProperties": false
          },
          "checkedAt": {
            "type": "string",
            "minLength": 20
          }
        },
        "required": [
          "id",
          "taxNumber",
          "legalNameChecked",
          "confirmedFor",
          "outcome",
          "evidence",
          "evidenceRead",
          "evidenceReadPromptVersion",
          "note",
          "checkedBy",
          "checkedAt"
        ],
        "additionalProperties": false
      },
      "ClosePurchaseOrderResponse": {
        "type": "object",
        "properties": {
          "purchaseOrderId": {
            "type": "string"
          },
          "status": {
            "type": "string",
            "enum": [
              "DRAFT",
              "IN_APPROVAL",
              "APPROVED",
              "SENT",
              "PART_RECEIVED",
              "RECEIVED",
              "CLOSED",
              "CANCELLED"
            ]
          },
          "closed": {
            "$ref": "#/components/schemas/Closed"
          }
        },
        "required": [
          "purchaseOrderId",
          "status",
          "closed"
        ],
        "additionalProperties": false
      },
      "Closed": {
        "anyOf": [
          {
            "type": "object",
            "properties": {
              "by": {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string"
                  },
                  "name": {
                    "type": "string"
                  }
                },
                "required": [
                  "id",
                  "name"
                ],
                "additionalProperties": false
              },
              "at": {
                "type": "string",
                "minLength": 20
              },
              "reason": {
                "type": "string"
              },
              "short": {
                "type": "boolean"
              }
            },
            "required": [
              "by",
              "at",
              "reason",
              "short"
            ],
            "additionalProperties": false
          },
          {
            "type": "null"
          }
        ]
      },
      "ClosedBy": {
        "type": "object",
        "properties": {
          "label": {
            "type": "string"
          },
          "lockedByName": {
            "type": "string"
          },
          "lockedAt": {
            "type": "string",
            "minLength": 20
          },
          "reason": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "label",
          "lockedByName",
          "lockedAt",
          "reason"
        ],
        "additionalProperties": false
      },
      "Closure": {
        "anyOf": [
          {
            "type": "object",
            "properties": {
              "status": {
                "type": "string",
                "enum": [
                  "RESOLVED",
                  "SET_ASIDE"
                ]
              },
              "by": {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string"
                  },
                  "name": {
                    "type": "string"
                  }
                },
                "required": [
                  "id",
                  "name"
                ],
                "additionalProperties": false
              },
              "at": {
                "type": "string",
                "minLength": 20
              },
              "note": {
                "type": "string"
              }
            },
            "required": [
              "status",
              "by",
              "at",
              "note"
            ],
            "additionalProperties": false
          },
          {
            "type": "null"
          }
        ]
      },
      "Code": {
        "type": "string",
        "x-extensible-enum": [
          "validation_failed",
          "unauthenticated",
          "permission_denied",
          "not_found",
          "precondition_failed",
          "idempotency_conflict",
          "idempotency_in_flight",
          "conflict",
          "counterparty_link_taken",
          "payload_too_large",
          "write_conflict",
          "audit_chain_order",
          "unsupported_version",
          "service_unavailable",
          "not_implemented",
          "rate_limited",
          "payment_required",
          "bad_gateway",
          "internal_error",
          "account_not_active",
          "approval_required",
          "currency_tuple",
          "dimension_policy",
          "entry_changed",
          "gifi_code",
          "gifi_mismatch",
          "gifi_reserved_total",
          "illegal_transition",
          "invalid_draft",
          "invalid_money",
          "materiality_exceeded",
          "payment_file_invalid",
          "period_locked",
          "separation_of_duties",
          "tax_account_not_recurring",
          "tax_check_finding_not_open",
          "unbalanced_entry",
          "invalid_tax_input",
          "unsupported_tax_rule",
          "ai_budget_exceeded",
          "disclosure_not_accepted",
          "invalid_prompt",
          "model_output_unparsable",
          "model_refused",
          "connector_sync_unavailable",
          "no_model_provider",
          "not_in_review_queue",
          "company_domain_personal",
          "company_domain_missing",
          "company_not_found",
          "company_person_not_listed",
          "provider_key_missing",
          "provider_key_refused",
          "provider_unavailable",
          "provider_credits_exhausted",
          "api_key_label_taken",
          "api_key_cap_reached",
          "api_key_already_revoked",
          "api_key_revoked",
          "api_key_expired",
          "public_api_field_not_allowed",
          "public_api_unknown_field",
          "public_api_unknown_parameter",
          "public_api_body_too_large",
          "api_key_warehouse_needs_admin",
          "connection_schedule_shape",
          "connection_schedule_too_frequent",
          "connection_time_zone_unknown",
          "connection_target_required",
          "connection_target_not_allowed",
          "connection_target_not_on_ledger",
          "connection_unsupported_provider",
          "connection_not_ready",
          "connection_ends_on_passed",
          "connection_schedule_not_set",
          "connection_not_stopped",
          "connection_not_a_bank_feed",
          "connection_suggestion_decided",
          "connection_seat_cannot_administer",
          "connection_company_required",
          "connection_suggestion_required",
          "connection_ledger_not_found",
          "connection_history_seat",
          "connection_history_page_size",
          "connection_history_trigger",
          "connection_history_cursor",
          "places_identity_missing",
          "places_not_permitted",
          "places_unavailable",
          "place_not_found",
          "itc_window_not_gst",
          "itc_window_year_unknown",
          "itc_window_year_future",
          "itc_window_already",
          "return_itc_support_not_gst34",
          "return_itc_support_export_too_many",
          "invoice_selection_stale",
          "invoice_documents_overrun",
          "contract_po_needs_approver",
          "grant_read_only",
          "grant_no_deletes",
          "banking_agent_refused",
          "banking_needs_web_app",
          "proposal_not_pending",
          "proposal_expired",
          "proposal_on_its_desk",
          "proposal_awaits_confirmation",
          "proposal_contract_changed",
          "proposal_declined_recently",
          "proposal_input_invalid",
          "proposal_input_sensitive",
          "operation_not_served_here",
          "undo_group_not_yours",
          "undo_group_closed",
          "test_copy_outbound_off",
          "test_copy_replaced",
          "test_copy_exists",
          "test_copy_of_copy",
          "test_copy_not_found",
          "test_copy_too_large",
          "test_copy_not_switchable",
          "test_copy_busy",
          "test_copy_base_missing",
          "promotion_too_large",
          "promotion_conflicted",
          "promotion_unresolved",
          "outbound_guard_belt",
          "operation_replay_only",
          "invitation_request_reused",
          "undo_group_required",
          "approval_needs_person",
          "operation_audit_facts",
          "model_read_facts_moved",
          "operation_call_timed_out",
          "operation_facts_moved",
          "operation_settling",
          "position_ahead_of_ledger",
          "job_not_started",
          "job_message_unreadable",
          "answer_unreadable",
          "resource_required",
          "consent_request_invalid",
          "two_factor_required",
          "two_factor_not_enrolled",
          "two_factor_code_wrong",
          "two_factor_locked",
          "grant_ledgers_empty",
          "grant_ledger_unavailable",
          "connected_app_not_found",
          "connected_app_already_revoked",
          "connected_apps_off",
          "connected_app_not_verified",
          "consent_incomplete",
          "intercompany_elimination_blocked_future",
          "intercompany_elimination_blocked_not_matched",
          "intercompany_elimination_blocked_currency",
          "intercompany_elimination_blocked_fiscal_year",
          "intercompany_elimination_blocked_not_posted",
          "intercompany_elimination_blocked_not_plain",
          "intercompany_elimination_blocked_open_differs",
          "intercompany_elimination_blocked_nothing_to_eliminate",
          "intercompany_void_needs_reason",
          "slip_copy_document_mismatch",
          "search_source_erased",
          "search_source_not_found",
          "search_source_not_failed",
          "search_query_empty",
          "search_unavailable",
          "redaction_unavailable",
          "parser_unavailable",
          "parser_refused",
          "ocr_unavailable",
          "embedding_unavailable",
          "assistant_rate_limited",
          "assistant_turn_running",
          "assistant_turn_ended",
          "assistant_confirmation_pending",
          "assistant_not_connected",
          "assistant_already_connected",
          "assistant_ticket_invalid",
          "assistant_ticket_expired",
          "assistant_turn_not_found",
          "assistant_model_unavailable",
          "erasure_request",
          "model_named",
          "figure_unread",
          "contact_detail",
          "web_address",
          "citation_unread",
          "ledger_required",
          "grant_ledger_excluded",
          "confirmation_not_yours",
          "program_limit_exceeded",
          "program_halted",
          "request_state_invalid",
          "undo_group_undone",
          "warehouse_not_configured",
          "warehouse_kind_unknown",
          "warehouse_target_invalid",
          "warehouse_destination_cap",
          "warehouse_target_taken",
          "warehouse_not_tested",
          "warehouse_residency_unacknowledged",
          "warehouse_destination_removed",
          "warehouse_wrong_state",
          "warehouse_credential_not_rotatable",
          "warehouse_backfill_running",
          "warehouse_writer_unavailable",
          "warehouse_setup_not_described",
          "job_not_found",
          "job_finished",
          "job_not_resumable",
          "job_already_open",
          "job_cancel_not_allowed",
          "job_cancel_reason_required",
          "job_step_failed",
          "job_stalled",
          "job_seat_revoked",
          "job_grant_revoked",
          "provider_token_refreshing",
          "bulk_operation_class_refused",
          "bulk_operation_not_idempotent",
          "bulk_operation_not_served",
          "bulk_operation_too_large",
          "bulk_operation_item_too_large",
          "bulk_operation_unknown",
          "bulk_operation_not_undoable",
          "job_not_pausable",
          "job_paused",
          "job_not_reinstatable",
          "undo_group_not_undone",
          "undo_outside_batch",
          "restore_only_through_undo",
          "undo_authority_revoked",
          "undo_authority_unknown",
          "record_import_not_found",
          "record_import_not_applying",
          "record_import_seat_narrowed",
          "close_not_ready",
          "chart_import_clash",
          "csv_import_too_many_rows",
          "custom_field_limit_reached",
          "custom_field_index_limit_reached",
          "custom_object_limit_reached",
          "custom_object_archived",
          "custom_key_taken",
          "custom_field_not_indexed",
          "custom_field_index_building",
          "custom_reference_not_found",
          "custom_record_changed",
          "dimension_type_limit_reached",
          "dimension_type_system",
          "validation_rule_limit_reached",
          "validation_rule_invalid",
          "validation_rule_failed",
          "record_labels_too_many",
          "custom_field_type_not_on_lines",
          "custom_field_line_not_indexable",
          "custom_field_print_limit_reached",
          "invalid_custom_field",
          "entry_posted",
          "operation_sunset",
          "idempotency_key_required",
          "api_access_not_enabled",
          "api_access_ledger_closed",
          "api_key_maker_left",
          "workflow_definition_invalid",
          "workflow_action_not_offered",
          "workflow_action_banking",
          "workflow_action_person_only",
          "workflow_proposal_not_last",
          "workflow_limit_reached",
          "workflow_expiry_invalid",
          "workflow_preview_required",
          "workflow_needs_second_admin",
          "workflow_owner_lacks_capability",
          "workflow_version_changed",
          "workflow_activation_needs_person",
          "workflow_not_active",
          "workflow_paused",
          "workflow_expired",
          "workflow_draft_missing",
          "approval_step_same_person",
          "approval_vote_twice",
          "rule_routing_moved",
          "rule_auto_approval_web_only",
          "workflow_run_banking_refused",
          "query_not_a_select",
          "query_multiple_statements",
          "query_syntax",
          "query_view_unknown",
          "query_view_not_permitted",
          "query_function_not_allowed",
          "query_construct_not_allowed",
          "query_duplicate_column",
          "query_too_large",
          "query_too_costly",
          "query_timed_out",
          "query_write_refused",
          "query_busy",
          "query_needs_order_for_paging",
          "query_offset_too_large",
          "query_cursor_mismatch",
          "analysis_scope_tampered",
          "analysis_deparse_mismatch",
          "measure_unknown",
          "dimension_unknown",
          "measure_dimension_unreachable",
          "measure_mixed_currency",
          "measure_point_in_time",
          "saved_query_changed",
          "saved_query_limit_reached",
          "saved_query_archived",
          "dimension_value_merge_type",
          "dimension_value_merge_target_merged",
          "dimension_value_merge_self",
          "dimension_value_has_children",
          "dimension_value_not_merged",
          "dimension_value_already_merged",
          "tenant_moving",
          "tenant_unavailable",
          "inbound_address_taken",
          "inbound_domain_taken",
          "vendor_export_too_many",
          "vendor_name_no_letters",
          "vendor_same_supplier",
          "vendor_default_account_not_on_ledger",
          "terms_not_on_ledger",
          "terms_not_for_purchases",
          "terms_days_no_set",
          "terms_days_ambiguous",
          "vendor_company_not_on_ledger",
          "vendor_owner_not_on_ledger",
          "vendor_counterparty_entity_taken",
          "banking_change_already_open",
          "vendor_second_remittance_contact",
          "vendor_archived_closed",
          "vendor_already_archived",
          "vendor_archive_banking_open",
          "vendor_not_archived",
          "vendor_hold_on_archived",
          "vendor_already_held",
          "vendor_not_held",
          "banking_evidence_not_on_ledger",
          "banking_vendor_archived",
          "banking_account_shared",
          "banking_change_already_decided",
          "banking_change_decided_meanwhile",
          "banking_change_frozen",
          "banking_change_not_in_force",
          "banking_decide_own_proposal",
          "banking_withdraw_not_yours",
          "banking_notice_moved",
          "banking_evidence_too_large",
          "banking_notice_not_owed",
          "banking_notice_already_recorded",
          "vendor_contact_remittance_needs_email",
          "vendor_contact_unreachable",
          "vendor_contact_email_role_taken",
          "vendor_contacts_full",
          "vendor_contact_unchanged",
          "purchases_cursor_unknown",
          "vendor_accept_own",
          "vendor_accept_archived",
          "vendor_already_accepted",
          "vendor_refuse_accepted",
          "vendor_refuse_already_decided",
          "banking_same_hand",
          "purchases_verification_method_not_offered",
          "purchases_payable_account_not_liability",
          "purchases_self_approved_export_too_many",
          "bill_export_too_many",
          "bill_vendor_not_on_ledger",
          "bill_vendor_archived",
          "bill_supplier_unnamed",
          "bill_due_before_bill_date",
          "bill_payable_not_on_chart",
          "bill_payable_not_liability",
          "bill_document_not_on_ledger",
          "bill_document_not_viewable",
          "bill_document_missing",
          "bill_document_stand_in",
          "bill_document_wrong_kind",
          "bill_document_inbox_keeps",
          "bill_lines_no_revisions",
          "bill_revision_unknown",
          "bill_line_price_mismatch",
          "bill_own_work_no_ceiling",
          "bill_own_work_over_ceiling",
          "bill_over_approval_ceiling",
          "bill_submit_blocked",
          "bill_decision_unknown",
          "bill_edit_blocked",
          "bill_import_number_required",
          "bill_import_company_gone",
          "bill_import_finding",
          "bill_import_duplicate",
          "bill_duplicate_stopped",
          "bill_not_found",
          "bill_not_awaiting_decision",
          "bill_decided_from_entry",
          "bill_approval_already_decided",
          "bill_cannot_post",
          "bill_line_uncoded",
          "bill_line_tax_changed",
          "bill_total_changed",
          "bill_draft_save_not_draft",
          "bill_edit_payload_unreadable",
          "bill_edit_not_posted",
          "bill_edit_already_pending",
          "bill_edit_payment_pinned",
          "bill_edit_none_pending",
          "bill_edit_own_proposal",
          "bill_edit_stale",
          "bill_edit_no_entry",
          "bill_legacy_changed",
          "bill_legacy_state",
          "bill_payment_changed",
          "bill_not_payable",
          "bill_changed",
          "bill_submit_not_draft",
          "bill_incomplete",
          "bill_number_used",
          "bill_void_not_posted",
          "bill_already_void",
          "bill_void_payment_blocked",
          "bill_void_edit_pending",
          "bill_void_no_entry",
          "bill_discard_not_draft",
          "payment_account_currency_not_in_file",
          "payment_originator_not_bank",
          "payment_run_export_too_many",
          "payment_date_too_far_ahead",
          "payment_date_too_far_back",
          "payment_run_account_not_company_bank",
          "payment_run_account_no_originator",
          "payment_run_bills_refused",
          "payment_run_bill_taken",
          "payment_run_allocation_moved",
          "payment_run_moved_meanwhile",
          "payment_run_payment_moved",
          "payment_run_release_own",
          "payment_run_not_draft",
          "payment_run_callback_unconfirmed",
          "payment_run_callback_unknown",
          "payment_run_no_rate",
          "payment_run_vendors_not_accepted",
          "payment_run_vendors_held",
          "payment_run_banking_moved",
          "payment_allocation_no_bill",
          "payment_bill_no_longer_owed",
          "payment_bill_entry_moved",
          "payment_bill_payable_lines",
          "payment_bill_payable_differs",
          "payment_run_cannot_cancel",
          "payment_run_cannot_reverse",
          "payment_run_no_entries",
          "payment_run_already_reversed",
          "payment_run_no_file",
          "payment_run_over_ceiling",
          "inbox_read_flag_not_open",
          "inbox_read_not_this_document",
          "inbox_read_already_read",
          "inbox_read_would_not_change",
          "inbox_read_attempts_used",
          "inbox_arrival_invoices_not_ours",
          "inbox_arrival_owned_by_bill",
          "inbox_arrival_at_the_desk",
          "inbox_arrival_already_decided",
          "inbox_arrival_sent_to_reader",
          "inbox_arrival_nothing_to_read",
          "inbox_arrival_type_not_readable",
          "inbox_arrival_already_read",
          "inbox_arrival_still_being_read",
          "inbox_arrivals_export_too_many",
          "inbox_refusals_export_too_many",
          "inbox_documents_export_too_many",
          "inbox_reply_stop_exists",
          "inbox_reply_stop_already_lifted",
          "inbox_replies_address_revoked",
          "inbox_replies_invoices_address",
          "inbox_replies_no_contact",
          "inbox_replies_until_out_of_range",
          "inbox_replies_already_off",
          "inbox_address_export_too_many",
          "inbox_address_mint_collided",
          "inbox_address_already_revoked",
          "inbox_address_vendor_archived",
          "inbox_address_watcher_no_seat",
          "inbox_address_telephone_required",
          "inbox_address_watcher_moved",
          "inbox_address_watcher_unchanged",
          "inbox_address_revoked_final",
          "inbox_address_binding_fixed",
          "inbox_address_invoices_not_bound",
          "inbox_address_suggestion_changed",
          "inbox_address_not_waiting",
          "inbox_address_no_suggestion",
          "vendor_notice_export_too_many",
          "vendor_notice_already_sent",
          "vendor_notice_withheld",
          "vendor_notice_draft_names_nobody",
          "vendor_notice_outbound_not_approved",
          "vendor_notice_recipient_stopped",
          "vendor_notice_recipient_bounced",
          "vendor_notice_relay_refused",
          "vendor_notice_vendor_archived",
          "vendor_notice_vendor_refused",
          "vendor_notice_address_unusable",
          "vendor_notice_recipient_not_on_record",
          "vendor_notice_no_email",
          "vendor_notice_no_contact",
          "vendor_notice_draft_open",
          "vendor_notice_not_drafted",
          "vendor_notice_paragraph_contact_detail",
          "vendor_notice_paragraph_banking",
          "bill_no_authority",
          "bill_outside_authority",
          "bill_authority_expired",
          "payment_run_no_authority",
          "payment_run_outside_authority",
          "payment_run_authority_expired",
          "authority_self_set",
          "authority_not_approver",
          "authority_scope_not_on_ledger",
          "authority_currency_not_company",
          "authority_own_work_above_cap",
          "authority_run_scope",
          "authority_expiry_out_of_range",
          "authority_already_open",
          "authority_closed",
          "authority_nothing_changed",
          "authority_carried_over_none",
          "authority_as_at_future",
          "authority_export_too_many",
          "bill_not_on_your_desk",
          "bill_stage_same_person",
          "bill_desk_not_waiting",
          "bill_desk_reassign_not_yours",
          "bill_desk_reassign_no_seat",
          "bill_desk_reassign_preparer",
          "bill_desk_reassign_no_authority",
          "bill_desk_reassign_same",
          "bill_desk_reassign_reviewer",
          "bill_awaiting_with_view",
          "bill_awaiting_too_many",
          "bill_approval_stage_export_too_many",
          "purchases_substitute_not_yours",
          "purchases_substitute_self",
          "purchases_substitute_no_seat",
          "purchases_substitute_too_long",
          "purchases_substitute_in_past",
          "purchases_substitute_overlap",
          "purchases_substitute_ended",
          "purchases_routing_desk_not_for_entries",
          "purchases_routing_author_no_authority",
          "purchases_policy_preview_needed",
          "purchases_policy_confirm_not_author",
          "purchases_policy_expiry_too_far",
          "purchases_policy_expiry_past",
          "purchases_policy_turn_on_by_confirm",
          "payment_originator_change_open",
          "payment_originator_same_as_in_force",
          "payment_originator_evidence_not_on_ledger",
          "payment_originator_decide_own_proposal",
          "payment_originator_change_already_decided",
          "payment_originator_change_decided_meanwhile",
          "payment_originator_withdraw_not_yours",
          "payment_run_originator_unverified",
          "payment_run_release_not_recorded",
          "bill_own_work_not_recorded",
          "payment_run_file_store_unavailable",
          "payment_run_file_missing",
          "payment_run_file_changed",
          "payment_run_file_stand_in",
          "full_export_own_request",
          "full_export_sole_admin",
          "full_export_override_not_sole",
          "full_export_override_not_owner",
          "full_export_already_decided",
          "full_export_decision_window_passed",
          "full_export_bank_files_not_confirmed",
          "full_export_bank_files_web_only",
          "full_export_not_approved",
          "full_export_not_yours",
          "full_export_already_downloaded",
          "full_export_download_window_passed",
          "full_export_not_requester",
          "full_export_list_too_many",
          "full_export_not_ready",
          "full_export_build_failed",
          "full_export_build_cancelled",
          "signal_already_decided",
          "signal_dismiss_own_work",
          "signal_export_too_many",
          "signal_decided_by_banking_change",
          "banking_signals_changed",
          "banking_reject_signal_not_fired",
          "vendor_sender_domain_already_retired",
          "vendor_sender_domain_not_retired",
          "bill_hold_not_payable",
          "bill_already_held",
          "bill_not_held",
          "bill_hold_until_past",
          "bill_hold_until_too_far",
          "payment_run_bills_held",
          "payment_run_bill_held_meanwhile",
          "bill_settlement_not_owed",
          "bill_settlement_in_draft_run",
          "bill_settlement_amount_moved",
          "bill_settlement_future_date",
          "bill_settlement_account_not_company",
          "bill_settlement_currency",
          "bill_settlement_paid_amount_required",
          "bill_settlement_method_not_recordable",
          "bill_settlement_no_open_period",
          "bill_settlement_payable_lines",
          "bill_settlement_payable_differs",
          "bill_settlement_same_person",
          "bill_settlement_over_ceiling",
          "bill_settlement_held",
          "bill_settlement_not_awaiting",
          "bill_settlement_run_owned",
          "bill_settlement_void_period_closed",
          "bill_paid_by_in_draft",
          "bill_paid_by_closed",
          "bill_paid_by_in_run",
          "bill_paid_by_recorded",
          "bill_still_owed_not_listed",
          "bill_paid_by_at_review",
          "bill_edit_paid_by",
          "purchases_as_of_future",
          "purchases_ageing_too_many_bills",
          "purchases_ageing_export_too_many",
          "purchases_report_unknown",
          "purchases_report_filter_not_taken",
          "purchases_report_status_unknown",
          "purchases_report_needs_company",
          "purchases_report_needs_dimension",
          "purchases_report_needs_slip_kind",
          "purchases_report_no_registration",
          "purchases_report_range_too_long",
          "purchases_report_controls_seat",
          "purchases_report_export_too_many",
          "purchases_report_working_set",
          "purchases_report_view_limit",
          "purchases_report_view_name_taken",
          "payment_run_reversal_not_recorded",
          "purchases_fx_method_recent",
          "bill_fx_not_foreign",
          "bill_fx_not_posted",
          "bill_fx_already_stated",
          "bill_fx_rate_date_future",
          "bill_itc_statement_void",
          "bill_itc_statement_not_claimed",
          "bill_itc_statement_stale",
          "vendor_registration_no_number",
          "vendor_registration_number_changed",
          "vendor_registration_date_future",
          "vendor_registration_evidence_not_found",
          "vendor_registration_evidence_too_large",
          "vendor_registration_evidence_missing",
          "vendor_registration_evidence_stand_in",
          "vendor_registration_state_checked",
          "bill_posting_date_required",
          "bill_posting_date_outside",
          "bill_posting_date_not_moved",
          "bill_posting_no_open_period",
          "bill_posting_date_not_recorded",
          "bill_posting_date_at_review",
          "payment_run_bill_owed_moved",
          "payment_bill_owed_moved",
          "bill_settlement_more_than_owed",
          "bill_settlement_short_without_reason",
          "vendor_credit_not_draft",
          "vendor_credit_no_vendor",
          "vendor_credit_incomplete",
          "vendor_credit_nothing_credited",
          "vendor_credit_number_used",
          "vendor_credit_date_future",
          "vendor_credit_vendor_archived",
          "vendor_credit_not_in_review",
          "vendor_credit_same_person",
          "vendor_credit_pricing_moved",
          "vendor_credit_posting_date_required",
          "vendor_credit_posting_date_outside",
          "vendor_credit_posting_date_not_moved",
          "vendor_credit_no_open_period",
          "vendor_credit_not_open",
          "vendor_credit_bill_other_vendor",
          "vendor_credit_bill_other_company",
          "vendor_credit_bill_currency",
          "vendor_credit_bill_not_owing",
          "vendor_credit_bill_in_draft_run",
          "vendor_credit_payable_differs",
          "vendor_credit_bill_over_open",
          "vendor_credit_over_remaining",
          "vendor_credit_already_applied",
          "vendor_credit_exchange_account_missing",
          "vendor_credit_application_in_run",
          "vendor_credit_application_not_live",
          "vendor_credit_not_approved",
          "vendor_credit_has_applications",
          "vendor_credit_has_refunds",
          "vendor_credit_refund_future_date",
          "vendor_credit_refund_account_not_company",
          "vendor_credit_refund_amount_required",
          "vendor_credit_refund_over_remaining",
          "vendor_credit_refund_not_awaiting",
          "vendor_credit_refund_not_standing",
          "vendor_credit_refund_same_person",
          "vendor_credit_export_too_many",
          "payment_run_credit_not_open",
          "payment_run_credit_other_vendor",
          "payment_run_credit_over_open",
          "payment_run_credit_covers_bill",
          "bill_supersede_not_draft",
          "bill_supersede_self",
          "bill_supersede_target_unknown",
          "bill_supersede_target_draft",
          "bill_supersede_other_company",
          "bill_supersede_no_vendor",
          "bill_supersede_other_vendor",
          "bill_supersede_taken",
          "bill_supersede_already_linked",
          "bill_supersede_not_linked",
          "bill_supersede_first_stands",
          "bill_supersede_flag_settled",
          "bill_supersede_flag_not_this",
          "payment_run_cheque_number_required",
          "payment_run_cheque_number_not_asked",
          "payment_run_cheque_number_range",
          "payment_run_cheque_number_taken",
          "payment_run_register_not_cheque",
          "payment_run_register_not_released",
          "bill_settlement_line_not_a_candidate",
          "bill_settlement_line_declined",
          "bill_settlement_feed_score_moved",
          "bill_settlement_line_taken",
          "bill_settlement_line_certified",
          "bill_feed_line_not_a_candidate",
          "payment_discount_changed",
          "payment_discount_window_closed",
          "payment_discount_account_type",
          "payment_run_remove_not_draft",
          "payment_run_remove_last",
          "payment_run_payment_already_removed",
          "payment_reverse_not_released",
          "payment_removed_never_posted",
          "payment_already_reversed",
          "payment_reverse_file_rejected",
          "payment_return_date_invalid",
          "payment_run_notice_document_invalid",
          "payment_run_lodgement_not_released",
          "payment_run_lodgement_recorded",
          "payment_run_lodgement_reversed",
          "payment_run_lodgement_date_invalid",
          "payment_run_outcome_not_lodged",
          "payment_run_outcome_recorded",
          "payment_run_outcome_accepted_reversed",
          "payment_run_outcome_after_return",
          "payment_run_outcome_date_invalid",
          "payment_run_banking_returned",
          "payment_run_banking_returned_meanwhile",
          "payment_run_totals_not_recorded",
          "payment_run_lodgement_cheque",
          "payment_run_bills_twin_paid",
          "bill_settlement_line_not_a_bill",
          "bill_settlement_line_amount_differs",
          "payment_run_clearing_disagrees",
          "payment_bank_profile_no_originator",
          "payment_bank_profile_exists",
          "payment_bank_profile_uncited",
          "payment_bank_profile_changed",
          "payment_run_test_not_draft",
          "payment_run_test_no_profile",
          "payment_run_test_check_failed",
          "payment_bank_file_verdict_recorded",
          "payment_bank_file_verdict_no_evidence",
          "payment_bank_file_evidence_not_on_ledger",
          "payment_bank_file_tests_export_too_many",
          "payment_run_bank_file_unproved",
          "payment_run_bank_date_window",
          "payment_run_bank_currency_refused",
          "payment_run_test_not_eft",
          "vendor_notice_remittance_run_not_released",
          "vendor_notice_remittance_not_sender",
          "vendor_notice_remittance_needs_second_person",
          "vendor_notice_remittance_new_address_needs_person",
          "vendor_notice_remittance_confirm_not_new",
          "vendor_notice_remittance_exists",
          "vendor_notice_remittance_payment_reversed",
          "vendor_notice_remittance_from_run",
          "vendor_notice_remittance_paragraph_contact_detail",
          "vendor_notice_remittance_paragraph_banking",
          "vendor_notice_remittance_paragraph_promise",
          "vendor_notice_bill_no_supplier",
          "vendor_notice_decision_not_made",
          "vendor_notice_no_supplier_contact",
          "vendor_notice_supplier_contact_no_seat",
          "vendor_notice_decision_draft_open",
          "vendor_notice_already_told",
          "vendor_notice_nothing_to_ask",
          "vendor_notice_words_decision",
          "vendor_notice_words_contact_detail",
          "vendor_notice_words_banking",
          "vendor_notice_banking_no_earlier_contact",
          "vendor_notice_recipient_after_change",
          "vendor_notice_not_person_drafted",
          "inbox_address_closing_out_of_range",
          "inbox_address_closing_scheduled",
          "inbox_address_closing_not_scheduled",
          "inbox_address_successor_unusable",
          "purchases_supplier_contact_no_seat",
          "inbox_address_closing_not_announced",
          "vendor_notice_supplier_contact_bills_address",
          "inbox_arrival_owned_by_credit",
          "vendor_credit_refund_currency",
          "vendor_credit_line_other_bill",
          "bill_settlement_evidence_unreadable",
          "bill_feed_line_no_supplier",
          "payment_run_bank_notice_too_large",
          "payment_run_wire_abroad_unreadable",
          "bill_supersede_prefill_too_many_lines",
          "bill_supersede_prefill_no_lines",
          "vendor_document_not_paper",
          "vendor_document_already_filed",
          "vendor_document_title",
          "vendor_document_dates",
          "vendor_document_expiry_too_far",
          "vendor_document_replaces_other_kind",
          "vendor_document_already_replaced",
          "vendor_document_already_withdrawn",
          "vendor_document_waiver_in_force",
          "vendor_document_without_terms_kind",
          "vendor_paper_cap",
          "vendor_paper_file_missing",
          "vendor_paper_file_stand_in",
          "vendor_agreement_term",
          "vendor_agreement_dates",
          "vendor_agreement_notice",
          "vendor_agreement_committed",
          "vendor_agreement_copy_not_theirs",
          "vendor_agreement_already_renewed",
          "vendor_agreement_not_your_decision",
          "vendor_agreement_closed",
          "vendor_paper_notice_no_recipient",
          "vendor_paper_notice_nothing_to_ask",
          "vendor_paper_notice_open_draft",
          "vendor_paper_notice_not_deciding_to_end",
          "vendor_paper_notice_needs_agreement",
          "vendor_paper_notice_names_no_agreement",
          "paper_requirements_count_moved",
          "paper_requirements_too_many",
          "paper_requirements_no_kind",
          "vendor_alias_key_taken",
          "vendor_alias_is_own_name",
          "vendor_alias_limit",
          "vendor_merged_not_restorable",
          "vendor_link_changed",
          "vendor_link_posted_needs_approver",
          "vendor_link_nothing",
          "vendor_merge_same_record",
          "vendor_merge_absorbed_archived",
          "vendor_merge_survivor_archived",
          "vendor_merge_absorbed_refused",
          "vendor_merge_survivor_refused",
          "vendor_merge_banking_open",
          "vendor_merge_banking_differs",
          "vendor_merge_hold_would_lift",
          "vendor_merge_in_draft_run",
          "vendor_merge_bills_in_review",
          "vendor_merge_open_credit",
          "vendor_merge_authority_scope",
          "vendor_merge_counterparty",
          "vendor_merge_slip_kind_differs",
          "vendor_merge_residency_differs",
          "vendor_merge_slip_consent_both_live",
          "vendor_merge_paper_over_cap",
          "vendor_merge_already_open",
          "vendor_merge_survivor_is_absorbed",
          "vendor_merge_same_hand",
          "vendor_merge_expired",
          "vendor_merge_decided",
          "vendor_merge_changed",
          "vendor_merge_withdraw_not_proposer",
          "vendor_merge_export_too_many",
          "vendor_merge_suggestion_dismissed",
          "vendor_merge_suggestion_reinstated",
          "bill_vendor_merged",
          "bill_link_vendor_in_review",
          "bill_link_vendor_void",
          "bill_link_vendor_posted_has_vendor",
          "supplier_match_decided",
          "bill_supplier_match_other_supplier",
          "slip_copies_file_not_kept",
          "slip_copies_print_too_many",
          "slip_copies_print_none",
          "slip_copy_document_not_stored",
          "slip_copy_export_too_many",
          "slip_copies_mailed_set_changed",
          "slip_copies_mailed_not_waiting",
          "slip_copies_mailed_future",
          "slip_consent_no_email",
          "slip_consent_already_live",
          "slip_consent_future",
          "slip_consent_not_given",
          "slip_copy_email_no_consent",
          "slip_copy_from_copies",
          "slip_copy_notice_by_hand",
          "slip_identity_ask_nothing_missing",
          "slip_identity_ask_recent",
          "bill_withholding_status",
          "bill_withholding_vendor_residency",
          "bill_withholding_withheld_on",
          "bill_withholding_changed",
          "bill_withholding_line_not_current",
          "bill_withholding_line_not_service",
          "bill_withholding_whole_bill_has_lines",
          "withholding_waiver_vendor",
          "withholding_waiver_document",
          "withholding_waiver_company",
          "withholding_waiver_already_recorded",
          "withholding_waiver_already_ended",
          "withholding_waiver_end_date",
          "purchases_withholding_account_not_liability",
          "vendor_slip_non_resident",
          "vendor_residency_has_nr_slip",
          "payment_withholding_moved",
          "payment_withholding_account_moved",
          "inbox_controls_sender_above_address",
          "inbox_arrival_held",
          "inbox_hold_not_held",
          "inbox_controls_export_too_many",
          "inbox_controls_firings_filters",
          "payment_run_marks_unconfirmed",
          "payment_run_marks_unknown",
          "payment_run_marks_not_recorded",
          "payment_run_brief_not_draft",
          "bill_dimension_value_unknown",
          "bill_proposed_tag_not_on_line",
          "bill_dimension_not_recorded",
          "bill_budget_changed",
          "bill_budget_not_open",
          "seat_company_outside",
          "seat_company_all_needed",
          "seat_company_person_not_covering",
          "seat_company_policy_wide",
          "seat_company_unclassified",
          "seat_company_report_needs_one",
          "seat_company_not_on_ledger",
          "seat_company_ledger_mismatch",
          "purchase_order_not_found",
          "purchase_order_not_draft",
          "purchase_order_empty_patch",
          "purchase_order_incomplete",
          "purchase_order_vendor_unusable",
          "purchase_order_asked_not_covered",
          "purchase_order_fx_no_rate",
          "purchase_order_fx_not_foreign",
          "purchase_order_dimension_misfiled",
          "purchase_order_awaiting_with_status",
          "purchase_order_changed",
          "purchase_order_not_in_approval",
          "purchase_order_no_authority",
          "purchase_order_outside_authority",
          "purchase_order_authority_expired",
          "purchase_order_over_approval_ceiling",
          "purchase_order_own_work_no_ceiling",
          "purchase_order_cannot_take_back",
          "purchase_order_take_back_seat",
          "purchase_order_notice_open",
          "purchase_order_not_sent",
          "purchase_order_cancel_seat",
          "purchase_order_cancelled",
          "purchase_order_not_approved_to_send",
          "purchase_order_already_sent",
          "purchase_order_no_recipient",
          "purchase_order_recipient_unknown",
          "purchase_order_not_cancelled",
          "purchase_order_series_next_lower",
          "purchase_order_export_too_many",
          "purchase_order_quote_document_not_quote",
          "purchase_order_suggestion_gone",
          "goods_receipt_not_found",
          "purchase_order_not_receivable",
          "goods_receipt_incomplete",
          "goods_receipt_over_receipt",
          "goods_receipt_future_date",
          "goods_receipt_before_order",
          "goods_receipt_receiver_is_approver",
          "goods_receipt_service_requester_only",
          "goods_receipt_on_behalf_seat",
          "goods_receipt_on_behalf_note",
          "goods_receipt_order_changed",
          "goods_receipt_not_proposed",
          "goods_receipt_not_confirmed",
          "goods_receipt_void_seat",
          "goods_receipt_billed",
          "goods_receipt_evidence_limit",
          "goods_receipt_evidence_kind",
          "goods_receipt_evidence_not_attached",
          "goods_receipt_attach_not_live",
          "goods_receipt_withdraw_seat",
          "purchase_order_cancel_after_receipt",
          "purchase_order_amend_after_receipt",
          "purchase_order_cannot_close",
          "purchase_order_close_seat",
          "purchase_order_not_closed",
          "bill_order_link_not_open",
          "bill_order_line_wrong_company",
          "bill_order_line_wrong_supplier",
          "bill_order_line_not_open",
          "bill_order_link_not_recorded",
          "bill_order_link_no_line",
          "bill_order_link_duplicate_line",
          "bill_order_proposal_cleared_line",
          "bill_order_proposal_no_supplier",
          "bill_match_changed",
          "purchases_policy_tolerance_over_authority",
          "vendor_order_exemption_reason_required",
          "accrual_account_missing",
          "accrual_account_not_liability",
          "accrual_account_is_payable",
          "accrual_period_locked",
          "accrual_earlier_standing",
          "accrual_nothing_to_accrue",
          "accrual_standing_differs",
          "accrual_rate_missing",
          "accrual_too_many_lines",
          "expected_bills_month_in_future",
          "expected_bills_export_too_many",
          "accrual_no_signals",
          "accrual_bill_arrived",
          "accrual_already_drafted",
          "accrual_not_predicted",
          "schedule_follow_not_posted",
          "schedule_follow_other_schedule",
          "schedule_follow_inactive",
          "signal_scope_not_offered",
          "bill_prepaid_changed",
          "bill_prepaid_choice_missing",
          "bill_prepaid_not_open",
          "bill_prepaid_released",
          "bill_prepaid_line_locked",
          "prepaid_release_waiting",
          "prepaid_nothing_to_end",
          "prepaid_period_closed",
          "prepaid_not_active",
          "prepaid_destination_refused",
          "prepaid_account_type",
          "bill_holdback_too_large",
          "bill_holdback_amount_invalid",
          "bill_holdback_foreign_currency",
          "bill_holdback_account_missing",
          "bill_holdback_account_not_liability",
          "bill_holdback_account_is_payable",
          "bill_holdback_release_not_posted",
          "bill_holdback_release_exceeds",
          "bill_holdback_release_none_left",
          "bill_holdback_release_before_bill",
          "bill_holdback_release_future",
          "bill_holdback_edit_released",
          "bill_holdback_void_released",
          "bill_holdback_none_note_short",
          "purchases_settings_account_shared",
          "cutover_exists",
          "cutover_date_future",
          "cutover_date_before_incorporation",
          "cutover_suspense_type",
          "cutover_suspense_inactive",
          "cutover_suspense_is_payable",
          "cutover_go_live_documents",
          "cutover_go_live_owned",
          "cutover_settled_frozen",
          "cutover_already_settled",
          "cutover_withdrawn",
          "cutover_withdraw_date_moved",
          "cutover_withdraw_opening_entry",
          "cutover_opening_entry_company",
          "cutover_opening_entry_date",
          "cutover_opening_entry_status",
          "cutover_checks_failing",
          "cutover_checks_changed",
          "cutover_acknowledgement_unknown",
          "cutover_export_too_many",
          "open_payables_cutover_closed",
          "open_payables_wrong_company",
          "open_payables_uploader_posts",
          "open_payables_attestation_missing",
          "open_payables_rows_not_ready",
          "open_payables_count_changed",
          "open_payables_difference_unexplained",
          "open_payables_authority",
          "open_payables_period_locked",
          "open_payables_reverse_closed",
          "open_payables_already_reversed",
          "open_payables_reverse_blocked",
          "open_payables_bill_not_editable",
          "open_payables_bill_void_closed",
          "open_payables_cutover_has_postings",
          "parallel_run_payables_month_not_ended",
          "parallel_run_payables_not_addable",
          "parallel_run_payables_not_compared",
          "parallel_run_proposal_decided",
          "parallel_run_proposal_stale",
          "parallel_run_total_not_classified",
          "parallel_run_proposal_not_found",
          "parallel_run_month_past_line_ceiling",
          "banking_batch_not_yours",
          "banking_batch_file_format",
          "banking_batch_too_many",
          "banking_batch_secret_fill",
          "banking_batch_paper_limit",
          "banking_batch_paper_duplicate",
          "banking_batch_paper_closed",
          "banking_batch_check_nothing",
          "banking_batch_check_running",
          "banking_batch_filter_kind",
          "banking_batch_expired",
          "banking_batch_still_reading",
          "banking_paper_name_empty",
          "banking_paper_taken_off",
          "bill_payable_account_not_recorded",
          "payment_run_release_totals_not_recorded",
          "record_import_apply_running",
          "record_import_too_many_to_approve",
          "record_import_revert_refused",
          "record_import_revert_asset_standing",
          "record_import_revert_customer_waiting",
          "record_import_kind_web_only",
          "payment_run_release_timed_out",
          "list_sort_unknown",
          "list_sort_needs_company",
          "list_sort_unavailable",
          "bill_amount_needs_company",
          "purchases_cursor_other_order",
          "list_view_limit",
          "list_view_shared_limit",
          "list_view_name_taken",
          "list_view_params_not_taken",
          "list_view_share_needs_seat",
          "bulk_act_empty",
          "bulk_act_too_many",
          "bulk_act_reason_needed",
          "bulk_act_filter_not_taken",
          "bulk_act_filter_changed",
          "bulk_act_changed",
          "bulk_act_over_cap",
          "bulk_act_nothing_eligible",
          "bulk_act_wrong_mode",
          "bulk_item_not_found",
          "bulk_item_status",
          "bill_bulk_stage_is_review",
          "bill_bulk_no_rate",
          "bill_bulk_month_closed",
          "bill_bulk_over_budget",
          "bill_bulk_match_exception",
          "bill_bulk_prepaid_offered",
          "bill_bulk_findings",
          "bill_bulk_signal_open",
          "bill_bulk_not_draft",
          "bill_bulk_not_held",
          "vendor_bulk_already_held",
          "vendor_bulk_not_held",
          "payment_run_bulk_not_draft",
          "purchase_order_bulk_not_draft",
          "inbox_bulk_already_decided",
          "purchases_export_kind_unknown",
          "purchases_export_query_invalid",
          "purchases_export_open_limit",
          "purchases_export_all_needs_audit",
          "purchases_export_not_ready",
          "purchases_export_failed",
          "purchases_export_expired",
          "purchases_export_not_yours",
          "purchases_export_seat_changed",
          "purchases_export_object_missing",
          "privacy_received_out_of_range",
          "privacy_identity_note_needed",
          "privacy_not_an_individual",
          "privacy_duplicate_open",
          "privacy_change_in_force",
          "privacy_change_in_draft_run",
          "privacy_change_not_paid",
          "privacy_digits_already_destroyed",
          "privacy_permission_needed",
          "privacy_permission_voided",
          "privacy_permission_other_supplier",
          "privacy_permission_duplicate",
          "privacy_permission_used",
          "privacy_own_request",
          "privacy_not_waiting",
          "privacy_not_open",
          "privacy_plan_moved",
          "privacy_not_yours",
          "privacy_answer_before_decision",
          "privacy_already_answered",
          "privacy_pack_not_for_this_kind",
          "privacy_pack_not_asked",
          "privacy_pack_not_ready",
          "privacy_pack_build_failed",
          "privacy_pack_build_cancelled",
          "privacy_pack_gone",
          "privacy_admin_only",
          "privacy_message_too_long",
          "privacy_no_decision_for_copy",
          "privacy_export_too_many",
          "privacy_permission_letter_wrong_kind",
          "vendor_merge_privacy_request_open",
          "vendor_merge_portal_submission_waiting",
          "vendor_merge_vendor_query_open",
          "vendor_merge_vendor_statement_open",
          "year_end_file_year_end_invalid",
          "year_end_file_building",
          "year_end_file_not_building",
          "year_end_file_not_ready",
          "year_end_file_already_signed",
          "year_end_file_store_unavailable",
          "year_end_file_audit_seat",
          "year_end_file_commentary_figure",
          "year_end_file_decisions_incomplete",
          "year_end_commentary_attempts",
          "year_end_file_export_too_many",
          "vendor_portal_off",
          "vendor_portal_link_revoked",
          "vendor_portal_no_live_link",
          "vendor_portal_issuer_deciding",
          "vendor_portal_already_decided",
          "vendor_portal_record_moved",
          "vendor_portal_submission_kind",
          "vendor_portal_evidence_mismatch",
          "vendor_portal_closed",
          "vendor_portal_facts_empty",
          "vendor_portal_facts_waiting",
          "vendor_portal_banking_waiting",
          "vendor_portal_digits_not_here",
          "vendor_portal_paper_kind",
          "vendor_portal_cap",
          "vendor_portal_daily_limit",
          "vendor_portal_no_company",
          "vendor_portal_file_too_large",
          "vendor_portal_file_empty",
          "vendor_portal_file_type",
          "vendor_portal_file_not_kept",
          "vendor_portal_not_withdrawable",
          "vendor_portal_link_mismatch",
          "vendor_query_closed",
          "vendor_query_moved_on",
          "vendor_query_already_resolved",
          "vendor_query_owner_no_seat",
          "vendor_query_assign_not_yours",
          "vendor_query_subject_other_supplier",
          "vendor_query_vendor_archived",
          "vendor_query_arrival_not_a_message",
          "vendor_query_arrival_already_opened",
          "vendor_query_arrival_supplier_needed",
          "vendor_query_fact_not_available",
          "vendor_query_answer_empty",
          "vendor_notice_invitation_needs_link",
          "vendor_notice_link_not_invitation",
          "vendor_portal_company_needed",
          "vendor_portal_owner_unavailable",
          "vendor_portal_query_closed",
          "vendor_query_arrival_text_unreadable",
          "vendor_query_policy_expires_past",
          "vendor_query_no_company_reachable",
          "vendor_query_message_other_supplier",
          "vendor_query_arrival_quoted_only",
          "vendor_query_internal_question_not_open",
          "vendor_statement_database_refused",
          "vendor_query_portal_duplicate",
          "vendor_query_portal_open_cap",
          "vendor_query_portal_message_cap",
          "vendor_query_policy_expiry",
          "vendor_query_policy_ended",
          "vendor_query_export_too_many",
          "vendor_query_set_aside_origin",
          "vendor_query_follow_up_open",
          "vendor_statement_not_found",
          "vendor_statement_exists",
          "vendor_statement_document_used",
          "vendor_statement_file_format",
          "vendor_statement_file_too_large",
          "vendor_statement_missing_date",
          "vendor_statement_too_many_lines",
          "vendor_statement_not_in_review",
          "vendor_statement_changed",
          "vendor_statement_books_moved",
          "vendor_statement_no_supplier",
          "vendor_statement_supplier_differs",
          "vendor_statement_unchecked_figures",
          "vendor_statement_missing_header",
          "vendor_statement_too_many_bills",
          "vendor_statement_link_invalid",
          "vendor_statement_decline_reason",
          "vendor_statement_read_in_progress",
          "vendor_statement_read_attempts_used",
          "vendor_statement_nothing_to_read",
          "vendor_statement_not_accepted",
          "vendor_statement_nothing_to_ask",
          "vendor_statement_discard_seat",
          "vendor_account_statement_not_tied",
          "vendor_account_statement_too_many_rows",
          "vendor_account_statement_too_many_to_draw",
          "bill_question_topic_open",
          "bill_question_bill_void",
          "bill_question_outcome_required",
          "bill_question_outcome_bill_only",
          "ai_ceiling_not_whole_cents",
          "ai_ceiling_too_high",
          "ai_ceiling_below_budget",
          "ai_budget_above_ledger",
          "ai_use_cursor_invalid",
          "ai_use_range_too_long",
          "ai_use_export_too_many",
          "bill_capital_bill_not_posted",
          "bill_capital_line_not_capital",
          "bill_capital_set_aside",
          "bill_capital_over_line",
          "bill_capital_entity_differs",
          "bill_capital_account_differs",
          "bill_capital_changed",
          "bill_capital_line_locked",
          "bill_capital_void_blocked",
          "bill_capital_read_off",
          "bill_capital_read_attempts_used",
          "bill_capital_read_not_open",
          "bill_capital_asset_already_linked",
          "bill_capital_asset_mismatch",
          "bill_capital_look_back_future",
          "signal_capital_set_aside_own_work",
          "signal_confirmed_by_registration",
          "purchases_line_profile_too_few_bills",
          "purchases_line_profile_field_not_agreed",
          "purchases_line_profile_pattern_moved",
          "purchases_line_profile_one_live",
          "purchases_line_profile_replaces_nothing",
          "purchases_line_profile_not_typed",
          "purchases_line_profile_account_not_active",
          "bill_plan_not_open",
          "bill_plan_date_past",
          "bill_plan_date_far",
          "bill_due_account_needs_company",
          "bill_due_account_invalid",
          "bulk_act_needs_date",
          "payment_plan_account_invalid",
          "payment_plan_vendor_unknown",
          "payment_plan_window_invalid",
          "payment_plan_nothing_to_plan",
          "payment_plan_expired",
          "payment_plan_already_decided",
          "payment_plan_changed",
          "payment_plan_line_unknown",
          "payment_plan_lines_open",
          "payment_plan_not_recorded",
          "payment_run_release_policy_author",
          "run_policy_account_taken",
          "run_policy_expiry_too_far",
          "run_policy_currency_differs",
          "run_policy_not_in_force",
          "run_policy_decline_needed",
          "run_policy_decline_suggestion",
          "run_policy_replace_invalid",
          "month_end_commentary_month_invalid",
          "month_end_commentary_draft_exists",
          "month_end_commentary_replaced",
          "month_end_commentary_race",
          "month_end_commentary_read_failed",
          "month_end_commentary_database_refused",
          "month_end_commentary_not_draft",
          "month_end_commentary_audit_seat",
          "month_end_commentary_sentence_figure",
          "month_end_commentary_decisions_incomplete",
          "month_end_commentary_nothing_kept",
          "month_end_commentary_attempts",
          "month_end_commentary_export_too_many",
          "imported_history_suppliers_unplaced",
          "imported_history_suppliers_not_offered",
          "migration_file_not_readable",
          "migration_file_wrong_kind",
          "migration_no_open_payables",
          "migration_too_many_files",
          "migration_reading_too_many",
          "migration_banking_needs_sensitive",
          "migration_month_signed",
          "migration_month_no_payables",
          "migration_month_company",
          "migration_month_before_conversion",
          "migration_assistant_not_for_lens",
          "migration_finding_decided",
          "migration_finding_not_proposal",
          "migration_finding_stale",
          "migration_class_not_allowed",
          "migration_change_needs",
          "migration_export_too_many",
          "webhook_signing_not_configured",
          "webhook_url_invalid",
          "webhook_url_not_https",
          "webhook_url_private",
          "webhook_url_has_query",
          "webhook_url_has_credentials",
          "webhook_url_port",
          "webhook_url_duplicate",
          "webhook_endpoint_limit",
          "webhook_event_unknown",
          "webhook_endpoint_not_active",
          "webhook_endpoint_removed",
          "webhook_secret_already_shown",
          "webhook_delivery_not_dead",
          "webhook_test_too_soon",
          "webhook_export_too_many",
          "card_receipt_export_too_many",
          "bill_also_record_needs_card",
          "bill_seen_total_changed",
          "bill_vendor_is_own_company",
          "vendor_counterparty_has_bills",
          "vendor_merge_counterparty_own_bills",
          "intercompany_other_company_not_in_seat",
          "intercompany_pair_decided",
          "intercompany_pair_not_open",
          "intercompany_candidate_taken",
          "intercompany_candidate_not_eligible",
          "intercompany_unlink_has_elimination",
          "intercompany_customer_needs_approval",
          "intercompany_customer_company_taken",
          "intercompany_mirror_line_not_billable",
          "intercompany_mirror_too_many_lines",
          "intercompany_account_not_revenue",
          "intercompany_figures_moved",
          "intercompany_decline_needs_reason",
          "intercompany_elimination_exists",
          "intercompany_elimination_already_void",
          "intercompany_by_hand_not_needed",
          "intercompany_by_hand_needs_note",
          "intercompany_elimination_groups_differ",
          "intercompany_reading_off",
          "intercompany_reading_limit",
          "intercompany_export_too_many",
          "intercompany_look_back_company_required",
          "inbox_domain_apex",
          "inbox_domain_platform",
          "inbox_domain_malformed",
          "inbox_domain_company_has_one",
          "inbox_domain_taken",
          "inbox_domain_unavailable",
          "inbox_domain_not_verified",
          "inbox_domain_local_part_reserved",
          "inbox_domain_address_taken",
          "inbox_domain_invoices_mailbox",
          "inbox_domain_company_mismatch",
          "inbox_domain_removed_final",
          "payment_rail_not_approved",
          "payment_rail_not_configured",
          "payment_rail_off",
          "payment_rail_no_connection",
          "payment_rail_connection_unavailable",
          "payment_rail_provider_unavailable",
          "payment_rail_funding_source_refused",
          "payment_rail_funding_source_in_use",
          "payment_rail_funding_source_not_bound",
          "payment_rail_already_set",
          "payment_rail_run_not_released",
          "payment_rail_method",
          "payment_rail_currency",
          "payment_rail_run_lodged",
          "payment_rail_already_dispatched",
          "payment_rail_run_reversed",
          "payment_rail_run_moved",
          "payment_rail_confirmation_needed",
          "payment_rail_run_changed",
          "payment_rail_nothing_to_send",
          "payment_rail_nothing_to_stop",
          "payment_rail_sending_now",
          "payment_rail_outcome_unknown",
          "payment_rail_payees_not_payable",
          "payment_rail_in_flight",
          "payment_run_lodgement_dispatched",
          "payment_return_file_invalid",
          "payment_return_file_duplicate",
          "payment_return_file_not_a_notice",
          "payment_return_run_not_released",
          "payment_return_run_not_eft",
          "payment_return_proposal_decided",
          "payment_run_outcome_with_open_returns",
          "vendor_query_arrival_changed",
          "vendor_statement_file_missing",
          "purchases_custom_field_values_bill_void",
          "purchases_custom_field_values_kind_unknown",
          "vendor_reopen_archived",
          "vendor_reopen_nothing_to_reopen",
          "vendor_reopen_decided_again",
          "vendor_restore_moved_on",
          "vendor_registration_check_replaced",
          "vendor_registration_stated_changed",
          "vendor_registration_earlier_check_unusable",
          "vendor_credit_moved_on",
          "payment_run_policy_pass_not_run",
          "payment_run_policy_pass_run_moved",
          "vendor_line_profile_not_proposal",
          "vendor_line_profile_not_dismissed",
          "vendor_line_profile_not_restorable",
          "vendor_line_profile_was_discarded_proposal",
          "inbox_suggestion_decline_moved_on",
          "bill_still_owed_moved_on",
          "bill_feed_decline_moved_on",
          "bill_submission_moved_on",
          "bill_prepaid_early_end_moved_on"
        ],
        "description": "The values listed in `x-extensible-enum` are the ones known today. New values can appear without a new release, so handle an unknown one as you would an unexpected state, not as a failure to parse."
      },
      "CommittedOption1": {
        "type": "object",
        "properties": {
          "amountMinor": {
            "type": "string",
            "pattern": "^-?\\d+$"
          },
          "currency": {
            "type": "string",
            "pattern": "^[A-Z]{3}$"
          }
        },
        "required": [
          "amountMinor",
          "currency"
        ],
        "additionalProperties": false
      },
      "Common": {
        "type": "object",
        "properties": {
          "language": {
            "type": "string",
            "enum": [
              "en",
              "fr"
            ]
          },
          "companyName": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200
          },
          "vendorName": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200
          },
          "recipientName": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 120
              },
              {
                "type": "null"
              }
            ]
          },
          "contact": {
            "type": "object",
            "properties": {
              "name": {
                "type": "string"
              },
              "telephone": {
                "type": "string"
              },
              "replyTo": {
                "type": "string",
                "format": "email",
                "pattern": "^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"
              },
              "source": {
                "type": "string",
                "enum": [
                  "SETTINGS",
                  "ADDRESS_WATCHER"
                ]
              }
            },
            "required": [
              "name",
              "telephone",
              "replyTo",
              "source"
            ],
            "additionalProperties": false
          }
        },
        "required": [
          "language",
          "companyName",
          "vendorName",
          "recipientName",
          "contact"
        ],
        "additionalProperties": false
      },
      "Contact": {
        "type": "object",
        "properties": {
          "state": {
            "type": "string",
            "enum": [
              "SEATED",
              "FELL_BACK",
              "NOBODY"
            ]
          },
          "name": {
            "type": [
              "string",
              "null"
            ]
          },
          "telephone": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "state",
          "name",
          "telephone"
        ],
        "additionalProperties": false
      },
      "ContactsItem": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 120
          },
          "email": {
            "type": "string",
            "maxLength": 200,
            "format": "email",
            "pattern": "^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"
          },
          "phone": {
            "type": "string",
            "maxLength": 50
          },
          "role": {
            "type": "string",
            "enum": [
              "BILLING",
              "ACCOUNT_MANAGER",
              "ESCALATION",
              "REMITTANCE"
            ]
          },
          "note": {
            "type": "string",
            "maxLength": 500
          }
        },
        "required": [
          "name",
          "role"
        ],
        "additionalProperties": false
      },
      "Conversion": {
        "type": "object",
        "properties": {
          "state": {
            "type": "string",
            "enum": [
              "SAME_CURRENCY",
              "CONVERTED",
              "UNTESTED"
            ]
          },
          "functionalCurrency": {
            "type": "string",
            "pattern": "^[A-Z]{3}$"
          },
          "functionalTotalMinor": {
            "anyOf": [
              {
                "type": "string",
                "pattern": "^-?\\d+$"
              },
              {
                "type": "null"
              }
            ]
          },
          "fxRate": {
            "anyOf": [
              {
                "type": "string",
                "pattern": "^\\d{1,6}\\.\\d{6}$"
              },
              {
                "type": "null"
              }
            ]
          },
          "fxRateDate": {
            "anyOf": [
              {
                "type": "string",
                "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
              },
              {
                "type": "null"
              }
            ]
          },
          "fxSource": {
            "anyOf": [
              {
                "type": "string",
                "enum": [
                  "BOC_DAILY",
                  "ENTITY_POLICY",
                  "TYPED",
                  "BACKFILLED_FROM_ENTRY"
                ]
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "state",
          "functionalCurrency",
          "functionalTotalMinor",
          "fxRate",
          "fxRateDate",
          "fxSource"
        ],
        "additionalProperties": false
      },
      "Counts4": {
        "type": "object",
        "properties": {
          "both": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "different": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "onlyTheirs": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "onlyOurs": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "total": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "uncheckedFigures": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "declines": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          }
        },
        "required": [
          "both",
          "different",
          "onlyTheirs",
          "onlyOurs",
          "total",
          "uncheckedFigures",
          "declines"
        ],
        "additionalProperties": false
      },
      "CreateHandoffResponse": {
        "type": "object",
        "properties": {
          "notice": {
            "$ref": "#/components/schemas/ListVendorNoticesResponseItem"
          }
        },
        "required": [
          "notice"
        ],
        "additionalProperties": false
      },
      "CreatePurchaseOrderResponse": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "number": {
            "type": [
              "string",
              "null"
            ]
          },
          "status": {
            "type": "string",
            "enum": [
              "DRAFT",
              "IN_APPROVAL",
              "APPROVED",
              "SENT",
              "PART_RECEIVED",
              "RECEIVED",
              "CLOSED",
              "CANCELLED"
            ]
          },
          "source": {
            "type": "string",
            "enum": [
              "MANUAL",
              "QUOTE_READ",
              "PATTERN",
              "IMPORT"
            ]
          },
          "revision": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "entity": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "name": {
                "type": "string"
              }
            },
            "required": [
              "id",
              "name"
            ],
            "additionalProperties": false
          },
          "entityTimeZone": {
            "type": "string"
          },
          "vendor": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string"
                  },
                  "displayName": {
                    "type": "string"
                  }
                },
                "required": [
                  "id",
                  "displayName"
                ],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ]
          },
          "supplierReference": {
            "type": [
              "string",
              "null"
            ]
          },
          "currency": {
            "type": "string",
            "pattern": "^[A-Z]{3}$"
          },
          "totalMinor": {
            "type": "string",
            "pattern": "^-?\\d+$"
          },
          "functionalTotalMinor": {
            "anyOf": [
              {
                "type": "string",
                "pattern": "^-?\\d+$"
              },
              {
                "type": "null"
              }
            ]
          },
          "lineCount": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "expectedBy": {
            "anyOf": [
              {
                "type": "string",
                "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
              },
              {
                "type": "null"
              }
            ]
          },
          "orderDate": {
            "anyOf": [
              {
                "type": "string",
                "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
              },
              {
                "type": "null"
              }
            ]
          },
          "createdAt": {
            "type": "string",
            "minLength": 20
          },
          "requestedBy": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "name": {
                "type": "string"
              }
            },
            "required": [
              "id",
              "name"
            ],
            "additionalProperties": false
          },
          "submittedAt": {
            "anyOf": [
              {
                "type": "string",
                "minLength": 20
              },
              {
                "type": "null"
              }
            ]
          },
          "sentAt": {
            "anyOf": [
              {
                "type": "string",
                "minLength": 20
              },
              {
                "type": "null"
              }
            ]
          },
          "declined": {
            "$ref": "#/components/schemas/Retired"
          },
          "customFields": {
            "$ref": "#/components/schemas/CustomFields2"
          },
          "deliveryNote": {
            "type": [
              "string",
              "null"
            ]
          },
          "memo": {
            "type": [
              "string",
              "null"
            ]
          },
          "lines": {
            "$ref": "#/components/schemas/Lines6"
          },
          "gaps": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "quote": {
            "$ref": "#/components/schemas/Quote"
          },
          "pattern": {
            "$ref": "#/components/schemas/Pattern"
          },
          "counts": {
            "type": "object",
            "properties": {
              "audit": {
                "type": "integer",
                "minimum": 0,
                "maximum": 9007199254740991
              }
            },
            "required": [
              "audit"
            ],
            "additionalProperties": false
          },
          "closed": {
            "$ref": "#/components/schemas/Closed"
          },
          "noticeOwed": {
            "type": "boolean"
          }
        },
        "required": [
          "id",
          "number",
          "status",
          "source",
          "revision",
          "entity",
          "entityTimeZone",
          "vendor",
          "supplierReference",
          "currency",
          "totalMinor",
          "functionalTotalMinor",
          "lineCount",
          "expectedBy",
          "orderDate",
          "createdAt",
          "requestedBy",
          "submittedAt",
          "sentAt",
          "declined",
          "deliveryNote",
          "memo",
          "lines",
          "gaps",
          "quote",
          "pattern",
          "counts",
          "closed",
          "noticeOwed"
        ],
        "additionalProperties": false
      },
      "CreateVendorCreditResponse": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "vendorId": {
            "type": [
              "string",
              "null"
            ]
          },
          "status": {
            "type": "string",
            "enum": [
              "DRAFT",
              "IN_REVIEW",
              "APPROVED",
              "APPLIED",
              "VOID"
            ]
          },
          "remainingMinor": {
            "type": "string",
            "pattern": "^-?\\d+$"
          },
          "entryId": {
            "type": [
              "string",
              "null"
            ]
          },
          "entryNumber": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991
              },
              {
                "type": "null"
              }
            ]
          },
          "moved": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "billId": {
                  "type": "string"
                },
                "from": {
                  "type": "string",
                  "enum": [
                    "APPROVED",
                    "PARTIALLY_PAID",
                    "PAID"
                  ]
                },
                "to": {
                  "type": "string",
                  "enum": [
                    "APPROVED",
                    "PARTIALLY_PAID",
                    "PAID"
                  ]
                }
              },
              "required": [
                "billId",
                "from",
                "to"
              ],
              "additionalProperties": false
            }
          }
        },
        "required": [
          "id",
          "vendorId",
          "status",
          "remainingMinor",
          "entryId",
          "entryNumber",
          "moved"
        ],
        "additionalProperties": false
      },
      "CreateVendorResponse": {
        "type": "object",
        "properties": {
          "vendor": {
            "$ref": "#/components/schemas/ListVendorsResponseItem"
          }
        },
        "required": [
          "vendor"
        ],
        "additionalProperties": false
      },
      "CreateVendorStatementResponse": {
        "type": "object",
        "properties": {
          "statement": {
            "$ref": "#/components/schemas/Statement2"
          },
          "rows": {
            "$ref": "#/components/schemas/Rows2"
          }
        },
        "required": [
          "statement"
        ],
        "additionalProperties": false
      },
      "CustomFields2": {
        "description": "The record's own fields, by the field's key, archived fields' values included.",
        "type": "object",
        "propertyNames": {
          "type": "string"
        },
        "additionalProperties": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "boolean"
            },
            {
              "type": "array",
              "items": {
                "type": "string"
              }
            }
          ]
        },
        "x-stability-level": "beta"
      },
      "CustomFields3": {
        "description": "The record's own fields: a value for each custom field this ledger defines for the record's kind, by the field's key. Text, a number or a date as text, true or false, or a list of choices.",
        "type": "object",
        "propertyNames": {
          "type": "string",
          "pattern": "^[a-z][a-z0-9_]{0,39}$"
        },
        "additionalProperties": {
          "anyOf": [
            {
              "type": "string",
              "maxLength": 500
            },
            {
              "type": "boolean"
            },
            {
              "minItems": 1,
              "maxItems": 20,
              "type": "array",
              "items": {
                "type": "string",
                "maxLength": 80
              }
            }
          ]
        },
        "x-stability-level": "beta"
      },
      "CustomFields4": {
        "description": "Send only the fields you are changing. A field with a value is set to it, a field with null is cleared, and a field left out keeps the value it holds, so two people saving different fields of one record at once both keep their change. A clear on an archived field that holds a value is refused.",
        "type": "object",
        "propertyNames": {
          "type": "string",
          "pattern": "^[a-z][a-z0-9_]{0,39}$"
        },
        "additionalProperties": {
          "anyOf": [
            {
              "anyOf": [
                {
                  "type": "string",
                  "maxLength": 500
                },
                {
                  "type": "boolean"
                },
                {
                  "minItems": 1,
                  "maxItems": 20,
                  "type": "array",
                  "items": {
                    "type": "string",
                    "maxLength": 80
                  }
                }
              ]
            },
            {
              "type": "null"
            }
          ]
        },
        "x-stability-level": "beta"
      },
      "CustomFields5": {
        "description": "The line's own fields: a value for each line field this ledger defines for the line's kind, by the field's key. Text or true or false.",
        "type": "object",
        "propertyNames": {
          "type": "string",
          "pattern": "^[a-z][a-z0-9_]{0,39}$"
        },
        "additionalProperties": {
          "anyOf": [
            {
              "type": "string",
              "maxLength": 500
            },
            {
              "type": "boolean"
            }
          ]
        },
        "x-stability-level": "beta"
      },
      "CustomFields6": {
        "type": "object",
        "propertyNames": {
          "type": "string",
          "pattern": "^[a-z][a-z0-9_]{0,39}$"
        },
        "additionalProperties": {
          "anyOf": [
            {
              "anyOf": [
                {
                  "type": "string",
                  "maxLength": 500
                },
                {
                  "type": "boolean"
                },
                {
                  "minItems": 1,
                  "maxItems": 20,
                  "type": "array",
                  "items": {
                    "type": "string",
                    "maxLength": 80
                  }
                }
              ]
            },
            {
              "type": "null"
            }
          ]
        },
        "description": "Send only the fields you are changing. A field with a value is set to it, a field with null is cleared, and a field left out keeps the value it holds, so two people saving different fields of one record at once both keep their change. A clear on an archived field that holds a value is refused."
      },
      "Data2": {
        "type": "object",
        "properties": {
          "object": {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "const": "vendor"
              },
              "id": {
                "type": "string",
                "minLength": 1
              }
            },
            "required": [
              "type",
              "id"
            ],
            "additionalProperties": false
          },
          "href": {
            "type": "string",
            "format": "starts_with",
            "pattern": "^\\/v1\\/.*"
          }
        },
        "required": [
          "object",
          "href"
        ],
        "additionalProperties": false
      },
      "Data3": {
        "type": "object",
        "properties": {
          "object": {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "const": "bill"
              },
              "id": {
                "type": "string",
                "minLength": 1
              }
            },
            "required": [
              "type",
              "id"
            ],
            "additionalProperties": false
          },
          "href": {
            "type": "string",
            "format": "starts_with",
            "pattern": "^\\/v1\\/.*"
          }
        },
        "required": [
          "object",
          "href"
        ],
        "additionalProperties": false
      },
      "Data5": {
        "type": "object",
        "properties": {
          "object": {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "const": "purchaseOrder"
              },
              "id": {
                "type": "string",
                "minLength": 1
              }
            },
            "required": [
              "type",
              "id"
            ],
            "additionalProperties": false
          },
          "href": {
            "type": "string",
            "format": "starts_with",
            "pattern": "^\\/v1\\/.*"
          }
        },
        "required": [
          "object",
          "href"
        ],
        "additionalProperties": false
      },
      "Data6": {
        "type": "object",
        "properties": {
          "object": {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "const": "vendorCredit"
              },
              "id": {
                "type": "string",
                "minLength": 1
              }
            },
            "required": [
              "type",
              "id"
            ],
            "additionalProperties": false
          },
          "href": {
            "type": "string",
            "format": "starts_with",
            "pattern": "^\\/v1\\/.*"
          }
        },
        "required": [
          "object",
          "href"
        ],
        "additionalProperties": false
      },
      "Decision": {
        "anyOf": [
          {
            "type": "object",
            "properties": {
              "state": {
                "type": "string",
                "enum": [
                  "DISMISSED",
                  "CONFIRMED"
                ]
              },
              "by": {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string"
                  },
                  "name": {
                    "type": "string"
                  }
                },
                "required": [
                  "id",
                  "name"
                ],
                "additionalProperties": false
              },
              "at": {
                "type": "string",
                "minLength": 20
              },
              "note": {
                "type": [
                  "string",
                  "null"
                ]
              }
            },
            "required": [
              "state",
              "by",
              "at",
              "note"
            ],
            "additionalProperties": false
          },
          {
            "type": "null"
          }
        ]
      },
      "Decision2": {
        "anyOf": [
          {
            "type": "object",
            "properties": {
              "by": {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string"
                  },
                  "name": {
                    "type": "string"
                  }
                },
                "required": [
                  "id",
                  "name"
                ],
                "additionalProperties": false
              },
              "at": {
                "type": "string",
                "minLength": 20
              },
              "note": {
                "type": [
                  "string",
                  "null"
                ]
              }
            },
            "required": [
              "by",
              "at",
              "note"
            ],
            "additionalProperties": false
          },
          {
            "type": "null"
          }
        ]
      },
      "DecisionFacts": {
        "anyOf": [
          {
            "oneOf": [
              {
                "type": "object",
                "properties": {
                  "kind": {
                    "type": "string",
                    "const": "BILL_APPROVED"
                  },
                  "common": {
                    "$ref": "#/components/schemas/Common"
                  },
                  "invoice": {
                    "$ref": "#/components/schemas/Invoice"
                  },
                  "replaces": {
                    "anyOf": [
                      {
                        "$ref": "#/components/schemas/Invoice"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                },
                "required": [
                  "kind",
                  "common",
                  "invoice",
                  "replaces"
                ],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "kind": {
                    "type": "string",
                    "const": "BILL_HELD"
                  },
                  "common": {
                    "$ref": "#/components/schemas/Common"
                  },
                  "invoice": {
                    "$ref": "#/components/schemas/Invoice"
                  },
                  "need": {
                    "$ref": "#/components/schemas/Need"
                  },
                  "hold": {
                    "type": "object",
                    "properties": {
                      "heldAt": {
                        "type": "string",
                        "minLength": 20
                      },
                      "heldUntil": {
                        "anyOf": [
                          {
                            "type": "string",
                            "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "byPolicy": {
                        "type": "boolean"
                      }
                    },
                    "required": [
                      "heldAt",
                      "heldUntil",
                      "byPolicy"
                    ],
                    "additionalProperties": false
                  }
                },
                "required": [
                  "kind",
                  "common",
                  "invoice",
                  "need",
                  "hold"
                ],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "kind": {
                    "type": "string",
                    "const": "BILL_DECLINED"
                  },
                  "common": {
                    "$ref": "#/components/schemas/Common"
                  },
                  "invoice": {
                    "$ref": "#/components/schemas/Invoice"
                  },
                  "why": {
                    "$ref": "#/components/schemas/Need"
                  },
                  "how": {
                    "type": "string",
                    "enum": [
                      "VOIDED",
                      "DISCARDED"
                    ]
                  },
                  "sendTo": {
                    "type": [
                      "string",
                      "null"
                    ]
                  }
                },
                "required": [
                  "kind",
                  "common",
                  "invoice",
                  "why",
                  "how",
                  "sendTo"
                ],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "kind": {
                    "type": "string",
                    "const": "CORRECTION_ASKED"
                  },
                  "common": {
                    "$ref": "#/components/schemas/Common"
                  },
                  "invoice": {
                    "$ref": "#/components/schemas/Invoice"
                  },
                  "items": {
                    "maxItems": 12,
                    "type": "array",
                    "items": {
                      "type": "string",
                      "enum": [
                        "DOCUMENT",
                        "SUPPLIER_NAME",
                        "DATE",
                        "TOTAL",
                        "REGISTRATION",
                        "TAX_SHOWN",
                        "RECIPIENT",
                        "TERMS",
                        "DESCRIPTIONS",
                        "TAX_DIFFERS",
                        "DOES_NOT_ADD_UP"
                      ]
                    }
                  },
                  "paragraph": {
                    "$ref": "#/components/schemas/Paragraph"
                  },
                  "sendTo": {
                    "type": [
                      "string",
                      "null"
                    ]
                  }
                },
                "required": [
                  "kind",
                  "common",
                  "invoice",
                  "items",
                  "paragraph",
                  "sendTo"
                ],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "kind": {
                    "type": "string",
                    "const": "ADDRESS_CLOSING"
                  },
                  "common": {
                    "$ref": "#/components/schemas/Common"
                  },
                  "closing": {
                    "type": "object",
                    "properties": {
                      "address": {
                        "type": "string"
                      },
                      "closesOn": {
                        "type": "string",
                        "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                      },
                      "setAt": {
                        "type": "string",
                        "minLength": 20
                      },
                      "successor": {
                        "type": [
                          "string",
                          "null"
                        ]
                      }
                    },
                    "required": [
                      "address",
                      "closesOn",
                      "setAt",
                      "successor"
                    ],
                    "additionalProperties": false
                  }
                },
                "required": [
                  "kind",
                  "common",
                  "closing"
                ],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "kind": {
                    "type": "string",
                    "const": "BANKING_CHANGED"
                  },
                  "common": {
                    "$ref": "#/components/schemas/Common"
                  },
                  "banking": {
                    "type": "object",
                    "properties": {
                      "changeId": {
                        "type": "string"
                      },
                      "changedOn": {
                        "type": "string",
                        "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                      },
                      "recipientWasOnFileBefore": {
                        "type": "boolean",
                        "const": true
                      }
                    },
                    "required": [
                      "changeId",
                      "changedOn",
                      "recipientWasOnFileBefore"
                    ],
                    "additionalProperties": false
                  }
                },
                "required": [
                  "kind",
                  "common",
                  "banking"
                ],
                "additionalProperties": false
              }
            ]
          },
          {
            "type": "null"
          }
        ]
      },
      "DeclinePurchaseOrderSuggestionResponse": {
        "type": "object",
        "properties": {
          "ok": {
            "type": "boolean",
            "const": true
          },
          "hiddenUntil": {
            "type": "string",
            "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
          }
        },
        "required": [
          "ok",
          "hiddenUntil"
        ],
        "additionalProperties": false
      },
      "Deductions": {
        "type": "array",
        "items": {
          "type": "object",
          "properties": {
            "kind": {
              "type": "string",
              "enum": [
                "CREDIT",
                "DISCOUNT",
                "WITHHOLDING"
              ]
            },
            "amountMinor": {
              "type": "string",
              "pattern": "^-?\\d+$"
            },
            "reason": {
              "type": "string"
            },
            "account": {
              "$ref": "#/components/schemas/Account"
            },
            "vendorCredit": {
              "anyOf": [
                {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "number": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "id",
                    "number"
                  ],
                  "additionalProperties": false
                },
                {
                  "type": "null"
                }
              ]
            }
          },
          "required": [
            "kind",
            "amountMinor",
            "reason",
            "account",
            "vendorCredit"
          ],
          "additionalProperties": false
        }
      },
      "Delivery": {
        "oneOf": [
          {
            "type": "object",
            "properties": {
              "via": {
                "type": "string",
                "const": "PORTAL"
              }
            },
            "required": [
              "via"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "via": {
                "type": "string",
                "const": "EMAIL"
              },
              "recipientEmail": {
                "type": "string",
                "maxLength": 320,
                "format": "email",
                "pattern": "^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"
              }
            },
            "required": [
              "via",
              "recipientEmail"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "via": {
                "type": "string",
                "const": "BY_HAND"
              },
              "text": {
                "type": "string",
                "minLength": 4,
                "maxLength": 4000
              }
            },
            "required": [
              "via",
              "text"
            ],
            "additionalProperties": false
          }
        ]
      },
      "Desk": {
        "oneOf": [
          {
            "$ref": "#/components/schemas/DeskOption1"
          },
          {
            "type": "object",
            "properties": {
              "kind": {
                "type": "string",
                "const": "ROLE"
              },
              "role": {
                "type": "string",
                "enum": [
                  "ADMIN",
                  "APPROVER"
                ]
              }
            },
            "required": [
              "kind",
              "role"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "kind": {
                "type": "string",
                "const": "AUTHORITY"
              }
            },
            "required": [
              "kind"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "kind": {
                "type": "string",
                "const": "GROUP"
              },
              "rule": {
                "type": "string",
                "enum": [
                  "ANY",
                  "ALL"
                ]
              },
              "members": {
                "minItems": 2,
                "maxItems": 10,
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "name": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "id",
                    "name"
                  ],
                  "additionalProperties": false
                }
              }
            },
            "required": [
              "kind",
              "rule",
              "members"
            ],
            "additionalProperties": false
          }
        ]
      },
      "Desk2": {
        "anyOf": [
          {
            "type": "object",
            "properties": {
              "stageId": {
                "type": "string"
              },
              "position": {
                "type": "integer",
                "minimum": 1,
                "maximum": 6
              },
              "stageCount": {
                "type": "integer",
                "minimum": 1,
                "maximum": 6
              },
              "kind": {
                "type": "string",
                "enum": [
                  "REVIEW",
                  "SIGN"
                ]
              },
              "desk": {
                "$ref": "#/components/schemas/Desk"
              },
              "routedAt": {
                "type": "string",
                "minLength": 20
              },
              "forSomeoneElse": {
                "anyOf": [
                  {
                    "type": "object",
                    "properties": {
                      "id": {
                        "type": "string"
                      },
                      "name": {
                        "type": "string"
                      }
                    },
                    "required": [
                      "id",
                      "name"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "null"
                  }
                ]
              }
            },
            "required": [
              "stageId",
              "position",
              "stageCount",
              "kind",
              "desk",
              "routedAt",
              "forSomeoneElse"
            ],
            "additionalProperties": false
          },
          {
            "type": "null"
          }
        ]
      },
      "DeskOption1": {
        "type": "object",
        "properties": {
          "kind": {
            "type": "string",
            "const": "PERSON"
          },
          "person": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "name": {
                "type": "string"
              }
            },
            "required": [
              "id",
              "name"
            ],
            "additionalProperties": false
          }
        },
        "required": [
          "kind",
          "person"
        ],
        "additionalProperties": false
      },
      "Differences": {
        "type": "array",
        "items": {
          "$ref": "#/components/schemas/DifferencesItem"
        }
      },
      "DifferencesItem": {
        "type": "object",
        "properties": {
          "field": {
            "type": "string",
            "enum": [
              "TOTAL",
              "BILL_DATE",
              "CURRENCY"
            ]
          },
          "was": {
            "type": "string"
          },
          "now": {
            "type": "string"
          }
        },
        "required": [
          "field",
          "was",
          "now"
        ],
        "additionalProperties": false
      },
      "Dimensions": {
        "type": "array",
        "items": {
          "type": "object",
          "properties": {
            "typeId": {
              "type": "string"
            },
            "typeLabel": {
              "type": "string"
            },
            "valueId": {
              "type": "string"
            },
            "valueCode": {
              "type": "string"
            },
            "valueName": {
              "type": "string"
            }
          },
          "required": [
            "typeId",
            "typeLabel",
            "valueId",
            "valueCode",
            "valueName"
          ],
          "additionalProperties": false
        }
      },
      "Dimensions2": {
        "maxItems": 20,
        "type": "array",
        "items": {
          "$ref": "#/components/schemas/DimensionsItem"
        }
      },
      "Dimensions3": {
        "type": "array",
        "items": {
          "$ref": "#/components/schemas/DimensionsItem"
        }
      },
      "DimensionsItem": {
        "type": "object",
        "properties": {
          "dimensionTypeId": {
            "type": "string",
            "minLength": 1
          },
          "dimensionValueId": {
            "type": "string",
            "minLength": 1
          }
        },
        "required": [
          "dimensionTypeId",
          "dimensionValueId"
        ],
        "additionalProperties": false
      },
      "Document": {
        "anyOf": [
          {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "fileName": {
                "type": "string"
              },
              "mimeType": {
                "type": "string"
              },
              "sizeBytes": {
                "type": "integer",
                "minimum": 0,
                "maximum": 9007199254740991
              }
            },
            "required": [
              "id",
              "fileName",
              "mimeType",
              "sizeBytes"
            ],
            "additionalProperties": false
          },
          {
            "type": "null"
          }
        ]
      },
      "DraftBankingNoticeResponse": {
        "type": "object",
        "properties": {
          "notice": {
            "$ref": "#/components/schemas/GetVendorNoticeResponse"
          }
        },
        "required": [
          "notice"
        ],
        "additionalProperties": false
      },
      "DraftVendorDuplicateBriefResponse": {
        "type": "object",
        "properties": {
          "read": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "notes": {
                    "maxItems": 8,
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "vendorId": {
                          "type": "string"
                        },
                        "why": {
                          "type": "string",
                          "maxLength": 500
                        }
                      },
                      "required": [
                        "vendorId",
                        "why"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "promptVersion": {
                    "type": "string"
                  }
                },
                "required": [
                  "notes",
                  "promptVersion"
                ],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ]
          },
          "why": {
            "type": "string",
            "enum": [
              "DISCLOSURE",
              "BUDGET",
              "PROVIDER",
              "UNPARSABLE",
              "REFUSED",
              "FIGURE_INVENTED",
              "UNKNOWN_REF",
              "STOPPED_AFTER_THREE_DISMISSALS"
            ]
          }
        },
        "required": [
          "read"
        ],
        "additionalProperties": false
      },
      "DraftVendorHoldReasonResponse": {
        "type": "object",
        "properties": {
          "drafted": {
            "type": [
              "string",
              "null"
            ]
          },
          "why": {
            "type": "string",
            "enum": [
              "DISCLOSURE",
              "BUDGET",
              "PROVIDER",
              "UNPARSABLE",
              "REFUSED",
              "FIGURE_INVENTED",
              "STOPPED_AFTER_THREE_REWRITES"
            ]
          }
        },
        "required": [
          "drafted"
        ],
        "additionalProperties": false
      },
      "Email": {
        "anyOf": [
          {
            "type": "string",
            "maxLength": 200,
            "format": "email",
            "pattern": "^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"
          },
          {
            "type": "null"
          }
        ]
      },
      "Email2": {
        "oneOf": [
          {
            "type": "object",
            "properties": {
              "ready": {
                "type": "boolean",
                "const": true
              },
              "to": {
                "type": "string"
              },
              "consentGivenOn": {
                "type": "string",
                "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
              },
              "basis": {
                "type": "string",
                "enum": [
                  "WRITTEN",
                  "ELECTRONIC"
                ]
              }
            },
            "required": [
              "ready",
              "to",
              "consentGivenOn",
              "basis"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "ready": {
                "type": "boolean",
                "const": false
              },
              "why": {
                "type": "string",
                "enum": [
                  "NO_CONTACT_EMAIL",
                  "NO_CONSENT",
                  "CONSENT_WITHDRAWN",
                  "ADDRESS_CHANGED",
                  "NO_SUPPLIER_CONTACT",
                  "OUTBOUND_NOT_APPROVED",
                  "ALREADY_DELIVERED"
                ]
              },
              "sentence": {
                "type": "string"
              }
            },
            "required": [
              "ready",
              "why",
              "sentence"
            ],
            "additionalProperties": false
          }
        ]
      },
      "Entry": {
        "anyOf": [
          {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "number": {
                "anyOf": [
                  {
                    "type": "integer",
                    "minimum": -9007199254740991,
                    "maximum": 9007199254740991
                  },
                  {
                    "type": "null"
                  }
                ]
              }
            },
            "required": [
              "id",
              "number"
            ],
            "additionalProperties": false
          },
          {
            "type": "null"
          }
        ]
      },
      "Entry2": {
        "anyOf": [
          {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "entryNumber": {
                "anyOf": [
                  {
                    "type": "integer",
                    "minimum": -9007199254740991,
                    "maximum": 9007199254740991
                  },
                  {
                    "type": "null"
                  }
                ]
              }
            },
            "required": [
              "id",
              "entryNumber"
            ],
            "additionalProperties": false
          },
          {
            "type": "null"
          }
        ]
      },
      "Facts": {
        "type": "array",
        "items": {
          "type": "string",
          "enum": [
            "AMOUNT_ABOVE_RECENT",
            "FIRST_FROM_SUPPLIER",
            "SUPPLIER_NOT_ON_LIST",
            "SENDER_OR_BANKING_CHECK_OPEN",
            "ACCOUNT_NEW_FOR_SUPPLIER",
            "TAX_DIFFERS_FROM_PAPER",
            "LOOKS_LIKE_A_DUPLICATE"
          ]
        }
      },
      "FeedCandidate": {
        "anyOf": [
          {
            "type": "object",
            "properties": {
              "sourceTransactionId": {
                "type": "string"
              },
              "account": {
                "$ref": "#/components/schemas/Account2"
              },
              "txnDate": {
                "type": "string",
                "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
              },
              "description": {
                "type": "string"
              },
              "amountMinor": {
                "type": "string",
                "pattern": "^-?\\d+$"
              },
              "currency": {
                "type": "string",
                "pattern": "^[A-Z]{3}$"
              },
              "scoreBp": {
                "type": "integer",
                "minimum": 0,
                "maximum": 10000
              },
              "linesMatching": {
                "type": "integer",
                "minimum": 1,
                "maximum": 9007199254740991
              },
              "billsMatching": {
                "type": "integer",
                "minimum": 1,
                "maximum": 9007199254740991
              }
            },
            "required": [
              "sourceTransactionId",
              "account",
              "txnDate",
              "description",
              "amountMinor",
              "currency",
              "scoreBp",
              "linesMatching",
              "billsMatching"
            ],
            "additionalProperties": false
          },
          {
            "type": "null"
          }
        ]
      },
      "FiguresItem": {
        "type": "object",
        "properties": {
          "label": {
            "type": "string",
            "minLength": 1,
            "maxLength": 80
          },
          "minor": {
            "type": "string",
            "pattern": "^-?\\d+$"
          },
          "currency": {
            "type": "string",
            "minLength": 3,
            "maxLength": 3
          }
        },
        "required": [
          "label",
          "minor",
          "currency"
        ],
        "additionalProperties": false
      },
      "FiledUnder": {
        "anyOf": [
          {
            "type": "object",
            "properties": {
              "policyId": {
                "type": "string"
              },
              "authorName": {
                "type": "string"
              },
              "startedAt": {
                "type": "string",
                "minLength": 20
              },
              "expiresAt": {
                "type": "string",
                "minLength": 20
              },
              "dailyCap": {
                "type": "integer",
                "minimum": 1,
                "maximum": 9007199254740991
              }
            },
            "required": [
              "policyId",
              "authorName",
              "startedAt",
              "expiresAt",
              "dailyCap"
            ],
            "additionalProperties": false
          },
          {
            "type": "null"
          }
        ]
      },
      "FillStatsOption1": {
        "type": "object",
        "properties": {
          "filledFields": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "bills": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "kept": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "changed": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "declined": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "lastFiredAt": {
            "anyOf": [
              {
                "type": "string",
                "minLength": 20
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "filledFields",
          "bills",
          "kept",
          "changed",
          "declined",
          "lastFiredAt"
        ],
        "additionalProperties": false
      },
      "FilteredTotalsOption1": {
        "type": "object",
        "properties": {
          "current": {
            "type": "string",
            "pattern": "^-?\\d+$"
          },
          "d1to30": {
            "type": "string",
            "pattern": "^-?\\d+$"
          },
          "d31to60": {
            "type": "string",
            "pattern": "^-?\\d+$"
          },
          "d61to90": {
            "type": "string",
            "pattern": "^-?\\d+$"
          },
          "over90": {
            "type": "string",
            "pattern": "^-?\\d+$"
          },
          "held": {
            "type": "string",
            "pattern": "^-?\\d+$"
          },
          "total": {
            "type": "string",
            "pattern": "^-?\\d+$"
          }
        },
        "required": [
          "current",
          "d1to30",
          "d31to60",
          "d61to90",
          "over90",
          "held",
          "total"
        ],
        "additionalProperties": false
      },
      "Findings": {
        "type": "array",
        "items": {
          "oneOf": [
            {
              "type": "object",
              "properties": {
                "kind": {
                  "type": "string",
                  "const": "SLIPPED"
                },
                "daysAgo": {
                  "type": "integer",
                  "minimum": 1,
                  "maximum": 9007199254740991
                }
              },
              "required": [
                "kind",
                "daysAgo"
              ],
              "additionalProperties": false
            },
            {
              "type": "object",
              "properties": {
                "kind": {
                  "type": "string",
                  "const": "AFTER_DISCOUNT"
                },
                "discountOn": {
                  "type": "string",
                  "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                },
                "lostMinor": {
                  "type": "string",
                  "pattern": "^-?\\d+$"
                }
              },
              "required": [
                "kind",
                "discountOn",
                "lostMinor"
              ],
              "additionalProperties": false
            },
            {
              "type": "object",
              "properties": {
                "kind": {
                  "type": "string",
                  "const": "AFTER_DUE"
                },
                "days": {
                  "type": "integer",
                  "minimum": 1,
                  "maximum": 9007199254740991
                },
                "interestPerDayMinor": {
                  "anyOf": [
                    {
                      "type": "string",
                      "pattern": "^-?\\d+$"
                    },
                    {
                      "type": "null"
                    }
                  ]
                }
              },
              "required": [
                "kind",
                "days",
                "interestPerDayMinor"
              ],
              "additionalProperties": false
            }
          ]
        }
      },
      "Findings2": {
        "type": "array",
        "items": {
          "type": "object",
          "properties": {
            "severity": {
              "type": "string",
              "enum": [
                "BLOCKING",
                "WARNING",
                "NOTE"
              ]
            },
            "code": {
              "type": "string"
            },
            "message": {
              "type": "string"
            },
            "line": {
              "anyOf": [
                {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 9007199254740991
                },
                {
                  "type": "null"
                }
              ]
            }
          },
          "required": [
            "severity",
            "code",
            "message",
            "line"
          ],
          "additionalProperties": false
        }
      },
      "FindingsItem": {
        "type": "object",
        "properties": {
          "kind": {
            "type": "string",
            "enum": [
              "CROSS_FOOT",
              "TAX_NOT_AS_PRINTED",
              "PAYABLE_NOT_TOTAL",
              "VENDOR_DEFAULT_APPLIED",
              "VENDOR_DEFAULT_UNUSABLE",
              "CODING_RULE_UNUSABLE",
              "ACCOUNT_SHORTLIST_TRUNCATED",
              "DOCUMENT_TRUNCATED",
              "VENDOR_FROM_ADDRESS",
              "ADDRESS_VENDOR_DIFFERS",
              "DOCUMENTARY_TIER",
              "DOCUMENTARY_UNTESTED",
              "REGISTRATION_MISSING",
              "NO_SOURCE_DOCUMENT",
              "CLAIM_WINDOW",
              "REGISTRATION_UNCONFIRMED",
              "CURRENCY_NOT_VENDORS",
              "WITHHOLDING_RESIDENCY_UNSTATED",
              "OVER_BUDGET",
              "PO_REQUIRED",
              "PO_LINE_NOT_ON_ORDER",
              "PO_PRICE_VARIANCE",
              "PO_QUANTITY_VARIANCE",
              "PO_OVER_BILLED",
              "PO_NOT_RECEIVED",
              "PO_NOT_COMPARED",
              "HOLDBACK_UNSTATED",
              "LINE_PROFILE_APPLIED",
              "LINE_PROFILE_NOT_APPLIED",
              "PAID_BY_CARD_STATED"
            ]
          },
          "text": {
            "type": "string",
            "minLength": 1
          },
          "blocking": {
            "type": "boolean"
          },
          "figures": {
            "default": [],
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/FiguresItem"
            }
          }
        },
        "required": [
          "kind",
          "text",
          "blocking",
          "figures"
        ],
        "additionalProperties": false
      },
      "Follows": {
        "anyOf": [
          {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "reference": {
                "type": "string"
              },
              "status": {
                "type": "string",
                "enum": [
                  "OPEN",
                  "RESOLVED",
                  "SET_ASIDE"
                ]
              }
            },
            "required": [
              "id",
              "reference",
              "status"
            ],
            "additionalProperties": false
          },
          {
            "type": "null"
          }
        ]
      },
      "GetBillMatchResponse": {
        "oneOf": [
          {
            "type": "object",
            "properties": {
              "billId": {
                "type": "string"
              },
              "billStatus": {
                "type": "string"
              },
              "read": {
                "type": "string",
                "const": "MEASURED"
              },
              "state": {
                "type": "string",
                "enum": [
                  "NO_ORDER",
                  "MATCHED",
                  "EXCEPTIONS"
                ]
              },
              "mode": {
                "type": "string",
                "enum": [
                  "TWO_WAY",
                  "THREE_WAY"
                ]
              },
              "currency": {
                "type": "string",
                "pattern": "^[A-Z]{3}$"
              },
              "required": {
                "type": "object",
                "properties": {
                  "applies": {
                    "type": "boolean"
                  },
                  "aboveMinor": {
                    "anyOf": [
                      {
                        "type": "string",
                        "pattern": "^-?\\d+$"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "subtotalMinor": {
                    "anyOf": [
                      {
                        "type": "string",
                        "pattern": "^-?\\d+$"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "exempt": {
                    "$ref": "#/components/schemas/Retired"
                  }
                },
                "required": [
                  "applies",
                  "aboveMinor",
                  "subtotalMinor",
                  "exempt"
                ],
                "additionalProperties": false
              },
              "lines": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "position": {
                      "type": "integer",
                      "minimum": 0,
                      "maximum": 9007199254740991
                    },
                    "description": {
                      "type": "string"
                    },
                    "quantity": {
                      "type": "string",
                      "pattern": "^\\d{1,10}(\\.\\d{1,4})?$"
                    },
                    "netMinor": {
                      "type": "string",
                      "pattern": "^-?\\d+$"
                    },
                    "orderLine": {
                      "anyOf": [
                        {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "string"
                            },
                            "orderId": {
                              "type": "string"
                            },
                            "orderNumber": {
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "position": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 9007199254740991
                            },
                            "description": {
                              "type": "string"
                            },
                            "quantity": {
                              "type": "string",
                              "pattern": "^\\d{1,10}(\\.\\d{1,4})?$"
                            },
                            "unitPriceMinor": {
                              "type": "string",
                              "pattern": "^-?\\d+$"
                            },
                            "currency": {
                              "type": "string",
                              "pattern": "^[A-Z]{3}$"
                            },
                            "orderStatus": {
                              "type": "string",
                              "enum": [
                                "DRAFT",
                                "IN_APPROVAL",
                                "APPROVED",
                                "SENT",
                                "PART_RECEIVED",
                                "RECEIVED",
                                "CLOSED",
                                "CANCELLED"
                              ]
                            }
                          },
                          "required": [
                            "id",
                            "orderId",
                            "orderNumber",
                            "position",
                            "description",
                            "quantity",
                            "unitPriceMinor",
                            "currency",
                            "orderStatus"
                          ],
                          "additionalProperties": false
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "billedElsewhere": {
                      "type": "string",
                      "pattern": "^\\d{1,10}(\\.\\d{1,4})?$"
                    },
                    "receivedQuantity": {
                      "anyOf": [
                        {
                          "type": "string",
                          "pattern": "^\\d{1,10}(\\.\\d{1,4})?$"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "expectedNetMinor": {
                      "anyOf": [
                        {
                          "type": "string",
                          "pattern": "^-?\\d+$"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "priceVarianceMinor": {
                      "anyOf": [
                        {
                          "type": "string",
                          "pattern": "^-?\\d+$"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "priceVarianceBp": {
                      "anyOf": [
                        {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "standing": {
                      "type": "string",
                      "enum": [
                        "CLEAN",
                        "NOTE",
                        "EXCEPTION",
                        "UNLINKED",
                        "NOT_COMPARED"
                      ]
                    }
                  },
                  "required": [
                    "position",
                    "description",
                    "quantity",
                    "netMinor",
                    "orderLine",
                    "billedElsewhere",
                    "receivedQuantity",
                    "expectedNetMinor",
                    "priceVarianceMinor",
                    "priceVarianceBp",
                    "standing"
                  ],
                  "additionalProperties": false
                }
              },
              "orders": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "number": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "status": {
                      "type": "string",
                      "enum": [
                        "DRAFT",
                        "IN_APPROVAL",
                        "APPROVED",
                        "SENT",
                        "PART_RECEIVED",
                        "RECEIVED",
                        "CLOSED",
                        "CANCELLED"
                      ]
                    },
                    "currency": {
                      "type": "string",
                      "pattern": "^[A-Z]{3}$"
                    },
                    "totalMinor": {
                      "type": "string",
                      "pattern": "^-?\\d+$"
                    },
                    "billedNetMinor": {
                      "type": "string",
                      "pattern": "^-?\\d+$"
                    },
                    "overBilledMinor": {
                      "type": "string",
                      "pattern": "^-?\\d+$"
                    },
                    "requestedBy": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "name": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "id",
                        "name"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "id",
                    "number",
                    "status",
                    "currency",
                    "totalMinor",
                    "billedNetMinor",
                    "overBilledMinor",
                    "requestedBy"
                  ],
                  "additionalProperties": false
                }
              },
              "findings": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "code": {
                      "type": "string",
                      "enum": [
                        "PO_REQUIRED",
                        "PO_LINE_NOT_ON_ORDER",
                        "PO_PRICE_VARIANCE",
                        "PO_QUANTITY_VARIANCE",
                        "PO_OVER_BILLED",
                        "PO_NOT_RECEIVED",
                        "PO_NOT_COMPARED"
                      ]
                    },
                    "severity": {
                      "type": "string",
                      "enum": [
                        "WARNING",
                        "NOTE"
                      ]
                    },
                    "line": {
                      "anyOf": [
                        {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 9007199254740991
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "fact": {
                      "type": "string"
                    },
                    "remedy": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "figures": {
                      "type": "object",
                      "propertyNames": {
                        "type": "string"
                      },
                      "additionalProperties": {
                        "type": "string"
                      }
                    },
                    "tolerance": {
                      "anyOf": [
                        {
                          "type": "object",
                          "properties": {
                            "ruleId": {
                              "type": "string"
                            },
                            "ruleVersion": {
                              "type": "integer",
                              "minimum": 1,
                              "maximum": 9007199254740991
                            },
                            "authorName": {
                              "type": "string"
                            },
                            "sentence": {
                              "type": "string"
                            },
                            "expiresOn": {
                              "anyOf": [
                                {
                                  "type": "string",
                                  "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "state": {
                              "type": "string",
                              "enum": [
                                "WOULD_APPLY",
                                "APPLIED"
                              ]
                            },
                            "valueMinor": {
                              "type": "string",
                              "pattern": "^-?\\d+$"
                            },
                            "bp": {
                              "type": "integer",
                              "minimum": -9007199254740991,
                              "maximum": 9007199254740991
                            },
                            "usedMinor": {
                              "type": "string",
                              "pattern": "^-?\\d+$"
                            },
                            "totalCapMinor": {
                              "type": "string",
                              "pattern": "^-?\\d+$"
                            },
                            "currency": {
                              "type": "string",
                              "pattern": "^[A-Z]{3}$"
                            }
                          },
                          "required": [
                            "ruleId",
                            "ruleVersion",
                            "authorName",
                            "sentence",
                            "expiresOn",
                            "state",
                            "valueMinor",
                            "bp",
                            "usedMinor",
                            "totalCapMinor",
                            "currency"
                          ],
                          "additionalProperties": false
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  },
                  "required": [
                    "code",
                    "severity",
                    "line",
                    "fact",
                    "remedy",
                    "figures",
                    "tolerance"
                  ],
                  "additionalProperties": false
                }
              },
              "digest": {
                "type": "string",
                "pattern": "^[0-9a-f]{16}$"
              },
              "orderReference": {
                "anyOf": [
                  {
                    "type": "object",
                    "properties": {
                      "text": {
                        "type": "string"
                      },
                      "source": {
                        "type": "string",
                        "enum": [
                          "DOCUMENT",
                          "TYPED"
                        ]
                      },
                      "found": {
                        "type": "boolean"
                      }
                    },
                    "required": [
                      "text",
                      "source",
                      "found"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "may": {
                "type": "object",
                "properties": {
                  "link": {
                    "type": "boolean"
                  }
                },
                "required": [
                  "link"
                ],
                "additionalProperties": false
              },
              "entityTimeZone": {
                "type": "string"
              }
            },
            "required": [
              "billId",
              "billStatus",
              "read",
              "state",
              "mode",
              "currency",
              "required",
              "lines",
              "orders",
              "findings",
              "digest",
              "orderReference",
              "may",
              "entityTimeZone"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "billId": {
                "type": "string"
              },
              "billStatus": {
                "type": "string"
              },
              "read": {
                "type": "string",
                "const": "UNREAD"
              },
              "state": {
                "type": "string",
                "const": "UNREAD"
              },
              "why": {
                "type": "string"
              }
            },
            "required": [
              "billId",
              "billStatus",
              "read",
              "state",
              "why"
            ],
            "additionalProperties": false
          }
        ]
      },
      "GetBillWithholdingResponse": {
        "type": "object",
        "properties": {
          "summary": {
            "type": "object",
            "properties": {
              "state": {
                "type": "string",
                "enum": [
                  "NOT_APPLICABLE",
                  "RESIDENCY_UNSTATED",
                  "UNDECIDED",
                  "NO_SERVICE_IN_CANADA",
                  "WITHHOLDS",
                  "WAIVED"
                ]
              },
              "serviceLines": {
                "type": "integer",
                "minimum": 0,
                "maximum": 9007199254740991
              },
              "undecidedLines": {
                "type": "integer",
                "minimum": 0,
                "maximum": 9007199254740991
              },
              "inCanadaLines": {
                "type": "integer",
                "minimum": 0,
                "maximum": 9007199254740991
              },
              "markedNetMinor": {
                "type": "string",
                "pattern": "^-?\\d+$"
              },
              "currency": {
                "type": "string",
                "pattern": "^[A-Z]{3}$"
              },
              "rateBp": {
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991
              },
              "waiver": {
                "$ref": "#/components/schemas/Waiver"
              },
              "unstatedBecause": {
                "type": "array",
                "items": {
                  "type": "string",
                  "enum": [
                    "MAILING_COUNTRY",
                    "BANK_ABROAD"
                  ]
                }
              },
              "frozenBy": {
                "anyOf": [
                  {
                    "type": "string",
                    "enum": [
                      "STATUS",
                      "WITHHELD_ON"
                    ]
                  },
                  {
                    "type": "null"
                  }
                ]
              }
            },
            "required": [
              "state",
              "serviceLines",
              "undecidedLines",
              "inCanadaLines",
              "markedNetMinor",
              "currency",
              "rateBp",
              "waiver",
              "unstatedBecause",
              "frozenBy"
            ],
            "additionalProperties": false
          },
          "lines": {
            "type": "object",
            "properties": {
              "data": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "lineId": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "position": {
                      "anyOf": [
                        {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "description": {
                      "type": "string"
                    },
                    "netMinor": {
                      "type": "string",
                      "pattern": "^-?\\d+$"
                    },
                    "supplyCategory": {
                      "type": "string",
                      "enum": [
                        "GOODS",
                        "SERVICES",
                        "INTANGIBLE_PROPERTY",
                        "REAL_PROPERTY"
                      ]
                    },
                    "needsDecision": {
                      "type": "boolean"
                    },
                    "decision": {
                      "anyOf": [
                        {
                          "type": "string",
                          "enum": [
                            "IN_CANADA",
                            "OUTSIDE_CANADA",
                            "NOT_A_SERVICE"
                          ]
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "decidedBy": {
                      "anyOf": [
                        {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "string"
                            },
                            "name": {
                              "type": "string"
                            }
                          },
                          "required": [
                            "id",
                            "name"
                          ],
                          "additionalProperties": false
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "decidedAt": {
                      "anyOf": [
                        {
                          "type": "string",
                          "minLength": 20
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "note": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "source": {
                      "anyOf": [
                        {
                          "type": "string",
                          "enum": [
                            "PERSON",
                            "AGENT_DRAFT",
                            "AGENT_DRAFT_EDITED"
                          ]
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "earlierDecisions": {
                      "type": "integer",
                      "minimum": 0,
                      "maximum": 9007199254740991
                    },
                    "carried": {
                      "anyOf": [
                        {
                          "type": "object",
                          "properties": {
                            "decision": {
                              "type": "string",
                              "enum": [
                                "IN_CANADA",
                                "OUTSIDE_CANADA",
                                "NOT_A_SERVICE"
                              ]
                            },
                            "by": {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string"
                                },
                                "name": {
                                  "type": "string"
                                }
                              },
                              "required": [
                                "id",
                                "name"
                              ],
                              "additionalProperties": false
                            },
                            "at": {
                              "type": "string",
                              "minLength": 20
                            },
                            "billId": {
                              "type": "string"
                            },
                            "billNumber": {
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "declinedProposal": {
                              "type": "boolean"
                            }
                          },
                          "required": [
                            "decision",
                            "by",
                            "at",
                            "billId",
                            "billNumber",
                            "declinedProposal"
                          ],
                          "additionalProperties": false
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  },
                  "required": [
                    "lineId",
                    "position",
                    "description",
                    "netMinor",
                    "supplyCategory",
                    "needsDecision",
                    "decision",
                    "decidedBy",
                    "decidedAt",
                    "note",
                    "source",
                    "earlierDecisions",
                    "carried"
                  ],
                  "additionalProperties": false
                }
              },
              "nextCursor": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "total": {
                "anyOf": [
                  {
                    "type": "integer",
                    "minimum": -9007199254740991,
                    "maximum": 9007199254740991
                  },
                  {
                    "type": "null"
                  }
                ]
              }
            },
            "required": [
              "data",
              "nextCursor",
              "total"
            ],
            "additionalProperties": false
          },
          "lastDecisionId": {
            "type": [
              "string",
              "null"
            ]
          },
          "revision": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "current": {
            "type": "boolean"
          },
          "entityTimeZone": {
            "type": "string"
          },
          "mayDecide": {
            "type": "boolean"
          }
        },
        "required": [
          "summary",
          "lines",
          "lastDecisionId",
          "revision",
          "current",
          "entityTimeZone",
          "mayDecide"
        ],
        "additionalProperties": false
      },
      "GetPurchaseOrderBudgetPositionResponse": {
        "type": "object",
        "properties": {
          "subject": {
            "type": "object",
            "properties": {
              "kind": {
                "type": "string",
                "enum": [
                  "BILL",
                  "ORDER"
                ]
              },
              "id": {
                "type": "string"
              }
            },
            "required": [
              "kind",
              "id"
            ],
            "additionalProperties": false
          },
          "entityId": {
            "type": "string"
          },
          "entityName": {
            "type": "string"
          },
          "entityTimeZone": {
            "type": "string"
          },
          "currency": {
            "type": "string",
            "pattern": "^[A-Z]{3}$"
          },
          "measuredOn": {
            "type": "string",
            "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
          },
          "postingMoved": {
            "type": "boolean"
          },
          "windowLabel": {
            "type": "string"
          },
          "plan": {
            "oneOf": [
              {
                "type": "object",
                "properties": {
                  "state": {
                    "type": "string",
                    "const": "PLAN"
                  },
                  "budgetId": {
                    "type": "string"
                  },
                  "name": {
                    "type": "string"
                  },
                  "version": {
                    "type": "integer",
                    "exclusiveMinimum": 0,
                    "maximum": 9007199254740991
                  },
                  "fiscalYear": {
                    "type": "integer",
                    "minimum": -9007199254740991,
                    "maximum": 9007199254740991
                  }
                },
                "required": [
                  "state",
                  "budgetId",
                  "name",
                  "version",
                  "fiscalYear"
                ],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "state": {
                    "type": "string",
                    "const": "NONE_APPROVED"
                  },
                  "company": {
                    "type": "string"
                  }
                },
                "required": [
                  "state",
                  "company"
                ],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "state": {
                    "type": "string",
                    "const": "OTHER_CURRENCY"
                  },
                  "planCurrency": {
                    "type": "string",
                    "pattern": "^[A-Z]{3}$"
                  }
                },
                "required": [
                  "state",
                  "planCurrency"
                ],
                "additionalProperties": false
              }
            ]
          },
          "groups": {
            "maxItems": 100,
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "accountId": {
                  "type": "string"
                },
                "code": {
                  "type": "string"
                },
                "name": {
                  "type": "string"
                },
                "lineIndexes": {
                  "type": "array",
                  "items": {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 9007199254740991
                  }
                },
                "state": {
                  "type": "string",
                  "enum": [
                    "OVER",
                    "WITHIN",
                    "UNBUDGETED",
                    "NOT_YET_PLANNED",
                    "NOT_BUDGETABLE",
                    "NO_RATE",
                    "TAGS_NOT_COVERED",
                    "MIXED_PLAN_TAGS"
                  ]
                },
                "tagLabels": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                },
                "monthPlanMinor": {
                  "anyOf": [
                    {
                      "type": "string",
                      "pattern": "^-?\\d+$"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "planYtdMinor": {
                  "type": "string",
                  "pattern": "^-?\\d+$"
                },
                "planYearMinor": {
                  "type": "string",
                  "pattern": "^-?\\d+$"
                },
                "actualMinor": {
                  "type": "string",
                  "pattern": "^-?\\d+$"
                },
                "committedMinor": {
                  "type": "string",
                  "pattern": "^-?\\d+$"
                },
                "thisMinor": {
                  "type": "string",
                  "pattern": "^-?\\d+$"
                },
                "afterMinor": {
                  "type": "string",
                  "pattern": "^-?\\d+$"
                },
                "overByMinor": {
                  "type": "string",
                  "pattern": "^-?\\d+$"
                },
                "alreadyOver": {
                  "type": "boolean"
                },
                "firstPlannedMonth": {
                  "anyOf": [
                    {
                      "type": "string",
                      "pattern": "^\\d{4}-(0[1-9]|1[0-2])$"
                    },
                    {
                      "type": "null"
                    }
                  ]
                }
              },
              "required": [
                "accountId",
                "code",
                "name",
                "lineIndexes",
                "state",
                "tagLabels",
                "monthPlanMinor",
                "planYtdMinor",
                "planYearMinor",
                "actualMinor",
                "committedMinor",
                "thisMinor",
                "afterMinor",
                "overByMinor",
                "alreadyOver",
                "firstPlannedMonth"
              ],
              "additionalProperties": false
            }
          },
          "committedBills": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "committedUnmeasuredBills": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "notComparedLines": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "over": {
            "type": "boolean"
          },
          "verdictDigest": {
            "type": "string",
            "pattern": "^[0-9a-f]{16}$"
          },
          "readAt": {
            "type": "string",
            "minLength": 20
          }
        },
        "required": [
          "subject",
          "entityId",
          "entityName",
          "entityTimeZone",
          "currency",
          "measuredOn",
          "postingMoved",
          "windowLabel",
          "plan",
          "groups",
          "committedBills",
          "committedUnmeasuredBills",
          "notComparedLines",
          "over",
          "verdictDigest",
          "readAt"
        ],
        "additionalProperties": false
      },
      "GetPurchaseOrderNumberSeriesResponse": {
        "type": "object",
        "properties": {
          "entityId": {
            "type": "string"
          },
          "prefix": {
            "type": "string"
          },
          "padding": {
            "type": "integer",
            "minimum": 1,
            "maximum": 12
          },
          "next": {
            "type": "integer",
            "minimum": 1,
            "maximum": 9007199254740991
          },
          "nextNumber": {
            "type": "string"
          },
          "issued": {
            "type": [
              "string",
              "null"
            ]
          },
          "updatedAt": {
            "anyOf": [
              {
                "type": "string",
                "minLength": 20
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "entityId",
          "prefix",
          "padding",
          "next",
          "nextNumber",
          "issued",
          "updatedAt"
        ],
        "additionalProperties": false
      },
      "GetPurchasesSettingsResponse": {
        "type": "object",
        "properties": {
          "ledger": {
            "type": "object",
            "properties": {
              "bankingCallbackWindowDays": {
                "type": "integer",
                "minimum": 1,
                "maximum": 365
              },
              "bankingProposalExpiryDays": {
                "type": "integer",
                "minimum": 1,
                "maximum": 365
              },
              "bankingNoticeTelephone": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "newVendorSlipKind": {
                "type": "string",
                "enum": [
                  "NONE",
                  "T4A",
                  "T5018",
                  "T4A_NR"
                ]
              },
              "newVendorAccount": {
                "$ref": "#/components/schemas/Account"
              },
              "updatedBy": {
                "anyOf": [
                  {
                    "type": "object",
                    "properties": {
                      "id": {
                        "type": "string"
                      },
                      "name": {
                        "type": "string"
                      }
                    },
                    "required": [
                      "id",
                      "name"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "updatedAt": {
                "anyOf": [
                  {
                    "type": "string",
                    "minLength": 20
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "bankingDigitsRetentionDays": {
                "type": "integer",
                "minimum": 7,
                "maximum": 365
              },
              "bankingDigitsRetentionSetBy": {
                "anyOf": [
                  {
                    "type": "object",
                    "properties": {
                      "id": {
                        "type": "string"
                      },
                      "name": {
                        "type": "string"
                      }
                    },
                    "required": [
                      "id",
                      "name"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "bankingDigitsRetentionSetAt": {
                "anyOf": [
                  {
                    "type": "string",
                    "minLength": 20
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "bankingDigitsDueCount": {
                "type": "integer",
                "minimum": 0,
                "maximum": 9007199254740991
              },
              "vendorPortalOn": {
                "type": "boolean"
              },
              "vendorPortalOnBy": {
                "anyOf": [
                  {
                    "type": "object",
                    "properties": {
                      "id": {
                        "type": "string"
                      },
                      "name": {
                        "type": "string"
                      }
                    },
                    "required": [
                      "id",
                      "name"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "vendorPortalOnAt": {
                "anyOf": [
                  {
                    "type": "string",
                    "minLength": 20
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "vendorPortalLinkDays": {
                "type": "integer",
                "minimum": 7,
                "maximum": 365
              },
              "vendorPortalReadsPerDay": {
                "type": "integer",
                "minimum": 0,
                "maximum": 20
              },
              "vendorPortalLiveLinks": {
                "type": "integer",
                "minimum": 0,
                "maximum": 9007199254740991
              },
              "vendorPortalWaiting": {
                "type": "integer",
                "minimum": 0,
                "maximum": 9007199254740991
              },
              "statementRoundingMinor": {
                "type": "integer",
                "minimum": 0,
                "maximum": 500
              },
              "statementLookbackDays": {
                "type": "integer",
                "minimum": 30,
                "maximum": 400
              },
              "statementMatchSetBy": {
                "anyOf": [
                  {
                    "type": "object",
                    "properties": {
                      "id": {
                        "type": "string"
                      },
                      "name": {
                        "type": "string"
                      }
                    },
                    "required": [
                      "id",
                      "name"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "statementMatchSetAt": {
                "anyOf": [
                  {
                    "type": "string",
                    "minLength": 20
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "treatmentWindowBills": {
                "type": "integer",
                "minimum": 3,
                "maximum": 12
              },
              "priceCreepBp": {
                "type": "integer",
                "minimum": 100,
                "maximum": 10000
              },
              "priceCreepFloorMinor": {
                "type": "string",
                "pattern": "^\\d+$"
              },
              "expectedBillMinOccurrences": {
                "type": "integer",
                "minimum": 3,
                "maximum": 24
              },
              "expectedBillGraceDays": {
                "type": "integer",
                "minimum": 0,
                "maximum": 31
              },
              "recurringToleranceBp": {
                "type": "integer",
                "minimum": 0,
                "maximum": 10000
              },
              "recurringToleranceFloorMinor": {
                "type": "string",
                "pattern": "^\\d+$"
              },
              "duplicateAmountWindowDays": {
                "type": "integer",
                "minimum": 0,
                "maximum": 31
              },
              "duplicateCadenceMinMonths": {
                "type": "integer",
                "minimum": 1,
                "maximum": 24
              },
              "duplicateCadenceMaxPerMonth": {
                "type": "integer",
                "minimum": 1,
                "maximum": 10
              },
              "bankingSignalWindowDays": {
                "type": "integer",
                "minimum": 1,
                "maximum": 365
              },
              "bankingShortIntervalDays": {
                "type": "integer",
                "minimum": 1,
                "maximum": 730
              },
              "approvalReminders": {
                "type": "object",
                "properties": {
                  "nudgeAfterDays": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 30
                  },
                  "noticeMode": {
                    "type": "string",
                    "enum": [
                      "EACH",
                      "DAILY_DIGEST"
                    ]
                  }
                },
                "required": [
                  "nudgeAfterDays",
                  "noticeMode"
                ],
                "additionalProperties": false
              },
              "supplierNotices": {
                "type": "object",
                "properties": {
                  "approved": {
                    "type": "string",
                    "enum": [
                      "OFF",
                      "OFFERED",
                      "TICKED"
                    ]
                  },
                  "held": {
                    "type": "string",
                    "enum": [
                      "OFF",
                      "OFFERED",
                      "TICKED"
                    ]
                  },
                  "declined": {
                    "type": "string",
                    "enum": [
                      "OFF",
                      "OFFERED",
                      "TICKED"
                    ]
                  }
                },
                "required": [
                  "approved",
                  "held",
                  "declined"
                ],
                "additionalProperties": false
              },
              "vendorMergeExpiryDays": {
                "type": "integer",
                "minimum": 1,
                "maximum": 60
              },
              "paperLeadDays": {
                "type": "integer",
                "minimum": 1,
                "maximum": 120
              },
              "newVendorRequiredPaper": {
                "type": "array",
                "items": {
                  "type": "string",
                  "enum": [
                    "WSIB_CLEARANCE",
                    "INSURANCE_CERTIFICATE",
                    "MASTER_AGREEMENT",
                    "W8BEN",
                    "DIRECT_DEPOSIT_FORM",
                    "WITHHOLDING_WAIVER",
                    "OTHER"
                  ]
                }
              }
            },
            "required": [
              "bankingCallbackWindowDays",
              "bankingProposalExpiryDays",
              "bankingNoticeTelephone",
              "newVendorSlipKind",
              "newVendorAccount",
              "updatedBy",
              "updatedAt",
              "bankingDigitsRetentionDays",
              "bankingDigitsRetentionSetBy",
              "bankingDigitsRetentionSetAt",
              "bankingDigitsDueCount",
              "vendorPortalOn",
              "vendorPortalOnBy",
              "vendorPortalOnAt",
              "vendorPortalLinkDays",
              "vendorPortalReadsPerDay",
              "vendorPortalLiveLinks",
              "vendorPortalWaiting",
              "statementRoundingMinor",
              "statementLookbackDays",
              "statementMatchSetBy",
              "statementMatchSetAt",
              "treatmentWindowBills",
              "priceCreepBp",
              "priceCreepFloorMinor",
              "expectedBillMinOccurrences",
              "expectedBillGraceDays",
              "recurringToleranceBp",
              "recurringToleranceFloorMinor",
              "duplicateAmountWindowDays",
              "duplicateCadenceMinMonths",
              "duplicateCadenceMaxPerMonth",
              "bankingSignalWindowDays",
              "bankingShortIntervalDays",
              "approvalReminders",
              "supplierNotices",
              "vendorMergeExpiryDays",
              "paperLeadDays",
              "newVendorRequiredPaper"
            ],
            "additionalProperties": false
          },
          "entity": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "entityId": {
                    "type": "string"
                  },
                  "entityName": {
                    "type": "string"
                  },
                  "entityTimeZone": {
                    "type": "string"
                  },
                  "payableAccount": {
                    "$ref": "#/components/schemas/Account"
                  },
                  "billNumberRequired": {
                    "type": "boolean"
                  },
                  "updatedBy": {
                    "anyOf": [
                      {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "name": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "id",
                          "name"
                        ],
                        "additionalProperties": false
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "updatedAt": {
                    "anyOf": [
                      {
                        "type": "string",
                        "minLength": 20
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "bankingLargeBillMinor": {
                    "type": "string",
                    "pattern": "^-?\\d+$"
                  },
                  "fxMethod": {
                    "type": "object",
                    "properties": {
                      "method": {
                        "type": "string",
                        "enum": [
                          "BOC_DAILY",
                          "LEDGER_RATE"
                        ]
                      },
                      "setBy": {
                        "anyOf": [
                          {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string"
                              },
                              "name": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "id",
                              "name"
                            ],
                            "additionalProperties": false
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "setAt": {
                        "anyOf": [
                          {
                            "type": "string",
                            "minLength": 20
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "note": {
                        "type": [
                          "string",
                          "null"
                        ]
                      }
                    },
                    "required": [
                      "method",
                      "setBy",
                      "setAt",
                      "note"
                    ],
                    "additionalProperties": false
                  },
                  "unconvertedBillCount": {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 9007199254740991
                  },
                  "supplierContact": {
                    "anyOf": [
                      {
                        "type": "object",
                        "properties": {
                          "user": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string"
                              },
                              "name": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "id",
                              "name"
                            ],
                            "additionalProperties": false
                          },
                          "telephone": {
                            "type": "string"
                          },
                          "seatHeld": {
                            "type": "boolean"
                          }
                        },
                        "required": [
                          "user",
                          "telephone",
                          "seatHeld"
                        ],
                        "additionalProperties": false
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "remittanceSender": {
                    "anyOf": [
                      {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "name": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "id",
                          "name"
                        ],
                        "additionalProperties": false
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "withholdingPayableAccount": {
                    "$ref": "#/components/schemas/Account"
                  },
                  "inbox": {
                    "type": "object",
                    "properties": {
                      "senderPolicy": {
                        "type": "string",
                        "enum": [
                          "ACCEPT_ALL",
                          "QUARANTINE_UNAUTHENTICATED",
                          "KNOWN_SENDERS_ONLY"
                        ]
                      },
                      "addressDailyMessages": {
                        "type": "integer",
                        "minimum": -9007199254740991,
                        "maximum": 9007199254740991
                      },
                      "senderDailyMessages": {
                        "type": "integer",
                        "minimum": -9007199254740991,
                        "maximum": 9007199254740991
                      },
                      "addressDailyReadMinor": {
                        "type": "string",
                        "pattern": "^-?\\d+$"
                      },
                      "senderDailyReadMinor": {
                        "type": "string",
                        "pattern": "^-?\\d+$"
                      },
                      "watcherEmailed": {
                        "type": "boolean"
                      },
                      "setBy": {
                        "anyOf": [
                          {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string"
                              },
                              "name": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "id",
                              "name"
                            ],
                            "additionalProperties": false
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "setAt": {
                        "anyOf": [
                          {
                            "type": "string",
                            "minLength": 20
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "adviceDismissed": {
                        "$ref": "#/components/schemas/StoppedBy"
                      },
                      "heldOpen": {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 9007199254740991
                      }
                    },
                    "required": [
                      "senderPolicy",
                      "addressDailyMessages",
                      "senderDailyMessages",
                      "addressDailyReadMinor",
                      "senderDailyReadMinor",
                      "watcherEmailed",
                      "setBy",
                      "setAt",
                      "adviceDismissed",
                      "heldOpen"
                    ],
                    "additionalProperties": false
                  },
                  "orderSuggestionsOn": {
                    "type": "boolean"
                  },
                  "receiptOverPercent": {
                    "type": "string"
                  },
                  "receiverNotApprover": {
                    "type": "boolean"
                  },
                  "orderMatchMode": {
                    "type": "string",
                    "enum": [
                      "TWO_WAY",
                      "THREE_WAY"
                    ]
                  },
                  "orderRequiredAboveMinor": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "receivedNotInvoicedAccount": {
                    "$ref": "#/components/schemas/Account"
                  },
                  "prepaidAccount": {
                    "$ref": "#/components/schemas/Account"
                  },
                  "prepaidFloorMinor": {
                    "type": "string"
                  },
                  "prepaidSetBy": {
                    "anyOf": [
                      {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "name": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "id",
                          "name"
                        ],
                        "additionalProperties": false
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "prepaidSetAt": {
                    "anyOf": [
                      {
                        "type": "string",
                        "minLength": 20
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "expectedBillsOn": {
                    "type": "boolean"
                  },
                  "accruedLiabilitiesAccount": {
                    "$ref": "#/components/schemas/Account"
                  },
                  "holdbackPayableAccount": {
                    "$ref": "#/components/schemas/Account"
                  },
                  "capitalFloorMinor": {
                    "type": "string",
                    "pattern": "^\\d+$"
                  },
                  "capitalReadOn": {
                    "type": "boolean"
                  },
                  "capitalSetBy": {
                    "anyOf": [
                      {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "name": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "id",
                          "name"
                        ],
                        "additionalProperties": false
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "capitalSetAt": {
                    "anyOf": [
                      {
                        "type": "string",
                        "minLength": 20
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "planAccountId": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "cardReceiptGraceDays": {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 30
                  },
                  "intercompanyReadOn": {
                    "type": "boolean"
                  },
                  "intercompanySetBy": {
                    "anyOf": [
                      {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "name": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "id",
                          "name"
                        ],
                        "additionalProperties": false
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "intercompanySetAt": {
                    "anyOf": [
                      {
                        "type": "string",
                        "minLength": 20
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                },
                "required": [
                  "entityId",
                  "entityName",
                  "entityTimeZone",
                  "payableAccount",
                  "billNumberRequired",
                  "updatedBy",
                  "updatedAt",
                  "bankingLargeBillMinor",
                  "fxMethod",
                  "unconvertedBillCount",
                  "supplierContact",
                  "remittanceSender",
                  "withholdingPayableAccount",
                  "inbox",
                  "orderSuggestionsOn",
                  "receiptOverPercent",
                  "receiverNotApprover",
                  "orderMatchMode",
                  "orderRequiredAboveMinor",
                  "receivedNotInvoicedAccount",
                  "prepaidAccount",
                  "prepaidFloorMinor",
                  "prepaidSetBy",
                  "prepaidSetAt",
                  "expectedBillsOn",
                  "accruedLiabilitiesAccount",
                  "holdbackPayableAccount",
                  "capitalFloorMinor",
                  "capitalReadOn",
                  "capitalSetBy",
                  "capitalSetAt",
                  "planAccountId",
                  "cardReceiptGraceDays",
                  "intercompanyReadOn",
                  "intercompanySetBy",
                  "intercompanySetAt"
                ],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ]
          },
          "verificationMethods": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "method": {
                  "type": "string",
                  "enum": [
                    "CALLBACK_KNOWN_NUMBER",
                    "IN_PERSON",
                    "OTHER"
                  ]
                },
                "active": {
                  "type": "boolean"
                },
                "guidance": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "updatedBy": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "name": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "id",
                        "name"
                      ],
                      "additionalProperties": false
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "updatedAt": {
                  "anyOf": [
                    {
                      "type": "string",
                      "minLength": 20
                    },
                    {
                      "type": "null"
                    }
                  ]
                }
              },
              "required": [
                "method",
                "active",
                "guidance",
                "updatedBy",
                "updatedAt"
              ],
              "additionalProperties": false
            }
          },
          "stored": {
            "type": "boolean"
          },
          "paymentRail": {
            "type": "object",
            "properties": {
              "state": {
                "type": "string",
                "enum": [
                  "OFF",
                  "ON"
                ]
              },
              "connection": {
                "anyOf": [
                  {
                    "type": "object",
                    "properties": {
                      "id": {
                        "type": "string"
                      },
                      "displayName": {
                        "type": "string"
                      },
                      "status": {
                        "type": "string",
                        "enum": [
                          "ACTIVE",
                          "PAUSED",
                          "ERROR",
                          "REVOKED"
                        ]
                      },
                      "environment": {
                        "type": "string",
                        "enum": [
                          "SANDBOX",
                          "PRODUCTION"
                        ]
                      },
                      "fundingSourceLabel": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "connectedBy": {
                        "anyOf": [
                          {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string"
                              },
                              "name": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "id",
                              "name"
                            ],
                            "additionalProperties": false
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "connectedAt": {
                        "type": "string",
                        "minLength": 20
                      }
                    },
                    "required": [
                      "id",
                      "displayName",
                      "status",
                      "environment",
                      "fundingSourceLabel",
                      "connectedBy",
                      "connectedAt"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "connectionReady": {
                "type": "boolean"
              },
              "enabledBy": {
                "anyOf": [
                  {
                    "type": "object",
                    "properties": {
                      "id": {
                        "type": "string"
                      },
                      "name": {
                        "type": "string"
                      }
                    },
                    "required": [
                      "id",
                      "name"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "enabledAt": {
                "anyOf": [
                  {
                    "type": "string",
                    "minLength": 20
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "deployment": {
                "type": "string",
                "enum": [
                  "HELD",
                  "APPROVED"
                ]
              },
              "environment": {
                "type": "string",
                "enum": [
                  "SANDBOX",
                  "PRODUCTION"
                ]
              },
              "unsentPayouts": {
                "type": "integer",
                "minimum": 0,
                "maximum": 9007199254740991
              }
            },
            "required": [
              "state",
              "connection",
              "connectionReady",
              "enabledBy",
              "enabledAt",
              "deployment",
              "environment",
              "unsentPayouts"
            ],
            "additionalProperties": false
          }
        },
        "required": [
          "ledger",
          "entity",
          "verificationMethods",
          "stored",
          "paymentRail"
        ],
        "additionalProperties": false
      },
      "GetVendorNoticeResponse": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "kind": {
            "$ref": "#/components/schemas/Kind5"
          },
          "state": {
            "type": "string",
            "enum": [
              "DRAFTED",
              "SENT",
              "SUPPRESSED",
              "BOUNCED"
            ]
          },
          "reason": {
            "$ref": "#/components/schemas/Reason"
          },
          "recipientEmail": {
            "type": "string"
          },
          "language": {
            "type": "string",
            "enum": [
              "en",
              "fr",
              "bilingual"
            ]
          },
          "subject": {
            "type": "string"
          },
          "reference": {
            "type": "string"
          },
          "entity": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "name": {
                "type": "string"
              }
            },
            "required": [
              "id",
              "name"
            ],
            "additionalProperties": false
          },
          "entityTimeZone": {
            "type": "string"
          },
          "address": {
            "$ref": "#/components/schemas/Address"
          },
          "vendor": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string"
                  },
                  "displayName": {
                    "type": "string"
                  }
                },
                "required": [
                  "id",
                  "displayName"
                ],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ]
          },
          "inboundEmailId": {
            "type": [
              "string",
              "null"
            ]
          },
          "inboundRefusalId": {
            "type": [
              "string",
              "null"
            ]
          },
          "digestNoticeId": {
            "type": [
              "string",
              "null"
            ]
          },
          "digestHourStart": {
            "anyOf": [
              {
                "type": "string",
                "minLength": 20
              },
              {
                "type": "null"
              }
            ]
          },
          "under": {
            "$ref": "#/components/schemas/Under"
          },
          "stoppedBy": {
            "$ref": "#/components/schemas/StoppedBy"
          },
          "createdAt": {
            "type": "string",
            "minLength": 20
          },
          "sentAt": {
            "anyOf": [
              {
                "type": "string",
                "minLength": 20
              },
              {
                "type": "null"
              }
            ]
          },
          "sentVia": {
            "anyOf": [
              {
                "type": "string",
                "enum": [
                  "PRODUCT",
                  "BY_HAND"
                ]
              },
              {
                "type": "null"
              }
            ]
          },
          "sentBy": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string"
                  },
                  "name": {
                    "type": "string"
                  }
                },
                "required": [
                  "id",
                  "name"
                ],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ]
          },
          "sentNote": {
            "type": [
              "string",
              "null"
            ]
          },
          "transport": {
            "anyOf": [
              {
                "type": "string",
                "enum": [
                  "postmark",
                  "log",
                  "test-copy"
                ]
              },
              {
                "type": "null"
              }
            ]
          },
          "bouncedAt": {
            "anyOf": [
              {
                "type": "string",
                "minLength": 20
              },
              {
                "type": "null"
              }
            ]
          },
          "bounceReason": {
            "type": [
              "string",
              "null"
            ]
          },
          "relayRefusal": {
            "type": [
              "string",
              "null"
            ]
          },
          "draftedBy": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string"
                  },
                  "name": {
                    "type": "string"
                  }
                },
                "required": [
                  "id",
                  "name"
                ],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ]
          },
          "discarded": {
            "$ref": "#/components/schemas/Retired"
          },
          "sendable": {
            "type": "boolean"
          },
          "outboundApproved": {
            "type": "boolean"
          },
          "sentence": {
            "type": "string"
          },
          "payment": {
            "$ref": "#/components/schemas/Payment"
          },
          "requested": {
            "$ref": "#/components/schemas/StoppedBy"
          },
          "recipientNew": {
            "type": "boolean"
          },
          "recipientConfirmedBy": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string"
                  },
                  "name": {
                    "type": "string"
                  }
                },
                "required": [
                  "id",
                  "name"
                ],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ]
          },
          "bill": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string"
                  },
                  "number": {
                    "type": [
                      "string",
                      "null"
                    ]
                  }
                },
                "required": [
                  "id",
                  "number"
                ],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ]
          },
          "vendorBankingChangeId": {
            "type": [
              "string",
              "null"
            ]
          },
          "slipDistribution": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string"
                  },
                  "reference": {
                    "type": "string"
                  }
                },
                "required": [
                  "id",
                  "reference"
                ],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ]
          },
          "purchaseOrder": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string"
                  },
                  "number": {
                    "type": [
                      "string",
                      "null"
                    ]
                  }
                },
                "required": [
                  "id",
                  "number"
                ],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ]
          },
          "vendorPortalLink": {
            "default": null,
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string"
                  },
                  "contactName": {
                    "type": "string"
                  }
                },
                "required": [
                  "id",
                  "contactName"
                ],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ]
          },
          "vendorQuery": {
            "default": null,
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string"
                  },
                  "reference": {
                    "type": "string"
                  }
                },
                "required": [
                  "id",
                  "reference"
                ],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ]
          },
          "vendorStatement": {
            "$ref": "#/components/schemas/VendorStatement"
          },
          "body": {
            "type": "string"
          },
          "from": {
            "type": "object",
            "properties": {
              "address": {
                "type": "string"
              },
              "name": {
                "type": "string"
              }
            },
            "required": [
              "address",
              "name"
            ],
            "additionalProperties": false
          },
          "providerMessageId": {
            "type": [
              "string",
              "null"
            ]
          },
          "messageVersion": {
            "type": "string"
          },
          "foldedCount": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": 0,
                "maximum": 9007199254740991
              },
              {
                "type": "null"
              }
            ]
          },
          "facts": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "language": {
                    "type": "string",
                    "enum": [
                      "en",
                      "fr"
                    ]
                  },
                  "vendorName": {
                    "type": "string"
                  },
                  "recipientName": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "companyName": {
                    "type": "string"
                  },
                  "billTo": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "address": {
                    "type": "string"
                  },
                  "paymentTermsName": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "contact": {
                    "type": "object",
                    "properties": {
                      "name": {
                        "type": "string"
                      },
                      "telephone": {
                        "type": "string"
                      }
                    },
                    "required": [
                      "name",
                      "telephone"
                    ],
                    "additionalProperties": false
                  },
                  "situation": {
                    "type": "string",
                    "enum": [
                      "NEW_SUPPLIER",
                      "NOT_USING_AN_INBOX",
                      "ALREADY_USING_AN_INBOX"
                    ]
                  },
                  "paragraph": {
                    "type": "object",
                    "properties": {
                      "source": {
                        "type": "string",
                        "enum": [
                          "STANDARD",
                          "AGENT_DRAFT",
                          "AGENT_DRAFT_EDITED",
                          "PERSON"
                        ]
                      },
                      "text": {
                        "type": [
                          "string",
                          "null"
                        ]
                      }
                    },
                    "required": [
                      "source",
                      "text"
                    ],
                    "additionalProperties": false
                  },
                  "thresholds": {
                    "type": "object",
                    "properties": {
                      "currency": {
                        "type": "string"
                      },
                      "lowerMinor": {
                        "type": "string"
                      },
                      "upperMinor": {
                        "type": "string"
                      },
                      "source": {
                        "type": "string"
                      }
                    },
                    "required": [
                      "currency",
                      "lowerMinor",
                      "upperMinor",
                      "source"
                    ],
                    "additionalProperties": false
                  }
                },
                "required": [
                  "language",
                  "vendorName",
                  "recipientName",
                  "companyName",
                  "billTo",
                  "address",
                  "paymentTermsName",
                  "contact",
                  "situation",
                  "paragraph",
                  "thresholds"
                ],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ]
          },
          "remittance": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "version": {
                    "type": "number",
                    "const": 1
                  },
                  "kind": {
                    "type": "string",
                    "enum": [
                      "ADVICE",
                      "REVERSAL"
                    ]
                  },
                  "language": {
                    "type": "string",
                    "enum": [
                      "en",
                      "fr",
                      "bilingual"
                    ]
                  },
                  "company": {
                    "type": "object",
                    "properties": {
                      "name": {
                        "type": "string"
                      },
                      "legalName": {
                        "type": [
                          "string",
                          "null"
                        ]
                      }
                    },
                    "required": [
                      "name",
                      "legalName"
                    ],
                    "additionalProperties": false
                  },
                  "vendor": {
                    "type": "object",
                    "properties": {
                      "id": {
                        "type": "string"
                      },
                      "displayName": {
                        "type": "string"
                      }
                    },
                    "required": [
                      "id",
                      "displayName"
                    ],
                    "additionalProperties": false
                  },
                  "recipient": {
                    "type": "object",
                    "properties": {
                      "email": {
                        "type": "string"
                      },
                      "name": {
                        "type": [
                          "string",
                          "null"
                        ]
                      }
                    },
                    "required": [
                      "email",
                      "name"
                    ],
                    "additionalProperties": false
                  },
                  "payment": {
                    "type": "object",
                    "properties": {
                      "id": {
                        "type": "string"
                      },
                      "runId": {
                        "type": "string"
                      },
                      "sequence": {
                        "type": "integer",
                        "minimum": 1,
                        "maximum": 9007199254740991
                      },
                      "paymentDate": {
                        "type": "string",
                        "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                      },
                      "amountMinor": {
                        "type": "string",
                        "pattern": "^-?\\d+$"
                      },
                      "currency": {
                        "type": "string",
                        "pattern": "^[A-Z]{3}$"
                      }
                    },
                    "required": [
                      "id",
                      "runId",
                      "sequence",
                      "paymentDate",
                      "amountMinor",
                      "currency"
                    ],
                    "additionalProperties": false
                  },
                  "lines": {
                    "$ref": "#/components/schemas/Lines"
                  },
                  "totals": {
                    "type": "object",
                    "properties": {
                      "appliedMinor": {
                        "type": "string",
                        "pattern": "^-?\\d+$"
                      },
                      "creditsMinor": {
                        "type": "string",
                        "pattern": "^-?\\d+$"
                      },
                      "discountsMinor": {
                        "type": "string",
                        "pattern": "^-?\\d+$"
                      },
                      "withholdingMinor": {
                        "type": "string",
                        "pattern": "^-?\\d+$"
                      },
                      "paidMinor": {
                        "type": "string",
                        "pattern": "^-?\\d+$"
                      }
                    },
                    "required": [
                      "appliedMinor",
                      "creditsMinor",
                      "discountsMinor",
                      "withholdingMinor",
                      "paidMinor"
                    ],
                    "additionalProperties": false
                  },
                  "contact": {
                    "anyOf": [
                      {
                        "type": "object",
                        "properties": {
                          "name": {
                            "type": "string"
                          },
                          "telephone": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "name",
                          "telephone"
                        ],
                        "additionalProperties": false
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "reference": {
                    "type": "string"
                  },
                  "situation": {
                    "type": "string",
                    "enum": [
                      "PAID_IN_FULL",
                      "WITH_DEDUCTIONS",
                      "SHORT"
                    ]
                  },
                  "paragraph": {
                    "type": "object",
                    "properties": {
                      "source": {
                        "type": "string",
                        "enum": [
                          "STANDARD",
                          "PERSON",
                          "AGENT_DRAFT",
                          "AGENT_DRAFT_EDITED"
                        ]
                      },
                      "text": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "promptVersion": {
                        "type": [
                          "string",
                          "null"
                        ]
                      }
                    },
                    "required": [
                      "source",
                      "text",
                      "promptVersion"
                    ],
                    "additionalProperties": false
                  },
                  "releasedAt": {
                    "type": "string",
                    "minLength": 20
                  },
                  "entityTimeZone": {
                    "type": "string"
                  },
                  "reversal": {
                    "anyOf": [
                      {
                        "type": "object",
                        "properties": {
                          "adviceReference": {
                            "type": "string"
                          },
                          "adviceSentOn": {
                            "type": "string",
                            "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                          },
                          "reversedOn": {
                            "type": "string",
                            "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                          },
                          "returnWords": {
                            "type": [
                              "string",
                              "null"
                            ]
                          }
                        },
                        "required": [
                          "adviceReference",
                          "adviceSentOn",
                          "reversedOn",
                          "returnWords"
                        ],
                        "additionalProperties": false
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "instrument": {
                    "anyOf": [
                      {
                        "type": "object",
                        "properties": {
                          "method": {
                            "type": "string",
                            "enum": [
                              "EFT",
                              "CHEQUE",
                              "WIRE"
                            ]
                          },
                          "chequeNumber": {
                            "anyOf": [
                              {
                                "type": "integer",
                                "minimum": -9007199254740991,
                                "maximum": 9007199254740991
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "accountLast4": {
                            "anyOf": [
                              {
                                "type": "string",
                                "pattern": "^[0-9A-Z]{4}$"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "printedName": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "crossReference": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "originatorShortName": {
                            "type": [
                              "string",
                              "null"
                            ]
                          }
                        },
                        "required": [
                          "method",
                          "chequeNumber",
                          "accountLast4",
                          "printedName",
                          "crossReference",
                          "originatorShortName"
                        ],
                        "additionalProperties": false
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                },
                "required": [
                  "version",
                  "kind",
                  "language",
                  "company",
                  "vendor",
                  "recipient",
                  "payment",
                  "lines",
                  "totals",
                  "contact",
                  "reference",
                  "situation",
                  "paragraph",
                  "releasedAt",
                  "entityTimeZone",
                  "reversal",
                  "instrument"
                ],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ]
          },
          "decisionFacts": {
            "$ref": "#/components/schemas/DecisionFacts"
          },
          "paperFacts": {
            "$ref": "#/components/schemas/PaperFacts"
          }
        },
        "required": [
          "id",
          "kind",
          "state",
          "reason",
          "recipientEmail",
          "language",
          "subject",
          "reference",
          "entity",
          "entityTimeZone",
          "address",
          "vendor",
          "inboundEmailId",
          "inboundRefusalId",
          "digestNoticeId",
          "digestHourStart",
          "under",
          "stoppedBy",
          "createdAt",
          "sentAt",
          "sentVia",
          "sentBy",
          "sentNote",
          "transport",
          "bouncedAt",
          "bounceReason",
          "relayRefusal",
          "draftedBy",
          "discarded",
          "sendable",
          "outboundApproved",
          "sentence",
          "payment",
          "requested",
          "recipientNew",
          "recipientConfirmedBy",
          "bill",
          "vendorBankingChangeId",
          "slipDistribution",
          "purchaseOrder",
          "vendorPortalLink",
          "vendorQuery",
          "vendorStatement",
          "body",
          "from",
          "providerMessageId",
          "messageVersion",
          "foldedCount",
          "facts",
          "remittance",
          "decisionFacts",
          "paperFacts"
        ],
        "additionalProperties": false
      },
      "GetVendorPortalSubmissionResponse": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "vendor": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "displayName": {
                "type": "string"
              }
            },
            "required": [
              "id",
              "displayName"
            ],
            "additionalProperties": false
          },
          "kind": {
            "type": "string",
            "enum": [
              "DOCUMENT",
              "FACTS",
              "PAPER",
              "BANKING"
            ]
          },
          "summary": {
            "type": "string"
          },
          "receivedAt": {
            "type": "string",
            "minLength": 20
          },
          "waitingDays": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": 0,
                "maximum": 9007199254740991
              },
              {
                "type": "null"
              }
            ]
          },
          "state": {
            "type": "string",
            "enum": [
              "RECEIVED",
              "ACCEPTED",
              "DECLINED",
              "WITHDRAWN"
            ]
          },
          "decidedBy": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string"
                  },
                  "name": {
                    "type": "string"
                  }
                },
                "required": [
                  "id",
                  "name"
                ],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ]
          },
          "entityTimeZone": {
            "type": "string"
          },
          "link": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "contactName": {
                "type": "string"
              },
              "issuedBy": {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string"
                  },
                  "name": {
                    "type": "string"
                  }
                },
                "required": [
                  "id",
                  "name"
                ],
                "additionalProperties": false
              },
              "issuedAt": {
                "type": "string",
                "minLength": 20
              },
              "opens": {
                "type": "integer",
                "minimum": 0,
                "maximum": 9007199254740991
              }
            },
            "required": [
              "id",
              "contactName",
              "issuedBy",
              "issuedAt",
              "opens"
            ],
            "additionalProperties": false
          },
          "facts": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "key": {
                  "type": "string",
                  "enum": [
                    "legalName",
                    "taxNumber",
                    "qstNumber",
                    "recipientType",
                    "surname",
                    "givenName",
                    "addressLine1",
                    "addressLine2",
                    "city",
                    "region",
                    "postalCode",
                    "country"
                  ]
                },
                "label": {
                  "type": "string"
                },
                "current": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "proposed": {
                  "type": "string"
                },
                "status": {
                  "type": "string",
                  "enum": [
                    "NEW",
                    "CHANGED",
                    "SAME"
                  ]
                },
                "readFromPage": {
                  "type": "boolean"
                },
                "changedBySupplier": {
                  "type": "boolean"
                }
              },
              "required": [
                "key",
                "label",
                "current",
                "proposed",
                "status",
                "readFromPage",
                "changedBySupplier"
              ],
              "additionalProperties": false
            }
          },
          "paper": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "kind": {
                    "type": "string"
                  },
                  "validFrom": {
                    "anyOf": [
                      {
                        "type": "string",
                        "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "validUntil": {
                    "anyOf": [
                      {
                        "type": "string",
                        "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "readDates": {
                    "anyOf": [
                      {
                        "type": "object",
                        "properties": {
                          "from": {
                            "anyOf": [
                              {
                                "type": "string",
                                "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "until": {
                            "anyOf": [
                              {
                                "type": "string",
                                "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          }
                        },
                        "required": [
                          "from",
                          "until"
                        ],
                        "additionalProperties": false
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "title": {
                    "type": [
                      "string",
                      "null"
                    ]
                  }
                },
                "required": [
                  "kind",
                  "validFrom",
                  "validUntil",
                  "readDates",
                  "title"
                ],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ]
          },
          "banking": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "holderName": {
                    "type": "string"
                  },
                  "holderMatchesLegalName": {
                    "type": "string",
                    "enum": [
                      "AGREES",
                      "DIFFERS",
                      "NOT_FOUND"
                    ]
                  },
                  "reason": {
                    "type": "string",
                    "enum": [
                      "NEW_ACCOUNT",
                      "CHANGED_BANK",
                      "CORRECTION"
                    ]
                  },
                  "callback": {
                    "type": "object",
                    "properties": {
                      "onFile": {
                        "type": "boolean"
                      },
                      "endsWith": {
                        "type": [
                          "string",
                          "null"
                        ]
                      }
                    },
                    "required": [
                      "onFile",
                      "endsWith"
                    ],
                    "additionalProperties": false
                  },
                  "existingState": {
                    "type": "string",
                    "enum": [
                      "ON_FILE",
                      "NONE",
                      "CHANGE_BEING_CHECKED"
                    ]
                  }
                },
                "required": [
                  "holderName",
                  "holderMatchesLegalName",
                  "reason",
                  "callback",
                  "existingState"
                ],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ]
          },
          "document": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string"
                  },
                  "fileName": {
                    "type": "string"
                  },
                  "sensitive": {
                    "type": "boolean"
                  }
                },
                "required": [
                  "id",
                  "fileName",
                  "sensitive"
                ],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ]
          },
          "flags": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "code": {
                  "type": "string"
                },
                "sentence": {
                  "type": "string"
                }
              },
              "required": [
                "code",
                "sentence"
              ],
              "additionalProperties": false
            }
          },
          "decision": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "by": {
                    "type": "object",
                    "properties": {
                      "id": {
                        "type": "string"
                      },
                      "name": {
                        "type": "string"
                      }
                    },
                    "required": [
                      "id",
                      "name"
                    ],
                    "additionalProperties": false
                  },
                  "at": {
                    "type": "string",
                    "minLength": 20
                  },
                  "note": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "declineReasonCode": {
                    "anyOf": [
                      {
                        "type": "string",
                        "enum": [
                          "UNCLEAR_COPY",
                          "WRONG_DOCUMENT",
                          "ALREADY_ON_FILE",
                          "WILL_CALL",
                          "WRITE_TO_US"
                        ]
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                },
                "required": [
                  "by",
                  "at",
                  "note",
                  "declineReasonCode"
                ],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ]
          },
          "readUsed": {
            "type": "boolean"
          }
        },
        "required": [
          "id",
          "vendor",
          "kind",
          "summary",
          "receivedAt",
          "waitingDays",
          "state",
          "decidedBy",
          "entityTimeZone",
          "link",
          "facts",
          "paper",
          "banking",
          "document",
          "flags",
          "decision",
          "readUsed"
        ],
        "additionalProperties": false
      },
      "GetVendorStatementNoticeFactsResponse": {
        "type": "object",
        "properties": {
          "facts": {
            "type": "object",
            "properties": {
              "theirsOnly": {
                "$ref": "#/components/schemas/TheirsOnly"
              },
              "oursOnly": {
                "$ref": "#/components/schemas/TheirsOnly"
              },
              "differs": {
                "$ref": "#/components/schemas/TheirsOnly"
              },
              "currency": {
                "type": "string",
                "pattern": "^[A-Z]{3}$"
              },
              "statementDate": {
                "type": "string",
                "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
              }
            },
            "required": [
              "theirsOnly",
              "oursOnly",
              "differs",
              "currency",
              "statementDate"
            ],
            "additionalProperties": false
          },
          "preview": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "subject": {
                    "type": "string"
                  },
                  "text": {
                    "type": "string"
                  }
                },
                "required": [
                  "subject",
                  "text"
                ],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ]
          },
          "recipients": {
            "maxItems": 50,
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "email": {
                  "type": "string"
                },
                "name": {
                  "type": [
                    "string",
                    "null"
                  ]
                }
              },
              "required": [
                "email",
                "name"
              ],
              "additionalProperties": false
            }
          },
          "openDraft": {
            "$ref": "#/components/schemas/OpenDraft"
          },
          "lastSent": {
            "$ref": "#/components/schemas/LastSent"
          },
          "outboundApproved": {
            "type": "boolean"
          },
          "entityTimeZone": {
            "type": "string"
          }
        },
        "required": [
          "facts",
          "preview",
          "recipients",
          "openDraft",
          "lastSent",
          "outboundApproved",
          "entityTimeZone"
        ],
        "additionalProperties": false
      },
      "Head": {
        "type": "array",
        "items": {
          "type": "object",
          "properties": {
            "field": {
              "type": "string"
            },
            "before": {
              "type": "string"
            },
            "after": {
              "type": "string"
            }
          },
          "required": [
            "field",
            "before",
            "after"
          ],
          "additionalProperties": false
        }
      },
      "History": {
        "type": "array",
        "items": {
          "type": "object",
          "properties": {
            "id": {
              "type": "string"
            },
            "at": {
              "type": "string"
            },
            "action": {
              "type": "string"
            },
            "actorName": {
              "type": [
                "string",
                "null"
              ]
            },
            "actorType": {
              "type": "string",
              "enum": [
                "USER",
                "AGENT",
                "SYSTEM",
                "CUSTOMER"
              ]
            },
            "attribution": {
              "type": "string"
            },
            "targetType": {
              "type": "string"
            },
            "targetId": {
              "type": "string"
            },
            "requestId": {
              "type": [
                "string",
                "null"
              ]
            },
            "clientAddress": {
              "type": [
                "string",
                "null"
              ]
            },
            "before": {
              "anyOf": [
                {
                  "type": "object",
                  "propertyNames": {
                    "type": "string"
                  },
                  "additionalProperties": {}
                },
                {
                  "type": "null"
                }
              ]
            },
            "after": {
              "anyOf": [
                {
                  "type": "object",
                  "propertyNames": {
                    "type": "string"
                  },
                  "additionalProperties": {}
                },
                {
                  "type": "null"
                }
              ]
            },
            "door": {
              "anyOf": [
                {
                  "type": "string",
                  "enum": [
                    "web",
                    "rest",
                    "mcp"
                  ]
                },
                {
                  "type": "null"
                }
              ]
            },
            "operation": {
              "type": [
                "string",
                "null"
              ]
            },
            "connectedAppId": {
              "type": [
                "string",
                "null"
              ]
            },
            "undoGroupId": {
              "type": [
                "string",
                "null"
              ]
            },
            "confirmationId": {
              "type": [
                "string",
                "null"
              ]
            },
            "traceId": {
              "type": [
                "string",
                "null"
              ]
            }
          },
          "required": [
            "id",
            "at",
            "action",
            "actorName",
            "actorType",
            "attribution",
            "targetType",
            "targetId",
            "requestId",
            "clientAddress",
            "door",
            "operation",
            "connectedAppId",
            "undoGroupId",
            "confirmationId",
            "traceId"
          ],
          "additionalProperties": false
        }
      },
      "Hold": {
        "anyOf": [
          {
            "type": "object",
            "properties": {
              "held": {
                "default": true,
                "type": "boolean",
                "const": true
              },
              "since": {
                "type": "string",
                "minLength": 20
              }
            },
            "required": [
              "held",
              "since"
            ],
            "additionalProperties": false
          },
          {
            "type": "null"
          }
        ]
      },
      "HoldBillResponse": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "hold": {
            "$ref": "#/components/schemas/Hold"
          }
        },
        "required": [
          "id",
          "hold"
        ],
        "additionalProperties": false
      },
      "Holdback": {
        "type": "object",
        "properties": {
          "state": {
            "type": "string",
            "enum": [
              "NONE",
              "RETAINED",
              "RELEASE_DUE",
              "RELEASE_DRAFTED",
              "PART_RELEASED",
              "RELEASED",
              "IS_RELEASE"
            ]
          },
          "currency": {
            "type": "string",
            "pattern": "^[A-Z]{3}$"
          },
          "grossMinor": {
            "anyOf": [
              {
                "type": "string",
                "pattern": "^-?\\d+$"
              },
              {
                "type": "null"
              }
            ]
          },
          "retainedMinor": {
            "type": "string",
            "pattern": "^-?\\d+$"
          },
          "releasedMinor": {
            "type": "string",
            "pattern": "^-?\\d+$"
          },
          "draftedMinor": {
            "type": "string",
            "pattern": "^-?\\d+$"
          },
          "remainingMinor": {
            "type": "string",
            "pattern": "^-?\\d+$"
          },
          "bp": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991
              },
              {
                "type": "null"
              }
            ]
          },
          "authority": {
            "anyOf": [
              {
                "type": "string",
                "enum": [
                  "STATUTE",
                  "AGREEMENT"
                ]
              },
              {
                "type": "null"
              }
            ]
          },
          "authorityNote": {
            "type": [
              "string",
              "null"
            ]
          },
          "releaseOn": {
            "anyOf": [
              {
                "type": "string",
                "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
              },
              {
                "type": "null"
              }
            ]
          },
          "account": {
            "$ref": "#/components/schemas/Account"
          },
          "statedBy": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string"
                  },
                  "name": {
                    "type": "string"
                  }
                },
                "required": [
                  "id",
                  "name"
                ],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ]
          },
          "statedAt": {
            "anyOf": [
              {
                "type": "string",
                "minLength": 20
              },
              {
                "type": "null"
              }
            ]
          },
          "source": {
            "anyOf": [
              {
                "type": "string",
                "enum": [
                  "PERSON",
                  "AGENT_DRAFT",
                  "AGENT_DRAFT_EDITED",
                  "CARRIED"
                ]
              },
              {
                "type": "null"
              }
            ]
          },
          "of": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "billId": {
                    "type": "string"
                  },
                  "number": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "billDate": {
                    "type": "string",
                    "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                  },
                  "supplierName": {
                    "type": "string"
                  }
                },
                "required": [
                  "billId",
                  "number",
                  "billDate",
                  "supplierName"
                ],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ]
          },
          "releases": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "billId": {
                  "type": "string"
                },
                "number": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "status": {
                  "type": "string"
                },
                "subtotalMinor": {
                  "type": "string",
                  "pattern": "^-?\\d+$"
                },
                "taxMinor": {
                  "type": "string",
                  "pattern": "^-?\\d+$"
                },
                "totalMinor": {
                  "type": "string",
                  "pattern": "^-?\\d+$"
                },
                "billDate": {
                  "type": "string",
                  "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                },
                "paid": {
                  "type": "boolean"
                }
              },
              "required": [
                "billId",
                "number",
                "status",
                "subtotalMinor",
                "taxMinor",
                "totalMinor",
                "billDate",
                "paid"
              ],
              "additionalProperties": false
            }
          },
          "releasesTotal": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "releasesNextCursor": {
            "type": [
              "string",
              "null"
            ]
          },
          "finding": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "code": {
                    "type": "string",
                    "const": "HOLDBACK_UNSTATED"
                  },
                  "fact": {
                    "type": "string"
                  },
                  "remedy": {
                    "type": "string"
                  }
                },
                "required": [
                  "code",
                  "fact",
                  "remedy"
                ],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ]
          },
          "entityTimeZone": {
            "type": "string"
          }
        },
        "required": [
          "state",
          "currency",
          "grossMinor",
          "retainedMinor",
          "releasedMinor",
          "draftedMinor",
          "remainingMinor",
          "bp",
          "authority",
          "authorityNote",
          "releaseOn",
          "account",
          "statedBy",
          "statedAt",
          "source",
          "of",
          "releases",
          "releasesTotal",
          "releasesNextCursor",
          "finding",
          "entityTimeZone"
        ],
        "additionalProperties": false
      },
      "Imported": {
        "type": "array",
        "items": {
          "type": "object",
          "properties": {
            "position": {
              "type": "integer",
              "minimum": 0,
              "maximum": 9007199254740991
            },
            "placement": {
              "type": "string",
              "enum": [
                "AT_TIME",
                "START_OF_DAY",
                "ON_DAY",
                "IN_PERIOD"
              ]
            },
            "sortsAt": {
              "anyOf": [
                {
                  "type": "string",
                  "minLength": 20
                },
                {
                  "type": "null"
                }
              ]
            },
            "record": {
              "$ref": "#/components/schemas/Record"
            }
          },
          "required": [
            "position",
            "placement",
            "sortsAt",
            "record"
          ],
          "additionalProperties": false
        }
      },
      "Invoice": {
        "type": "object",
        "properties": {
          "billId": {
            "type": "string"
          },
          "number": {
            "type": [
              "string",
              "null"
            ]
          },
          "date": {
            "type": "string",
            "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
          },
          "totalMinor": {
            "type": "string",
            "pattern": "^-?\\d+$"
          },
          "currency": {
            "type": "string",
            "pattern": "^[A-Z]{3}$"
          },
          "dueDate": {
            "type": "string",
            "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
          }
        },
        "required": [
          "billId",
          "number",
          "date",
          "totalMinor",
          "currency",
          "dueDate"
        ],
        "additionalProperties": false
      },
      "Job": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "ledgerId": {
            "type": "string"
          },
          "kind": {
            "type": "string",
            "x-extensible-enum": [
              "RECORD_IMPORT_READ",
              "RECORD_IMPORT_APPLY",
              "LIST_EXPORT",
              "AUDIT_PACKAGE",
              "YEAR_END_FILE",
              "PAYMENT_RUN_DISPATCH",
              "BULK_OPERATION",
              "UNDO_GROUP",
              "FULL_EXPORT",
              "WAREHOUSE_BACKFILL",
              "TEST_COPY",
              "WORKFLOW_RUN",
              "VENDOR_PRIVACY_PACK",
              "CAPITAL_LOOK_BACK",
              "VENDOR_PAPER_APPLY",
              "VENDOR_MERGE_APPROVAL",
              "SETTLEMENT_PROPOSE",
              "SALES_INVOICE_IMPORT",
              "WORKSPACE_INVITATIONS_SEND",
              "PROVIDER_TOKEN_REFRESH",
              "PROJECTION_REPLAY",
              "CHART_IMPORT_APPLY",
              "WORKSPACE_IMPORT_APPLY",
              "CSV_IMPORT",
              "CUSTOM_FIELD_INDEX",
              "PROMOTION_APPLY",
              "PERIOD_CLOSE"
            ],
            "description": "The values listed in `x-extensible-enum` are the ones known today. New values can appear without a new release, so handle an unknown one as you would an unexpected state, not as a failure to parse."
          },
          "state": {
            "type": "string",
            "enum": [
              "QUEUED",
              "RUNNING",
              "CANCELLING",
              "STALLED",
              "SUCCEEDED",
              "FAILED",
              "CANCELLED"
            ]
          },
          "done": {
            "type": "boolean"
          },
          "subject": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string"
                  },
                  "id": {
                    "type": "string"
                  },
                  "label": {
                    "type": "string"
                  }
                },
                "required": [
                  "type",
                  "id",
                  "label"
                ],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ]
          },
          "startedBy": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "name": {
                "type": "string"
              }
            },
            "required": [
              "id",
              "name"
            ],
            "additionalProperties": false
          },
          "app": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string"
                  },
                  "name": {
                    "type": "string"
                  }
                },
                "required": [
                  "id",
                  "name"
                ],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ]
          },
          "door": {
            "type": "string",
            "enum": [
              "web",
              "rest",
              "mcp"
            ]
          },
          "progress": {
            "type": "object",
            "properties": {
              "unit": {
                "type": "string",
                "enum": [
                  "rows",
                  "records",
                  "items",
                  "sections",
                  "payments",
                  "tables"
                ]
              },
              "done": {
                "type": "integer",
                "minimum": 0,
                "maximum": 9007199254740991
              },
              "failed": {
                "type": "integer",
                "minimum": 0,
                "maximum": 9007199254740991
              },
              "total": {
                "anyOf": [
                  {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 9007199254740991
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "percent": {
                "anyOf": [
                  {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 100
                  },
                  {
                    "type": "null"
                  }
                ]
              }
            },
            "required": [
              "unit",
              "done",
              "failed",
              "total",
              "percent"
            ],
            "additionalProperties": false
          },
          "queuedAt": {
            "type": "string",
            "minLength": 20
          },
          "startedAt": {
            "anyOf": [
              {
                "type": "string",
                "minLength": 20
              },
              {
                "type": "null"
              }
            ]
          },
          "finishedAt": {
            "anyOf": [
              {
                "type": "string",
                "minLength": 20
              },
              {
                "type": "null"
              }
            ]
          },
          "heartbeatAt": {
            "anyOf": [
              {
                "type": "string",
                "minLength": 20
              },
              {
                "type": "null"
              }
            ]
          },
          "queuePosition": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": 0,
                "maximum": 9007199254740991
              },
              {
                "type": "null"
              }
            ]
          },
          "cancel": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "requestedAt": {
                    "type": "string",
                    "minLength": 20
                  },
                  "requestedBy": {
                    "type": "object",
                    "properties": {
                      "id": {
                        "type": "string"
                      },
                      "name": {
                        "type": "string"
                      }
                    },
                    "required": [
                      "id",
                      "name"
                    ],
                    "additionalProperties": false
                  },
                  "reason": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "late": {
                    "type": "boolean"
                  }
                },
                "required": [
                  "requestedAt",
                  "requestedBy",
                  "reason",
                  "late"
                ],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ]
          },
          "error": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "code": {
                    "$ref": "#/components/schemas/Code"
                  },
                  "message": {
                    "type": "string"
                  },
                  "remedy": {
                    "type": "string"
                  },
                  "retryable": {
                    "type": "boolean"
                  }
                },
                "required": [
                  "code",
                  "message",
                  "remedy",
                  "retryable"
                ],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ]
          },
          "result": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "kind": {
                    "type": "string",
                    "x-extensible-enum": [
                      "RECORD_IMPORT_READ",
                      "RECORD_IMPORT_APPLY",
                      "LIST_EXPORT",
                      "AUDIT_PACKAGE",
                      "YEAR_END_FILE",
                      "PAYMENT_RUN_DISPATCH",
                      "BULK_OPERATION",
                      "UNDO_GROUP",
                      "FULL_EXPORT",
                      "WAREHOUSE_BACKFILL",
                      "TEST_COPY",
                      "WORKFLOW_RUN",
                      "VENDOR_PRIVACY_PACK",
                      "VENDOR_PAPER_APPLY",
                      "VENDOR_MERGE_APPROVAL",
                      "CAPITAL_LOOK_BACK",
                      "SETTLEMENT_PROPOSE",
                      "PROVIDER_TOKEN_REFRESH",
                      "WORKSPACE_INVITATIONS_SEND",
                      "PROJECTION_REPLAY",
                      "SALES_INVOICE_IMPORT",
                      "CHART_IMPORT_APPLY",
                      "WORKSPACE_IMPORT_APPLY",
                      "CSV_IMPORT",
                      "CUSTOM_FIELD_INDEX",
                      "PROMOTION_APPLY",
                      "PERIOD_CLOSE"
                    ],
                    "description": "Which kind of job this result is for. The values listed in `x-extensible-enum` are the ones known today. New values can appear without a new release, so handle an unknown one as you would an unexpected state, not as a failure to parse."
                  }
                },
                "required": [
                  "kind"
                ],
                "additionalProperties": true,
                "x-open-by-reference": true,
                "description": "What the job made: ids and counts. The fields depend on `kind`; `x-known-variants` lists the shapes known today. A kind added later is not a change to this contract.",
                "x-known-variants": [
                  {
                    "type": "object",
                    "properties": {
                      "kind": {
                        "type": "string",
                        "const": "RECORD_IMPORT_READ"
                      },
                      "batchId": {
                        "type": "string"
                      },
                      "rowsRead": {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 9007199254740991
                      }
                    },
                    "required": [
                      "kind",
                      "batchId",
                      "rowsRead"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "kind": {
                        "type": "string",
                        "const": "RECORD_IMPORT_APPLY"
                      },
                      "importId": {
                        "type": "string"
                      },
                      "applied": {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 9007199254740991
                      },
                      "refused": {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 9007199254740991
                      }
                    },
                    "required": [
                      "kind",
                      "importId",
                      "applied",
                      "refused"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "kind": {
                        "type": "string",
                        "const": "LIST_EXPORT"
                      },
                      "exportId": {
                        "type": "string"
                      },
                      "rows": {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 9007199254740991
                      }
                    },
                    "required": [
                      "kind",
                      "exportId",
                      "rows"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "kind": {
                        "type": "string",
                        "const": "AUDIT_PACKAGE"
                      },
                      "packageId": {
                        "type": "string"
                      },
                      "records": {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 9007199254740991
                      }
                    },
                    "required": [
                      "kind",
                      "packageId",
                      "records"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "kind": {
                        "type": "string",
                        "const": "YEAR_END_FILE"
                      },
                      "yearEndFileId": {
                        "type": "string"
                      },
                      "sections": {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 9007199254740991
                      }
                    },
                    "required": [
                      "kind",
                      "yearEndFileId",
                      "sections"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "kind": {
                        "type": "string",
                        "const": "PAYMENT_RUN_DISPATCH"
                      },
                      "paymentRunId": {
                        "type": "string"
                      },
                      "submitted": {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 9007199254740991
                      },
                      "failed": {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 9007199254740991
                      }
                    },
                    "required": [
                      "kind",
                      "paymentRunId",
                      "submitted",
                      "failed"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "kind": {
                        "type": "string",
                        "const": "BULK_OPERATION"
                      },
                      "operation": {
                        "type": "string"
                      },
                      "succeeded": {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 9007199254740991
                      },
                      "failed": {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 9007199254740991
                      },
                      "skipped": {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 9007199254740991
                      }
                    },
                    "required": [
                      "kind",
                      "operation",
                      "succeeded",
                      "failed",
                      "skipped"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "kind": {
                        "type": "string",
                        "const": "UNDO_GROUP"
                      },
                      "undoGroupId": {
                        "type": "string"
                      },
                      "direction": {
                        "type": "string",
                        "enum": [
                          "undo",
                          "redo"
                        ]
                      },
                      "groupState": {
                        "type": "string",
                        "enum": [
                          "IN_PLACE",
                          "UNDONE",
                          "PARTLY_UNDONE",
                          "UNDO_PROPOSED"
                        ]
                      },
                      "undone": {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 9007199254740991
                      },
                      "refused": {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 9007199254740991
                      },
                      "staying": {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 9007199254740991
                      },
                      "notUndone": {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 9007199254740991
                      },
                      "refusals": {
                        "maxItems": 20,
                        "type": "array",
                        "items": {
                          "type": "object",
                          "properties": {
                            "code": {
                              "$ref": "#/components/schemas/Code"
                            },
                            "message": {
                              "type": "string"
                            },
                            "remedy": {
                              "type": "string"
                            },
                            "ordinal": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 9007199254740991
                            },
                            "operation": {
                              "type": "string"
                            },
                            "recordId": {
                              "type": [
                                "string",
                                "null"
                              ]
                            }
                          },
                          "required": [
                            "code",
                            "message",
                            "remedy",
                            "ordinal",
                            "operation",
                            "recordId"
                          ],
                          "additionalProperties": false
                        }
                      }
                    },
                    "required": [
                      "kind",
                      "undoGroupId",
                      "direction",
                      "groupState",
                      "undone",
                      "refused",
                      "staying",
                      "notUndone",
                      "refusals"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "kind": {
                        "type": "string",
                        "const": "FULL_EXPORT"
                      },
                      "requestId": {
                        "type": "string"
                      },
                      "tables": {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 9007199254740991
                      }
                    },
                    "required": [
                      "kind",
                      "requestId",
                      "tables"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "kind": {
                        "type": "string",
                        "const": "WAREHOUSE_BACKFILL"
                      },
                      "destinationId": {
                        "type": "string"
                      },
                      "tables": {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 9007199254740991
                      },
                      "rows": {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 9007199254740991
                      }
                    },
                    "required": [
                      "kind",
                      "destinationId",
                      "tables",
                      "rows"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "kind": {
                        "type": "string",
                        "const": "TEST_COPY"
                      },
                      "testCopyId": {
                        "type": "string"
                      },
                      "tables": {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 9007199254740991
                      }
                    },
                    "required": [
                      "kind",
                      "testCopyId",
                      "tables"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "kind": {
                        "type": "string",
                        "const": "WORKFLOW_RUN"
                      },
                      "workflowRunId": {
                        "type": "string"
                      },
                      "stepsDone": {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 9007199254740991
                      }
                    },
                    "required": [
                      "kind",
                      "workflowRunId",
                      "stepsDone"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "kind": {
                        "type": "string",
                        "const": "VENDOR_PRIVACY_PACK"
                      },
                      "requestId": {
                        "type": "string"
                      },
                      "sections": {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 9007199254740991
                      }
                    },
                    "required": [
                      "kind",
                      "requestId",
                      "sections"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "kind": {
                        "type": "string",
                        "const": "VENDOR_PAPER_APPLY"
                      },
                      "changed": {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 9007199254740991
                      }
                    },
                    "required": [
                      "kind",
                      "changed"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "kind": {
                        "type": "string",
                        "const": "VENDOR_MERGE_APPROVAL"
                      },
                      "mergeId": {
                        "type": "string"
                      },
                      "billsMoved": {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 9007199254740991
                      }
                    },
                    "required": [
                      "kind",
                      "mergeId",
                      "billsMoved"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "examined": {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 9007199254740991
                      },
                      "raised": {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 9007199254740991
                      },
                      "alreadyRaised": {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 9007199254740991
                      },
                      "cleared": {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 9007199254740991
                      },
                      "belowFloor": {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 9007199254740991
                      },
                      "notCapital": {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 9007199254740991
                      },
                      "noRate": {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 9007199254740991
                      },
                      "kind": {
                        "type": "string",
                        "const": "CAPITAL_LOOK_BACK"
                      },
                      "entityId": {
                        "type": "string"
                      }
                    },
                    "required": [
                      "examined",
                      "raised",
                      "alreadyRaised",
                      "cleared",
                      "belowFloor",
                      "notCapital",
                      "noRate",
                      "kind",
                      "entityId"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "kind": {
                        "type": "string",
                        "const": "SETTLEMENT_PROPOSE"
                      },
                      "settlementId": {
                        "type": "string"
                      },
                      "proposed": {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 9007199254740991
                      },
                      "alreadyProposed": {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 9007199254740991
                      },
                      "taxMinor": {
                        "type": "string",
                        "pattern": "^-?\\d+$"
                      }
                    },
                    "required": [
                      "kind",
                      "settlementId",
                      "proposed",
                      "alreadyProposed",
                      "taxMinor"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "kind": {
                        "type": "string",
                        "const": "PROVIDER_TOKEN_REFRESH"
                      },
                      "connectionId": {
                        "type": "string"
                      },
                      "provider": {
                        "type": "string",
                        "enum": [
                          "QBO",
                          "XERO"
                        ]
                      },
                      "outcome": {
                        "type": "string",
                        "enum": [
                          "REFRESHED",
                          "ALREADY_FRESH"
                        ]
                      }
                    },
                    "required": [
                      "kind",
                      "connectionId",
                      "provider",
                      "outcome"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "kind": {
                        "type": "string",
                        "const": "WORKSPACE_INVITATIONS_SEND"
                      },
                      "importId": {
                        "type": "string"
                      },
                      "sent": {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 9007199254740991
                      },
                      "refused": {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 9007199254740991
                      },
                      "notConfigured": {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 9007199254740991
                      },
                      "queued": {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 9007199254740991
                      },
                      "throttled": {
                        "type": "boolean"
                      },
                      "resumesAt": {
                        "type": [
                          "string",
                          "null"
                        ]
                      }
                    },
                    "required": [
                      "kind",
                      "importId",
                      "sent",
                      "refused",
                      "notConfigured",
                      "queued",
                      "throttled",
                      "resumesAt"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "kind": {
                        "type": "string",
                        "const": "PROJECTION_REPLAY"
                      },
                      "projection": {
                        "type": "string",
                        "enum": [
                          "entity-summary",
                          "document-index",
                          "webhooks",
                          "workflow-trigger"
                        ]
                      },
                      "appliedFrom": {
                        "type": "string"
                      },
                      "appliedThrough": {
                        "type": "string"
                      },
                      "applied": {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 9007199254740991
                      }
                    },
                    "required": [
                      "kind",
                      "projection",
                      "appliedFrom",
                      "appliedThrough",
                      "applied"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "kind": {
                        "type": "string",
                        "const": "SALES_INVOICE_IMPORT"
                      },
                      "entityId": {
                        "type": "string"
                      },
                      "imported": {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 9007199254740991
                      },
                      "refused": {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 9007199254740991
                      },
                      "customersCreated": {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 9007199254740991
                      },
                      "refusals": {
                        "maxItems": 25,
                        "type": "array",
                        "items": {
                          "type": "object",
                          "properties": {
                            "row": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 9007199254740991
                            },
                            "number": {
                              "type": "string"
                            },
                            "reason": {
                              "type": "string"
                            },
                            "tax": {
                              "anyOf": [
                                {
                                  "type": "object",
                                  "properties": {
                                    "chargedMinor": {
                                      "type": "string"
                                    },
                                    "determinedMinor": {
                                      "type": "string"
                                    }
                                  },
                                  "required": [
                                    "chargedMinor",
                                    "determinedMinor"
                                  ],
                                  "additionalProperties": false
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            }
                          },
                          "required": [
                            "row",
                            "number",
                            "reason",
                            "tax"
                          ],
                          "additionalProperties": false
                        }
                      }
                    },
                    "required": [
                      "kind",
                      "entityId",
                      "imported",
                      "refused",
                      "customersCreated",
                      "refusals"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "kind": {
                        "type": "string",
                        "const": "CHART_IMPORT_APPLY"
                      },
                      "importId": {
                        "type": "string"
                      },
                      "accountsCreated": {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 9007199254740991
                      },
                      "dimensionValuesCreated": {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 9007199254740991
                      },
                      "dimensionPoliciesCreated": {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 9007199254740991
                      },
                      "dimensionTypeCode": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "declinedGroupCount": {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 9007199254740991
                      },
                      "accountsWithoutGifiCount": {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 9007199254740991
                      }
                    },
                    "required": [
                      "kind",
                      "importId",
                      "accountsCreated",
                      "dimensionValuesCreated",
                      "dimensionPoliciesCreated",
                      "dimensionTypeCode",
                      "declinedGroupCount",
                      "accountsWithoutGifiCount"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "kind": {
                        "type": "string",
                        "const": "WORKSPACE_IMPORT_APPLY"
                      },
                      "importId": {
                        "type": "string"
                      },
                      "applied": {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 9007199254740991
                      },
                      "refused": {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 9007199254740991
                      },
                      "sendJobId": {
                        "type": [
                          "string",
                          "null"
                        ]
                      }
                    },
                    "required": [
                      "kind",
                      "importId",
                      "applied",
                      "refused",
                      "sendJobId"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "kind": {
                        "type": "string",
                        "const": "CSV_IMPORT"
                      },
                      "connectionId": {
                        "type": "string"
                      },
                      "syncRunId": {
                        "type": "string"
                      },
                      "inserted": {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 9007199254740991
                      },
                      "duplicates": {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 9007199254740991
                      },
                      "total": {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 9007199254740991
                      },
                      "evidenceKey": {
                        "type": "string"
                      }
                    },
                    "required": [
                      "kind",
                      "connectionId",
                      "syncRunId",
                      "inserted",
                      "duplicates",
                      "total",
                      "evidenceKey"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "kind": {
                        "type": "string",
                        "const": "CUSTOM_FIELD_INDEX"
                      },
                      "definitionId": {
                        "type": "string"
                      },
                      "recordsIndexed": {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 9007199254740991
                      }
                    },
                    "required": [
                      "kind",
                      "definitionId",
                      "recordsIndexed"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "kind": {
                        "type": "string",
                        "const": "PROMOTION_APPLY"
                      },
                      "promotionId": {
                        "type": "string"
                      },
                      "changesApplied": {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 9007199254740991
                      },
                      "indexJobsStarted": {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 9007199254740991
                      }
                    },
                    "required": [
                      "kind",
                      "promotionId",
                      "changesApplied",
                      "indexJobsStarted"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "kind": {
                        "type": "string",
                        "const": "PERIOD_CLOSE"
                      },
                      "closePeriodId": {
                        "type": "string"
                      },
                      "periodYear": {
                        "type": "integer",
                        "minimum": -9007199254740991,
                        "maximum": 9007199254740991
                      },
                      "periodMonth": {
                        "type": "integer",
                        "minimum": 1,
                        "maximum": 12
                      },
                      "lockId": {
                        "type": "string"
                      }
                    },
                    "required": [
                      "kind",
                      "closePeriodId",
                      "periodYear",
                      "periodMonth",
                      "lockId"
                    ],
                    "additionalProperties": false
                  }
                ]
              },
              {
                "type": "null"
              }
            ]
          },
          "undoGroupId": {
            "type": [
              "string",
              "null"
            ]
          },
          "traceId": {
            "type": "string",
            "pattern": "^[0-9a-f]{32}$"
          },
          "may": {
            "type": "object",
            "properties": {
              "cancel": {
                "type": "boolean"
              },
              "resume": {
                "type": "boolean"
              }
            },
            "required": [
              "cancel",
              "resume"
            ],
            "additionalProperties": false
          }
        },
        "required": [
          "id",
          "ledgerId",
          "kind",
          "state",
          "done",
          "subject",
          "startedBy",
          "app",
          "door",
          "progress",
          "queuedAt",
          "startedAt",
          "finishedAt",
          "heartbeatAt",
          "queuePosition",
          "cancel",
          "error",
          "result",
          "undoGroupId",
          "traceId",
          "may"
        ],
        "additionalProperties": false
      },
      "Job2": {
        "anyOf": [
          {
            "$ref": "#/components/schemas/Job"
          },
          {
            "type": "null"
          }
        ]
      },
      "Keys": {
        "maxItems": 6,
        "type": "array",
        "items": {
          "$ref": "#/components/schemas/KeysItem"
        }
      },
      "KeysItem": {
        "type": "string",
        "enum": [
          "BILL_RECEIVED",
          "BILL_STATE",
          "BILL_AMOUNTS",
          "BILL_HELD_TOLD",
          "BILL_DECLINED_TOLD",
          "PAYMENT_PAID",
          "PAYMENT_APPLIED",
          "PAYMENT_DEDUCTIONS",
          "SHORT_PAY_REASON",
          "ADVICE_SENT",
          "CREDIT_STATUS"
        ]
      },
      "Kind3": {
        "type": "string",
        "enum": [
          "HOLDER_NAME_MISMATCH",
          "NO_EVIDENCE",
          "NEW_SENDER_DOMAIN",
          "FIRST_TIME_SENDER_DOMAIN",
          "CHANGE_BEFORE_A_LARGE_BILL",
          "SHORT_INTERVAL",
          "SHARED_ACCOUNT",
          "PRINTED_ACCOUNT_DIFFERS"
        ]
      },
      "Kind4": {
        "type": "string",
        "enum": [
          "DUPLICATE_BILL",
          "HOLDER_NAME_MISMATCH",
          "NO_EVIDENCE",
          "NEW_SENDER_DOMAIN",
          "FIRST_TIME_SENDER_DOMAIN",
          "CHANGE_BEFORE_A_LARGE_BILL",
          "SHORT_INTERVAL",
          "SHARED_ACCOUNT",
          "PRINTED_ACCOUNT_DIFFERS",
          "DOCUMENT_EXPIRING",
          "AGREEMENT_RENEWING",
          "SLIP_IDENTITY_INCOMPLETE",
          "SLIP_KIND_QUESTIONED",
          "EXPECTED_BILL_MISSING",
          "RECURRING_AMOUNT_MOVED",
          "TAX_TREATMENT_DRIFT",
          "PRICE_CREEP",
          "CAPITAL_PURCHASE"
        ]
      },
      "Kind5": {
        "type": "string",
        "enum": [
          "RECEIVED",
          "COULD_NOT_READ",
          "REFUSED",
          "QUARANTINED",
          "DIGEST",
          "HANDOFF",
          "REMITTANCE_ADVICE",
          "REMITTANCE_REVERSAL",
          "BILL_APPROVED",
          "BILL_HELD",
          "BILL_DECLINED",
          "CORRECTION_ASKED",
          "ADDRESS_CLOSING",
          "BANKING_CHANGED",
          "DOCUMENT_REQUESTED",
          "NON_RENEWAL_NOTICE",
          "SLIP_COPY",
          "SLIP_IDENTITY_ASK",
          "HELD",
          "PURCHASE_ORDER",
          "PURCHASE_ORDER_CANCELLED",
          "PORTAL_INVITATION",
          "QUERY_ANSWER",
          "QUERY_ASKED",
          "STATEMENT_QUERY",
          "ACCOUNT_STATEMENT",
          "PORTAL_DECISION"
        ]
      },
      "LastReplayOption1": {
        "type": "object",
        "properties": {
          "at": {
            "type": "string",
            "minLength": 20
          },
          "by": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "name": {
                "type": "string"
              }
            },
            "required": [
              "id",
              "name"
            ],
            "additionalProperties": false
          }
        },
        "required": [
          "at",
          "by"
        ],
        "additionalProperties": false
      },
      "LastSent": {
        "anyOf": [
          {
            "type": "object",
            "properties": {
              "on": {
                "type": "string",
                "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
              },
              "byName": {
                "type": "string"
              },
              "recipientEmail": {
                "type": "string"
              }
            },
            "required": [
              "on",
              "byName",
              "recipientEmail"
            ],
            "additionalProperties": false
          },
          {
            "type": "null"
          }
        ]
      },
      "Later": {
        "type": "array",
        "items": {
          "type": "object",
          "properties": {
            "entityId": {
              "type": "string"
            },
            "currency": {
              "type": "string",
              "pattern": "^[A-Z]{3}$"
            },
            "bills": {
              "type": "integer",
              "minimum": 0,
              "maximum": 9007199254740991
            },
            "openMinor": {
              "type": "string",
              "pattern": "^-?\\d+$"
            },
            "firstOn": {
              "anyOf": [
                {
                  "type": "string",
                  "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                },
                {
                  "type": "null"
                }
              ]
            },
            "lastOn": {
              "anyOf": [
                {
                  "type": "string",
                  "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                },
                {
                  "type": "null"
                }
              ]
            }
          },
          "required": [
            "entityId",
            "currency",
            "bills",
            "openMinor",
            "firstOn",
            "lastOn"
          ],
          "additionalProperties": false
        }
      },
      "LatestFile": {
        "anyOf": [
          {
            "$ref": "#/components/schemas/LatestFileOption1"
          },
          {
            "type": "null"
          }
        ]
      },
      "LatestFileOption1": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "fileName": {
            "type": "string"
          },
          "producedAt": {
            "type": "string",
            "minLength": 20
          }
        },
        "required": [
          "id",
          "fileName",
          "producedAt"
        ],
        "additionalProperties": false
      },
      "LineOption1": {
        "type": "object",
        "properties": {
          "position": {
            "type": "integer",
            "minimum": 1,
            "maximum": 9007199254740991
          },
          "lineId": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "quantity": {
            "type": "string"
          },
          "account": {
            "$ref": "#/components/schemas/Account3"
          },
          "currency": {
            "type": "string",
            "pattern": "^[A-Z]{3}$"
          },
          "netMinor": {
            "type": "string",
            "pattern": "^-?\\d+$"
          },
          "costMinor": {
            "anyOf": [
              {
                "type": "string",
                "pattern": "^-?\\d+$"
              },
              {
                "type": "null"
              }
            ]
          },
          "perUnitCostMinor": {
            "anyOf": [
              {
                "type": "string",
                "pattern": "^-?\\d+$"
              },
              {
                "type": "null"
              }
            ]
          },
          "state": {
            "type": "string",
            "enum": [
              "FLAGGED",
              "REGISTERED",
              "PARTLY_REGISTERED",
              "SET_ASIDE",
              "CLEARED_EARLIER",
              "BELOW_FLOOR",
              "NOT_DEPRECIABLE",
              "NO_RATE",
              "CLOSED"
            ]
          },
          "signal": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string"
                  },
                  "state": {
                    "type": "string",
                    "enum": [
                      "OPEN",
                      "DISMISSED",
                      "CONFIRMED"
                    ]
                  },
                  "observedAt": {
                    "type": "string",
                    "minLength": 20
                  },
                  "decision": {
                    "$ref": "#/components/schemas/Decision2"
                  },
                  "closedBy": {
                    "anyOf": [
                      {
                        "type": "string",
                        "enum": [
                          "BILL_VOIDED",
                          "LINE_CHANGED"
                        ]
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                },
                "required": [
                  "id",
                  "state",
                  "observedAt",
                  "decision",
                  "closedBy"
                ],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ]
          },
          "clearedBy": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "signalId": {
                    "type": "string"
                  },
                  "byName": {
                    "type": "string"
                  },
                  "at": {
                    "type": "string",
                    "minLength": 20
                  },
                  "reason": {
                    "type": "string"
                  }
                },
                "required": [
                  "signalId",
                  "byName",
                  "at",
                  "reason"
                ],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ]
          },
          "reading": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "state": {
                    "type": "string",
                    "enum": [
                      "OFF",
                      "WAITING",
                      "STOPPED",
                      "READ",
                      "NOTHING_STATED",
                      "FAILED",
                      "NOT_ASKED"
                    ]
                  },
                  "outcome": {
                    "anyOf": [
                      {
                        "type": "string",
                        "enum": [
                          "READ",
                          "NOTHING_STATED",
                          "UNSANE",
                          "UNPARSABLE",
                          "REFUSED",
                          "DISCLOSURE",
                          "BUDGET",
                          "PROVIDER",
                          "STOPPED_AFTER_DECLINES"
                        ]
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "id": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "ccaClass": {
                    "anyOf": [
                      {
                        "type": "string",
                        "enum": [
                          "1",
                          "3",
                          "6",
                          "8",
                          "10",
                          "12",
                          "16",
                          "43",
                          "44",
                          "46",
                          "50",
                          "53",
                          "54",
                          "55",
                          "56",
                          "10.1",
                          "14.1",
                          "43.1",
                          "43.2"
                        ]
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "inServiceOn": {
                    "anyOf": [
                      {
                        "type": "string",
                        "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "promptVersion": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "readAt": {
                    "anyOf": [
                      {
                        "type": "string",
                        "minLength": 20
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "attempts": {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 3
                  },
                  "mayReadAgain": {
                    "type": "boolean"
                  }
                },
                "required": [
                  "state",
                  "outcome",
                  "id",
                  "ccaClass",
                  "inServiceOn",
                  "promptVersion",
                  "readAt",
                  "attempts",
                  "mayReadAgain"
                ],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ]
          },
          "assets": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string"
                },
                "name": {
                  "type": "string"
                },
                "costMinor": {
                  "type": "string",
                  "pattern": "^-?\\d+$"
                },
                "ccaClass": {
                  "anyOf": [
                    {
                      "type": "string",
                      "enum": [
                        "1",
                        "3",
                        "6",
                        "8",
                        "10",
                        "12",
                        "16",
                        "43",
                        "44",
                        "46",
                        "50",
                        "53",
                        "54",
                        "55",
                        "56",
                        "10.1",
                        "14.1",
                        "43.1",
                        "43.2"
                      ]
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "status": {
                  "type": "string",
                  "enum": [
                    "ACTIVE",
                    "DISPOSED",
                    "FULLY_DEPRECIATED"
                  ]
                },
                "createdAt": {
                  "type": "string",
                  "minLength": 20
                }
              },
              "required": [
                "id",
                "name",
                "costMinor",
                "ccaClass",
                "status",
                "createdAt"
              ],
              "additionalProperties": false
            }
          },
          "registeredMinor": {
            "type": "string",
            "pattern": "^-?\\d+$"
          },
          "remainingMinor": {
            "anyOf": [
              {
                "type": "string",
                "pattern": "^-?\\d+$"
              },
              {
                "type": "null"
              }
            ]
          },
          "prefill": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "entity": {
                    "type": "object",
                    "properties": {
                      "id": {
                        "type": "string"
                      },
                      "name": {
                        "type": "string"
                      },
                      "country": {
                        "type": "string",
                        "minLength": 2,
                        "maxLength": 2
                      },
                      "functionalCurrency": {
                        "type": "string",
                        "pattern": "^[A-Z]{3}$"
                      },
                      "timeZone": {
                        "type": "string"
                      },
                      "region": {
                        "type": [
                          "string",
                          "null"
                        ]
                      }
                    },
                    "required": [
                      "id",
                      "name",
                      "country",
                      "functionalCurrency",
                      "timeZone",
                      "region"
                    ],
                    "additionalProperties": false
                  },
                  "name": {
                    "type": "string",
                    "maxLength": 200
                  },
                  "description": {
                    "type": "string",
                    "maxLength": 1000
                  },
                  "acquiredOn": {
                    "type": "string",
                    "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                  },
                  "inServiceOn": {
                    "type": "string",
                    "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                  },
                  "costMinor": {
                    "type": "string",
                    "pattern": "^-?\\d+$"
                  },
                  "remainingMinor": {
                    "type": "string",
                    "pattern": "^-?\\d+$"
                  },
                  "ccaClass": {
                    "anyOf": [
                      {
                        "type": "string",
                        "enum": [
                          "1",
                          "3",
                          "6",
                          "8",
                          "10",
                          "12",
                          "16",
                          "43",
                          "44",
                          "46",
                          "50",
                          "53",
                          "54",
                          "55",
                          "56",
                          "10.1",
                          "14.1",
                          "43.1",
                          "43.2"
                        ]
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "ccaClassBasis": {
                    "type": "string",
                    "enum": [
                      "ACCOUNT_TABLE",
                      "READING",
                      "NONE"
                    ]
                  },
                  "ccaClassFacts": {
                    "anyOf": [
                      {
                        "type": "object",
                        "properties": {
                          "ccaClass": {
                            "type": "string",
                            "enum": [
                              "1",
                              "3",
                              "6",
                              "8",
                              "10",
                              "12",
                              "16",
                              "43",
                              "44",
                              "46",
                              "50",
                              "53",
                              "54",
                              "55",
                              "56",
                              "10.1",
                              "14.1",
                              "43.1",
                              "43.2"
                            ]
                          },
                          "description": {
                            "type": "string"
                          },
                          "rateE5": {
                            "type": "string",
                            "pattern": "^\\d+$"
                          }
                        },
                        "required": [
                          "ccaClass",
                          "description",
                          "rateE5"
                        ],
                        "additionalProperties": false
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "menu": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "enum": [
                        "1",
                        "3",
                        "6",
                        "8",
                        "10",
                        "12",
                        "16",
                        "43",
                        "44",
                        "46",
                        "50",
                        "53",
                        "54",
                        "55",
                        "56",
                        "10.1",
                        "14.1",
                        "43.1",
                        "43.2"
                      ]
                    }
                  },
                  "vehicle": {
                    "type": "boolean"
                  },
                  "inServiceBasis": {
                    "type": "string",
                    "enum": [
                      "BILL_DATE",
                      "READING"
                    ]
                  },
                  "method": {
                    "anyOf": [
                      {
                        "type": "string",
                        "enum": [
                          "STRAIGHT_LINE",
                          "DECLINING_BALANCE"
                        ]
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "usefulLifeMonths": {
                    "anyOf": [
                      {
                        "type": "integer",
                        "minimum": -9007199254740991,
                        "maximum": 9007199254740991
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "decliningRatePct": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "assetAccount": {
                    "$ref": "#/components/schemas/Account3"
                  },
                  "accumulatedAccount": {
                    "$ref": "#/components/schemas/AccumulatedAccount"
                  },
                  "expenseAccount": {
                    "$ref": "#/components/schemas/AccumulatedAccount"
                  },
                  "basedOnAssetId": {
                    "type": [
                      "string",
                      "null"
                    ]
                  }
                },
                "required": [
                  "entity",
                  "name",
                  "description",
                  "acquiredOn",
                  "inServiceOn",
                  "costMinor",
                  "remainingMinor",
                  "ccaClass",
                  "ccaClassBasis",
                  "ccaClassFacts",
                  "menu",
                  "vehicle",
                  "inServiceBasis",
                  "method",
                  "usefulLifeMonths",
                  "decliningRatePct",
                  "assetAccount",
                  "accumulatedAccount",
                  "expenseAccount",
                  "basedOnAssetId"
                ],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ]
          },
          "blocked": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "code": {
                    "type": "string"
                  },
                  "sentence": {
                    "type": "string"
                  }
                },
                "required": [
                  "code",
                  "sentence"
                ],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ]
          },
          "basisDigest": {
            "type": "string",
            "minLength": 32,
            "maxLength": 32
          }
        },
        "required": [
          "position",
          "lineId",
          "description",
          "quantity",
          "account",
          "currency",
          "netMinor",
          "costMinor",
          "perUnitCostMinor",
          "state",
          "signal",
          "clearedBy",
          "reading",
          "assets",
          "registeredMinor",
          "remainingMinor",
          "prefill",
          "blocked",
          "basisDigest"
        ],
        "additionalProperties": false
      },
      "Lines": {
        "type": "array",
        "items": {
          "type": "object",
          "properties": {
            "billId": {
              "type": "string"
            },
            "billNumber": {
              "type": [
                "string",
                "null"
              ]
            },
            "billDate": {
              "type": "string",
              "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
            },
            "billTotalMinor": {
              "type": "string",
              "pattern": "^-?\\d+$"
            },
            "appliedMinor": {
              "type": "string",
              "pattern": "^-?\\d+$"
            },
            "deductions": {
              "type": "array",
              "items": {
                "type": "object",
                "properties": {
                  "kind": {
                    "type": "string",
                    "enum": [
                      "CREDIT",
                      "DISCOUNT",
                      "WITHHOLDING"
                    ]
                  },
                  "amountMinor": {
                    "type": "string",
                    "pattern": "^-?\\d+$"
                  },
                  "reason": {
                    "type": "string"
                  },
                  "sourceLabel": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "discount": {
                    "anyOf": [
                      {
                        "type": "object",
                        "properties": {
                          "bp": {
                            "type": "integer",
                            "minimum": -9007199254740991,
                            "maximum": 9007199254740991
                          },
                          "days": {
                            "type": "integer",
                            "minimum": -9007199254740991,
                            "maximum": 9007199254740991
                          },
                          "discountDate": {
                            "type": "string",
                            "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                          }
                        },
                        "required": [
                          "bp",
                          "days",
                          "discountDate"
                        ],
                        "additionalProperties": false
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                },
                "required": [
                  "kind",
                  "amountMinor",
                  "reason",
                  "sourceLabel",
                  "discount"
                ],
                "additionalProperties": false
              }
            },
            "paidMinor": {
              "type": "string",
              "pattern": "^-?\\d+$"
            },
            "leftOpenMinor": {
              "type": "string",
              "pattern": "^-?\\d+$"
            },
            "shortReason": {
              "type": [
                "string",
                "null"
              ]
            }
          },
          "required": [
            "billId",
            "billNumber",
            "billDate",
            "billTotalMinor",
            "appliedMinor",
            "deductions",
            "paidMinor",
            "leftOpenMinor",
            "shortReason"
          ],
          "additionalProperties": false
        }
      },
      "Lines2": {
        "type": "array",
        "items": {
          "type": "object",
          "properties": {
            "kind": {
              "type": "string",
              "enum": [
                "ADDED",
                "REMOVED",
                "CHANGED"
              ]
            },
            "position": {
              "type": "integer",
              "minimum": 0,
              "maximum": 9007199254740991
            },
            "description": {
              "type": "string"
            },
            "cells": {
              "$ref": "#/components/schemas/Head"
            },
            "netBeforeMinor": {
              "anyOf": [
                {
                  "type": "string",
                  "pattern": "^-?\\d+$"
                },
                {
                  "type": "null"
                }
              ]
            },
            "netAfterMinor": {
              "anyOf": [
                {
                  "type": "string",
                  "pattern": "^-?\\d+$"
                },
                {
                  "type": "null"
                }
              ]
            }
          },
          "required": [
            "kind",
            "position",
            "description",
            "cells",
            "netBeforeMinor",
            "netAfterMinor"
          ],
          "additionalProperties": false
        }
      },
      "Lines3": {
        "minItems": 1,
        "maxItems": 100,
        "type": "array",
        "items": {
          "type": "object",
          "properties": {
            "description": {
              "type": "string",
              "minLength": 1,
              "maxLength": 500
            },
            "accountId": {
              "anyOf": [
                {
                  "type": "string",
                  "minLength": 1
                },
                {
                  "type": "null"
                }
              ]
            },
            "quantity": {
              "default": "1",
              "type": "string",
              "pattern": "^\\d{1,10}(\\.\\d{1,4})?$"
            },
            "unitPriceMinor": {
              "type": "string",
              "pattern": "^-?\\d+$"
            },
            "netMinor": {
              "type": "string",
              "pattern": "^-?\\d+$"
            },
            "taxAsPrintedMinor": {
              "anyOf": [
                {
                  "type": "string",
                  "pattern": "^-?\\d+$"
                },
                {
                  "type": "null"
                }
              ]
            },
            "supplyCategory": {
              "type": "string",
              "enum": [
                "GOODS",
                "SERVICES",
                "INTANGIBLE_PROPERTY",
                "REAL_PROPERTY"
              ]
            },
            "itcKind": {
              "type": "string",
              "enum": [
                "GENERAL",
                "MEALS_ENTERTAINMENT",
                "PASSENGER_VEHICLE",
                "ZERO_EMISSION_VEHICLE",
                "EXEMPT_ACTIVITY",
                "NONE"
              ]
            },
            "dimensions": {
              "$ref": "#/components/schemas/Dimensions2"
            },
            "servicePeriodStart": {
              "type": "string",
              "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
            },
            "servicePeriodEnd": {
              "type": "string",
              "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
            },
            "purchaseOrderLineId": {
              "anyOf": [
                {
                  "type": "string",
                  "minLength": 1
                },
                {
                  "type": "null"
                }
              ]
            },
            "customFields": {
              "$ref": "#/components/schemas/CustomFields5"
            }
          },
          "required": [
            "description",
            "supplyCategory",
            "itcKind"
          ],
          "additionalProperties": false
        }
      },
      "Lines4": {
        "type": "array",
        "items": {
          "type": "object",
          "properties": {
            "position": {
              "type": "integer",
              "minimum": 0,
              "maximum": 9007199254740991
            },
            "description": {
              "type": "string"
            },
            "account": {
              "$ref": "#/components/schemas/Account"
            },
            "quantity": {
              "type": "string"
            },
            "unitPriceMinor": {
              "anyOf": [
                {
                  "type": "string",
                  "pattern": "^-?\\d+$"
                },
                {
                  "type": "null"
                }
              ]
            },
            "netMinor": {
              "type": "string",
              "pattern": "^-?\\d+$"
            },
            "taxAsPrintedMinor": {
              "anyOf": [
                {
                  "type": "string",
                  "pattern": "^-?\\d+$"
                },
                {
                  "type": "null"
                }
              ]
            },
            "supplyCategory": {
              "type": "string",
              "enum": [
                "GOODS",
                "SERVICES",
                "INTANGIBLE_PROPERTY",
                "REAL_PROPERTY"
              ]
            },
            "itcKind": {
              "type": "string",
              "enum": [
                "GENERAL",
                "MEALS_ENTERTAINMENT",
                "PASSENGER_VEHICLE",
                "ZERO_EMISSION_VEHICLE",
                "EXEMPT_ACTIVITY",
                "NONE"
              ]
            },
            "commercialUsePct": {
              "type": [
                "string",
                "null"
              ]
            },
            "provincialServiceKind": {
              "default": null,
              "anyOf": [
                {
                  "type": "string",
                  "enum": [
                    "ACCOUNTING",
                    "ARCHITECTURAL_OR_ENGINEERING",
                    "SECURITY",
                    "NON_RESIDENTIAL_REAL_ESTATE",
                    "ADVERTISING",
                    "ACCOMMODATION"
                  ]
                },
                {
                  "type": "null"
                }
              ]
            },
            "provincialBase": {
              "default": null,
              "anyOf": [
                {
                  "type": "string",
                  "enum": [
                    "IN_BASE",
                    "OUTSIDE_BASE"
                  ]
                },
                {
                  "type": "null"
                }
              ]
            },
            "provincialExemption": {
              "default": null,
              "anyOf": [
                {
                  "type": "string",
                  "enum": [
                    "RESALE"
                  ]
                },
                {
                  "type": "null"
                }
              ]
            },
            "propertyRegion": {
              "default": null,
              "anyOf": [
                {
                  "type": "string",
                  "enum": [
                    "CA-AB",
                    "CA-BC",
                    "CA-MB",
                    "CA-NB",
                    "CA-NL",
                    "CA-NS",
                    "CA-NT",
                    "CA-NU",
                    "CA-ON",
                    "CA-PE",
                    "CA-QC",
                    "CA-SK",
                    "CA-YT"
                  ]
                },
                {
                  "type": "null"
                }
              ]
            },
            "dimensions": {
              "$ref": "#/components/schemas/Dimensions3"
            },
            "servicePeriodStart": {
              "anyOf": [
                {
                  "type": "string",
                  "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                },
                {
                  "type": "null"
                }
              ]
            },
            "servicePeriodEnd": {
              "anyOf": [
                {
                  "type": "string",
                  "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                },
                {
                  "type": "null"
                }
              ]
            },
            "taxMinor": {
              "anyOf": [
                {
                  "type": "string",
                  "pattern": "^-?\\d+$"
                },
                {
                  "type": "null"
                }
              ]
            },
            "treatment": {
              "type": [
                "string",
                "null"
              ]
            },
            "purchaseOrderLine": {
              "default": null,
              "anyOf": [
                {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "orderId": {
                      "type": "string"
                    },
                    "orderNumber": {
                      "type": "string"
                    },
                    "position": {
                      "type": "integer",
                      "minimum": 0,
                      "maximum": 9007199254740991
                    }
                  },
                  "required": [
                    "id",
                    "orderId",
                    "orderNumber",
                    "position"
                  ],
                  "additionalProperties": false
                },
                {
                  "type": "null"
                }
              ]
            },
            "heldBackMinor": {
              "default": "0",
              "type": "string",
              "pattern": "^-?\\d+$"
            },
            "customFields": {
              "description": "The line's own fields, by the field's key.",
              "type": "object",
              "propertyNames": {
                "type": "string"
              },
              "additionalProperties": {
                "type": [
                  "string",
                  "boolean"
                ]
              },
              "x-stability-level": "beta"
            },
            "carriedFrom": {
              "$ref": "#/components/schemas/CarriedFrom"
            }
          },
          "required": [
            "position",
            "description",
            "account",
            "quantity",
            "unitPriceMinor",
            "netMinor",
            "taxAsPrintedMinor",
            "supplyCategory",
            "itcKind",
            "commercialUsePct",
            "provincialServiceKind",
            "provincialBase",
            "provincialExemption",
            "propertyRegion",
            "dimensions",
            "servicePeriodStart",
            "servicePeriodEnd",
            "taxMinor",
            "treatment",
            "purchaseOrderLine",
            "heldBackMinor"
          ],
          "additionalProperties": false
        }
      },
      "Lines6": {
        "type": "array",
        "items": {
          "type": "object",
          "properties": {
            "id": {
              "type": "string"
            },
            "position": {
              "type": "integer",
              "minimum": 0,
              "maximum": 9007199254740991
            },
            "description": {
              "type": "string"
            },
            "account": {
              "$ref": "#/components/schemas/Account"
            },
            "quantity": {
              "type": "string"
            },
            "unitPriceMinor": {
              "type": "string",
              "pattern": "^-?\\d+$"
            },
            "netMinor": {
              "type": "string",
              "pattern": "^-?\\d+$"
            },
            "supplyCategory": {
              "anyOf": [
                {
                  "type": "string",
                  "enum": [
                    "GOODS",
                    "SERVICES",
                    "INTANGIBLE_PROPERTY",
                    "REAL_PROPERTY"
                  ]
                },
                {
                  "type": "null"
                }
              ]
            },
            "expectedDate": {
              "anyOf": [
                {
                  "type": "string",
                  "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                },
                {
                  "type": "null"
                }
              ]
            },
            "dimensions": {
              "type": "array",
              "items": {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "object",
                    "properties": {
                      "id": {
                        "type": "string"
                      },
                      "label": {
                        "type": "string"
                      }
                    },
                    "required": [
                      "id",
                      "label"
                    ],
                    "additionalProperties": false
                  },
                  "value": {
                    "type": "object",
                    "properties": {
                      "id": {
                        "type": "string"
                      },
                      "code": {
                        "type": "string"
                      },
                      "name": {
                        "type": "string"
                      }
                    },
                    "required": [
                      "id",
                      "code",
                      "name"
                    ],
                    "additionalProperties": false
                  }
                },
                "required": [
                  "type",
                  "value"
                ],
                "additionalProperties": false
              }
            },
            "customFields": {
              "description": "The line's own fields, by the field's key.",
              "type": "object",
              "propertyNames": {
                "type": "string"
              },
              "additionalProperties": {
                "type": [
                  "string",
                  "boolean"
                ]
              },
              "x-stability-level": "beta"
            },
            "carriedFrom": {
              "$ref": "#/components/schemas/CarriedFrom"
            }
          },
          "required": [
            "id",
            "position",
            "description",
            "account",
            "quantity",
            "unitPriceMinor",
            "netMinor",
            "supplyCategory",
            "expectedDate",
            "dimensions"
          ],
          "additionalProperties": false
        }
      },
      "Lines7": {
        "minItems": 1,
        "maxItems": 200,
        "type": "array",
        "items": {
          "type": "object",
          "properties": {
            "purchaseOrderLineId": {
              "type": "string",
              "minLength": 1
            },
            "quantity": {
              "type": "string",
              "pattern": "^\\d{1,10}(\\.\\d{1,4})?$"
            },
            "note": {
              "default": null,
              "anyOf": [
                {
                  "type": "string",
                  "maxLength": 300
                },
                {
                  "type": "null"
                }
              ]
            },
            "customFields": {
              "type": "object",
              "propertyNames": {
                "type": "string",
                "pattern": "^[a-z][a-z0-9_]{0,39}$"
              },
              "additionalProperties": {
                "anyOf": [
                  {
                    "type": "string",
                    "maxLength": 500
                  },
                  {
                    "type": "boolean"
                  }
                ]
              }
            }
          },
          "required": [
            "purchaseOrderLineId",
            "quantity"
          ],
          "additionalProperties": false
        }
      },
      "Lines8": {
        "minItems": 1,
        "maxItems": 100,
        "type": "array",
        "items": {
          "type": "object",
          "properties": {
            "description": {
              "type": "string",
              "minLength": 1,
              "maxLength": 500
            },
            "accountId": {
              "anyOf": [
                {
                  "type": "string",
                  "minLength": 1
                },
                {
                  "type": "null"
                }
              ]
            },
            "quantity": {
              "default": "1",
              "type": "string",
              "pattern": "^\\d{1,10}(\\.\\d{1,4})?$"
            },
            "unitPriceMinor": {
              "type": "string",
              "pattern": "^-?\\d+$"
            },
            "netMinor": {
              "type": "string",
              "pattern": "^-?\\d+$"
            },
            "taxAsPrintedMinor": {
              "anyOf": [
                {
                  "type": "string",
                  "pattern": "^-?\\d+$"
                },
                {
                  "type": "null"
                }
              ]
            },
            "supplyCategory": {
              "type": "string",
              "enum": [
                "GOODS",
                "SERVICES",
                "INTANGIBLE_PROPERTY",
                "REAL_PROPERTY"
              ]
            },
            "itcKind": {
              "type": "string",
              "enum": [
                "GENERAL",
                "MEALS_ENTERTAINMENT",
                "PASSENGER_VEHICLE",
                "ZERO_EMISSION_VEHICLE",
                "EXEMPT_ACTIVITY",
                "NONE"
              ]
            },
            "dimensions": {
              "$ref": "#/components/schemas/Dimensions2"
            },
            "servicePeriodStart": {
              "type": "string",
              "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
            },
            "servicePeriodEnd": {
              "type": "string",
              "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
            },
            "purchaseOrderLineId": {
              "anyOf": [
                {
                  "type": "string",
                  "minLength": 1
                },
                {
                  "type": "null"
                }
              ]
            },
            "customFields": {
              "$ref": "#/components/schemas/CustomFields5"
            },
            "adjustsBillLineId": {
              "anyOf": [
                {
                  "type": "string",
                  "minLength": 1
                },
                {
                  "type": "null"
                }
              ]
            }
          },
          "required": [
            "description",
            "supplyCategory",
            "itcKind"
          ],
          "additionalProperties": false
        }
      },
      "LinesItem": {
        "type": "object",
        "properties": {
          "description": {
            "type": "string",
            "minLength": 1,
            "maxLength": 500
          },
          "accountId": {
            "anyOf": [
              {
                "type": "string",
                "minLength": 1
              },
              {
                "type": "null"
              }
            ]
          },
          "quantity": {
            "type": "string",
            "pattern": "^\\d{1,10}(\\.\\d{1,4})?$"
          },
          "unitPriceMinor": {
            "type": "string",
            "pattern": "^-?\\d+$"
          },
          "supplyCategory": {
            "anyOf": [
              {
                "type": "string",
                "enum": [
                  "GOODS",
                  "SERVICES",
                  "INTANGIBLE_PROPERTY",
                  "REAL_PROPERTY"
                ]
              },
              {
                "type": "null"
              }
            ]
          },
          "expectedDate": {
            "anyOf": [
              {
                "type": "string",
                "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
              },
              {
                "type": "null"
              }
            ]
          },
          "dimensions": {
            "default": [],
            "maxItems": 10,
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/DimensionsItem"
            }
          },
          "customFields": {
            "$ref": "#/components/schemas/CustomFields5"
          }
        },
        "required": [
          "description",
          "accountId",
          "quantity",
          "unitPriceMinor",
          "supplyCategory",
          "expectedDate"
        ],
        "additionalProperties": false
      },
      "LinesItem2": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "billId": {
            "type": "string"
          },
          "supplierName": {
            "type": "string"
          },
          "number": {
            "type": [
              "string",
              "null"
            ]
          },
          "rank": {
            "type": "integer",
            "minimum": 1,
            "maximum": 9007199254740991
          },
          "decision": {
            "type": "string",
            "enum": [
              "TAKEN",
              "SKIPPED"
            ]
          },
          "skipReason": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/SkipReasonOption1"
              },
              {
                "type": "null"
              }
            ]
          },
          "detail": {
            "type": [
              "string",
              "null"
            ]
          },
          "openMinor": {
            "type": "string",
            "pattern": "^-?\\d+$"
          },
          "cashMinor": {
            "anyOf": [
              {
                "type": "string",
                "pattern": "^-?\\d+$"
              },
              {
                "type": "null"
              }
            ]
          },
          "currency": {
            "type": "string",
            "pattern": "^[A-Z]{3}$"
          }
        },
        "required": [
          "id",
          "billId",
          "supplierName",
          "number",
          "rank",
          "decision",
          "skipReason",
          "detail",
          "openMinor",
          "cashMinor",
          "currency"
        ],
        "additionalProperties": false
      },
      "LinkBillSupersedeResponse": {
        "type": "object",
        "properties": {
          "billId": {
            "type": "string"
          },
          "supersede": {
            "type": "object",
            "properties": {
              "replaces": {
                "$ref": "#/components/schemas/Replaces"
              },
              "replacedBy": {
                "$ref": "#/components/schemas/Replaces"
              },
              "correctionsTotal": {
                "type": "integer",
                "minimum": 0,
                "maximum": 9007199254740991
              },
              "offer": {
                "anyOf": [
                  {
                    "type": "object",
                    "properties": {
                      "billId": {
                        "type": "string"
                      },
                      "supplierName": {
                        "type": "string"
                      },
                      "number": {
                        "type": "string"
                      },
                      "billDate": {
                        "type": "string",
                        "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                      },
                      "totalMinor": {
                        "type": "string",
                        "pattern": "^-?\\d+$"
                      },
                      "currency": {
                        "type": "string",
                        "pattern": "^[A-Z]{3}$"
                      },
                      "differences": {
                        "minItems": 1,
                        "maxItems": 3,
                        "type": "array",
                        "items": {
                          "$ref": "#/components/schemas/DifferencesItem"
                        }
                      }
                    },
                    "required": [
                      "billId",
                      "supplierName",
                      "number",
                      "billDate",
                      "totalMinor",
                      "currency",
                      "differences"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "next": {
                "anyOf": [
                  {
                    "type": "object",
                    "properties": {
                      "standing": {
                        "type": "string",
                        "enum": [
                          "DRAFT",
                          "IN_REVIEW",
                          "OPEN",
                          "IN_RUN",
                          "EDIT_PENDING",
                          "PAID",
                          "VOID"
                        ]
                      },
                      "sentence": {
                        "type": "string"
                      }
                    },
                    "required": [
                      "standing",
                      "sentence"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "null"
                  }
                ]
              }
            },
            "required": [
              "replaces",
              "replacedBy",
              "correctionsTotal",
              "offer",
              "next"
            ],
            "additionalProperties": false
          }
        },
        "required": [
          "billId",
          "supersede"
        ],
        "additionalProperties": false
      },
      "LinkVendorResponse": {
        "type": "object",
        "properties": {
          "vendorId": {
            "type": "string"
          },
          "links": {
            "$ref": "#/components/schemas/Links"
          }
        },
        "required": [
          "vendorId",
          "links"
        ],
        "additionalProperties": false
      },
      "Links": {
        "type": "array",
        "items": {
          "type": "object",
          "properties": {
            "id": {
              "type": "string"
            },
            "provider": {
              "type": "string",
              "enum": [
                "STRIPE",
                "HUBSPOT",
                "QBO",
                "XERO"
              ]
            },
            "externalId": {
              "type": "string"
            },
            "externalLabel": {
              "type": [
                "string",
                "null"
              ]
            },
            "source": {
              "type": "string",
              "enum": [
                "EMAIL_MATCH",
                "IMPORT",
                "CHECKOUT",
                "MANUAL"
              ]
            },
            "linkedBy": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string"
                },
                "name": {
                  "type": "string"
                }
              },
              "required": [
                "id",
                "name"
              ],
              "additionalProperties": false
            },
            "linkedAt": {
              "type": "string",
              "minLength": 20
            }
          },
          "required": [
            "id",
            "provider",
            "externalId",
            "externalLabel",
            "source",
            "linkedBy",
            "linkedAt"
          ],
          "additionalProperties": false
        }
      },
      "List": {
        "type": "string",
        "enum": [
          "vendors",
          "bills",
          "billsDue",
          "paymentRuns",
          "purchaseOrders",
          "arrivals",
          "documents",
          "vendorNotices",
          "signals",
          "vendorCredits",
          "vendorMerges",
          "billInbox",
          "expectedBills",
          "bankingWorklist",
          "vendorQueries",
          "vendorStatements"
        ]
      },
      "ListAiProviderFaultsResponseItem": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "occurredAt": {
            "type": "string",
            "minLength": 20
          },
          "feature": {
            "type": "string"
          },
          "featureGroup": {
            "anyOf": [
              {
                "type": "string",
                "enum": [
                  "DOCUMENT_READING",
                  "CODING_AND_MATCHING",
                  "DRAFTING",
                  "CHAT",
                  "EVALUATION"
                ]
              },
              {
                "type": "null"
              }
            ]
          },
          "providerId": {
            "type": "string"
          },
          "model": {
            "type": "string"
          },
          "modelLocation": {
            "type": "string"
          },
          "kind": {
            "type": "string",
            "enum": [
              "RATE_LIMITED",
              "SERVER_ERROR",
              "TIMEOUT",
              "UNREACHABLE"
            ]
          },
          "httpStatus": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991
              },
              {
                "type": "null"
              }
            ]
          },
          "outcome": {
            "type": "string",
            "enum": [
              "PASSED_OVER",
              "NO_MEMBER_LEFT"
            ]
          },
          "passedOverTo": {
            "type": [
              "string",
              "null"
            ]
          },
          "elapsedMs": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "documentId": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "id",
          "occurredAt",
          "feature",
          "featureGroup",
          "providerId",
          "model",
          "modelLocation",
          "kind",
          "httpStatus",
          "outcome",
          "passedOverTo",
          "elapsedMs",
          "documentId"
        ],
        "additionalProperties": false
      },
      "ListBillFeedCandidatesResponse": {
        "type": "object",
        "properties": {
          "entityTimeZone": {
            "type": "string"
          },
          "bill": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "openMinor": {
                "type": "string",
                "pattern": "^-?\\d+$"
              },
              "currency": {
                "type": "string",
                "pattern": "^[A-Z]{3}$"
              },
              "paidBy": {
                "type": "string",
                "enum": [
                  "RUN",
                  "CARD",
                  "PAD",
                  "ACCOUNT",
                  "CHEQUE",
                  "WIRE",
                  "ETRANSFER",
                  "OTHER"
                ]
              },
              "anchorDate": {
                "type": "string",
                "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
              },
              "status": {
                "default": "APPROVED",
                "type": "string",
                "enum": [
                  "DRAFT",
                  "IN_REVIEW",
                  "APPROVED",
                  "PARTIALLY_PAID",
                  "PAID",
                  "VOID"
                ]
              },
              "receipt": {
                "default": false,
                "type": "boolean"
              }
            },
            "required": [
              "id",
              "openMinor",
              "currency",
              "paidBy",
              "anchorDate",
              "status",
              "receipt"
            ],
            "additionalProperties": false
          },
          "window": {
            "$ref": "#/components/schemas/Period2"
          },
          "candidates": {
            "maxItems": 5,
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "sourceTransactionId": {
                  "type": "string"
                },
                "account": {
                  "$ref": "#/components/schemas/Account2"
                },
                "txnDate": {
                  "type": "string",
                  "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                },
                "description": {
                  "type": "string"
                },
                "amountMinor": {
                  "type": "string",
                  "pattern": "^-?\\d+$"
                },
                "currency": {
                  "type": "string",
                  "pattern": "^[A-Z]{3}$"
                },
                "scoreBp": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 10000
                },
                "linesMatching": {
                  "type": "integer",
                  "minimum": 1,
                  "maximum": 9007199254740991
                },
                "billsMatching": {
                  "type": "integer",
                  "minimum": 1,
                  "maximum": 9007199254740991
                },
                "counterparty": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "signals": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "kind": {
                        "type": "string",
                        "enum": [
                          "AMOUNT_EXACT",
                          "DATE_WINDOW",
                          "COUNTERPARTY",
                          "REFERENCE",
                          "HISTORY"
                        ]
                      },
                      "scoreBp": {
                        "type": "integer",
                        "minimum": -9007199254740991,
                        "maximum": 9007199254740991
                      },
                      "weightBp": {
                        "type": "integer",
                        "minimum": -9007199254740991,
                        "maximum": 9007199254740991
                      },
                      "phrase": {
                        "type": "string"
                      }
                    },
                    "required": [
                      "kind",
                      "scoreBp",
                      "weightBp",
                      "phrase"
                    ],
                    "additionalProperties": false
                  }
                },
                "evidence": {
                  "type": "string"
                },
                "reading": {
                  "$ref": "#/components/schemas/Reading"
                },
                "record": {
                  "type": "object",
                  "properties": {
                    "method": {
                      "type": "string",
                      "enum": [
                        "CARD",
                        "PAD",
                        "CHEQUE",
                        "WIRE",
                        "ETRANSFER",
                        "OTHER"
                      ]
                    },
                    "settledOn": {
                      "type": "string",
                      "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                    },
                    "financialAccountId": {
                      "type": "string"
                    },
                    "amountMinor": {
                      "type": "string",
                      "pattern": "^-?\\d+$"
                    },
                    "reference": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 60
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "sourceTransactionId": {
                      "type": "string"
                    },
                    "feedScoreBp": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    }
                  },
                  "required": [
                    "method",
                    "settledOn",
                    "financialAccountId",
                    "amountMinor",
                    "reference",
                    "sourceTransactionId",
                    "feedScoreBp"
                  ],
                  "additionalProperties": false
                },
                "blocked": {
                  "type": [
                    "string",
                    "null"
                  ]
                }
              },
              "required": [
                "sourceTransactionId",
                "account",
                "txnDate",
                "description",
                "amountMinor",
                "currency",
                "scoreBp",
                "linesMatching",
                "billsMatching",
                "counterparty",
                "signals",
                "evidence",
                "reading",
                "record",
                "blocked"
              ],
              "additionalProperties": false
            }
          },
          "total": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "truncated": {
            "type": "boolean"
          },
          "declined": {
            "maxItems": 5,
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "sourceTransactionId": {
                  "type": "string"
                },
                "txnDate": {
                  "type": "string",
                  "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                },
                "description": {
                  "type": "string"
                },
                "reason": {
                  "type": "string",
                  "enum": [
                    "NOT_THIS_SUPPLIER",
                    "NOT_THIS_BILL",
                    "NOT_A_PAYMENT",
                    "OTHER"
                  ]
                },
                "by": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "name": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "id",
                    "name"
                  ],
                  "additionalProperties": false
                },
                "at": {
                  "type": "string",
                  "minLength": 20
                }
              },
              "required": [
                "sourceTransactionId",
                "txnDate",
                "description",
                "reason",
                "by",
                "at"
              ],
              "additionalProperties": false
            }
          },
          "declinedTotal": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "otherCurrencyLines": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          }
        },
        "required": [
          "entityTimeZone",
          "bill",
          "window",
          "candidates",
          "total",
          "truncated",
          "declined",
          "declinedTotal",
          "otherCurrencyLines"
        ],
        "additionalProperties": false
      },
      "ListBillSettlementsResponseItem": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "billId": {
            "type": "string"
          },
          "entityId": {
            "type": "string"
          },
          "entityTimeZone": {
            "type": "string"
          },
          "method": {
            "type": "string",
            "enum": [
              "RUN",
              "CARD",
              "PAD",
              "ACCOUNT",
              "CHEQUE",
              "WIRE",
              "ETRANSFER",
              "OTHER"
            ]
          },
          "state": {
            "type": "string",
            "enum": [
              "POSTED",
              "AWAITING_APPROVAL",
              "DECLINED",
              "VOIDED",
              "REVERSED_WITH_RUN"
            ]
          },
          "settledOn": {
            "type": "string",
            "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
          },
          "postingDate": {
            "anyOf": [
              {
                "type": "string",
                "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
              },
              {
                "type": "null"
              }
            ]
          },
          "amountMinor": {
            "type": "string",
            "pattern": "^-?\\d+$"
          },
          "currency": {
            "type": "string",
            "pattern": "^[A-Z]{3}$"
          },
          "paidAmountMinor": {
            "type": "string",
            "pattern": "^-?\\d+$"
          },
          "paidCurrency": {
            "type": "string",
            "pattern": "^[A-Z]{3}$"
          },
          "functionalAmountMinor": {
            "type": "string",
            "pattern": "^-?\\d+$"
          },
          "functionalCurrency": {
            "type": "string",
            "pattern": "^[A-Z]{3}$"
          },
          "account": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "displayName": {
                "type": "string"
              },
              "kind": {
                "type": "string",
                "enum": [
                  "BANK",
                  "CARD",
                  "STRIPE"
                ]
              }
            },
            "required": [
              "id",
              "displayName",
              "kind"
            ],
            "additionalProperties": false
          },
          "reference": {
            "type": [
              "string",
              "null"
            ]
          },
          "note": {
            "type": [
              "string",
              "null"
            ]
          },
          "run": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string"
                  },
                  "paymentId": {
                    "type": "string"
                  }
                },
                "required": [
                  "id",
                  "paymentId"
                ],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ]
          },
          "entry": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string"
                  },
                  "number": {
                    "anyOf": [
                      {
                        "type": "integer",
                        "minimum": -9007199254740991,
                        "maximum": 9007199254740991
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "status": {
                    "type": "string",
                    "enum": [
                      "DRAFT",
                      "PROPOSED",
                      "IN_REVIEW",
                      "APPROVED",
                      "POSTED",
                      "DECLINED",
                      "REVERSED"
                    ]
                  }
                },
                "required": [
                  "id",
                  "number",
                  "status"
                ],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ]
          },
          "recordedBy": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "name": {
                "type": "string"
              }
            },
            "required": [
              "id",
              "name"
            ],
            "additionalProperties": false
          },
          "recordedAt": {
            "type": "string",
            "minLength": 20
          },
          "requiresSecondPerson": {
            "type": "boolean"
          },
          "recorderCapMinor": {
            "anyOf": [
              {
                "type": "string",
                "pattern": "^-?\\d+$"
              },
              {
                "type": "null"
              }
            ]
          },
          "approvedBy": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string"
                  },
                  "name": {
                    "type": "string"
                  }
                },
                "required": [
                  "id",
                  "name"
                ],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ]
          },
          "approvedAt": {
            "anyOf": [
              {
                "type": "string",
                "minLength": 20
              },
              {
                "type": "null"
              }
            ]
          },
          "voided": {
            "$ref": "#/components/schemas/Voided"
          },
          "hint": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "method": {
                    "type": "string"
                  },
                  "settledOn": {
                    "anyOf": [
                      {
                        "type": "string",
                        "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "promptVersion": {
                    "type": "string"
                  }
                },
                "required": [
                  "method",
                  "settledOn",
                  "promptVersion"
                ],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ]
          },
          "approveBlocked": {
            "type": [
              "string",
              "null"
            ]
          },
          "shortReason": {
            "type": [
              "string",
              "null"
            ]
          },
          "deductions": {
            "$ref": "#/components/schemas/Deductions"
          },
          "feedLine": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "sourceTransactionId": {
                    "type": "string"
                  },
                  "txnDate": {
                    "type": "string",
                    "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                  },
                  "description": {
                    "type": "string"
                  },
                  "account": {
                    "type": "object",
                    "properties": {
                      "id": {
                        "type": "string"
                      },
                      "displayName": {
                        "type": "string"
                      }
                    },
                    "required": [
                      "id",
                      "displayName"
                    ],
                    "additionalProperties": false
                  },
                  "matched": {
                    "type": "boolean"
                  },
                  "scoreBp": {
                    "type": "integer",
                    "minimum": -9007199254740991,
                    "maximum": 9007199254740991
                  },
                  "evidenceReadable": {
                    "type": "boolean"
                  }
                },
                "required": [
                  "sourceTransactionId",
                  "txnDate",
                  "description",
                  "account",
                  "matched",
                  "scoreBp",
                  "evidenceReadable"
                ],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "id",
          "billId",
          "entityId",
          "entityTimeZone",
          "method",
          "state",
          "settledOn",
          "postingDate",
          "amountMinor",
          "currency",
          "paidAmountMinor",
          "paidCurrency",
          "functionalAmountMinor",
          "functionalCurrency",
          "account",
          "reference",
          "note",
          "run",
          "entry",
          "recordedBy",
          "recordedAt",
          "requiresSecondPerson",
          "recorderCapMinor",
          "approvedBy",
          "approvedAt",
          "voided",
          "hint",
          "approveBlocked",
          "shortReason",
          "deductions",
          "feedLine"
        ],
        "additionalProperties": false
      },
      "ListBillSupplierMatchesResponse": {
        "type": "object",
        "properties": {
          "applied": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/AppliedOption1"
              },
              {
                "type": "null"
              }
            ]
          },
          "proposals": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AppliedOption1"
            }
          },
          "declinedCount": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "linkable": {
            "type": "boolean"
          },
          "entityTimeZone": {
            "type": "string"
          }
        },
        "required": [
          "applied",
          "proposals",
          "declinedCount",
          "linkable",
          "entityTimeZone"
        ],
        "additionalProperties": false
      },
      "ListBillsResponseItem": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "entityId": {
            "type": "string"
          },
          "entityName": {
            "type": "string"
          },
          "entityTimeZone": {
            "type": "string"
          },
          "supplierName": {
            "type": "string"
          },
          "vendor": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string"
                  },
                  "displayName": {
                    "type": "string"
                  }
                },
                "required": [
                  "id",
                  "displayName"
                ],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ]
          },
          "number": {
            "type": [
              "string",
              "null"
            ]
          },
          "billDate": {
            "type": "string",
            "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
          },
          "postingDate": {
            "anyOf": [
              {
                "type": "string",
                "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
              },
              {
                "type": "null"
              }
            ]
          },
          "dueDate": {
            "type": "string",
            "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
          },
          "overdueDays": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991
          },
          "currency": {
            "type": "string",
            "pattern": "^[A-Z]{3}$"
          },
          "totalMinor": {
            "type": "string",
            "pattern": "^-?\\d+$"
          },
          "openMinor": {
            "type": "string",
            "pattern": "^-?\\d+$"
          },
          "taxMinor": {
            "anyOf": [
              {
                "type": "string",
                "pattern": "^-?\\d+$"
              },
              {
                "type": "null"
              }
            ]
          },
          "status": {
            "type": "string",
            "enum": [
              "DRAFT",
              "IN_REVIEW",
              "DECLINED",
              "APPROVED",
              "HELD",
              "OPEN",
              "DUE",
              "OVERDUE",
              "IN_RUN",
              "PARTIALLY_PAID",
              "PAID",
              "VOID"
            ]
          },
          "memo": {
            "type": [
              "string",
              "null"
            ]
          },
          "run": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string"
                  },
                  "status": {
                    "type": "string",
                    "enum": [
                      "DRAFT",
                      "RELEASED",
                      "CANCELLED"
                    ]
                  },
                  "paymentDate": {
                    "type": "string",
                    "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                  }
                },
                "required": [
                  "id",
                  "status",
                  "paymentDate"
                ],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ]
          },
          "hold": {
            "$ref": "#/components/schemas/Hold"
          },
          "paidBy": {
            "type": "string",
            "enum": [
              "RUN",
              "CARD",
              "PAD",
              "ACCOUNT",
              "CHEQUE",
              "WIRE",
              "ETRANSFER",
              "OTHER"
            ]
          },
          "conversion": {
            "$ref": "#/components/schemas/Conversion"
          },
          "supersedesBillId": {
            "default": null,
            "type": [
              "string",
              "null"
            ]
          },
          "customFields": {
            "$ref": "#/components/schemas/CustomFields2"
          }
        },
        "required": [
          "id",
          "entityId",
          "entityName",
          "entityTimeZone",
          "supplierName",
          "vendor",
          "number",
          "billDate",
          "postingDate",
          "dueDate",
          "overdueDays",
          "currency",
          "totalMinor",
          "openMinor",
          "taxMinor",
          "status",
          "memo",
          "run",
          "hold",
          "paidBy",
          "conversion",
          "supersedesBillId"
        ],
        "additionalProperties": false
      },
      "ListImportedHistoryResponse": {
        "type": "array",
        "items": {
          "$ref": "#/components/schemas/Record"
        }
      },
      "ListQuestionsResponse": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ListQuestionsResponseItem"
            }
          },
          "nextCursor": {
            "type": [
              "string",
              "null"
            ]
          },
          "total": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "data",
          "nextCursor",
          "total"
        ],
        "additionalProperties": false
      },
      "ListQuestionsResponseItem": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "entityId": {
            "type": "string"
          },
          "entityName": {
            "type": "string"
          },
          "about": {
            "type": "object",
            "properties": {
              "kind": {
                "type": "string",
                "enum": [
                  "ENTRY",
                  "SOURCE_TRANSACTION",
                  "BILL",
                  "INVOICE",
                  "CREDIT_MEMO"
                ]
              },
              "id": {
                "type": "string"
              },
              "date": {
                "type": "string"
              },
              "label": {
                "type": "string"
              },
              "amountMinor": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "currency": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "detail": {
                "type": [
                  "string",
                  "null"
                ]
              }
            },
            "required": [
              "kind",
              "id",
              "date",
              "label",
              "amountMinor",
              "currency",
              "detail"
            ],
            "additionalProperties": false
          },
          "text": {
            "type": "string"
          },
          "status": {
            "type": "string",
            "enum": [
              "OPEN",
              "ANSWERED",
              "RESOLVED"
            ]
          },
          "askedBy": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string"
                  },
                  "name": {
                    "type": "string"
                  }
                },
                "required": [
                  "id",
                  "name"
                ],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ]
          },
          "askedAt": {
            "type": "string",
            "minLength": 20
          },
          "askedOf": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string"
                  },
                  "name": {
                    "type": "string"
                  }
                },
                "required": [
                  "id",
                  "name"
                ],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ]
          },
          "answer": {
            "type": [
              "string",
              "null"
            ]
          },
          "answeredBy": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string"
                  },
                  "name": {
                    "type": "string"
                  }
                },
                "required": [
                  "id",
                  "name"
                ],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ]
          },
          "answeredAt": {
            "anyOf": [
              {
                "type": "string",
                "minLength": 20
              },
              {
                "type": "null"
              }
            ]
          },
          "resolution": {
            "type": [
              "string",
              "null"
            ]
          },
          "resolvedBy": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string"
                  },
                  "name": {
                    "type": "string"
                  }
                },
                "required": [
                  "id",
                  "name"
                ],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ]
          },
          "resolvedAt": {
            "anyOf": [
              {
                "type": "string",
                "minLength": 20
              },
              {
                "type": "null"
              }
            ]
          },
          "ruleId": {
            "type": [
              "string",
              "null"
            ]
          },
          "lastSentAt": {
            "anyOf": [
              {
                "type": "string",
                "minLength": 20
              },
              {
                "type": "null"
              }
            ]
          },
          "ageDays": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991
          },
          "canAnswer": {
            "type": "boolean"
          },
          "topic": {
            "anyOf": [
              {
                "type": "string",
                "enum": [
                  "AMOUNT",
                  "SUPPLIER",
                  "CODING",
                  "TAX",
                  "DUPLICATE",
                  "OTHER"
                ]
              },
              {
                "type": "null"
              }
            ]
          },
          "outcome": {
            "anyOf": [
              {
                "type": "string",
                "enum": [
                  "NO_CHANGE",
                  "APPROVED",
                  "HELD",
                  "SENT_BACK",
                  "EDITED",
                  "SUPPLIER_ASKED",
                  "VOIDED"
                ]
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "id",
          "entityId",
          "entityName",
          "about",
          "text",
          "status",
          "askedBy",
          "askedAt",
          "askedOf",
          "answer",
          "answeredBy",
          "answeredAt",
          "resolution",
          "resolvedBy",
          "resolvedAt",
          "ruleId",
          "lastSentAt",
          "ageDays",
          "canAnswer",
          "topic",
          "outcome"
        ],
        "additionalProperties": false
      },
      "ListRulesResponseItem": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "sourceText": {
            "type": "string"
          },
          "kind": {
            "type": "string",
            "enum": [
              "ROUTING",
              "CODING",
              "AUTO_APPROVAL",
              "HOLD",
              "MATCH_TOLERANCE",
              "LINE_PROFILE",
              "RUN_PREPARE"
            ]
          },
          "status": {
            "type": "string",
            "enum": [
              "PROPOSED",
              "ACTIVE",
              "DISCARDED",
              "RETIRED"
            ]
          },
          "origin": {
            "type": "string",
            "enum": [
              "WRITTEN",
              "LEARNED"
            ]
          },
          "entityId": {
            "type": [
              "string",
              "null"
            ]
          },
          "entityName": {
            "type": [
              "string",
              "null"
            ]
          },
          "version": {
            "type": "integer",
            "exclusiveMinimum": 0,
            "maximum": 9007199254740991
          },
          "isAutoApproval": {
            "type": "boolean"
          },
          "rule": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/RuleOption1"
              },
              {
                "type": "null"
              }
            ]
          },
          "interpretation": {
            "type": "string"
          },
          "authorName": {
            "type": [
              "string",
              "null"
            ]
          },
          "createdAt": {
            "type": "string"
          },
          "sourceEntryId": {
            "type": [
              "string",
              "null"
            ]
          },
          "sourceEntryRef": {
            "type": [
              "string",
              "null"
            ]
          },
          "supersedesId": {
            "type": [
              "string",
              "null"
            ]
          },
          "firingCount": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "toleranceUsedMinor": {
            "anyOf": [
              {
                "type": "string",
                "pattern": "^-?\\d+$"
              },
              {
                "type": "null"
              }
            ]
          },
          "toleranceTotalCapMinor": {
            "anyOf": [
              {
                "type": "string",
                "pattern": "^-?\\d+$"
              },
              {
                "type": "null"
              }
            ]
          },
          "vendor": {
            "default": null,
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string"
                  },
                  "displayName": {
                    "type": "string"
                  },
                  "archived": {
                    "type": "boolean"
                  }
                },
                "required": [
                  "id",
                  "displayName",
                  "archived"
                ],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ]
          },
          "fillStats": {
            "default": null,
            "anyOf": [
              {
                "$ref": "#/components/schemas/FillStatsOption1"
              },
              {
                "type": "null"
              }
            ]
          },
          "runPolicy": {
            "default": null,
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "financialAccountId": {
                    "type": "string"
                  },
                  "accountName": {
                    "type": "string"
                  },
                  "method": {
                    "type": "string",
                    "enum": [
                      "EFT",
                      "CHEQUE",
                      "WIRE"
                    ]
                  },
                  "currency": {
                    "type": "string",
                    "pattern": "^[A-Z]{3}$"
                  },
                  "perBillCapMinor": {
                    "type": "string",
                    "pattern": "^-?\\d+$"
                  },
                  "weekCapMinor": {
                    "type": "string",
                    "pattern": "^-?\\d+$"
                  },
                  "weekUsedMinor": {
                    "type": "string",
                    "pattern": "^-?\\d+$"
                  },
                  "maxBills": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 9007199254740991
                  },
                  "weekday": {
                    "type": "string",
                    "enum": [
                      "MON",
                      "TUE",
                      "WED",
                      "THU",
                      "FRI",
                      "SAT",
                      "SUN"
                    ]
                  },
                  "payInDays": {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 9007199254740991
                  },
                  "nextPassOn": {
                    "anyOf": [
                      {
                        "type": "string",
                        "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "nextPassState": {
                    "type": "string",
                    "enum": [
                      "SCHEDULED",
                      "PAUSED",
                      "NOT_LIVE"
                    ]
                  },
                  "pausedUntil": {
                    "anyOf": [
                      {
                        "type": "string",
                        "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "lastPass": {
                    "anyOf": [
                      {
                        "type": "object",
                        "properties": {
                          "firedAt": {
                            "type": "string",
                            "minLength": 20
                          },
                          "outcome": {
                            "type": "string"
                          },
                          "runId": {
                            "type": [
                              "string",
                              "null"
                            ]
                          }
                        },
                        "required": [
                          "firedAt",
                          "outcome",
                          "runId"
                        ],
                        "additionalProperties": false
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "openDeclines": {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 9007199254740991
                  },
                  "replacesRuleId": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "entityTimeZone": {
                    "type": "string"
                  }
                },
                "required": [
                  "financialAccountId",
                  "accountName",
                  "method",
                  "currency",
                  "perBillCapMinor",
                  "weekCapMinor",
                  "weekUsedMinor",
                  "maxBills",
                  "weekday",
                  "payInDays",
                  "nextPassOn",
                  "nextPassState",
                  "pausedUntil",
                  "lastPass",
                  "openDeclines",
                  "replacesRuleId",
                  "entityTimeZone"
                ],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ]
          },
          "lastFiredAt": {
            "type": [
              "string",
              "null"
            ]
          },
          "authorMayApprove": {
            "type": "boolean"
          },
          "subject": {
            "type": "string",
            "enum": [
              "ENTRY",
              "BILL",
              "VENDOR",
              "RUN",
              "INVOICE"
            ]
          },
          "expiresAt": {
            "anyOf": [
              {
                "type": "string",
                "minLength": 20
              },
              {
                "type": "null"
              }
            ]
          },
          "expired": {
            "type": "boolean"
          },
          "desk": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "first": {
                    "$ref": "#/components/schemas/Desk"
                  },
                  "second": {
                    "anyOf": [
                      {
                        "$ref": "#/components/schemas/Desk"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "previewId": {
                    "type": [
                      "string",
                      "null"
                    ]
                  }
                },
                "required": [
                  "first",
                  "second",
                  "previewId"
                ],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ]
          },
          "readerIsAuthor": {
            "type": "boolean"
          },
          "holdingNow": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": 0,
                "maximum": 9007199254740991
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "id",
          "sourceText",
          "kind",
          "status",
          "origin",
          "entityId",
          "entityName",
          "version",
          "isAutoApproval",
          "rule",
          "interpretation",
          "authorName",
          "createdAt",
          "sourceEntryId",
          "sourceEntryRef",
          "supersedesId",
          "firingCount",
          "toleranceUsedMinor",
          "toleranceTotalCapMinor",
          "vendor",
          "fillStats",
          "runPolicy",
          "lastFiredAt",
          "authorMayApprove",
          "subject",
          "expiresAt",
          "expired",
          "desk",
          "readerIsAuthor",
          "holdingNow"
        ],
        "additionalProperties": false
      },
      "ListVendorAgreementsResponseItem": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "vendorId": {
            "type": "string"
          },
          "entity": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "name": {
                "type": "string"
              }
            },
            "required": [
              "id",
              "name"
            ],
            "additionalProperties": false
          },
          "name": {
            "type": "string"
          },
          "startsOn": {
            "type": "string",
            "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
          },
          "endsOn": {
            "anyOf": [
              {
                "type": "string",
                "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
              },
              {
                "type": "null"
              }
            ]
          },
          "renewal": {
            "type": "string",
            "enum": [
              "AUTO_RENEWS",
              "ENDS",
              "OPEN_ENDED"
            ]
          },
          "noticeDays": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991
              },
              {
                "type": "null"
              }
            ]
          },
          "actBy": {
            "anyOf": [
              {
                "type": "string",
                "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
              },
              {
                "type": "null"
              }
            ]
          },
          "daysToAct": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991
              },
              {
                "type": "null"
              }
            ]
          },
          "committed": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/CommittedOption1"
              },
              {
                "type": "null"
              }
            ]
          },
          "account": {
            "$ref": "#/components/schemas/Account"
          },
          "signedCopy": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "documentId": {
                    "type": "string"
                  },
                  "fileName": {
                    "type": "string"
                  },
                  "openable": {
                    "type": "boolean"
                  }
                },
                "required": [
                  "documentId",
                  "fileName",
                  "openable"
                ],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ]
          },
          "owner": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "name": {
                "type": "string"
              }
            },
            "required": [
              "id",
              "name"
            ],
            "additionalProperties": false
          },
          "note": {
            "type": [
              "string",
              "null"
            ]
          },
          "state": {
            "type": "string",
            "enum": [
              "UPCOMING",
              "ACTIVE",
              "ACT_SOON",
              "ACT_BY_PASSED",
              "TERM_PASSED",
              "RENEWED",
              "ENDED"
            ]
          },
          "decision": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "decision": {
                    "type": "string",
                    "enum": [
                      "RENEW",
                      "LET_END"
                    ]
                  },
                  "by": {
                    "type": "object",
                    "properties": {
                      "id": {
                        "type": "string"
                      },
                      "name": {
                        "type": "string"
                      }
                    },
                    "required": [
                      "id",
                      "name"
                    ],
                    "additionalProperties": false
                  },
                  "at": {
                    "type": "string",
                    "minLength": 20
                  },
                  "note": {
                    "type": [
                      "string",
                      "null"
                    ]
                  }
                },
                "required": [
                  "decision",
                  "by",
                  "at",
                  "note"
                ],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ]
          },
          "ended": {
            "$ref": "#/components/schemas/Retired"
          },
          "renews": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string"
                  },
                  "endsOn": {
                    "anyOf": [
                      {
                        "type": "string",
                        "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                },
                "required": [
                  "id",
                  "endsOn"
                ],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ]
          },
          "renewedBy": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string"
                  },
                  "startsOn": {
                    "type": "string",
                    "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                  }
                },
                "required": [
                  "id",
                  "startsOn"
                ],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ]
          },
          "notice": {
            "type": "object",
            "properties": {
              "state": {
                "type": "string",
                "enum": [
                  "NONE",
                  "DRAFTED",
                  "SENT"
                ]
              },
              "noticeId": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "by": {
                "anyOf": [
                  {
                    "type": "object",
                    "properties": {
                      "id": {
                        "type": "string"
                      },
                      "name": {
                        "type": "string"
                      }
                    },
                    "required": [
                      "id",
                      "name"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "on": {
                "anyOf": [
                  {
                    "type": "string",
                    "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                  },
                  {
                    "type": "null"
                  }
                ]
              }
            },
            "required": [
              "state",
              "noticeId",
              "by",
              "on"
            ],
            "additionalProperties": false
          },
          "entityTimeZone": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "vendorId",
          "entity",
          "name",
          "startsOn",
          "endsOn",
          "renewal",
          "noticeDays",
          "actBy",
          "daysToAct",
          "committed",
          "account",
          "signedCopy",
          "owner",
          "note",
          "state",
          "decision",
          "ended",
          "renews",
          "renewedBy",
          "notice",
          "entityTimeZone"
        ],
        "additionalProperties": false
      },
      "ListVendorAliasesResponseItem": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "vendorId": {
            "type": "string"
          },
          "alias": {
            "type": "string"
          },
          "source": {
            "type": "string",
            "enum": [
              "RENAME",
              "MERGE",
              "FROM_BILL",
              "ACCEPTED_MATCH",
              "TYPED"
            ]
          },
          "createdAt": {
            "type": "string",
            "minLength": 20
          },
          "createdBy": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "name": {
                "type": "string"
              }
            },
            "required": [
              "id",
              "name"
            ],
            "additionalProperties": false
          },
          "bill": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string"
                  },
                  "number": {
                    "type": [
                      "string",
                      "null"
                    ]
                  }
                },
                "required": [
                  "id",
                  "number"
                ],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ]
          },
          "merge": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string"
                  }
                },
                "required": [
                  "id"
                ],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "id",
          "vendorId",
          "alias",
          "source",
          "createdAt",
          "createdBy",
          "bill",
          "merge"
        ],
        "additionalProperties": false
      },
      "ListVendorCreditRefundsResponseItem": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "vendorCreditId": {
            "type": "string"
          },
          "vendorId": {
            "type": [
              "string",
              "null"
            ]
          },
          "receivedOn": {
            "type": "string",
            "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
          },
          "postingDate": {
            "anyOf": [
              {
                "type": "string",
                "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
              },
              {
                "type": "null"
              }
            ]
          },
          "amountMinor": {
            "type": "string",
            "pattern": "^-?\\d+$"
          },
          "currency": {
            "type": "string",
            "pattern": "^[A-Z]{3}$"
          },
          "receivedAmountMinor": {
            "type": "string",
            "pattern": "^-?\\d+$"
          },
          "receivedCurrency": {
            "type": "string",
            "pattern": "^[A-Z]{3}$"
          },
          "functionalAmountMinor": {
            "type": "string",
            "pattern": "^-?\\d+$"
          },
          "account": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "displayName": {
                "type": "string"
              }
            },
            "required": [
              "id",
              "displayName"
            ],
            "additionalProperties": false
          },
          "reference": {
            "type": [
              "string",
              "null"
            ]
          },
          "note": {
            "type": [
              "string",
              "null"
            ]
          },
          "sourceTransactionId": {
            "type": [
              "string",
              "null"
            ]
          },
          "entry": {
            "$ref": "#/components/schemas/Entry"
          },
          "recordedBy": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "name": {
                "type": "string"
              }
            },
            "required": [
              "id",
              "name"
            ],
            "additionalProperties": false
          },
          "recordedAt": {
            "type": "string",
            "minLength": 20
          },
          "requiresSecondPerson": {
            "type": "boolean"
          },
          "approvedBy": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string"
                  },
                  "name": {
                    "type": "string"
                  }
                },
                "required": [
                  "id",
                  "name"
                ],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ]
          },
          "approvedAt": {
            "anyOf": [
              {
                "type": "string",
                "minLength": 20
              },
              {
                "type": "null"
              }
            ]
          },
          "voided": {
            "$ref": "#/components/schemas/Voided"
          },
          "state": {
            "type": "string",
            "enum": [
              "AWAITING",
              "POSTED",
              "VOIDED"
            ]
          },
          "approveBlocked": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "id",
          "vendorCreditId",
          "vendorId",
          "receivedOn",
          "postingDate",
          "amountMinor",
          "currency",
          "receivedAmountMinor",
          "receivedCurrency",
          "functionalAmountMinor",
          "account",
          "reference",
          "note",
          "sourceTransactionId",
          "entry",
          "recordedBy",
          "recordedAt",
          "requiresSecondPerson",
          "approvedBy",
          "approvedAt",
          "voided",
          "state",
          "approveBlocked"
        ],
        "additionalProperties": false
      },
      "ListVendorDocumentsResponseItem": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "vendorId": {
            "type": "string"
          },
          "kind": {
            "type": "string",
            "enum": [
              "WSIB_CLEARANCE",
              "INSURANCE_CERTIFICATE",
              "MASTER_AGREEMENT",
              "W8BEN",
              "DIRECT_DEPOSIT_FORM",
              "WITHHOLDING_WAIVER",
              "OTHER"
            ]
          },
          "title": {
            "type": [
              "string",
              "null"
            ]
          },
          "reference": {
            "type": [
              "string",
              "null"
            ]
          },
          "validFrom": {
            "anyOf": [
              {
                "type": "string",
                "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
              },
              {
                "type": "null"
              }
            ]
          },
          "validUntil": {
            "anyOf": [
              {
                "type": "string",
                "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
              },
              {
                "type": "null"
              }
            ]
          },
          "note": {
            "type": [
              "string",
              "null"
            ]
          },
          "state": {
            "type": "string",
            "enum": [
              "CURRENT",
              "EXPIRING",
              "EXPIRED",
              "NOT_YET",
              "SUPERSEDED",
              "WITHDRAWN"
            ]
          },
          "daysToExpiry": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991
              },
              {
                "type": "null"
              }
            ]
          },
          "file": {
            "type": "object",
            "properties": {
              "documentId": {
                "type": "string"
              },
              "fileName": {
                "type": "string"
              },
              "mimeType": {
                "type": "string"
              },
              "sizeBytes": {
                "type": "integer",
                "minimum": 0,
                "maximum": 9007199254740991
              },
              "openable": {
                "type": "boolean"
              }
            },
            "required": [
              "documentId",
              "fileName",
              "mimeType",
              "sizeBytes",
              "openable"
            ],
            "additionalProperties": false
          },
          "recordedBy": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "name": {
                "type": "string"
              }
            },
            "required": [
              "id",
              "name"
            ],
            "additionalProperties": false
          },
          "recordedAt": {
            "type": "string",
            "minLength": 20
          },
          "supersedes": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string"
                  },
                  "validUntil": {
                    "anyOf": [
                      {
                        "type": "string",
                        "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                },
                "required": [
                  "id",
                  "validUntil"
                ],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ]
          },
          "supersededBy": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string"
                  },
                  "recordedAt": {
                    "type": "string",
                    "minLength": 20
                  }
                },
                "required": [
                  "id",
                  "recordedAt"
                ],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ]
          },
          "withdrawn": {
            "$ref": "#/components/schemas/Retired"
          },
          "reading": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "promptVersion": {
                    "type": "string"
                  },
                  "kindAgrees": {
                    "type": "boolean"
                  },
                  "validFromRead": {
                    "anyOf": [
                      {
                        "type": "string",
                        "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "validUntilRead": {
                    "anyOf": [
                      {
                        "type": "string",
                        "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "edited": {
                    "type": "boolean"
                  }
                },
                "required": [
                  "promptVersion",
                  "kindAgrees",
                  "validFromRead",
                  "validUntilRead",
                  "edited"
                ],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ]
          },
          "retainUntil": {
            "anyOf": [
              {
                "type": "string",
                "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "id",
          "vendorId",
          "kind",
          "title",
          "reference",
          "validFrom",
          "validUntil",
          "note",
          "state",
          "daysToExpiry",
          "file",
          "recordedBy",
          "recordedAt",
          "supersedes",
          "supersededBy",
          "withdrawn",
          "reading",
          "retainUntil"
        ],
        "additionalProperties": false
      },
      "ListVendorMergesResponseItem": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "survivor": {
            "$ref": "#/components/schemas/Survivor2"
          },
          "absorbed": {
            "$ref": "#/components/schemas/Survivor2"
          },
          "state": {
            "type": "string",
            "enum": [
              "PROPOSED",
              "APPROVED",
              "REJECTED",
              "WITHDRAWN",
              "EXPIRED"
            ]
          },
          "proposedFrom": {
            "type": "string",
            "enum": [
              "PERSON",
              "LOOKALIKE_LIST"
            ]
          },
          "proposedBy": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "name": {
                "type": "string"
              }
            },
            "required": [
              "id",
              "name"
            ],
            "additionalProperties": false
          },
          "proposedAt": {
            "type": "string",
            "minLength": 20
          },
          "expiresAt": {
            "type": "string",
            "minLength": 20
          },
          "reason": {
            "type": "string"
          },
          "evidenceSentence": {
            "type": [
              "string",
              "null"
            ]
          },
          "readingPromptVersion": {
            "type": [
              "string",
              "null"
            ]
          },
          "decidedBy": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string"
                  },
                  "name": {
                    "type": "string"
                  }
                },
                "required": [
                  "id",
                  "name"
                ],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ]
          },
          "decidedAt": {
            "anyOf": [
              {
                "type": "string",
                "minLength": 20
              },
              {
                "type": "null"
              }
            ]
          },
          "decisionNote": {
            "type": [
              "string",
              "null"
            ]
          },
          "moved": {
            "anyOf": [
              {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "kind": {
                      "type": "string",
                      "enum": [
                        "BILL",
                        "CONTACT",
                        "SENDER_DOMAIN",
                        "RECURRING_SCHEDULE",
                        "ALIAS",
                        "DOCUMENT",
                        "AGREEMENT",
                        "WITHHOLDING_WAIVER"
                      ]
                    },
                    "count": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    }
                  },
                  "required": [
                    "kind",
                    "count"
                  ],
                  "additionalProperties": false
                }
              },
              {
                "type": "null"
              }
            ]
          },
          "entityTimeZone": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "survivor",
          "absorbed",
          "state",
          "proposedFrom",
          "proposedBy",
          "proposedAt",
          "expiresAt",
          "reason",
          "evidenceSentence",
          "readingPromptVersion",
          "decidedBy",
          "decidedAt",
          "decisionNote",
          "moved",
          "entityTimeZone"
        ],
        "additionalProperties": false
      },
      "ListVendorNoticesResponseItem": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "kind": {
            "$ref": "#/components/schemas/Kind5"
          },
          "state": {
            "type": "string",
            "enum": [
              "DRAFTED",
              "SENT",
              "SUPPRESSED",
              "BOUNCED"
            ]
          },
          "reason": {
            "$ref": "#/components/schemas/Reason"
          },
          "recipientEmail": {
            "type": "string"
          },
          "language": {
            "type": "string",
            "enum": [
              "en",
              "fr",
              "bilingual"
            ]
          },
          "subject": {
            "type": "string"
          },
          "reference": {
            "type": "string"
          },
          "entity": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "name": {
                "type": "string"
              }
            },
            "required": [
              "id",
              "name"
            ],
            "additionalProperties": false
          },
          "entityTimeZone": {
            "type": "string"
          },
          "address": {
            "$ref": "#/components/schemas/Address"
          },
          "vendor": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string"
                  },
                  "displayName": {
                    "type": "string"
                  }
                },
                "required": [
                  "id",
                  "displayName"
                ],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ]
          },
          "inboundEmailId": {
            "type": [
              "string",
              "null"
            ]
          },
          "inboundRefusalId": {
            "type": [
              "string",
              "null"
            ]
          },
          "digestNoticeId": {
            "type": [
              "string",
              "null"
            ]
          },
          "digestHourStart": {
            "anyOf": [
              {
                "type": "string",
                "minLength": 20
              },
              {
                "type": "null"
              }
            ]
          },
          "under": {
            "$ref": "#/components/schemas/Under"
          },
          "stoppedBy": {
            "$ref": "#/components/schemas/StoppedBy"
          },
          "createdAt": {
            "type": "string",
            "minLength": 20
          },
          "sentAt": {
            "anyOf": [
              {
                "type": "string",
                "minLength": 20
              },
              {
                "type": "null"
              }
            ]
          },
          "sentVia": {
            "anyOf": [
              {
                "type": "string",
                "enum": [
                  "PRODUCT",
                  "BY_HAND"
                ]
              },
              {
                "type": "null"
              }
            ]
          },
          "sentBy": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string"
                  },
                  "name": {
                    "type": "string"
                  }
                },
                "required": [
                  "id",
                  "name"
                ],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ]
          },
          "sentNote": {
            "type": [
              "string",
              "null"
            ]
          },
          "transport": {
            "anyOf": [
              {
                "type": "string",
                "enum": [
                  "postmark",
                  "log",
                  "test-copy"
                ]
              },
              {
                "type": "null"
              }
            ]
          },
          "bouncedAt": {
            "anyOf": [
              {
                "type": "string",
                "minLength": 20
              },
              {
                "type": "null"
              }
            ]
          },
          "bounceReason": {
            "type": [
              "string",
              "null"
            ]
          },
          "relayRefusal": {
            "type": [
              "string",
              "null"
            ]
          },
          "draftedBy": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string"
                  },
                  "name": {
                    "type": "string"
                  }
                },
                "required": [
                  "id",
                  "name"
                ],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ]
          },
          "discarded": {
            "$ref": "#/components/schemas/Retired"
          },
          "sendable": {
            "type": "boolean"
          },
          "outboundApproved": {
            "type": "boolean"
          },
          "sentence": {
            "type": "string"
          },
          "payment": {
            "$ref": "#/components/schemas/Payment"
          },
          "requested": {
            "$ref": "#/components/schemas/StoppedBy"
          },
          "recipientNew": {
            "type": "boolean"
          },
          "recipientConfirmedBy": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string"
                  },
                  "name": {
                    "type": "string"
                  }
                },
                "required": [
                  "id",
                  "name"
                ],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ]
          },
          "bill": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string"
                  },
                  "number": {
                    "type": [
                      "string",
                      "null"
                    ]
                  }
                },
                "required": [
                  "id",
                  "number"
                ],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ]
          },
          "vendorBankingChangeId": {
            "type": [
              "string",
              "null"
            ]
          },
          "slipDistribution": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string"
                  },
                  "reference": {
                    "type": "string"
                  }
                },
                "required": [
                  "id",
                  "reference"
                ],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ]
          },
          "purchaseOrder": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string"
                  },
                  "number": {
                    "type": [
                      "string",
                      "null"
                    ]
                  }
                },
                "required": [
                  "id",
                  "number"
                ],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ]
          },
          "vendorPortalLink": {
            "default": null,
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string"
                  },
                  "contactName": {
                    "type": "string"
                  }
                },
                "required": [
                  "id",
                  "contactName"
                ],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ]
          },
          "vendorQuery": {
            "default": null,
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string"
                  },
                  "reference": {
                    "type": "string"
                  }
                },
                "required": [
                  "id",
                  "reference"
                ],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ]
          },
          "vendorStatement": {
            "$ref": "#/components/schemas/VendorStatement"
          }
        },
        "required": [
          "id",
          "kind",
          "state",
          "reason",
          "recipientEmail",
          "language",
          "subject",
          "reference",
          "entity",
          "entityTimeZone",
          "address",
          "vendor",
          "inboundEmailId",
          "inboundRefusalId",
          "digestNoticeId",
          "digestHourStart",
          "under",
          "stoppedBy",
          "createdAt",
          "sentAt",
          "sentVia",
          "sentBy",
          "sentNote",
          "transport",
          "bouncedAt",
          "bounceReason",
          "relayRefusal",
          "draftedBy",
          "discarded",
          "sendable",
          "outboundApproved",
          "sentence",
          "payment",
          "requested",
          "recipientNew",
          "recipientConfirmedBy",
          "bill",
          "vendorBankingChangeId",
          "slipDistribution",
          "purchaseOrder",
          "vendorPortalLink",
          "vendorQuery",
          "vendorStatement"
        ],
        "additionalProperties": false
      },
      "ListVendorPortalLinksResponseItem": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "vendorContactId": {
            "type": "string"
          },
          "contactName": {
            "type": "string"
          },
          "contactEmail": {
            "type": [
              "string",
              "null"
            ]
          },
          "issuedBy": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "name": {
                "type": "string"
              }
            },
            "required": [
              "id",
              "name"
            ],
            "additionalProperties": false
          },
          "issuedAt": {
            "type": "string",
            "minLength": 20
          },
          "expiresAt": {
            "type": "string",
            "minLength": 20
          },
          "state": {
            "type": "string",
            "enum": [
              "LIVE",
              "EXPIRED",
              "REVOKED"
            ]
          },
          "revokedAt": {
            "anyOf": [
              {
                "type": "string",
                "minLength": 20
              },
              {
                "type": "null"
              }
            ]
          },
          "revokedBy": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string"
                  },
                  "name": {
                    "type": "string"
                  }
                },
                "required": [
                  "id",
                  "name"
                ],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ]
          },
          "revokeReason": {
            "type": [
              "string",
              "null"
            ]
          },
          "lastOpenedAt": {
            "anyOf": [
              {
                "type": "string",
                "minLength": 20
              },
              {
                "type": "null"
              }
            ]
          },
          "opens": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "invitation": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "noticeId": {
                    "type": "string"
                  },
                  "state": {
                    "type": "string"
                  },
                  "sentAt": {
                    "anyOf": [
                      {
                        "type": "string",
                        "minLength": 20
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                },
                "required": [
                  "noticeId",
                  "state",
                  "sentAt"
                ],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "id",
          "vendorContactId",
          "contactName",
          "contactEmail",
          "issuedBy",
          "issuedAt",
          "expiresAt",
          "state",
          "revokedAt",
          "revokedBy",
          "revokeReason",
          "lastOpenedAt",
          "opens",
          "invitation"
        ],
        "additionalProperties": false
      },
      "ListVendorQueryMessagesResponseItem": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "seq": {
            "type": "integer",
            "minimum": 1,
            "maximum": 9007199254740991
          },
          "direction": {
            "type": "string",
            "enum": [
              "FROM_SUPPLIER",
              "FROM_US"
            ]
          },
          "channel": {
            "type": "string",
            "enum": [
              "PORTAL",
              "EMAIL",
              "BY_HAND"
            ]
          },
          "body": {
            "type": "string"
          },
          "at": {
            "type": "string",
            "minLength": 20
          },
          "by": {
            "type": "object",
            "properties": {
              "kind": {
                "type": "string",
                "enum": [
                  "SUPPLIER_CONTACT",
                  "STAFF"
                ]
              },
              "name": {
                "type": "string"
              }
            },
            "required": [
              "kind",
              "name"
            ],
            "additionalProperties": false
          },
          "delivery": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "state": {
                    "type": "string",
                    "enum": [
                      "PAGE",
                      "EMAILED",
                      "DRAFTED",
                      "BOUNCED",
                      "BY_HAND",
                      "NOT_SENT"
                    ]
                  },
                  "noticeId": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "sentence": {
                    "type": "string"
                  }
                },
                "required": [
                  "state",
                  "noticeId",
                  "sentence"
                ],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ]
          },
          "told": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "version": {
                    "type": "number",
                    "const": 1
                  },
                  "language": {
                    "type": "string",
                    "enum": [
                      "en",
                      "fr"
                    ]
                  },
                  "evidenceAt": {
                    "type": "string",
                    "minLength": 20
                  },
                  "keys": {
                    "$ref": "#/components/schemas/Keys"
                  },
                  "sentence": {
                    "anyOf": [
                      {
                        "type": "object",
                        "properties": {
                          "text": {
                            "type": "string",
                            "maxLength": 600
                          },
                          "source": {
                            "type": "string",
                            "enum": [
                              "STANDARD",
                              "AGENT_DRAFT",
                              "AGENT_DRAFT_EDITED",
                              "PERSON"
                            ]
                          },
                          "promptVersion": {
                            "type": [
                              "string",
                              "null"
                            ]
                          }
                        },
                        "required": [
                          "text",
                          "source",
                          "promptVersion"
                        ],
                        "additionalProperties": false
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "draft": {
                    "type": "object",
                    "properties": {
                      "requested": {
                        "type": "boolean"
                      },
                      "category": {
                        "anyOf": [
                          {
                            "type": "string",
                            "enum": [
                              "PAYMENT_STATUS",
                              "SHORT_PAID",
                              "NOT_RECEIVED",
                              "DUE_DATE",
                              "AMOUNT_DIFFERS",
                              "REMITTANCE_ADVICE",
                              "CREDIT",
                              "OTHER"
                            ]
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "proposedKeys": {
                        "$ref": "#/components/schemas/ProposedKeys"
                      }
                    },
                    "required": [
                      "requested",
                      "category",
                      "proposedKeys"
                    ],
                    "additionalProperties": false
                  },
                  "sourceLabel": {
                    "type": [
                      "string",
                      "null"
                    ]
                  }
                },
                "required": [
                  "version",
                  "language",
                  "evidenceAt",
                  "keys",
                  "sentence",
                  "draft",
                  "sourceLabel"
                ],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ]
          },
          "mentionsBanking": {
            "type": "boolean"
          }
        },
        "required": [
          "id",
          "seq",
          "direction",
          "channel",
          "body",
          "at",
          "by",
          "delivery",
          "told",
          "mentionsBanking"
        ],
        "additionalProperties": false
      },
      "ListVendorQueryPoliciesResponseItem": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "enabledBy": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "name": {
                "type": "string"
              }
            },
            "required": [
              "id",
              "name"
            ],
            "additionalProperties": false
          },
          "enabledAt": {
            "type": "string",
            "minLength": 20
          },
          "expiresAt": {
            "type": "string",
            "minLength": 20
          },
          "dailyCap": {
            "type": "integer",
            "minimum": 1,
            "maximum": 200
          },
          "end": {
            "$ref": "#/components/schemas/Retired"
          },
          "state": {
            "type": "string",
            "enum": [
              "LIVE",
              "EXPIRED",
              "ENDED"
            ]
          },
          "filedToday": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": 0,
                "maximum": 9007199254740991
              },
              {
                "type": "null"
              }
            ]
          },
          "pausedUntil": {
            "anyOf": [
              {
                "type": "string",
                "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
              },
              {
                "type": "null"
              }
            ]
          },
          "filedTotal": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "setAsideTotal": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          }
        },
        "required": [
          "id",
          "enabledBy",
          "enabledAt",
          "expiresAt",
          "dailyCap",
          "end",
          "state",
          "filedToday",
          "pausedUntil",
          "filedTotal",
          "setAsideTotal"
        ],
        "additionalProperties": false
      },
      "ListVendorSenderDomainsResponseItem": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "domain": {
            "type": "string"
          },
          "state": {
            "type": "string",
            "enum": [
              "KNOWN",
              "RETIRED"
            ]
          },
          "learnedFrom": {
            "type": "string",
            "enum": [
              "APPROVED_BILL",
              "BACKFILL"
            ]
          },
          "firstBill": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "number": {
                "type": [
                  "string",
                  "null"
                ]
              }
            },
            "required": [
              "id",
              "number"
            ],
            "additionalProperties": false
          },
          "learnedBy": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "name": {
                "type": "string"
              }
            },
            "required": [
              "id",
              "name"
            ],
            "additionalProperties": false
          },
          "firstSeenAt": {
            "type": "string",
            "minLength": 20
          },
          "lastSeenAt": {
            "type": "string",
            "minLength": 20
          },
          "messageCount": {
            "type": "integer",
            "exclusiveMinimum": 0,
            "maximum": 9007199254740991
          },
          "authenticatedCount": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "retired": {
            "$ref": "#/components/schemas/Retired"
          },
          "restored": {
            "$ref": "#/components/schemas/Retired"
          }
        },
        "required": [
          "id",
          "domain",
          "state",
          "learnedFrom",
          "firstBill",
          "learnedBy",
          "firstSeenAt",
          "lastSeenAt",
          "messageCount",
          "authenticatedCount",
          "retired",
          "restored"
        ],
        "additionalProperties": false
      },
      "ListVendorWithholdingWaiversResponseItem": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "craReference": {
            "type": "string"
          },
          "rateBp": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991
          },
          "validFrom": {
            "type": "string",
            "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
          },
          "validTo": {
            "type": "string",
            "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
          },
          "entity": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "name": {
                "type": "string"
              }
            },
            "required": [
              "id",
              "name"
            ],
            "additionalProperties": false
          },
          "vendorDocumentId": {
            "type": "string"
          },
          "documentTitle": {
            "type": [
              "string",
              "null"
            ]
          },
          "standing": {
            "type": "string",
            "enum": [
              "IN_FORCE",
              "NOT_YET",
              "EXPIRED",
              "ENDED"
            ]
          },
          "recordedBy": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "name": {
                "type": "string"
              }
            },
            "required": [
              "id",
              "name"
            ],
            "additionalProperties": false
          },
          "recordedAt": {
            "type": "string",
            "minLength": 20
          },
          "ended": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "on": {
                    "type": "string",
                    "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                  },
                  "by": {
                    "type": "object",
                    "properties": {
                      "id": {
                        "type": "string"
                      },
                      "name": {
                        "type": "string"
                      }
                    },
                    "required": [
                      "id",
                      "name"
                    ],
                    "additionalProperties": false
                  },
                  "at": {
                    "type": "string",
                    "minLength": 20
                  },
                  "reason": {
                    "type": "string"
                  }
                },
                "required": [
                  "on",
                  "by",
                  "at",
                  "reason"
                ],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ]
          },
          "paymentsUnder": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          }
        },
        "required": [
          "id",
          "craReference",
          "rateBp",
          "validFrom",
          "validTo",
          "entity",
          "vendorDocumentId",
          "documentTitle",
          "standing",
          "recordedBy",
          "recordedAt",
          "ended",
          "paymentsUnder"
        ],
        "additionalProperties": false
      },
      "ListVendorsResponseItem": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "displayName": {
            "type": "string"
          },
          "legalName": {
            "type": [
              "string",
              "null"
            ]
          },
          "taxNumber": {
            "type": [
              "string",
              "null"
            ]
          },
          "paymentTerms": {
            "$ref": "#/components/schemas/PaymentTerms"
          },
          "email": {
            "type": [
              "string",
              "null"
            ]
          },
          "phone": {
            "type": [
              "string",
              "null"
            ]
          },
          "address": {
            "type": [
              "string",
              "null"
            ]
          },
          "defaultCurrency": {
            "type": [
              "string",
              "null"
            ]
          },
          "language": {
            "type": "string",
            "enum": [
              "en",
              "fr"
            ]
          },
          "qstNumber": {
            "type": [
              "string",
              "null"
            ]
          },
          "gstRegistrationState": {
            "type": "string",
            "enum": [
              "REGISTERED",
              "NOT_REGISTERED",
              "UNKNOWN"
            ]
          },
          "residency": {
            "type": "string",
            "enum": [
              "CANADA",
              "NON_RESIDENT",
              "UNKNOWN"
            ]
          },
          "acceptance": {
            "type": "object",
            "properties": {
              "state": {
                "type": "string",
                "enum": [
                  "PENDING_ACCEPTANCE",
                  "ACCEPTED",
                  "REFUSED",
                  "NOT_REVIEWED"
                ]
              },
              "by": {
                "anyOf": [
                  {
                    "type": "object",
                    "properties": {
                      "id": {
                        "type": "string"
                      },
                      "name": {
                        "type": "string"
                      }
                    },
                    "required": [
                      "id",
                      "name"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "at": {
                "anyOf": [
                  {
                    "type": "string",
                    "minLength": 20
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "note": {
                "type": [
                  "string",
                  "null"
                ]
              }
            },
            "required": [
              "state",
              "by",
              "at",
              "note"
            ],
            "additionalProperties": false
          },
          "addressLine1": {
            "type": [
              "string",
              "null"
            ]
          },
          "addressLine2": {
            "type": [
              "string",
              "null"
            ]
          },
          "city": {
            "type": [
              "string",
              "null"
            ]
          },
          "region": {
            "type": [
              "string",
              "null"
            ]
          },
          "postalCode": {
            "type": [
              "string",
              "null"
            ]
          },
          "country": {
            "type": "string"
          },
          "status": {
            "type": "string",
            "enum": [
              "ACTIVE",
              "ARCHIVED"
            ]
          },
          "archivedAt": {
            "anyOf": [
              {
                "type": "string",
                "minLength": 20
              },
              {
                "type": "null"
              }
            ]
          },
          "bankingState": {
            "type": "string",
            "enum": [
              "NONE",
              "PENDING",
              "VERIFIED"
            ]
          },
          "mergedInto": {
            "default": null,
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string"
                  },
                  "displayName": {
                    "type": "string"
                  }
                },
                "required": [
                  "id",
                  "displayName"
                ],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ]
          },
          "createdAt": {
            "type": "string",
            "minLength": 20
          },
          "updatedAt": {
            "type": "string",
            "minLength": 20
          },
          "customFields": {
            "$ref": "#/components/schemas/CustomFields2"
          }
        },
        "required": [
          "id",
          "displayName",
          "legalName",
          "taxNumber",
          "paymentTerms",
          "email",
          "phone",
          "address",
          "defaultCurrency",
          "language",
          "qstNumber",
          "gstRegistrationState",
          "residency",
          "acceptance",
          "addressLine1",
          "addressLine2",
          "city",
          "region",
          "postalCode",
          "country",
          "status",
          "archivedAt",
          "bankingState",
          "mergedInto",
          "createdAt",
          "updatedAt"
        ],
        "additionalProperties": false
      },
      "LiveOption1": {
        "type": "object",
        "properties": {
          "ruleId": {
            "type": "string"
          },
          "status": {
            "type": "string",
            "enum": [
              "PROPOSED",
              "ACTIVE",
              "DISCARDED",
              "RETIRED"
            ]
          },
          "origin": {
            "type": "string",
            "enum": [
              "WRITTEN",
              "LEARNED"
            ]
          },
          "authorName": {
            "type": "string"
          },
          "authorId": {
            "type": "string"
          },
          "createdAt": {
            "type": "string",
            "minLength": 20
          },
          "expiresAt": {
            "anyOf": [
              {
                "type": "string",
                "minLength": 20
              },
              {
                "type": "null"
              }
            ]
          },
          "expiresOn": {
            "anyOf": [
              {
                "type": "string",
                "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
              },
              {
                "type": "null"
              }
            ]
          },
          "expired": {
            "type": "boolean"
          },
          "entity": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string"
                  },
                  "name": {
                    "type": "string"
                  }
                },
                "required": [
                  "id",
                  "name"
                ],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ]
          },
          "interpretation": {
            "type": "string"
          },
          "fields": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "field": {
                  "type": "string",
                  "enum": [
                    "ACCOUNT",
                    "SUPPLY_CATEGORY",
                    "ITC_KIND",
                    "COMMERCIAL_USE",
                    "PROVINCIAL_SERVICE",
                    "PROPERTY_REGION",
                    "DIMENSION"
                  ]
                },
                "dimensionTypeId": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "valueLabel": {
                  "type": "string"
                },
                "state": {
                  "type": "string",
                  "enum": [
                    "FILLING",
                    "PAUSED",
                    "EXPECTING"
                  ]
                },
                "pausedWhy": {
                  "type": [
                    "string",
                    "null"
                  ]
                }
              },
              "required": [
                "field",
                "dimensionTypeId",
                "valueLabel",
                "state",
                "pausedWhy"
              ],
              "additionalProperties": false
            }
          },
          "stats": {
            "$ref": "#/components/schemas/FillStatsOption1"
          },
          "replacesRuleId": {
            "type": [
              "string",
              "null"
            ]
          },
          "previewId": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "ruleId",
          "status",
          "origin",
          "authorName",
          "authorId",
          "createdAt",
          "expiresAt",
          "expiresOn",
          "expired",
          "entity",
          "interpretation",
          "fields",
          "stats",
          "replacesRuleId",
          "previewId"
        ],
        "additionalProperties": false
      },
      "Mark": {
        "type": "object",
        "properties": {
          "importId": {
            "type": "string"
          },
          "lineNumber": {
            "type": "integer",
            "minimum": 1,
            "maximum": 9007199254740991
          },
          "documentId": {
            "type": "string"
          },
          "fileName": {
            "type": "string"
          },
          "fileSha256": {
            "type": "string",
            "pattern": "^[0-9a-f]{64}$"
          },
          "sourceSystem": {
            "type": "string",
            "enum": [
              "QUICKBOOKS_ONLINE",
              "QUICKBOOKS_DESKTOP",
              "XERO",
              "SAGE_50",
              "SPREADSHEET",
              "OTHER"
            ]
          },
          "sourceSystemLabel": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 80
              },
              {
                "type": "null"
              }
            ]
          },
          "sourceRef": {
            "type": [
              "string",
              "null"
            ]
          },
          "uploadedBy": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "name": {
                "type": "string"
              }
            },
            "required": [
              "id",
              "name"
            ],
            "additionalProperties": false
          },
          "approvedBy": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "name": {
                "type": "string"
              }
            },
            "required": [
              "id",
              "name"
            ],
            "additionalProperties": false
          },
          "approvedAt": {
            "type": "string",
            "minLength": 20
          }
        },
        "required": [
          "importId",
          "lineNumber",
          "documentId",
          "fileName",
          "fileSha256",
          "sourceSystem",
          "sourceSystemLabel",
          "sourceRef",
          "uploadedBy",
          "approvedBy",
          "approvedAt"
        ],
        "additionalProperties": false
      },
      "Need": {
        "type": "object",
        "properties": {
          "text": {
            "type": "string",
            "minLength": 8,
            "maxLength": 600
          },
          "source": {
            "type": "string",
            "enum": [
              "STANDARD",
              "AGENT_DRAFT",
              "AGENT_DRAFT_EDITED",
              "PERSON"
            ]
          },
          "promptVersion": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "text",
          "source",
          "promptVersion"
        ],
        "additionalProperties": false
      },
      "OpenDraft": {
        "anyOf": [
          {
            "type": "object",
            "properties": {
              "noticeId": {
                "type": "string"
              },
              "byName": {
                "type": "string"
              },
              "recipientEmail": {
                "type": "string"
              }
            },
            "required": [
              "noticeId",
              "byName",
              "recipientEmail"
            ],
            "additionalProperties": false
          },
          {
            "type": "null"
          }
        ]
      },
      "Owner": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "seated": {
            "type": "boolean"
          },
          "because": {
            "type": "string",
            "enum": [
              "SUPPLIER_OWNER",
              "SUPPLIER_CONTACT",
              "ADDRESS_WATCHER",
              "LINK_ISSUER",
              "POLICY_AUTHOR",
              "RAISER",
              "NAMED"
            ]
          }
        },
        "required": [
          "id",
          "name",
          "seated",
          "because"
        ],
        "additionalProperties": false
      },
      "PaperFacts": {
        "anyOf": [
          {
            "oneOf": [
              {
                "type": "object",
                "properties": {
                  "kind": {
                    "type": "string",
                    "const": "DOCUMENT_REQUESTED"
                  },
                  "common": {
                    "$ref": "#/components/schemas/Common"
                  },
                  "items": {
                    "minItems": 1,
                    "maxItems": 12,
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "documentKind": {
                          "type": "string",
                          "enum": [
                            "WSIB_CLEARANCE",
                            "INSURANCE_CERTIFICATE",
                            "MASTER_AGREEMENT",
                            "W8BEN",
                            "DIRECT_DEPOSIT_FORM",
                            "WITHHOLDING_WAIVER",
                            "OTHER"
                          ]
                        },
                        "title": {
                          "anyOf": [
                            {
                              "type": "string",
                              "maxLength": 160
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "state": {
                          "type": "string",
                          "enum": [
                            "MISSING",
                            "LAPSED",
                            "EXPIRING"
                          ]
                        },
                        "validUntil": {
                          "anyOf": [
                            {
                              "type": "string",
                              "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        }
                      },
                      "required": [
                        "documentKind",
                        "title",
                        "state",
                        "validUntil"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "sentence": {
                    "$ref": "#/components/schemas/Paragraph"
                  }
                },
                "required": [
                  "kind",
                  "common",
                  "items",
                  "sentence"
                ],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "kind": {
                    "type": "string",
                    "const": "NON_RENEWAL_NOTICE"
                  },
                  "common": {
                    "$ref": "#/components/schemas/Common"
                  },
                  "agreement": {
                    "type": "object",
                    "properties": {
                      "name": {
                        "type": "string",
                        "maxLength": 160
                      },
                      "endsOn": {
                        "type": "string",
                        "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                      },
                      "noticeDays": {
                        "anyOf": [
                          {
                            "type": "integer",
                            "minimum": -9007199254740991,
                            "maximum": 9007199254740991
                          },
                          {
                            "type": "null"
                          }
                        ]
                      }
                    },
                    "required": [
                      "name",
                      "endsOn",
                      "noticeDays"
                    ],
                    "additionalProperties": false
                  },
                  "sentence": {
                    "$ref": "#/components/schemas/Paragraph"
                  }
                },
                "required": [
                  "kind",
                  "common",
                  "agreement",
                  "sentence"
                ],
                "additionalProperties": false
              }
            ]
          },
          {
            "type": "null"
          }
        ]
      },
      "Paragraph": {
        "anyOf": [
          {
            "$ref": "#/components/schemas/Need"
          },
          {
            "type": "null"
          }
        ]
      },
      "Pattern": {
        "anyOf": [
          {
            "type": "object",
            "properties": {
              "billId": {
                "type": "string"
              },
              "billNumber": {
                "type": [
                  "string",
                  "null"
                ]
              }
            },
            "required": [
              "billId",
              "billNumber"
            ],
            "additionalProperties": false
          },
          {
            "type": "null"
          }
        ]
      },
      "Payment": {
        "anyOf": [
          {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "runId": {
                "type": "string"
              },
              "paymentDate": {
                "type": "string",
                "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
              },
              "amountMinor": {
                "type": "string",
                "pattern": "^-?\\d+$"
              },
              "currency": {
                "type": "string",
                "pattern": "^[A-Z]{3}$"
              }
            },
            "required": [
              "id",
              "runId",
              "paymentDate",
              "amountMinor",
              "currency"
            ],
            "additionalProperties": false
          },
          {
            "type": "null"
          }
        ]
      },
      "PaymentTerms": {
        "anyOf": [
          {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "name": {
                "type": "string"
              },
              "netDays": {
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991
              },
              "discountBp": {
                "anyOf": [
                  {
                    "type": "integer",
                    "minimum": -9007199254740991,
                    "maximum": 9007199254740991
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "discountDays": {
                "anyOf": [
                  {
                    "type": "integer",
                    "minimum": -9007199254740991,
                    "maximum": 9007199254740991
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "interestMonthlyBp": {
                "anyOf": [
                  {
                    "type": "integer",
                    "minimum": -9007199254740991,
                    "maximum": 9007199254740991
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "interestAnnualBp": {
                "anyOf": [
                  {
                    "type": "integer",
                    "minimum": -9007199254740991,
                    "maximum": 9007199254740991
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "isDefault": {
                "type": "boolean"
              },
              "appliesTo": {
                "type": "string",
                "enum": [
                  "SALES",
                  "PURCHASES",
                  "BOTH"
                ]
              }
            },
            "required": [
              "id",
              "name",
              "netDays",
              "discountBp",
              "discountDays",
              "interestMonthlyBp",
              "interestAnnualBp",
              "isDefault",
              "appliesTo"
            ],
            "additionalProperties": false
          },
          {
            "type": "null"
          }
        ]
      },
      "Period2": {
        "type": "object",
        "properties": {
          "from": {
            "type": "string",
            "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
          },
          "to": {
            "type": "string",
            "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
          }
        },
        "required": [
          "from",
          "to"
        ],
        "additionalProperties": false
      },
      "Plan": {
        "type": "object",
        "properties": {
          "plannedOn": {
            "anyOf": [
              {
                "type": "string",
                "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
              },
              {
                "type": "null"
              }
            ]
          },
          "plannedBy": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string"
                  },
                  "name": {
                    "type": "string"
                  }
                },
                "required": [
                  "id",
                  "name"
                ],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ]
          },
          "plannedAt": {
            "anyOf": [
              {
                "type": "string",
                "minLength": 20
              },
              {
                "type": "null"
              }
            ]
          },
          "findings": {
            "$ref": "#/components/schemas/Findings"
          }
        },
        "required": [
          "plannedOn",
          "plannedBy",
          "plannedAt",
          "findings"
        ],
        "additionalProperties": false
      },
      "PlanBillResponse": {
        "type": "object",
        "properties": {
          "billId": {
            "type": "string"
          },
          "changed": {
            "type": "boolean"
          },
          "plan": {
            "$ref": "#/components/schemas/Plan"
          },
          "previousOn": {
            "anyOf": [
              {
                "type": "string",
                "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "billId",
          "changed",
          "plan",
          "previousOn"
        ],
        "additionalProperties": false
      },
      "PreviewRuleResponse": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "ruleId": {
            "type": "string"
          },
          "ruleVersion": {
            "type": "integer",
            "exclusiveMinimum": 0,
            "maximum": 9007199254740991
          },
          "consideredCount": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "matchedCount": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "skippedForCurrency": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "totalMinor": {
            "type": "string",
            "pattern": "^-?\\d+$"
          },
          "largestMinor": {
            "type": "string",
            "pattern": "^-?\\d+$"
          },
          "currency": {
            "type": "string"
          },
          "matched": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "entryId": {
                  "type": "string"
                },
                "entryRef": {
                  "type": "string"
                },
                "entryDate": {
                  "type": "string"
                },
                "memo": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "amountMinor": {
                  "type": "string",
                  "pattern": "^-?\\d+$"
                },
                "currency": {
                  "type": "string"
                }
              },
              "required": [
                "entryId",
                "entryRef",
                "entryDate",
                "memo",
                "amountMinor",
                "currency"
              ],
              "additionalProperties": false
            }
          },
          "createdAt": {
            "type": "string"
          },
          "expiresAt": {
            "type": "string"
          },
          "subject": {
            "default": "ENTRY",
            "type": "string",
            "enum": [
              "ENTRY",
              "BILL",
              "VENDOR",
              "RUN",
              "INVOICE"
            ]
          },
          "billMatched": {
            "default": [],
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "billId": {
                  "type": "string"
                },
                "revision": {
                  "type": "integer",
                  "minimum": -9007199254740991,
                  "maximum": 9007199254740991
                },
                "supplierName": {
                  "type": "string"
                },
                "number": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "totalMinor": {
                  "type": "string",
                  "pattern": "^-?\\d+$"
                },
                "currency": {
                  "type": "string"
                },
                "effect": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "desk": {
                          "$ref": "#/components/schemas/Desk"
                        },
                        "stageCount": {
                          "type": "integer",
                          "minimum": 1,
                          "maximum": 2
                        }
                      },
                      "required": [
                        "desk",
                        "stageCount"
                      ],
                      "additionalProperties": false
                    },
                    {
                      "type": "object",
                      "properties": {
                        "hold": {
                          "type": "boolean",
                          "const": true
                        },
                        "capReached": {
                          "type": "boolean"
                        }
                      },
                      "required": [
                        "hold",
                        "capReached"
                      ],
                      "additionalProperties": false
                    }
                  ]
                }
              },
              "required": [
                "billId",
                "revision",
                "supplierName",
                "number",
                "totalMinor",
                "currency",
                "effect"
              ],
              "additionalProperties": false
            }
          },
          "toleranceMatched": {
            "default": [],
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "billId": {
                  "type": "string"
                },
                "revision": {
                  "type": "integer",
                  "minimum": -9007199254740991,
                  "maximum": 9007199254740991
                },
                "supplierName": {
                  "type": "string"
                },
                "number": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "currency": {
                  "type": "string"
                },
                "totalMinor": {
                  "type": "string",
                  "pattern": "^-?\\d+$"
                },
                "tolerated": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "code": {
                        "type": "string",
                        "enum": [
                          "PO_PRICE_VARIANCE",
                          "PO_QUANTITY_VARIANCE",
                          "PO_OVER_BILLED",
                          "PO_NOT_RECEIVED"
                        ]
                      },
                      "line": {
                        "anyOf": [
                          {
                            "type": "integer",
                            "minimum": -9007199254740991,
                            "maximum": 9007199254740991
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "valueMinor": {
                        "type": "string",
                        "pattern": "^-?\\d+$"
                      },
                      "bp": {
                        "type": "integer",
                        "minimum": -9007199254740991,
                        "maximum": 9007199254740991
                      }
                    },
                    "required": [
                      "code",
                      "line",
                      "valueMinor",
                      "bp"
                    ],
                    "additionalProperties": false
                  }
                },
                "capReached": {
                  "type": "boolean"
                }
              },
              "required": [
                "billId",
                "revision",
                "supplierName",
                "number",
                "currency",
                "totalMinor",
                "tolerated",
                "capReached"
              ],
              "additionalProperties": false
            }
          },
          "cut": {
            "default": false,
            "type": "boolean"
          },
          "profileMatched": {
            "default": [],
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "billId": {
                  "type": "string"
                },
                "number": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "billDate": {
                  "type": "string",
                  "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                },
                "filled": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 9007199254740991
                },
                "agrees": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 9007199254740991
                },
                "differs": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "position": {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 9007199254740991
                      },
                      "field": {
                        "type": "string"
                      },
                      "profile": {
                        "type": "string"
                      },
                      "approved": {
                        "type": "string"
                      }
                    },
                    "required": [
                      "position",
                      "field",
                      "profile",
                      "approved"
                    ],
                    "additionalProperties": false
                  }
                }
              },
              "required": [
                "billId",
                "number",
                "billDate",
                "filled",
                "agrees",
                "differs"
              ],
              "additionalProperties": false
            }
          },
          "runWeeks": {
            "default": [],
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "weekStart": {
                  "type": "string",
                  "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                },
                "passOn": {
                  "type": "string",
                  "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                },
                "consideredCount": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 9007199254740991
                },
                "cut": {
                  "type": "boolean"
                },
                "takenCount": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 9007199254740991
                },
                "takenAppliedMinor": {
                  "type": "string",
                  "pattern": "^-?\\d+$"
                },
                "takenCashMinor": {
                  "type": "string",
                  "pattern": "^-?\\d+$"
                },
                "lines": {
                  "maxItems": 500,
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/LinesItem2"
                  }
                }
              },
              "required": [
                "weekStart",
                "passOn",
                "consideredCount",
                "cut",
                "takenCount",
                "takenAppliedMinor",
                "takenCashMinor",
                "lines"
              ],
              "additionalProperties": false
            }
          }
        },
        "required": [
          "id",
          "ruleId",
          "ruleVersion",
          "consideredCount",
          "matchedCount",
          "skippedForCurrency",
          "totalMinor",
          "largestMinor",
          "currency",
          "matched",
          "createdAt",
          "expiresAt",
          "subject",
          "billMatched",
          "toleranceMatched",
          "cut",
          "profileMatched",
          "runWeeks"
        ],
        "additionalProperties": false
      },
      "PriorMethods": {
        "maxItems": 8,
        "type": "array",
        "items": {
          "type": "object",
          "properties": {
            "method": {
              "type": "string",
              "enum": [
                "RUN",
                "CARD",
                "PAD",
                "ACCOUNT",
                "CHEQUE",
                "WIRE",
                "ETRANSFER",
                "OTHER"
              ]
            },
            "count": {
              "type": "integer",
              "exclusiveMinimum": 0,
              "maximum": 9007199254740991
            }
          },
          "required": [
            "method",
            "count"
          ],
          "additionalProperties": false
        }
      },
      "ProblemDetails": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "status": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991
          },
          "detail": {
            "type": "string"
          },
          "code": {
            "$ref": "#/components/schemas/Code"
          },
          "requestId": {
            "type": [
              "string",
              "null"
            ]
          },
          "fields": {
            "type": "object",
            "propertyNames": {
              "type": "string"
            },
            "additionalProperties": {
              "type": "string"
            }
          },
          "remedy": {
            "type": "string"
          },
          "maxBytes": {
            "type": "integer",
            "exclusiveMinimum": 0,
            "maximum": 9007199254740991
          }
        },
        "required": [
          "type",
          "title",
          "status",
          "detail",
          "code"
        ],
        "additionalProperties": false
      },
      "ProposedKeys": {
        "maxItems": 11,
        "type": "array",
        "items": {
          "$ref": "#/components/schemas/KeysItem"
        }
      },
      "PurchaseOrderLine": {
        "anyOf": [
          {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "orderId": {
                "type": "string"
              },
              "orderNumber": {
                "type": "string"
              },
              "position": {
                "type": "integer",
                "minimum": 0,
                "maximum": 9007199254740991
              }
            },
            "required": [
              "id",
              "orderId",
              "orderNumber",
              "position"
            ],
            "additionalProperties": false
          },
          {
            "type": "null"
          }
        ]
      },
      "Quote": {
        "anyOf": [
          {
            "type": "object",
            "properties": {
              "documentId": {
                "type": "string"
              },
              "fileName": {
                "type": "string"
              },
              "promptVersion": {
                "type": "string"
              },
              "linesRead": {
                "type": "integer",
                "minimum": 0,
                "maximum": 9007199254740991
              },
              "linesKept": {
                "type": "integer",
                "minimum": 0,
                "maximum": 9007199254740991
              }
            },
            "required": [
              "documentId",
              "fileName",
              "promptVersion",
              "linesRead",
              "linesKept"
            ],
            "additionalProperties": false
          },
          {
            "type": "null"
          }
        ]
      },
      "Quotes": {
        "type": "array",
        "items": {
          "type": "object",
          "properties": {
            "ask": {
              "type": "string",
              "enum": [
                "SEE_WHAT_YOU_HOLD",
                "REMOVE_CONTACT_DETAILS",
                "REMOVE_BANK_ACCOUNT",
                "REMOVE_EVERYTHING",
                "CORRECT_DETAILS",
                "OTHER"
              ]
            },
            "quote": {
              "type": "string"
            }
          },
          "required": [
            "ask",
            "quote"
          ],
          "additionalProperties": false
        }
      },
      "RaiseVendorQueryResponse": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "reference": {
            "type": "string",
            "pattern": "^Q-[0-9A-F]{10}$"
          },
          "title": {
            "type": "string"
          },
          "status": {
            "type": "string",
            "enum": [
              "OPEN",
              "RESOLVED",
              "SET_ASIDE"
            ]
          },
          "turn": {
            "anyOf": [
              {
                "type": "string",
                "enum": [
                  "US",
                  "SUPPLIER"
                ]
              },
              {
                "type": "null"
              }
            ]
          },
          "vendor": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "displayName": {
                "type": "string"
              }
            },
            "required": [
              "id",
              "displayName"
            ],
            "additionalProperties": false
          },
          "entityId": {
            "type": "string"
          },
          "entityName": {
            "type": "string"
          },
          "entityTimeZone": {
            "type": "string"
          },
          "subject": {
            "$ref": "#/components/schemas/Subject2"
          },
          "origin": {
            "type": "string",
            "enum": [
              "PORTAL",
              "EMAIL",
              "RECORDED",
              "OURS"
            ]
          },
          "raisedAt": {
            "type": "string",
            "minLength": 20
          },
          "lastMessageAt": {
            "type": "string",
            "minLength": 20
          },
          "messageCount": {
            "type": "integer",
            "minimum": 1,
            "maximum": 9007199254740991
          },
          "owner": {
            "$ref": "#/components/schemas/Owner"
          },
          "mentionsBanking": {
            "type": "boolean"
          },
          "filedUnder": {
            "$ref": "#/components/schemas/FiledUnder"
          },
          "questionId": {
            "type": [
              "string",
              "null"
            ]
          },
          "followsQueryId": {
            "type": [
              "string",
              "null"
            ]
          },
          "aboutMinor": {
            "anyOf": [
              {
                "type": "string",
                "pattern": "^-?\\d+$"
              },
              {
                "type": "null"
              }
            ]
          },
          "aboutCurrency": {
            "anyOf": [
              {
                "type": "string",
                "pattern": "^[A-Z]{3}$"
              },
              {
                "type": "null"
              }
            ]
          },
          "waitingSince": {
            "anyOf": [
              {
                "type": "string",
                "minLength": 20
              },
              {
                "type": "null"
              }
            ]
          },
          "closedAt": {
            "anyOf": [
              {
                "type": "string",
                "minLength": 20
              },
              {
                "type": "null"
              }
            ]
          },
          "sentence": {
            "type": "string"
          },
          "draftPausedUntil": {
            "anyOf": [
              {
                "type": "string",
                "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
              },
              {
                "type": "null"
              }
            ]
          },
          "raisedBy": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string"
                  },
                  "name": {
                    "type": "string"
                  }
                },
                "required": [
                  "id",
                  "name"
                ],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ]
          },
          "arrival": {
            "$ref": "#/components/schemas/Arrival"
          },
          "linkIssuer": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string"
                  },
                  "name": {
                    "type": "string"
                  }
                },
                "required": [
                  "id",
                  "name"
                ],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ]
          },
          "closure": {
            "$ref": "#/components/schemas/Closure"
          },
          "follows": {
            "$ref": "#/components/schemas/Follows"
          },
          "blocked": {
            "$ref": "#/components/schemas/Blocked"
          },
          "answerableBy": {
            "$ref": "#/components/schemas/AnswerableBy"
          }
        },
        "required": [
          "id",
          "reference",
          "title",
          "status",
          "turn",
          "vendor",
          "entityId",
          "entityName",
          "entityTimeZone",
          "subject",
          "origin",
          "raisedAt",
          "lastMessageAt",
          "messageCount",
          "owner",
          "mentionsBanking",
          "filedUnder",
          "questionId",
          "followsQueryId",
          "aboutMinor",
          "aboutCurrency",
          "waitingSince",
          "closedAt",
          "sentence",
          "draftPausedUntil",
          "raisedBy",
          "arrival",
          "linkIssuer",
          "closure",
          "follows",
          "blocked",
          "answerableBy"
        ],
        "additionalProperties": false
      },
      "Reading": {
        "anyOf": [
          {
            "type": "object",
            "properties": {
              "verdict": {
                "type": "string",
                "enum": [
                  "SAME",
                  "DIFFERENT",
                  "UNSURE"
                ]
              },
              "quote": {
                "type": "string",
                "minLength": 1,
                "maxLength": 80
              },
              "note": {
                "type": "string",
                "maxLength": 160
              },
              "promptVersion": {
                "type": "string"
              },
              "readBy": {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string"
                  },
                  "name": {
                    "type": "string"
                  }
                },
                "required": [
                  "id",
                  "name"
                ],
                "additionalProperties": false
              },
              "readAt": {
                "type": "string",
                "minLength": 20
              }
            },
            "required": [
              "verdict",
              "quote",
              "note",
              "promptVersion",
              "readBy",
              "readAt"
            ],
            "additionalProperties": false
          },
          {
            "type": "null"
          }
        ]
      },
      "Reason": {
        "anyOf": [
          {
            "type": "string",
            "enum": [
              "REPLIES_OFF",
              "REPLIES_EXPIRED",
              "NO_CONTACT",
              "OUTBOUND_NOT_APPROVED",
              "RELAY_REFUSED",
              "PERSON_DRAFTED",
              "NO_SENDER",
              "OWN_DOMAIN",
              "AUTO_SUBMITTED",
              "UNAUTHENTICATED_STRANGER",
              "RECIPIENT_STOPPED",
              "RECIPIENT_BOUNCED",
              "FOLDED_INTO_DIGEST",
              "LEDGER_DAILY_CAP",
              "DISCARDED",
              "TEST_COPY_HELD"
            ]
          },
          {
            "type": "null"
          }
        ]
      },
      "Receipt": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "purchaseOrderId": {
            "type": "string"
          },
          "orderNumber": {
            "type": [
              "string",
              "null"
            ]
          },
          "sequence": {
            "type": "integer",
            "minimum": 1,
            "maximum": 9007199254740991
          },
          "status": {
            "type": "string",
            "enum": [
              "PROPOSED",
              "CONFIRMED",
              "VOID",
              "DISCARDED"
            ]
          },
          "source": {
            "type": "string",
            "enum": [
              "MANUAL",
              "SLIP_READ",
              "SLIP_MAILED"
            ]
          },
          "entity": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "name": {
                "type": "string"
              }
            },
            "required": [
              "id",
              "name"
            ],
            "additionalProperties": false
          },
          "entityTimeZone": {
            "type": "string"
          },
          "receivedOn": {
            "anyOf": [
              {
                "type": "string",
                "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
              },
              {
                "type": "null"
              }
            ]
          },
          "receivedBy": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string"
                  },
                  "name": {
                    "type": "string"
                  }
                },
                "required": [
                  "id",
                  "name"
                ],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ]
          },
          "onBehalfOf": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string"
                  },
                  "name": {
                    "type": "string"
                  }
                },
                "required": [
                  "id",
                  "name"
                ],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ]
          },
          "lineCount": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "attachmentCount": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "proposedAt": {
            "anyOf": [
              {
                "type": "string",
                "minLength": 20
              },
              {
                "type": "null"
              }
            ]
          },
          "voided": {
            "$ref": "#/components/schemas/Retired"
          },
          "discarded": {
            "$ref": "#/components/schemas/Retired"
          },
          "signedForBy": {
            "type": [
              "string",
              "null"
            ]
          },
          "note": {
            "type": [
              "string",
              "null"
            ]
          },
          "lines": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string"
                },
                "purchaseOrderLineId": {
                  "type": "string"
                },
                "position": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 9007199254740991
                },
                "description": {
                  "type": "string"
                },
                "supplyCategory": {
                  "anyOf": [
                    {
                      "type": "string",
                      "enum": [
                        "GOODS",
                        "SERVICES",
                        "INTANGIBLE_PROPERTY",
                        "REAL_PROPERTY"
                      ]
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "quantity": {
                  "type": "string",
                  "pattern": "^\\d{1,10}(\\.\\d{1,4})?$"
                },
                "ordered": {
                  "type": "string",
                  "pattern": "^\\d{1,10}(\\.\\d{1,4})?$"
                },
                "slipQuantity": {
                  "anyOf": [
                    {
                      "type": "string",
                      "pattern": "^\\d{1,10}(\\.\\d{1,4})?$"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "slipDescription": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "note": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "customFields": {
                  "type": "object",
                  "propertyNames": {
                    "type": "string"
                  },
                  "additionalProperties": {
                    "type": [
                      "string",
                      "boolean"
                    ]
                  }
                },
                "carriedFrom": {
                  "type": [
                    "string",
                    "null"
                  ]
                }
              },
              "required": [
                "id",
                "purchaseOrderLineId",
                "position",
                "description",
                "supplyCategory",
                "quantity",
                "ordered",
                "slipQuantity",
                "slipDescription",
                "note"
              ],
              "additionalProperties": false
            }
          },
          "evidence": {
            "maxItems": 32,
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string"
                },
                "documentId": {
                  "type": "string"
                },
                "fileName": {
                  "type": "string"
                },
                "mimeType": {
                  "type": "string"
                },
                "caption": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "isImage": {
                  "type": "boolean"
                },
                "addedBy": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "name": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "id",
                    "name"
                  ],
                  "additionalProperties": false
                },
                "addedAt": {
                  "type": "string",
                  "minLength": 20
                },
                "withdrawn": {
                  "$ref": "#/components/schemas/Retired"
                }
              },
              "required": [
                "id",
                "documentId",
                "fileName",
                "mimeType",
                "caption",
                "isImage",
                "addedBy",
                "addedAt",
                "withdrawn"
              ],
              "additionalProperties": false
            }
          },
          "separation": {
            "type": "object",
            "properties": {
              "applied": {
                "type": "boolean"
              },
              "approver": {
                "type": [
                  "string",
                  "null"
                ]
              }
            },
            "required": [
              "applied",
              "approver"
            ],
            "additionalProperties": false
          },
          "overPercentApplied": {
            "type": "string"
          },
          "proposal": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "promptVersion": {
                    "type": "string"
                  },
                  "linesRead": {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 9007199254740991
                  },
                  "linesKept": {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 9007199254740991
                  },
                  "arrival": {
                    "type": "object",
                    "properties": {
                      "inboundEmailId": {
                        "type": "string"
                      },
                      "senderDomain": {
                        "type": "string"
                      },
                      "authentication": {
                        "type": "string",
                        "enum": [
                          "PASSED",
                          "FAILED",
                          "UNRECORDED"
                        ]
                      },
                      "domainKnown": {
                        "type": "boolean"
                      },
                      "warnings": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    },
                    "required": [
                      "inboundEmailId",
                      "senderDomain",
                      "authentication",
                      "domainKnown",
                      "warnings"
                    ],
                    "additionalProperties": false
                  }
                },
                "required": [
                  "promptVersion",
                  "linesRead",
                  "linesKept",
                  "arrival"
                ],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ]
          },
          "counts": {
            "type": "object",
            "properties": {
              "audit": {
                "type": "integer",
                "minimum": 0,
                "maximum": 9007199254740991
              }
            },
            "required": [
              "audit"
            ],
            "additionalProperties": false
          }
        },
        "required": [
          "id",
          "purchaseOrderId",
          "orderNumber",
          "sequence",
          "status",
          "source",
          "entity",
          "entityTimeZone",
          "receivedOn",
          "receivedBy",
          "onBehalfOf",
          "lineCount",
          "attachmentCount",
          "proposedAt",
          "voided",
          "discarded",
          "signedForBy",
          "note",
          "lines",
          "evidence",
          "separation",
          "overPercentApplied",
          "proposal",
          "counts"
        ],
        "additionalProperties": false
      },
      "Recipients": {
        "type": "array",
        "items": {
          "$ref": "#/components/schemas/RecipientsItem"
        }
      },
      "RecipientsItem": {
        "type": "object",
        "properties": {
          "email": {
            "type": "string"
          },
          "name": {
            "type": [
              "string",
              "null"
            ]
          },
          "role": {
            "anyOf": [
              {
                "type": "string",
                "enum": [
                  "BILLING",
                  "ACCOUNT_MANAGER",
                  "ESCALATION",
                  "REMITTANCE"
                ]
              },
              {
                "type": "null"
              }
            ]
          },
          "source": {
            "type": "string",
            "enum": [
              "VENDOR",
              "CONTACT"
            ]
          }
        },
        "required": [
          "email",
          "name",
          "role",
          "source"
        ],
        "additionalProperties": false
      },
      "Record": {
        "oneOf": [
          {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "occurredOn": {
                "type": "string",
                "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
              },
              "occurredAt": {
                "anyOf": [
                  {
                    "type": "string",
                    "minLength": 20
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "occurredZone": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "periodYear": {
                "anyOf": [
                  {
                    "type": "integer",
                    "minimum": -9007199254740991,
                    "maximum": 9007199254740991
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "periodMonth": {
                "anyOf": [
                  {
                    "type": "integer",
                    "minimum": -9007199254740991,
                    "maximum": 9007199254740991
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "subject": {
                "type": "string"
              },
              "entityId": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "entityName": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "payloadVersion": {
                "type": "integer",
                "minimum": 1,
                "maximum": 9007199254740991
              },
              "mark": {
                "$ref": "#/components/schemas/Mark"
              },
              "createdAt": {
                "type": "string",
                "minLength": 20
              },
              "vendor": {
                "$ref": "#/components/schemas/Vendor"
              },
              "kind": {
                "type": "string",
                "const": "AUDIT_LINE"
              },
              "payload": {
                "type": "object",
                "properties": {
                  "actorName": {
                    "anyOf": [
                      {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 500
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "actorEmail": {
                    "anyOf": [
                      {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 500
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "action": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 500
                  },
                  "targetDescription": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 500
                  },
                  "amountMinor": {
                    "anyOf": [
                      {
                        "type": "string",
                        "pattern": "^-?\\d+$"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "currency": {
                    "anyOf": [
                      {
                        "type": "string",
                        "pattern": "^[A-Z]{3}$"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "before": {
                    "anyOf": [
                      {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 500
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "after": {
                    "anyOf": [
                      {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 500
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "note": {
                    "anyOf": [
                      {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 500
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "zoneAssumed": {
                    "type": "boolean"
                  }
                },
                "required": [
                  "actorName",
                  "actorEmail",
                  "action",
                  "targetDescription",
                  "amountMinor",
                  "currency",
                  "before",
                  "after",
                  "note",
                  "zoneAssumed"
                ],
                "additionalProperties": false
              }
            },
            "required": [
              "id",
              "occurredOn",
              "occurredAt",
              "occurredZone",
              "periodYear",
              "periodMonth",
              "subject",
              "entityId",
              "entityName",
              "payloadVersion",
              "mark",
              "createdAt",
              "vendor",
              "kind",
              "payload"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "occurredOn": {
                "type": "string",
                "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
              },
              "occurredAt": {
                "anyOf": [
                  {
                    "type": "string",
                    "minLength": 20
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "occurredZone": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "periodYear": {
                "anyOf": [
                  {
                    "type": "integer",
                    "minimum": -9007199254740991,
                    "maximum": 9007199254740991
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "periodMonth": {
                "anyOf": [
                  {
                    "type": "integer",
                    "minimum": -9007199254740991,
                    "maximum": 9007199254740991
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "subject": {
                "type": "string"
              },
              "entityId": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "entityName": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "payloadVersion": {
                "type": "integer",
                "minimum": 1,
                "maximum": 9007199254740991
              },
              "mark": {
                "$ref": "#/components/schemas/Mark"
              },
              "createdAt": {
                "type": "string",
                "minLength": 20
              },
              "vendor": {
                "$ref": "#/components/schemas/Vendor"
              },
              "kind": {
                "type": "string",
                "const": "CONTROL_FIRING"
              },
              "payload": {
                "type": "object",
                "properties": {
                  "controlName": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 500
                  },
                  "outcome": {
                    "type": "string",
                    "enum": [
                      "AUTO_APPROVED",
                      "ROUTED",
                      "REFUSED",
                      "CHANGED"
                    ]
                  },
                  "subjectRef": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 500
                  },
                  "amountMinor": {
                    "anyOf": [
                      {
                        "type": "string",
                        "pattern": "^-?\\d+$"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "currency": {
                    "anyOf": [
                      {
                        "type": "string",
                        "pattern": "^[A-Z]{3}$"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "actorName": {
                    "anyOf": [
                      {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 500
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "reason": {
                    "anyOf": [
                      {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 500
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                },
                "required": [
                  "controlName",
                  "outcome",
                  "subjectRef",
                  "amountMinor",
                  "currency",
                  "actorName",
                  "reason"
                ],
                "additionalProperties": false
              }
            },
            "required": [
              "id",
              "occurredOn",
              "occurredAt",
              "occurredZone",
              "periodYear",
              "periodMonth",
              "subject",
              "entityId",
              "entityName",
              "payloadVersion",
              "mark",
              "createdAt",
              "vendor",
              "kind",
              "payload"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "occurredOn": {
                "type": "string",
                "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
              },
              "occurredAt": {
                "anyOf": [
                  {
                    "type": "string",
                    "minLength": 20
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "occurredZone": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "periodYear": {
                "anyOf": [
                  {
                    "type": "integer",
                    "minimum": -9007199254740991,
                    "maximum": 9007199254740991
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "periodMonth": {
                "anyOf": [
                  {
                    "type": "integer",
                    "minimum": -9007199254740991,
                    "maximum": 9007199254740991
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "subject": {
                "type": "string"
              },
              "entityId": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "entityName": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "payloadVersion": {
                "type": "integer",
                "minimum": 1,
                "maximum": 9007199254740991
              },
              "mark": {
                "$ref": "#/components/schemas/Mark"
              },
              "createdAt": {
                "type": "string",
                "minLength": 20
              },
              "vendor": {
                "$ref": "#/components/schemas/Vendor"
              },
              "kind": {
                "type": "string",
                "const": "PERIOD_LOCK"
              },
              "payload": {
                "type": "object",
                "properties": {
                  "lockedThrough": {
                    "anyOf": [
                      {
                        "type": "string",
                        "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "scope": {
                    "anyOf": [
                      {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 500
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "subledger": {
                    "anyOf": [
                      {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 500
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "lockedByName": {
                    "anyOf": [
                      {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 500
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "lockedOn": {
                    "anyOf": [
                      {
                        "type": "string",
                        "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "unlockedOn": {
                    "anyOf": [
                      {
                        "type": "string",
                        "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "unlockedByName": {
                    "anyOf": [
                      {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 500
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "reason": {
                    "anyOf": [
                      {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 500
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                },
                "required": [
                  "lockedThrough",
                  "scope",
                  "subledger",
                  "lockedByName",
                  "lockedOn",
                  "unlockedOn",
                  "unlockedByName",
                  "reason"
                ],
                "additionalProperties": false
              }
            },
            "required": [
              "id",
              "occurredOn",
              "occurredAt",
              "occurredZone",
              "periodYear",
              "periodMonth",
              "subject",
              "entityId",
              "entityName",
              "payloadVersion",
              "mark",
              "createdAt",
              "vendor",
              "kind",
              "payload"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "occurredOn": {
                "type": "string",
                "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
              },
              "occurredAt": {
                "anyOf": [
                  {
                    "type": "string",
                    "minLength": 20
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "occurredZone": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "periodYear": {
                "anyOf": [
                  {
                    "type": "integer",
                    "minimum": -9007199254740991,
                    "maximum": 9007199254740991
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "periodMonth": {
                "anyOf": [
                  {
                    "type": "integer",
                    "minimum": -9007199254740991,
                    "maximum": 9007199254740991
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "subject": {
                "type": "string"
              },
              "entityId": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "entityName": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "payloadVersion": {
                "type": "integer",
                "minimum": 1,
                "maximum": 9007199254740991
              },
              "mark": {
                "$ref": "#/components/schemas/Mark"
              },
              "createdAt": {
                "type": "string",
                "minLength": 20
              },
              "vendor": {
                "$ref": "#/components/schemas/Vendor"
              },
              "kind": {
                "type": "string",
                "const": "REPORT_PACK"
              },
              "payload": {
                "type": "object",
                "properties": {
                  "title": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 500
                  },
                  "statusAsIssued": {
                    "anyOf": [
                      {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 500
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "issuedOn": {
                    "anyOf": [
                      {
                        "type": "string",
                        "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "issuedByName": {
                    "anyOf": [
                      {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 500
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                },
                "required": [
                  "title",
                  "statusAsIssued",
                  "issuedOn",
                  "issuedByName"
                ],
                "additionalProperties": false
              }
            },
            "required": [
              "id",
              "occurredOn",
              "occurredAt",
              "occurredZone",
              "periodYear",
              "periodMonth",
              "subject",
              "entityId",
              "entityName",
              "payloadVersion",
              "mark",
              "createdAt",
              "vendor",
              "kind",
              "payload"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "occurredOn": {
                "type": "string",
                "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
              },
              "occurredAt": {
                "anyOf": [
                  {
                    "type": "string",
                    "minLength": 20
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "occurredZone": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "periodYear": {
                "anyOf": [
                  {
                    "type": "integer",
                    "minimum": -9007199254740991,
                    "maximum": 9007199254740991
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "periodMonth": {
                "anyOf": [
                  {
                    "type": "integer",
                    "minimum": -9007199254740991,
                    "maximum": 9007199254740991
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "subject": {
                "type": "string"
              },
              "entityId": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "entityName": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "payloadVersion": {
                "type": "integer",
                "minimum": 1,
                "maximum": 9007199254740991
              },
              "mark": {
                "$ref": "#/components/schemas/Mark"
              },
              "createdAt": {
                "type": "string",
                "minLength": 20
              },
              "vendor": {
                "$ref": "#/components/schemas/Vendor"
              },
              "kind": {
                "type": "string",
                "const": "SLIP_FILE"
              },
              "payload": {
                "type": "object",
                "properties": {
                  "kind": {
                    "type": "string",
                    "enum": [
                      "T4A",
                      "T5018"
                    ]
                  },
                  "taxYear": {
                    "type": "integer",
                    "minimum": 1900,
                    "maximum": 2200
                  },
                  "periodEnd": {
                    "type": "string",
                    "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                  },
                  "slipCount": {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 1000000
                  },
                  "totalMinor": {
                    "type": "string",
                    "pattern": "^-?\\d+$"
                  },
                  "reportType": {
                    "anyOf": [
                      {
                        "type": "string",
                        "enum": [
                          "ORIGINAL",
                          "AMENDMENT"
                        ]
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "filedOn": {
                    "anyOf": [
                      {
                        "type": "string",
                        "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "confirmationNumber": {
                    "anyOf": [
                      {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 500
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                },
                "required": [
                  "kind",
                  "taxYear",
                  "periodEnd",
                  "slipCount",
                  "totalMinor",
                  "reportType",
                  "filedOn",
                  "confirmationNumber"
                ],
                "additionalProperties": false
              }
            },
            "required": [
              "id",
              "occurredOn",
              "occurredAt",
              "occurredZone",
              "periodYear",
              "periodMonth",
              "subject",
              "entityId",
              "entityName",
              "payloadVersion",
              "mark",
              "createdAt",
              "vendor",
              "kind",
              "payload"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "occurredOn": {
                "type": "string",
                "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
              },
              "occurredAt": {
                "anyOf": [
                  {
                    "type": "string",
                    "minLength": 20
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "occurredZone": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "periodYear": {
                "anyOf": [
                  {
                    "type": "integer",
                    "minimum": -9007199254740991,
                    "maximum": 9007199254740991
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "periodMonth": {
                "anyOf": [
                  {
                    "type": "integer",
                    "minimum": -9007199254740991,
                    "maximum": 9007199254740991
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "subject": {
                "type": "string"
              },
              "entityId": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "entityName": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "payloadVersion": {
                "type": "integer",
                "minimum": 1,
                "maximum": 9007199254740991
              },
              "mark": {
                "$ref": "#/components/schemas/Mark"
              },
              "createdAt": {
                "type": "string",
                "minLength": 20
              },
              "vendor": {
                "$ref": "#/components/schemas/Vendor"
              },
              "kind": {
                "type": "string",
                "const": "FX_RATE"
              },
              "payload": {
                "type": "object",
                "properties": {
                  "base": {
                    "type": "string",
                    "pattern": "^[A-Z]{3}$"
                  },
                  "quote": {
                    "type": "string",
                    "pattern": "^[A-Z]{3}$"
                  },
                  "rate": {
                    "type": "string",
                    "pattern": "^\\d{1,6}\\.\\d{6}$"
                  },
                  "rateSourceAsNamed": {
                    "anyOf": [
                      {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 500
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "note": {
                    "anyOf": [
                      {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 500
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                },
                "required": [
                  "base",
                  "quote",
                  "rate",
                  "rateSourceAsNamed",
                  "note"
                ],
                "additionalProperties": false
              }
            },
            "required": [
              "id",
              "occurredOn",
              "occurredAt",
              "occurredZone",
              "periodYear",
              "periodMonth",
              "subject",
              "entityId",
              "entityName",
              "payloadVersion",
              "mark",
              "createdAt",
              "vendor",
              "kind",
              "payload"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "occurredOn": {
                "type": "string",
                "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
              },
              "occurredAt": {
                "anyOf": [
                  {
                    "type": "string",
                    "minLength": 20
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "occurredZone": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "periodYear": {
                "anyOf": [
                  {
                    "type": "integer",
                    "minimum": -9007199254740991,
                    "maximum": 9007199254740991
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "periodMonth": {
                "anyOf": [
                  {
                    "type": "integer",
                    "minimum": -9007199254740991,
                    "maximum": 9007199254740991
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "subject": {
                "type": "string"
              },
              "entityId": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "entityName": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "payloadVersion": {
                "type": "integer",
                "minimum": 1,
                "maximum": 9007199254740991
              },
              "mark": {
                "$ref": "#/components/schemas/Mark"
              },
              "createdAt": {
                "type": "string",
                "minLength": 20
              },
              "vendor": {
                "$ref": "#/components/schemas/Vendor"
              },
              "kind": {
                "type": "string",
                "const": "SCHEDULE"
              },
              "payload": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 500
                  },
                  "templateType": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 500
                  },
                  "intervalText": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 500
                  },
                  "interval": {
                    "anyOf": [
                      {
                        "type": "object",
                        "properties": {
                          "unit": {
                            "type": "string",
                            "enum": [
                              "DAY",
                              "WEEK",
                              "MONTH",
                              "YEAR"
                            ]
                          },
                          "every": {
                            "type": "integer",
                            "minimum": 1,
                            "maximum": 366
                          }
                        },
                        "required": [
                          "unit",
                          "every"
                        ],
                        "additionalProperties": false
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "previousDate": {
                    "anyOf": [
                      {
                        "type": "string",
                        "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "nextDateInSource": {
                    "anyOf": [
                      {
                        "type": "string",
                        "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "endDate": {
                    "anyOf": [
                      {
                        "type": "string",
                        "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "counterpartyName": {
                    "anyOf": [
                      {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 500
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "amountMinor": {
                    "anyOf": [
                      {
                        "type": "string",
                        "pattern": "^-?\\d+$"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "currency": {
                    "anyOf": [
                      {
                        "type": "string",
                        "pattern": "^[A-Z]{3}$"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "activeInSource": {
                    "type": [
                      "boolean",
                      "null"
                    ]
                  }
                },
                "required": [
                  "name",
                  "templateType",
                  "intervalText",
                  "interval",
                  "previousDate",
                  "nextDateInSource",
                  "endDate",
                  "counterpartyName",
                  "amountMinor",
                  "currency",
                  "activeInSource"
                ],
                "additionalProperties": false
              }
            },
            "required": [
              "id",
              "occurredOn",
              "occurredAt",
              "occurredZone",
              "periodYear",
              "periodMonth",
              "subject",
              "entityId",
              "entityName",
              "payloadVersion",
              "mark",
              "createdAt",
              "vendor",
              "kind",
              "payload"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "occurredOn": {
                "type": "string",
                "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
              },
              "occurredAt": {
                "anyOf": [
                  {
                    "type": "string",
                    "minLength": 20
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "occurredZone": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "periodYear": {
                "anyOf": [
                  {
                    "type": "integer",
                    "minimum": -9007199254740991,
                    "maximum": 9007199254740991
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "periodMonth": {
                "anyOf": [
                  {
                    "type": "integer",
                    "minimum": -9007199254740991,
                    "maximum": 9007199254740991
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "subject": {
                "type": "string"
              },
              "entityId": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "entityName": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "payloadVersion": {
                "type": "integer",
                "minimum": 1,
                "maximum": 9007199254740991
              },
              "mark": {
                "$ref": "#/components/schemas/Mark"
              },
              "createdAt": {
                "type": "string",
                "minLength": 20
              },
              "vendor": {
                "$ref": "#/components/schemas/Vendor"
              },
              "kind": {
                "type": "string",
                "const": "QUEUE_DECISION"
              },
              "payload": {
                "type": "object",
                "properties": {
                  "recordType": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 500
                  },
                  "reference": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 500
                  },
                  "decision": {
                    "type": "string",
                    "enum": [
                      "APPROVED",
                      "DECLINED"
                    ]
                  },
                  "decidedByName": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 500
                  },
                  "submittedByName": {
                    "anyOf": [
                      {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 500
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "amountMinor": {
                    "anyOf": [
                      {
                        "type": "string",
                        "pattern": "^-?\\d+$"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "currency": {
                    "anyOf": [
                      {
                        "type": "string",
                        "pattern": "^[A-Z]{3}$"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "reason": {
                    "anyOf": [
                      {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 500
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                },
                "required": [
                  "recordType",
                  "reference",
                  "decision",
                  "decidedByName",
                  "submittedByName",
                  "amountMinor",
                  "currency",
                  "reason"
                ],
                "additionalProperties": false
              }
            },
            "required": [
              "id",
              "occurredOn",
              "occurredAt",
              "occurredZone",
              "periodYear",
              "periodMonth",
              "subject",
              "entityId",
              "entityName",
              "payloadVersion",
              "mark",
              "createdAt",
              "vendor",
              "kind",
              "payload"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "occurredOn": {
                "type": "string",
                "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
              },
              "occurredAt": {
                "anyOf": [
                  {
                    "type": "string",
                    "minLength": 20
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "occurredZone": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "periodYear": {
                "anyOf": [
                  {
                    "type": "integer",
                    "minimum": -9007199254740991,
                    "maximum": 9007199254740991
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "periodMonth": {
                "anyOf": [
                  {
                    "type": "integer",
                    "minimum": -9007199254740991,
                    "maximum": 9007199254740991
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "subject": {
                "type": "string"
              },
              "entityId": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "entityName": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "payloadVersion": {
                "type": "integer",
                "minimum": 1,
                "maximum": 9007199254740991
              },
              "mark": {
                "$ref": "#/components/schemas/Mark"
              },
              "createdAt": {
                "type": "string",
                "minLength": 20
              },
              "vendor": {
                "$ref": "#/components/schemas/Vendor"
              },
              "kind": {
                "type": "string",
                "const": "TAX_OVERRIDE"
              },
              "payload": {
                "type": "object",
                "properties": {
                  "reference": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 500
                  },
                  "engineOrDefaultTreatment": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 500
                  },
                  "chosenTreatment": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 500
                  },
                  "reason": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 500
                  },
                  "taxAmountMinor": {
                    "anyOf": [
                      {
                        "type": "string",
                        "pattern": "^-?\\d+$"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "currency": {
                    "anyOf": [
                      {
                        "type": "string",
                        "pattern": "^[A-Z]{3}$"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "registrationNumber": {
                    "anyOf": [
                      {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 500
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "overriddenByName": {
                    "anyOf": [
                      {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 500
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                },
                "required": [
                  "reference",
                  "engineOrDefaultTreatment",
                  "chosenTreatment",
                  "reason",
                  "taxAmountMinor",
                  "currency",
                  "registrationNumber",
                  "overriddenByName"
                ],
                "additionalProperties": false
              }
            },
            "required": [
              "id",
              "occurredOn",
              "occurredAt",
              "occurredZone",
              "periodYear",
              "periodMonth",
              "subject",
              "entityId",
              "entityName",
              "payloadVersion",
              "mark",
              "createdAt",
              "vendor",
              "kind",
              "payload"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "occurredOn": {
                "type": "string",
                "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
              },
              "occurredAt": {
                "anyOf": [
                  {
                    "type": "string",
                    "minLength": 20
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "occurredZone": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "periodYear": {
                "anyOf": [
                  {
                    "type": "integer",
                    "minimum": -9007199254740991,
                    "maximum": 9007199254740991
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "periodMonth": {
                "anyOf": [
                  {
                    "type": "integer",
                    "minimum": -9007199254740991,
                    "maximum": 9007199254740991
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "subject": {
                "type": "string"
              },
              "entityId": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "entityName": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "payloadVersion": {
                "type": "integer",
                "minimum": 1,
                "maximum": 9007199254740991
              },
              "mark": {
                "$ref": "#/components/schemas/Mark"
              },
              "createdAt": {
                "type": "string",
                "minLength": 20
              },
              "vendor": {
                "$ref": "#/components/schemas/Vendor"
              },
              "kind": {
                "type": "string",
                "const": "PAID_BILL"
              },
              "payload": {
                "type": "object",
                "properties": {
                  "supplierName": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 500
                  },
                  "number": {
                    "anyOf": [
                      {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 500
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "dueDate": {
                    "anyOf": [
                      {
                        "type": "string",
                        "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "paidOn": {
                    "type": "string",
                    "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                  },
                  "currency": {
                    "type": "string",
                    "pattern": "^[A-Z]{3}$"
                  },
                  "subtotalMinor": {
                    "anyOf": [
                      {
                        "type": "string",
                        "pattern": "^-?\\d+$"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "taxMinor": {
                    "anyOf": [
                      {
                        "type": "string",
                        "pattern": "^-?\\d+$"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "totalMinor": {
                    "type": "string",
                    "pattern": "^-?\\d+$"
                  },
                  "functionalTotalMinor": {
                    "anyOf": [
                      {
                        "type": "string",
                        "pattern": "^-?\\d+$"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "paymentMethod": {
                    "anyOf": [
                      {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 500
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "paymentReference": {
                    "anyOf": [
                      {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 500
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "memo": {
                    "anyOf": [
                      {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 500
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                },
                "required": [
                  "supplierName",
                  "number",
                  "dueDate",
                  "paidOn",
                  "currency",
                  "subtotalMinor",
                  "taxMinor",
                  "totalMinor",
                  "functionalTotalMinor",
                  "paymentMethod",
                  "paymentReference",
                  "memo"
                ],
                "additionalProperties": false
              }
            },
            "required": [
              "id",
              "occurredOn",
              "occurredAt",
              "occurredZone",
              "periodYear",
              "periodMonth",
              "subject",
              "entityId",
              "entityName",
              "payloadVersion",
              "mark",
              "createdAt",
              "vendor",
              "kind",
              "payload"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "occurredOn": {
                "type": "string",
                "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
              },
              "occurredAt": {
                "anyOf": [
                  {
                    "type": "string",
                    "minLength": 20
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "occurredZone": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "periodYear": {
                "anyOf": [
                  {
                    "type": "integer",
                    "minimum": -9007199254740991,
                    "maximum": 9007199254740991
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "periodMonth": {
                "anyOf": [
                  {
                    "type": "integer",
                    "minimum": -9007199254740991,
                    "maximum": 9007199254740991
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "subject": {
                "type": "string"
              },
              "entityId": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "entityName": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "payloadVersion": {
                "type": "integer",
                "minimum": 1,
                "maximum": 9007199254740991
              },
              "mark": {
                "$ref": "#/components/schemas/Mark"
              },
              "createdAt": {
                "type": "string",
                "minLength": 20
              },
              "vendor": {
                "$ref": "#/components/schemas/Vendor"
              },
              "kind": {
                "type": "string",
                "const": "VENDOR_PAYMENT"
              },
              "payload": {
                "type": "object",
                "properties": {
                  "supplierName": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 500
                  },
                  "currency": {
                    "type": "string",
                    "pattern": "^[A-Z]{3}$"
                  },
                  "amountMinor": {
                    "type": "string",
                    "pattern": "^-?\\d+$"
                  },
                  "method": {
                    "anyOf": [
                      {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 500
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "reference": {
                    "anyOf": [
                      {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 500
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "paidFromAccountName": {
                    "anyOf": [
                      {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 500
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "billsAppliedText": {
                    "anyOf": [
                      {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 500
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "memo": {
                    "anyOf": [
                      {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 500
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                },
                "required": [
                  "supplierName",
                  "currency",
                  "amountMinor",
                  "method",
                  "reference",
                  "paidFromAccountName",
                  "billsAppliedText",
                  "memo"
                ],
                "additionalProperties": false
              }
            },
            "required": [
              "id",
              "occurredOn",
              "occurredAt",
              "occurredZone",
              "periodYear",
              "periodMonth",
              "subject",
              "entityId",
              "entityName",
              "payloadVersion",
              "mark",
              "createdAt",
              "vendor",
              "kind",
              "payload"
            ],
            "additionalProperties": false
          }
        ]
      },
      "RecordBillFxRateResponse": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "status": {
            "type": "string",
            "enum": [
              "DRAFT",
              "IN_REVIEW",
              "APPROVED",
              "PARTIALLY_PAID",
              "PAID",
              "VOID"
            ]
          },
          "versionCount": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "findings": {
            "$ref": "#/components/schemas/Findings2"
          }
        },
        "required": [
          "id",
          "status",
          "versionCount",
          "findings"
        ],
        "additionalProperties": false
      },
      "RecordGoodsReceiptResponse": {
        "type": "object",
        "properties": {
          "receipt": {
            "$ref": "#/components/schemas/Receipt"
          },
          "order": {
            "type": "object",
            "properties": {
              "status": {
                "type": "string",
                "enum": [
                  "DRAFT",
                  "IN_APPROVAL",
                  "APPROVED",
                  "SENT",
                  "PART_RECEIVED",
                  "RECEIVED",
                  "CLOSED",
                  "CANCELLED"
                ]
              },
              "receiving": {
                "type": "object",
                "properties": {
                  "state": {
                    "type": "string",
                    "enum": [
                      "NONE",
                      "PART",
                      "COMPLETE"
                    ]
                  },
                  "receivedLines": {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 9007199254740991
                  },
                  "lineCount": {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 9007199254740991
                  },
                  "proposed": {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 9007199254740991
                  }
                },
                "required": [
                  "state",
                  "receivedLines",
                  "lineCount",
                  "proposed"
                ],
                "additionalProperties": false
              }
            },
            "required": [
              "status",
              "receiving"
            ],
            "additionalProperties": false
          }
        },
        "required": [
          "receipt",
          "order"
        ],
        "additionalProperties": false
      },
      "Refusal": {
        "anyOf": [
          {
            "type": "object",
            "properties": {
              "code": {
                "type": "string"
              },
              "message": {
                "type": "string"
              },
              "remedy": {
                "type": "string"
              }
            },
            "required": [
              "code",
              "message",
              "remedy"
            ],
            "additionalProperties": false
          },
          {
            "type": "null"
          }
        ]
      },
      "RegisterAssetRequest": {
        "type": "object",
        "properties": {
          "entityId": {
            "type": "string",
            "minLength": 1
          },
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200
          },
          "description": {
            "type": "string",
            "maxLength": 1000
          },
          "acquiredOn": {
            "type": "string",
            "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
          },
          "inServiceOn": {
            "type": "string",
            "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
          },
          "costMajor": {
            "type": "string",
            "pattern": "^\\d+(\\.\\d{1,2})?$"
          },
          "salvageMajor": {
            "default": "0",
            "type": "string",
            "pattern": "^\\d+(\\.\\d{1,2})?$"
          },
          "currency": {
            "type": "string",
            "pattern": "^[A-Z]{3}$"
          },
          "method": {
            "type": "string",
            "enum": [
              "STRAIGHT_LINE",
              "DECLINING_BALANCE"
            ]
          },
          "usefulLifeMonths": {
            "type": "integer",
            "minimum": 1,
            "maximum": 600
          },
          "decliningRatePct": {
            "type": "string",
            "pattern": "^\\d{1,3}(\\.\\d{1,3})?$"
          },
          "ccaClass": {
            "type": "string",
            "enum": [
              "1",
              "3",
              "6",
              "8",
              "10",
              "12",
              "16",
              "43",
              "44",
              "46",
              "50",
              "53",
              "54",
              "55",
              "56",
              "10.1",
              "14.1",
              "43.1",
              "43.2"
            ]
          },
          "isPassengerVehicle": {
            "type": "boolean"
          },
          "assetAccountId": {
            "type": "string",
            "minLength": 1
          },
          "accumulatedAccountId": {
            "type": "string",
            "minLength": 1
          },
          "expenseAccountId": {
            "type": "string",
            "minLength": 1
          }
        },
        "required": [
          "entityId",
          "name",
          "acquiredOn",
          "inServiceOn",
          "costMajor",
          "currency",
          "method",
          "usefulLifeMonths",
          "assetAccountId",
          "accumulatedAccountId",
          "expenseAccountId"
        ],
        "additionalProperties": false
      },
      "RegisterAssetResponse": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "entityId": {
            "type": "string"
          },
          "entityName": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "description": {
            "type": [
              "string",
              "null"
            ]
          },
          "acquiredOn": {
            "type": "string",
            "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
          },
          "inServiceOn": {
            "type": "string",
            "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
          },
          "costMinor": {
            "type": "string",
            "pattern": "^-?\\d+$"
          },
          "salvageMinor": {
            "type": "string",
            "pattern": "^-?\\d+$"
          },
          "currency": {
            "type": "string"
          },
          "method": {
            "type": "string",
            "enum": [
              "STRAIGHT_LINE",
              "DECLINING_BALANCE"
            ]
          },
          "usefulLifeMonths": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991
              },
              {
                "type": "null"
              }
            ]
          },
          "decliningRateE5": {
            "anyOf": [
              {
                "type": "string",
                "pattern": "^\\d+$"
              },
              {
                "type": "null"
              }
            ]
          },
          "ccaClass": {
            "anyOf": [
              {
                "type": "string",
                "enum": [
                  "1",
                  "3",
                  "6",
                  "8",
                  "10",
                  "12",
                  "16",
                  "43",
                  "44",
                  "46",
                  "50",
                  "53",
                  "54",
                  "55",
                  "56",
                  "10.1",
                  "14.1",
                  "43.1",
                  "43.2"
                ]
              },
              {
                "type": "null"
              }
            ]
          },
          "source": {
            "$ref": "#/components/schemas/Source"
          },
          "isPassengerVehicle": {
            "type": [
              "boolean",
              "null"
            ]
          },
          "status": {
            "type": "string",
            "enum": [
              "ACTIVE",
              "DISPOSED",
              "FULLY_DEPRECIATED"
            ]
          },
          "disposedOn": {
            "anyOf": [
              {
                "type": "string",
                "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
              },
              {
                "type": "null"
              }
            ]
          },
          "disposalProceedsMinor": {
            "anyOf": [
              {
                "type": "string",
                "pattern": "^-?\\d+$"
              },
              {
                "type": "null"
              }
            ]
          },
          "disposalEntryId": {
            "type": [
              "string",
              "null"
            ]
          },
          "disposalEntryStatus": {
            "type": [
              "string",
              "null"
            ]
          },
          "disposalBinds": {
            "type": "boolean"
          },
          "accumulatedPostedMinor": {
            "type": "string",
            "pattern": "^-?\\d+$"
          },
          "netBookValueMinor": {
            "type": "string",
            "pattern": "^-?\\d+$"
          },
          "pendingRows": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "assetAccount": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "code": {
                "type": "string"
              },
              "name": {
                "type": "string"
              }
            },
            "required": [
              "id",
              "code",
              "name"
            ],
            "additionalProperties": false
          },
          "accumulatedAccount": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "code": {
                "type": "string"
              },
              "name": {
                "type": "string"
              }
            },
            "required": [
              "id",
              "code",
              "name"
            ],
            "additionalProperties": false
          },
          "expenseAccount": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "code": {
                "type": "string"
              },
              "name": {
                "type": "string"
              }
            },
            "required": [
              "id",
              "code",
              "name"
            ],
            "additionalProperties": false
          },
          "createdByName": {
            "type": [
              "string",
              "null"
            ]
          },
          "createdAt": {
            "type": "string",
            "minLength": 20
          },
          "schedule": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string"
                },
                "periodYear": {
                  "type": "integer",
                  "minimum": -9007199254740991,
                  "maximum": 9007199254740991
                },
                "periodMonth": {
                  "type": "integer",
                  "minimum": 1,
                  "maximum": 12
                },
                "periodLabel": {
                  "type": "string"
                },
                "amountMinor": {
                  "type": "string",
                  "pattern": "^-?\\d+$"
                },
                "entryId": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "entryNumber": {
                  "anyOf": [
                    {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "entryStatus": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "handedToQueueAt": {
                  "anyOf": [
                    {
                      "type": "string",
                      "minLength": 20
                    },
                    {
                      "type": "null"
                    }
                  ]
                }
              },
              "required": [
                "id",
                "periodYear",
                "periodMonth",
                "periodLabel",
                "amountMinor",
                "entryId",
                "entryNumber",
                "entryStatus",
                "handedToQueueAt"
              ],
              "additionalProperties": false
            }
          },
          "scheduleTotalMinor": {
            "type": "string",
            "pattern": "^-?\\d+$"
          },
          "cca": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "fiscalYear": {
                  "$ref": "#/components/schemas/Window"
                },
                "row": {
                  "type": "object",
                  "properties": {
                    "ccaClass": {
                      "type": "string",
                      "enum": [
                        "1",
                        "3",
                        "6",
                        "8",
                        "10",
                        "12",
                        "16",
                        "43",
                        "44",
                        "46",
                        "50",
                        "53",
                        "54",
                        "55",
                        "56",
                        "10.1",
                        "14.1",
                        "43.1",
                        "43.2"
                      ]
                    },
                    "assetId": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "assetName": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "rateE5": {
                      "type": "string",
                      "pattern": "^\\d+$"
                    },
                    "openingUccMinor": {
                      "type": "string",
                      "pattern": "^-?\\d+$"
                    },
                    "additionsMinor": {
                      "type": "string",
                      "pattern": "^-?\\d+$"
                    },
                    "dispositionsMinor": {
                      "type": "string",
                      "pattern": "^-?\\d+$"
                    },
                    "regime": {
                      "type": "string",
                      "enum": [
                        "HALF_YEAR",
                        "AII_PHASE_1",
                        "AII_PHASE_OUT",
                        "AII_REINSTATED_2025",
                        "AII_REINSTATED_NIL",
                        "CLEAN_ENERGY_FULL_EXPENSING",
                        "MANUFACTURING_FULL_EXPENSING",
                        "PRODUCTIVITY_ASSETS",
                        "ZERO_EMISSION_ENHANCED",
                        "NONE"
                      ]
                    },
                    "adjustmentMinor": {
                      "type": "string",
                      "pattern": "^-?\\d+$"
                    },
                    "baseMinor": {
                      "type": "string",
                      "pattern": "^-?\\d+$"
                    },
                    "ccaMinor": {
                      "type": "string",
                      "pattern": "^-?\\d+$"
                    },
                    "closingUccMinor": {
                      "type": "string",
                      "pattern": "^-?\\d+$"
                    },
                    "recaptureMinor": {
                      "type": "string",
                      "pattern": "^-?\\d+$"
                    },
                    "terminalLossMinor": {
                      "type": "string",
                      "pattern": "^-?\\d+$"
                    },
                    "dispositionsNotPostedCount": {
                      "type": "integer",
                      "minimum": 0,
                      "maximum": 9007199254740991
                    },
                    "notes": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    }
                  },
                  "required": [
                    "ccaClass",
                    "assetId",
                    "assetName",
                    "rateE5",
                    "openingUccMinor",
                    "additionsMinor",
                    "dispositionsMinor",
                    "regime",
                    "adjustmentMinor",
                    "baseMinor",
                    "ccaMinor",
                    "closingUccMinor",
                    "recaptureMinor",
                    "terminalLossMinor",
                    "dispositionsNotPostedCount",
                    "notes"
                  ],
                  "additionalProperties": false
                },
                "bookDepreciationMinor": {
                  "type": "string",
                  "pattern": "^-?\\d+$"
                },
                "bookVsTaxMinor": {
                  "type": "string",
                  "pattern": "^-?\\d+$"
                }
              },
              "required": [
                "fiscalYear",
                "row",
                "bookDepreciationMinor",
                "bookVsTaxMinor"
              ],
              "additionalProperties": false
            }
          },
          "ccaRefusal": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "assetId": {
                    "type": "string"
                  },
                  "assetName": {
                    "type": "string"
                  },
                  "ccaClass": {
                    "type": "string"
                  },
                  "reason": {
                    "type": "string"
                  },
                  "remedy": {
                    "type": "string"
                  }
                },
                "required": [
                  "assetId",
                  "assetName",
                  "ccaClass",
                  "reason",
                  "remedy"
                ],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "id",
          "entityId",
          "entityName",
          "name",
          "description",
          "acquiredOn",
          "inServiceOn",
          "costMinor",
          "salvageMinor",
          "currency",
          "method",
          "usefulLifeMonths",
          "decliningRateE5",
          "ccaClass",
          "source",
          "isPassengerVehicle",
          "status",
          "disposedOn",
          "disposalProceedsMinor",
          "disposalEntryId",
          "disposalEntryStatus",
          "disposalBinds",
          "accumulatedPostedMinor",
          "netBookValueMinor",
          "pendingRows",
          "assetAccount",
          "accumulatedAccount",
          "expenseAccount",
          "createdByName",
          "createdAt",
          "schedule",
          "scheduleTotalMinor",
          "cca",
          "ccaRefusal"
        ],
        "additionalProperties": false
      },
      "RegisterBillAssetResponse": {
        "type": "object",
        "properties": {
          "asset": {
            "$ref": "#/components/schemas/RegisterAssetResponse"
          },
          "line": {
            "$ref": "#/components/schemas/LineOption1"
          }
        },
        "required": [
          "asset",
          "line"
        ],
        "additionalProperties": false
      },
      "Replaces": {
        "anyOf": [
          {
            "type": "object",
            "properties": {
              "billId": {
                "type": "string"
              },
              "supplierName": {
                "type": "string"
              },
              "number": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "billDate": {
                "type": "string",
                "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
              },
              "status": {
                "type": "string",
                "enum": [
                  "DRAFT",
                  "IN_REVIEW",
                  "DECLINED",
                  "APPROVED",
                  "HELD",
                  "OPEN",
                  "DUE",
                  "OVERDUE",
                  "IN_RUN",
                  "PARTIALLY_PAID",
                  "PAID",
                  "VOID"
                ]
              },
              "totalMinor": {
                "type": "string",
                "pattern": "^-?\\d+$"
              },
              "currency": {
                "type": "string",
                "pattern": "^[A-Z]{3}$"
              },
              "linkedBy": {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string"
                  },
                  "name": {
                    "type": "string"
                  }
                },
                "required": [
                  "id",
                  "name"
                ],
                "additionalProperties": false
              },
              "linkedAt": {
                "type": "string",
                "minLength": 20
              },
              "note": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "voidedAt": {
                "anyOf": [
                  {
                    "type": "string",
                    "minLength": 20
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "voidReason": {
                "type": [
                  "string",
                  "null"
                ]
              }
            },
            "required": [
              "billId",
              "supplierName",
              "number",
              "billDate",
              "status",
              "totalMinor",
              "currency",
              "linkedBy",
              "linkedAt",
              "note",
              "voidedAt",
              "voidReason"
            ],
            "additionalProperties": false
          },
          {
            "type": "null"
          }
        ]
      },
      "Report": {
        "type": "string",
        "enum": [
          "spend-by-vendor",
          "spend-by-account",
          "spend-by-month",
          "spend-by-company",
          "spend-by-dimension",
          "bill-register",
          "payment-register",
          "tax-paid",
          "cash-required",
          "itc-at-risk",
          "unexplained-payable",
          "subsequent-payments",
          "slip-reconciliation",
          "approvals",
          "own-work-approvals",
          "open-commitments",
          "prepaid-schedule",
          "cut-off",
          "holdbacks-held"
        ]
      },
      "RequestPurchasesExportResponseOption1": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "kind": {
            "type": "string",
            "enum": [
              "BILLS",
              "VENDORS",
              "PAYMENT_RUNS"
            ]
          },
          "format": {
            "type": "string",
            "enum": [
              "CSV",
              "XLSX"
            ]
          },
          "state": {
            "type": "string",
            "enum": [
              "QUEUED",
              "RUNNING",
              "READY",
              "FAILED",
              "EXPIRED"
            ]
          },
          "filters": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "query": {
            "type": "object",
            "propertyNames": {
              "type": "string"
            },
            "additionalProperties": {
              "type": "string"
            }
          },
          "requestedBy": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "name": {
                "type": "string"
              }
            },
            "required": [
              "id",
              "name"
            ],
            "additionalProperties": false
          },
          "requestedAt": {
            "type": "string",
            "minLength": 20
          },
          "startedAt": {
            "anyOf": [
              {
                "type": "string",
                "minLength": 20
              },
              {
                "type": "null"
              }
            ]
          },
          "finishedAt": {
            "anyOf": [
              {
                "type": "string",
                "minLength": 20
              },
              {
                "type": "null"
              }
            ]
          },
          "totalRows": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": 0,
                "maximum": 9007199254740991
              },
              {
                "type": "null"
              }
            ]
          },
          "rowCount": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": 0,
                "maximum": 9007199254740991
              },
              {
                "type": "null"
              }
            ]
          },
          "byteSize": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": 0,
                "maximum": 9007199254740991
              },
              {
                "type": "null"
              }
            ]
          },
          "fileName": {
            "type": [
              "string",
              "null"
            ]
          },
          "sha256": {
            "anyOf": [
              {
                "type": "string",
                "pattern": "^[0-9a-f]{64}$"
              },
              {
                "type": "null"
              }
            ]
          },
          "availableUntil": {
            "anyOf": [
              {
                "type": "string",
                "minLength": 20
              },
              {
                "type": "null"
              }
            ]
          },
          "failureKind": {
            "anyOf": [
              {
                "type": "string",
                "enum": [
                  "REFUSED",
                  "TOO_SLOW",
                  "STALE",
                  "FAULT"
                ]
              },
              {
                "type": "null"
              }
            ]
          },
          "failureReason": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 1000
              },
              {
                "type": "null"
              }
            ]
          },
          "notify": {
            "anyOf": [
              {
                "type": "string",
                "enum": [
                  "SENT",
                  "UNDELIVERABLE"
                ]
              },
              {
                "type": "null"
              }
            ]
          },
          "attempt": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "jobId": {
            "type": [
              "string",
              "null"
            ]
          },
          "entityTimeZone": {
            "type": "string"
          },
          "clockEntityName": {
            "type": [
              "string",
              "null"
            ]
          },
          "seatCompanyNames": {
            "anyOf": [
              {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              {
                "type": "null"
              }
            ]
          },
          "mine": {
            "type": "boolean"
          }
        },
        "required": [
          "id",
          "kind",
          "format",
          "state",
          "filters",
          "query",
          "requestedBy",
          "requestedAt",
          "startedAt",
          "finishedAt",
          "totalRows",
          "rowCount",
          "byteSize",
          "fileName",
          "sha256",
          "availableUntil",
          "failureKind",
          "failureReason",
          "notify",
          "attempt",
          "jobId",
          "entityTimeZone",
          "clockEntityName",
          "seatCompanyNames",
          "mine"
        ],
        "additionalProperties": false
      },
      "RetireVendorSenderDomainResponse": {
        "type": "object",
        "properties": {
          "senderDomain": {
            "$ref": "#/components/schemas/ListVendorSenderDomainsResponseItem"
          }
        },
        "required": [
          "senderDomain"
        ],
        "additionalProperties": false
      },
      "Retired": {
        "anyOf": [
          {
            "type": "object",
            "properties": {
              "by": {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string"
                  },
                  "name": {
                    "type": "string"
                  }
                },
                "required": [
                  "id",
                  "name"
                ],
                "additionalProperties": false
              },
              "at": {
                "type": "string",
                "minLength": 20
              },
              "reason": {
                "type": "string"
              }
            },
            "required": [
              "by",
              "at",
              "reason"
            ],
            "additionalProperties": false
          },
          {
            "type": "null"
          }
        ]
      },
      "Retired2": {
        "anyOf": [
          {
            "type": "object",
            "properties": {
              "byName": {
                "type": "string"
              },
              "at": {
                "type": "string",
                "minLength": 20
              },
              "reason": {
                "type": "string"
              }
            },
            "required": [
              "byName",
              "at",
              "reason"
            ],
            "additionalProperties": false
          },
          {
            "type": "null"
          }
        ]
      },
      "Rows2": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "key": {
                  "type": "string"
                },
                "rowKind": {
                  "type": "string",
                  "enum": [
                    "THEIRS",
                    "OURS_ONLY"
                  ]
                },
                "lineId": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "lineNo": {
                  "anyOf": [
                    {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "lineKind": {
                  "anyOf": [
                    {
                      "type": "string",
                      "enum": [
                        "INVOICE",
                        "CREDIT",
                        "PAYMENT",
                        "OTHER"
                      ]
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "matchKind": {
                  "type": "string",
                  "enum": [
                    "BOTH",
                    "AMOUNT_DIFFERS",
                    "ONLY_THEIRS",
                    "ONLY_OURS"
                  ]
                },
                "matchRule": {
                  "type": "string",
                  "enum": [
                    "NUMBER_AND_AMOUNT",
                    "NUMBER_ONLY",
                    "PAYMENT_REFERENCE",
                    "PAYMENT_AMOUNT_AND_DATE",
                    "PERSON",
                    "NONE"
                  ]
                },
                "matchedBy": {
                  "anyOf": [
                    {
                      "type": "string",
                      "enum": [
                        "RULE",
                        "PERSON"
                      ]
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "theirs": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "reference": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "docDate": {
                          "anyOf": [
                            {
                              "type": "string",
                              "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "amountMinor": {
                          "type": "string",
                          "pattern": "^-?\\d+$"
                        },
                        "taxMinor": {
                          "anyOf": [
                            {
                              "type": "string",
                              "pattern": "^-?\\d+$"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "excerpt": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "page": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "minimum": -9007199254740991,
                              "maximum": 9007199254740991
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "figureSource": {
                          "type": "string",
                          "enum": [
                            "PAGE_CHECKED",
                            "PAGE_NOT_FOUND",
                            "FILE_CELL",
                            "PERSON"
                          ]
                        }
                      },
                      "required": [
                        "reference",
                        "docDate",
                        "amountMinor",
                        "taxMinor",
                        "excerpt",
                        "page",
                        "figureSource"
                      ],
                      "additionalProperties": false
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "ours": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "kind": {
                          "type": "string",
                          "enum": [
                            "BILL",
                            "CREDIT",
                            "PAYMENT"
                          ]
                        },
                        "id": {
                          "type": "string"
                        },
                        "number": {
                          "type": "string"
                        },
                        "date": {
                          "anyOf": [
                            {
                              "type": "string",
                              "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "keyedOn": {
                          "anyOf": [
                            {
                              "type": "string",
                              "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "amountMinor": {
                          "type": "string",
                          "pattern": "^-?\\d+$"
                        },
                        "status": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "kind",
                        "id",
                        "number",
                        "date",
                        "keyedOn",
                        "amountMinor",
                        "status"
                      ],
                      "additionalProperties": false
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "differenceMinor": {
                  "type": "string",
                  "pattern": "^-?\\d+$"
                },
                "differenceHint": {
                  "anyOf": [
                    {
                      "type": "string",
                      "enum": [
                        "TAX",
                        "ROUNDING",
                        "PART_PAYMENT",
                        "PAID",
                        "OTHER"
                      ]
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "evidence": {
                  "type": "string"
                },
                "suggestion": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "billId": {
                          "type": "string"
                        },
                        "number": {
                          "type": "string"
                        },
                        "why": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "billId",
                        "number",
                        "why"
                      ],
                      "additionalProperties": false
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "consequence": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "periodState": {
                          "type": "string",
                          "enum": [
                            "FILED",
                            "NOT_FILED",
                            "NO_REGISTRATION",
                            "NO_DATE",
                            "FOREIGN"
                          ]
                        },
                        "returnPeriod": {
                          "anyOf": [
                            {
                              "type": "object",
                              "properties": {
                                "start": {
                                  "type": "string",
                                  "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                                },
                                "end": {
                                  "type": "string",
                                  "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                                }
                              },
                              "required": [
                                "start",
                                "end"
                              ],
                              "additionalProperties": false
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "filedOn": {
                          "anyOf": [
                            {
                              "type": "string",
                              "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "windowYears": {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991
                        },
                        "windowLastDay": {
                          "anyOf": [
                            {
                              "type": "string",
                              "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "windowOpen": {
                          "type": "boolean"
                        },
                        "printedTaxMinor": {
                          "anyOf": [
                            {
                              "type": "string",
                              "pattern": "^-?\\d+$"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "unbooked": {
                          "anyOf": [
                            {
                              "type": "object",
                              "properties": {
                                "billId": {
                                  "type": "string"
                                },
                                "number": {
                                  "type": "string"
                                },
                                "status": {
                                  "type": "string"
                                }
                              },
                              "required": [
                                "billId",
                                "number",
                                "status"
                              ],
                              "additionalProperties": false
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "sentence": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "periodState",
                        "returnPeriod",
                        "filedOn",
                        "windowYears",
                        "windowLastDay",
                        "windowOpen",
                        "printedTaxMinor",
                        "unbooked",
                        "sentence"
                      ],
                      "additionalProperties": false
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "declined": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "on": {
                          "type": "string",
                          "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                        },
                        "byName": {
                          "type": "string"
                        },
                        "reason": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "on",
                        "byName",
                        "reason"
                      ],
                      "additionalProperties": false
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "changedSinceYouLooked": {
                  "type": "boolean"
                }
              },
              "required": [
                "key",
                "rowKind",
                "lineId",
                "lineNo",
                "lineKind",
                "matchKind",
                "matchRule",
                "matchedBy",
                "theirs",
                "ours",
                "differenceMinor",
                "differenceHint",
                "evidence",
                "suggestion",
                "consequence",
                "declined"
              ],
              "additionalProperties": false
            }
          },
          "nextCursor": {
            "type": [
              "string",
              "null"
            ]
          },
          "total": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991
              },
              {
                "type": "null"
              }
            ]
          },
          "counts": {
            "$ref": "#/components/schemas/Counts4"
          },
          "entityTimeZone": {
            "type": "string"
          },
          "reconciliationDigest": {
            "type": "string",
            "pattern": "^[0-9a-f]{64}$"
          }
        },
        "required": [
          "data",
          "nextCursor",
          "total",
          "counts",
          "entityTimeZone",
          "reconciliationDigest"
        ],
        "additionalProperties": false
      },
      "Rows3": {
        "type": "array",
        "items": {
          "$ref": "#/components/schemas/TieOption1"
        }
      },
      "RuleOption1": {
        "type": "object",
        "properties": {
          "when": {
            "type": "object",
            "properties": {
              "amountMinorAtLeast": {
                "type": "string",
                "pattern": "^-?\\d+$"
              },
              "amountMinorBelow": {
                "type": "string",
                "pattern": "^-?\\d+$"
              },
              "amountCurrency": {
                "type": "string",
                "pattern": "^[A-Z]{3}$"
              },
              "sourceKinds": {
                "minItems": 1,
                "maxItems": 7,
                "type": "array",
                "items": {
                  "type": "string",
                  "enum": [
                    "MANUAL",
                    "AGENT_PROPOSAL",
                    "RECURRING",
                    "REVERSAL",
                    "IMPORT",
                    "CHAT",
                    "MIGRATION",
                    "PAYMENT_RUN",
                    "INVOICE",
                    "RECEIPT",
                    "BILL",
                    "BILL_SETTLEMENT",
                    "VENDOR_CREDIT"
                  ]
                }
              },
              "accountCode": {
                "type": "string",
                "minLength": 1,
                "maxLength": 32
              },
              "memoContains": {
                "type": "string",
                "minLength": 2,
                "maxLength": 120
              },
              "missingDimension": {
                "type": "string",
                "minLength": 1,
                "maxLength": 64
              },
              "vendorId": {
                "type": "string",
                "minLength": 1
              },
              "newVendor": {
                "type": "boolean",
                "const": true
              },
              "dimensionValueId": {
                "type": "string",
                "minLength": 1
              },
              "billSources": {
                "minItems": 1,
                "maxItems": 4,
                "type": "array",
                "items": {
                  "type": "string",
                  "enum": [
                    "INBOX_DOCUMENT",
                    "MANUAL",
                    "IMPORT",
                    "RECURRING",
                    "CONVERSION"
                  ]
                }
              },
              "vendorPaperNotCurrent": {
                "minItems": 1,
                "maxItems": 8,
                "type": "array",
                "items": {
                  "type": "string",
                  "enum": [
                    "WSIB_CLEARANCE",
                    "INSURANCE_CERTIFICATE",
                    "MASTER_AGREEMENT",
                    "W8BEN",
                    "DIRECT_DEPOSIT_FORM",
                    "WITHHOLDING_WAIVER",
                    "OTHER"
                  ]
                }
              },
              "overBudget": {
                "type": "boolean",
                "const": true
              },
              "orderException": {
                "type": "boolean",
                "const": true
              },
              "customerId": {
                "type": "string",
                "minLength": 1
              },
              "departmentValueId": {
                "type": "string",
                "minLength": 1
              },
              "dueWithinDays": {
                "type": "integer",
                "minimum": 0,
                "maximum": 60
              },
              "discountLapsesWithinDays": {
                "type": "integer",
                "minimum": 0,
                "maximum": 30
              },
              "vendorIds": {
                "minItems": 1,
                "maxItems": 100,
                "type": "array",
                "items": {
                  "type": "string",
                  "minLength": 1
                }
              },
              "exceptVendorIds": {
                "minItems": 1,
                "maxItems": 100,
                "type": "array",
                "items": {
                  "type": "string",
                  "minLength": 1
                }
              }
            },
            "additionalProperties": false
          },
          "then": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "route": {
                    "type": "string",
                    "enum": [
                      "BOOKKEEPER",
                      "SENIOR",
                      "CONTROLLER"
                    ]
                  }
                },
                "required": [
                  "route"
                ],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "code": {
                    "type": "object",
                    "properties": {
                      "accountCode": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 32
                      },
                      "note": {
                        "type": "string",
                        "maxLength": 200
                      }
                    },
                    "required": [
                      "accountCode"
                    ],
                    "additionalProperties": false
                  }
                },
                "required": [
                  "code"
                ],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "autoApprove": {
                    "type": "boolean",
                    "const": true
                  }
                },
                "required": [
                  "autoApprove"
                ],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "hold": {
                    "type": "object",
                    "properties": {
                      "maxOpen": {
                        "type": "integer",
                        "minimum": 1,
                        "maximum": 500
                      }
                    },
                    "required": [
                      "maxOpen"
                    ],
                    "additionalProperties": false
                  }
                },
                "required": [
                  "hold"
                ],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "tolerate": {
                    "type": "object",
                    "properties": {
                      "priceBp": {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 1000
                      },
                      "quantityBp": {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 1000
                      },
                      "capMinor": {
                        "type": "string",
                        "pattern": "^-?\\d+$"
                      },
                      "totalCapMinor": {
                        "type": "string",
                        "pattern": "^-?\\d+$"
                      },
                      "currency": {
                        "type": "string",
                        "pattern": "^[A-Z]{3}$"
                      }
                    },
                    "required": [
                      "priceBp",
                      "quantityBp",
                      "capMinor",
                      "totalCapMinor",
                      "currency"
                    ],
                    "additionalProperties": false
                  }
                },
                "required": [
                  "tolerate"
                ],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "fill": {
                    "type": "object",
                    "properties": {
                      "account": {
                        "type": "object",
                        "properties": {
                          "accountCode": {
                            "type": "string",
                            "minLength": 1,
                            "maxLength": 32
                          }
                        },
                        "required": [
                          "accountCode"
                        ],
                        "additionalProperties": false
                      },
                      "supplyCategory": {
                        "type": "string",
                        "enum": [
                          "GOODS",
                          "SERVICES",
                          "INTANGIBLE_PROPERTY",
                          "REAL_PROPERTY"
                        ]
                      },
                      "itcKind": {
                        "type": "string",
                        "enum": [
                          "GENERAL",
                          "MEALS_ENTERTAINMENT",
                          "PASSENGER_VEHICLE",
                          "ZERO_EMISSION_VEHICLE",
                          "EXEMPT_ACTIVITY",
                          "NONE"
                        ]
                      },
                      "commercialUsePct": {
                        "type": "string",
                        "pattern": "^0(?:\\.\\d{1,4})?$"
                      },
                      "provincialServiceKind": {
                        "type": "string",
                        "enum": [
                          "ACCOUNTING",
                          "ARCHITECTURAL_OR_ENGINEERING",
                          "SECURITY",
                          "NON_RESIDENTIAL_REAL_ESTATE",
                          "ADVERTISING",
                          "ACCOMMODATION"
                        ]
                      },
                      "propertyRegion": {
                        "type": "string",
                        "enum": [
                          "CA-AB",
                          "CA-BC",
                          "CA-MB",
                          "CA-NB",
                          "CA-NL",
                          "CA-NS",
                          "CA-NT",
                          "CA-NU",
                          "CA-ON",
                          "CA-PE",
                          "CA-QC",
                          "CA-SK",
                          "CA-YT"
                        ]
                      },
                      "dimensions": {
                        "minItems": 1,
                        "maxItems": 8,
                        "type": "array",
                        "items": {
                          "$ref": "#/components/schemas/DimensionsItem"
                        }
                      }
                    },
                    "additionalProperties": false
                  }
                },
                "required": [
                  "fill"
                ],
                "additionalProperties": false
              },
              {
                "$ref": "#/components/schemas/ThenOption7"
              }
            ]
          }
        },
        "required": [
          "when",
          "then"
        ],
        "additionalProperties": false
      },
      "RunwayOption1": {
        "type": "object",
        "properties": {
          "today": {
            "type": "string",
            "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
          },
          "balanceMinor": {
            "type": "string",
            "pattern": "^-?\\d+$"
          },
          "horizonDays": {
            "type": "integer",
            "exclusiveMinimum": 0,
            "maximum": 9007199254740991
          },
          "crossesZeroOn": {
            "anyOf": [
              {
                "type": "string",
                "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
              },
              {
                "type": "null"
              }
            ]
          },
          "lowestMinor": {
            "type": "string",
            "pattern": "^-?\\d+$"
          },
          "lowestOn": {
            "anyOf": [
              {
                "type": "string",
                "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
              },
              {
                "type": "null"
              }
            ]
          },
          "endBalanceMinor": {
            "type": "string",
            "pattern": "^-?\\d+$"
          },
          "lastMovementOn": {
            "anyOf": [
              {
                "type": "string",
                "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
              },
              {
                "type": "null"
              }
            ]
          },
          "days": {
            "maxItems": 91,
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "on": {
                  "type": "string",
                  "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                },
                "bills": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 9007199254740991
                },
                "outMinor": {
                  "type": "string",
                  "pattern": "^-?\\d+$"
                },
                "balanceAfterMinor": {
                  "type": "string",
                  "pattern": "^-?\\d+$"
                }
              },
              "required": [
                "on",
                "bills",
                "outMinor",
                "balanceAfterMinor"
              ],
              "additionalProperties": false
            }
          }
        },
        "required": [
          "today",
          "balanceMinor",
          "horizonDays",
          "crossesZeroOn",
          "lowestMinor",
          "lowestOn",
          "endBalanceMinor",
          "lastMovementOn",
          "days"
        ],
        "additionalProperties": false
      },
      "Sentence": {
        "type": "object",
        "properties": {
          "text": {
            "type": "string",
            "minLength": 8,
            "maxLength": 600
          },
          "source": {
            "type": "string",
            "const": "PERSON"
          },
          "promptVersion": {
            "type": "null"
          }
        },
        "required": [
          "text",
          "source",
          "promptVersion"
        ],
        "additionalProperties": false
      },
      "SetCustomFieldValuesRequest": {
        "type": "object",
        "properties": {
          "customFields": {
            "$ref": "#/components/schemas/CustomFields6"
          }
        },
        "required": [
          "customFields"
        ],
        "additionalProperties": false
      },
      "SkipOption1": {
        "type": "string",
        "enum": [
          "NOT_BILLS_MAILBOX",
          "NO_TEXT",
          "ALREADY_QUERIED",
          "DECIDED_BY_A_PERSON",
          "AUTO_REPLY",
          "NOT_AUTHENTICATED",
          "NOT_A_MESSAGE",
          "VENDOR_ARCHIVED",
          "SENDER_UNKNOWN",
          "SENDER_AMBIGUOUS",
          "REFERENCE_OTHER_SUPPLIER",
          "NOT_A_QUESTION",
          "NO_POLICY",
          "POLICY_EXPIRED",
          "PAUSED_AFTER_THREE_SET_ASIDE",
          "OVER_DAILY_CAP"
        ]
      },
      "SkipReasonOption1": {
        "type": "string",
        "enum": [
          "BILL_HELD",
          "NO_VENDOR",
          "VENDOR_ARCHIVED",
          "VENDOR_HELD",
          "VENDOR_NOT_ACCEPTED",
          "NO_BANKING",
          "BANKING_PENDING",
          "BANKING_RETURNED",
          "BANKING_FOREIGN",
          "IN_RUN",
          "CURRENCY_DIFFERS",
          "PLANNED_LATER",
          "DECLINED_RECENTLY",
          "OPEN_SIGNAL",
          "CREDIT_AVAILABLE",
          "WITHHOLDING_REVIEW",
          "PER_BILL_CAP",
          "MAX_BILLS",
          "WEEK_CAP",
          "NEW_PAYEE",
          "ABOVE_HISTORICAL_MAX",
          "REFUSED_AT_PREPARE"
        ]
      },
      "Source": {
        "anyOf": [
          {
            "type": "object",
            "properties": {
              "billId": {
                "type": "string"
              },
              "billNumber": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "supplierName": {
                "type": "string"
              },
              "billDate": {
                "type": "string",
                "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
              },
              "billLineId": {
                "type": "string"
              },
              "linePosition": {
                "type": "integer",
                "minimum": 1,
                "maximum": 9007199254740991
              }
            },
            "required": [
              "billId",
              "billNumber",
              "supplierName",
              "billDate",
              "billLineId",
              "linePosition"
            ],
            "additionalProperties": false
          },
          {
            "type": "null"
          }
        ]
      },
      "Sources": {
        "maxItems": 5,
        "type": "array",
        "items": {
          "type": "object",
          "properties": {
            "kind": {
              "type": "string",
              "enum": [
                "BILL",
                "SIGNAL",
                "FINDING"
              ]
            },
            "id": {
              "type": "string",
              "minLength": 1
            },
            "label": {
              "type": "string"
            }
          },
          "required": [
            "kind",
            "id",
            "label"
          ],
          "additionalProperties": false
        }
      },
      "Standing": {
        "type": "object",
        "properties": {
          "required": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "kind": {
                  "type": "string",
                  "enum": [
                    "WSIB_CLEARANCE",
                    "INSURANCE_CERTIFICATE",
                    "MASTER_AGREEMENT",
                    "W8BEN",
                    "DIRECT_DEPOSIT_FORM",
                    "WITHHOLDING_WAIVER",
                    "OTHER"
                  ]
                },
                "state": {
                  "type": "string",
                  "enum": [
                    "CURRENT",
                    "EXPIRING",
                    "LAPSED",
                    "MISSING"
                  ]
                },
                "validUntil": {
                  "anyOf": [
                    {
                      "type": "string",
                      "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "documentId": {
                  "type": [
                    "string",
                    "null"
                  ]
                }
              },
              "required": [
                "kind",
                "state",
                "validUntil",
                "documentId"
              ],
              "additionalProperties": false
            }
          },
          "rollup": {
            "type": "string",
            "enum": [
              "NONE_REQUIRED",
              "CURRENT",
              "EXPIRING",
              "NOT_CURRENT"
            ]
          },
          "requiredSetBy": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string"
                  },
                  "name": {
                    "type": "string"
                  }
                },
                "required": [
                  "id",
                  "name"
                ],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ]
          },
          "requiredSetAt": {
            "anyOf": [
              {
                "type": "string",
                "minLength": 20
              },
              {
                "type": "null"
              }
            ]
          },
          "leadDays": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991
          }
        },
        "required": [
          "required",
          "rollup",
          "requiredSetBy",
          "requiredSetAt",
          "leadDays"
        ],
        "additionalProperties": false
      },
      "Statement2": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "entityId": {
            "type": "string"
          },
          "entityName": {
            "type": "string"
          },
          "entityTimeZone": {
            "type": "string"
          },
          "vendor": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string"
                  },
                  "displayName": {
                    "type": "string"
                  }
                },
                "required": [
                  "id",
                  "displayName"
                ],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ]
          },
          "supplierNamePrinted": {
            "type": [
              "string",
              "null"
            ]
          },
          "source": {
            "type": "string",
            "enum": [
              "UPLOAD",
              "MAILED",
              "TYPED"
            ]
          },
          "basis": {
            "type": "string",
            "enum": [
              "OPEN_ITEMS",
              "ACTIVITY"
            ]
          },
          "status": {
            "type": "string",
            "enum": [
              "READING",
              "IN_REVIEW",
              "ACCEPTED",
              "DISCARDED"
            ]
          },
          "stalled": {
            "type": "boolean"
          },
          "stalledMinutes": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991
              },
              {
                "type": "null"
              }
            ]
          },
          "statementDate": {
            "anyOf": [
              {
                "type": "string",
                "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
              },
              {
                "type": "null"
              }
            ]
          },
          "periodFrom": {
            "anyOf": [
              {
                "type": "string",
                "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
              },
              {
                "type": "null"
              }
            ]
          },
          "currency": {
            "anyOf": [
              {
                "type": "string",
                "pattern": "^[A-Z]{3}$"
              },
              {
                "type": "null"
              }
            ]
          },
          "statementNumber": {
            "type": [
              "string",
              "null"
            ]
          },
          "figures": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "theirOpening": {
                    "type": "string",
                    "pattern": "^-?\\d+$"
                  },
                  "theirClosing": {
                    "type": "string",
                    "pattern": "^-?\\d+$"
                  },
                  "ourOpening": {
                    "type": "string",
                    "pattern": "^-?\\d+$"
                  },
                  "ourClosing": {
                    "type": "string",
                    "pattern": "^-?\\d+$"
                  },
                  "difference": {
                    "type": "string",
                    "pattern": "^-?\\d+$"
                  },
                  "explained": {
                    "type": "object",
                    "properties": {
                      "opening": {
                        "type": "string",
                        "pattern": "^-?\\d+$"
                      },
                      "rows": {
                        "type": "string",
                        "pattern": "^-?\\d+$"
                      }
                    },
                    "required": [
                      "opening",
                      "rows"
                    ],
                    "additionalProperties": false
                  },
                  "footingGaps": {
                    "type": "object",
                    "properties": {
                      "theirs": {
                        "type": "object",
                        "properties": {
                          "minor": {
                            "type": "string",
                            "pattern": "^-?\\d+$"
                          },
                          "sentence": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "minor",
                          "sentence"
                        ],
                        "additionalProperties": false
                      },
                      "ours": {
                        "type": "object",
                        "properties": {
                          "minor": {
                            "type": "string",
                            "pattern": "^-?\\d+$"
                          },
                          "sentence": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "minor",
                          "sentence"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "required": [
                      "theirs",
                      "ours"
                    ],
                    "additionalProperties": false
                  },
                  "identityHolds": {
                    "type": "boolean",
                    "const": true
                  }
                },
                "required": [
                  "theirOpening",
                  "theirClosing",
                  "ourOpening",
                  "ourClosing",
                  "difference",
                  "explained",
                  "footingGaps",
                  "identityHolds"
                ],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ]
          },
          "readOutcome": {
            "anyOf": [
              {
                "type": "string",
                "enum": [
                  "OK",
                  "NOT_A_STATEMENT",
                  "UNREADABLE",
                  "DISCLOSURE",
                  "BUDGET",
                  "PROVIDER",
                  "UNPARSABLE",
                  "REFUSED",
                  "FILE_COLUMNS",
                  "TOO_LONG"
                ]
              },
              {
                "type": "null"
              }
            ]
          },
          "readSentence": {
            "type": [
              "string",
              "null"
            ]
          },
          "readerLocation": {
            "type": [
              "string",
              "null"
            ]
          },
          "promptVersion": {
            "type": [
              "string",
              "null"
            ]
          },
          "linesRead": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "linesKept": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "printedAccountVerdict": {
            "type": [
              "string",
              "null"
            ]
          },
          "supplierNameCheck": {
            "anyOf": [
              {
                "type": "string",
                "enum": [
                  "SAME",
                  "CONFIRMED_BY_PERSON",
                  "NOT_PRINTED"
                ]
              },
              {
                "type": "null"
              }
            ]
          },
          "readAttempts": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "revision": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "addedBy": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string"
                  },
                  "name": {
                    "type": "string"
                  }
                },
                "required": [
                  "id",
                  "name"
                ],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ]
          },
          "addedAt": {
            "type": "string",
            "minLength": 20
          },
          "acceptedBy": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string"
                  },
                  "name": {
                    "type": "string"
                  }
                },
                "required": [
                  "id",
                  "name"
                ],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ]
          },
          "acceptedAt": {
            "anyOf": [
              {
                "type": "string",
                "minLength": 20
              },
              {
                "type": "null"
              }
            ]
          },
          "discardedBy": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string"
                  },
                  "name": {
                    "type": "string"
                  }
                },
                "required": [
                  "id",
                  "name"
                ],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ]
          },
          "discardedAt": {
            "anyOf": [
              {
                "type": "string",
                "minLength": 20
              },
              {
                "type": "null"
              }
            ]
          },
          "discardReason": {
            "type": [
              "string",
              "null"
            ]
          },
          "counts": {
            "$ref": "#/components/schemas/Counts4"
          },
          "notCompared": {
            "type": "object",
            "properties": {
              "otherCurrencyBills": {
                "type": "integer",
                "minimum": 0,
                "maximum": 9007199254740991
              },
              "currencies": {
                "type": "array",
                "items": {
                  "type": "string",
                  "pattern": "^[A-Z]{3}$"
                }
              }
            },
            "required": [
              "otherCurrencyBills",
              "currencies"
            ],
            "additionalProperties": false
          },
          "readAt": {
            "anyOf": [
              {
                "type": "string",
                "minLength": 20
              },
              {
                "type": "null"
              }
            ]
          },
          "fileHeaders": {
            "maxItems": 60,
            "type": "array",
            "items": {
              "type": "string",
              "maxLength": 120
            }
          },
          "document": {
            "$ref": "#/components/schemas/Document"
          },
          "reconciliationDigest": {
            "anyOf": [
              {
                "type": "string",
                "pattern": "^[0-9a-f]{64}$"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "id",
          "entityId",
          "entityName",
          "entityTimeZone",
          "vendor",
          "supplierNamePrinted",
          "source",
          "basis",
          "status",
          "stalled",
          "stalledMinutes",
          "statementDate",
          "periodFrom",
          "currency",
          "statementNumber",
          "figures",
          "readOutcome",
          "readSentence",
          "readerLocation",
          "promptVersion",
          "linesRead",
          "linesKept",
          "printedAccountVerdict",
          "supplierNameCheck",
          "readAttempts",
          "revision",
          "addedBy",
          "addedAt",
          "acceptedBy",
          "acceptedAt",
          "discardedBy",
          "discardedAt",
          "discardReason",
          "counts",
          "notCompared",
          "readAt",
          "fileHeaders",
          "document",
          "reconciliationDigest"
        ],
        "additionalProperties": false
      },
      "StoppedBy": {
        "anyOf": [
          {
            "type": "object",
            "properties": {
              "by": {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string"
                  },
                  "name": {
                    "type": "string"
                  }
                },
                "required": [
                  "id",
                  "name"
                ],
                "additionalProperties": false
              },
              "at": {
                "type": "string",
                "minLength": 20
              }
            },
            "required": [
              "by",
              "at"
            ],
            "additionalProperties": false
          },
          {
            "type": "null"
          }
        ]
      },
      "Stored": {
        "anyOf": [
          {
            "$ref": "#/components/schemas/StoredOption1"
          },
          {
            "type": "null"
          }
        ]
      },
      "StoredOption1": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "kind": {
            "$ref": "#/components/schemas/Kind4"
          },
          "state": {
            "type": "string",
            "enum": [
              "OPEN",
              "DISMISSED",
              "CONFIRMED"
            ]
          },
          "severity": {
            "type": "string",
            "enum": [
              "CRITICAL",
              "WARNING",
              "INFO"
            ]
          },
          "sentence": {
            "type": "string"
          },
          "observedAt": {
            "type": "string",
            "minLength": 20
          },
          "decision": {
            "$ref": "#/components/schemas/Decision"
          },
          "label": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "kind",
          "state",
          "severity",
          "sentence",
          "observedAt",
          "decision",
          "label"
        ],
        "additionalProperties": false
      },
      "Subject2": {
        "type": "object",
        "properties": {
          "kind": {
            "type": "string",
            "enum": [
              "BILL",
              "PAYMENT",
              "VENDOR_CREDIT",
              "VENDOR"
            ]
          },
          "label": {
            "type": "string"
          },
          "billId": {
            "type": [
              "string",
              "null"
            ]
          },
          "paymentId": {
            "type": [
              "string",
              "null"
            ]
          },
          "vendorCreditId": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "kind",
          "label",
          "billId",
          "paymentId",
          "vendorCreditId"
        ],
        "additionalProperties": false
      },
      "Subject3": {
        "oneOf": [
          {
            "type": "object",
            "properties": {
              "kind": {
                "type": "string",
                "const": "BILL"
              },
              "billId": {
                "type": "string",
                "minLength": 1
              }
            },
            "required": [
              "kind",
              "billId"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "kind": {
                "type": "string",
                "const": "PAYMENT"
              },
              "paymentId": {
                "type": "string",
                "minLength": 1
              }
            },
            "required": [
              "kind",
              "paymentId"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "kind": {
                "type": "string",
                "const": "VENDOR_CREDIT"
              },
              "vendorCreditId": {
                "type": "string",
                "minLength": 1
              }
            },
            "required": [
              "kind",
              "vendorCreditId"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "kind": {
                "type": "string",
                "const": "VENDOR"
              }
            },
            "required": [
              "kind"
            ],
            "additionalProperties": false
          }
        ]
      },
      "Survivor": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "displayName": {
            "type": "string"
          },
          "legalName": {
            "type": [
              "string",
              "null"
            ]
          },
          "businessNumber": {
            "type": [
              "string",
              "null"
            ]
          },
          "taxNumber": {
            "type": [
              "string",
              "null"
            ]
          },
          "status": {
            "type": "string",
            "enum": [
              "ACTIVE",
              "ARCHIVED"
            ]
          },
          "acceptanceState": {
            "type": "string",
            "enum": [
              "PENDING_ACCEPTANCE",
              "ACCEPTED",
              "REFUSED",
              "NOT_REVIEWED"
            ]
          },
          "paymentHold": {
            "type": "boolean"
          },
          "verifiedAccountLast4": {
            "anyOf": [
              {
                "type": "string",
                "pattern": "^[0-9]{4}$"
              },
              {
                "type": "null"
              }
            ]
          },
          "billCount": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "openOwed": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "entityId": {
                  "type": "string"
                },
                "currency": {
                  "type": "string",
                  "pattern": "^[A-Z]{3}$"
                },
                "openMinor": {
                  "type": "string",
                  "pattern": "^-?\\d+$"
                }
              },
              "required": [
                "entityId",
                "currency",
                "openMinor"
              ],
              "additionalProperties": false
            }
          },
          "createdAt": {
            "type": "string",
            "minLength": 20
          },
          "cameFrom": {
            "default": null,
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "importId": {
                    "type": "string"
                  },
                  "sourceSystem": {
                    "anyOf": [
                      {
                        "type": "string",
                        "enum": [
                          "QUICKBOOKS_ONLINE",
                          "QUICKBOOKS_DESKTOP",
                          "XERO",
                          "SAGE_50",
                          "SPREADSHEET",
                          "OTHER"
                        ]
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "sourceSystemLabel": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "importedAt": {
                    "anyOf": [
                      {
                        "type": "string",
                        "minLength": 20
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                },
                "required": [
                  "importId",
                  "sourceSystem",
                  "sourceSystemLabel",
                  "importedAt"
                ],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "id",
          "displayName",
          "legalName",
          "businessNumber",
          "taxNumber",
          "status",
          "acceptanceState",
          "paymentHold",
          "verifiedAccountLast4",
          "billCount",
          "openOwed",
          "createdAt",
          "cameFrom"
        ],
        "additionalProperties": false
      },
      "Survivor2": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "displayName": {
            "type": "string"
          },
          "status": {
            "type": "string",
            "enum": [
              "ACTIVE",
              "ARCHIVED"
            ]
          }
        },
        "required": [
          "id",
          "displayName",
          "status"
        ],
        "additionalProperties": false
      },
      "Survivor3": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "displayName": {
            "type": "string"
          },
          "billCount": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991
          },
          "createdAt": {
            "type": "string",
            "minLength": 20
          }
        },
        "required": [
          "id",
          "displayName",
          "billCount",
          "createdAt"
        ],
        "additionalProperties": false
      },
      "TheirsOnly": {
        "type": "array",
        "items": {
          "type": "object",
          "properties": {
            "reference": {
              "type": "string"
            },
            "date": {
              "anyOf": [
                {
                  "type": "string",
                  "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                },
                {
                  "type": "null"
                }
              ]
            },
            "amountMinor": {
              "type": "string",
              "pattern": "^-?\\d+$"
            }
          },
          "required": [
            "reference",
            "date",
            "amountMinor"
          ],
          "additionalProperties": false
        }
      },
      "ThenOption7": {
        "type": "object",
        "properties": {
          "prepare": {
            "type": "object",
            "properties": {
              "financialAccountId": {
                "type": "string",
                "minLength": 1
              },
              "method": {
                "type": "string",
                "enum": [
                  "EFT",
                  "CHEQUE",
                  "WIRE"
                ]
              },
              "currency": {
                "type": "string",
                "pattern": "^[A-Z]{3}$"
              },
              "perBillCapMinor": {
                "type": "string",
                "pattern": "^-?\\d+$"
              },
              "weekCapMinor": {
                "type": "string",
                "pattern": "^-?\\d+$"
              },
              "maxBills": {
                "type": "integer",
                "minimum": 1,
                "maximum": 200
              },
              "weekday": {
                "type": "string",
                "enum": [
                  "MON",
                  "TUE",
                  "WED",
                  "THU",
                  "FRI",
                  "SAT",
                  "SUN"
                ]
              },
              "payInDays": {
                "type": "integer",
                "minimum": 0,
                "maximum": 14
              }
            },
            "required": [
              "financialAccountId",
              "method",
              "currency",
              "perBillCapMinor",
              "weekCapMinor",
              "maxBills",
              "weekday",
              "payInDays"
            ],
            "additionalProperties": false
          }
        },
        "required": [
          "prepare"
        ],
        "additionalProperties": false
      },
      "TieOption1": {
        "type": "object",
        "properties": {
          "entityId": {
            "type": "string"
          },
          "entityName": {
            "type": "string"
          },
          "currency": {
            "type": "string",
            "pattern": "^[A-Z]{3}$"
          },
          "asOf": {
            "type": "string",
            "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
          },
          "subledgerMinor": {
            "type": "string",
            "pattern": "^-?\\d+$"
          },
          "controlMinor": {
            "type": "string",
            "pattern": "^-?\\d+$"
          },
          "settlementResidualMinor": {
            "type": "string",
            "pattern": "^-?\\d+$"
          },
          "unexplainedMinor": {
            "type": "string",
            "pattern": "^-?\\d+$"
          },
          "unappliedCreditMinor": {
            "type": "string",
            "pattern": "^-?\\d+$"
          },
          "unnamedLineCount": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "tied": {
            "type": "boolean"
          },
          "controlAccounts": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string"
                },
                "code": {
                  "type": "string"
                },
                "name": {
                  "type": "string"
                },
                "balanceMinor": {
                  "type": "string",
                  "pattern": "^-?\\d+$"
                },
                "source": {
                  "type": "string",
                  "enum": [
                    "BILL",
                    "SETTINGS",
                    "GIFI_FALLBACK"
                  ]
                },
                "subledgerMinor": {
                  "type": "string",
                  "pattern": "^-?\\d+$"
                },
                "settlementResidualMinor": {
                  "type": "string",
                  "pattern": "^-?\\d+$"
                },
                "unexplainedMinor": {
                  "type": "string",
                  "pattern": "^-?\\d+$"
                }
              },
              "required": [
                "id",
                "code",
                "name",
                "balanceMinor",
                "source",
                "subledgerMinor",
                "settlementResidualMinor",
                "unexplainedMinor"
              ],
              "additionalProperties": false
            }
          },
          "exchangeAccountNominated": {
            "type": "boolean"
          }
        },
        "required": [
          "entityId",
          "entityName",
          "currency",
          "asOf",
          "subledgerMinor",
          "controlMinor",
          "settlementResidualMinor",
          "unexplainedMinor",
          "unappliedCreditMinor",
          "unnamedLineCount",
          "tied",
          "controlAccounts",
          "exchangeAccountNominated"
        ],
        "additionalProperties": false
      },
      "Totals": {
        "type": "object",
        "properties": {
          "native": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "imported": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          }
        },
        "required": [
          "native",
          "imported"
        ],
        "additionalProperties": false
      },
      "Totals2": {
        "type": "array",
        "items": {
          "type": "object",
          "properties": {
            "entityId": {
              "type": "string"
            },
            "entityName": {
              "type": "string"
            },
            "currency": {
              "type": "string",
              "pattern": "^[A-Z]{3}$"
            },
            "minor": {
              "type": "string",
              "pattern": "^-?\\d+$"
            }
          },
          "required": [
            "entityId",
            "entityName",
            "currency",
            "minor"
          ],
          "additionalProperties": false
        }
      },
      "Totals3": {
        "type": "array",
        "items": {
          "type": "object",
          "properties": {
            "entityId": {
              "type": "string"
            },
            "entityName": {
              "type": "string"
            },
            "currency": {
              "type": "string",
              "pattern": "^[A-Z]{3}$"
            },
            "openMinor": {
              "type": "string",
              "pattern": "^-?\\d+$"
            }
          },
          "required": [
            "entityId",
            "entityName",
            "currency",
            "openMinor"
          ],
          "additionalProperties": false
        }
      },
      "Totals4": {
        "type": "object",
        "properties": {
          "current": {
            "type": "string",
            "pattern": "^-?\\d+$"
          },
          "d1to30": {
            "type": "string",
            "pattern": "^-?\\d+$"
          },
          "d31to60": {
            "type": "string",
            "pattern": "^-?\\d+$"
          },
          "d61to90": {
            "type": "string",
            "pattern": "^-?\\d+$"
          },
          "over90": {
            "type": "string",
            "pattern": "^-?\\d+$"
          },
          "held": {
            "type": "string",
            "pattern": "^-?\\d+$"
          },
          "total": {
            "type": "string",
            "pattern": "^-?\\d+$"
          },
          "dueSoonMinor": {
            "type": "string",
            "pattern": "^-?\\d+$"
          }
        },
        "required": [
          "current",
          "d1to30",
          "d31to60",
          "d61to90",
          "over90",
          "held",
          "total",
          "dueSoonMinor"
        ],
        "additionalProperties": false
      },
      "Under": {
        "anyOf": [
          {
            "oneOf": [
              {
                "type": "object",
                "properties": {
                  "kind": {
                    "type": "string",
                    "const": "SETTING"
                  },
                  "by": {
                    "type": "object",
                    "properties": {
                      "id": {
                        "type": "string"
                      },
                      "name": {
                        "type": "string"
                      }
                    },
                    "required": [
                      "id",
                      "name"
                    ],
                    "additionalProperties": false
                  },
                  "enabledAt": {
                    "type": "string",
                    "minLength": 20
                  },
                  "expiresAt": {
                    "type": "string",
                    "minLength": 20
                  }
                },
                "required": [
                  "kind",
                  "by",
                  "enabledAt",
                  "expiresAt"
                ],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "kind": {
                    "type": "string",
                    "const": "PERSON"
                  },
                  "by": {
                    "type": "object",
                    "properties": {
                      "id": {
                        "type": "string"
                      },
                      "name": {
                        "type": "string"
                      }
                    },
                    "required": [
                      "id",
                      "name"
                    ],
                    "additionalProperties": false
                  }
                },
                "required": [
                  "kind",
                  "by"
                ],
                "additionalProperties": false
              }
            ]
          },
          {
            "type": "null"
          }
        ]
      },
      "UndoAgentBatchResponse": {
        "type": "object",
        "properties": {
          "outcome": {
            "type": "string",
            "const": "job_started"
          },
          "job": {
            "$ref": "#/components/schemas/Job"
          },
          "existing": {
            "type": "boolean"
          }
        },
        "required": [
          "outcome",
          "job",
          "existing"
        ],
        "additionalProperties": false
      },
      "ValidFrom": {
        "anyOf": [
          {
            "type": "object",
            "properties": {
              "iso": {
                "type": "string",
                "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
              },
              "line": {
                "type": "string",
                "maxLength": 200
              }
            },
            "required": [
              "iso",
              "line"
            ],
            "additionalProperties": false
          },
          {
            "type": "null"
          }
        ]
      },
      "Vendor": {
        "default": null,
        "anyOf": [
          {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "displayName": {
                "type": "string"
              },
              "placement": {
                "type": "string",
                "enum": [
                  "NAME",
                  "ALIAS"
                ]
              }
            },
            "required": [
              "id",
              "displayName",
              "placement"
            ],
            "additionalProperties": false
          },
          {
            "type": "null"
          }
        ]
      },
      "Vendor2": {
        "anyOf": [
          {
            "$ref": "#/components/schemas/Vendor2Option1"
          },
          {
            "type": "null"
          }
        ]
      },
      "Vendor2Option1": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "label": {
            "type": "string"
          },
          "kind": {
            "type": "string",
            "enum": [
              "bill",
              "vendor",
              "payment-run",
              "entry",
              "account",
              "entity",
              "person",
              "dimension-value",
              "authority",
              "rule",
              "purchase-order"
            ]
          }
        },
        "required": [
          "id",
          "label",
          "kind"
        ],
        "additionalProperties": false
      },
      "Vendor3": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "displayName": {
            "type": "string"
          },
          "legalName": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "id",
          "displayName",
          "legalName"
        ],
        "additionalProperties": false
      },
      "VendorOption1": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "displayName": {
            "type": "string"
          },
          "language": {
            "type": "string",
            "enum": [
              "en",
              "fr"
            ]
          }
        },
        "required": [
          "id",
          "displayName",
          "language"
        ],
        "additionalProperties": false
      },
      "VendorStatement": {
        "default": null,
        "anyOf": [
          {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "statementDate": {
                "anyOf": [
                  {
                    "type": "string",
                    "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                  },
                  {
                    "type": "null"
                  }
                ]
              }
            },
            "required": [
              "id",
              "statementDate"
            ],
            "additionalProperties": false
          },
          {
            "type": "null"
          }
        ]
      },
      "ViewsItem2": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "report": {
            "$ref": "#/components/schemas/Report"
          },
          "name": {
            "type": "string"
          },
          "filters": {
            "type": "object",
            "propertyNames": {
              "type": "string"
            },
            "additionalProperties": {
              "type": "string"
            }
          },
          "createdAt": {
            "type": "string",
            "minLength": 20
          },
          "updatedAt": {
            "type": "string",
            "minLength": 20
          }
        },
        "required": [
          "id",
          "report",
          "name",
          "filters",
          "createdAt",
          "updatedAt"
        ],
        "additionalProperties": false
      },
      "ViewsItem3": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "list": {
            "$ref": "#/components/schemas/List"
          },
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 80
          },
          "filters": {
            "type": "object",
            "propertyNames": {
              "type": "string"
            },
            "additionalProperties": {
              "type": "string"
            }
          },
          "shared": {
            "type": "boolean"
          },
          "sharedAt": {
            "anyOf": [
              {
                "type": "string",
                "minLength": 20
              },
              {
                "type": "null"
              }
            ]
          },
          "ownerId": {
            "type": "string"
          },
          "ownerName": {
            "type": "string"
          },
          "mine": {
            "type": "boolean"
          },
          "source": {
            "type": "string",
            "enum": [
              "PERSON",
              "DRAFT"
            ]
          },
          "draftPromptVersion": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 40
              },
              {
                "type": "null"
              }
            ]
          },
          "createdAt": {
            "type": "string",
            "minLength": 20
          },
          "updatedAt": {
            "type": "string",
            "minLength": 20
          }
        },
        "required": [
          "id",
          "list",
          "name",
          "filters",
          "shared",
          "sharedAt",
          "ownerId",
          "ownerName",
          "mine",
          "source",
          "draftPromptVersion",
          "createdAt",
          "updatedAt"
        ],
        "additionalProperties": false
      },
      "Voided": {
        "anyOf": [
          {
            "type": "object",
            "properties": {
              "by": {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string"
                  },
                  "name": {
                    "type": "string"
                  }
                },
                "required": [
                  "id",
                  "name"
                ],
                "additionalProperties": false
              },
              "at": {
                "type": "string",
                "minLength": 20
              },
              "reason": {
                "type": "string"
              },
              "entry": {
                "$ref": "#/components/schemas/Entry"
              }
            },
            "required": [
              "by",
              "at",
              "reason",
              "entry"
            ],
            "additionalProperties": false
          },
          {
            "type": "null"
          }
        ]
      },
      "WaitingOnYouOption1": {
        "oneOf": [
          {
            "type": "object",
            "properties": {
              "state": {
                "type": "string",
                "const": "READ"
              },
              "count": {
                "type": "integer",
                "minimum": 0,
                "maximum": 9007199254740991
              },
              "oldestOn": {
                "anyOf": [
                  {
                    "type": "string",
                    "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "oldestDays": {
                "anyOf": [
                  {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 9007199254740991
                  },
                  {
                    "type": "null"
                  }
                ]
              }
            },
            "required": [
              "state",
              "count",
              "oldestOn",
              "oldestDays"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "state": {
                "type": "string",
                "const": "UNREAD"
              }
            },
            "required": [
              "state"
            ],
            "additionalProperties": false
          }
        ]
      },
      "WaitingTotals": {
        "type": "array",
        "items": {
          "type": "object",
          "properties": {
            "currency": {
              "type": "string",
              "pattern": "^[A-Z]{3}$"
            },
            "amountMinor": {
              "type": "string",
              "pattern": "^-?\\d+$"
            }
          },
          "required": [
            "currency",
            "amountMinor"
          ],
          "additionalProperties": false
        }
      },
      "Waiver": {
        "anyOf": [
          {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "craReference": {
                "type": "string"
              },
              "rateBp": {
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991
              },
              "validFrom": {
                "type": "string",
                "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
              },
              "validTo": {
                "type": "string",
                "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
              }
            },
            "required": [
              "id",
              "craReference",
              "rateBp",
              "validFrom",
              "validTo"
            ],
            "additionalProperties": false
          },
          {
            "type": "null"
          }
        ]
      },
      "Window": {
        "type": "object",
        "properties": {
          "start": {
            "type": "string",
            "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
          },
          "end": {
            "type": "string",
            "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
          },
          "label": {
            "type": "string"
          }
        },
        "required": [
          "start",
          "end",
          "label"
        ],
        "additionalProperties": false
      },
      "Window2": {
        "anyOf": [
          {
            "type": "object",
            "properties": {
              "years": {
                "anyOf": [
                  {
                    "type": "number",
                    "const": 2
                  },
                  {
                    "type": "number",
                    "const": 4
                  }
                ]
              },
              "declared": {
                "type": "boolean"
              },
              "declaredBy": {
                "anyOf": [
                  {
                    "type": "object",
                    "properties": {
                      "id": {
                        "type": "string"
                      },
                      "name": {
                        "type": "string"
                      }
                    },
                    "required": [
                      "id",
                      "name"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "fiscalYearEnd": {
                "type": "string",
                "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
              },
              "firstPeriod": {
                "$ref": "#/components/schemas/Window"
              },
              "lastPeriod": {
                "$ref": "#/components/schemas/Window"
              },
              "lastDay": {
                "type": "string",
                "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
              },
              "daysLeft": {
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991
              },
              "postingReturnDue": {
                "type": "string",
                "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
              },
              "closedForPosting": {
                "type": "boolean"
              }
            },
            "required": [
              "years",
              "declared",
              "declaredBy",
              "fiscalYearEnd",
              "firstPeriod",
              "lastPeriod",
              "lastDay",
              "daysLeft",
              "postingReturnDue",
              "closedForPosting"
            ],
            "additionalProperties": false
          },
          {
            "type": "null"
          }
        ]
      }
    },
    "responses": {
      "Problem400": {
        "description": "The request has no Idempotency-Key header.",
        "headers": {
          "X-Request-Id": {
            "$ref": "#/components/headers/XRequestId"
          }
        },
        "content": {
          "application/problem+json": {
            "schema": {
              "$ref": "#/components/schemas/ProblemDetails"
            }
          }
        }
      },
      "Problem401": {
        "description": "The key or token is missing, malformed, unknown, revoked or expired.",
        "headers": {
          "X-Request-Id": {
            "$ref": "#/components/headers/XRequestId"
          }
        },
        "content": {
          "application/problem+json": {
            "schema": {
              "$ref": "#/components/schemas/ProblemDetails"
            }
          }
        }
      },
      "Problem403": {
        "description": "The key or token may not do this, or the books are closed to the API.",
        "headers": {
          "X-Request-Id": {
            "$ref": "#/components/headers/XRequestId"
          }
        },
        "content": {
          "application/problem+json": {
            "schema": {
              "$ref": "#/components/schemas/ProblemDetails"
            }
          }
        }
      },
      "Problem404": {
        "description": "There is no such record on these books.",
        "headers": {
          "X-Request-Id": {
            "$ref": "#/components/headers/XRequestId"
          }
        },
        "content": {
          "application/problem+json": {
            "schema": {
              "$ref": "#/components/schemas/ProblemDetails"
            }
          }
        }
      },
      "Problem409": {
        "description": "An identical request is still running, or another change reached the record first.",
        "headers": {
          "X-Request-Id": {
            "$ref": "#/components/headers/XRequestId"
          }
        },
        "content": {
          "application/problem+json": {
            "schema": {
              "$ref": "#/components/schemas/ProblemDetails"
            }
          }
        }
      },
      "Problem412": {
        "description": "The books refuse this in their current state. The problem body says what to change.",
        "headers": {
          "X-Request-Id": {
            "$ref": "#/components/headers/XRequestId"
          }
        },
        "content": {
          "application/problem+json": {
            "schema": {
              "$ref": "#/components/schemas/ProblemDetails"
            }
          }
        }
      },
      "Problem422": {
        "description": "A field is invalid or cannot be set through the API, or the Idempotency-Key was reused for a different request.",
        "headers": {
          "X-Request-Id": {
            "$ref": "#/components/headers/XRequestId"
          }
        },
        "content": {
          "application/problem+json": {
            "schema": {
              "$ref": "#/components/schemas/ProblemDetails"
            }
          }
        }
      },
      "Problem429": {
        "description": "Too many requests. Wait the number of seconds in Retry-After.",
        "headers": {
          "X-Request-Id": {
            "$ref": "#/components/headers/XRequestId"
          },
          "Retry-After": {
            "$ref": "#/components/headers/RetryAfter"
          },
          "RateLimit-Policy": {
            "$ref": "#/components/headers/RateLimitPolicy"
          },
          "RateLimit": {
            "$ref": "#/components/headers/RateLimit"
          }
        },
        "content": {
          "application/problem+json": {
            "schema": {
              "$ref": "#/components/schemas/ProblemDetails"
            }
          }
        }
      },
      "Problem500": {
        "description": "A fault on our side. Quote the X-Request-Id when you write to us.",
        "headers": {
          "X-Request-Id": {
            "$ref": "#/components/headers/XRequestId"
          }
        },
        "content": {
          "application/problem+json": {
            "schema": {
              "$ref": "#/components/schemas/ProblemDetails"
            }
          }
        }
      }
    },
    "parameters": {
      "IdempotencyKey": {
        "name": "Idempotency-Key",
        "in": "header",
        "required": true,
        "description": "A new value for each new request (a UUID is fine), the same value when you retry it. Kept for 7 days.",
        "schema": {
          "type": "string",
          "minLength": 1,
          "maxLength": 255
        }
      }
    },
    "headers": {
      "XRequestId": {
        "description": "Quote this when you write to us about the call.",
        "schema": {
          "type": "string"
        }
      },
      "RateLimitPolicy": {
        "description": "The quota and window of this class of call, for example \"reads\";q=300;w=60.",
        "schema": {
          "type": "string"
        }
      },
      "RateLimit": {
        "description": "What is left of the quota and when it resets, for example \"reads\";r=250;t=30.",
        "schema": {
          "type": "string"
        }
      },
      "RetryAfter": {
        "description": "Seconds to wait before sending the same request again.",
        "schema": {
          "type": "integer",
          "minimum": 0
        }
      },
      "LedgerPosition": {
        "description": "The position in the ledger's event log after this write. Pass it to listEvents as startPosition to read what followed.",
        "schema": {
          "type": "string",
          "pattern": "^[0-9]{1,19}$"
        }
      },
      "Location": {
        "description": "Where to read the record that was created, or the page where a person confirms the act.",
        "schema": {
          "type": "string"
        }
      }
    }
  }
}
