{
  "openapi": "3.0.3",
  "info": {
    "title": "Flow Payroll API",
    "version": "combined",
    "description": "Aggregated specification combining every Flow Payroll service into one document, scoped to a single API gateway. Generated from the per-service specs; those remain the source of truth. Health-check endpoints are omitted.",
    "contact": {
      "name": "Flow Payroll Support",
      "email": "hello@flowpayroll.ai"
    }
  },
  "servers": [
    {
      "url": "https://api.sandbox.flowpayroll.ai",
      "description": "Sandbox"
    },
    {
      "url": "https://api.flowpayroll.ai",
      "description": "Live"
    }
  ],
  "security": [
    {
      "X-Auth-Token": []
    }
  ],
  "tags": [
    {
      "name": "Administration · API tokens"
    },
    {
      "name": "Administration · Activity"
    },
    {
      "name": "Administration · Branding"
    },
    {
      "name": "Administration · Customer"
    },
    {
      "name": "Administration · Organisation groups"
    },
    {
      "name": "Administration · Organisations"
    },
    {
      "name": "Administration · Roles"
    },
    {
      "name": "Administration · SCIM"
    },
    {
      "name": "Administration · Users"
    },
    {
      "name": "Authentication · Organisations"
    },
    {
      "name": "Billing · Account codes"
    },
    {
      "name": "Billing · Accounting Sync"
    },
    {
      "name": "Billing · Clients"
    },
    {
      "name": "Billing · Credit Notes"
    },
    {
      "name": "Billing · Finance defaults"
    },
    {
      "name": "Billing · Invoice & credit note templates"
    },
    {
      "name": "Billing · Invoices"
    },
    {
      "name": "Billing · Tax rates"
    },
    {
      "name": "Court orders · Attachments"
    },
    {
      "name": "Court orders · Court orders"
    },
    {
      "name": "Court orders · Payees"
    },
    {
      "name": "Court orders · Reference data"
    },
    {
      "name": "Email wording · Account emails"
    },
    {
      "name": "Email wording · Organisation emails"
    },
    {
      "name": "HMRC DPS · Bulk actions"
    },
    {
      "name": "HMRC DPS · Jobs"
    },
    {
      "name": "HMRC DPS · Notifications"
    },
    {
      "name": "HMRC DPS · Pagination"
    },
    {
      "name": "HMRC P-forms · P32"
    },
    {
      "name": "HMRC P-forms · P45"
    },
    {
      "name": "HMRC P-forms · P60"
    },
    {
      "name": "HMRC P-forms · PFormBulkSend"
    },
    {
      "name": "Holiday · Holiday Employee Configuration"
    },
    {
      "name": "Holiday · Holiday History"
    },
    {
      "name": "Holiday · Holiday Organisation Configuration"
    },
    {
      "name": "Holiday · Holiday Taken"
    },
    {
      "name": "Holiday · Opening Balance"
    },
    {
      "name": "Integrations · Activity"
    },
    {
      "name": "Integrations · Connections"
    },
    {
      "name": "Integrations · Initial import"
    },
    {
      "name": "Integrations · Provider data"
    },
    {
      "name": "Integrations · Providers"
    },
    {
      "name": "Integrations · Scheme links"
    },
    {
      "name": "Pay API · Calculator"
    },
    {
      "name": "Pay API · Employees"
    },
    {
      "name": "Pay API · NI & identifiers"
    },
    {
      "name": "Pay API · Organisation"
    },
    {
      "name": "Pay API · Pay Elements"
    },
    {
      "name": "Pay API · Payroll"
    },
    {
      "name": "Pay API · Payroll lines"
    },
    {
      "name": "Pay API · Payroll setup"
    },
    {
      "name": "Pay API · PayrollConfig"
    },
    {
      "name": "Pay API · Payslip"
    },
    {
      "name": "Pay API · RTI"
    },
    {
      "name": "Pay API · Salary"
    },
    {
      "name": "Pay API · Starters & leavers"
    },
    {
      "name": "Pay API · Student loans"
    },
    {
      "name": "Pay API · Tax codes"
    },
    {
      "name": "Pay API · Working patterns"
    },
    {
      "name": "Pay API · YearEnd"
    },
    {
      "name": "Payment · AvailablePaymentConfig"
    },
    {
      "name": "Payment · OrganisationPaymentConfig"
    },
    {
      "name": "Payment · PaymentFile"
    },
    {
      "name": "Payroll journals · Control account mappings"
    },
    {
      "name": "Payroll journals · Journal export metadata"
    },
    {
      "name": "Payroll journals · Journal templates"
    },
    {
      "name": "Payroll journals · Journals"
    },
    {
      "name": "Payroll journals · Org journal settings"
    },
    {
      "name": "Payroll journals · Pay element mappings"
    },
    {
      "name": "Payroll journals · Split dimensions"
    },
    {
      "name": "Payroll journals · Split value mappings"
    },
    {
      "name": "Pensions v2 · AdditionalVoluntaryContribution"
    },
    {
      "name": "Pensions v2 · Auto-enrolment"
    },
    {
      "name": "Pensions v2 · AutoEnrolmentExemption"
    },
    {
      "name": "Pensions v2 · ContributionOverride"
    },
    {
      "name": "Pensions v2 · Employee enrolment"
    },
    {
      "name": "Pensions v2 · Organisation defaults"
    },
    {
      "name": "Pensions v2 · Pension calculations"
    },
    {
      "name": "Pensions v2 · Pension groups"
    },
    {
      "name": "Pensions v2 · Pension information"
    },
    {
      "name": "Pensions v2 · Pension providers"
    },
    {
      "name": "Pensions v2 · Pension schemes"
    },
    {
      "name": "Pensions v2 · Postponement"
    },
    {
      "name": "Pensions v2 · Provider submissions"
    },
    {
      "name": "Recurring line items · Recurring Line Items"
    },
    {
      "name": "Reports · Datasets"
    },
    {
      "name": "Reports · Exports"
    },
    {
      "name": "Reports · Report definitions"
    },
    {
      "name": "Reports · Run history"
    },
    {
      "name": "Reports · Run reports"
    },
    {
      "name": "Reports · Schedules"
    },
    {
      "name": "Reports · report-settings"
    },
    {
      "name": "Salary · Salary employee configuration"
    },
    {
      "name": "Salary · Salary lines"
    },
    {
      "name": "Salary · Salary organisation configuration"
    },
    {
      "name": "Salary · Statutory leave policies"
    },
    {
      "name": "Statutory pay · Alabaster & earnings"
    },
    {
      "name": "Statutory pay · Attachments"
    },
    {
      "name": "Statutory pay · External payments"
    },
    {
      "name": "Statutory pay · Import & reconcile"
    },
    {
      "name": "Statutory pay · Line items & schedule"
    },
    {
      "name": "Statutory pay · Statutory Calculations"
    },
    {
      "name": "Statutory pay · Statutory Rates"
    },
    {
      "name": "Statutory pay · Statutory payments"
    },
    {
      "name": "Webhooks · Alert contacts"
    },
    {
      "name": "Webhooks · Delivery log"
    },
    {
      "name": "Webhooks · Endpoint subscriptions"
    },
    {
      "name": "Webhooks · Endpoints"
    },
    {
      "name": "Webhooks · Event types"
    },
    {
      "name": "Webhooks · Events"
    },
    {
      "name": "Webhooks · Replays"
    }
  ],
  "paths": {
    "/v1/authentication/my-organisations": {
      "get": {
        "tags": [
          "Authentication · Organisations"
        ],
        "operationId": "Authentication_GetMyOrganisations",
        "summary": "List the organisations the authenticated principal can act on",
        "description": "Returns every organisation the caller has been granted access to, with its legal and trading name. The list is sourced from the principal access table (the source of truth for who can act on which organisation) and joined with the organisation directory for names. Works before an organisation is selected, so a multi-organisation principal can populate an organisation switcher. Results are paginated; follow `paginationToken` until it is absent.",
        "parameters": [
          {
            "name": "pageSize",
            "in": "query",
            "required": false,
            "description": "Maximum number of organisations to return (1-100). Defaults to 50; values outside the range are clamped.",
            "schema": {
              "type": "integer",
              "format": "int32",
              "minimum": 1,
              "maximum": 100,
              "default": 50
            }
          },
          {
            "name": "paginationToken",
            "in": "query",
            "required": false,
            "description": "Opaque token returned by a previous page. Omit for the first page.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The organisations the caller can act on.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Authentication_ApiResponseMyOrganisations"
                }
              }
            }
          },
          "400": {
            "description": "The pagination token is not valid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Authentication_ApiResponseError"
                }
              }
            }
          },
          "401": {
            "description": "The caller could not be authenticated.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Authentication_ApiResponseError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/administration/activity": {
      "get": {
        "tags": [
          "Administration · Activity"
        ],
        "summary": "List recent administration activity",
        "description": "Needs permission organisation:read.\n\nThe latest administration actions in your account, newest first: organisations added, people invited or removed, access changed, and API tokens issued, rotated, renamed, rescoped or revoked. Each event's `action` is one of a closed PascalCase set, published as an enum on the field.\n\nPaginated: `pageSize` defaults to 10 and is at most 50, and `paginationToken` walks further back. Follow the token until it is absent rather than raising `pageSize`. Events are kept for 90 days.",
        "operationId": "Administration_GetActivity",
        "parameters": [
          {
            "name": "pageSize",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "paginationToken",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ActivityListResponseResponseBody"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ObjectResponseBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ObjectResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ObjectResponseBody"
                }
              }
            }
          }
        },
        "x-flow-permission": "organisation:read"
      }
    },
    "/v1/administration/access-changes": {
      "get": {
        "tags": [
          "Administration · Activity"
        ],
        "summary": "List changes to who has access",
        "description": "Needs permission user:read.\n\nEvery change to who can reach what in your account, newest first: access given (`Granted`), a different role (`RoleChanged`) and access taken away (`Removed`), on one organisation, an organisation group or the whole account. Each change names the person or API token, `roleBefore` and `roleAfter`, who made it (`actor`), when, and the `requestId` that made it. `source` is `Administration` for a change made in an account and `Platform` for one FlowPayroll made; a `Platform` removal has no `actor`.\n\n`?principalId=` narrows the list to one person (`USER#…`) or API token (`M2M#…`), as the other lists show them (400 `invalid_principal_id` otherwise).\n\nPaginated: `pageSize` (default 25, at most 100) and `paginationToken`; follow the token until it is absent. Changes are listed here for 13 months, and kept in write-once storage for 7 years.",
        "operationId": "Administration_GetAccessChanges",
        "parameters": [
          {
            "name": "principalId",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "pageSize",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "paginationToken",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_AccessChangeListResponseResponseBody"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ObjectResponseBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ObjectResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ObjectResponseBody"
                }
              }
            }
          }
        },
        "x-flow-permission": "user:read"
      }
    },
    "/v1/administration/api-tokens": {
      "get": {
        "tags": [
          "Administration · API tokens"
        ],
        "summary": "List your API tokens",
        "description": "Needs permission api-token:read.\n\nEvery API token (client credential) your account holds, paginated. The organisations each token reaches are not included here — read them per token from `GET /api-tokens/{clientId}`.\n\nAn account may hold 5 API tokens, so count them here before offering to create another. A few accounts hold more, from credentials issued before the limit existed, and keep them.\n\nNo response from this endpoint contains a secret. A secret is shown once, when a token is created or rotated, and never again.\n\n`callerAccess.granted` on each token says whether you can manage it: a token with account-wide access needs account-wide access of your own, any other needs every organisation it reaches.",
        "operationId": "Administration_GetApiTokens",
        "parameters": [
          {
            "name": "pageSize",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "paginationToken",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ApiTokenListResponseResponseBody"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ObjectResponseBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ObjectResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ObjectResponseBody"
                }
              }
            }
          }
        },
        "x-flow-permission": "api-token:read"
      },
      "post": {
        "tags": [
          "Administration · API tokens"
        ],
        "summary": "Create an API token",
        "description": "Needs permission api-token:write.\n\nIssues a new client credential for your account. The response carries `clientSecret` exactly once — store it before doing anything else. Retrying with the same `Idempotency-Key` answers 200 with the token already made and no secret; if the secret has been lost, rotate the token.\n\n`roleId` is the token's role (`GET /roles`, those listing `api-token` in `assignableTo`); leave it out for your account's default role. A token's role never covers API tokens, roles or the account, whatever it says. Giving a token a role needs a caller who manages API tokens where it applies (403 `access_management_denied` otherwise; a person or an API token alike), and the role's permissions must be ones you hold (403 `role_assignment_denied`). A role for people only answers 400 `role_not_assignable`, and while only Administrator can be given out any other role answers 400 `role_not_yet_available`. A role you leave out on access it did not have is your account's default role (`GET /customer/access-settings`), and `administrator` while only Administrator can be given out; when that default role is for people only, the token is refused with 400 `role_not_assignable` and you name its role. Every response lists the token's role at each place in `roles`.\n\n`allowedIpRanges` lists the address ranges the token may be used from: 1 to 20, IPv4 or IPv6, such as `203.0.113.0/24` or `2001:db8::/32`, with no spaces or leading zeros. Each is stored as its network address. From anywhere else every API, this one included, answers 403 `ip_not_allowed`. 400 `invalid_ip_range` names a range we cannot use. Only a person changes or lifts an existing token's ranges: an API token is refused with 403 `insufficient_permissions`, `missingPermission: api-token:write`. An API token restricted to ranges issues or rotates only tokens within them (403 `token_ranges_wider_than_yours`); one it issues without ranges gets its own. Leave it out to allow any address.\n\nState what the token reaches as either `organisationIds` or `allOrganisations: true`, never both. `allOrganisations` grants account-wide access — every organisation the account owns, including ones added later — and only somebody who already holds account-wide access may grant it (403 `whole_customer_access_denied` otherwise). `name` is 3 to 100 characters and unique within your account.\n\nAn account may hold 5 API tokens, counting every client credential it holds and not only the ones created here. Being over the limit revokes nothing; it only refuses a new one. Three things answer 409, told apart by `message.token`:\n- `token_limit_reached` — the account already holds 5 tokens. Revoke one that is no longer used, or contact support to raise the allowance.\n- `duplicate_token_name` — another token in your account has that name.\n- `idempotency_key_reused` — that `Idempotency-Key` was already used for a different request body.\n\n403 `billing_not_set_up` when billing is not set up for the account yet — email hello@flowpayroll.ai to agree pricing and set it up. Accounts onboarded by Flow Payroll are already set up.",
        "operationId": "Administration_IssueApiToken",
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "description": "Your own key for this create, so a retry after a lost response finds what the first attempt made instead of making a second one. Any unique string up to 255 characters; a UUID is the usual choice. Send the same value on every retry of the same request, and a new value for a new one — reusing a key for a different body answers 409 `idempotency_key_reused`. Keys are remembered for 24 hours. Optional, and a request without one simply has no replay protection.",
            "schema": {
              "maxLength": 255,
              "type": "string"
            },
            "example": "8b1f4c1e-0000-4000-8000-000000000000"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Administration_IssueApiTokenRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ApiTokenIssuedResponseResponseBody"
                }
              }
            }
          },
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ApiTokenIssuedResponseResponseBody"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ObjectResponseBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ObjectResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ObjectResponseBody"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ObjectResponseBody"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ObjectResponseBody"
                }
              }
            }
          }
        },
        "x-flow-permission": "api-token:write"
      }
    },
    "/v1/administration/api-tokens/{clientId}": {
      "get": {
        "tags": [
          "Administration · API tokens"
        ],
        "summary": "Get an API token and its access",
        "description": "Needs permission api-token:read.\n\nOne token, with both kinds of access it may hold, exactly as `GET /users/{principalId}` reports them for a person:\n\n- `organisationIds` — every organisation it reaches through a direct grant.\n- `coversWholeCustomer` — whether it also holds account-wide access, which reaches every organisation the account owns, including ones added later, and names none of them.\n\n**Read `coversWholeCustomer` before treating an empty `organisationIds` as no access.** There are no roles: a credential either reaches an organisation or it does not, and one that reaches it may do everything in it.\n\n`token.callerAccess.granted` says whether you can manage it. A token with account-wide access is only readable with account-wide access of your own (403 `whole_customer_access_denied`).\n\nTo change the direct grants, use `/api-tokens/{clientId}/organisations`; for account-wide access, `/api-tokens/{clientId}/customer-access`. No response from this endpoint contains a secret.",
        "operationId": "Administration_GetApiToken",
        "parameters": [
          {
            "name": "clientId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ApiTokenDetailResponseResponseBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ObjectResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ObjectResponseBody"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ObjectResponseBody"
                }
              }
            }
          }
        },
        "x-flow-permission": "api-token:read"
      },
      "patch": {
        "tags": [
          "Administration · API tokens"
        ],
        "summary": "Rename an API token, or change where it may be used from",
        "description": "Needs permission api-token:write.\n\nA JSON Merge Patch: send `name`, `allowedIpRanges`, or both; leave one out to keep it. The client id, the secret and the organisations it reaches are untouched. 409 `duplicate_token_name` when another token in your account already has that name.\n\n`allowedIpRanges` lists the address ranges the token may be used from: 1 to 20, IPv4 or IPv6, such as `203.0.113.0/24` or `2001:db8::/32`, with no spaces or leading zeros. Each is stored as its network address. From anywhere else every API, this one included, answers 403 `ip_not_allowed`. 400 `invalid_ip_range` names a range we cannot use. Only a person changes or lifts an existing token's ranges: an API token is refused with 403 `insufficient_permissions`, `missingPermission: api-token:write`. An API token restricted to ranges issues or rotates only tokens within them (403 `token_ranges_wider_than_yours`); one it issues without ranges gets its own. `null` lets it be used from anywhere again. Changing it needs a person who manages API tokens: a token can never change its own or another token's ranges (403 `insufficient_permissions`, `missingPermission: api-token:write`).",
        "operationId": "Administration_RenameApiToken",
        "parameters": [
          {
            "name": "clientId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/merge-patch+json": {
              "schema": {
                "$ref": "#/components/schemas/Administration_RenameApiTokenRequest"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Administration_RenameApiTokenRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ApiTokenSummaryResponseResponseBody"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ObjectResponseBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ObjectResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ObjectResponseBody"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ObjectResponseBody"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ObjectResponseBody"
                }
              }
            }
          }
        },
        "x-flow-permission": "api-token:write"
      },
      "delete": {
        "tags": [
          "Administration · API tokens"
        ],
        "summary": "Revoke an API token",
        "description": "Needs permission api-token:write.\n\nNothing can authenticate with the credential afterwards. Takes effect immediately: an access token already minted from it stays decodable for up to an hour, but every request it makes is refused, because access is checked against live data on each call.",
        "operationId": "Administration_RevokeApiToken",
        "parameters": [
          {
            "name": "clientId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ApiTokenSummaryResponseResponseBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ObjectResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ObjectResponseBody"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ObjectResponseBody"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ObjectResponseBody"
                }
              }
            }
          }
        },
        "x-flow-permission": "api-token:write"
      }
    },
    "/v1/administration/api-tokens/{clientId}/rotate": {
      "post": {
        "tags": [
          "Administration · API tokens"
        ],
        "summary": "Rotate an API token's secret",
        "description": "Needs permission api-token:write.\n\nIssues a new secret for the same client id and invalidates the old one. Anything still using the old secret stops working immediately, so update the integration straight away. The new secret is shown once, in this response, and never again.",
        "operationId": "Administration_RotateApiToken",
        "parameters": [
          {
            "name": "clientId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ApiTokenIssuedResponseResponseBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ObjectResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ObjectResponseBody"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ObjectResponseBody"
                }
              }
            }
          }
        },
        "x-flow-permission": "api-token:write"
      }
    },
    "/v1/administration/api-tokens/{clientId}/organisations": {
      "put": {
        "tags": [
          "Administration · API tokens"
        ],
        "summary": "Replace the organisations an API token reaches",
        "description": "Needs permission api-token:write.\n\nDeclarative: afterwards the token holds a direct grant on exactly the organisations listed, and the difference from its current grants is worked out here. `roleId` gives it that role on every organisation listed; leave it out to keep its roles, and new organisations get your account's default role. Giving a token a role needs a caller who manages API tokens where it applies (403 `access_management_denied` otherwise; a person or an API token alike), and the role's permissions must be ones you hold (403 `role_assignment_denied`). A role for people only answers 400 `role_not_assignable`, and while only Administrator can be given out any other role answers 400 `role_not_yet_available`. A role you leave out on access it did not have is your account's default role (`GET /customer/access-settings`), and `administrator` while only Administrator can be given out; when that default role is for people only, the token is refused with 400 `role_not_assignable` and you name its role. Every response lists the token's role at each place in `roles`. An empty list is refused with 400 — revoke the token instead, so ending an integration is always an explicit act. 404 when any organisation named is not yours.\n\nPrefer the per-organisation routes for a single change: two administrators replacing the set at once have one overwrite the other, and for a credential the overwritten edit is an integration that stops working with nothing to say why. `PUT` and `DELETE /api-tokens/{clientId}/organisations/{organisationId}` cannot lose a concurrent edit.\n\nAccount-wide access is not affected by this operation. The response is the same body every other operation on this resource returns, with `coversWholeCustomer` read live.",
        "operationId": "Administration_ReplaceApiTokenOrganisations",
        "parameters": [
          {
            "name": "clientId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Administration_ReplaceApiTokenOrganisationsRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ApiTokenOrganisationsResponseResponseBody"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ObjectResponseBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ObjectResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ObjectResponseBody"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ObjectResponseBody"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ObjectResponseBody"
                }
              }
            }
          }
        },
        "x-flow-permission": "api-token:write"
      },
      "get": {
        "tags": [
          "Administration · API tokens"
        ],
        "summary": "List the organisations an API token reaches",
        "description": "Needs permission api-token:read.\n\nThe token's access on its own, without its record: `organisationIds` for its direct grants and `coversWholeCustomer` for account-wide access. Every operation on this resource returns the same body, so nothing needs re-fetching to see what a change did. The credential counterpart of `GET /users/{principalId}/organisations`.",
        "operationId": "Administration_GetApiTokenOrganisations",
        "parameters": [
          {
            "name": "clientId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ApiTokenOrganisationsResponseResponseBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ObjectResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ObjectResponseBody"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ObjectResponseBody"
                }
              }
            }
          }
        },
        "x-flow-permission": "api-token:read"
      }
    },
    "/v1/administration/api-tokens/{clientId}/organisations/{organisationId}": {
      "put": {
        "tags": [
          "Administration · API tokens"
        ],
        "summary": "Grant an API token one organisation",
        "description": "Needs permission api-token:write.\n\nIdempotent, and safe to use concurrently: two administrators adding two different organisations both succeed, where two declarative replaces would have one overwrite the other. The body is optional: `roleId` gives the token that role there; leave it out to keep its role, or to give your account's default role on an organisation it did not reach. Giving a token a role needs a caller who manages API tokens where it applies (403 `access_management_denied` otherwise; a person or an API token alike), and the role's permissions must be ones you hold (403 `role_assignment_denied`). A role for people only answers 400 `role_not_assignable`, and while only Administrator can be given out any other role answers 400 `role_not_yet_available`. A role you leave out on access it did not have is your account's default role (`GET /customer/access-settings`), and `administrator` while only Administrator can be given out; when that default role is for people only, the token is refused with 400 `role_not_assignable` and you name its role. Every response lists the token's role at each place in `roles`.\n\n404 when the organisation is not yours, so a credential cannot be widened to something you cannot see. Everything else the token reaches is left alone.",
        "operationId": "Administration_GrantApiTokenOrganisation",
        "parameters": [
          {
            "name": "clientId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "organisationId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Administration_AccessRoleRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ApiTokenOrganisationsResponseResponseBody"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ObjectResponseBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ObjectResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ObjectResponseBody"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ObjectResponseBody"
                }
              }
            }
          }
        },
        "x-flow-permission": "api-token:write"
      },
      "delete": {
        "tags": [
          "Administration · API tokens"
        ],
        "summary": "Remove an API token's grant on one organisation",
        "description": "Needs permission api-token:write.\n\nIdempotent: removing an organisation the token does not reach answers the same as removing one it did. Everything else it reaches is left alone.\n\n400 `token_access_would_be_empty` when it would leave the token reaching nothing — a credential that authenticates and reaches no organisation fails every call with no explanation. Revoke the token with `DELETE /api-tokens/{clientId}` instead, so ending an integration is always an explicit act.",
        "operationId": "Administration_RevokeApiTokenOrganisation",
        "parameters": [
          {
            "name": "clientId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "organisationId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ApiTokenOrganisationsResponseResponseBody"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ObjectResponseBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ObjectResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ObjectResponseBody"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ObjectResponseBody"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ObjectResponseBody"
                }
              }
            }
          }
        },
        "x-flow-permission": "api-token:write"
      }
    },
    "/v1/administration/api-tokens/{clientId}/customer-access": {
      "get": {
        "tags": [
          "Administration · API tokens"
        ],
        "summary": "Check whether an API token has account-wide access",
        "description": "Needs permission api-token:read.\n\nRead `coversWholeCustomer`. The body is the same one `/api-tokens/{clientId}/organisations` returns, because the two are two views of one credential's access.",
        "operationId": "Administration_GetApiTokenCustomerAccess",
        "parameters": [
          {
            "name": "clientId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ApiTokenOrganisationsResponseResponseBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ObjectResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ObjectResponseBody"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ObjectResponseBody"
                }
              }
            }
          }
        },
        "x-flow-permission": "api-token:read"
      },
      "put": {
        "tags": [
          "Administration · API tokens"
        ],
        "summary": "Grant an API token account-wide access",
        "description": "Needs permission api-token:write.\n\nAfterwards the token reaches every organisation the account owns, including ones added later, whatever its `organisationIds` list says. Idempotent. The body is optional: `roleId` sets the token's role across the account. Giving a token a role needs a caller who manages API tokens where it applies (403 `access_management_denied` otherwise; a person or an API token alike), and the role's permissions must be ones you hold (403 `role_assignment_denied`). A role for people only answers 400 `role_not_assignable`, and while only Administrator can be given out any other role answers 400 `role_not_yet_available`. A role you leave out on access it did not have is your account's default role (`GET /customer/access-settings`), and `administrator` while only Administrator can be given out; when that default role is for people only, the token is refused with 400 `role_not_assignable` and you name its role. Every response lists the token's role at each place in `roles`.\n\n**This is the widest grant this API makes.** A leaked credential holding it reaches everything, so only somebody who already holds account-wide access may grant it — 403 `whole_customer_access_denied` otherwise, a higher bar than `PUT /api-tokens/{clientId}/organisations/{organisationId}`, which needs only the one organisation.\n\nThe token's direct grants are left as they are, so removing account-wide access later returns it to exactly that set rather than to nothing.",
        "operationId": "Administration_GrantApiTokenCustomerAccess",
        "parameters": [
          {
            "name": "clientId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Administration_AccessRoleRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ApiTokenOrganisationsResponseResponseBody"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ObjectResponseBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ObjectResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ObjectResponseBody"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ObjectResponseBody"
                }
              }
            }
          }
        },
        "x-flow-permission": "api-token:write"
      },
      "delete": {
        "tags": [
          "Administration · API tokens"
        ],
        "summary": "Remove an API token's account-wide access",
        "description": "Needs permission api-token:write.\n\nAfterwards the token reaches exactly the organisations in `organisationIds`. Idempotent, and the same bar as granting it: only somebody who holds account-wide access may remove it.\n\nUnlike removing a token's last organisation, this is not refused for leaving the credential reaching nothing: narrowing is plainly what the caller means, and the next step is granting the organisations it should have. Until then the token still authenticates and reaches nothing, which the response shows.",
        "operationId": "Administration_RevokeApiTokenCustomerAccess",
        "parameters": [
          {
            "name": "clientId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ApiTokenOrganisationsResponseResponseBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ObjectResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ObjectResponseBody"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ObjectResponseBody"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ObjectResponseBody"
                }
              }
            }
          }
        },
        "x-flow-permission": "api-token:write"
      }
    },
    "/v1/administration/customer/branding": {
      "get": {
        "tags": [
          "Administration · Branding"
        ],
        "summary": "Get your published brand",
        "description": "Needs permission customer:read.\n\nThe brand your employees, emails and documents see now: the live revision. 404 `branding_not_published` until the first publish. Edits to the draft do not change this.",
        "operationId": "Administration_GetPublishedBranding",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_BrandingRevisionResponseResponseBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ObjectResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ObjectResponseBody"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ObjectResponseBody"
                }
              }
            }
          }
        },
        "x-flow-permission": "customer:read"
      },
      "delete": {
        "tags": [
          "Administration · Branding"
        ],
        "summary": "Go back to the Flow brand",
        "description": "Needs permission customer:write.\n\nTakes your brand down: your organisations, their employees, emails, payslips and your web addresses show the Flow brand again, within 15 minutes (your own web address within a minute). Answers the revision that was live. Every revision stays in your history, so republishing one brings your brand back; the draft is not changed. 404 `branding_not_published` when nothing is live, 409 `concurrent_change` when somebody published at the same moment.",
        "operationId": "Administration_UnpublishBranding",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_BrandingRevisionResponseResponseBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ObjectResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ObjectResponseBody"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ObjectResponseBody"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ObjectResponseBody"
                }
              }
            }
          }
        },
        "x-flow-permission": "customer:write"
      }
    },
    "/v1/administration/customer/branding/draft": {
      "get": {
        "tags": [
          "Administration · Branding"
        ],
        "summary": "Get your brand draft",
        "description": "Needs permission customer:read.\n\nThe editable copy of your brand, with short-lived preview links to its logo and icon and what Flow has switched on for your account (`entitlement`, read-only). Nobody else sees the draft until it is published. `version` is 0 before the first save. `canChange` says whether you can change the brand; one-organisation administrators can view only. The `ETag` header is the version as an entity tag; send it back as `If-Match` to change the draft.",
        "operationId": "Administration_GetBrandingDraft",
        "responses": {
          "200": {
            "description": "OK",
            "headers": {
              "ETag": {
                "description": "The draft's current version as a strong entity tag, such as `\"5\"`. Send it as `If-Match` to change it.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_BrandingDraftResponseResponseBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ObjectResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ObjectResponseBody"
                }
              }
            }
          }
        },
        "x-flow-permission": "customer:read"
      },
      "patch": {
        "tags": [
          "Administration · Branding"
        ],
        "summary": "Change your brand draft",
        "description": "Needs permission customer:write.\n\nA JSON Merge Patch (RFC 7396): leave a field out to keep it, send `null` to clear it, send a value to change it. `If-Match` is required and must be the draft's `ETag` as you last read it; if somebody else saved since, the answer is 412 `concurrent_change` and nothing is written; without it, 428 `precondition_required`. Every field is checked: colours are `#RRGGBB`, links `https` only, the product name 2 to 40 characters, the legal footer up to 300, and text on the main colour must reach WCAG AA (4.5:1). `fontLicenceConfirmed: true` records you and the time as the licence confirmation an uploaded font needs. Flow-controlled settings (white label, Powered by Flow, allowances, domains) cannot be sent here. Changing the brand needs access to every organisation in the account, or being its owner (403 `whole_customer_access_denied`); `canChange` on the draft says whether you can.",
        "operationId": "Administration_UpdateBrandingDraft",
        "parameters": [
          {
            "name": "If-Match",
            "in": "header",
            "description": "The draft's `ETag` as you last read it, such as `\"4\"` (the same as `version` in quotes). 412 `concurrent_change` when somebody saved since; 428 `precondition_required` without it.",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/merge-patch+json": {
              "schema": {
                "$ref": "#/components/schemas/Administration_UpdateBrandingDraftRequest"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Administration_UpdateBrandingDraftRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "headers": {
              "ETag": {
                "description": "The draft's current version as a strong entity tag, such as `\"5\"`. Send it as `If-Match` to change it.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_BrandingDraftResponseResponseBody"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ObjectResponseBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ObjectResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ObjectResponseBody"
                }
              }
            }
          },
          "412": {
            "description": "Precondition Failed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ObjectResponseBody"
                }
              }
            }
          },
          "428": {
            "description": "Precondition Required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ObjectResponseBody"
                }
              }
            }
          }
        },
        "x-flow-permission": "customer:write"
      },
      "delete": {
        "tags": [
          "Administration · Branding"
        ],
        "summary": "Start your brand again",
        "description": "Needs permission customer:write.\n\nEmpties the draft so the editor starts again from the Flow look. Answers the draft as it was before. What is published does not change, and your uploaded files and published history stay. 404 `branding_draft_empty` when the draft is already empty, 412 `concurrent_change` when somebody saved since the `If-Match` you sent, or at the same moment. `canChange` says whether you can change the brand; one-organisation administrators can view only.",
        "operationId": "Administration_DiscardBrandingDraft",
        "parameters": [
          {
            "name": "If-Match",
            "in": "header",
            "description": "Optional: the draft's `ETag` as you last read it. Sent, the change is refused with 412 `concurrent_change` when somebody saved since.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "headers": {
              "ETag": {
                "description": "The draft's current version as a strong entity tag, such as `\"5\"`. Send it as `If-Match` to change it.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_BrandingDraftResponseResponseBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ObjectResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ObjectResponseBody"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ObjectResponseBody"
                }
              }
            }
          },
          "412": {
            "description": "Precondition Failed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ObjectResponseBody"
                }
              }
            }
          }
        },
        "x-flow-permission": "customer:write"
      }
    },
    "/v1/administration/customer/branding/revisions": {
      "post": {
        "tags": [
          "Administration · Branding"
        ],
        "summary": "Publish your brand",
        "description": "Needs permission customer:write.\n\nMakes the draft live as a new, immutable revision; or, with `fromRevision`, republishes an older revision as a new one and leaves the draft alone. Needs a product name and a main colour, and every file the brand names must have finished processing (400 `brand_file_not_ready` otherwise). Employees, emails and payslips pick it up within 15 minutes; your own web address within a minute.",
        "operationId": "Administration_PublishBranding",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Administration_PublishBrandingRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_BrandingRevisionResponseResponseBody"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ObjectResponseBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ObjectResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ObjectResponseBody"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ObjectResponseBody"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ObjectResponseBody"
                }
              }
            }
          }
        },
        "x-flow-permission": "customer:write"
      },
      "get": {
        "tags": [
          "Administration · Branding"
        ],
        "summary": "List your published brand history",
        "description": "Needs permission customer:read.\n\nEvery revision ever published, newest first. Paginated: `pageSize` defaults to 20 and is at most 50; follow `paginationToken` until it is absent.",
        "operationId": "Administration_ListBrandingRevisions",
        "parameters": [
          {
            "name": "pageSize",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "paginationToken",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_BrandingRevisionListResponseResponseBody"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ObjectResponseBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ObjectResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ObjectResponseBody"
                }
              }
            }
          }
        },
        "x-flow-permission": "customer:read"
      }
    },
    "/v1/administration/customer/branding/assets": {
      "post": {
        "tags": [
          "Administration · Branding"
        ],
        "summary": "Upload a logo, icon or font",
        "description": "Needs permission customer:write.\n\nAnswers a short-lived signed upload link: PUT the file's bytes, as the whole body, to `url` with every one of `headers`, before `expiresDate`. The server chose the storage key, the content type and the size limit. Then poll the status route with `uploadId` until it is `Ready` (use its `assetId`) or `Rejected` (show its `message`). Logos and icons: SVG, or PNG as a fallback (an icon must be square; a small PNG is scaled up where it is drawn larger), up to 1 MB. Fonts: WOFF2 up to 500 KB. Files are checked by their content, never their name; SVGs are cleaned of scripts and links to other files. An account can be given 200 upload links a day, counted by UTC day (429 `upload_limit_reached`). Fonts need the licence confirmation on the draft first (400 `font_licence_not_confirmed`).",
        "operationId": "Administration_CreateBrandingAssetUpload",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Administration_CreateBrandingAssetUploadRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_BrandingAssetUploadResponseResponseBody"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ObjectResponseBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ObjectResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ObjectResponseBody"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ObjectResponseBody"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ObjectResponseBody"
                }
              }
            }
          }
        },
        "x-flow-permission": "customer:write"
      }
    },
    "/v1/administration/customer/branding/assets/{uploadId}": {
      "get": {
        "tags": [
          "Administration · Branding"
        ],
        "summary": "Check an upload",
        "description": "Needs permission customer:read.\n\n`Processing` until the file has been checked, then `Ready` with the `assetId` to put on the brand (and a short-lived preview link), or `Rejected` with a sentence saying what to upload instead.",
        "operationId": "Administration_GetBrandingAssetUpload",
        "parameters": [
          {
            "name": "uploadId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_BrandingAssetUploadStatusResponseResponseBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ObjectResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ObjectResponseBody"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ObjectResponseBody"
                }
              }
            }
          }
        },
        "x-flow-permission": "customer:read"
      }
    },
    "/v1/administration/customer/branding/domains": {
      "get": {
        "tags": [
          "Administration · Branding"
        ],
        "summary": "List your web addresses",
        "description": "Needs permission customer:read.\n\nThe web addresses Flow has set up for your app, with their status and the exact DNS record to create. Read-only: ask Flow support to add or remove one.",
        "operationId": "Administration_ListBrandingDomains",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_PartnerDomainListResponseResponseBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ObjectResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ObjectResponseBody"
                }
              }
            }
          }
        },
        "x-flow-permission": "customer:read"
      }
    },
    "/v1/administration/customer/branding/sending-domains": {
      "get": {
        "tags": [
          "Administration · Branding"
        ],
        "summary": "List your email sending domains",
        "description": "Needs permission customer:read.\n\nThe email domains Flow has set up for your account's emails, with the DKIM and Return-Path records to create and whether each is verified. Emails are only ever sent from a verified domain: a sender address may be on any of these, and is used once its domain is verified. Also answers the verified domain an unset address uses, and Flow's fallback address. While none is verified, each email comes from its own standard address in your name (the email list says which). Read-only: ask Flow support to add or remove one.",
        "operationId": "Administration_ListBrandingSendingDomains",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_SendingDomainListResponseResponseBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ObjectResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ObjectResponseBody"
                }
              }
            }
          }
        },
        "x-flow-permission": "customer:read"
      }
    },
    "/v1/administration/customer/owner": {
      "put": {
        "tags": [
          "Administration · Customer"
        ],
        "summary": "Transfer ownership of your account",
        "description": "Hands the account to another of its users. Only the current owner may do this — 403 `not_customer_owner` for anybody else. The new owner must already be one of the account's people; 404 when they are not, the same answer as for nobody at all.\n\nOwnership is what cannot be taken away from inside the account: the owner can always administer everything, whatever their organisation list says, removing their last organisation never locks them out, and only the owner can remove people. Transferring it is therefore the widest change this API makes, and it is recorded in the activity feed.\n\n409 `ownership_changed` when the owner changed while the request was in flight — read `GET /customer` to see who owns the account now.",
        "operationId": "Administration_TransferCustomerOwner",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Administration_TransferCustomerOwnerRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_CustomerOwnerResponseResponseBody"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ObjectResponseBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ObjectResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ObjectResponseBody"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ObjectResponseBody"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ObjectResponseBody"
                }
              }
            }
          }
        }
      }
    },
    "/v1/administration/customer": {
      "get": {
        "tags": [
          "Administration · Customer"
        ],
        "summary": "Get your account",
        "description": "Needs permission customer:read.\n\nYour account is the customer every other resource on this API belongs to: `/organisations` are the organisations it owns, `/users` the people who can sign in to it, and `/api-tokens` the credentials it holds. It is a singleton because the account always comes from your credentials, so there is no `customerId` to pass anywhere on this API.\n\n`owner` names the account's one owner: the person whose access cannot be revoked from inside the account, the only one who can transfer that standing, and the only one who can remove people. Null on an account that has not been assigned an owner yet; Flow Payroll support sets it.\n\n`billingStatus` is `Billable` or `AwaitingSetup`. While awaiting setup, creating organisations and API tokens answers 403 `billing_not_set_up`; everything the account already has stays manageable.\n\n404 means the signed-in identity is not linked to an account yet. That is a provisioning step for Flow Payroll support, not something a retry can fix.",
        "operationId": "Administration_GetCustomer",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_CustomerResponseResponseBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ObjectResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ObjectResponseBody"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ObjectResponseBody"
                }
              }
            }
          }
        },
        "x-flow-permission": "customer:read"
      },
      "patch": {
        "tags": [
          "Administration · Customer"
        ],
        "summary": "Rename your account",
        "description": "Needs permission customer:write.\n\nChanges the display name shown across the administration screens and in invitations. The name is 2 to 120 characters. Anybody with access to the account may rename it, and the change is recorded in the activity feed with the actor who made it.",
        "operationId": "Administration_RenameCustomer",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Administration_RenameCustomerRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_CustomerResponseResponseBody"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ObjectResponseBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ObjectResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ObjectResponseBody"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ObjectResponseBody"
                }
              }
            }
          }
        },
        "x-flow-permission": "customer:write"
      }
    },
    "/v1/administration/users/{userId}/organisation-groups/{groupId}": {
      "put": {
        "tags": [
          "Administration · Organisation groups"
        ],
        "summary": "Give a person access through an organisation group",
        "description": "Needs permission user:write.\n\nThey reach every organisation in the group, including ones added later. 201 with the grant's address in `Location` when they had no access through the group; 200 when their role on it is replaced. `roleId` is required: the role they get in every organisation in the group, judged as if it covered the whole account, so you can only give a role you could give account-wide. A group belongs to your account, so only your own people and API tokens can hold one; give a guest organisations one at a time. Changing an organisation group needs access to every organisation in your account (403 `whole_customer_access_denied`), because everybody with access through the group reaches every organisation in it, including ones added later.",
        "operationId": "Administration_GrantUserOrganisationGroup",
        "parameters": [
          {
            "name": "userId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "groupId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Administration_OrganisationGroupAccessRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_OrganisationGroupGrantResponseResponseBody"
                }
              }
            }
          },
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_OrganisationGroupGrantResponseResponseBody"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ObjectResponseBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ObjectResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ObjectResponseBody"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ObjectResponseBody"
                }
              }
            }
          }
        },
        "x-flow-permission": "user:write"
      },
      "delete": {
        "tags": [
          "Administration · Organisation groups"
        ],
        "summary": "End a person's access through an organisation group",
        "description": "Needs permission user:write.\n\nAnswers the grant as it was; 404 `group_grant_not_found` when they had none. Changing an organisation group needs access to every organisation in your account (403 `whole_customer_access_denied`), because everybody with access through the group reaches every organisation in it, including ones added later.",
        "operationId": "Administration_RevokeUserOrganisationGroup",
        "parameters": [
          {
            "name": "userId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "groupId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_OrganisationGroupGrantResponseResponseBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ObjectResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ObjectResponseBody"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ObjectResponseBody"
                }
              }
            }
          }
        },
        "x-flow-permission": "user:write"
      }
    },
    "/v1/administration/api-tokens/{clientId}/organisation-groups/{groupId}": {
      "put": {
        "tags": [
          "Administration · Organisation groups"
        ],
        "summary": "Give an API token access through an organisation group",
        "description": "Needs permission api-token:write.\n\nThe token reaches every organisation in the group, including ones added later. 201 with the grant's address in `Location` when they had no access through the group; 200 when their role on it is replaced. `roleId` is required: the role they get in every organisation in the group, judged as if it covered the whole account, so you can only give a role you could give account-wide. A group belongs to your account, so only your own people and API tokens can hold one; give a guest organisations one at a time. Giving or taking away a group is managing access for the whole account, so an API token is refused with 403 `whole_customer_access_denied`, as on every account-wide grant. Changing an organisation group needs access to every organisation in your account (403 `whole_customer_access_denied`), because everybody with access through the group reaches every organisation in it, including ones added later.",
        "operationId": "Administration_GrantApiTokenOrganisationGroup",
        "parameters": [
          {
            "name": "clientId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "groupId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Administration_OrganisationGroupAccessRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_OrganisationGroupGrantResponseResponseBody"
                }
              }
            }
          },
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_OrganisationGroupGrantResponseResponseBody"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ObjectResponseBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ObjectResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ObjectResponseBody"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ObjectResponseBody"
                }
              }
            }
          }
        },
        "x-flow-permission": "api-token:write"
      },
      "delete": {
        "tags": [
          "Administration · Organisation groups"
        ],
        "summary": "End an API token's access through an organisation group",
        "description": "Needs permission api-token:write.\n\nAnswers the grant as it was; 404 `group_grant_not_found` when it had none. Giving or taking away a group is managing access for the whole account, so an API token is refused with 403 `whole_customer_access_denied`, as on every account-wide grant. Changing an organisation group needs access to every organisation in your account (403 `whole_customer_access_denied`), because everybody with access through the group reaches every organisation in it, including ones added later.",
        "operationId": "Administration_RevokeApiTokenOrganisationGroup",
        "parameters": [
          {
            "name": "clientId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "groupId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_OrganisationGroupGrantResponseResponseBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ObjectResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ObjectResponseBody"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ObjectResponseBody"
                }
              }
            }
          }
        },
        "x-flow-permission": "api-token:write"
      }
    },
    "/v1/administration/organisation-groups": {
      "get": {
        "tags": [
          "Administration · Organisation groups"
        ],
        "summary": "List your organisation groups",
        "description": "Needs permission organisation:read.\n\nPaged, in id order.",
        "operationId": "Administration_GetOrganisationGroups",
        "parameters": [
          {
            "name": "pageSize",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "paginationToken",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_OrganisationGroupListResponseResponseBody"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ObjectResponseBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ObjectResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ObjectResponseBody"
                }
              }
            }
          }
        },
        "x-flow-permission": "organisation:read"
      },
      "post": {
        "tags": [
          "Administration · Organisation groups"
        ],
        "summary": "Create an organisation group",
        "description": "Needs permission organisation:write.\n\nA named set of your organisations, such as the clients one team looks after. 201 with its address in `Location`. Changing an organisation group needs access to every organisation in your account (403 `whole_customer_access_denied`), because everybody with access through the group reaches every organisation in it, including ones added later.",
        "operationId": "Administration_CreateOrganisationGroup",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Administration_CreateOrganisationGroupRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_OrganisationGroupResponseResponseBody"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ObjectResponseBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ObjectResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ObjectResponseBody"
                }
              }
            }
          }
        },
        "x-flow-permission": "organisation:write"
      }
    },
    "/v1/administration/organisation-groups/{groupId}": {
      "get": {
        "tags": [
          "Administration · Organisation groups"
        ],
        "summary": "Get an organisation group",
        "description": "Needs permission organisation:read.\n\n404 `group_not_found` when your account has no such group.",
        "operationId": "Administration_GetOrganisationGroup",
        "parameters": [
          {
            "name": "groupId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_OrganisationGroupResponseResponseBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ObjectResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ObjectResponseBody"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ObjectResponseBody"
                }
              }
            }
          }
        },
        "x-flow-permission": "organisation:read"
      },
      "patch": {
        "tags": [
          "Administration · Organisation groups"
        ],
        "summary": "Rename an organisation group",
        "description": "Needs permission organisation:write.\n\nA JSON Merge Patch of its name and description. Changing an organisation group needs access to every organisation in your account (403 `whole_customer_access_denied`), because everybody with access through the group reaches every organisation in it, including ones added later.",
        "operationId": "Administration_UpdateOrganisationGroup",
        "parameters": [
          {
            "name": "groupId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/merge-patch+json": {
              "schema": {
                "$ref": "#/components/schemas/Administration_UpdateOrganisationGroupRequest"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Administration_UpdateOrganisationGroupRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_OrganisationGroupResponseResponseBody"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ObjectResponseBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ObjectResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ObjectResponseBody"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ObjectResponseBody"
                }
              }
            }
          }
        },
        "x-flow-permission": "organisation:write"
      },
      "delete": {
        "tags": [
          "Administration · Organisation groups"
        ],
        "summary": "Delete an organisation group",
        "description": "Needs permission organisation:write.\n\nAnswers the group as it was. Every organisation is taken out of it and everybody's access through it ends; access people hold to an organisation directly is not affected. Changing an organisation group needs access to every organisation in your account (403 `whole_customer_access_denied`), because everybody with access through the group reaches every organisation in it, including ones added later.",
        "operationId": "Administration_DeleteOrganisationGroup",
        "parameters": [
          {
            "name": "groupId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_OrganisationGroupResponseResponseBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ObjectResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ObjectResponseBody"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ObjectResponseBody"
                }
              }
            }
          }
        },
        "x-flow-permission": "organisation:write"
      }
    },
    "/v1/administration/organisation-groups/{groupId}/organisations": {
      "get": {
        "tags": [
          "Administration · Organisation groups"
        ],
        "summary": "List the organisations in a group",
        "description": "Needs permission organisation:read.\n\nPaged, in id order.",
        "operationId": "Administration_GetOrganisationGroupOrganisations",
        "parameters": [
          {
            "name": "groupId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "pageSize",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "paginationToken",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_OrganisationGroupMemberListResponseResponseBody"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ObjectResponseBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ObjectResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ObjectResponseBody"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ObjectResponseBody"
                }
              }
            }
          }
        },
        "x-flow-permission": "organisation:read"
      }
    },
    "/v1/administration/organisation-groups/{groupId}/organisations/{organisationId}": {
      "put": {
        "tags": [
          "Administration · Organisation groups"
        ],
        "summary": "Add an organisation to a group",
        "description": "Needs permission organisation:write.\n\n201 with the membership's address in `Location` when the organisation is added; 200 with `added` false when it was already in the group. The organisation must be one your account owns or manages (404 `organisation_not_found` otherwise). An organisation can be in at most 25 organisation groups (409 `organisation_group_limit_reached`). Changing an organisation group needs access to every organisation in your account (403 `whole_customer_access_denied`), because everybody with access through the group reaches every organisation in it, including ones added later.",
        "operationId": "Administration_AddOrganisationToGroup",
        "parameters": [
          {
            "name": "groupId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "organisationId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_OrganisationGroupMemberResponseResponseBody"
                }
              }
            }
          },
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_OrganisationGroupMemberResponseResponseBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ObjectResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ObjectResponseBody"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ObjectResponseBody"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ObjectResponseBody"
                }
              }
            }
          }
        },
        "x-flow-permission": "organisation:write"
      },
      "delete": {
        "tags": [
          "Administration · Organisation groups"
        ],
        "summary": "Take an organisation out of a group",
        "description": "Needs permission organisation:write.\n\nAnswers the membership removed; 404 `group_member_not_found` when the organisation was not in the group. Changing an organisation group needs access to every organisation in your account (403 `whole_customer_access_denied`), because everybody with access through the group reaches every organisation in it, including ones added later.",
        "operationId": "Administration_RemoveOrganisationFromGroup",
        "parameters": [
          {
            "name": "groupId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "organisationId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_OrganisationGroupMemberResponseResponseBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ObjectResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ObjectResponseBody"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ObjectResponseBody"
                }
              }
            }
          }
        },
        "x-flow-permission": "organisation:write"
      }
    },
    "/v1/administration/organisation-groups/{groupId}/access": {
      "get": {
        "tags": [
          "Administration · Organisation groups"
        ],
        "summary": "List who has access through an organisation group",
        "description": "Needs permission user:read.\n\nEverybody with access through one of your account's organisation groups, with the role it gives them: the `Group` rows `GET /organisations/{organisationId}/access` shows for this group, the same shape, `via.type` always `Group`. Ordered by principal id. Paginated: `pageSize` (default 50, at most 100) and `paginationToken`; follow the token until it is absent.\n\n`createdBy` and `createdDate` say who gave the access and when, where the grant records it.\n\n404 `group_not_found` when your account has no such group, or it is being deleted. 403 when you hold no access in your account. Once roles other than administrator can be given, seeing this list needs `user:read` across your account (403 `access_view_denied`), and API tokens are listed only to somebody who also holds `api-token:read`.",
        "operationId": "Administration_GetOrganisationGroupAccess",
        "parameters": [
          {
            "name": "groupId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "pageSize",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "paginationToken",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_OrganisationAccessListResponseResponseBody"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ObjectResponseBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ObjectResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ObjectResponseBody"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ObjectResponseBody"
                }
              }
            }
          }
        },
        "x-flow-permission": "user:read"
      }
    },
    "/v1/administration/organisations": {
      "get": {
        "tags": [
          "Administration · Organisations"
        ],
        "summary": "List the organisations you can see",
        "description": "Needs permission organisation:read.\n\nYour account's organisations come in two kinds, marked by `relationship`: `Owned`, and `Managed` for an organisation your account manages on its owner's behalf, such as a bureau's client. `?relationship=owned` or `managed` keeps one kind (400 `conflicting_filters` with `accessType=Guest`). The order is owned (by name), then managed (by id), then guest; `search` narrows all three by the start of the name (punctuation and spaces ignored). Managed and guest pages are matched within the page read, so one may hold fewer than `pageSize` rows, or none, and still carry a `paginationToken`: keep following it.\n\nBoth kinds of organisation: the account's own, in name order, then any you reach as a **guest** of another business. `accessType` on each row says which — `Customer` or `Guest` — and the `accessType` query parameter filters to one kind. One page holds one kind, so follow the token to exhaustion to see both. `search` matches the start of an organisation's name in every phase, as above.\n\nThe account's own list is **not** only the ones you can reach. `callerAccess.granted` on each row says whether you can act on that organisation. An administrator who runs 12 of an account's 40 organisations still needs to know the other 28 exist, so the list includes them and marks them. A guest organisation is managed by its own account: you can open it, never administer it here.\n\nPaginated: `pageSize` (default 50, at most 100) and `paginationToken`. Follow the token until it is absent — a page is never the whole list while a token is present.\n\nTo find who can reach one of the account's organisations, call `GET /users?organisationId={organisationId}`.\n\n**Organisation groups.** Each row's `groups` names your account's organisation groups it is in (`groupId`, `name`), never another account's: an organisation your account manages may also be in its owner's groups, and those are not shown. Always empty on a guest row. `groupId` lists only one of your groups' organisations, in id order, and only those your account still owns or manages; `search` and `relationship` narrow within each page read, so a page may be short and still carry a `paginationToken`. A group that is not your account's, or is being deleted, answers 404 `group_not_found`; `groupId` with `accessType=Guest` is 400 `conflicting_filters`. Groups are for people who hold access in your account: anybody else gets 403 from `groupId`, as from `GET /organisation-groups`, and `groups` empty on every row. For the filter chips' counts, use `organisationCount` on `GET /organisation-groups`.\n\n**externalId.** Each owned or managed row's `externalId` is your account's own identifier for it; another account that owns or manages the same organisation keeps its own, never shown to you, and guest rows have none. `externalId` as a filter finds the one organisation your account owns or manages with that value (exact and case-sensitive): one row, or none, and no `paginationToken`. `search` and `relationship` still narrow; `groupId`, `organisationType`, `businessType`, `minEmployees` or `maxEmployees` with it is 400 `conflicting_filters`.\n\n**Narrowing your own organisations.** `organisationType` and `businessType` (repeat the parameter, or separate values with commas; at most 50 each) and `minEmployees` / `maxEmployees` (employees who have not left today) keep only the organisations your account owns, in name order, a full page at a time. With `groupId`, `relationship=managed` or `accessType=Guest` they are 400 `conflicting_filters`; a value that cannot hold is 400 `invalid_organisation_filters`.\n\n**Profile.** Each row's `profile` carries the PAYE and accounts office references, the registered office, the primary contact and the last completed and next open pay run, so a list can show them without opening the payroll app. It is absent when it cannot be read right now, and the page still renders.",
        "operationId": "Administration_GetOrganisations",
        "parameters": [
          {
            "name": "search",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "pageSize",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "paginationToken",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "accessType",
            "in": "query",
            "description": "Customer for the account's own, Guest for guest access, absent for both.",
            "schema": {
              "enum": [
                "Customer",
                "Guest"
              ],
              "type": "string"
            }
          },
          {
            "name": "relationship",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "groupId",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "minEmployees",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "maxEmployees",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "externalId",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "organisationType",
            "in": "query",
            "schema": {
              "type": "array",
              "items": {
                "type": "string"
              }
            }
          },
          {
            "name": "businessType",
            "in": "query",
            "schema": {
              "type": "array",
              "items": {
                "type": "string"
              }
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_OrganisationListResponseResponseBody"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ObjectResponseBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ObjectResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ObjectResponseBody"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ObjectResponseBody"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ObjectResponseBody"
                }
              }
            }
          }
        },
        "x-flow-permission": "organisation:read"
      },
      "post": {
        "tags": [
          "Administration · Organisations"
        ],
        "summary": "Add an organisation",
        "description": "Needs permission organisation:write.\n\nCreates an organisation under your account. `legalName` is required; `organisationType` and `businessType` accept only the values listed in the schema, and anything else is refused with a 400 naming the choices.\n\nSend an `Idempotency-Key` so a retry after a lost response cannot create the organisation twice. A replay answers 200 with the organisation the first attempt made; a fresh create answers 201; 202 means the organisation exists but a setup step did not finish, and `outstandingSteps` names it.\n\n403 `billing_not_set_up` when billing is not set up for the account yet — email hello@flowpayroll.ai to agree pricing and set it up. Accounts onboarded by Flow Payroll are already set up.\n\n`externalId` records your account's own identifier for it. Sending one needs `organisation:write` across your whole account (403 `insufficient_permissions`). It must be unique among your account's organisations: 409 `external_id_taken` before anything is created when another has it. A replay with the same `Idempotency-Key` is not a clash. Of two requests claiming one value at the same moment, one wins and the other answers 409 `external_id_taken` having created nothing.",
        "operationId": "Administration_CreateOrganisation",
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "description": "Your own key for this create, so a retry after a lost response finds what the first attempt made instead of making a second one. Any unique string up to 255 characters; a UUID is the usual choice. Send the same value on every retry of the same request, and a new value for a new one — reusing a key for a different body answers 409 `idempotency_key_reused`. Keys are remembered for 24 hours. Optional, and a request without one simply has no replay protection.",
            "schema": {
              "maxLength": 255,
              "type": "string"
            },
            "example": "8b1f4c1e-0000-4000-8000-000000000000"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Administration_CreateOrganisationRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_OrganisationCreatedResponseResponseBody"
                }
              }
            }
          },
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_OrganisationCreatedResponseResponseBody"
                }
              }
            }
          },
          "202": {
            "description": "Accepted",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_OrganisationCreatedResponseResponseBody"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ObjectResponseBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ObjectResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ObjectResponseBody"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ObjectResponseBody"
                }
              }
            }
          }
        },
        "x-flow-permission": "organisation:write"
      }
    },
    "/v1/administration/organisations/summary": {
      "get": {
        "tags": [
          "Administration · Organisations"
        ],
        "summary": "Add up the organisations you can see",
        "description": "Needs permission organisation:read.\n\nEvery organisation `GET /organisations` lists for you (your account's own, the ones it manages, then the ones you reach as a guest), each counted once: how many there are, their employees (on the books, active and left, by the payroll's own leaver rule today), the payroll they ran over a period (issued payslips paid in it: organisations paid, payslips, employees paid, gross, net and employer cost) and the 8 with the most active employees.\n\n**Payroll** covers only the organisations where you can see pay runs (`pay-run:read`), and `payroll.organisationCount` says how many that is; `payroll` is left out when there are none.\n\n`from` and `to` (yyyy-MM-dd) name the period, at most a year; leave both out for this calendar month (400 `invalid_summary_period` otherwise). `employees` and `payroll` are left out, never answered as zero, when they cannot be read right now, and `largestOrganisations` is then empty. 503 `organisation_list_unavailable` when the organisations themselves cannot be listed, as on `GET /organisations`.\n\n`accessType` narrows it as on `GET /organisations`: `Customer` for your account's own and managed organisations, `Guest` for the ones you reach as a guest; leave it out for every one (400 `invalid_access_type` otherwise).",
        "operationId": "Administration_GetOrganisationsSummary",
        "parameters": [
          {
            "name": "from",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "to",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "accessType",
            "in": "query",
            "description": "Customer for the account's own, Guest for guest access, absent for both.",
            "schema": {
              "enum": [
                "Customer",
                "Guest"
              ],
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_OrganisationsSummaryResponseResponseBody"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ObjectResponseBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ObjectResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ObjectResponseBody"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ObjectResponseBody"
                }
              }
            }
          }
        },
        "x-flow-permission": "organisation:read"
      }
    },
    "/v1/administration/organisations/bulk": {
      "post": {
        "tags": [
          "Administration · Organisations"
        ],
        "summary": "Add several organisations at once",
        "description": "Needs permission organisation:write.\n\nState the shared details once in `defaults`; any entry may override any of them. Leave a field out of an entry to inherit the default, or set it to override — an address set on an entry replaces the default address as a whole rather than merging field by field.\n\nEvery organisation is created exactly as `POST /organisations` creates one. One `Idempotency-Key` covers the whole batch and each entry claims under it by position, so retrying a partly successful batch finds the organisations it already made instead of making them again. Resend the batch unchanged: entries added, removed or reordered make it a different request, which answers 409 `idempotency_key_reused`.\n\n201 when every entry went through, 207 when some did, 400 when none did. In all three the body lists what happened to each entry. An organisation in `created` can still be incomplete — its own `complete` and `outstandingSteps` say so.\n\n403 `billing_not_set_up` when billing is not set up for the account yet — email hello@flowpayroll.ai to agree pricing and set it up. Accounts onboarded by Flow Payroll are already set up.\n\n`externalId` on an entry is that organisation's own, never a default; two entries with the same one are 400 `duplicate_external_id`, and one another organisation already has fails that entry with `external_id_taken`.",
        "operationId": "Administration_BulkCreateOrganisations",
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "description": "Your own key for this create, so a retry after a lost response finds what the first attempt made instead of making a second one. Any unique string up to 255 characters; a UUID is the usual choice. Send the same value on every retry of the same request, and a new value for a new one — reusing a key for a different body answers 409 `idempotency_key_reused`. Keys are remembered for 24 hours. Optional, and a request without one simply has no replay protection.",
            "schema": {
              "maxLength": 255,
              "type": "string"
            },
            "example": "8b1f4c1e-0000-4000-8000-000000000000"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Administration_BulkCreateOrganisationsRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_BulkCreateOrganisationsResponseResponseBody"
                }
              }
            }
          },
          "207": {
            "description": "Multi-Status",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_BulkCreateOrganisationsResponseResponseBody"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_BulkCreateOrganisationsResponseResponseBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ObjectResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ObjectResponseBody"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ObjectResponseBody"
                }
              }
            }
          }
        },
        "x-flow-permission": "organisation:write"
      }
    },
    "/v1/administration/organisations/{organisationId}": {
      "get": {
        "tags": [
          "Administration · Organisations"
        ],
        "summary": "Get an organisation",
        "description": "Needs permission organisation:read.\n\nThe full record for one organisation, read from the system that owns it, so the names, type and references are authoritative. `callerAccess.granted` says whether you can act on it. `employees` carries headcounts that trail the payroll by seconds — fine for a headline figure, never a figure to file or pay on — and is absent when they cannot be read right now.\n\nA guest reads an organisation they hold access to. 404 for one you cannot reach and for one that does not exist; the two are deliberately indistinguishable.\n\nTo see who can reach it, call `GET /users?organisationId={organisationId}`.",
        "operationId": "Administration_GetOrganisation",
        "parameters": [
          {
            "name": "organisationId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_OrganisationDetailResponseResponseBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ObjectResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ObjectResponseBody"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ObjectResponseBody"
                }
              }
            }
          }
        },
        "x-flow-permission": "organisation:read"
      },
      "patch": {
        "tags": [
          "Administration · Organisations"
        ],
        "summary": "Change what your account records about an organisation",
        "description": "Needs permission organisation:write.\n\nA JSON Merge Patch: leave a field out to keep it, send `null` to clear it. Answers the organisation as it now stands, in `GET /organisations/{organisationId}`'s shape.\n\n`externalId` is your account's own identifier for it, such as its id in your practice management system: 1 to 256 characters, case-sensitive, no spaces at either end (400 `invalid_external_id`), unique among your account's organisations (409 `external_id_taken`); 409 `concurrent_change` when somebody changed it while this request ran, so read it again and retry. Setting it needs `organisation:write` across your whole account, not only on this organisation (403 `insufficient_permissions`, `missingPermission: organisation:write`), because partners' own systems identify the organisation by it. Only your account sees it: an account that owns or manages the same organisation keeps its own.\n\nThe organisation's names, type and references are its payroll record's and do not change here. 404 for an organisation that belongs to another account and for one that does not exist.",
        "operationId": "Administration_UpdateOrganisation",
        "parameters": [
          {
            "name": "organisationId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/merge-patch+json": {
              "schema": {
                "$ref": "#/components/schemas/Administration_UpdateOrganisationRequest"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Administration_UpdateOrganisationRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_OrganisationDetailResponseResponseBody"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ObjectResponseBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ObjectResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ObjectResponseBody"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ObjectResponseBody"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ObjectResponseBody"
                }
              }
            }
          }
        },
        "x-flow-permission": "organisation:write"
      }
    },
    "/v1/administration/organisations/{organisationId}/access": {
      "get": {
        "tags": [
          "Administration · Organisations"
        ],
        "summary": "List who has access to an organisation",
        "description": "Needs permission user:read.\n\nEverybody who can reach this organisation, one row for each way in: `Direct` (given this organisation), `Group` (given an organisation group it is in: `groupId` and `groupName` on your account's groups, only `customerId` on the other account's) and `Account` (given every organisation of the account that owns or manages it, named by `customerId` and `customerName`). Somebody with two ways in has two rows, each with the role that way gives them. `accountOwner` marks an account's owner, an administrator of everything the account has, who has no grant to take away.\n\nWhen one account owns the organisation and another manages it, both accounts' people are listed: the list is everybody with access, not only your account's. `kind` is `Person` or `ApiToken`; `principalId` is the id the `/users` and `/api-tokens` routes take.\n\nOrdered direct, then each group, then each account (the owner's first). Paginated: `pageSize` (default 50, at most 100) and `paginationToken`; follow the token until it is absent.\n\n404 for an organisation of another account, as on `GET /organisations/{organisationId}`. Once roles other than administrator can be given, seeing this list needs `user:read` in the organisation (403 `access_view_denied`), and API tokens are listed only to somebody who also holds `api-token:read`.\n\n`createdBy` and `createdDate` say who gave the access and when, where the grant records it; `createdBy` only on access your account gave.",
        "operationId": "Administration_GetOrganisationAccess",
        "parameters": [
          {
            "name": "organisationId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "pageSize",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "paginationToken",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_OrganisationAccessListResponseResponseBody"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ObjectResponseBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ObjectResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ObjectResponseBody"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ObjectResponseBody"
                }
              }
            }
          }
        },
        "x-flow-permission": "user:read"
      }
    },
    "/v1/administration/organisations/{organisationId}/people": {
      "get": {
        "tags": [
          "Administration · Organisations"
        ],
        "summary": "Name who did something in an organisation",
        "description": "Needs permission organisation:read.\n\nWho the ids in a history are: each person's name (else their email) and email, each API token's name, so a list of exports or report runs can say who started each. Send the ids as `principalIds`, separated by commas, at most 100, in any of the forms histories hold them (`USER#…`, the bare id, `M2M#…` for an API token); each answer carries the id as you sent it.\n\nOnly somebody who has access to the organisation now is named; any other id is left out of `people`, so a person whose access has ended is shown by the history as no longer having access. Needs any access to the organisation.",
        "operationId": "Administration_GetOrganisationPeople",
        "parameters": [
          {
            "name": "organisationId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "principalIds",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_PeopleNamesResponseResponseBody"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ObjectResponseBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ObjectResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ObjectResponseBody"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ObjectResponseBody"
                }
              }
            }
          }
        },
        "x-flow-permission": "organisation:read"
      }
    },
    "/v1/administration/organisations/branding": {
      "get": {
        "tags": [
          "Administration · Organisations"
        ],
        "summary": "Get several organisations' company logos",
        "description": "Needs permission organisation:read.\n\n`organisationIds` is a comma-separated list of up to 100 organisations (repeats count once; 400 `too_many_organisations` above that). Answers each one you can reach, in the order asked, with a short-lived link to its company logo, or null when it has none. Organisations you cannot reach are left out, not refused.",
        "operationId": "Administration_ListOrganisationBranding",
        "parameters": [
          {
            "name": "organisationIds",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_OrganisationBrandingListResponseResponseBody"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ObjectResponseBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ObjectResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ObjectResponseBody"
                }
              }
            }
          }
        },
        "x-flow-permission": "organisation:read"
      }
    },
    "/v1/administration/organisations/{organisationId}/branding": {
      "get": {
        "tags": [
          "Administration · Organisations"
        ],
        "summary": "Get an organisation's branding",
        "description": "Needs permission organisation:read.\n\nIts company logo, and whose brand its employees get (`accountOfRecord`): the managing account if Flow set one with the owner's consent, else the owning account. The account of record is read-only here.",
        "operationId": "Administration_GetOrganisationBranding",
        "parameters": [
          {
            "name": "organisationId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_OrganisationBrandingResponseResponseBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ObjectResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ObjectResponseBody"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ObjectResponseBody"
                }
              }
            }
          }
        },
        "x-flow-permission": "organisation:read"
      },
      "patch": {
        "tags": [
          "Administration · Organisations"
        ],
        "summary": "Change an organisation's company logo",
        "description": "Needs permission organisation:write.\n\nA JSON Merge Patch with one field, `companyLogoAssetId`, from this organisation's own upload route; `null` removes the logo. When both the organisation and the account have a logo, the company logo is shown with \"Powered by\" and the account's logo. Anyone who can open the organisation may change it, whatever account they belong to; the logo is filed under the organisation's own account. 409 `organisation_has_no_account` when the organisation is not linked to an account yet.",
        "operationId": "Administration_UpdateOrganisationBranding",
        "parameters": [
          {
            "name": "organisationId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/merge-patch+json": {
              "schema": {
                "$ref": "#/components/schemas/Administration_UpdateOrganisationBrandingRequest"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Administration_UpdateOrganisationBrandingRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_OrganisationBrandingResponseResponseBody"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ObjectResponseBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ObjectResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ObjectResponseBody"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ObjectResponseBody"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ObjectResponseBody"
                }
              }
            }
          }
        },
        "x-flow-permission": "organisation:write"
      }
    },
    "/v1/administration/organisations/{organisationId}/branding/assets": {
      "post": {
        "tags": [
          "Administration · Organisations"
        ],
        "summary": "Upload a company logo",
        "description": "Needs permission organisation:write.\n\nAnswers a short-lived signed upload link: PUT the file's bytes, as the whole body, to `url` with every one of `headers`, before `expiresDate`. The server chose the storage key, the content type and the size limit. Then poll the status route with `uploadId` until it is `Ready` (use its `assetId`) or `Rejected` (show its `message`). Logos and icons: SVG, or PNG as a fallback (an icon must be square; a small PNG is scaled up where it is drawn larger), up to 1 MB. Fonts: WOFF2 up to 500 KB. Files are checked by their content, never their name; SVGs are cleaned of scripts and links to other files. An account can be given 200 upload links a day, counted by UTC day (429 `upload_limit_reached`). Only `kind: CompanyLogo` is accepted here. 409 `organisation_has_no_account` when the organisation is not linked to an account yet.",
        "operationId": "Administration_CreateOrganisationBrandingAssetUpload",
        "parameters": [
          {
            "name": "organisationId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Administration_CreateBrandingAssetUploadRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_BrandingAssetUploadResponseResponseBody"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ObjectResponseBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ObjectResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ObjectResponseBody"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ObjectResponseBody"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ObjectResponseBody"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ObjectResponseBody"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ObjectResponseBody"
                }
              }
            }
          }
        },
        "x-flow-permission": "organisation:write"
      }
    },
    "/v1/administration/organisations/{organisationId}/branding/assets/{uploadId}": {
      "get": {
        "tags": [
          "Administration · Organisations"
        ],
        "summary": "Check a company logo upload",
        "description": "Needs permission organisation:read.\n\n`Processing` until the file has been checked, then `Ready` with the `assetId` to put on the brand (and a short-lived preview link), or `Rejected` with a sentence saying what to upload instead.",
        "operationId": "Administration_GetOrganisationBrandingAssetUpload",
        "parameters": [
          {
            "name": "organisationId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "uploadId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_BrandingAssetUploadStatusResponseResponseBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ObjectResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ObjectResponseBody"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ObjectResponseBody"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ObjectResponseBody"
                }
              }
            }
          }
        },
        "x-flow-permission": "organisation:read"
      }
    },
    "/v1/administration/organisations/{organisationId}/resolved-branding": {
      "get": {
        "tags": [
          "Administration · Organisations"
        ],
        "summary": "Get the brand the app shows for an organisation",
        "description": "Whose brand applies to this organisation: its managing account if that account has white label and has published a brand, else its owning account on the same terms, else Flow Payroll's. When an account's brand applies, `publishedBrandPath` is where its published files are served on the app's own address (`/_brand-of/{customerId}/`, holding `theme.css` and `logos/logo.svg`); it is null when Flow Payroll's brand applies. `brandRevision` changes on every publish. `accessMessages` are that brand's own words for what a role cannot change, per permissions area.\n\nNeeds any access to the organisation, whatever the role: everybody working in it sees its brand.",
        "operationId": "Administration_GetOrganisationResolvedBranding",
        "parameters": [
          {
            "name": "organisationId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_OrganisationResolvedBrandingResponseResponseBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ObjectResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ObjectResponseBody"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ObjectResponseBody"
                }
              }
            }
          }
        }
      }
    },
    "/v1/administration/organisations/{organisationId}/support-sessions": {
      "post": {
        "tags": [
          "Administration · Organisations"
        ],
        "summary": "Start a support session for an organisation",
        "description": "For an organisation whose brand has a support panel address: that address (`embedUrl`) and a signed token for the page behind it. Show the address in a frame and, once the page says it is ready, hand it the token in a message; never put the token in the address. The token lasts 10 minutes (`expiresAt`), so ask again shortly before, and ask again whenever the person changes organisation. `sessionId` is the token's `jti`: quote it to support.\n\nThe token is a JSON Web Token signed with RS256, with `typ` `support-assertion+jwt`: refuse any other `typ`. Its claims: `iss` (Flow Payroll's public keys address), `aud` (the customer id of the account whose brand the organisation shows), `sub` (that account's `externalId` for the person, or `flow:` followed by their id here when it has given them none or they are not one of its own people), `org` (that account's `externalId` for the organisation, or `flow:` followed by the organisation's id), `principal_id` and `organisation_id` (the ids used by this API, always), `env`, `ver`, `iat`, `exp` and `jti`. It carries no name, email address or payroll data, and it is not accepted by this API.\n\nNeeds any access to the organisation. 404 `support_panel_not_set` when the organisation's brand has no support panel address (or Flow Payroll's own brand applies); 403 `support_session_needs_a_person` for an API token; 429 `too_many_support_sessions` after 120 in an hour for one person, with `Retry-After` in seconds until the hour turns.",
        "operationId": "Administration_CreateOrganisationSupportSession",
        "parameters": [
          {
            "name": "organisationId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_SupportSessionResponseResponseBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ObjectResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ObjectResponseBody"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ObjectResponseBody"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ObjectResponseBody"
                }
              }
            }
          }
        }
      }
    },
    "/v1/administration/roles": {
      "get": {
        "tags": [
          "Administration · Roles"
        ],
        "summary": "List the roles you can give",
        "description": "Needs permission role:read, or any of user:write, api-token:write.\n\nThe built-in roles first, each with what it lets people do (`permissions`) and who it can be given to (`assignableTo`: `person`, `api-token`), then your account's own roles by name. `available` is false while only Administrator can be given out: the other roles are listed so a screen can show them, and become available without any change on your side. `isDefault` marks the role people get when none is chosen for them. Not paged: at most 13 built-in roles and 50 of your own.",
        "operationId": "Administration_GetRoles",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_RoleListResponseResponseBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ObjectResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ObjectResponseBody"
                }
              }
            }
          }
        },
        "x-flow-permission": "role:read",
        "x-flow-permission-also-accepts": [
          "user:write",
          "api-token:write"
        ]
      },
      "post": {
        "tags": [
          "Administration · Roles"
        ],
        "summary": "Create a role of your own",
        "description": "Needs permission role:write.\n\n201 with the new role and its address in `Location`. `roleId` is `custom.` followed by 3 to 40 lower-case letters, numbers or hyphens, made from the name when you leave it out; it never changes. Pick `permissions` from the catalogue: `employee:read`, `employee:*` for every level of one area, or `*`. Nobody can build or change a role to include more than they hold themselves, and changing roles needs permission to manage roles (403 `role_management_denied`, `role_change_denied`). 409 `role_already_exists` for an id you already use, 409 `role_limit_reached` at 50 roles.",
        "operationId": "Administration_CreateRole",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Administration_CreateRoleRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_RoleResponseResponseBody"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ObjectResponseBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ObjectResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ObjectResponseBody"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ObjectResponseBody"
                }
              }
            }
          }
        },
        "x-flow-permission": "role:write"
      }
    },
    "/v1/administration/roles/{roleId}": {
      "get": {
        "tags": [
          "Administration · Roles"
        ],
        "summary": "Get a role",
        "description": "Needs permission role:read, or any of user:write, api-token:write.\n\n404 `role_not_found` when your account has no role with that id.",
        "operationId": "Administration_GetRole",
        "parameters": [
          {
            "name": "roleId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_RoleResponseResponseBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ObjectResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ObjectResponseBody"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ObjectResponseBody"
                }
              }
            }
          }
        },
        "x-flow-permission": "role:read",
        "x-flow-permission-also-accepts": [
          "user:write",
          "api-token:write"
        ]
      },
      "patch": {
        "tags": [
          "Administration · Roles"
        ],
        "summary": "Change one of your own roles",
        "description": "Needs permission role:write.\n\nA JSON Merge Patch (RFC 7396): leave a field out to keep it, send `null` to clear the description. `permissions` replaces the whole list. Everyone who holds the role has the change at once. Nobody can build or change a role to include more than they hold themselves, and changing roles needs permission to manage roles (403 `role_management_denied`, `role_change_denied`). The default role can never include managing people, roles, API tokens or the account (403 `default_role_denied`). Built-in roles cannot be changed (400 `built_in_role_read_only`). 409 `concurrent_change` when somebody else saved first.",
        "operationId": "Administration_UpdateRole",
        "parameters": [
          {
            "name": "roleId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/merge-patch+json": {
              "schema": {
                "$ref": "#/components/schemas/Administration_UpdateRoleRequest"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Administration_UpdateRoleRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_RoleResponseResponseBody"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ObjectResponseBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ObjectResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ObjectResponseBody"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ObjectResponseBody"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ObjectResponseBody"
                }
              }
            }
          }
        },
        "x-flow-permission": "role:write"
      },
      "delete": {
        "tags": [
          "Administration · Roles"
        ],
        "summary": "Delete one of your own roles",
        "description": "Needs permission role:write.\n\nAnswers the role as it was. 409 `role_in_use` while anybody holds it, with up to 20 of them in the body so you know whom to move to another role first; 409 `role_is_default` for your default role; 409 `role_holders_still_being_checked` when we could not yet finish checking who has it (try again in a moment: each try gets further). Built-in roles cannot be deleted (400 `built_in_role_read_only`).",
        "operationId": "Administration_DeleteRole",
        "parameters": [
          {
            "name": "roleId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_RoleResponseResponseBody"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ObjectResponseBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ObjectResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ObjectResponseBody"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ObjectResponseBody"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_RoleInUseResponseResponseBody"
                }
              }
            }
          }
        },
        "x-flow-permission": "role:write"
      }
    },
    "/v1/administration/roles/{roleId}/revisions": {
      "get": {
        "tags": [
          "Administration · Roles"
        ],
        "summary": "See how a role has changed",
        "description": "Needs permission role:read.\n\nEvery version of one of your own roles, newest first, including its deletion. Built-in roles have no history here (404).",
        "operationId": "Administration_GetRoleRevisions",
        "parameters": [
          {
            "name": "roleId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "pageSize",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "paginationToken",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_RoleRevisionListResponseResponseBody"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ObjectResponseBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ObjectResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ObjectResponseBody"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ObjectResponseBody"
                }
              }
            }
          }
        },
        "x-flow-permission": "role:read"
      }
    },
    "/v1/administration/customer/access-settings": {
      "get": {
        "tags": [
          "Administration · Roles"
        ],
        "summary": "Get your access settings",
        "description": "Needs permission role:read.\n\n`defaultRole` is the role new access gets when no role is named: inviting a person, issuing an API token, giving an organisation or the whole account, and people a SCIM client adds. It is Viewer until you choose one (`defaultRoleChosen`). While only Administrator can be given out, new access without a role is Administrator whatever this says.",
        "operationId": "Administration_GetAccessSettings",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_AccessSettingsResponseResponseBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ObjectResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ObjectResponseBody"
                }
              }
            }
          }
        },
        "x-flow-permission": "role:read"
      },
      "patch": {
        "tags": [
          "Administration · Roles"
        ],
        "summary": "Choose your default role",
        "description": "Needs permission role:write.\n\nA JSON Merge Patch. The default role cannot include managing people, roles, API tokens or the account, and must be one you could give out yourself (403 `default_role_denied`); changing it needs permission to manage roles. 400 `role_not_yet_available` while only Administrator can be given out.",
        "operationId": "Administration_UpdateAccessSettings",
        "requestBody": {
          "content": {
            "application/merge-patch+json": {
              "schema": {
                "$ref": "#/components/schemas/Administration_UpdateAccessSettingsRequest"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Administration_UpdateAccessSettingsRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_AccessSettingsResponseResponseBody"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ObjectResponseBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ObjectResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ObjectResponseBody"
                }
              }
            }
          }
        },
        "x-flow-permission": "role:write"
      }
    },
    "/v1/administration/scim/v2/Users": {
      "get": {
        "tags": [
          "Administration · SCIM"
        ],
        "summary": "List or find users",
        "description": "Needs permission user:read.\n\nYour account's people. filter supports userName eq, externalId eq and id eq only (400 invalidFilter otherwise). Pages by cursor (RFC 9865: cursor, count, nextCursor) unless you send startIndex (RFC 7644 index paging). Send an API token of your account as Authorization: Bearer <token>, with the user:write permission across the whole account (403 otherwise).",
        "operationId": "Administration_ScimListUsers",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/scim+json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ScimUserResourceScimListResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/scim+json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ScimError"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/scim+json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ScimError"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/scim+json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ScimError"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/scim+json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ScimError"
                }
              }
            }
          }
        },
        "x-flow-permission": "user:read"
      },
      "post": {
        "tags": [
          "Administration · SCIM"
        ],
        "summary": "Provision a user",
        "description": "Needs permission user:write.\n\nInvites the person across the whole account with your default role (Administrator until other roles can be given). 409 uniqueness when the userName or externalId is already in your account. Send an API token of your account as Authorization: Bearer <token>, with the user:write permission across the whole account (403 otherwise).",
        "operationId": "Administration_ScimCreateUser",
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/scim+json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ScimUserResource"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/scim+json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ScimError"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/scim+json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ScimError"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/scim+json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ScimError"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/scim+json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ScimError"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/scim+json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ScimError"
                }
              }
            }
          },
          "412": {
            "description": "Precondition Failed",
            "content": {
              "application/scim+json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ScimError"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "content": {
              "application/scim+json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ScimError"
                }
              }
            }
          }
        },
        "x-flow-permission": "user:write"
      }
    },
    "/v1/administration/scim/v2/Users/{id}": {
      "get": {
        "tags": [
          "Administration · SCIM"
        ],
        "summary": "Get a user",
        "description": "Needs permission user:read.\n\n404 for anybody who is not one of your account's people. Send an API token of your account as Authorization: Bearer <token>, with the user:write permission across the whole account (403 otherwise).",
        "operationId": "Administration_ScimGetUser",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/scim+json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ScimUserResource"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/scim+json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ScimError"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/scim+json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ScimError"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/scim+json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ScimError"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/scim+json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ScimError"
                }
              }
            }
          }
        },
        "x-flow-permission": "user:read"
      },
      "put": {
        "tags": [
          "Administration · SCIM"
        ],
        "summary": "Replace a user",
        "description": "Needs permission user:write.\n\nname, displayName and externalId can change; userName cannot (400 mutability). active false suspends the person and true restores them (needs user:delete). The account owner is never suspended (403). All or nothing. Send an API token of your account as Authorization: Bearer <token>, with the user:write permission across the whole account (403 otherwise).",
        "operationId": "Administration_ScimReplaceUser",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/scim+json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ScimUserResource"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/scim+json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ScimError"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/scim+json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ScimError"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/scim+json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ScimError"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/scim+json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ScimError"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/scim+json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ScimError"
                }
              }
            }
          },
          "412": {
            "description": "Precondition Failed",
            "content": {
              "application/scim+json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ScimError"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "content": {
              "application/scim+json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ScimError"
                }
              }
            }
          }
        },
        "x-flow-permission": "user:write"
      },
      "patch": {
        "tags": [
          "Administration · SCIM"
        ],
        "summary": "Change a user",
        "description": "Needs permission user:write.\n\nRFC 7644 PATCH, all or nothing. active false suspends the person: their sign-in is disabled and signed out everywhere and their access is kept; true restores them (needs user:delete). Names can change; userName cannot. Send an API token of your account as Authorization: Bearer <token>, with the user:write permission across the whole account (403 otherwise).",
        "operationId": "Administration_ScimPatchUser",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/scim+json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ScimUserResource"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/scim+json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ScimError"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/scim+json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ScimError"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/scim+json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ScimError"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/scim+json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ScimError"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/scim+json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ScimError"
                }
              }
            }
          },
          "412": {
            "description": "Precondition Failed",
            "content": {
              "application/scim+json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ScimError"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "content": {
              "application/scim+json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ScimError"
                }
              }
            }
          }
        },
        "x-flow-permission": "user:write"
      },
      "delete": {
        "tags": [
          "Administration · SCIM"
        ],
        "summary": "Remove a user",
        "description": "Needs permission user:delete.\n\nRemoves the person from your account: their access goes, and their sign-in is disabled and signed out everywhere. 204. Needs user:delete as well. The account owner cannot be removed (403). Send an API token of your account as Authorization: Bearer <token>, with the user:write permission across the whole account (403 otherwise).",
        "operationId": "Administration_ScimDeleteUser",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No Content"
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/scim+json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ScimError"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/scim+json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ScimError"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/scim+json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ScimError"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/scim+json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ScimError"
                }
              }
            }
          },
          "412": {
            "description": "Precondition Failed",
            "content": {
              "application/scim+json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ScimError"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "content": {
              "application/scim+json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ScimError"
                }
              }
            }
          }
        },
        "x-flow-permission": "user:delete"
      }
    },
    "/v1/administration/scim/v2/Groups": {
      "get": {
        "tags": [
          "Administration · SCIM"
        ],
        "summary": "List roles as groups",
        "description": "Needs permission user:read.\n\nOne group per role a person can hold. filter supports displayName eq and id eq. excludedAttributes=members leaves members out. Send an API token of your account as Authorization: Bearer <token>, with the user:write permission across the whole account (403 otherwise).",
        "operationId": "Administration_ScimListGroups",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/scim+json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ScimGroupResourceScimListResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/scim+json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ScimError"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/scim+json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ScimError"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/scim+json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ScimError"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/scim+json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ScimError"
                }
              }
            }
          }
        },
        "x-flow-permission": "user:read"
      },
      "post": {
        "tags": [
          "Administration · SCIM"
        ],
        "summary": "Not supported",
        "description": "Needs permission user:write.\n\n501: roles are created in the admin area or through /roles.",
        "operationId": "Administration_ScimCreateGroup",
        "responses": {
          "400": {
            "description": "Bad Request",
            "content": {
              "application/scim+json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ScimError"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/scim+json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ScimError"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/scim+json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ScimError"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/scim+json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ScimError"
                }
              }
            }
          },
          "501": {
            "description": "Not Implemented",
            "content": {
              "application/scim+json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ScimError"
                }
              }
            }
          }
        },
        "x-flow-permission": "user:write"
      }
    },
    "/v1/administration/scim/v2/Groups/{id}": {
      "get": {
        "tags": [
          "Administration · SCIM"
        ],
        "summary": "Get a role as a group",
        "description": "Needs permission user:read.\n\nid is the role id, such as payroll-manager or custom.hr-team. Send an API token of your account as Authorization: Bearer <token>, with the user:write permission across the whole account (403 otherwise).",
        "operationId": "Administration_ScimGetGroup",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/scim+json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ScimGroupResource"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/scim+json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ScimError"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/scim+json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ScimError"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/scim+json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ScimError"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/scim+json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ScimError"
                }
              }
            }
          }
        },
        "x-flow-permission": "user:read"
      },
      "patch": {
        "tags": [
          "Administration · SCIM"
        ],
        "summary": "Add or remove members",
        "description": "Needs permission user:write.\n\nJoining gives the person this role across your whole account; leaving gives them your default role back. The same rules as /users apply to which roles can be given. displayName cannot change (400 mutability). Send an API token of your account as Authorization: Bearer <token>, with the user:write permission across the whole account (403 otherwise).",
        "operationId": "Administration_ScimPatchGroup",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/scim+json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ScimGroupResource"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/scim+json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ScimError"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/scim+json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ScimError"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/scim+json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ScimError"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/scim+json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ScimError"
                }
              }
            }
          },
          "412": {
            "description": "Precondition Failed",
            "content": {
              "application/scim+json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ScimError"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "content": {
              "application/scim+json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ScimError"
                }
              }
            }
          }
        },
        "x-flow-permission": "user:write"
      },
      "put": {
        "tags": [
          "Administration · SCIM"
        ],
        "summary": "Replace the members",
        "description": "Needs permission user:write.\n\nmembers replaces everyone who holds the role across your account. Send an API token of your account as Authorization: Bearer <token>, with the user:write permission across the whole account (403 otherwise).",
        "operationId": "Administration_ScimReplaceGroup",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/scim+json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ScimGroupResource"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/scim+json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ScimError"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/scim+json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ScimError"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/scim+json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ScimError"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/scim+json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ScimError"
                }
              }
            }
          },
          "412": {
            "description": "Precondition Failed",
            "content": {
              "application/scim+json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ScimError"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "content": {
              "application/scim+json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ScimError"
                }
              }
            }
          }
        },
        "x-flow-permission": "user:write"
      },
      "delete": {
        "tags": [
          "Administration · SCIM"
        ],
        "summary": "Not supported",
        "description": "Needs permission user:write.\n\n501: roles are deleted in the admin area or through /roles.",
        "operationId": "Administration_ScimDeleteGroup",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "400": {
            "description": "Bad Request",
            "content": {
              "application/scim+json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ScimError"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/scim+json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ScimError"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/scim+json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ScimError"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/scim+json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ScimError"
                }
              }
            }
          },
          "501": {
            "description": "Not Implemented",
            "content": {
              "application/scim+json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ScimError"
                }
              }
            }
          }
        },
        "x-flow-permission": "user:write"
      }
    },
    "/v1/administration/scim/v2/ServiceProviderConfig": {
      "get": {
        "tags": [
          "Administration · SCIM"
        ],
        "summary": "What SCIM features are supported",
        "description": "Needs permission organisation:read.\n\nIncludes RFC 9865 pagination. Any caller of your account may read it. A filter is refused (403).",
        "operationId": "Administration_ScimServiceProviderConfig",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/scim+json": {
                "schema": {}
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/scim+json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ScimError"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/scim+json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ScimError"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/scim+json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ScimError"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/scim+json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ScimError"
                }
              }
            }
          }
        },
        "x-flow-permission": "organisation:read"
      }
    },
    "/v1/administration/scim/v2/ResourceTypes": {
      "get": {
        "tags": [
          "Administration · SCIM"
        ],
        "summary": "The resource types",
        "description": "Needs permission organisation:read.\n\nUser and Group. Any caller of your account may read it. A filter is refused (403).",
        "operationId": "Administration_ScimResourceTypes",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/scim+json": {
                "schema": {}
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/scim+json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ScimError"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/scim+json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ScimError"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/scim+json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ScimError"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/scim+json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ScimError"
                }
              }
            }
          }
        },
        "x-flow-permission": "organisation:read"
      }
    },
    "/v1/administration/scim/v2/ResourceTypes/{id}": {
      "get": {
        "tags": [
          "Administration · SCIM"
        ],
        "summary": "One resource type",
        "description": "Needs permission organisation:read.\n\nUser or Group. Any caller of your account may read it. A filter is refused (403).",
        "operationId": "Administration_ScimResourceType",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/scim+json": {
                "schema": {}
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/scim+json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ScimError"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/scim+json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ScimError"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/scim+json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ScimError"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/scim+json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ScimError"
                }
              }
            }
          }
        },
        "x-flow-permission": "organisation:read"
      }
    },
    "/v1/administration/scim/v2/Schemas": {
      "get": {
        "tags": [
          "Administration · SCIM"
        ],
        "summary": "The schemas",
        "description": "Needs permission organisation:read.\n\nUser, Group and the access extension, with each attribute's mutability. Any caller of your account may read it. A filter is refused (403).",
        "operationId": "Administration_ScimSchemas",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/scim+json": {
                "schema": {}
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/scim+json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ScimError"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/scim+json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ScimError"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/scim+json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ScimError"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/scim+json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ScimError"
                }
              }
            }
          }
        },
        "x-flow-permission": "organisation:read"
      }
    },
    "/v1/administration/scim/v2/Schemas/{id}": {
      "get": {
        "tags": [
          "Administration · SCIM"
        ],
        "summary": "One schema",
        "description": "Needs permission organisation:read.\n\nBy its URI. Any caller of your account may read it. A filter is refused (403).",
        "operationId": "Administration_ScimSchema",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/scim+json": {
                "schema": {}
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/scim+json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ScimError"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/scim+json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ScimError"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/scim+json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ScimError"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/scim+json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ScimError"
                }
              }
            }
          }
        },
        "x-flow-permission": "organisation:read"
      }
    },
    "/v1/administration/users/me": {
      "get": {
        "tags": [
          "Administration · Users"
        ],
        "summary": "Get yourself and your access",
        "description": "Who you are and every role you hold, in the same shape as `GET /users/{principalId}`: `access` lists each grant (the whole account, an organisation or an organisation group) with its role. Any signed-in person can read their own, whatever their role. API tokens are refused (403 `own_access_needs_a_person`); a token reads itself with `GET /api-tokens/{clientId}`.",
        "operationId": "Administration_GetMe",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_UserDetailResponseResponseBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ObjectResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ObjectResponseBody"
                }
              }
            }
          }
        }
      }
    },
    "/v1/administration/users": {
      "get": {
        "tags": [
          "Administration · Users"
        ],
        "summary": "List the people in your account",
        "description": "Needs permission user:read.\n\nEveryone who can sign in to your account, paginated in `principalId` order, followed by your **guests** — people from other businesses you invited into specific organisations. `accessType` on each row says which — `Customer` or `Guest` — and the `accessType` query parameter filters to one kind. One page holds one kind, so follow the token to exhaustion to see both. A guest row shows only the access you granted.\n\n`organisationId` narrows the list to the people who can reach one organisation, whether by a direct grant or by account-wide access, and answers 404 if that organisation is not yours. `search` matches a name or email address **within the page returned**, so a page can hold fewer rows than `pageSize` while a `paginationToken` is still present — keep following the token.\n\nAn account may hold 500 people; guests use none of those places. Read the list to exhaustion to count them before offering to invite another. A few accounts hold more, from before the limit existed, and keep everyone they have.\n\n`externalId` finds the one person in your account, one of your own or a guest, with that externalId (exact and case-sensitive): one row, or none, and no `paginationToken`. `search` and `accessType` still narrow; `organisationId` with it is 400 `conflicting_filters`. Each row's `externalId` is your own identifier for that person, the same value SCIM provisioning reads and writes.",
        "operationId": "Administration_GetUsers",
        "parameters": [
          {
            "name": "search",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "organisationId",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "pageSize",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "paginationToken",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "accessType",
            "in": "query",
            "description": "Customer for the account's own, Guest for guest access, absent for both.",
            "schema": {
              "enum": [
                "Customer",
                "Guest"
              ],
              "type": "string"
            }
          },
          {
            "name": "externalId",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_UserListResponseResponseBody"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ObjectResponseBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ObjectResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ObjectResponseBody"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ObjectResponseBody"
                }
              }
            }
          }
        },
        "x-flow-permission": "user:read"
      },
      "post": {
        "tags": [
          "Administration · Users"
        ],
        "summary": "Invite somebody, or give somebody more access",
        "description": "Needs permission user:write.\n\n201 when an account was created for the address and an invitation emailed. 200 when the address already belongs to somebody in your account: the access you asked for is added, no second account is created and no email is sent — `alreadyExisted` and `invitationEmailed` in the response say which happened. 404 when any organisation named is not yours.\n\nState the access as either `organisationIds` or `allOrganisations: true`, never both. `allOrganisations` grants account-wide access — every organisation the account owns, including ones added later — and only somebody who already holds it may grant it (403 `whole_customer_access_denied` otherwise). Every organisation named is checked against what you can reach, so nobody grants wider than they hold.\n\n**Guests** (`asGuest: true`): somebody from another business, invited into the organisations you pick and nothing else. They never see your other organisations, your people or your settings; you see only the access you granted, and can take it back at any time. `organisationIds` is required and `allOrganisations` is refused for a guest. If they have no account, one is created for them in their own right — never a place in yours.\n\n**Sign-in** follows your account's set-up (`GET /customer`, `signIn`), for guests as for your own people. Where your account links people to an identity provider and passwords are not `Allowed`, the new person is linked instead of emailed: `invitationEmailed` is false, they open Flow Payroll from the provider, and there is no password to reset. `signIn: Password` asks for a password of their own, for somebody outside the provider such as a bureau; `signIn: IdentityProviderAndPassword` links them and also emails a password, for somebody who needs a direct login as well. 409 `password_sign_in_denied` for either where your account never issues passwords, and 409 `identity_provider_not_configured` for anything with the provider where it has none. `roleId` is the role they get wherever this invitation gives access (`GET /roles`); leave it out for your account's default role. You may change your own access like anybody else's, within what you hold. You need permission to manage people where you give the role (403 `access_management_denied`), and you can only give a role whose permissions you hold, unless it is your account's default role (403 `role_assignment_denied`). Locking and unlocking pay runs, submitting to HMRC, getting payment files and approving pension contributions must always be held to be given. While only Administrator can be given out, any other role answers 400 `role_not_yet_available`. A role you leave out on access they did not have is your account's default role (`GET /customer/access-settings`), and `administrator` while only Administrator can be given out. `{principalId}` may be the bare id or the full `USER#…` one. Every response lists the role at each place in `roles`. A guest linked to your provider signs in through it, so whoever runs that provider can sign in as them: invite a guest from another business, such as an accountant, with `signIn: Password`. Giving somebody more access never changes how they sign in.\n\n`externalId` records your own identifier for them (the same value SCIM provisioning uses), for one of your own people or a guest alike: it is your account's label, never seen by the guest's own account. Setting it needs `user:write` across your whole account, not only in some organisations (403 `insufficient_permissions`, `missingPermission: user:write`), and, where your account gives roles, cannot be done for somebody who can do things you cannot (403 `holder_outranks_you`). It is unique among your people and guests (409 `external_id_taken`), and an invitation never changes the one somebody already has (409 `external_id_already_set`); repeating their own value changes nothing and needs nothing more. Each is refused before anybody is invited.\n\nAn account may hold 500 people. Only a new account of your own uses one of those places, so an invitation that turns out to be an access change works at the limit, and an account already past the limit keeps everyone it has. Three things answer 409, told apart by `message.token`:\n- `user_limit_reached` — the account already holds 500 people. The account owner can remove somebody who no longer needs access with `DELETE /users/{principalId}`, or contact support to raise the allowance.\n- `email_already_in_use` — that address already signs in to a different account, so it cannot be invited here — unless you invite them as a guest.\n- `account_needs_repair` — that address has an older account that support must repair before it can be given access.",
        "operationId": "Administration_InviteUser",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Administration_InviteUserRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_UserInvitedResponseResponseBody"
                }
              }
            }
          },
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_UserInvitedResponseResponseBody"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ObjectResponseBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ObjectResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ObjectResponseBody"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ObjectResponseBody"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ObjectResponseBody"
                }
              }
            }
          }
        },
        "x-flow-permission": "user:write"
      }
    },
    "/v1/administration/users/bulk": {
      "post": {
        "tags": [
          "Administration · Users"
        ],
        "summary": "Invite several people at once",
        "description": "Needs permission user:write.\n\nState the access once in `defaults`; any entry may override it. Leave a field out of an entry to inherit the default, or set it to override. An entry that names organisations replaces the default set for that person rather than adding to it, and `allOrganisations: false` on an entry opts that person out of a default of `true`.\n\nEach person is invited exactly as `POST /users` would invite them, so nothing about the authorisation differs. 201 when every entry went through, 207 when some did, 400 when none did. In all three the body lists what happened to each entry, and a failed entry carries the same `reason` token the single endpoint would have answered with in `message.token`. Partial success is normal and is not rolled back: invitations already sent stay sent.\n\nThe account's limit of 500 people is counted once for the whole batch. A batch carrying more new people than there is room for fills the remaining places and answers `user_limit_reached` on the rest; entries that turn out to be access changes for people already in the account use no place at all.",
        "operationId": "Administration_BulkInviteUsers",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Administration_BulkInviteUsersRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_BulkInviteUsersResponseResponseBody"
                }
              }
            }
          },
          "207": {
            "description": "Multi-Status",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_BulkInviteUsersResponseResponseBody"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_BulkInviteUsersResponseResponseBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ObjectResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ObjectResponseBody"
                }
              }
            }
          }
        },
        "x-flow-permission": "user:write"
      }
    },
    "/v1/administration/users/{principalId}": {
      "get": {
        "tags": [
          "Administration · Users"
        ],
        "summary": "Get a person and their access",
        "description": "Needs permission user:read.\n\nWho they are, plus both kinds of access this platform has:\n\n- `organisationIds` — every organisation they hold a **direct grant** on.\n- `coversWholeCustomer` — whether they also hold **account-wide access**, which reaches every organisation the account owns, including ones added later, and names none of them.\n\n**Read `coversWholeCustomer` before treating an empty `organisationIds` as no access.** Somebody who runs the whole account typically holds no grant on any single organisation, so the two fields together are the answer.\n\nTo change either kind, use `/users/{principalId}/organisations` for direct grants and `/users/{principalId}/customer-access` for account-wide access. 404 when the person is not in your account, and for somebody who does not exist — the same answer to both.",
        "operationId": "Administration_GetUser",
        "parameters": [
          {
            "name": "principalId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_UserDetailResponseResponseBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ObjectResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ObjectResponseBody"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ObjectResponseBody"
                }
              }
            }
          }
        },
        "x-flow-permission": "user:read"
      },
      "patch": {
        "tags": [
          "Administration · Users"
        ],
        "summary": "Change what your account records about a person",
        "description": "Needs permission user:write.\n\nA JSON Merge Patch: leave a field out to keep it, send `null` to clear it. Answers the person as they now stand, in `GET /users/{principalId}`'s shape.\n\n`externalId` is your own identifier for them, such as their id in your HR system, and the same value SCIM provisioning reads and writes, so changing it here changes it there. 1 to 256 characters, case-sensitive, no spaces at either end (400 `invalid_external_id`).\n\nAn identity provider finds, updates and removes people by it, so this route's `user:write` must be held across your whole account, not only in some organisations (403 `insufficient_permissions`, `missingPermission: user:write`), and, where your account gives roles, the person must not be able to do anything you cannot (403 `holder_outranks_you`). An API token is judged the same way: one with the `hr-integration` role across the account may change it. 409 `external_id_taken` when somebody else in your account has it, and `concurrent_change` when it was changed while this request ran (read it again and retry). Works on your guests too. 404 when the person is neither one of your people nor your guest.\n\nTheir name and sign-in address belong to their sign-in account, and their access to the access routes; neither changes here.",
        "operationId": "Administration_UpdateUser",
        "parameters": [
          {
            "name": "principalId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/merge-patch+json": {
              "schema": {
                "$ref": "#/components/schemas/Administration_UpdateUserRequest"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Administration_UpdateUserRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_UserDetailResponseResponseBody"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ObjectResponseBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ObjectResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ObjectResponseBody"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ObjectResponseBody"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ObjectResponseBody"
                }
              }
            }
          }
        },
        "x-flow-permission": "user:write"
      },
      "delete": {
        "tags": [
          "Administration · Users"
        ],
        "summary": "Remove somebody from your account",
        "description": "Needs permission user:delete.\n\nRemoves every grant by which they reach your organisations, disables their sign-in and signs them out everywhere. Grants another account gave them are that account's, and stay. The sign-in account is kept, disabled, so the audit history stays joinable and re-inviting them later does not create a second identity. Takes effect at once: an access token they already hold keeps decoding for up to an hour, and every request made with it is refused.\n\n**Needs `user:delete` across your whole account**, as a person or an API token: 403 `insufficient_permissions` (`missingPermission: user:delete`) otherwise. The account owner is never removed (409 `cannot_delete_owner`): transfer ownership first. Once roles other than Administrator can be given, nobody removes somebody who can do more than they can (403 `holder_outranks_you`).\n\n`signsInThroughIdentityProvider` says the person signs in through your organisation's identity provider: removing them here stops them signing in to Flow Payroll, and their account there is for whoever runs it to close.\n\nFor a guest — somebody who belongs to another account and reaches organisations here by invitation — this takes back every organisation you granted and nothing else: their account is not yours, so it stays signed in to their own. Somebody who reaches nothing of yours answers 404.",
        "operationId": "Administration_RevokeUser",
        "parameters": [
          {
            "name": "principalId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_UserRevokedResponseResponseBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ObjectResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ObjectResponseBody"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ObjectResponseBody"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ObjectResponseBody"
                }
              }
            }
          }
        },
        "x-flow-permission": "user:delete"
      }
    },
    "/v1/administration/users/{principalId}/organisations": {
      "get": {
        "tags": [
          "Administration · Users"
        ],
        "summary": "List the organisations a person reaches",
        "description": "Needs permission user:read.\n\nReports both kinds of access:\n\n- `organisationIds` — every organisation they hold a **direct grant** on. Managed by the operations on this resource.\n- `coversWholeCustomer` — whether they also hold **account-wide access**, which reaches every organisation the account owns, including ones added later. Managed at `/users/{principalId}/customer-access`; nothing on this resource can create, change or remove it.\n\n**Read `coversWholeCustomer` before treating an empty list as no access.** Somebody who runs the whole account typically holds no grant naming any single organisation.",
        "operationId": "Administration_GetUserOrganisations",
        "parameters": [
          {
            "name": "principalId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_UserOrganisationsResponseResponseBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ObjectResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ObjectResponseBody"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ObjectResponseBody"
                }
              }
            }
          }
        },
        "x-flow-permission": "user:read"
      },
      "put": {
        "tags": [
          "Administration · Users"
        ],
        "summary": "Replace a person's direct grants",
        "description": "Needs permission user:write.\n\nDeclarative: afterwards they hold a direct grant on exactly the organisations listed, and the difference from their current grants is worked out here. `roleId` gives them that role on every organisation listed; leave it out to keep their roles, and new organisations give them your account's default role. You may change your own access like anybody else's, within what you hold. You need permission to manage people where you give the role (403 `access_management_denied`), and you can only give a role whose permissions you hold, unless it is your account's default role (403 `role_assignment_denied`). Locking and unlocking pay runs, submitting to HMRC, getting payment files and approving pension contributions must always be held to be given. While only Administrator can be given out, any other role answers 400 `role_not_yet_available`. A role you leave out on access they did not have is your account's default role (`GET /customer/access-settings`), and `administrator` while only Administrator can be given out. `{principalId}` may be the bare id or the full `USER#…` one. Every response lists the role at each place in `roles`. Every organisation being added is checked against what you can reach, so nobody grants wider than they hold. 404 when any organisation named is not yours; 400 `user_access_would_be_empty` when the result would leave them reaching nothing; 409 `cannot_remove_own_last_access` when it would remove your own last access.\n\nThis does **not** describe account-wide access. Somebody holding it reaches every organisation whatever this list says, and sending an empty list does not remove it — read `coversWholeCustomer` in the response. To change one organisation without restating the rest, use `PUT` or `DELETE /users/{principalId}/organisations/{organisationId}`, which are also safe when two administrators edit at once.\n\nFor a guest, an empty list takes back everything you granted — that is how guest access ends, and their own account elsewhere is untouched. 403 `owner_access_protected` when it would take access from the account owner: only the owner narrows their own access.",
        "operationId": "Administration_ReplaceUserOrganisations",
        "parameters": [
          {
            "name": "principalId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Administration_ReplaceUserOrganisationsRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_UserOrganisationsResponseResponseBody"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ObjectResponseBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ObjectResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ObjectResponseBody"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ObjectResponseBody"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ObjectResponseBody"
                }
              }
            }
          }
        },
        "x-flow-permission": "user:write"
      }
    },
    "/v1/administration/users/{principalId}/organisations/{organisationId}": {
      "put": {
        "tags": [
          "Administration · Users"
        ],
        "summary": "Grant a person one organisation",
        "description": "Needs permission user:write.\n\nIdempotent, and safe to use concurrently: two administrators adding two different organisations both succeed, where two declarative replaces would have one overwrite the other. The body is optional: `roleId` gives them that role there, replacing the one they had; leave it out to keep their role, or to give them your account's default role on an organisation they did not have. You may change your own access like anybody else's, within what you hold. You need permission to manage people where you give the role (403 `access_management_denied`), and you can only give a role whose permissions you hold, unless it is your account's default role (403 `role_assignment_denied`). Locking and unlocking pay runs, submitting to HMRC, getting payment files and approving pension contributions must always be held to be given. While only Administrator can be given out, any other role answers 400 `role_not_yet_available`. A role you leave out on access they did not have is your account's default role (`GET /customer/access-settings`), and `administrator` while only Administrator can be given out. `{principalId}` may be the bare id or the full `USER#…` one. Every response lists the role at each place in `roles`. 404 when the organisation is not yours.",
        "operationId": "Administration_GrantUserOrganisation",
        "parameters": [
          {
            "name": "principalId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "organisationId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Administration_AccessRoleRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_UserOrganisationsResponseResponseBody"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ObjectResponseBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ObjectResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ObjectResponseBody"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ObjectResponseBody"
                }
              }
            }
          }
        },
        "x-flow-permission": "user:write"
      },
      "delete": {
        "tags": [
          "Administration · Users"
        ],
        "summary": "Remove a person's grant on one organisation",
        "description": "Needs permission user:write.\n\nIdempotent: removing a grant they do not hold answers the same as removing one they did. Everything else is left alone, including account-wide access — somebody holding it still reaches this organisation afterwards, and the response shows that.\n\n400 `user_access_would_be_empty` when it would leave them reaching nothing at all — grant them another organisation first, or have the account owner remove them with `DELETE /users/{principalId}`. A guest is the exception: taking back the last organisation you granted is exactly how guest access ends, and their own account elsewhere is untouched. 409 `cannot_remove_own_last_access` when the grant is your own last access — ask another administrator. 403 `owner_access_protected` when it would take access from the account owner: only the owner narrows their own access.",
        "operationId": "Administration_RevokeUserOrganisation",
        "parameters": [
          {
            "name": "principalId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "organisationId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_UserOrganisationsResponseResponseBody"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ObjectResponseBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ObjectResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ObjectResponseBody"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ObjectResponseBody"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ObjectResponseBody"
                }
              }
            }
          }
        },
        "x-flow-permission": "user:write"
      }
    },
    "/v1/administration/users/{principalId}/customer-access": {
      "get": {
        "tags": [
          "Administration · Users"
        ],
        "summary": "Check whether a person has account-wide access",
        "description": "Needs permission user:read.\n\nAccount-wide access is the second kind of access here, and the one that names no organisation: it reaches every organisation the account owns, including ones added later. Read `coversWholeCustomer`.\n\nThe body is the same one `GET /users/{principalId}/organisations` returns, because the two resources are two views of one person's access.",
        "operationId": "Administration_GetUserCustomerAccess",
        "parameters": [
          {
            "name": "principalId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_UserOrganisationsResponseResponseBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ObjectResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ObjectResponseBody"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ObjectResponseBody"
                }
              }
            }
          }
        },
        "x-flow-permission": "user:read"
      },
      "put": {
        "tags": [
          "Administration · Users"
        ],
        "summary": "Grant a person account-wide access",
        "description": "Needs permission user:write.\n\nAfterwards they reach every organisation the account owns, including ones added later, whatever their `organisationIds` list says. Idempotent. The body is optional: `roleId` sets their role across the account; leave it out to keep it, or to give them your account's default role. You may change your own access like anybody else's, within what you hold. You need permission to manage people where you give the role (403 `access_management_denied`), and you can only give a role whose permissions you hold, unless it is your account's default role (403 `role_assignment_denied`). Locking and unlocking pay runs, submitting to HMRC, getting payment files and approving pension contributions must always be held to be given. While only Administrator can be given out, any other role answers 400 `role_not_yet_available`. A role you leave out on access they did not have is your account's default role (`GET /customer/access-settings`), and `administrator` while only Administrator can be given out. `{principalId}` may be the bare id or the full `USER#…` one. Every response lists the role at each place in `roles`.\n\n**Only somebody who already holds account-wide access may grant it** — 403 `whole_customer_access_denied` otherwise. Handing out every organisation, present and future, is granting wider than you hold, so an administrator of three organisations cannot make somebody who reaches forty. This is a higher bar than `PUT /users/{principalId}/organisations/{organisationId}`, which needs only the one organisation.\n\nTheir direct grants are left exactly as they were, so removing account-wide access later returns them to that set rather than to nothing.\n\nA guest cannot hold account-wide access: they belong to another business, so grant them organisations individually instead.",
        "operationId": "Administration_GrantUserCustomerAccess",
        "parameters": [
          {
            "name": "principalId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Administration_AccessRoleRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_UserOrganisationsResponseResponseBody"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ObjectResponseBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ObjectResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ObjectResponseBody"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ObjectResponseBody"
                }
              }
            }
          }
        },
        "x-flow-permission": "user:write"
      },
      "delete": {
        "tags": [
          "Administration · Users"
        ],
        "summary": "Remove a person's account-wide access",
        "description": "Needs permission user:write.\n\nAfterwards they reach exactly the organisations in `organisationIds` and nothing else. Idempotent, and the same bar as granting it: only somebody who holds account-wide access may remove it (403 `whole_customer_access_denied` otherwise).\n\n400 `user_access_would_be_empty` when it would leave them reaching nothing at all — grant them an organisation first, or have the account owner remove them with `DELETE /users/{principalId}`. 409 `cannot_remove_own_last_access` when it is your own last access; ask another administrator. 403 `owner_access_protected` when it would take access from the account owner: only the owner narrows their own access.",
        "operationId": "Administration_RevokeUserCustomerAccess",
        "parameters": [
          {
            "name": "principalId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_UserOrganisationsResponseResponseBody"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ObjectResponseBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ObjectResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ObjectResponseBody"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ObjectResponseBody"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ObjectResponseBody"
                }
              }
            }
          }
        },
        "x-flow-permission": "user:write"
      }
    },
    "/v1/administration/users/{principalId}/resend-invitation": {
      "post": {
        "tags": [
          "Administration · Users"
        ],
        "summary": "Resend an invitation",
        "description": "Needs permission user:write.\n\nEmails the invitation again with a fresh link to set up their account, so it is not a repeat of the same message: the link in any earlier invitation stops working. 409 `already_signed_in` once they have signed in, because there is no invitation left to accept — they should use the password reset on the sign-in page instead. 409 `signs_in_through_identity_provider` when they sign in through your account's identity provider: they were never sent an invitation link, and open Flow Payroll from the provider. 429 `invitation_sent_recently` if an invitation was sent to them in the last minute.",
        "operationId": "Administration_ResendUserInvitation",
        "parameters": [
          {
            "name": "principalId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_UserInvitationResentResponseResponseBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ObjectResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ObjectResponseBody"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ObjectResponseBody"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ObjectResponseBody"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ObjectResponseBody"
                }
              }
            }
          }
        },
        "x-flow-permission": "user:write"
      }
    },
    "/v1/administration/users/{principalId}/release": {
      "post": {
        "tags": [
          "Administration · Users"
        ],
        "summary": "Stop managing a guest",
        "description": "Needs permission user:write.\n\nFor a guest your account manages (they sign in through your identity provider). They keep the access they hold and become an independent guest: if they signed in through your identity provider, they are emailed a password reset and your provider can no longer sign them in. Nothing about their organisations moves. 404 for anybody your account does not manage.",
        "operationId": "Administration_ReleaseGuest",
        "parameters": [
          {
            "name": "principalId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_GuestReleasedResponseResponseBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ObjectResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ObjectResponseBody"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ObjectResponseBody"
                }
              }
            }
          }
        },
        "x-flow-permission": "user:write"
      }
    },
    "/v1/administration/users/me/photo/uploads": {
      "post": {
        "tags": [
          "Administration · Users"
        ],
        "summary": "Upload your profile photo",
        "description": "Answers a short-lived signed upload link for a new profile photo: PUT the file's bytes, as the whole body, to `url` with every one of `headers`, before `expiresDate`. Then poll the status route with `uploadId` until it is `Ready` (read the photo) or `Rejected` (show its `message`). PNG (animated too), JPEG, GIF (animated too), WebP (animated too) or SVG, up to 2 MB and 4,096 pixels each way, animations up to 300 frames. The type is decided from the file's bytes, never its name; location and camera data, comments and anything hidden after the image are removed, and SVGs are cleaned of scripts and links. Replacing the photo deletes the previous one. A person can be given 50 upload links a day, counted by UTC day (429 `profile_photo_upload_limit_reached`). API tokens are refused (403 `profile_photo_needs_a_person`).",
        "operationId": "Administration_CreateProfilePhotoUpload",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Administration_CreateProfilePhotoUploadRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ProfilePhotoUploadResponseResponseBody"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ObjectResponseBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ObjectResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ObjectResponseBody"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ObjectResponseBody"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ObjectResponseBody"
                }
              }
            }
          }
        }
      }
    },
    "/v1/administration/users/me/photo/uploads/{uploadId}": {
      "get": {
        "tags": [
          "Administration · Users"
        ],
        "summary": "Check a profile photo upload",
        "description": "`Processing` until the file has been checked, then `Ready` (it is now your photo) or `Rejected` with a sentence saying what to upload instead. 404 `profile_photo_upload_not_found` for an upload that is not yours.",
        "operationId": "Administration_GetProfilePhotoUpload",
        "parameters": [
          {
            "name": "uploadId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ProfilePhotoUploadStatusResponseResponseBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ObjectResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ObjectResponseBody"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ObjectResponseBody"
                }
              }
            }
          }
        }
      }
    },
    "/v1/administration/users/me/photo": {
      "get": {
        "tags": [
          "Administration · Users"
        ],
        "summary": "Get your profile photo",
        "description": "A link to your photo that works for 15 minutes, and when it was set. Ask again for a fresh link before it runs out. 404 `profile_photo_not_set` when you have none.",
        "operationId": "Administration_GetProfilePhoto",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ProfilePhotoResponseResponseBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ObjectResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ObjectResponseBody"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ObjectResponseBody"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ObjectResponseBody"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "Administration · Users"
        ],
        "summary": "Remove your profile photo",
        "description": "Deletes your photo and answers when it had been set. 404 `profile_photo_not_set` when you have none.",
        "operationId": "Administration_DeleteProfilePhoto",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ProfilePhotoRemovedResponseResponseBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ObjectResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ObjectResponseBody"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ObjectResponseBody"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ObjectResponseBody"
                }
              }
            }
          }
        }
      }
    },
    "/v1/administration/users/me/preferences": {
      "get": {
        "tags": [
          "Administration · Users"
        ],
        "summary": "Get your preferences",
        "description": "Every preference the signed-in person has, each at its default until they choose: never 404. Grouped by the part of the app a preference is about (`people`: how lists of people are sorted). A new preference arrives inside its group, or as a new group; an existing one never moves. API tokens are refused (403 `preferences_need_a_person`).",
        "operationId": "Administration_GetUserPreferences",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_UserPreferencesResponseResponseBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ObjectResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ObjectResponseBody"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ObjectResponseBody"
                }
              }
            }
          }
        }
      },
      "patch": {
        "tags": [
          "Administration · Users"
        ],
        "summary": "Change your preferences",
        "description": "A JSON Merge Patch (RFC 7396): name only what changes, and everything left out stays as it is; `null` puts a preference, or a whole group, back to its default. A field this API does not know is refused (400), so a misspelt preference is never taken for a saved one. Answers every preference as it now stands. Two changes at once each keep what they changed; 409 `concurrent_change` only when a change keeps losing. API tokens are refused (403 `preferences_need_a_person`).",
        "operationId": "Administration_UpdateUserPreferences",
        "requestBody": {
          "content": {
            "application/merge-patch+json": {
              "schema": {
                "$ref": "#/components/schemas/Administration_UpdateUserPreferencesRequest"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Administration_UpdateUserPreferencesRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_UserPreferencesResponseResponseBody"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ObjectResponseBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ObjectResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ObjectResponseBody"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ObjectResponseBody"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Administration_ObjectResponseBody"
                }
              }
            }
          }
        }
      }
    },
    "/v1/notification-settings/customer/email-settings": {
      "get": {
        "tags": [
          "Email wording · Account emails"
        ],
        "summary": "List your account's email wording",
        "description": "Needs permission customer:read.\n\nEvery email whose wording can be changed, as set for your whole account, including the sign-in emails people who use the app receive: it applies to every organisation in the account that sets nothing of its own. The account is the one you are signed in to; no request names it. Needs account-wide access.",
        "operationId": "EmailWording_ListAccountEmailSettings",
        "parameters": [],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EmailWording_EmailWordingSettingsResponseListResponseBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EmailWording_ObjectResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EmailWording_ObjectResponseBody"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EmailWording_ObjectResponseBody"
                }
              }
            }
          }
        },
        "x-flow-permission": "customer:read"
      }
    },
    "/v1/notification-settings/customer/email-settings/{eventType}": {
      "get": {
        "tags": [
          "Email wording · Account emails"
        ],
        "summary": "Get your account's wording for one email",
        "description": "Needs permission customer:read.\n\nOne email's wording for your account, with the standard wording it inherits.",
        "operationId": "EmailWording_GetAccountEmailSetting",
        "parameters": [
          {
            "name": "eventType",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "PayslipGeneratedEvent",
                "P45GeneratedEvent",
                "P60GeneratedEvent",
                "EmployeePensionEnrolmentEvent",
                "EmployeePensionReEnrolmentEvent",
                "EmployeePensionPostponementEvent",
                "EmployeePensionOptInInformationEvent",
                "EmployeePensionOptInConfirmationEvent",
                "EmployeePensionJoinConfirmationEvent",
                "ReportReadyEvent",
                "UserInvitedEvent",
                "EmailVerificationEvent",
                "PasswordResetEvent",
                "SecurityAlertEvent"
              ]
            },
            "description": "The email, by the event name its webhook delivery events carry, as listed by the list operation: PayslipGeneratedEvent, P45GeneratedEvent, P60GeneratedEvent, EmployeePensionEnrolmentEvent, EmployeePensionReEnrolmentEvent, EmployeePensionPostponementEvent, EmployeePensionOptInInformationEvent, EmployeePensionOptInConfirmationEvent, EmployeePensionJoinConfirmationEvent, ReportReadyEvent, UserInvitedEvent, EmailVerificationEvent, PasswordResetEvent, SecurityAlertEvent."
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EmailWording_EmailWordingSettingsResponseResponseBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EmailWording_ObjectResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EmailWording_ObjectResponseBody"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EmailWording_ObjectResponseBody"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EmailWording_ObjectResponseBody"
                }
              }
            }
          }
        },
        "x-flow-permission": "customer:read"
      },
      "patch": {
        "tags": [
          "Email wording · Account emails"
        ],
        "summary": "Change your account's wording for one email",
        "description": "Needs permission customer:write.\n\nA JSON Merge Patch (RFC 7396): leave a field out to keep it, send `null` to clear it (the email then uses the inherited wording), send text to change it. Plain text only, with the placeholders the email lists, written `{{like.this}}`. `enabled: false` switches off an email that can be switched off (`canBeSwitchedOff`; 400 `email_cannot_be_switched_off` otherwise), `true` switches it back on, `null` follows the account (or, for the account, sends it). Send every field as `null` to go back to the standard wording. Every save is kept as a version (see the revisions operation). Applies to every organisation in your account that has not set its own. Needs account-wide access, checked on every request.",
        "operationId": "EmailWording_PatchAccountEmailSetting",
        "parameters": [
          {
            "name": "eventType",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "PayslipGeneratedEvent",
                "P45GeneratedEvent",
                "P60GeneratedEvent",
                "EmployeePensionEnrolmentEvent",
                "EmployeePensionReEnrolmentEvent",
                "EmployeePensionPostponementEvent",
                "EmployeePensionOptInInformationEvent",
                "EmployeePensionOptInConfirmationEvent",
                "EmployeePensionJoinConfirmationEvent",
                "ReportReadyEvent",
                "UserInvitedEvent",
                "EmailVerificationEvent",
                "PasswordResetEvent",
                "SecurityAlertEvent"
              ]
            },
            "description": "The email, by the event name its webhook delivery events carry, as listed by the list operation: PayslipGeneratedEvent, P45GeneratedEvent, P60GeneratedEvent, EmployeePensionEnrolmentEvent, EmployeePensionReEnrolmentEvent, EmployeePensionPostponementEvent, EmployeePensionOptInInformationEvent, EmployeePensionOptInConfirmationEvent, EmployeePensionJoinConfirmationEvent, ReportReadyEvent, UserInvitedEvent, EmailVerificationEvent, PasswordResetEvent, SecurityAlertEvent."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/merge-patch+json": {
              "schema": {
                "$ref": "#/components/schemas/EmailWording_EmailWordingPatch"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/EmailWording_EmailWordingPatch"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EmailWording_EmailWordingSettingsResponseResponseBody"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EmailWording_ObjectResponseBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EmailWording_ObjectResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EmailWording_ObjectResponseBody"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EmailWording_ObjectResponseBody"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EmailWording_ObjectResponseBody"
                }
              }
            }
          },
          "415": {
            "description": "Unsupported Media Type",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EmailWording_ObjectResponseBody"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EmailWording_ObjectResponseBody"
                }
              }
            }
          }
        },
        "x-flow-permission": "customer:write"
      }
    },
    "/v1/notification-settings/customer/email-settings/{eventType}/previews": {
      "post": {
        "tags": [
          "Email wording · Account emails"
        ],
        "summary": "Preview your account's wording for one email",
        "description": "Needs permission customer:read.\n\nThe wording that would be sent, filled with sample values. Send an unsaved draft to preview it, or no body to preview what is saved. Nothing is saved or sent.",
        "operationId": "EmailWording_PreviewAccountEmailSetting",
        "parameters": [
          {
            "name": "eventType",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "PayslipGeneratedEvent",
                "P45GeneratedEvent",
                "P60GeneratedEvent",
                "EmployeePensionEnrolmentEvent",
                "EmployeePensionReEnrolmentEvent",
                "EmployeePensionPostponementEvent",
                "EmployeePensionOptInInformationEvent",
                "EmployeePensionOptInConfirmationEvent",
                "EmployeePensionJoinConfirmationEvent",
                "ReportReadyEvent",
                "UserInvitedEvent",
                "EmailVerificationEvent",
                "PasswordResetEvent",
                "SecurityAlertEvent"
              ]
            },
            "description": "The email, by the event name its webhook delivery events carry, as listed by the list operation: PayslipGeneratedEvent, P45GeneratedEvent, P60GeneratedEvent, EmployeePensionEnrolmentEvent, EmployeePensionReEnrolmentEvent, EmployeePensionPostponementEvent, EmployeePensionOptInInformationEvent, EmployeePensionOptInConfirmationEvent, EmployeePensionJoinConfirmationEvent, ReportReadyEvent, UserInvitedEvent, EmailVerificationEvent, PasswordResetEvent, SecurityAlertEvent."
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/merge-patch+json": {
              "schema": {
                "$ref": "#/components/schemas/EmailWording_EmailWordingPatch"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/EmailWording_EmailWordingPatch"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EmailWording_EmailWordingPreviewResponseResponseBody"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EmailWording_ObjectResponseBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EmailWording_ObjectResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EmailWording_ObjectResponseBody"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EmailWording_ObjectResponseBody"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EmailWording_ObjectResponseBody"
                }
              }
            }
          }
        },
        "x-flow-permission": "customer:read"
      }
    },
    "/v1/notification-settings/customer/email-settings/{eventType}/rendered-previews": {
      "post": {
        "tags": [
          "Email wording · Account emails"
        ],
        "summary": "Preview your account's email as it would be sent",
        "description": "Needs permission customer:read.\n\nThe email exactly as it would be sent: subject, a whole HTML page and the plain-text version, with sample values (Jane Doe, Acme Ltd) and no attachment. Send `wording` in the same shape as a change to preview unsaved wording over what is saved. Logos are embedded in the page, so it can be shown in a sandboxed frame. Nothing is saved or sent. At most 30 previews a minute per person (429 `preview_limit`); API tokens cannot preview (403). 409 `preview_no_template` when the email is not set up; 502 `preview_unavailable` when the preview cannot be drawn just now. Send `brand` `Draft` to see the unpublished brand (the published brand when there is no draft). The sign-in emails (invitation, email verification, password reset, security alert) are previewed with sample code 123456 and a sample invitation link on the brand's own sign-in address.",
        "operationId": "EmailWording_RenderAccountEmailPreview",
        "parameters": [
          {
            "name": "eventType",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "PayslipGeneratedEvent",
                "P45GeneratedEvent",
                "P60GeneratedEvent",
                "EmployeePensionEnrolmentEvent",
                "EmployeePensionReEnrolmentEvent",
                "EmployeePensionPostponementEvent",
                "EmployeePensionOptInInformationEvent",
                "EmployeePensionOptInConfirmationEvent",
                "EmployeePensionJoinConfirmationEvent",
                "ReportReadyEvent",
                "UserInvitedEvent",
                "EmailVerificationEvent",
                "PasswordResetEvent",
                "SecurityAlertEvent"
              ]
            },
            "description": "The email, by the event name its webhook delivery events carry, as listed by the list operation: PayslipGeneratedEvent, P45GeneratedEvent, P60GeneratedEvent, EmployeePensionEnrolmentEvent, EmployeePensionReEnrolmentEvent, EmployeePensionPostponementEvent, EmployeePensionOptInInformationEvent, EmployeePensionOptInConfirmationEvent, EmployeePensionJoinConfirmationEvent, ReportReadyEvent, UserInvitedEvent, EmailVerificationEvent, PasswordResetEvent, SecurityAlertEvent."
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/EmailWording_EmailRenderedPreviewRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EmailWording_EmailRenderedPreviewResponseResponseBody"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EmailWording_ObjectResponseBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EmailWording_ObjectResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EmailWording_ObjectResponseBody"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EmailWording_ObjectResponseBody"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EmailWording_ObjectResponseBody"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EmailWording_ObjectResponseBody"
                }
              }
            }
          },
          "502": {
            "description": "Bad Gateway",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EmailWording_ObjectResponseBody"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EmailWording_ObjectResponseBody"
                }
              }
            }
          }
        },
        "x-flow-permission": "customer:read"
      }
    },
    "/v1/notification-settings/customer/email-settings/{eventType}/revisions": {
      "get": {
        "tags": [
          "Email wording · Account emails"
        ],
        "summary": "List the saved versions of your account's wording for one email",
        "description": "Needs permission customer:read.\n\nEvery saved version of this email's wording at this level, newest first: what it held after each save, including whether it was switched off, and who saved it. Page with `pageSize` (1 to 50, default 20) and the `paginationToken` the previous page returned (also in `metadata.paginationToken`).",
        "operationId": "EmailWording_ListAccountEmailWordingRevisions",
        "parameters": [
          {
            "name": "eventType",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "PayslipGeneratedEvent",
                "P45GeneratedEvent",
                "P60GeneratedEvent",
                "EmployeePensionEnrolmentEvent",
                "EmployeePensionReEnrolmentEvent",
                "EmployeePensionPostponementEvent",
                "EmployeePensionOptInInformationEvent",
                "EmployeePensionOptInConfirmationEvent",
                "EmployeePensionJoinConfirmationEvent",
                "ReportReadyEvent",
                "UserInvitedEvent",
                "EmailVerificationEvent",
                "PasswordResetEvent",
                "SecurityAlertEvent"
              ]
            },
            "description": "The email, by the event name its webhook delivery events carry, as listed by the list operation: PayslipGeneratedEvent, P45GeneratedEvent, P60GeneratedEvent, EmployeePensionEnrolmentEvent, EmployeePensionReEnrolmentEvent, EmployeePensionPostponementEvent, EmployeePensionOptInInformationEvent, EmployeePensionOptInConfirmationEvent, EmployeePensionJoinConfirmationEvent, ReportReadyEvent, UserInvitedEvent, EmailVerificationEvent, PasswordResetEvent, SecurityAlertEvent."
          },
          {
            "name": "pageSize",
            "in": "query",
            "required": false,
            "description": "How many versions to return: 1 to 50, default 20.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 50,
              "default": 20
            }
          },
          {
            "name": "paginationToken",
            "in": "query",
            "required": false,
            "description": "The `paginationToken` the previous page returned; leave it out for the first page.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EmailWording_EmailWordingRevisionListResponseResponseBody"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EmailWording_ObjectResponseBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EmailWording_ObjectResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EmailWording_ObjectResponseBody"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EmailWording_ObjectResponseBody"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EmailWording_ObjectResponseBody"
                }
              }
            }
          }
        },
        "x-flow-permission": "customer:read"
      }
    },
    "/v1/notification-settings/customer/email-settings/{eventType}/revisions/{revisionId}/restorations": {
      "post": {
        "tags": [
          "Email wording · Account emails"
        ],
        "summary": "Restore a saved version of your account's wording for one email",
        "description": "Needs permission customer:write.\n\nPuts a saved version back: its wording and on/off choice are saved again as a new version, exactly as a change would be, and the restored settings are returned. 404 `email_wording_revision_not_found` when the version does not exist.",
        "operationId": "EmailWording_RestoreAccountEmailWordingRevision",
        "parameters": [
          {
            "name": "eventType",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "PayslipGeneratedEvent",
                "P45GeneratedEvent",
                "P60GeneratedEvent",
                "EmployeePensionEnrolmentEvent",
                "EmployeePensionReEnrolmentEvent",
                "EmployeePensionPostponementEvent",
                "EmployeePensionOptInInformationEvent",
                "EmployeePensionOptInConfirmationEvent",
                "EmployeePensionJoinConfirmationEvent",
                "ReportReadyEvent",
                "UserInvitedEvent",
                "EmailVerificationEvent",
                "PasswordResetEvent",
                "SecurityAlertEvent"
              ]
            },
            "description": "The email, by the event name its webhook delivery events carry, as listed by the list operation: PayslipGeneratedEvent, P45GeneratedEvent, P60GeneratedEvent, EmployeePensionEnrolmentEvent, EmployeePensionReEnrolmentEvent, EmployeePensionPostponementEvent, EmployeePensionOptInInformationEvent, EmployeePensionOptInConfirmationEvent, EmployeePensionJoinConfirmationEvent, ReportReadyEvent, UserInvitedEvent, EmailVerificationEvent, PasswordResetEvent, SecurityAlertEvent."
          },
          {
            "name": "revisionId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "A version's `revisionId`, as the revisions operation lists it."
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EmailWording_EmailWordingSettingsResponseResponseBody"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EmailWording_ObjectResponseBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EmailWording_ObjectResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EmailWording_ObjectResponseBody"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EmailWording_ObjectResponseBody"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EmailWording_ObjectResponseBody"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EmailWording_ObjectResponseBody"
                }
              }
            }
          }
        },
        "x-flow-permission": "customer:write"
      }
    },
    "/v1/notification-settings/customer/email-settings/{eventType}/test-sends": {
      "post": {
        "tags": [
          "Email wording · Account emails"
        ],
        "summary": "Send yourself a test of one email (account)",
        "description": "Needs permission customer:write.\n\nSends the email, with your account's brand and saved wording and sample values, to your own address only, with the subject prefixed \"Test: \". One test a minute per person.",
        "operationId": "EmailWording_SendAccountTestEmail",
        "parameters": [
          {
            "name": "eventType",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "PayslipGeneratedEvent",
                "P45GeneratedEvent",
                "P60GeneratedEvent",
                "EmployeePensionEnrolmentEvent",
                "EmployeePensionReEnrolmentEvent",
                "EmployeePensionPostponementEvent",
                "EmployeePensionOptInInformationEvent",
                "EmployeePensionOptInConfirmationEvent",
                "EmployeePensionJoinConfirmationEvent",
                "ReportReadyEvent",
                "UserInvitedEvent",
                "EmailVerificationEvent",
                "PasswordResetEvent",
                "SecurityAlertEvent"
              ]
            },
            "description": "The email, by the event name its webhook delivery events carry, as listed by the list operation: PayslipGeneratedEvent, P45GeneratedEvent, P60GeneratedEvent, EmployeePensionEnrolmentEvent, EmployeePensionReEnrolmentEvent, EmployeePensionPostponementEvent, EmployeePensionOptInInformationEvent, EmployeePensionOptInConfirmationEvent, EmployeePensionJoinConfirmationEvent, ReportReadyEvent, UserInvitedEvent, EmailVerificationEvent, PasswordResetEvent, SecurityAlertEvent."
          }
        ],
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EmailWording_EmailTestSendResponseResponseBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EmailWording_ObjectResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EmailWording_ObjectResponseBody"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EmailWording_ObjectResponseBody"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EmailWording_ObjectResponseBody"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EmailWording_ObjectResponseBody"
                }
              }
            }
          },
          "502": {
            "description": "Bad Gateway",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EmailWording_ObjectResponseBody"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EmailWording_ObjectResponseBody"
                }
              }
            }
          }
        },
        "x-flow-permission": "customer:write"
      }
    },
    "/v1/notification-settings/organisations/{organisationId}/email-settings": {
      "get": {
        "tags": [
          "Email wording · Organisation emails"
        ],
        "summary": "List an organisation's email wording",
        "description": "Needs permission organisation-settings:read.\n\nEvery email whose wording an organisation can change, each with who receives it (`audience`), whether it is sent (`enabled`) and can be switched off, what this organisation has set (`wording`), what applies where it sets nothing (`inherited`: its account's wording, then the standard wording), the `standard` wording, the placeholders it may use with their sample values, whether it shows a button, what it always includes (`locked`) and who last saved it. The sign-in emails are set for the whole account only.",
        "operationId": "EmailWording_ListOrganisationEmailSettings",
        "parameters": [
          {
            "name": "organisationId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The organisation to act on. It must be the one selected with `X-Org-Id`: a request naming two different organisations is refused with 403."
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EmailWording_EmailWordingSettingsResponseListResponseBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EmailWording_ObjectResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EmailWording_ObjectResponseBody"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EmailWording_ObjectResponseBody"
                }
              }
            }
          }
        },
        "x-flow-permission": "organisation-settings:read"
      }
    },
    "/v1/notification-settings/organisations/{organisationId}/email-settings/{eventType}": {
      "get": {
        "tags": [
          "Email wording · Organisation emails"
        ],
        "summary": "Get an organisation's wording for one email",
        "description": "Needs permission organisation-settings:read.\n\nOne email's wording for this organisation, with what it inherits. 404 `email_not_editable` when the email's wording cannot be changed, and `email_not_editable_for_organisation` for a sign-in email.",
        "operationId": "EmailWording_GetOrganisationEmailSetting",
        "parameters": [
          {
            "name": "organisationId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The organisation to act on. It must be the one selected with `X-Org-Id`: a request naming two different organisations is refused with 403."
          },
          {
            "name": "eventType",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "PayslipGeneratedEvent",
                "P45GeneratedEvent",
                "P60GeneratedEvent",
                "EmployeePensionEnrolmentEvent",
                "EmployeePensionReEnrolmentEvent",
                "EmployeePensionPostponementEvent",
                "EmployeePensionOptInInformationEvent",
                "EmployeePensionOptInConfirmationEvent",
                "EmployeePensionJoinConfirmationEvent",
                "ReportReadyEvent"
              ]
            },
            "description": "The email, by the event name its webhook delivery events carry, as listed by the list operation: PayslipGeneratedEvent, P45GeneratedEvent, P60GeneratedEvent, EmployeePensionEnrolmentEvent, EmployeePensionReEnrolmentEvent, EmployeePensionPostponementEvent, EmployeePensionOptInInformationEvent, EmployeePensionOptInConfirmationEvent, EmployeePensionJoinConfirmationEvent, ReportReadyEvent."
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EmailWording_EmailWordingSettingsResponseResponseBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EmailWording_ObjectResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EmailWording_ObjectResponseBody"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EmailWording_ObjectResponseBody"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EmailWording_ObjectResponseBody"
                }
              }
            }
          }
        },
        "x-flow-permission": "organisation-settings:read"
      },
      "patch": {
        "tags": [
          "Email wording · Organisation emails"
        ],
        "summary": "Change an organisation's wording for one email",
        "description": "Needs permission organisation-settings:write.\n\nA JSON Merge Patch (RFC 7396): leave a field out to keep it, send `null` to clear it (the email then uses the inherited wording), send text to change it. Plain text only, with the placeholders the email lists, written `{{like.this}}`. `enabled: false` switches off an email that can be switched off (`canBeSwitchedOff`; 400 `email_cannot_be_switched_off` otherwise), `true` switches it back on, `null` follows the account (or, for the account, sends it). Send every field as `null` to go back to the standard wording. Every save is kept as a version (see the revisions operation). Applies to this organisation only. Refused wording answers 400 with one `validationIssues` entry per thing to fix, and nothing is saved. Emails sent after the save carry it. API tokens cannot change or preview an organisation's emails (403 `email_settings_need_a_person`).",
        "operationId": "EmailWording_PatchOrganisationEmailSetting",
        "parameters": [
          {
            "name": "organisationId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The organisation to act on. It must be the one selected with `X-Org-Id`: a request naming two different organisations is refused with 403."
          },
          {
            "name": "eventType",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "PayslipGeneratedEvent",
                "P45GeneratedEvent",
                "P60GeneratedEvent",
                "EmployeePensionEnrolmentEvent",
                "EmployeePensionReEnrolmentEvent",
                "EmployeePensionPostponementEvent",
                "EmployeePensionOptInInformationEvent",
                "EmployeePensionOptInConfirmationEvent",
                "EmployeePensionJoinConfirmationEvent",
                "ReportReadyEvent"
              ]
            },
            "description": "The email, by the event name its webhook delivery events carry, as listed by the list operation: PayslipGeneratedEvent, P45GeneratedEvent, P60GeneratedEvent, EmployeePensionEnrolmentEvent, EmployeePensionReEnrolmentEvent, EmployeePensionPostponementEvent, EmployeePensionOptInInformationEvent, EmployeePensionOptInConfirmationEvent, EmployeePensionJoinConfirmationEvent, ReportReadyEvent."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/merge-patch+json": {
              "schema": {
                "$ref": "#/components/schemas/EmailWording_EmailWordingPatch"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/EmailWording_EmailWordingPatch"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EmailWording_EmailWordingSettingsResponseResponseBody"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EmailWording_ObjectResponseBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EmailWording_ObjectResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EmailWording_ObjectResponseBody"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EmailWording_ObjectResponseBody"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EmailWording_ObjectResponseBody"
                }
              }
            }
          },
          "415": {
            "description": "Unsupported Media Type",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EmailWording_ObjectResponseBody"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EmailWording_ObjectResponseBody"
                }
              }
            }
          }
        },
        "x-flow-permission": "organisation-settings:write"
      }
    },
    "/v1/notification-settings/organisations/{organisationId}/email-settings/{eventType}/previews": {
      "post": {
        "tags": [
          "Email wording · Organisation emails"
        ],
        "summary": "Preview an organisation's wording for one email",
        "description": "Needs permission organisation-settings:read.\n\nThe wording that would be sent, filled with sample values (Jane Doe, Acme Ltd). Send an unsaved draft in the same shape as a change to preview it over what is saved, or no body to preview what is saved. Nothing is saved or sent. API tokens cannot change or preview an organisation's emails (403 `email_settings_need_a_person`).",
        "operationId": "EmailWording_PreviewOrganisationEmailSetting",
        "parameters": [
          {
            "name": "organisationId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The organisation to act on. It must be the one selected with `X-Org-Id`: a request naming two different organisations is refused with 403."
          },
          {
            "name": "eventType",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "PayslipGeneratedEvent",
                "P45GeneratedEvent",
                "P60GeneratedEvent",
                "EmployeePensionEnrolmentEvent",
                "EmployeePensionReEnrolmentEvent",
                "EmployeePensionPostponementEvent",
                "EmployeePensionOptInInformationEvent",
                "EmployeePensionOptInConfirmationEvent",
                "EmployeePensionJoinConfirmationEvent",
                "ReportReadyEvent"
              ]
            },
            "description": "The email, by the event name its webhook delivery events carry, as listed by the list operation: PayslipGeneratedEvent, P45GeneratedEvent, P60GeneratedEvent, EmployeePensionEnrolmentEvent, EmployeePensionReEnrolmentEvent, EmployeePensionPostponementEvent, EmployeePensionOptInInformationEvent, EmployeePensionOptInConfirmationEvent, EmployeePensionJoinConfirmationEvent, ReportReadyEvent."
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/merge-patch+json": {
              "schema": {
                "$ref": "#/components/schemas/EmailWording_EmailWordingPatch"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/EmailWording_EmailWordingPatch"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EmailWording_EmailWordingPreviewResponseResponseBody"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EmailWording_ObjectResponseBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EmailWording_ObjectResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EmailWording_ObjectResponseBody"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EmailWording_ObjectResponseBody"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EmailWording_ObjectResponseBody"
                }
              }
            }
          }
        },
        "x-flow-permission": "organisation-settings:read"
      }
    },
    "/v1/notification-settings/organisations/{organisationId}/email-settings/{eventType}/rendered-previews": {
      "post": {
        "tags": [
          "Email wording · Organisation emails"
        ],
        "summary": "Preview an organisation's email as it would be sent",
        "description": "Needs permission organisation-settings:read.\n\nThe email exactly as it would be sent: subject, a whole HTML page and the plain-text version, with sample values (Jane Doe, Acme Ltd) and no attachment. Send `wording` in the same shape as a change to preview unsaved wording over what is saved. Logos are embedded in the page, so it can be shown in a sandboxed frame. Nothing is saved or sent. At most 30 previews a minute per person (429 `preview_limit`); API tokens cannot preview (403). 409 `preview_no_template` when the email is not set up; 502 `preview_unavailable` when the preview cannot be drawn just now. An organisation previews the published brand only: `brand` `Draft` answers 400 `draft_preview_not_available`.",
        "operationId": "EmailWording_RenderOrganisationEmailPreview",
        "parameters": [
          {
            "name": "organisationId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The organisation to act on. It must be the one selected with `X-Org-Id`: a request naming two different organisations is refused with 403."
          },
          {
            "name": "eventType",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "PayslipGeneratedEvent",
                "P45GeneratedEvent",
                "P60GeneratedEvent",
                "EmployeePensionEnrolmentEvent",
                "EmployeePensionReEnrolmentEvent",
                "EmployeePensionPostponementEvent",
                "EmployeePensionOptInInformationEvent",
                "EmployeePensionOptInConfirmationEvent",
                "EmployeePensionJoinConfirmationEvent",
                "ReportReadyEvent"
              ]
            },
            "description": "The email, by the event name its webhook delivery events carry, as listed by the list operation: PayslipGeneratedEvent, P45GeneratedEvent, P60GeneratedEvent, EmployeePensionEnrolmentEvent, EmployeePensionReEnrolmentEvent, EmployeePensionPostponementEvent, EmployeePensionOptInInformationEvent, EmployeePensionOptInConfirmationEvent, EmployeePensionJoinConfirmationEvent, ReportReadyEvent."
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/EmailWording_EmailRenderedPreviewRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EmailWording_EmailRenderedPreviewResponseResponseBody"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EmailWording_ObjectResponseBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EmailWording_ObjectResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EmailWording_ObjectResponseBody"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EmailWording_ObjectResponseBody"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EmailWording_ObjectResponseBody"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EmailWording_ObjectResponseBody"
                }
              }
            }
          },
          "502": {
            "description": "Bad Gateway",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EmailWording_ObjectResponseBody"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EmailWording_ObjectResponseBody"
                }
              }
            }
          }
        },
        "x-flow-permission": "organisation-settings:read"
      }
    },
    "/v1/notification-settings/organisations/{organisationId}/email-settings/{eventType}/revisions": {
      "get": {
        "tags": [
          "Email wording · Organisation emails"
        ],
        "summary": "List the saved versions of an organisation's wording for one email",
        "description": "Needs permission organisation-settings:read.\n\nEvery saved version of this email's wording at this level, newest first: what it held after each save, including whether it was switched off, and who saved it. Page with `pageSize` (1 to 50, default 20) and the `paginationToken` the previous page returned (also in `metadata.paginationToken`).",
        "operationId": "EmailWording_ListOrganisationEmailWordingRevisions",
        "parameters": [
          {
            "name": "organisationId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The organisation to act on. It must be the one selected with `X-Org-Id`: a request naming two different organisations is refused with 403."
          },
          {
            "name": "eventType",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "PayslipGeneratedEvent",
                "P45GeneratedEvent",
                "P60GeneratedEvent",
                "EmployeePensionEnrolmentEvent",
                "EmployeePensionReEnrolmentEvent",
                "EmployeePensionPostponementEvent",
                "EmployeePensionOptInInformationEvent",
                "EmployeePensionOptInConfirmationEvent",
                "EmployeePensionJoinConfirmationEvent",
                "ReportReadyEvent"
              ]
            },
            "description": "The email, by the event name its webhook delivery events carry, as listed by the list operation: PayslipGeneratedEvent, P45GeneratedEvent, P60GeneratedEvent, EmployeePensionEnrolmentEvent, EmployeePensionReEnrolmentEvent, EmployeePensionPostponementEvent, EmployeePensionOptInInformationEvent, EmployeePensionOptInConfirmationEvent, EmployeePensionJoinConfirmationEvent, ReportReadyEvent."
          },
          {
            "name": "pageSize",
            "in": "query",
            "required": false,
            "description": "How many versions to return: 1 to 50, default 20.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 50,
              "default": 20
            }
          },
          {
            "name": "paginationToken",
            "in": "query",
            "required": false,
            "description": "The `paginationToken` the previous page returned; leave it out for the first page.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EmailWording_EmailWordingRevisionListResponseResponseBody"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EmailWording_ObjectResponseBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EmailWording_ObjectResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EmailWording_ObjectResponseBody"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EmailWording_ObjectResponseBody"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EmailWording_ObjectResponseBody"
                }
              }
            }
          }
        },
        "x-flow-permission": "organisation-settings:read"
      }
    },
    "/v1/notification-settings/organisations/{organisationId}/email-settings/{eventType}/revisions/{revisionId}/restorations": {
      "post": {
        "tags": [
          "Email wording · Organisation emails"
        ],
        "summary": "Restore a saved version of an organisation's wording for one email",
        "description": "Needs permission organisation-settings:write.\n\nPuts a saved version back: its wording and on/off choice are saved again as a new version, exactly as a change would be, and the restored settings are returned. 404 `email_wording_revision_not_found` when the version does not exist. API tokens cannot change or preview an organisation's emails (403 `email_settings_need_a_person`).",
        "operationId": "EmailWording_RestoreOrganisationEmailWordingRevision",
        "parameters": [
          {
            "name": "organisationId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The organisation to act on. It must be the one selected with `X-Org-Id`: a request naming two different organisations is refused with 403."
          },
          {
            "name": "eventType",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "PayslipGeneratedEvent",
                "P45GeneratedEvent",
                "P60GeneratedEvent",
                "EmployeePensionEnrolmentEvent",
                "EmployeePensionReEnrolmentEvent",
                "EmployeePensionPostponementEvent",
                "EmployeePensionOptInInformationEvent",
                "EmployeePensionOptInConfirmationEvent",
                "EmployeePensionJoinConfirmationEvent",
                "ReportReadyEvent"
              ]
            },
            "description": "The email, by the event name its webhook delivery events carry, as listed by the list operation: PayslipGeneratedEvent, P45GeneratedEvent, P60GeneratedEvent, EmployeePensionEnrolmentEvent, EmployeePensionReEnrolmentEvent, EmployeePensionPostponementEvent, EmployeePensionOptInInformationEvent, EmployeePensionOptInConfirmationEvent, EmployeePensionJoinConfirmationEvent, ReportReadyEvent."
          },
          {
            "name": "revisionId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "A version's `revisionId`, as the revisions operation lists it."
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EmailWording_EmailWordingSettingsResponseResponseBody"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EmailWording_ObjectResponseBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EmailWording_ObjectResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EmailWording_ObjectResponseBody"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EmailWording_ObjectResponseBody"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EmailWording_ObjectResponseBody"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EmailWording_ObjectResponseBody"
                }
              }
            }
          }
        },
        "x-flow-permission": "organisation-settings:write"
      }
    },
    "/v1/notification-settings/organisations/{organisationId}/email-settings/{eventType}/test-sends": {
      "post": {
        "tags": [
          "Email wording · Organisation emails"
        ],
        "summary": "Send yourself a test of one email",
        "description": "Needs permission organisation-settings:write.\n\nSends the email, with this organisation's brand and saved wording and sample values, to the signed-in person's own address and nobody else, with the subject prefixed \"Test: \". It is delivered like a real email. No attachment. One test a minute per person (429 `test_send_limit`). API tokens cannot send tests.",
        "operationId": "EmailWording_SendOrganisationTestEmail",
        "parameters": [
          {
            "name": "organisationId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The organisation to act on. It must be the one selected with `X-Org-Id`: a request naming two different organisations is refused with 403."
          },
          {
            "name": "eventType",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "PayslipGeneratedEvent",
                "P45GeneratedEvent",
                "P60GeneratedEvent",
                "EmployeePensionEnrolmentEvent",
                "EmployeePensionReEnrolmentEvent",
                "EmployeePensionPostponementEvent",
                "EmployeePensionOptInInformationEvent",
                "EmployeePensionOptInConfirmationEvent",
                "EmployeePensionJoinConfirmationEvent",
                "ReportReadyEvent"
              ]
            },
            "description": "The email, by the event name its webhook delivery events carry, as listed by the list operation: PayslipGeneratedEvent, P45GeneratedEvent, P60GeneratedEvent, EmployeePensionEnrolmentEvent, EmployeePensionReEnrolmentEvent, EmployeePensionPostponementEvent, EmployeePensionOptInInformationEvent, EmployeePensionOptInConfirmationEvent, EmployeePensionJoinConfirmationEvent, ReportReadyEvent."
          }
        ],
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EmailWording_EmailTestSendResponseResponseBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EmailWording_ObjectResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EmailWording_ObjectResponseBody"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EmailWording_ObjectResponseBody"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EmailWording_ObjectResponseBody"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EmailWording_ObjectResponseBody"
                }
              }
            }
          },
          "502": {
            "description": "Bad Gateway",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EmailWording_ObjectResponseBody"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EmailWording_ObjectResponseBody"
                }
              }
            }
          }
        },
        "x-flow-permission": "organisation-settings:write"
      }
    },
    "/v1/calculator/grosstonet": {
      "post": {
        "tags": [
          "Pay API · Calculator"
        ],
        "summary": "Calculate gross to net values",
        "description": "Needs permission pay-run:read.",
        "operationId": "Pay_GrossToNetCalculator",
        "x-flow-permission": "pay-run:read",
        "parameters": [
          {
            "$ref": "#/components/parameters/Pay_Request-Id"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Pay_GrossToNetDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Calculation Complete",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Pay_ResponseBody"
                    },
                    {
                      "properties": {
                        "content": {
                          "type": "object",
                          "properties": {
                            "data": {
                              "$ref": "#/components/schemas/Pay_CalculationResult"
                            }
                          }
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid calculation data or unsupported formula",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          }
        }
      }
    },
    "/v1/employee-fields": {
      "get": {
        "tags": [
          "Pay API · Employees"
        ],
        "summary": "List every employee field your role can read",
        "description": "Needs permission employee:read.\n\nEach field's path as search, sort, export and import name it, the kind of value it holds, its choices, whether it repeats or is read for a date, and whether `PATCH /employees/{employeeId}` changes it. A new employee field appears here as soon as it is released.",
        "operationId": "Pay_ListEmployeeFields",
        "x-flow-permission": "employee:read",
        "parameters": [
          {
            "$ref": "#/components/parameters/Pay_Request-Id"
          }
        ],
        "responses": {
          "200": {
            "description": "Fields listed",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Pay_ResponseBody"
                    },
                    {
                      "properties": {
                        "content": {
                          "type": "object",
                          "properties": {
                            "data": {
                              "type": "array",
                              "items": {
                                "$ref": "#/components/schemas/Pay_EmployeeFieldDto"
                              }
                            }
                          }
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "500": {
            "description": "An internal server error occurred",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          }
        },
        "x-mint": {
          "mcp": {
            "enabled": true
          }
        }
      }
    },
    "/v1/employees": {
      "get": {
        "tags": [
          "Pay API · Employees"
        ],
        "summary": "List employees with pagination",
        "description": "Needs permission employee:read.",
        "operationId": "Pay_ListEmployees",
        "x-flow-permission": "employee:read",
        "parameters": [
          {
            "name": "pageSize",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int32"
            },
            "description": "The maximum number of employees to return."
          },
          {
            "name": "paginationToken",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "The pagination token for the next page."
          },
          {
            "$ref": "#/components/parameters/Pay_Request-Id"
          }
        ],
        "responses": {
          "200": {
            "description": "Employees listed successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Pay_ResponseBody"
                    },
                    {
                      "properties": {
                        "content": {
                          "type": "object",
                          "properties": {
                            "data": {
                              "type": "array",
                              "items": {
                                "$ref": "#/components/schemas/Pay_EmployeeListItemDto"
                              }
                            },
                            "metadata": {
                              "type": "object",
                              "properties": {
                                "paginationToken": {
                                  "type": "string",
                                  "nullable": true
                                }
                              }
                            }
                          }
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "500": {
            "description": "An error occurred",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          }
        },
        "x-mint": {
          "mcp": {
            "enabled": true
          }
        }
      },
      "post": {
        "tags": [
          "Pay API · Employees"
        ],
        "summary": "Create a new employee",
        "description": "Needs permission employee:write, and employee-payroll:write, employee-pay-schedule:write.\n\nAdding an employee writes their details, their payroll details and the pay schedule they are paid on, so it needs `employee:write`, `employee-payroll:write` and `employee-pay-schedule:write`. A role without one of them changes existing employees (`PUT` and `PATCH /employees/{employeeId}`) but cannot add new starters. The new employee's other fields are judged as on any change: a Payroll ID needs `employee-payroll-id:write` (left out, it is the employee's ID), working patterns `working-pattern:write`.",
        "operationId": "Pay_PostNewEmployee",
        "x-flow-permission": "employee:write",
        "parameters": [
          {
            "$ref": "#/components/parameters/Pay_Request-Id"
          }
        ],
        "x-flow-permission-also-requires": [
          "employee-payroll:write",
          "employee-pay-schedule:write"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Pay_CreateEmployeeDto"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Employee Created",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Pay_ResponseBody"
                    },
                    {
                      "properties": {
                        "content": {
                          "type": "object",
                          "properties": {
                            "data": {
                              "$ref": "#/components/schemas/Pay_EmployeeDto"
                            }
                          }
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid employee data",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          }
        }
      }
    },
    "/v1/employees/by-ni/{nationalInsuranceNumber}": {
      "get": {
        "tags": [
          "Pay API · Employees"
        ],
        "summary": "Find employee by National Insurance Number",
        "description": "Needs permission employee:read.",
        "operationId": "Pay_GetEmployeeByNationalInsuranceNumber",
        "x-flow-permission": "employee:read",
        "parameters": [
          {
            "name": "nationalInsuranceNumber",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The National Insurance Number of the employee to find"
          },
          {
            "$ref": "#/components/parameters/Pay_Request-Id"
          }
        ],
        "responses": {
          "200": {
            "description": "Employee found successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Pay_ResponseBody"
                    },
                    {
                      "properties": {
                        "content": {
                          "type": "object",
                          "properties": {
                            "data": {
                              "$ref": "#/components/schemas/Pay_EmployeeDto"
                            }
                          }
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "404": {
            "description": "Employee not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "500": {
            "description": "An internal server error occurred",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          }
        },
        "x-mint": {
          "mcp": {
            "enabled": true
          }
        }
      }
    },
    "/v1/employees/by-payroll-id/{payrollId}": {
      "get": {
        "tags": [
          "Pay API · Employees"
        ],
        "summary": "Find employee by Payroll ID",
        "description": "Needs permission employee:read.",
        "operationId": "Pay_GetEmployeeByPayrollId",
        "x-flow-permission": "employee:read",
        "parameters": [
          {
            "name": "payrollId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The Payroll ID of the employee to find"
          },
          {
            "$ref": "#/components/parameters/Pay_Request-Id"
          }
        ],
        "responses": {
          "200": {
            "description": "Employee found successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Pay_ResponseBody"
                    },
                    {
                      "properties": {
                        "content": {
                          "type": "object",
                          "properties": {
                            "data": {
                              "$ref": "#/components/schemas/Pay_EmployeeDto"
                            }
                          }
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "404": {
            "description": "Employee not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "500": {
            "description": "An internal server error occurred",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          }
        },
        "x-mint": {
          "mcp": {
            "enabled": true
          }
        }
      }
    },
    "/v1/employees/exports": {
      "get": {
        "tags": [
          "Pay API · Employees"
        ],
        "summary": "List the organisation's latest employee exports",
        "description": "Needs permission employee:export.\n\nThe organisation's 100 latest exports, whoever started them, newest first, each as `GET /employees/exports/{exportId}` answers it: who started it, and a link only where you may download the file.",
        "operationId": "Pay_ListEmployeeExports",
        "x-flow-permission": "employee:export",
        "parameters": [
          {
            "$ref": "#/components/parameters/Pay_Request-Id"
          }
        ],
        "responses": {
          "200": {
            "description": "Exports listed",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Pay_ResponseBody"
                    },
                    {
                      "properties": {
                        "content": {
                          "type": "object",
                          "properties": {
                            "data": {
                              "$ref": "#/components/schemas/Pay_EmployeeExportListDto"
                            }
                          }
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "500": {
            "description": "An internal server error occurred",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          }
        },
        "x-mint": {
          "mcp": {
            "enabled": true
          }
        }
      },
      "post": {
        "tags": [
          "Pay API · Employees"
        ],
        "summary": "Export the employees a search matches as a CSV",
        "description": "Needs permission employee:export.\n\nThe file is written in the background: this answers at once with the export, and `GET /employees/exports/{exportId}` gives a link to the file once it is completed. Choose the columns and their headings; each must be a field your role can read, and the file holds only those, led by `Employee ID` unless you placed `id` yourself, so the file can be read back to update the same employees. Rows are the employees the search matches, in its order, with dated values as on `asAt`. A list's values are separated by `; `, a map's written `key=value`.",
        "operationId": "Pay_StartEmployeeExport",
        "x-flow-permission": "employee:export",
        "parameters": [
          {
            "$ref": "#/components/parameters/Pay_Request-Id"
          }
        ],
        "requestBody": {
          "description": "The columns, and which employees to export",
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Pay_EmployeeExportRequestDto"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Export started",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Pay_ResponseBody"
                    },
                    {
                      "properties": {
                        "content": {
                          "type": "object",
                          "properties": {
                            "data": {
                              "$ref": "#/components/schemas/Pay_EmployeeExportDto"
                            }
                          }
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "The export cannot be made as sent; the message says why",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "500": {
            "description": "An internal server error occurred",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "503": {
            "description": "The search could not catch up with your own write; retry after the Retry-After seconds",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          }
        },
        "x-employee-file-columns": [
          {
            "key": "payrollId",
            "header": "Payroll ID",
            "fields": [
              "payrollId"
            ]
          },
          {
            "key": "employeeId",
            "header": "Employee ID",
            "fields": [
              "id"
            ]
          },
          {
            "key": "payrollConfigName",
            "header": "Payroll Config",
            "fields": [
              "payrollConfigId"
            ]
          },
          {
            "key": "title",
            "header": "Title",
            "fields": [
              "name.title"
            ]
          },
          {
            "key": "firstName",
            "header": "First Name",
            "fields": [
              "name.firstName"
            ]
          },
          {
            "key": "middleName",
            "header": "Middle Name",
            "fields": [
              "name.middleName"
            ]
          },
          {
            "key": "lastName",
            "header": "Last Name",
            "fields": [
              "name.lastName"
            ]
          },
          {
            "key": "email",
            "header": "Email",
            "fields": [
              "email"
            ]
          },
          {
            "key": "phone",
            "header": "Phone",
            "fields": [
              "phone"
            ]
          },
          {
            "key": "birthDate",
            "header": "Birth Date",
            "fields": [
              "birthDate"
            ]
          },
          {
            "key": "birthGender",
            "header": "Birth Gender",
            "fields": [
              "birthGender"
            ]
          },
          {
            "key": "maritalStatus",
            "header": "Marital Status",
            "fields": [
              "maritalStatus"
            ]
          },
          {
            "key": "startDate",
            "header": "Start Date",
            "fields": [
              "starterDetails.startDate"
            ]
          },
          {
            "key": "starterDeclaration",
            "header": "Starter Declaration",
            "fields": [
              "starterDetails.starterDeclaration"
            ]
          },
          {
            "key": "alreadySentToHmrcFps",
            "header": "Starter Reported to HMRC",
            "fields": [
              "starterDetails.alreadySentToHmrcFps"
            ]
          },
          {
            "key": "directorNicType",
            "header": "Director NIC Type",
            "fields": [
              "directorDetails.directorsNICType"
            ]
          },
          {
            "key": "directorAppointmentDate",
            "header": "Director Appointment Date",
            "fields": [
              "directorDetails.appointmentDate"
            ]
          },
          {
            "key": "directorEndDate",
            "header": "Director End Date",
            "fields": [
              "directorDetails.endDate"
            ]
          },
          {
            "key": "partnerNiNumber",
            "header": "Partner NI Number",
            "fields": [
              "partnerDetails.nationalInsuranceNumber"
            ]
          },
          {
            "key": "partnerFirstName",
            "header": "Partner First Name",
            "fields": [
              "partnerDetails.name.firstName"
            ]
          },
          {
            "key": "partnerLastName",
            "header": "Partner Last Name",
            "fields": [
              "partnerDetails.name.lastName"
            ]
          },
          {
            "key": "hoursWorkedCategory",
            "header": "Hours Worked",
            "fields": [
              "hoursWorkedCategory"
            ]
          },
          {
            "key": "jobTitle",
            "header": "Job Title",
            "fields": [
              "jobTitle"
            ]
          },
          {
            "key": "department",
            "header": "Department",
            "fields": [
              "department"
            ]
          },
          {
            "key": "salary",
            "header": "Salary",
            "fields": [
              "salary"
            ]
          },
          {
            "key": "taxCode",
            "header": "Tax Code",
            "fields": [
              "taxCodesPerYear{}[].code",
              "taxCodesPerYear{}[].effectiveDate"
            ]
          },
          {
            "key": "niCategory",
            "header": "NI Category",
            "fields": [
              "niDetails.categoriesPerYear{}[].category",
              "niDetails.categoriesPerYear{}[].effectiveDate"
            ]
          },
          {
            "key": "nationalInsuranceNumber",
            "header": "NI Number",
            "fields": [
              "niDetails.nationalInsuranceNumber"
            ]
          },
          {
            "key": "studentLoanPlan",
            "header": "Student Loan Plan",
            "fields": [
              "studentDetails.studentLoanDetails.loanType"
            ]
          },
          {
            "key": "postgraduateLoanPlan",
            "header": "Postgraduate Loan Plan",
            "fields": [
              "studentDetails.postgraduateLoanDetails.loanType"
            ]
          },
          {
            "key": "studentLoanStartDate",
            "header": "Student Loan Start Date",
            "fields": [
              "studentDetails.studentLoanDetails.startDate"
            ]
          },
          {
            "key": "studentLoanEndDate",
            "header": "Student Loan End Date",
            "fields": [
              "studentDetails.studentLoanDetails.endDate"
            ]
          },
          {
            "key": "postgraduateLoanStartDate",
            "header": "PG Loan Start Date",
            "fields": [
              "studentDetails.postgraduateLoanDetails.startDate"
            ]
          },
          {
            "key": "postgraduateLoanEndDate",
            "header": "PG Loan End Date",
            "fields": [
              "studentDetails.postgraduateLoanDetails.endDate"
            ]
          },
          {
            "key": "previousEmploymentGrossTaxable",
            "header": "P45 Previous Taxable Pay",
            "fields": [
              "previousEmployment{}.grossTaxable"
            ]
          },
          {
            "key": "previousEmploymentTax",
            "header": "P45 Previous Tax Paid",
            "fields": [
              "previousEmployment{}.tax"
            ]
          },
          {
            "key": "addressLine1",
            "header": "Address Line 1",
            "fields": [
              "address.line1"
            ]
          },
          {
            "key": "addressLine2",
            "header": "Address Line 2",
            "fields": [
              "address.line2"
            ]
          },
          {
            "key": "city",
            "header": "City",
            "fields": [
              "address.city"
            ]
          },
          {
            "key": "county",
            "header": "County",
            "fields": [
              "address.county"
            ]
          },
          {
            "key": "postcode",
            "header": "Postcode",
            "fields": [
              "address.postcode"
            ]
          },
          {
            "key": "countryCode",
            "header": "Country Code",
            "fields": [
              "address.countryCode"
            ]
          },
          {
            "key": "accountHolderName",
            "header": "Account Holder Name",
            "fields": [
              "bankAccounts[].accountHolderName",
              "bankAccounts[].isPrimaryPayrollAccount"
            ]
          },
          {
            "key": "accountNumber",
            "header": "Account Number",
            "fields": [
              "bankAccounts[].accountNumber",
              "bankAccounts[].isPrimaryPayrollAccount"
            ]
          },
          {
            "key": "sortCode",
            "header": "Sort Code",
            "fields": [
              "bankAccounts[].sortCode",
              "bankAccounts[].isPrimaryPayrollAccount"
            ]
          },
          {
            "key": "secondaryEmail",
            "header": "Secondary Email",
            "fields": [
              "secondaryEmail"
            ]
          },
          {
            "key": "secondaryPhone",
            "header": "Secondary Phone",
            "fields": [
              "secondaryPhone"
            ]
          },
          {
            "key": "employeeCode",
            "header": "Employee Code",
            "fields": [
              "employeeCode"
            ]
          },
          {
            "key": "passportNumber",
            "header": "Passport Number",
            "fields": [
              "passportNumber"
            ]
          },
          {
            "key": "gender",
            "header": "Gender",
            "fields": [
              "gender"
            ]
          },
          {
            "key": "isIrregularEmployment",
            "header": "Irregular Employment",
            "fields": [
              "isIrregularEmployment"
            ]
          },
          {
            "key": "isOffPayrollWorker",
            "header": "Off Payroll Worker (IR35)",
            "fields": [
              "isOffPayrollWorker"
            ]
          },
          {
            "key": "workplacePostcode",
            "header": "Workplace Postcode",
            "fields": [
              "workplaceDetails.workplacePostcode"
            ]
          },
          {
            "key": "taxCodeW1M1",
            "header": "Tax Code W1/M1",
            "fields": [
              "taxCodesPerYear{}[].week1Month1",
              "taxCodesPerYear{}[].effectiveDate"
            ]
          },
          {
            "key": "workMonday",
            "header": "Works Monday",
            "fields": [
              "workingDays.standardWorkingDays.monday"
            ]
          },
          {
            "key": "workTuesday",
            "header": "Works Tuesday",
            "fields": [
              "workingDays.standardWorkingDays.tuesday"
            ]
          },
          {
            "key": "workWednesday",
            "header": "Works Wednesday",
            "fields": [
              "workingDays.standardWorkingDays.wednesday"
            ]
          },
          {
            "key": "workThursday",
            "header": "Works Thursday",
            "fields": [
              "workingDays.standardWorkingDays.thursday"
            ]
          },
          {
            "key": "workFriday",
            "header": "Works Friday",
            "fields": [
              "workingDays.standardWorkingDays.friday"
            ]
          },
          {
            "key": "workSaturday",
            "header": "Works Saturday",
            "fields": [
              "workingDays.standardWorkingDays.saturday"
            ]
          },
          {
            "key": "workSunday",
            "header": "Works Sunday",
            "fields": [
              "workingDays.standardWorkingDays.sunday"
            ]
          },
          {
            "key": "ytdGross",
            "header": "YTD Gross",
            "fields": [
              "earningsToDatePerYear{}.gross",
              "openingBalance{}.gross"
            ]
          },
          {
            "key": "ytdTax",
            "header": "YTD Tax",
            "fields": [
              "earningsToDatePerYear{}.tax",
              "openingBalance{}.tax"
            ]
          },
          {
            "key": "ytdTaxable",
            "header": "YTD Taxable",
            "fields": [
              "earningsToDatePerYear{}.taxable",
              "openingBalance{}.taxable"
            ]
          },
          {
            "key": "ytdNi",
            "header": "YTD NI",
            "fields": [
              "earningsToDatePerYear{}.ni",
              "openingBalance{}.ni"
            ]
          },
          {
            "key": "ytdEmployerNi",
            "header": "YTD Employer NI",
            "fields": [
              "earningsToDatePerYear{}.employerNi",
              "openingBalance{}.employerNi"
            ]
          },
          {
            "key": "ytdStudentLoan",
            "header": "YTD Student Loan",
            "fields": [
              "earningsToDatePerYear{}.studentLoan",
              "openingBalance{}.studentLoan"
            ]
          },
          {
            "key": "ytdPostgraduateLoan",
            "header": "YTD Postgraduate Loan",
            "fields": [
              "earningsToDatePerYear{}.postgraduateLoan",
              "openingBalance{}.postgraduateLoan"
            ]
          },
          {
            "key": "leavingDate",
            "header": "Leaving Date",
            "fields": [
              "leaverDetails.leavingDate"
            ]
          },
          {
            "key": "leaverReason",
            "header": "Leaver Reason",
            "fields": [
              "leaverDetails.reason"
            ]
          },
          {
            "key": "leaverReportedToHmrc",
            "header": "Leaver Reported to HMRC",
            "fields": [
              "leaverDetails.reportedToHmrc"
            ]
          },
          {
            "key": "ytdGrossForEmployeeNi",
            "header": "YTD Gross for Employee NI",
            "fields": [
              "earningsToDatePerYear{}.grossForEmployeeNi",
              "openingBalance{}.grossForEmployeeNi"
            ]
          },
          {
            "key": "ytdGrossForEmployerNi",
            "header": "YTD Gross for Employer NI",
            "fields": [
              "earningsToDatePerYear{}.grossForEmployerNi",
              "openingBalance{}.grossForEmployerNi"
            ]
          },
          {
            "key": "ytdEmployerClass1ANi",
            "header": "YTD Employer Class 1A NI",
            "fields": [
              "earningsToDatePerYear{}.employerClass1ANi",
              "openingBalance{}.employerClass1ANi"
            ]
          },
          {
            "key": "ytdNet",
            "header": "YTD Net Pay",
            "fields": [
              "earningsToDatePerYear{}.net",
              "openingBalance{}.net"
            ]
          },
          {
            "key": "ytdTotalEmployerCost",
            "header": "YTD Cost to Employer",
            "fields": [
              "earningsToDatePerYear{}.totalEmployerCost",
              "openingBalance{}.totalEmployerCost"
            ]
          },
          {
            "key": "ytdPension",
            "header": "YTD Employee Pension",
            "fields": [
              "earningsToDatePerYear{}.pension",
              "openingBalance{}.pension"
            ]
          },
          {
            "key": "ytdEmployerPension",
            "header": "YTD Employer Pension",
            "fields": [
              "earningsToDatePerYear{}.employerPension",
              "openingBalance{}.employerPension"
            ]
          },
          {
            "key": "ytdGrossPensionable",
            "header": "YTD Pensionable Pay",
            "fields": [
              "earningsToDatePerYear{}.grossPensionable",
              "openingBalance{}.grossPensionable"
            ]
          },
          {
            "key": "niEarningsToLel",
            "header": "Earnings to LEL",
            "fields": [
              "earningsToDatePerYear{}.niBandResult{}.bandResults{}.grossInBand",
              "openingBalance{}.niBandResult{}.bandResults{}.grossInBand",
              "niDetails.categoriesPerYear{}[].category",
              "niDetails.categoriesPerYear{}[].effectiveDate"
            ]
          },
          {
            "key": "niEarningsLelToPt",
            "header": "Earnings LEL to PT",
            "fields": [
              "earningsToDatePerYear{}.niBandResult{}.bandResults{}.grossInBand",
              "openingBalance{}.niBandResult{}.bandResults{}.grossInBand",
              "niDetails.categoriesPerYear{}[].category",
              "niDetails.categoriesPerYear{}[].effectiveDate"
            ]
          },
          {
            "key": "niEarningsPtToFust",
            "header": "Earnings PT to FUST",
            "fields": [
              "earningsToDatePerYear{}.niBandResult{}.bandResults{}.grossInBand",
              "openingBalance{}.niBandResult{}.bandResults{}.grossInBand",
              "niDetails.categoriesPerYear{}[].category",
              "niDetails.categoriesPerYear{}[].effectiveDate"
            ]
          },
          {
            "key": "niEarningsFustToUel",
            "header": "Earnings FUST to UEL",
            "fields": [
              "earningsToDatePerYear{}.niBandResult{}.bandResults{}.grossInBand",
              "openingBalance{}.niBandResult{}.bandResults{}.grossInBand",
              "niDetails.categoriesPerYear{}[].category",
              "niDetails.categoriesPerYear{}[].effectiveDate"
            ]
          },
          {
            "key": "niEarningsPtToUel",
            "header": "Earnings PT to UEL",
            "fields": []
          },
          {
            "key": "ytdSSP",
            "header": "YTD Statutory Sick Pay",
            "fields": [
              "earningsToDatePerYear{}.statutory{}",
              "openingBalance{}.statutory{}"
            ]
          },
          {
            "key": "ytdSMP",
            "header": "YTD Statutory Maternity Pay",
            "fields": [
              "earningsToDatePerYear{}.statutory{}",
              "openingBalance{}.statutory{}"
            ]
          },
          {
            "key": "ytdSPP",
            "header": "YTD Statutory Paternity Pay",
            "fields": [
              "earningsToDatePerYear{}.statutory{}",
              "openingBalance{}.statutory{}"
            ]
          },
          {
            "key": "ytdSAP",
            "header": "YTD Statutory Adoption Pay",
            "fields": [
              "earningsToDatePerYear{}.statutory{}",
              "openingBalance{}.statutory{}"
            ]
          },
          {
            "key": "ytdShPP",
            "header": "YTD Shared Parental Pay",
            "fields": [
              "earningsToDatePerYear{}.statutory{}",
              "openingBalance{}.statutory{}"
            ]
          },
          {
            "key": "ytdSPBP",
            "header": "YTD Statutory Parental Bereavement Pay",
            "fields": [
              "earningsToDatePerYear{}.statutory{}",
              "openingBalance{}.statutory{}"
            ]
          },
          {
            "key": "ytdSNCP",
            "header": "YTD Statutory Neonatal Care Pay",
            "fields": [
              "earningsToDatePerYear{}.statutory{}",
              "openingBalance{}.statutory{}"
            ]
          },
          {
            "key": "niEmployeeNi",
            "header": "NI Employee NI",
            "fields": [
              "earningsToDatePerYear{}.niBandResult{}.employeeNi",
              "openingBalance{}.niBandResult{}.employeeNi",
              "niDetails.categoriesPerYear{}[].category",
              "niDetails.categoriesPerYear{}[].effectiveDate"
            ]
          },
          {
            "key": "niEmployerNi",
            "header": "NI Employer NI",
            "fields": [
              "earningsToDatePerYear{}.niBandResult{}.employerNi",
              "openingBalance{}.niBandResult{}.employerNi",
              "niDetails.categoriesPerYear{}[].category",
              "niDetails.categoriesPerYear{}[].effectiveDate"
            ]
          },
          {
            "key": "niTotalNi",
            "header": "NI Total NI",
            "fields": [
              "earningsToDatePerYear{}.niBandResult{}.totalNi",
              "openingBalance{}.niBandResult{}.totalNi",
              "niDetails.categoriesPerYear{}[].category",
              "niDetails.categoriesPerYear{}[].effectiveDate"
            ]
          },
          {
            "key": "niGrossForEmployeeNi",
            "header": "NI Gross for Employee NI",
            "fields": [
              "earningsToDatePerYear{}.niBandResult{}.grossForEmployeeNi",
              "openingBalance{}.niBandResult{}.grossForEmployeeNi",
              "niDetails.categoriesPerYear{}[].category",
              "niDetails.categoriesPerYear{}[].effectiveDate"
            ]
          },
          {
            "key": "niGrossForEmployerNi",
            "header": "NI Gross for Employer NI",
            "fields": [
              "earningsToDatePerYear{}.niBandResult{}.grossForEmployerNi",
              "openingBalance{}.niBandResult{}.grossForEmployerNi",
              "niDetails.categoriesPerYear{}[].category",
              "niDetails.categoriesPerYear{}[].effectiveDate"
            ]
          },
          {
            "key": "directorYtdGrossForEmployeeNi",
            "header": "Director YTD Gross for Employee NI",
            "fields": [
              "directorEarningsToDatePerYear{}.grossForEmployeeNi",
              "openingBalanceDirector{}.grossForEmployeeNi"
            ]
          },
          {
            "key": "directorYtdGrossForEmployerNi",
            "header": "Director YTD Gross for Employer NI",
            "fields": [
              "directorEarningsToDatePerYear{}.grossForEmployerNi",
              "openingBalanceDirector{}.grossForEmployerNi"
            ]
          },
          {
            "key": "directorYtdNi",
            "header": "Director YTD Employee NI",
            "fields": [
              "directorEarningsToDatePerYear{}.ni",
              "openingBalanceDirector{}.ni"
            ]
          },
          {
            "key": "directorYtdEmployerNi",
            "header": "Director YTD Employer NI",
            "fields": [
              "directorEarningsToDatePerYear{}.employerNi",
              "openingBalanceDirector{}.employerNi"
            ]
          }
        ],
        "x-employee-file-tag-columns": {
          "key": "tags",
          "prefix": "Tag: ",
          "separator": " / "
        }
      }
    },
    "/v1/employees/exports/{exportId}": {
      "get": {
        "tags": [
          "Pay API · Employees"
        ],
        "summary": "Get one of the organisation's employee exports",
        "description": "Needs permission employee:export.\n\nWhere it stands, who started it (`requestedBy`) and, once completed, a link to the file that works for 12 hours; ask again for a fresh one. Everybody who can export employees in the organisation sees its exports. The link goes to whoever started the export, or to somebody whose role reads every column the file holds; anyone else gets `downloadUnavailable` instead.",
        "operationId": "Pay_GetEmployeeExport",
        "x-flow-permission": "employee:export",
        "parameters": [
          {
            "name": "exportId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The export."
          },
          {
            "$ref": "#/components/parameters/Pay_Request-Id"
          }
        ],
        "responses": {
          "200": {
            "description": "Export found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Pay_ResponseBody"
                    },
                    {
                      "properties": {
                        "content": {
                          "type": "object",
                          "properties": {
                            "data": {
                              "$ref": "#/components/schemas/Pay_EmployeeExportDto"
                            }
                          }
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "404": {
            "description": "No such export in this organisation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "500": {
            "description": "An internal server error occurred",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          }
        },
        "x-mint": {
          "mcp": {
            "enabled": true
          }
        }
      }
    },
    "/v1/employees/headcounts": {
      "get": {
        "tags": [
          "Pay API · Employees"
        ],
        "summary": "Count the organisation's employees: total, active, leavers and future leavers",
        "description": "Needs permission employee:read.\n\nA leaver is marked a leaver or has left before the date; a future leaver is still active with a leaving date on or after it. Active and leavers add up to the total.",
        "operationId": "Pay_GetEmployeeHeadcounts",
        "x-flow-permission": "employee:read",
        "parameters": [
          {
            "name": "asAt",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date"
            },
            "description": "The date to count for, yyyy-MM-dd; today when omitted."
          },
          {
            "$ref": "#/components/parameters/Pay_Request-Id"
          }
        ],
        "responses": {
          "200": {
            "description": "Employees counted",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Pay_ResponseBody"
                    },
                    {
                      "properties": {
                        "content": {
                          "type": "object",
                          "properties": {
                            "data": {
                              "$ref": "#/components/schemas/Pay_EmployeeHeadcountsDto"
                            }
                          }
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "The date is not yyyy-MM-dd",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "500": {
            "description": "An internal server error occurred",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          }
        },
        "x-mint": {
          "mcp": {
            "enabled": true
          }
        }
      }
    },
    "/v1/employees/imports": {
      "post": {
        "tags": [
          "Pay API · Employees"
        ],
        "summary": "Send a CSV of changes to existing employees",
        "description": "Needs permission employee:write, or any of employee-payroll:write, employee-payroll-id:write, employee-pay-schedule:write, working-pattern:write.\n\nOne row per employee, found by the column `matchBy` names: by default the `id` column (the `Employee ID` the employee export leads with), or the Payroll ID, NI number, Employee code or Email column. That column is never changed, and a value more than one employee holds is a problem on its row. The other columns are employee fields, by their path or by `columns`. Only cells that differ from the employee now are changed, and an empty cell leaves the field as it is. Nothing changes yet: the file is compared in the background, and `GET /employees/imports/{importId}` shows the preview once its status is `Ready`. At most 10,000 rows and 5 MB.",
        "operationId": "Pay_StartEmployeeImport",
        "x-flow-permission": "employee:write",
        "parameters": [
          {
            "$ref": "#/components/parameters/Pay_Request-Id"
          }
        ],
        "x-flow-permission-also-accepts": [
          "employee-payroll:write",
          "employee-payroll-id:write",
          "employee-pay-schedule:write",
          "working-pattern:write"
        ],
        "requestBody": {
          "description": "The file, and which field each heading holds",
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Pay_EmployeeImportRequestDto"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "File received; the preview is being prepared. `Location` is the import, `Retry-After` how soon to look; the organisation's open apps also hear `employeeImportChanged` over the websocket.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Pay_ResponseBody"
                    },
                    {
                      "properties": {
                        "content": {
                          "type": "object",
                          "properties": {
                            "data": {
                              "$ref": "#/components/schemas/Pay_EmployeeImportDto"
                            }
                          }
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "The file cannot be imported as sent; the message says why",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "500": {
            "description": "An internal server error occurred",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          }
        },
        "x-employee-file-columns": [
          {
            "key": "payrollId",
            "header": "Payroll ID",
            "fields": [
              "payrollId"
            ]
          },
          {
            "key": "employeeId",
            "header": "Employee ID",
            "fields": [
              "id"
            ]
          },
          {
            "key": "payrollConfigName",
            "header": "Payroll Config",
            "fields": [
              "payrollConfigId"
            ]
          },
          {
            "key": "title",
            "header": "Title",
            "fields": [
              "name.title"
            ]
          },
          {
            "key": "firstName",
            "header": "First Name",
            "fields": [
              "name.firstName"
            ]
          },
          {
            "key": "middleName",
            "header": "Middle Name",
            "fields": [
              "name.middleName"
            ]
          },
          {
            "key": "lastName",
            "header": "Last Name",
            "fields": [
              "name.lastName"
            ]
          },
          {
            "key": "email",
            "header": "Email",
            "fields": [
              "email"
            ]
          },
          {
            "key": "phone",
            "header": "Phone",
            "fields": [
              "phone"
            ]
          },
          {
            "key": "birthDate",
            "header": "Birth Date",
            "fields": [
              "birthDate"
            ]
          },
          {
            "key": "birthGender",
            "header": "Birth Gender",
            "fields": [
              "birthGender"
            ]
          },
          {
            "key": "maritalStatus",
            "header": "Marital Status",
            "fields": [
              "maritalStatus"
            ]
          },
          {
            "key": "startDate",
            "header": "Start Date",
            "fields": [
              "starterDetails.startDate"
            ]
          },
          {
            "key": "starterDeclaration",
            "header": "Starter Declaration",
            "fields": [
              "starterDetails.starterDeclaration"
            ]
          },
          {
            "key": "alreadySentToHmrcFps",
            "header": "Starter Reported to HMRC",
            "fields": [
              "starterDetails.alreadySentToHmrcFps"
            ]
          },
          {
            "key": "directorNicType",
            "header": "Director NIC Type",
            "fields": [
              "directorDetails.directorsNICType"
            ]
          },
          {
            "key": "directorAppointmentDate",
            "header": "Director Appointment Date",
            "fields": [
              "directorDetails.appointmentDate"
            ]
          },
          {
            "key": "directorEndDate",
            "header": "Director End Date",
            "fields": [
              "directorDetails.endDate"
            ]
          },
          {
            "key": "partnerNiNumber",
            "header": "Partner NI Number",
            "fields": [
              "partnerDetails.nationalInsuranceNumber"
            ]
          },
          {
            "key": "partnerFirstName",
            "header": "Partner First Name",
            "fields": [
              "partnerDetails.name.firstName"
            ]
          },
          {
            "key": "partnerLastName",
            "header": "Partner Last Name",
            "fields": [
              "partnerDetails.name.lastName"
            ]
          },
          {
            "key": "hoursWorkedCategory",
            "header": "Hours Worked",
            "fields": [
              "hoursWorkedCategory"
            ]
          },
          {
            "key": "jobTitle",
            "header": "Job Title",
            "fields": [
              "jobTitle"
            ]
          },
          {
            "key": "department",
            "header": "Department",
            "fields": [
              "department"
            ]
          },
          {
            "key": "salary",
            "header": "Salary",
            "fields": [
              "salary"
            ]
          },
          {
            "key": "taxCode",
            "header": "Tax Code",
            "fields": [
              "taxCodesPerYear{}[].code",
              "taxCodesPerYear{}[].effectiveDate"
            ]
          },
          {
            "key": "niCategory",
            "header": "NI Category",
            "fields": [
              "niDetails.categoriesPerYear{}[].category",
              "niDetails.categoriesPerYear{}[].effectiveDate"
            ]
          },
          {
            "key": "nationalInsuranceNumber",
            "header": "NI Number",
            "fields": [
              "niDetails.nationalInsuranceNumber"
            ]
          },
          {
            "key": "studentLoanPlan",
            "header": "Student Loan Plan",
            "fields": [
              "studentDetails.studentLoanDetails.loanType"
            ]
          },
          {
            "key": "postgraduateLoanPlan",
            "header": "Postgraduate Loan Plan",
            "fields": [
              "studentDetails.postgraduateLoanDetails.loanType"
            ]
          },
          {
            "key": "studentLoanStartDate",
            "header": "Student Loan Start Date",
            "fields": [
              "studentDetails.studentLoanDetails.startDate"
            ]
          },
          {
            "key": "studentLoanEndDate",
            "header": "Student Loan End Date",
            "fields": [
              "studentDetails.studentLoanDetails.endDate"
            ]
          },
          {
            "key": "postgraduateLoanStartDate",
            "header": "PG Loan Start Date",
            "fields": [
              "studentDetails.postgraduateLoanDetails.startDate"
            ]
          },
          {
            "key": "postgraduateLoanEndDate",
            "header": "PG Loan End Date",
            "fields": [
              "studentDetails.postgraduateLoanDetails.endDate"
            ]
          },
          {
            "key": "previousEmploymentGrossTaxable",
            "header": "P45 Previous Taxable Pay",
            "fields": [
              "previousEmployment{}.grossTaxable"
            ]
          },
          {
            "key": "previousEmploymentTax",
            "header": "P45 Previous Tax Paid",
            "fields": [
              "previousEmployment{}.tax"
            ]
          },
          {
            "key": "addressLine1",
            "header": "Address Line 1",
            "fields": [
              "address.line1"
            ]
          },
          {
            "key": "addressLine2",
            "header": "Address Line 2",
            "fields": [
              "address.line2"
            ]
          },
          {
            "key": "city",
            "header": "City",
            "fields": [
              "address.city"
            ]
          },
          {
            "key": "county",
            "header": "County",
            "fields": [
              "address.county"
            ]
          },
          {
            "key": "postcode",
            "header": "Postcode",
            "fields": [
              "address.postcode"
            ]
          },
          {
            "key": "countryCode",
            "header": "Country Code",
            "fields": [
              "address.countryCode"
            ]
          },
          {
            "key": "accountHolderName",
            "header": "Account Holder Name",
            "fields": [
              "bankAccounts[].accountHolderName",
              "bankAccounts[].isPrimaryPayrollAccount"
            ]
          },
          {
            "key": "accountNumber",
            "header": "Account Number",
            "fields": [
              "bankAccounts[].accountNumber",
              "bankAccounts[].isPrimaryPayrollAccount"
            ]
          },
          {
            "key": "sortCode",
            "header": "Sort Code",
            "fields": [
              "bankAccounts[].sortCode",
              "bankAccounts[].isPrimaryPayrollAccount"
            ]
          },
          {
            "key": "secondaryEmail",
            "header": "Secondary Email",
            "fields": [
              "secondaryEmail"
            ]
          },
          {
            "key": "secondaryPhone",
            "header": "Secondary Phone",
            "fields": [
              "secondaryPhone"
            ]
          },
          {
            "key": "employeeCode",
            "header": "Employee Code",
            "fields": [
              "employeeCode"
            ]
          },
          {
            "key": "passportNumber",
            "header": "Passport Number",
            "fields": [
              "passportNumber"
            ]
          },
          {
            "key": "gender",
            "header": "Gender",
            "fields": [
              "gender"
            ]
          },
          {
            "key": "isIrregularEmployment",
            "header": "Irregular Employment",
            "fields": [
              "isIrregularEmployment"
            ]
          },
          {
            "key": "isOffPayrollWorker",
            "header": "Off Payroll Worker (IR35)",
            "fields": [
              "isOffPayrollWorker"
            ]
          },
          {
            "key": "workplacePostcode",
            "header": "Workplace Postcode",
            "fields": [
              "workplaceDetails.workplacePostcode"
            ]
          },
          {
            "key": "taxCodeW1M1",
            "header": "Tax Code W1/M1",
            "fields": [
              "taxCodesPerYear{}[].week1Month1",
              "taxCodesPerYear{}[].effectiveDate"
            ]
          },
          {
            "key": "workMonday",
            "header": "Works Monday",
            "fields": [
              "workingDays.standardWorkingDays.monday"
            ]
          },
          {
            "key": "workTuesday",
            "header": "Works Tuesday",
            "fields": [
              "workingDays.standardWorkingDays.tuesday"
            ]
          },
          {
            "key": "workWednesday",
            "header": "Works Wednesday",
            "fields": [
              "workingDays.standardWorkingDays.wednesday"
            ]
          },
          {
            "key": "workThursday",
            "header": "Works Thursday",
            "fields": [
              "workingDays.standardWorkingDays.thursday"
            ]
          },
          {
            "key": "workFriday",
            "header": "Works Friday",
            "fields": [
              "workingDays.standardWorkingDays.friday"
            ]
          },
          {
            "key": "workSaturday",
            "header": "Works Saturday",
            "fields": [
              "workingDays.standardWorkingDays.saturday"
            ]
          },
          {
            "key": "workSunday",
            "header": "Works Sunday",
            "fields": [
              "workingDays.standardWorkingDays.sunday"
            ]
          },
          {
            "key": "ytdGross",
            "header": "YTD Gross",
            "fields": [
              "earningsToDatePerYear{}.gross",
              "openingBalance{}.gross"
            ]
          },
          {
            "key": "ytdTax",
            "header": "YTD Tax",
            "fields": [
              "earningsToDatePerYear{}.tax",
              "openingBalance{}.tax"
            ]
          },
          {
            "key": "ytdTaxable",
            "header": "YTD Taxable",
            "fields": [
              "earningsToDatePerYear{}.taxable",
              "openingBalance{}.taxable"
            ]
          },
          {
            "key": "ytdNi",
            "header": "YTD NI",
            "fields": [
              "earningsToDatePerYear{}.ni",
              "openingBalance{}.ni"
            ]
          },
          {
            "key": "ytdEmployerNi",
            "header": "YTD Employer NI",
            "fields": [
              "earningsToDatePerYear{}.employerNi",
              "openingBalance{}.employerNi"
            ]
          },
          {
            "key": "ytdStudentLoan",
            "header": "YTD Student Loan",
            "fields": [
              "earningsToDatePerYear{}.studentLoan",
              "openingBalance{}.studentLoan"
            ]
          },
          {
            "key": "ytdPostgraduateLoan",
            "header": "YTD Postgraduate Loan",
            "fields": [
              "earningsToDatePerYear{}.postgraduateLoan",
              "openingBalance{}.postgraduateLoan"
            ]
          },
          {
            "key": "leavingDate",
            "header": "Leaving Date",
            "fields": [
              "leaverDetails.leavingDate"
            ]
          },
          {
            "key": "leaverReason",
            "header": "Leaver Reason",
            "fields": [
              "leaverDetails.reason"
            ]
          },
          {
            "key": "leaverReportedToHmrc",
            "header": "Leaver Reported to HMRC",
            "fields": [
              "leaverDetails.reportedToHmrc"
            ]
          },
          {
            "key": "ytdGrossForEmployeeNi",
            "header": "YTD Gross for Employee NI",
            "fields": [
              "earningsToDatePerYear{}.grossForEmployeeNi",
              "openingBalance{}.grossForEmployeeNi"
            ]
          },
          {
            "key": "ytdGrossForEmployerNi",
            "header": "YTD Gross for Employer NI",
            "fields": [
              "earningsToDatePerYear{}.grossForEmployerNi",
              "openingBalance{}.grossForEmployerNi"
            ]
          },
          {
            "key": "ytdEmployerClass1ANi",
            "header": "YTD Employer Class 1A NI",
            "fields": [
              "earningsToDatePerYear{}.employerClass1ANi",
              "openingBalance{}.employerClass1ANi"
            ]
          },
          {
            "key": "ytdNet",
            "header": "YTD Net Pay",
            "fields": [
              "earningsToDatePerYear{}.net",
              "openingBalance{}.net"
            ]
          },
          {
            "key": "ytdTotalEmployerCost",
            "header": "YTD Cost to Employer",
            "fields": [
              "earningsToDatePerYear{}.totalEmployerCost",
              "openingBalance{}.totalEmployerCost"
            ]
          },
          {
            "key": "ytdPension",
            "header": "YTD Employee Pension",
            "fields": [
              "earningsToDatePerYear{}.pension",
              "openingBalance{}.pension"
            ]
          },
          {
            "key": "ytdEmployerPension",
            "header": "YTD Employer Pension",
            "fields": [
              "earningsToDatePerYear{}.employerPension",
              "openingBalance{}.employerPension"
            ]
          },
          {
            "key": "ytdGrossPensionable",
            "header": "YTD Pensionable Pay",
            "fields": [
              "earningsToDatePerYear{}.grossPensionable",
              "openingBalance{}.grossPensionable"
            ]
          },
          {
            "key": "niEarningsToLel",
            "header": "Earnings to LEL",
            "fields": [
              "earningsToDatePerYear{}.niBandResult{}.bandResults{}.grossInBand",
              "openingBalance{}.niBandResult{}.bandResults{}.grossInBand",
              "niDetails.categoriesPerYear{}[].category",
              "niDetails.categoriesPerYear{}[].effectiveDate"
            ]
          },
          {
            "key": "niEarningsLelToPt",
            "header": "Earnings LEL to PT",
            "fields": [
              "earningsToDatePerYear{}.niBandResult{}.bandResults{}.grossInBand",
              "openingBalance{}.niBandResult{}.bandResults{}.grossInBand",
              "niDetails.categoriesPerYear{}[].category",
              "niDetails.categoriesPerYear{}[].effectiveDate"
            ]
          },
          {
            "key": "niEarningsPtToFust",
            "header": "Earnings PT to FUST",
            "fields": [
              "earningsToDatePerYear{}.niBandResult{}.bandResults{}.grossInBand",
              "openingBalance{}.niBandResult{}.bandResults{}.grossInBand",
              "niDetails.categoriesPerYear{}[].category",
              "niDetails.categoriesPerYear{}[].effectiveDate"
            ]
          },
          {
            "key": "niEarningsFustToUel",
            "header": "Earnings FUST to UEL",
            "fields": [
              "earningsToDatePerYear{}.niBandResult{}.bandResults{}.grossInBand",
              "openingBalance{}.niBandResult{}.bandResults{}.grossInBand",
              "niDetails.categoriesPerYear{}[].category",
              "niDetails.categoriesPerYear{}[].effectiveDate"
            ]
          },
          {
            "key": "niEarningsPtToUel",
            "header": "Earnings PT to UEL",
            "fields": []
          },
          {
            "key": "ytdSSP",
            "header": "YTD Statutory Sick Pay",
            "fields": [
              "earningsToDatePerYear{}.statutory{}",
              "openingBalance{}.statutory{}"
            ]
          },
          {
            "key": "ytdSMP",
            "header": "YTD Statutory Maternity Pay",
            "fields": [
              "earningsToDatePerYear{}.statutory{}",
              "openingBalance{}.statutory{}"
            ]
          },
          {
            "key": "ytdSPP",
            "header": "YTD Statutory Paternity Pay",
            "fields": [
              "earningsToDatePerYear{}.statutory{}",
              "openingBalance{}.statutory{}"
            ]
          },
          {
            "key": "ytdSAP",
            "header": "YTD Statutory Adoption Pay",
            "fields": [
              "earningsToDatePerYear{}.statutory{}",
              "openingBalance{}.statutory{}"
            ]
          },
          {
            "key": "ytdShPP",
            "header": "YTD Shared Parental Pay",
            "fields": [
              "earningsToDatePerYear{}.statutory{}",
              "openingBalance{}.statutory{}"
            ]
          },
          {
            "key": "ytdSPBP",
            "header": "YTD Statutory Parental Bereavement Pay",
            "fields": [
              "earningsToDatePerYear{}.statutory{}",
              "openingBalance{}.statutory{}"
            ]
          },
          {
            "key": "ytdSNCP",
            "header": "YTD Statutory Neonatal Care Pay",
            "fields": [
              "earningsToDatePerYear{}.statutory{}",
              "openingBalance{}.statutory{}"
            ]
          },
          {
            "key": "niEmployeeNi",
            "header": "NI Employee NI",
            "fields": [
              "earningsToDatePerYear{}.niBandResult{}.employeeNi",
              "openingBalance{}.niBandResult{}.employeeNi",
              "niDetails.categoriesPerYear{}[].category",
              "niDetails.categoriesPerYear{}[].effectiveDate"
            ]
          },
          {
            "key": "niEmployerNi",
            "header": "NI Employer NI",
            "fields": [
              "earningsToDatePerYear{}.niBandResult{}.employerNi",
              "openingBalance{}.niBandResult{}.employerNi",
              "niDetails.categoriesPerYear{}[].category",
              "niDetails.categoriesPerYear{}[].effectiveDate"
            ]
          },
          {
            "key": "niTotalNi",
            "header": "NI Total NI",
            "fields": [
              "earningsToDatePerYear{}.niBandResult{}.totalNi",
              "openingBalance{}.niBandResult{}.totalNi",
              "niDetails.categoriesPerYear{}[].category",
              "niDetails.categoriesPerYear{}[].effectiveDate"
            ]
          },
          {
            "key": "niGrossForEmployeeNi",
            "header": "NI Gross for Employee NI",
            "fields": [
              "earningsToDatePerYear{}.niBandResult{}.grossForEmployeeNi",
              "openingBalance{}.niBandResult{}.grossForEmployeeNi",
              "niDetails.categoriesPerYear{}[].category",
              "niDetails.categoriesPerYear{}[].effectiveDate"
            ]
          },
          {
            "key": "niGrossForEmployerNi",
            "header": "NI Gross for Employer NI",
            "fields": [
              "earningsToDatePerYear{}.niBandResult{}.grossForEmployerNi",
              "openingBalance{}.niBandResult{}.grossForEmployerNi",
              "niDetails.categoriesPerYear{}[].category",
              "niDetails.categoriesPerYear{}[].effectiveDate"
            ]
          },
          {
            "key": "directorYtdGrossForEmployeeNi",
            "header": "Director YTD Gross for Employee NI",
            "fields": [
              "directorEarningsToDatePerYear{}.grossForEmployeeNi",
              "openingBalanceDirector{}.grossForEmployeeNi"
            ]
          },
          {
            "key": "directorYtdGrossForEmployerNi",
            "header": "Director YTD Gross for Employer NI",
            "fields": [
              "directorEarningsToDatePerYear{}.grossForEmployerNi",
              "openingBalanceDirector{}.grossForEmployerNi"
            ]
          },
          {
            "key": "directorYtdNi",
            "header": "Director YTD Employee NI",
            "fields": [
              "directorEarningsToDatePerYear{}.ni",
              "openingBalanceDirector{}.ni"
            ]
          },
          {
            "key": "directorYtdEmployerNi",
            "header": "Director YTD Employer NI",
            "fields": [
              "directorEarningsToDatePerYear{}.employerNi",
              "openingBalanceDirector{}.employerNi"
            ]
          }
        ],
        "x-employee-file-tag-columns": {
          "key": "tags",
          "prefix": "Tag: ",
          "separator": " / "
        }
      }
    },
    "/v1/employees/imports/{importId}": {
      "get": {
        "tags": [
          "Pay API · Employees"
        ],
        "summary": "Get one of your employee imports",
        "description": "Needs permission employee:read.\n\nIts preview once `Ready`: what each row changes, from and to, and the rows and columns that cannot be applied, with why. After applying, how every row went.",
        "operationId": "Pay_GetEmployeeImport",
        "x-flow-permission": "employee:read",
        "parameters": [
          {
            "name": "importId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The import."
          },
          {
            "name": "filter",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Which rows to list: `All` (default), `Failed` (could not be saved), `Problems` (cannot be applied as they are) or `Changes`."
          },
          {
            "name": "offset",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int32"
            },
            "description": "Where the page of rows starts, for files with more than 1,000 to list (`rowsTruncated`)."
          },
          {
            "$ref": "#/components/parameters/Pay_Request-Id"
          }
        ],
        "responses": {
          "200": {
            "description": "Import found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Pay_ResponseBody"
                    },
                    {
                      "properties": {
                        "content": {
                          "type": "object",
                          "properties": {
                            "data": {
                              "$ref": "#/components/schemas/Pay_EmployeeImportDto"
                            }
                          }
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "filter or offset is not valid",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "404": {
            "description": "No such import of yours",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "500": {
            "description": "An internal server error occurred",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          }
        },
        "x-mint": {
          "mcp": {
            "enabled": true
          }
        }
      }
    },
    "/v1/employees/imports/{importId}/apply": {
      "post": {
        "tags": [
          "Pay API · Employees"
        ],
        "summary": "Apply one of your employee imports",
        "description": "Needs permission employee:write, or any of employee-payroll:write, employee-payroll-id:write, employee-pay-schedule:write, working-pattern:write.\n\nSaves the previewed changes in the background, one employee at a time, each decided as `PATCH /employees/{employeeId}` decides it for you: a change your role cannot make, or that fails validation, is reported on its row and the rest go ahead. Only a `Ready` import can be applied, once.",
        "operationId": "Pay_ApplyEmployeeImport",
        "x-flow-permission": "employee:write",
        "parameters": [
          {
            "name": "importId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The import."
          },
          {
            "$ref": "#/components/parameters/Pay_Request-Id"
          }
        ],
        "x-flow-permission-also-accepts": [
          "employee-payroll:write",
          "employee-payroll-id:write",
          "employee-pay-schedule:write",
          "working-pattern:write"
        ],
        "responses": {
          "202": {
            "description": "Applying. `Location` is the import and `progress` says how far it has got; `employeeImportChanged` arrives over the websocket as it moves.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Pay_ResponseBody"
                    },
                    {
                      "properties": {
                        "content": {
                          "type": "object",
                          "properties": {
                            "data": {
                              "$ref": "#/components/schemas/Pay_EmployeeImportDto"
                            }
                          }
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "The import is not ready, or has already been applied",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "404": {
            "description": "No such import of yours",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "500": {
            "description": "An internal server error occurred",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          }
        }
      }
    },
    "/v1/employees/leaver/bulk": {
      "put": {
        "tags": [
          "Pay API · Starters & leavers"
        ],
        "summary": "Set leaver details for many employees in one call",
        "description": "Needs permission employee:write.\n\nMarks each listed employee as a leaver in one request. The `defaults` block applies to every entry; any entry may override any field (`leavingDate`, `reason`, `issuedBy`) for that employee. Each successful entry is processed exactly as a single `PUT /employees/{employeeId}/leaver` call would be, so the outcome for an employee does not depend on whether you send one employee or many. The response always returns 200 with a structured envelope of succeeded and failed identifiers.",
        "operationId": "Pay_SetLeaverDetailsBulk",
        "x-flow-permission": "employee:write",
        "parameters": [
          {
            "$ref": "#/components/parameters/Pay_Request-Id"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Pay_BulkSetLeaverDetailsDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Bulk set completed; inspect succeeded/failed",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Pay_ResponseBody"
                    },
                    {
                      "properties": {
                        "content": {
                          "type": "object",
                          "properties": {
                            "data": {
                              "$ref": "#/components/schemas/Pay_BulkSetLeaverDetailsResultDto"
                            }
                          }
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request body, missing defaults.leavingDate, or empty entries list",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "500": {
            "description": "An internal server error occurred",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "Pay API · Starters & leavers"
        ],
        "summary": "Cancel leaver details for many employees in one call",
        "description": "Needs permission employee:write.\n\nClears the leaver status for each employee in the request body. The response always returns 200 with a structured envelope of succeeded and failed identifiers so callers can render a partial-results UI. Employees whose leaver has already been reported to HMRC via an FPS submission land in `failed` with reason `leaver_reported_to_hmrc`. Unknown employee ids land in `failed` with reason `not_found`. Employees with no leaver_details are no-ops and counted as succeeded.",
        "operationId": "Pay_CancelLeaverDetailsBulk",
        "x-flow-permission": "employee:write",
        "parameters": [
          {
            "$ref": "#/components/parameters/Pay_Request-Id"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Pay_BulkCancelLeaverDetailsDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Bulk cancel completed; inspect succeeded/failed",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Pay_ResponseBody"
                    },
                    {
                      "properties": {
                        "content": {
                          "type": "object",
                          "properties": {
                            "data": {
                              "$ref": "#/components/schemas/Pay_BulkCancelLeaverDetailsResultDto"
                            }
                          }
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request body or empty employeeIds list",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "500": {
            "description": "An internal server error occurred",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          }
        }
      }
    },
    "/v1/employees/search": {
      "post": {
        "tags": [
          "Pay API · Employees"
        ],
        "summary": "Search the organisation's employees on any field",
        "description": "Needs permission employee:read.\n\nFilters on any employee field (every operator a field's type allows; tags and other repeated fields match any or all values), dated values such as the tax code and NI category as on `asAt`, sorting, the fields to answer, and paging with how many match in all, so a list can say \"50 of 6,000\". Fields your role cannot read are neither answered nor matched. `GET /employee-fields` lists every field you can filter on. To see your own change straight after a write, send the employee and the `updatedDate` your write returned in `consistentWith`.",
        "operationId": "Pay_SearchEmployees",
        "x-flow-permission": "employee:read",
        "parameters": [
          {
            "$ref": "#/components/parameters/Pay_Request-Id"
          }
        ],
        "requestBody": {
          "description": "What to match, sort and answer; an empty body lists every employee",
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Pay_EmployeeSearchRequestDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Employees found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Pay_ResponseBody"
                    },
                    {
                      "properties": {
                        "content": {
                          "type": "object",
                          "properties": {
                            "data": {
                              "$ref": "#/components/schemas/Pay_EmployeeSearchResultDto"
                            }
                          }
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "The search cannot be answered as sent; the message says why",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "500": {
            "description": "An internal server error occurred",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "503": {
            "description": "The search could not catch up with your own write; retry after the Retry-After seconds",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          }
        }
      }
    },
    "/v1/employees/{employeeId}": {
      "get": {
        "tags": [
          "Pay API · Employees"
        ],
        "summary": "Get employee data",
        "description": "Needs permission employee:read.",
        "operationId": "Pay_GetEmployee",
        "x-flow-permission": "employee:read",
        "parameters": [
          {
            "name": "employeeId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/Pay_Request-Id"
          }
        ],
        "responses": {
          "200": {
            "description": "Employee Found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Pay_ResponseBody"
                    },
                    {
                      "properties": {
                        "content": {
                          "type": "object",
                          "properties": {
                            "data": {
                              "$ref": "#/components/schemas/Pay_EmployeeDto"
                            }
                          }
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "404": {
            "description": "Employee not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          }
        },
        "x-mint": {
          "mcp": {
            "enabled": true
          }
        }
      },
      "put": {
        "tags": [
          "Pay API · Employees"
        ],
        "summary": "Update an existing employee",
        "description": "Needs permission employee:write, or any of employee-payroll:write, employee-payroll-id:write, employee-pay-schedule:write, working-pattern:write.\n\nChanging an existing employee needs `employee:write` (or `employee-payroll:write` / `working-pattern:write` for those fields alone). Adding a new employee needs `employee:write` and `employee-payroll:write`, on `POST /employees`.",
        "operationId": "Pay_PutEmployee",
        "x-flow-permission": "employee:write",
        "parameters": [
          {
            "name": "employeeId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/Pay_Request-Id"
          }
        ],
        "x-flow-permission-also-accepts": [
          "employee-payroll:write",
          "employee-payroll-id:write",
          "employee-pay-schedule:write",
          "working-pattern:write"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Pay_UpdatableEmployeeDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Employee Updated",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Pay_ResponseBody"
                    },
                    {
                      "properties": {
                        "content": {
                          "type": "object",
                          "properties": {
                            "data": {
                              "$ref": "#/components/schemas/Pay_EmployeeDto"
                            }
                          }
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid employee data",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "404": {
            "description": "Employee not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          }
        }
      },
      "patch": {
        "tags": [
          "Pay API · Employees"
        ],
        "summary": "Partially update an existing employee",
        "description": "Needs permission employee:write, or any of employee-payroll:write, employee-payroll-id:write, employee-pay-schedule:write, working-pattern:write.\n\nApplies a JSON Merge Patch (RFC 7396) to the employee. Send only the fields you want to change - absent fields keep their current value, present fields are applied, and an explicit null clears an optional field. Accepts the same fields as PUT. Fields managed by dedicated endpoints (starterDetails, leaverDetails, payrollId, payrollConfigId, opening balances) are rejected with a 400. Nested objects merge recursively; arrays replace wholesale. The fields required on an employee (name, email, birthGender, birthDate, hoursWorkedCategory) cannot be cleared.",
        "operationId": "Pay_PatchEmployee",
        "x-flow-permission": "employee:write",
        "parameters": [
          {
            "name": "employeeId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/Pay_Request-Id"
          }
        ],
        "x-flow-permission-also-accepts": [
          "employee-payroll:write",
          "employee-payroll-id:write",
          "employee-pay-schedule:write",
          "working-pattern:write"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Pay_PatchEmployeeDto"
              }
            },
            "application/merge-patch+json": {
              "schema": {
                "$ref": "#/components/schemas/Pay_PatchEmployeeDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Employee Updated",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Pay_ResponseBody"
                    },
                    {
                      "properties": {
                        "content": {
                          "type": "object",
                          "properties": {
                            "data": {
                              "$ref": "#/components/schemas/Pay_EmployeeDto"
                            }
                          }
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid employee data, a field that cannot be patched, or an attempt to clear a required field",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "404": {
            "description": "Employee not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "Pay API · Employees"
        ],
        "summary": "Delete an existing employee",
        "description": "Needs permission employee:delete.\n\nPermanently deletes an employee who has never been paid. Their preview payslips are deleted and they are removed from every open pay run they were on, so each run's employee count goes down by one.\n\nAn employee with a final payslip cannot be deleted, because that payslip has been paid and reported to HMRC. The request fails with `409` and the token `deleteEmployeeHasFinalPayslips`, and nothing is changed. To stop paying someone who has already been paid, record them as a leaver instead.",
        "operationId": "Pay_DeleteEmployee",
        "x-flow-permission": "employee:delete",
        "parameters": [
          {
            "name": "employeeId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/Pay_Request-Id"
          }
        ],
        "responses": {
          "200": {
            "description": "Employee deleted, along with their preview payslips",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Pay_ResponseBody"
                    },
                    {
                      "properties": {
                        "content": {
                          "type": "object",
                          "properties": {
                            "data": {
                              "$ref": "#/components/schemas/Pay_EmployeeDto"
                            }
                          }
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "404": {
            "description": "Employee not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "409": {
            "description": "The employee has final payslips and cannot be deleted",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "500": {
            "description": "An error occurred",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          }
        }
      }
    },
    "/v1/employees/{employeeId}/effective-tax-info": {
      "get": {
        "tags": [
          "Pay API · Tax codes"
        ],
        "summary": "Get the effective tax code and NI category for an employee on a specific date",
        "description": "Needs permission employee-payroll:read.",
        "operationId": "Pay_GetEffectiveTaxInfo",
        "x-flow-permission": "employee-payroll:read",
        "parameters": [
          {
            "name": "employeeId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The ID of the employee"
          },
          {
            "name": "date",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date"
            },
            "description": "The date to get effective tax info for (YYYY-MM-DD). Defaults to today if not provided."
          },
          {
            "$ref": "#/components/parameters/Pay_Request-Id"
          }
        ],
        "responses": {
          "200": {
            "description": "Effective tax info retrieved successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Pay_ResponseBody"
                    },
                    {
                      "properties": {
                        "content": {
                          "type": "object",
                          "properties": {
                            "data": {
                              "$ref": "#/components/schemas/Pay_EffectiveTaxInfoDto"
                            }
                          }
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid date format",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "404": {
            "description": "Employee not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "500": {
            "description": "An internal server error occurred",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          }
        },
        "x-mint": {
          "mcp": {
            "enabled": true
          }
        }
      }
    },
    "/v1/employees/{employeeId}/leaver": {
      "put": {
        "tags": [
          "Pay API · Starters & leavers"
        ],
        "summary": "Update the leaver details for a specific employee",
        "description": "Needs permission employee:write.",
        "operationId": "Pay_UpdateLeaverDetails",
        "x-flow-permission": "employee:write",
        "parameters": [
          {
            "name": "employeeId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The ID of the employee whose leaver details are to be updated"
          },
          {
            "$ref": "#/components/parameters/Pay_Request-Id"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Pay_EmployeeLeaverDetailsDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Employee leaver details were successfully updated",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Pay_ResponseBody"
                    },
                    {
                      "properties": {
                        "content": {
                          "type": "object",
                          "properties": {
                            "data": {
                              "$ref": "#/components/schemas/Pay_EmployeeDto"
                            }
                          }
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request body",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "404": {
            "description": "Employee not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "500": {
            "description": "An internal server error occurred",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "Pay API · Starters & leavers"
        ],
        "summary": "Cancel (clear) the leaver details for a specific employee",
        "description": "Needs permission employee:write.\n\nClears the leaver status. Refused with 409 when the leaver has already been reported to HMRC via FPS — at that point the canonical record is on HMRC's side and the only valid undo is a correction in the next FPS submission.",
        "operationId": "Pay_CancelLeaverDetails",
        "x-flow-permission": "employee:write",
        "parameters": [
          {
            "name": "employeeId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The ID of the employee whose leaver status should be cleared"
          },
          {
            "$ref": "#/components/parameters/Pay_Request-Id"
          }
        ],
        "responses": {
          "200": {
            "description": "Leaver status was cleared",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Pay_ResponseBody"
                    },
                    {
                      "properties": {
                        "content": {
                          "type": "object",
                          "properties": {
                            "data": {
                              "$ref": "#/components/schemas/Pay_EmployeeDto"
                            }
                          }
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "404": {
            "description": "Employee not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "409": {
            "description": "Leaver has already been reported to HMRC via FPS and cannot be cancelled",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "500": {
            "description": "An internal server error occurred",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          }
        }
      }
    },
    "/v1/employees/{employeeId}/ni-categories": {
      "get": {
        "tags": [
          "Pay API · NI & identifiers"
        ],
        "summary": "Get all NI categories for an employee",
        "description": "Needs permission employee-payroll:read.",
        "operationId": "Pay_GetNiCategories",
        "x-flow-permission": "employee-payroll:read",
        "parameters": [
          {
            "name": "employeeId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The ID of the employee"
          },
          {
            "$ref": "#/components/parameters/Pay_Request-Id"
          }
        ],
        "responses": {
          "200": {
            "description": "NI categories retrieved successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Pay_ResponseBody"
                    },
                    {
                      "properties": {
                        "content": {
                          "type": "object",
                          "properties": {
                            "data": {
                              "$ref": "#/components/schemas/Pay_EmployeeNiCategoriesResponseDto"
                            }
                          }
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "404": {
            "description": "Employee not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "500": {
            "description": "An internal server error occurred",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          }
        },
        "x-mint": {
          "mcp": {
            "enabled": true
          }
        }
      }
    },
    "/v1/employees/{employeeId}/ni-categories/{year}/{effectiveDate}": {
      "delete": {
        "tags": [
          "Pay API · NI & identifiers"
        ],
        "summary": "Delete a specific NI category for an employee",
        "description": "Needs permission employee-payroll:write.",
        "operationId": "Pay_DeleteNiCategory",
        "x-flow-permission": "employee-payroll:write",
        "parameters": [
          {
            "name": "employeeId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The ID of the employee"
          },
          {
            "name": "year",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            },
            "description": "The tax year"
          },
          {
            "name": "effectiveDate",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "date"
            },
            "description": "The effective date of the NI category to delete (YYYY-MM-DD)"
          },
          {
            "$ref": "#/components/parameters/Pay_Request-Id"
          }
        ],
        "responses": {
          "200": {
            "description": "NI category deleted successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Pay_ResponseBody"
                    },
                    {
                      "properties": {
                        "content": {
                          "type": "object",
                          "properties": {
                            "data": {
                              "$ref": "#/components/schemas/Pay_EmployeeDto"
                            }
                          }
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request data",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "404": {
            "description": "Employee or NI category not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "500": {
            "description": "An internal server error occurred",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          }
        }
      }
    },
    "/v1/employees/{employeeId}/ni-category": {
      "post": {
        "tags": [
          "Pay API · NI & identifiers"
        ],
        "summary": "Add or update an NI category for an employee",
        "description": "Needs permission employee-payroll:write.",
        "operationId": "Pay_PostNiCategory",
        "x-flow-permission": "employee-payroll:write",
        "parameters": [
          {
            "name": "employeeId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The ID of the employee"
          },
          {
            "$ref": "#/components/parameters/Pay_Request-Id"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Pay_EmployeeNiCategoryDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "NI category updated successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Pay_ResponseBody"
                    },
                    {
                      "properties": {
                        "content": {
                          "type": "object",
                          "properties": {
                            "data": {
                              "$ref": "#/components/schemas/Pay_EmployeeDto"
                            }
                          }
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request data",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "404": {
            "description": "Employee not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "500": {
            "description": "An internal server error occurred",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          }
        }
      }
    },
    "/v1/employees/{employeeId}/nino": {
      "put": {
        "tags": [
          "Pay API · NI & identifiers"
        ],
        "summary": "Update an employee's National Insurance Number",
        "description": "Needs permission employee-payroll:write.",
        "operationId": "Pay_PutNino",
        "x-flow-permission": "employee-payroll:write",
        "parameters": [
          {
            "name": "employeeId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The ID of the employee"
          },
          {
            "$ref": "#/components/parameters/Pay_Request-Id"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Pay_EmployeeNinoDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "NINO updated successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Pay_ResponseBody"
                    },
                    {
                      "properties": {
                        "content": {
                          "type": "object",
                          "properties": {
                            "data": {
                              "$ref": "#/components/schemas/Pay_EmployeeDto"
                            }
                          }
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request data",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "404": {
            "description": "Employee not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "500": {
            "description": "An internal server error occurred",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          }
        }
      }
    },
    "/v1/employees/{employeeId}/opening-balance": {
      "put": {
        "tags": [
          "Pay API · Payroll setup"
        ],
        "summary": "Update the opening balance for a specific employee",
        "description": "Needs permission employee-payroll:write.\n\nSets the opening balance for this employment (e.g., when migrating from a different payroll system). Locked after any payslip has been finalized for the employee.",
        "operationId": "Pay_UpdateOpeningBalance",
        "x-flow-permission": "employee-payroll:write",
        "parameters": [
          {
            "name": "employeeId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The ID of the employee whose opening balance is to be updated"
          },
          {
            "$ref": "#/components/parameters/Pay_Request-Id"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Pay_UpdateOpeningBalanceDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Employee opening balance was successfully updated",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Pay_ResponseBody"
                    },
                    {
                      "properties": {
                        "content": {
                          "type": "object",
                          "properties": {
                            "data": {
                              "$ref": "#/components/schemas/Pay_EmployeeDto"
                            }
                          }
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request body or opening balance is locked (finalized payslips exist)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "404": {
            "description": "Employee not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "500": {
            "description": "An internal server error occurred",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          }
        }
      }
    },
    "/v1/employees/{employeeId}/payroll-config": {
      "put": {
        "tags": [
          "Pay API · Payroll setup"
        ],
        "summary": "Update an employee's payroll config assignment",
        "description": "Needs permission employee-pay-schedule:write.\n\nUpdates the employee's payroll config. Removes the employee from open payroll runs of the old config, deletes all preview payslips, adds the employee to open runs of the new config, and pre-processes payslips for the new periods.",
        "operationId": "Pay_PutPayrollConfig",
        "x-flow-permission": "employee-pay-schedule:write",
        "parameters": [
          {
            "name": "employeeId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The ID of the employee"
          },
          {
            "$ref": "#/components/parameters/Pay_Request-Id"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Pay_EmployeePayrollConfigUpdateDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Payroll config updated successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Pay_ResponseBody"
                    },
                    {
                      "properties": {
                        "content": {
                          "type": "object",
                          "properties": {
                            "data": {
                              "$ref": "#/components/schemas/Pay_EmployeeDto"
                            }
                          }
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request data or validation errors (e.g. payroll config not found)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "404": {
            "description": "Employee not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "500": {
            "description": "An internal server error occurred",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          }
        }
      }
    },
    "/v1/employees/{employeeId}/payroll-id": {
      "put": {
        "tags": [
          "Pay API · NI & identifiers"
        ],
        "summary": "Update an employee's Payroll ID",
        "description": "Needs permission employee-payroll-id:write.\n\nUpdates the employee's Payroll ID (payId field used in HMRC FPS submissions). The previous Payroll ID is automatically saved for HMRC reporting purposes.",
        "operationId": "Pay_PutPayrollId",
        "x-flow-permission": "employee-payroll-id:write",
        "parameters": [
          {
            "name": "employeeId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The ID of the employee"
          },
          {
            "$ref": "#/components/parameters/Pay_Request-Id"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Pay_EmployeePayrollIdUpdateDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Payroll ID updated successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Pay_ResponseBody"
                    },
                    {
                      "properties": {
                        "content": {
                          "type": "object",
                          "properties": {
                            "data": {
                              "$ref": "#/components/schemas/Pay_EmployeeDto"
                            }
                          }
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request data",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "404": {
            "description": "Employee not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "500": {
            "description": "An internal server error occurred",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          }
        }
      }
    },
    "/v1/employees/{employeeId}/postgraduate-loan/end": {
      "post": {
        "tags": [
          "Pay API · Student loans"
        ],
        "summary": "End a postgraduate loan for an employee",
        "description": "Needs permission employee-payroll:write.",
        "operationId": "Pay_PostPostgraduateLoanEnd",
        "x-flow-permission": "employee-payroll:write",
        "parameters": [
          {
            "name": "employeeId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The ID of the employee"
          },
          {
            "$ref": "#/components/parameters/Pay_Request-Id"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Pay_EmployeePostgraduateLoanEndDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Postgraduate loan ended successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Pay_ResponseBody"
                    },
                    {
                      "properties": {
                        "content": {
                          "type": "object",
                          "properties": {
                            "data": {
                              "$ref": "#/components/schemas/Pay_EmployeeDto"
                            }
                          }
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request data or no active postgraduate loan found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "404": {
            "description": "Employee not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "500": {
            "description": "An internal server error occurred",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          }
        }
      }
    },
    "/v1/employees/{employeeId}/postgraduate-loan/start": {
      "post": {
        "tags": [
          "Pay API · Student loans"
        ],
        "summary": "Start a postgraduate loan for an employee",
        "description": "Needs permission employee-payroll:write.",
        "operationId": "Pay_PostPostgraduateLoanStart",
        "x-flow-permission": "employee-payroll:write",
        "parameters": [
          {
            "name": "employeeId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The ID of the employee"
          },
          {
            "$ref": "#/components/parameters/Pay_Request-Id"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Pay_EmployeePostgraduateLoanStartDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Postgraduate loan started successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Pay_ResponseBody"
                    },
                    {
                      "properties": {
                        "content": {
                          "type": "object",
                          "properties": {
                            "data": {
                              "$ref": "#/components/schemas/Pay_EmployeeDto"
                            }
                          }
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request data",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "404": {
            "description": "Employee not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "500": {
            "description": "An internal server error occurred",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          }
        }
      }
    },
    "/v1/employees/{employeeId}/qualifying-day-policy": {
      "get": {
        "tags": [
          "Pay API · Working patterns"
        ],
        "summary": "Get the effective-dated SSP qualifying-day policy history",
        "description": "Needs permission employee-payroll:read.\n\nReturns every version of the employee's SSP qualifying-day policy, oldest first, resolved by effectiveFrom exactly as the working pattern is. Qualifying days are the days statutory sick pay can be paid for; they are kept separate from the working pattern because HMRC treats them as agreed between employer and employee rather than simply derived from the days worked.",
        "operationId": "Pay_GetQualifyingDayPolicy",
        "x-flow-permission": "employee-payroll:read",
        "parameters": [
          {
            "name": "employeeId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The ID of the employee"
          },
          {
            "$ref": "#/components/parameters/Pay_Request-Id"
          }
        ],
        "responses": {
          "200": {
            "description": "Qualifying day policy retrieved successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Pay_ResponseBody"
                    },
                    {
                      "properties": {
                        "content": {
                          "type": "object",
                          "properties": {
                            "data": {
                              "$ref": "#/components/schemas/Pay_EmployeeQualifyingDayPolicyHistoryResponseDto"
                            }
                          }
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "404": {
            "description": "Employee not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "500": {
            "description": "An internal server error occurred",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          }
        },
        "x-mint": {
          "mcp": {
            "enabled": true
          }
        }
      },
      "put": {
        "tags": [
          "Pay API · Working patterns"
        ],
        "summary": "Set the employee's SSP qualifying-day policy from an effective date",
        "description": "Needs permission employee-payroll:write.\n\nAdds a qualifying-day policy version effective from the given date; re-sending the same effectiveFrom replaces that version. mode chooses how qualifying days are decided: \"DeriveFromPattern\" uses the employee's working days, \"AgreedFixedDays\" uses the agreedQualifyingDays you supply, and \"WednesdayDefault\" is the statutory fallback where nothing was agreed. agreedQualifyingDays is required when mode is \"AgreedFixedDays\" and must select at least one day, because every week needs at least one qualifying day.",
        "operationId": "Pay_PutQualifyingDayPolicy",
        "x-flow-permission": "employee-payroll:write",
        "parameters": [
          {
            "name": "employeeId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The ID of the employee"
          },
          {
            "$ref": "#/components/parameters/Pay_Request-Id"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Pay_UpsertEmployeeQualifyingDayPolicyRequestDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Qualifying day policy saved successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Pay_ResponseBody"
                    },
                    {
                      "properties": {
                        "content": {
                          "type": "object",
                          "properties": {
                            "data": {
                              "$ref": "#/components/schemas/Pay_EmployeeQualifyingDayPolicyHistoryResponseDto"
                            }
                          }
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request data",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "404": {
            "description": "Employee not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "500": {
            "description": "An internal server error occurred",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "Pay API · Working patterns"
        ],
        "summary": "Remove an employee's whole qualifying-day policy history",
        "description": "Needs permission employee-payroll:write.\n\nRemoves every qualifying-day policy version the employee has, in one write, returning them to the inherited policy: the payroll-config default, then the organisation default, then qualifying days derived from the working pattern. Succeeds when there is nothing to remove.",
        "operationId": "Pay_DeleteAllQualifyingDayPolicies",
        "x-flow-permission": "employee-payroll:write",
        "parameters": [
          {
            "name": "employeeId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The ID of the employee"
          },
          {
            "$ref": "#/components/parameters/Pay_Request-Id"
          }
        ],
        "responses": {
          "200": {
            "description": "Qualifying-day policy history removed",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Pay_ResponseBody"
                    },
                    {
                      "properties": {
                        "content": {
                          "type": "object",
                          "properties": {
                            "data": {
                              "$ref": "#/components/schemas/Pay_EmployeeQualifyingDayPolicyHistoryResponseDto"
                            }
                          }
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "404": {
            "description": "Employee not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "500": {
            "description": "An internal server error occurred",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          }
        }
      }
    },
    "/v1/employees/{employeeId}/qualifying-day-policy/{effectiveFrom}": {
      "delete": {
        "tags": [
          "Pay API · Working patterns"
        ],
        "summary": "Remove an SSP qualifying-day policy version from an employee",
        "description": "Needs permission employee-payroll:write.\n\nRemoves the qualifying-day policy version taking effect on the given date. Removing every version returns the employee to the inherited policy: the payroll-config default, then the organisation default, then qualifying days derived from the working pattern. Responds with the remaining history.",
        "operationId": "Pay_DeleteQualifyingDayPolicy",
        "x-flow-permission": "employee-payroll:write",
        "parameters": [
          {
            "name": "employeeId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The ID of the employee"
          },
          {
            "name": "effectiveFrom",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "date"
            },
            "description": "The effective date of the version to remove (YYYY-MM-DD)"
          },
          {
            "$ref": "#/components/parameters/Pay_Request-Id"
          }
        ],
        "responses": {
          "200": {
            "description": "Qualifying-day policy version removed",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Pay_ResponseBody"
                    },
                    {
                      "properties": {
                        "content": {
                          "type": "object",
                          "properties": {
                            "data": {
                              "$ref": "#/components/schemas/Pay_EmployeeQualifyingDayPolicyHistoryResponseDto"
                            }
                          }
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid effective date",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "404": {
            "description": "Employee or qualifying-day policy version not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "500": {
            "description": "An internal server error occurred",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          }
        }
      }
    },
    "/v1/employees/{employeeId}/salary": {
      "get": {
        "tags": [
          "Pay API · Salary"
        ],
        "summary": "Get the effective-dated salary history for an employee",
        "description": "Needs permission employee:read.\n\nReturns every version of the employee's annual salary, oldest first, and the version in force today. The version in force on a day is the one with the latest effectiveFrom on or before it, which is how a pay run pays the old salary up to the day before a change and the new one from it.",
        "operationId": "Pay_GetSalary",
        "x-flow-permission": "employee:read",
        "parameters": [
          {
            "name": "employeeId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The ID of the employee"
          },
          {
            "$ref": "#/components/parameters/Pay_Request-Id"
          }
        ],
        "responses": {
          "200": {
            "description": "Salary history retrieved",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Pay_ResponseBody"
                    },
                    {
                      "properties": {
                        "content": {
                          "type": "object",
                          "properties": {
                            "data": {
                              "$ref": "#/components/schemas/Pay_EmployeeSalaryHistoryResponseDto"
                            }
                          }
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "404": {
            "description": "Employee not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "500": {
            "description": "An internal server error occurred",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          }
        },
        "x-mint": {
          "mcp": {
            "enabled": true
          }
        }
      },
      "put": {
        "tags": [
          "Pay API · Salary"
        ],
        "summary": "Set the employee's annual salary from an effective date",
        "description": "Needs permission employee:write.\n\nAdds a version of the employee's annual salary effective from the given date, leaving earlier versions in place so past periods still resolve the salary that applied then. Sending the same effectiveFrom again replaces that version rather than appending another, so retries and corrections are safe; to move a version to a different date, delete it and add the new one. An amount of 0 states that no salary is paid from that date. The version can also record the hours a week the salary is contracted for (contractedHoursPerWeek); they are kept with the version and do not change how the salary is pro-rated. Any open pay run the employee is on is recalculated, unless the save changes only the hours or the reason. Responds with the full history.",
        "operationId": "Pay_PutSalary",
        "x-flow-permission": "employee:write",
        "parameters": [
          {
            "name": "employeeId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The ID of the employee"
          },
          {
            "$ref": "#/components/parameters/Pay_Request-Id"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Pay_UpsertEmployeeSalaryRequestDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Salary saved",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Pay_ResponseBody"
                    },
                    {
                      "properties": {
                        "content": {
                          "type": "object",
                          "properties": {
                            "data": {
                              "$ref": "#/components/schemas/Pay_EmployeeSalaryHistoryResponseDto"
                            }
                          }
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request data",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "404": {
            "description": "Employee not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "500": {
            "description": "An internal server error occurred",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          }
        }
      }
    },
    "/v1/employees/{employeeId}/salary/{effectiveFrom}": {
      "delete": {
        "tags": [
          "Pay API · Salary"
        ],
        "summary": "Remove a salary version from an employee",
        "description": "Needs permission employee:write.\n\nRemoves the salary version taking effect on the given date; the version before it applies from then on. The last remaining version cannot be removed, because the employee's salary would go dark: set its amount to 0 instead. Any open pay run the employee is on is recalculated. Responds with the remaining history.",
        "operationId": "Pay_DeleteSalary",
        "x-flow-permission": "employee:write",
        "parameters": [
          {
            "name": "employeeId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The ID of the employee"
          },
          {
            "name": "effectiveFrom",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "date"
            },
            "description": "The effective date of the version to remove (YYYY-MM-DD)"
          },
          {
            "$ref": "#/components/parameters/Pay_Request-Id"
          }
        ],
        "responses": {
          "200": {
            "description": "Salary version removed",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Pay_ResponseBody"
                    },
                    {
                      "properties": {
                        "content": {
                          "type": "object",
                          "properties": {
                            "data": {
                              "$ref": "#/components/schemas/Pay_EmployeeSalaryHistoryResponseDto"
                            }
                          }
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid effective date, or this is the only salary version",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "404": {
            "description": "Employee or salary version not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "500": {
            "description": "An internal server error occurred",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          }
        }
      }
    },
    "/v1/employees/{employeeId}/starter": {
      "put": {
        "tags": [
          "Pay API · Starters & leavers"
        ],
        "summary": "Update the starter details for a specific employee",
        "description": "Needs permission employee:write, or any of employee-payroll:write, employee-payroll-id:write, employee-pay-schedule:write, working-pattern:write.\n\nThe start date and starter declaration go to HMRC on the first FPS that includes the employee, and\n`alreadySentToHmrcFps` records that they have been sent: while it is false the next FPS sends them, and it\nbecomes true when HMRC accepts that FPS. The employer can change all three at any time. Changing the start date\nor declaration while it is true only updates the employee's record: HMRC does not get the change. Setting it to\nfalse sends the starter details again on the next FPS; setting it to true stops them being sent (for an\nemployee whose previous payroll already reported them).",
        "operationId": "Pay_UpdateStarterDetails",
        "x-flow-permission": "employee:write",
        "parameters": [
          {
            "name": "employeeId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The ID of the employee whose starter details are to be updated"
          },
          {
            "$ref": "#/components/parameters/Pay_Request-Id"
          }
        ],
        "x-flow-permission-also-accepts": [
          "employee-payroll:write",
          "employee-payroll-id:write",
          "employee-pay-schedule:write",
          "working-pattern:write"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Pay_EmployeeStarterDetailsDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Employee starter details were successfully updated",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Pay_ResponseBody"
                    },
                    {
                      "properties": {
                        "content": {
                          "type": "object",
                          "properties": {
                            "data": {
                              "$ref": "#/components/schemas/Pay_EmployeeDto"
                            }
                          }
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request body",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "404": {
            "description": "Employee not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "500": {
            "description": "An internal server error occurred",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          }
        }
      }
    },
    "/v1/employees/{employeeId}/student-loan/end": {
      "post": {
        "tags": [
          "Pay API · Student loans"
        ],
        "summary": "End a student loan for an employee",
        "description": "Needs permission employee-payroll:write.",
        "operationId": "Pay_PostStudentLoanEnd",
        "x-flow-permission": "employee-payroll:write",
        "parameters": [
          {
            "name": "employeeId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The ID of the employee"
          },
          {
            "$ref": "#/components/parameters/Pay_Request-Id"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Pay_EmployeeStudentLoanEndDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Student loan ended successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Pay_ResponseBody"
                    },
                    {
                      "properties": {
                        "content": {
                          "type": "object",
                          "properties": {
                            "data": {
                              "$ref": "#/components/schemas/Pay_EmployeeDto"
                            }
                          }
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request data or no active student loan found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "404": {
            "description": "Employee not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "500": {
            "description": "An internal server error occurred",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          }
        }
      }
    },
    "/v1/employees/{employeeId}/student-loan/start": {
      "post": {
        "tags": [
          "Pay API · Student loans"
        ],
        "summary": "Start a student loan for an employee",
        "description": "Needs permission employee-payroll:write.",
        "operationId": "Pay_PostStudentLoanStart",
        "x-flow-permission": "employee-payroll:write",
        "parameters": [
          {
            "name": "employeeId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The ID of the employee"
          },
          {
            "$ref": "#/components/parameters/Pay_Request-Id"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Pay_EmployeeStudentLoanStartDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Student loan started successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Pay_ResponseBody"
                    },
                    {
                      "properties": {
                        "content": {
                          "type": "object",
                          "properties": {
                            "data": {
                              "$ref": "#/components/schemas/Pay_EmployeeDto"
                            }
                          }
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request data",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "404": {
            "description": "Employee not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "500": {
            "description": "An internal server error occurred",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          }
        }
      }
    },
    "/v1/employees/{employeeId}/tax-code": {
      "post": {
        "tags": [
          "Pay API · Tax codes"
        ],
        "summary": "Add or update a tax code for an employee",
        "description": "Needs permission employee-payroll:write.",
        "operationId": "Pay_PostTaxCode",
        "x-flow-permission": "employee-payroll:write",
        "parameters": [
          {
            "name": "employeeId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The ID of the employee"
          },
          {
            "$ref": "#/components/parameters/Pay_Request-Id"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Pay_EmployeeTaxCodeDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Tax code updated successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Pay_ResponseBody"
                    },
                    {
                      "properties": {
                        "content": {
                          "type": "object",
                          "properties": {
                            "data": {
                              "$ref": "#/components/schemas/Pay_EmployeeDto"
                            }
                          }
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request data",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "404": {
            "description": "Employee not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "500": {
            "description": "An internal server error occurred",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          }
        }
      }
    },
    "/v1/employees/{employeeId}/tax-codes": {
      "get": {
        "tags": [
          "Pay API · Tax codes"
        ],
        "summary": "Get all tax codes for an employee",
        "description": "Needs permission employee-payroll:read.",
        "operationId": "Pay_GetTaxCodes",
        "x-flow-permission": "employee-payroll:read",
        "parameters": [
          {
            "name": "employeeId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The ID of the employee"
          },
          {
            "$ref": "#/components/parameters/Pay_Request-Id"
          }
        ],
        "responses": {
          "200": {
            "description": "Tax codes retrieved successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Pay_ResponseBody"
                    },
                    {
                      "properties": {
                        "content": {
                          "type": "object",
                          "properties": {
                            "data": {
                              "$ref": "#/components/schemas/Pay_EmployeeTaxCodesResponseDto"
                            }
                          }
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "404": {
            "description": "Employee not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "500": {
            "description": "An internal server error occurred",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          }
        },
        "x-mint": {
          "mcp": {
            "enabled": true
          }
        }
      }
    },
    "/v1/employees/{employeeId}/tax-codes/{year}/{effectiveDate}": {
      "delete": {
        "tags": [
          "Pay API · Tax codes"
        ],
        "summary": "Delete a specific tax code for an employee",
        "description": "Needs permission employee-payroll:write.",
        "operationId": "Pay_DeleteTaxCode",
        "x-flow-permission": "employee-payroll:write",
        "parameters": [
          {
            "name": "employeeId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The ID of the employee"
          },
          {
            "name": "year",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            },
            "description": "The tax year"
          },
          {
            "name": "effectiveDate",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "date"
            },
            "description": "The effective date of the tax code to delete (YYYY-MM-DD)"
          },
          {
            "$ref": "#/components/parameters/Pay_Request-Id"
          }
        ],
        "responses": {
          "200": {
            "description": "Tax code deleted successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Pay_ResponseBody"
                    },
                    {
                      "properties": {
                        "content": {
                          "type": "object",
                          "properties": {
                            "data": {
                              "$ref": "#/components/schemas/Pay_EmployeeDto"
                            }
                          }
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request data",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "404": {
            "description": "Employee or tax code not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "500": {
            "description": "An internal server error occurred",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          }
        }
      }
    },
    "/v1/employees/{employeeId}/working-pattern": {
      "get": {
        "tags": [
          "Pay API · Working patterns"
        ],
        "summary": "Get the effective-dated working-pattern history for an employee",
        "description": "Needs permission working-pattern:read.\n\nReturns every version of the employee's working pattern, oldest first. The version in force on a date is the one with the latest effectiveFrom on or before it, which is how statutory sick pay resolves the pattern for a past sickness rather than using today's. Employees created before working patterns were effective-dated have no stored versions; for them a single version is returned anchored at 1900-01-01, so callers never have to special-case them.",
        "operationId": "Pay_GetWorkingPattern",
        "x-flow-permission": "working-pattern:read",
        "parameters": [
          {
            "name": "employeeId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The ID of the employee"
          },
          {
            "$ref": "#/components/parameters/Pay_Request-Id"
          }
        ],
        "responses": {
          "200": {
            "description": "Working pattern retrieved successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Pay_ResponseBody"
                    },
                    {
                      "properties": {
                        "content": {
                          "type": "object",
                          "properties": {
                            "data": {
                              "$ref": "#/components/schemas/Pay_EmployeeWorkingPatternHistoryResponseDto"
                            }
                          }
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "404": {
            "description": "Employee not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "500": {
            "description": "An internal server error occurred",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          }
        },
        "x-mint": {
          "mcp": {
            "enabled": true
          }
        }
      },
      "put": {
        "tags": [
          "Pay API · Working patterns"
        ],
        "summary": "Set the employee's working pattern from an effective date",
        "description": "Needs permission working-pattern:write.\n\nAdds a version of the employee's working pattern effective from the given date, leaving earlier versions in place. Sending the same effectiveFrom again replaces that version rather than appending another, so retries and corrections are safe. The configuration must carry the sub-object matching its workingPattern: standardWorkingDays for \"Standard\", shiftPattern for \"Shift\", explicitSchedule for \"Explicit\". Setting a pattern here is what makes it the employee's own; without one they inherit the payroll-config default, then the organisation default, then Monday to Friday. An \"Explicit\" schedule dates its own weeks, so each week it lists is also written into the earlier explicit versions covering those days, and one replacing a pattern that is not explicit takes effect from the first week it lists. A week left out is not removed from earlier versions, and a later-dated version keeps its own weeks.",
        "operationId": "Pay_PutWorkingPattern",
        "x-flow-permission": "working-pattern:write",
        "parameters": [
          {
            "name": "employeeId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The ID of the employee"
          },
          {
            "$ref": "#/components/parameters/Pay_Request-Id"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Pay_UpsertEmployeeWorkingPatternRequestDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Working pattern saved successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Pay_ResponseBody"
                    },
                    {
                      "properties": {
                        "content": {
                          "type": "object",
                          "properties": {
                            "data": {
                              "$ref": "#/components/schemas/Pay_EmployeeWorkingPatternHistoryResponseDto"
                            }
                          }
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request data",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "404": {
            "description": "Employee not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "500": {
            "description": "An internal server error occurred",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "Pay API · Working patterns"
        ],
        "summary": "Remove an employee's whole working-pattern history",
        "description": "Needs permission working-pattern:write.\n\nRemoves every working-pattern version the employee has, in one write, returning them to the payroll-config default, then the organisation default, then Monday to Friday. This is what returning somebody to an inherited pattern means: removing versions one at a time only reveals the version before it. Succeeds when there is nothing to remove, because the end state is the one asked for.",
        "operationId": "Pay_DeleteAllWorkingPatterns",
        "x-flow-permission": "working-pattern:write",
        "parameters": [
          {
            "name": "employeeId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The ID of the employee"
          },
          {
            "$ref": "#/components/parameters/Pay_Request-Id"
          }
        ],
        "responses": {
          "200": {
            "description": "Working-pattern history removed",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Pay_ResponseBody"
                    },
                    {
                      "properties": {
                        "content": {
                          "type": "object",
                          "properties": {
                            "data": {
                              "$ref": "#/components/schemas/Pay_EmployeeWorkingPatternHistoryResponseDto"
                            }
                          }
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "404": {
            "description": "Employee not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "500": {
            "description": "An internal server error occurred",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          }
        }
      }
    },
    "/v1/employees/{employeeId}/working-pattern/{effectiveFrom}": {
      "delete": {
        "tags": [
          "Pay API · Working patterns"
        ],
        "summary": "Remove a working-pattern version from an employee",
        "description": "Needs permission working-pattern:write.\n\nRemoves the working-pattern version taking effect on the given date. Removing every version is the only way back to an inherited pattern: the employee then falls through to the payroll-config default, then the organisation default, then Monday to Friday. A pattern synthesised for an employee who predates effective dating is not a stored version and cannot be removed, so that returns 404. Responds with the remaining history.",
        "operationId": "Pay_DeleteWorkingPattern",
        "x-flow-permission": "working-pattern:write",
        "parameters": [
          {
            "name": "employeeId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The ID of the employee"
          },
          {
            "name": "effectiveFrom",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "date"
            },
            "description": "The effective date of the version to remove (YYYY-MM-DD)"
          },
          {
            "$ref": "#/components/parameters/Pay_Request-Id"
          }
        ],
        "responses": {
          "200": {
            "description": "Working-pattern version removed",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Pay_ResponseBody"
                    },
                    {
                      "properties": {
                        "content": {
                          "type": "object",
                          "properties": {
                            "data": {
                              "$ref": "#/components/schemas/Pay_EmployeeWorkingPatternHistoryResponseDto"
                            }
                          }
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid effective date",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "404": {
            "description": "Employee or working-pattern version not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "500": {
            "description": "An internal server error occurred",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          }
        }
      }
    },
    "/v1/employees/{employeeId}/working-schedule": {
      "put": {
        "tags": [
          "Pay API · Working patterns"
        ],
        "summary": "Feed a batch of scheduled weeks (merged idempotently by week)",
        "description": "Needs permission working-pattern:write.\n\nMerges scheduled weeks into the employee's explicit schedule at the given effective date, keyed by weekCommencing, so a rota system can push one week or many and re-send the same week without duplicating it. Use this rather than PUT /employees/{employeeId}/working-pattern when feeding an ongoing rota: that endpoint replaces the whole configuration, this one updates only the weeks you send and leaves the rest alone. Weeks may start on any weekday but must be at least 7 days apart so they cannot overlap. Each week sent is also written into the earlier explicit versions covering those days, so it changes that week wherever it falls before effectiveFrom; a later-dated version keeps its own weeks.",
        "operationId": "Pay_PutWorkingSchedule",
        "x-flow-permission": "working-pattern:write",
        "parameters": [
          {
            "name": "employeeId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The ID of the employee"
          },
          {
            "$ref": "#/components/parameters/Pay_Request-Id"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Pay_UpsertScheduledWeeksRequestDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Working schedule updated successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Pay_ResponseBody"
                    },
                    {
                      "properties": {
                        "content": {
                          "type": "object",
                          "properties": {
                            "data": {
                              "$ref": "#/components/schemas/Pay_EmployeeWorkingPatternHistoryResponseDto"
                            }
                          }
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request data",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "404": {
            "description": "Employee not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "500": {
            "description": "An internal server error occurred",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          }
        }
      }
    },
    "/v1/notification/email/payslip/{payrollConfigId}/{year}/{period}": {
      "post": {
        "tags": [
          "Pay API · Payslip"
        ],
        "summary": "Send payslip notification emails to employees",
        "description": "Needs permission pay-run:write.\n\nEmails employees their payslips for a pay run. With `employeeIds` each payslip is sent\nwithin the request and the response names the employees whose email could not be sent. With\n`recipients` the payslips are sent in the background, so a request of any size is\naccepted at once: type `payRun` emails every non-empty payslip on the pay run, type\n`employees` the employees named. A payslip that cannot be sent is tried again and is\nnever emailed twice by the same request. One background send runs per pay run at a time: the\n202 answers it as `send`, and a second request while it runs is refused 409 with it.\nEach payslip's `lastEmailedStatus` shows its email as it lands. Give one of the two,\nnever both.",
        "operationId": "Pay_SendPayslipNotification",
        "x-flow-permission": "pay-run:write",
        "parameters": [
          {
            "name": "payrollConfigId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "ID of the payroll configuration",
            "example": "01JNR9P81W74HYCN35X1EEFDZE"
          },
          {
            "name": "year",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            },
            "description": "Year of the pay run",
            "example": 2024
          },
          {
            "name": "period",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            },
            "description": "Pay period number within the year",
            "example": 2
          },
          {
            "$ref": "#/components/parameters/Pay_Request-Id"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Pay_PayslipNotificationRequestDto"
              },
              "example": {
                "employeeIds": [
                  "EMP01JPW80Q2B7Q9RGGRY29VGC8WM",
                  "EMP02JPW80Q2B7Q9RGGRY29VGC8WN"
                ]
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Payslip notification being sent",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Pay_ResponseBody"
                    },
                    {
                      "properties": {
                        "content": {
                          "type": "object",
                          "properties": {
                            "data": {
                              "$ref": "#/components/schemas/Pay_PayslipNotificationResponseDto"
                            }
                          }
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request body: neither or both of employeeIds and recipients, an unknown recipients type, employees named for type payRun, or none or more than 5,000 for type employees",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "404": {
            "description": "Payroll config not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "409": {
            "description": "Payslips for this pay run are already being emailed in the background: the body's `send` is that send. Only one runs per pay run at a time",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          }
        }
      }
    },
    "/v1/organisation/balances/opening/{taxYear}": {
      "get": {
        "tags": [
          "Pay API · Organisation"
        ],
        "summary": "Get organisation opening balances by tax year",
        "description": "Needs permission organisation-settings:read.\n\nRetrieves the opening balances for the current organisation for a specific tax year",
        "operationId": "Pay_getOpeningBalancesByTaxYear",
        "x-flow-permission": "organisation-settings:read",
        "parameters": [
          {
            "name": "taxYear",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            },
            "description": "The tax year to retrieve balances for"
          },
          {
            "$ref": "#/components/parameters/Pay_Request-Id"
          }
        ],
        "responses": {
          "200": {
            "description": "Successfully retrieved balances",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Pay_ResponseBody"
                    },
                    {
                      "properties": {
                        "content": {
                          "type": "object",
                          "properties": {
                            "data": {
                              "$ref": "#/components/schemas/Pay_YearToDateBalancesDto"
                            }
                          }
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid tax year",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          }
        },
        "x-mint": {
          "mcp": {
            "enabled": true
          }
        }
      },
      "post": {
        "tags": [
          "Pay API · Organisation"
        ],
        "summary": "Update organisation opening balances by tax year",
        "description": "Needs permission organisation-settings:write.\n\nUpdates the opening balances for the current organisation for a specific tax year",
        "operationId": "Pay_updateOpeningBalancesByTaxYear",
        "x-flow-permission": "organisation-settings:write",
        "parameters": [
          {
            "name": "taxYear",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            },
            "description": "The tax year to update balances for"
          },
          {
            "$ref": "#/components/parameters/Pay_Request-Id"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Pay_UpdatableYearToDateBalancesDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successfully updated balances",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Pay_ResponseBody"
                    },
                    {
                      "properties": {
                        "content": {
                          "type": "object",
                          "properties": {
                            "data": {
                              "$ref": "#/components/schemas/Pay_YearToDateBalancesDto"
                            }
                          }
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request body or tax year. An Employment Allowance already used above the opening employer NI it was claimed against is refused with `opening_employer_ni_below_employment_allowance_used` on `baseValues.employerNi`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          }
        }
      }
    },
    "/v1/organisation/balances/paye-liability/tax-years": {
      "get": {
        "tags": [
          "Pay API · Organisation"
        ],
        "summary": "Get tax years with PAYE liability data",
        "description": "Needs permission organisation-settings:read.\n\nReturns the list of tax years for which the current organisation has PAYE liability data (i.e. has at least one processed payroll month). Used by the UI to populate the year selector on the PAYE liability page.",
        "operationId": "Pay_getTaxYearsWithPayeLiability",
        "x-flow-permission": "organisation-settings:read",
        "parameters": [
          {
            "$ref": "#/components/parameters/Pay_Request-Id"
          }
        ],
        "responses": {
          "200": {
            "description": "Tax years with PAYE liability retrieved successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Pay_ResponseBody"
                    },
                    {
                      "properties": {
                        "content": {
                          "type": "object",
                          "properties": {
                            "data": {
                              "type": "array",
                              "items": {
                                "$ref": "#/components/schemas/Pay_AvailableDataTaxYear"
                              }
                            }
                          }
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          }
        },
        "x-mint": {
          "mcp": {
            "enabled": true
          }
        }
      }
    },
    "/v1/organisation/balances/paye-liability/{taxYear}": {
      "get": {
        "tags": [
          "Pay API · Organisation"
        ],
        "summary": "Get PAYE liability summary by tax year",
        "description": "Needs permission organisation-settings:read.\n\nRetrieves the PAYE liability summary for the current organisation for a specific tax year, including monthly or quarterly breakdowns based on the organisation's HMRC settings",
        "operationId": "Pay_getPayeLiabilitySummary",
        "x-flow-permission": "organisation-settings:read",
        "parameters": [
          {
            "name": "taxYear",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            },
            "description": "The tax year to retrieve PAYE liability summary for"
          },
          {
            "$ref": "#/components/parameters/Pay_Request-Id"
          }
        ],
        "responses": {
          "200": {
            "description": "Successfully retrieved PAYE liability summary",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Pay_ResponseBody"
                    },
                    {
                      "properties": {
                        "content": {
                          "type": "object",
                          "properties": {
                            "data": {
                              "type": "array",
                              "items": {
                                "$ref": "#/components/schemas/Pay_PayeLiabilitySummaryDto"
                              }
                            }
                          }
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid tax year",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          }
        },
        "x-mint": {
          "mcp": {
            "enabled": true
          }
        }
      }
    },
    "/v1/organisation/balances/paye-payments/{taxYear}/payment/{paymentId}": {
      "put": {
        "tags": [
          "Pay API · Organisation"
        ],
        "summary": "Update a PAYE payment for a specific tax year and payment ID",
        "description": "Needs permission organisation-settings:write.\n\nUpdates an existing PAYE payment for the current organisation, recalculating due dates, and payment status",
        "operationId": "Pay_updatePayePayment",
        "x-flow-permission": "organisation-settings:write",
        "parameters": [
          {
            "name": "taxYear",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            },
            "description": "The tax year for the payment"
          },
          {
            "name": "paymentId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The unique identifier of the payment to update"
          },
          {
            "$ref": "#/components/parameters/Pay_Request-Id"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Pay_UpdatablePayePaymentDto"
              },
              "example": {
                "paymentReference": "PAYE_2024_001_UPDATED",
                "amountPaid": 2000,
                "paymentDate": "2024-05-25",
                "notes": "Updated payment amount and date"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successfully updated PAYE payment",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Pay_ResponseBody"
                    },
                    {
                      "properties": {
                        "content": {
                          "type": "object",
                          "properties": {
                            "data": {
                              "$ref": "#/components/schemas/Pay_PayePaymentDto"
                            }
                          }
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request body, tax year, period, or payment ID",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "404": {
            "description": "Payment not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "Pay API · Organisation"
        ],
        "summary": "Delete a PAYE payment for a specific tax year, period, and payment ID",
        "description": "Needs permission organisation-settings:write.\n\nDeletes an existing PAYE payment for the current organisation",
        "operationId": "Pay_deletePayePayment",
        "x-flow-permission": "organisation-settings:write",
        "parameters": [
          {
            "name": "taxYear",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            },
            "description": "The tax year for the payment"
          },
          {
            "name": "paymentId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The unique identifier of the payment to delete"
          },
          {
            "$ref": "#/components/parameters/Pay_Request-Id"
          }
        ],
        "responses": {
          "200": {
            "description": "Successfully deleted PAYE payment",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "400": {
            "description": "Invalid tax year, period, or payment ID",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "404": {
            "description": "Payment not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          }
        }
      }
    },
    "/v1/organisation/balances/paye-payments/{taxYear}/period/{period}": {
      "post": {
        "tags": [
          "Pay API · Organisation"
        ],
        "summary": "Record a PAYE payment for a specific tax year and period",
        "description": "Needs permission organisation-settings:write.\n\nRecords a PAYE payment for the current organisation for a specific tax year and period (monthly or quarterly based on HMRC settings)",
        "operationId": "Pay_recordPayePayment",
        "x-flow-permission": "organisation-settings:write",
        "parameters": [
          {
            "name": "taxYear",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            },
            "description": "The tax year for the payment"
          },
          {
            "name": "period",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            },
            "description": "The period for the payment (1-12 for monthly, 1-4 for quarterly)"
          },
          {
            "$ref": "#/components/parameters/Pay_Request-Id"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Pay_UpdatablePayePaymentDto"
              },
              "example": {
                "paymentReference": "PAYE_2024_001",
                "amountPaid": 1500,
                "paymentDate": "2024-05-22",
                "notes": "BACS payment via online banking"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successfully recorded PAYE payment",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Pay_ResponseBody"
                    },
                    {
                      "properties": {
                        "content": {
                          "type": "object",
                          "properties": {
                            "data": {
                              "$ref": "#/components/schemas/Pay_PayePaymentDto"
                            }
                          }
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request body, tax year, or period",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          }
        }
      }
    },
    "/v1/organisation/balances/running/{taxYear}": {
      "get": {
        "tags": [
          "Pay API · Organisation"
        ],
        "summary": "Get year-to-date running balances by tax year",
        "description": "Needs permission organisation-settings:read.\n\nRetrieves the year-to-date running balances for the current organisation for a specific tax year",
        "operationId": "Pay_getRunningBalancesByTaxYear",
        "x-flow-permission": "organisation-settings:read",
        "parameters": [
          {
            "name": "taxYear",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            },
            "description": "The tax year to retrieve running balances for"
          },
          {
            "$ref": "#/components/parameters/Pay_Request-Id"
          }
        ],
        "responses": {
          "200": {
            "description": "Successfully retrieved running balances",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Pay_ResponseBody"
                    },
                    {
                      "properties": {
                        "content": {
                          "type": "object",
                          "properties": {
                            "data": {
                              "$ref": "#/components/schemas/Pay_YearToDateBalancesDto"
                            }
                          }
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid tax year",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          }
        },
        "x-mint": {
          "mcp": {
            "enabled": true
          }
        }
      }
    },
    "/v1/organisation/balances/running/{taxYear}/month/{month}": {
      "get": {
        "tags": [
          "Pay API · Organisation"
        ],
        "summary": "Get month to date running balances by tax year and month",
        "description": "Needs permission organisation-settings:read.\n\nRetrieves the month to date running balances for the current organisation for a specific tax year and month",
        "operationId": "Pay_getMonthlyBalancesByTaxYear",
        "x-flow-permission": "organisation-settings:read",
        "parameters": [
          {
            "name": "taxYear",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            },
            "description": "The tax year to retrieve monthly balances for"
          },
          {
            "name": "month",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            },
            "description": "The tax month to retrieve balances for (1-12)"
          },
          {
            "$ref": "#/components/parameters/Pay_Request-Id"
          }
        ],
        "responses": {
          "200": {
            "description": "Successfully retrieved monthly balances",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Pay_ResponseBody"
                    },
                    {
                      "properties": {
                        "content": {
                          "type": "object",
                          "properties": {
                            "data": {
                              "$ref": "#/components/schemas/Pay_MonthlyBalancesDto"
                            }
                          }
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid tax year or month",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          }
        },
        "x-mint": {
          "mcp": {
            "enabled": true
          }
        }
      }
    },
    "/v1/organisation/hmrc/settings": {
      "get": {
        "tags": [
          "Pay API · Organisation"
        ],
        "summary": "Get the HMRC settings for the current organisation",
        "description": "Needs permission organisation-settings:read.\n\nRetrieves the HMRC settings for the current organisation",
        "operationId": "Pay_getHmrcSettings",
        "x-flow-permission": "organisation-settings:read",
        "parameters": [
          {
            "$ref": "#/components/parameters/Pay_Request-Id"
          }
        ],
        "responses": {
          "200": {
            "description": "The HMRC settings were retrieved",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Pay_ResponseBody"
                    },
                    {
                      "properties": {
                        "content": {
                          "type": "object",
                          "properties": {
                            "data": {
                              "$ref": "#/components/schemas/Pay_HmrcSettingsDto"
                            }
                          }
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "500": {
            "description": "An error occurred",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          }
        },
        "x-mint": {
          "mcp": {
            "enabled": true
          }
        }
      },
      "post": {
        "tags": [
          "Pay API · Organisation"
        ],
        "summary": "Update the HMRC settings for the current organisation",
        "description": "Needs permission organisation-settings:write.\n\nUpdates the HMRC settings for the current organisation",
        "operationId": "Pay_updateHmrcSettings",
        "x-flow-permission": "organisation-settings:write",
        "parameters": [
          {
            "$ref": "#/components/parameters/Pay_Request-Id"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Pay_UpdatableHmrcSettingsDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The HMRC settings were updated",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Pay_ResponseBody"
                    },
                    {
                      "properties": {
                        "content": {
                          "type": "object",
                          "properties": {
                            "data": {
                              "$ref": "#/components/schemas/Pay_HmrcSettingsDto"
                            }
                          }
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "The request is invalid",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "500": {
            "description": "An error occurred",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          }
        }
      }
    },
    "/v1/organisation/information": {
      "get": {
        "tags": [
          "Pay API · Organisation"
        ],
        "summary": "Get organisation information",
        "description": "Needs permission organisation-details:read.\n\nGet the organisation information for the current organisation",
        "operationId": "Pay_getOrganisationInformation",
        "x-flow-permission": "organisation-details:read",
        "parameters": [
          {
            "$ref": "#/components/parameters/Pay_Request-Id"
          }
        ],
        "responses": {
          "200": {
            "description": "The organisation information was retrieved",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Pay_ResponseBody"
                    },
                    {
                      "properties": {
                        "content": {
                          "type": "object",
                          "properties": {
                            "data": {
                              "$ref": "#/components/schemas/Pay_OrganisationInformationDto"
                            }
                          }
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "500": {
            "description": "An error occurred",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          }
        },
        "x-mint": {
          "mcp": {
            "enabled": true
          }
        }
      },
      "post": {
        "tags": [
          "Pay API · Organisation"
        ],
        "summary": "Update organisation information",
        "description": "Needs permission organisation-details:write.\n\nUpdate the organisation information for the current organisation",
        "operationId": "Pay_updateOrganisationInformation",
        "x-flow-permission": "organisation-details:write",
        "parameters": [
          {
            "$ref": "#/components/parameters/Pay_Request-Id"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Pay_UpdatableOrganisationInformationDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The organisation information was updated",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Pay_ResponseBody"
                    },
                    {
                      "properties": {
                        "content": {
                          "type": "object",
                          "properties": {
                            "data": {
                              "$ref": "#/components/schemas/Pay_OrganisationInformationDto"
                            }
                          }
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "The request is invalid",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "500": {
            "description": "An error occurred",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          }
        }
      }
    },
    "/v1/organisation/information/multiple": {
      "get": {
        "tags": [
          "Pay API · Organisation"
        ],
        "summary": "Get multiple organisation information",
        "description": "Needs permission organisation-details:read.\n\nGet information for multiple organisations",
        "operationId": "Pay_getMultipleOrganisationinformation",
        "x-flow-permission": "organisation-details:read",
        "parameters": [
          {
            "$ref": "#/components/parameters/Pay_Request-Id"
          }
        ],
        "responses": {
          "200": {
            "description": "The organisation information was retrieved",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Pay_ResponseBody"
                    },
                    {
                      "properties": {
                        "content": {
                          "type": "object",
                          "properties": {
                            "data": {
                              "type": "array",
                              "items": {
                                "$ref": "#/components/schemas/Pay_OrganisationInformationDto"
                              }
                            }
                          }
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "500": {
            "description": "An error occurred",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          }
        },
        "x-mint": {
          "mcp": {
            "enabled": true
          }
        }
      }
    },
    "/v1/organisation/pay-element": {
      "get": {
        "tags": [
          "Pay API · Pay Elements"
        ],
        "summary": "Get the pay elements for the current organisation",
        "description": "Needs permission organisation-settings:read.\n\nRetrieves the pay elements for the current organisation",
        "operationId": "Pay_listPayElements",
        "x-flow-permission": "organisation-settings:read",
        "parameters": [
          {
            "$ref": "#/components/parameters/Pay_Request-Id"
          }
        ],
        "responses": {
          "200": {
            "description": "The pay elements were retrieved",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Pay_ResponseBody"
                    },
                    {
                      "properties": {
                        "content": {
                          "type": "object",
                          "properties": {
                            "data": {
                              "type": "array",
                              "items": {
                                "$ref": "#/components/schemas/Pay_PayElementDto"
                              }
                            }
                          }
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "500": {
            "description": "An error occurred",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          }
        },
        "x-mint": {
          "mcp": {
            "enabled": true
          }
        }
      },
      "post": {
        "tags": [
          "Pay API · Pay Elements"
        ],
        "summary": "Create a new pay element for the current organisation",
        "description": "Needs permission organisation-settings:write.\n\nCreates a new pay element for the current organisation",
        "operationId": "Pay_createPayElement",
        "x-flow-permission": "organisation-settings:write",
        "parameters": [
          {
            "$ref": "#/components/parameters/Pay_Request-Id"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Pay_CreatePayElementDto"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "The pay element was created",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Pay_ResponseBody"
                    },
                    {
                      "properties": {
                        "content": {
                          "type": "object",
                          "properties": {
                            "data": {
                              "$ref": "#/components/schemas/Pay_PayElementDto"
                            }
                          }
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "The request is invalid",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          }
        }
      }
    },
    "/v1/organisation/pay-element/{payElementId}": {
      "get": {
        "tags": [
          "Pay API · Pay Elements"
        ],
        "summary": "Get a specific pay element by ID",
        "description": "Needs permission organisation-settings:read.\n\nRetrieves a specific pay element by its ID for the current organisation",
        "operationId": "Pay_getPayElement",
        "x-flow-permission": "organisation-settings:read",
        "parameters": [
          {
            "name": "payElementId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The ID of the pay element to retrieve"
          },
          {
            "$ref": "#/components/parameters/Pay_Request-Id"
          }
        ],
        "responses": {
          "200": {
            "description": "The pay element was retrieved",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Pay_ResponseBody"
                    },
                    {
                      "properties": {
                        "content": {
                          "type": "object",
                          "properties": {
                            "data": {
                              "$ref": "#/components/schemas/Pay_PayElementDto"
                            }
                          }
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "404": {
            "description": "Pay element not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "500": {
            "description": "An error occurred",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          }
        },
        "x-mint": {
          "mcp": {
            "enabled": true
          }
        }
      },
      "put": {
        "tags": [
          "Pay API · Pay Elements"
        ],
        "summary": "Update a specific pay element by ID",
        "description": "Needs permission organisation-settings:write.\n\nUpdates a specific pay element by its ID for the current organisation",
        "operationId": "Pay_updatePayElement",
        "x-flow-permission": "organisation-settings:write",
        "parameters": [
          {
            "name": "payElementId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The ID of the pay element to update"
          },
          {
            "$ref": "#/components/parameters/Pay_Request-Id"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Pay_UpdatePayElementDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The pay element was updated",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Pay_ResponseBody"
                    },
                    {
                      "properties": {
                        "content": {
                          "type": "object",
                          "properties": {
                            "data": {
                              "$ref": "#/components/schemas/Pay_PayElementDto"
                            }
                          }
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "The request is invalid",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "404": {
            "description": "Pay element not found or cannot be updated because it is a system code",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "Pay API · Pay Elements"
        ],
        "summary": "Delete a specific pay element by ID",
        "description": "Needs permission organisation-settings:write.\n\nDeletes a specific pay element by its ID for the current organisation",
        "operationId": "Pay_deletePayElement",
        "x-flow-permission": "organisation-settings:write",
        "parameters": [
          {
            "name": "payElementId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The ID of the pay element to delete"
          },
          {
            "$ref": "#/components/parameters/Pay_Request-Id"
          }
        ],
        "responses": {
          "204": {
            "description": "No Content"
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "404": {
            "description": "Pay element not found or cannot be deleted because it is a system code",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "500": {
            "description": "An error occurred",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          }
        }
      }
    },
    "/v1/organisation/working-pattern-defaults": {
      "get": {
        "tags": [
          "Pay API · Organisation"
        ],
        "summary": "Get the organisation's default working pattern and qualifying-day policy",
        "description": "Needs permission working-pattern:read.\n\nReturns the organisation-wide default, which applies to any employee with no pattern of their own whose payroll config also sets no default. Responds with an empty default rather than 404 when none has been set.",
        "operationId": "Pay_GetOrganisationWorkingPatternDefaults",
        "x-flow-permission": "working-pattern:read",
        "parameters": [
          {
            "$ref": "#/components/parameters/Pay_Request-Id"
          }
        ],
        "responses": {
          "200": {
            "description": "Working pattern defaults retrieved successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Pay_ResponseBody"
                    },
                    {
                      "properties": {
                        "content": {
                          "type": "object",
                          "properties": {
                            "data": {
                              "$ref": "#/components/schemas/Pay_WorkingPatternDefaultsDto"
                            }
                          }
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "500": {
            "description": "An internal server error occurred",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          }
        },
        "x-mint": {
          "mcp": {
            "enabled": true
          }
        }
      },
      "post": {
        "tags": [
          "Pay API · Organisation"
        ],
        "summary": "Set the organisation's default working pattern and qualifying-day policy",
        "description": "Needs permission working-pattern:write.\n\nReplaces the organisation-wide default. It applies to any employee with no pattern of their own whose payroll config also sets no default; a payroll-config default overrides it, and an employee's own pattern overrides both.",
        "operationId": "Pay_UpdateOrganisationWorkingPatternDefaults",
        "x-flow-permission": "working-pattern:write",
        "parameters": [
          {
            "$ref": "#/components/parameters/Pay_Request-Id"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Pay_WorkingPatternDefaultsDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Working pattern defaults saved successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Pay_ResponseBody"
                    },
                    {
                      "properties": {
                        "content": {
                          "type": "object",
                          "properties": {
                            "data": {
                              "$ref": "#/components/schemas/Pay_WorkingPatternDefaultsDto"
                            }
                          }
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request data",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "500": {
            "description": "An internal server error occurred",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          }
        }
      }
    },
    "/v1/payroll/line/{employeeId}": {
      "post": {
        "tags": [
          "Pay API · Payroll lines"
        ],
        "summary": "Upload payroll lines",
        "description": "Needs permission pay-run:write.\n\nUploads a list of payroll lines to the system. The system will attempt to process each line and return a list of validation issues for any lines that fail. The successful lines will be returned in the response. The combination of employeeID and id must be unique. There's a hard limit of 100 items per request. In addition to the input data, the response contain an additional field 'payrollDate' - which corresponds to the date that will be considered for the payroll process. The payrollDate will always be populated - either with the date in the input - or with the very next yet unlocked date, in case the period for the given date is already locked. On HMRC submission, the system will use the date as reference to the period. Sending an id that matches an existing line item updates (fully replaces) that line item; if the existing line item belongs to an already locked period, the request is rejected with a 409 and no lines are written. Line ids beginning 'internal_' are reserved for lines the platform creates itself (pension contributions, for example) and are rejected with a validation issue. The pension context that drives an employer contribution is platform-owned, so it is only honoured on the platform's own contribution lines and is ignored on uploaded ones. Billing and invoicing fields on a line (its billing status, invoice id and charge value) are derived by the platform and returned on the response, not accepted here.",
        "operationId": "Pay_UploadPayroll",
        "x-flow-permission": "pay-run:write",
        "parameters": [
          {
            "name": "employeeId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/Pay_Request-Id"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/Pay_PayrollLineDto"
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Payroll Uploaded",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Pay_ResponseBody"
                    },
                    {
                      "properties": {
                        "content": {
                          "type": "object",
                          "properties": {
                            "data": {
                              "type": "array",
                              "items": {
                                "$ref": "#/components/schemas/Pay_PayrollLineOutputDto"
                              }
                            }
                          }
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "207": {
            "description": "Partial Success - Some Items Failed",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Pay_ResponseBody"
                    },
                    {
                      "properties": {
                        "content": {
                          "type": "object",
                          "properties": {
                            "data": {
                              "$ref": "#/components/schemas/Pay_MultiStatusDataResponse"
                            }
                          }
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid payroll data",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "409": {
            "description": "One or more ids reference an existing payroll line that belongs to an already locked period and cannot be overridden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          }
        }
      }
    },
    "/v1/payroll/line/{employeeId}/{lineId}": {
      "delete": {
        "tags": [
          "Pay API · Payroll lines"
        ],
        "summary": "Delete a payroll line",
        "description": "Needs permission pay-run:write.\n\nDeletes a specific payroll line for an employee.",
        "operationId": "Pay_DeletePayrollLine",
        "x-flow-permission": "pay-run:write",
        "parameters": [
          {
            "name": "employeeId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "lineId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/Pay_Request-Id"
          }
        ],
        "responses": {
          "200": {
            "description": "Payroll Line Deleted Successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Pay_ResponseBody"
                    },
                    {
                      "properties": {
                        "content": {
                          "type": "object",
                          "properties": {
                            "data": {
                              "$ref": "#/components/schemas/Pay_PayrollLineOutputDto"
                            }
                          }
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "404": {
            "description": "Payroll Line Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "409": {
            "description": "Payroll Line Cannot Be Deleted for the given employee due a conflict reason. Eg. Payroll run is locked",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          }
        }
      }
    },
    "/v1/payroll/line/{employeeId}/{lineId}/attachments": {
      "post": {
        "tags": [
          "Pay API · Payroll lines"
        ],
        "summary": "Add attachments to a payroll line item",
        "description": "Needs permission pay-run:write.\n\nCreates attachment metadata records for a payroll line item and returns where to upload each file. Send each file's metadata (filename, contentType, exact fileSize) in this request, then PUT each file's bytes to its `uploadUrl` with the returned `headers`, within 15 minutes.",
        "operationId": "Pay_AddPayrollLineItemAttachments",
        "x-flow-permission": "pay-run:write",
        "parameters": [
          {
            "name": "employeeId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The ID of the employee"
          },
          {
            "name": "lineId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The ID of the payroll line item"
          },
          {
            "$ref": "#/components/parameters/Pay_Request-Id"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Pay_AddPayrollLineItemAttachmentsRequestDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Attachment upload URLs generated successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Pay_ResponseBody"
                    },
                    {
                      "properties": {
                        "content": {
                          "type": "object",
                          "properties": {
                            "data": {
                              "type": "array",
                              "items": {
                                "$ref": "#/components/schemas/Pay_AttachmentUploadResponseDto"
                              }
                            }
                          }
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request or no attachments provided",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "404": {
            "description": "Payroll Line Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          }
        }
      }
    },
    "/v1/payroll/line/{employeeId}/{lineId}/attachments/{attachmentId}": {
      "delete": {
        "tags": [
          "Pay API · Payroll lines"
        ],
        "summary": "Delete an attachment from a payroll line item",
        "description": "Needs permission pay-run:write.\n\nDeletes an attachment from a payroll line item. The file and its details are both removed.",
        "operationId": "Pay_DeletePayrollLineItemAttachment",
        "x-flow-permission": "pay-run:write",
        "parameters": [
          {
            "name": "employeeId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The ID of the employee"
          },
          {
            "name": "lineId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The ID of the payroll line item"
          },
          {
            "name": "attachmentId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The ID of the attachment to delete"
          },
          {
            "$ref": "#/components/parameters/Pay_Request-Id"
          }
        ],
        "responses": {
          "200": {
            "description": "Attachment deleted successfully",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "404": {
            "description": "Payroll Line Not Found or Attachment Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          }
        }
      }
    },
    "/v1/payroll/runs/tax-years-with-pay-runs": {
      "get": {
        "tags": [
          "Pay API · Payroll"
        ],
        "summary": "Get tax years with pay runs",
        "description": "Needs permission pay-run:read.",
        "operationId": "Pay_GetTaxYearsWithPayRuns",
        "x-flow-permission": "pay-run:read",
        "parameters": [
          {
            "$ref": "#/components/parameters/Pay_Request-Id"
          }
        ],
        "responses": {
          "200": {
            "description": "Tax years with pay runs retrieved successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Pay_ResponseBody"
                    },
                    {
                      "properties": {
                        "content": {
                          "type": "object",
                          "properties": {
                            "data": {
                              "type": "array",
                              "items": {
                                "$ref": "#/components/schemas/Pay_AvailableDataTaxYear"
                              }
                            }
                          }
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "500": {
            "description": "An error occurred",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          }
        },
        "x-mint": {
          "mcp": {
            "enabled": true
          }
        }
      }
    },
    "/v1/payroll/runs/{year}": {
      "get": {
        "tags": [
          "Pay API · Payroll"
        ],
        "summary": "List payroll runs by tax year",
        "description": "Needs permission pay-run:read.",
        "operationId": "Pay_ListPayrollRunsByTaxYear",
        "x-flow-permission": "pay-run:read",
        "parameters": [
          {
            "name": "year",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            },
            "description": "The year in format yyyy"
          },
          {
            "name": "pageSize",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int32"
            },
            "description": "The maximum number of payroll runs to return."
          },
          {
            "name": "paginationToken",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "The pagination token for the next page."
          },
          {
            "$ref": "#/components/parameters/Pay_Request-Id"
          }
        ],
        "responses": {
          "200": {
            "description": "Payroll runs listed successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Pay_ResponseBody"
                    },
                    {
                      "properties": {
                        "content": {
                          "type": "object",
                          "properties": {
                            "data": {
                              "type": "array",
                              "items": {
                                "$ref": "#/components/schemas/Pay_PayrollRunEntryDto"
                              }
                            },
                            "metadata": {
                              "type": "object",
                              "properties": {
                                "paginationToken": {
                                  "type": "string",
                                  "nullable": true
                                }
                              }
                            }
                          }
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "500": {
            "description": "An error occurred",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          }
        },
        "x-mint": {
          "mcp": {
            "enabled": true
          }
        }
      }
    },
    "/v1/payroll/year-end/{taxYear}": {
      "get": {
        "tags": [
          "Pay API · YearEnd"
        ],
        "summary": "List all year-end finalisations for an organisation in a tax year",
        "description": "Needs permission rti:read.",
        "operationId": "Pay_ListYearEndFinalisations",
        "x-flow-permission": "rti:read",
        "parameters": [
          {
            "name": "taxYear",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            },
            "description": "The tax year (e.g. 2025 for 2024/25)"
          },
          {
            "$ref": "#/components/parameters/Pay_Request-Id"
          }
        ],
        "responses": {
          "200": {
            "description": "Year-end finalisations found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Pay_ResponseBody"
                    },
                    {
                      "properties": {
                        "content": {
                          "type": "object",
                          "properties": {
                            "data": {
                              "type": "array",
                              "items": {
                                "$ref": "#/components/schemas/Pay_YearEndFinalisationDto"
                              }
                            }
                          }
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "500": {
            "description": "An error occurred",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          }
        },
        "x-mint": {
          "mcp": {
            "enabled": true
          }
        }
      }
    },
    "/v1/payroll/year-end/{taxYear}/{payrollConfigId}": {
      "get": {
        "tags": [
          "Pay API · YearEnd"
        ],
        "summary": "Read year-end finalisation for a payroll configuration",
        "description": "Needs permission rti:read.",
        "operationId": "Pay_ReadYearEndFinalisation",
        "x-flow-permission": "rti:read",
        "parameters": [
          {
            "name": "payrollConfigId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The payroll config id"
          },
          {
            "name": "taxYear",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            },
            "description": "The tax year (e.g. 2025 for 2024/25)"
          },
          {
            "$ref": "#/components/parameters/Pay_Request-Id"
          }
        ],
        "responses": {
          "200": {
            "description": "Year-end finalisation found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Pay_ResponseBody"
                    },
                    {
                      "properties": {
                        "content": {
                          "type": "object",
                          "properties": {
                            "data": {
                              "$ref": "#/components/schemas/Pay_YearEndFinalisationDto"
                            }
                          }
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "404": {
            "description": "Year-end not finalised for this payroll configuration",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "500": {
            "description": "An error occurred",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          }
        },
        "x-mint": {
          "mcp": {
            "enabled": true
          }
        }
      }
    },
    "/v1/payroll/year-end/{taxYear}/{payrollConfigId}/finalise": {
      "post": {
        "tags": [
          "Pay API · YearEnd"
        ],
        "summary": "Finalise year-end for a payroll configuration",
        "description": "Needs permission rti:submit.",
        "operationId": "Pay_FinaliseYearEnd",
        "x-flow-permission": "rti:submit",
        "parameters": [
          {
            "name": "payrollConfigId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The payroll config id"
          },
          {
            "name": "taxYear",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            },
            "description": "The tax year (e.g. 2025 for 2024/25)"
          },
          {
            "$ref": "#/components/parameters/Pay_Request-Id"
          }
        ],
        "responses": {
          "201": {
            "description": "Year-end finalised successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Pay_ResponseBody"
                    },
                    {
                      "properties": {
                        "content": {
                          "type": "object",
                          "properties": {
                            "data": {
                              "$ref": "#/components/schemas/Pay_YearEndFinalisationDto"
                            }
                          }
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Validation failed (e.g. not all pay runs completed)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "409": {
            "description": "Year-end already finalised for this payroll configuration",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "500": {
            "description": "An error occurred",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          }
        }
      }
    },
    "/v1/payroll/{payrollConfigId}/next": {
      "post": {
        "tags": [
          "Pay API · Payroll"
        ],
        "summary": "Create the next payroll run for a given payroll configuration",
        "description": "Needs permission pay-run:write.",
        "operationId": "Pay_CreateNextPayrollRun",
        "x-flow-permission": "pay-run:write",
        "parameters": [
          {
            "name": "payrollConfigId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The ID of the payroll configuration to use."
          },
          {
            "name": "paymentDateOverride",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date"
            },
            "description": "Optional override for the payment date (format: yyyy-MM-dd)."
          },
          {
            "$ref": "#/components/parameters/Pay_Request-Id"
          }
        ],
        "responses": {
          "201": {
            "description": "Payroll run created successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Pay_ResponseBody"
                    },
                    {
                      "properties": {
                        "content": {
                          "type": "object",
                          "properties": {
                            "data": {
                              "$ref": "#/components/schemas/Pay_PayrollRunEntryDto"
                            }
                          }
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request or parameters",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "404": {
            "description": "Payroll config not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "409": {
            "description": "Could not create next payroll run due to a conflict. (e.g. there's no existing payroll run to use as reference for creating the next one, or it is the last period of the year and next year can't be opened yet)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          }
        }
      }
    },
    "/v1/payroll/{payrollConfigId}/{year}/{period}": {
      "get": {
        "tags": [
          "Pay API · Payroll"
        ],
        "summary": "Get payroll run(lock) data",
        "description": "Needs permission pay-run:read.",
        "operationId": "Pay_GetPayroll",
        "x-flow-permission": "pay-run:read",
        "parameters": [
          {
            "name": "payrollConfigId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "year",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            },
            "description": "The year in format yyyy"
          },
          {
            "name": "period",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            },
            "description": "The period of the pay run (1, 2, 3... etc)"
          },
          {
            "name": "runEmployerNi",
            "in": "query",
            "required": false,
            "schema": {
              "type": "number",
              "format": "decimal"
            }
          },
          {
            "name": "runPayBill",
            "in": "query",
            "required": false,
            "schema": {
              "type": "number",
              "format": "decimal"
            }
          },
          {
            "$ref": "#/components/parameters/Pay_Request-Id"
          }
        ],
        "responses": {
          "200": {
            "description": "Payroll Run data found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Pay_ResponseBody"
                    },
                    {
                      "properties": {
                        "content": {
                          "type": "object",
                          "properties": {
                            "data": {
                              "$ref": "#/components/schemas/Pay_PayrollRunEntryDto"
                            }
                          }
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid path parameters",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "404": {
            "description": "Payroll config id not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          }
        },
        "x-mint": {
          "mcp": {
            "enabled": true
          }
        }
      },
      "post": {
        "tags": [
          "Pay API · Payroll"
        ],
        "summary": "Create a payroll run",
        "description": "Needs permission pay-run:write.",
        "operationId": "Pay_createPayrollRun",
        "x-flow-permission": "pay-run:write",
        "parameters": [
          {
            "name": "payrollConfigId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The ID of the payroll configuration to use."
          },
          {
            "name": "year",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            },
            "description": "The payroll year (e.g., 2024)."
          },
          {
            "name": "period",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            },
            "description": "The payroll period (e.g., 1 for January, 12 for December, or period number for other frequencies)."
          },
          {
            "name": "paymentDateOverride",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date"
            },
            "description": "Optional override for the payment date (format: yyyy-MM-dd)."
          },
          {
            "$ref": "#/components/parameters/Pay_Request-Id"
          }
        ],
        "responses": {
          "201": {
            "description": "Payroll run created successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Pay_ResponseBody"
                    },
                    {
                      "properties": {
                        "content": {
                          "type": "object",
                          "properties": {
                            "data": {
                              "$ref": "#/components/schemas/Pay_PayrollRunEntryDto"
                            }
                          }
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request or parameters",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "404": {
            "description": "Payroll config not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "409": {
            "description": "Payroll run already exists",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          }
        }
      }
    },
    "/v1/payroll/{payrollConfigId}/{year}/{period}/employees": {
      "post": {
        "tags": [
          "Pay API · Payroll"
        ],
        "summary": "Add a former employee to an open pay run",
        "description": "Needs permission pay-run:write.\n\nAdds someone who has already left to an open pay run so they can be paid after leaving, for example a late commission or service charge. Former employees are excluded from the payroll-config roster once their leaving date reaches a finalised payslip, so they cannot be picked up by a pay run any other way.\n\nWhere the P45 has already been issued, the resulting payslip is taxed at 0T on a week 1 / month 1 basis and reported on the next FPS with the payment-after-leaving indicator, the original leaving date and the original payroll ID. No second P45 is issued.",
        "operationId": "Pay_AddEmployeeToPayrollRun",
        "x-flow-permission": "pay-run:write",
        "parameters": [
          {
            "name": "payrollConfigId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The ID of the payroll configuration"
          },
          {
            "name": "year",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            },
            "description": "The year in format yyyy"
          },
          {
            "name": "period",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The period in format mm",
            "example": "1"
          },
          {
            "$ref": "#/components/parameters/Pay_Request-Id"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Pay_AddEmployeeToPayrollRunDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The former employee was added to the pay run, or was already on it. Their payslip is generated asynchronously.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request, or the person is still employed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "404": {
            "description": "Payroll config, pay run or employee not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "409": {
            "description": "The pay run is no longer open",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "500": {
            "description": "An error occurred",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          }
        }
      }
    },
    "/v1/payroll/{payrollConfigId}/{year}/{period}/employees/{employeeId}": {
      "delete": {
        "tags": [
          "Pay API · Payroll"
        ],
        "summary": "Remove a former employee from an open pay run",
        "description": "Needs permission pay-run:write.\n\nUndoes adding a former employee to a pay run. Deletes their payslip from the run and decrements the run's employee count, so a person added by mistake leaves no trace on the totals or on the FPS.\n\nOnly works while the run is open and only for a payslip that is still a preview. A person who is still employed cannot be removed this way, because their place on the run is owned by the payroll-config roster.",
        "operationId": "Pay_RemoveEmployeeFromPayrollRun",
        "x-flow-permission": "pay-run:write",
        "parameters": [
          {
            "name": "payrollConfigId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The ID of the payroll configuration"
          },
          {
            "name": "year",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            },
            "description": "The year in format yyyy"
          },
          {
            "name": "period",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The period in format mm",
            "example": "1"
          },
          {
            "name": "employeeId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The former employee to remove"
          },
          {
            "$ref": "#/components/parameters/Pay_Request-Id"
          }
        ],
        "responses": {
          "200": {
            "description": "The former employee was removed, or was not on the pay run",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request, or the person is still employed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "404": {
            "description": "Payroll config, pay run or employee not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "409": {
            "description": "The pay run is no longer open, or the payslip is already final",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "500": {
            "description": "An error occurred",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          }
        }
      }
    },
    "/v1/payroll/{payrollConfigId}/{year}/{period}/history": {
      "get": {
        "tags": [
          "Pay API · Payroll"
        ],
        "summary": "List the lock history of a payroll run",
        "description": "Needs permission pay-run:read.\n\nLists the lock cycles of a payroll run, newest first. Each cycle says who locked the run\nand when, when the lock completed, the balances it reported and its FPS submissions, and,\nfor a cycle the run was unlocked from, who unlocked it, when, why and for which employees.\nA run that has never been unlocked has one cycle. A run that has never been locked has none.",
        "operationId": "Pay_GetPayrollRunHistory",
        "x-flow-permission": "pay-run:read",
        "parameters": [
          {
            "name": "payrollConfigId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The payroll config id"
          },
          {
            "name": "year",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            },
            "description": "The year in format yyyy",
            "example": 2026
          },
          {
            "name": "period",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            },
            "description": "The period of the pay run (1, 2, 3... etc)",
            "example": 7
          },
          {
            "$ref": "#/components/parameters/Pay_Request-Id"
          }
        ],
        "responses": {
          "200": {
            "description": "The lock history was retrieved successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Pay_ResponseBody"
                    },
                    {
                      "properties": {
                        "content": {
                          "type": "object",
                          "properties": {
                            "data": {
                              "type": "array",
                              "items": {
                                "$ref": "#/components/schemas/Pay_PayrollRunLockCycleDto"
                              }
                            }
                          }
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "The request is invalid",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "404": {
            "description": "The payroll config or the payroll run was not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "500": {
            "description": "An error occurred",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          }
        },
        "x-mint": {
          "mcp": {
            "enabled": true
          }
        }
      }
    },
    "/v1/payroll/{payrollConfigId}/{year}/{period}/lock": {
      "post": {
        "tags": [
          "Pay API · Payroll"
        ],
        "summary": "Locks a payroll",
        "description": "Needs permission pay-run:lock.\n\nLocks the run: every payslip is issued as Final and the run completes asynchronously.\nA run that was unlocked (`lockStatus` Reopened or PartiallyReopened) is locked again the\nsame way, starting the next lock cycle, once the unlock has reopened every payslip in\nscope (the cycle's `reopenDone` has reached `reopenExpected`). Until then the lock\nanswers 409 `lock_payroll_run_unlock_in_progress` with that cycle in the body; an operator\ncan send `X-Unlock-Override: true` to lock anyway, which names them on the cycle as\n`unlockOverriddenBy`.",
        "operationId": "Pay_LockPayroll",
        "x-flow-permission": "pay-run:lock",
        "parameters": [
          {
            "name": "payrollConfigId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The payroll config id"
          },
          {
            "name": "year",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            },
            "description": "The year in format yyyy",
            "example": 2026
          },
          {
            "name": "period",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            },
            "description": "The period of the pay run (1, 2, 3... etc)",
            "example": 7
          },
          {
            "name": "lateReportingReason",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "The HMRC late reporting reason the run's next FPS carries, for a run locked again after an FPS already went under an earlier lock cycle (`H`, correction to an earlier submission, is the usual one). Recorded on the lock cycle; the FPS submission falls back to it when its own body gives none. Refused with `lock_payroll_run_invalid_late_reporting_reason` when it is not a reason HMRC accepts.",
            "example": "H"
          },
          {
            "$ref": "#/components/parameters/Pay_Request-Id"
          }
        ],
        "responses": {
          "201": {
            "description": "The payroll lock was created successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Pay_ResponseBody"
                    },
                    {
                      "properties": {
                        "content": {
                          "type": "object",
                          "properties": {
                            "data": {
                              "$ref": "#/components/schemas/Pay_PayrollRunEntryDto"
                            }
                          }
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "The request is invalid",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "404": {
            "description": "The payroll config was not found or invalid year param",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "409": {
            "description": "The run cannot be locked; the token says why: lock_payroll_run_already_locked, lock_payroll_run_earlier_open_runs_exist (an earlier run of the payroll config is open or reopened), lock_payroll_run_unlock_in_progress (the unlock has not reopened every payslip in scope yet; the body carries the cycle it was unlocked from, with reopenDone and reopenExpected), lock_payroll_run_invalid_late_reporting_reason",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Pay_ResponseBody"
                    },
                    {
                      "properties": {
                        "content": {
                          "type": "object",
                          "properties": {
                            "data": {
                              "$ref": "#/components/schemas/Pay_PayrollRunLockCycleDto"
                            }
                          }
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "500": {
            "description": "An error occurred",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          }
        }
      }
    },
    "/v1/payroll/{payrollConfigId}/{year}/{period}/processing": {
      "get": {
        "tags": [
          "Pay API · Payroll"
        ],
        "summary": "List the payslips of a pay run still being calculated",
        "description": "Needs permission pay-run:read.\n\nThe payslips of a pay run that are queued for calculation and have not finished yet, oldest\nfirst, with how many there are and when the oldest was queued. A payslip is queued whenever\nsomething it depends on changes (a pay line, the employee, the pay run itself) and leaves\nthis list once its calculation has been written, so a pending count of 0 means every\npayslip of the run is up to date: ask before reading figures you have just changed, and\nbefore locking. A calculation queued long ago that is still listed did not complete and will\nnot leave the list on its own.",
        "operationId": "Pay_GetPayrollRunProcessing",
        "x-flow-permission": "pay-run:read",
        "parameters": [
          {
            "name": "payrollConfigId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "ID of the payroll configuration",
            "example": "01JNR9P81W74HYCN35X1EEFDZE"
          },
          {
            "name": "year",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            },
            "description": "Year of the pay run",
            "example": 2026
          },
          {
            "name": "period",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            },
            "description": "Pay period number within the year",
            "example": 7
          },
          {
            "$ref": "#/components/parameters/Pay_Request-Id"
          }
        ],
        "responses": {
          "200": {
            "description": "The payslips still being calculated were retrieved successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Pay_ResponseBody"
                    },
                    {
                      "properties": {
                        "content": {
                          "type": "object",
                          "properties": {
                            "data": {
                              "$ref": "#/components/schemas/Pay_PayrollRunProcessingDto"
                            }
                          }
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "The request is invalid",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "404": {
            "description": "The payroll config or the pay run was not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "500": {
            "description": "An error occurred",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          }
        },
        "x-mint": {
          "mcp": {
            "enabled": true
          }
        }
      }
    },
    "/v1/payroll/{payrollConfigId}/{year}/{period}/unlock": {
      "post": {
        "tags": [
          "Pay API · Payroll"
        ],
        "summary": "Unlock a locked payroll run",
        "description": "Needs permission pay-run:unlock.\n\nReopens a locked, completed payroll run so its payslips can be changed and the run locked\nagain. The run answers at once as Reopened (every payslip) or PartiallyReopened (the listed\nemployees only); the payslips are reopened asynchronously, each keeping the version it had\nwhen the run was locked (see the payslip versions endpoints). Every later locked run of the\npayroll config is unlocked with it, with the same scope and reason, because its payslips\nwere calculated from this run's cumulatives: the answer lists them as `alsoUnlocked`, and\nthey are locked again in period order, this run first (the lock refuses a run while an\nearlier one is open). A later run already partially reopened for other employees is\nwidened instead of skipped: the employees in scope join its current cycle's unlock (or the\ncycle goes to Full), and it is listed under `alsoUnlocked` too. The same widening is\navailable on the run itself: unlocking a PartiallyReopened run for more employees, or in\nfull, adds to its open cycle rather than starting a new one. Every guard is checked on\nevery run before anything is reopened. A run in a finalised tax year is never unlocked,\nand the last period of a tax year is closed once 5 April has passed. The next lock of each\nrun starts its lock cycle n+1 and issues only the reopened payslips.",
        "operationId": "Pay_UnlockPayroll",
        "x-flow-permission": "pay-run:unlock",
        "parameters": [
          {
            "name": "payrollConfigId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The payroll config id"
          },
          {
            "name": "year",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            },
            "description": "The year in format yyyy",
            "example": 2026
          },
          {
            "name": "period",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            },
            "description": "The period of the pay run (1, 2, 3... etc)",
            "example": 7
          },
          {
            "$ref": "#/components/parameters/Pay_Request-Id"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Pay_UnlockPayrollRunDto"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "The run, and every later locked run of the payroll config, is reopened and their payslips are being reopened",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Pay_ResponseBody"
                    },
                    {
                      "properties": {
                        "content": {
                          "type": "object",
                          "properties": {
                            "data": {
                              "$ref": "#/components/schemas/Pay_UnlockPayrollRunResultDto"
                            }
                          }
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "The request is invalid (unlock_payroll_run_body_required, unlock_payroll_run_invalid_scope, unlock_payroll_run_employee_ids_required, unlock_payroll_run_reason_required)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "404": {
            "description": "The payroll config or the payroll run was not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "409": {
            "description": "The run, or a later locked run that would be unlocked with it, cannot be unlocked; the message names the run. The token says why: unlock_payroll_run_disabled (not enabled in this environment), unlock_payroll_run_not_locked (neither locked nor partially reopened), unlock_payroll_run_already_reopened (a partially reopened run whose open cycle already covers every employee asked for), unlock_payroll_run_not_completed (a lock is still processing), unlock_payroll_run_tax_year_finalised, unlock_payroll_run_tax_year_closed (the last period of a tax year that has ended). A leaver whose P45 is already issued is reopened like anyone else: the correction reaches HMRC on the next FPS, never as a new P45, and the run's history names them under leaversWithIssuedP45",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "500": {
            "description": "An error occurred",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          }
        }
      }
    },
    "/v1/payrollconfig": {
      "get": {
        "tags": [
          "Pay API · PayrollConfig"
        ],
        "summary": "Read all payroll configurations",
        "description": "Needs permission organisation-settings:read, or any of pay-run:read.",
        "operationId": "Pay_ReadAllPayrollConfigs",
        "x-flow-permission": "organisation-settings:read",
        "parameters": [
          {
            "name": "pageSize",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "paginationToken",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/Pay_Request-Id"
          }
        ],
        "x-flow-permission-also-accepts": [
          "pay-run:read"
        ],
        "responses": {
          "200": {
            "description": "Payroll Configurations Retrieved",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Pay_ResponseBody"
                    },
                    {
                      "properties": {
                        "content": {
                          "type": "object",
                          "properties": {
                            "data": {
                              "type": "array",
                              "items": {
                                "$ref": "#/components/schemas/Pay_PayrollConfigDto"
                              }
                            },
                            "metadata": {
                              "type": "object",
                              "properties": {
                                "paginationToken": {
                                  "type": "string",
                                  "nullable": true
                                }
                              }
                            }
                          }
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          }
        },
        "x-mint": {
          "mcp": {
            "enabled": true
          }
        }
      },
      "post": {
        "tags": [
          "Pay API · PayrollConfig"
        ],
        "summary": "Create a new payroll configuration",
        "description": "Needs permission organisation-settings:write.",
        "operationId": "Pay_CreatePayrollConfig",
        "x-flow-permission": "organisation-settings:write",
        "parameters": [
          {
            "$ref": "#/components/parameters/Pay_Request-Id"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Pay_UpdateablePayrollConfigDto"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Payroll Configuration Created",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Pay_ResponseBody"
                    },
                    {
                      "properties": {
                        "content": {
                          "type": "object",
                          "properties": {
                            "data": {
                              "$ref": "#/components/schemas/Pay_PayrollConfigDto"
                            }
                          }
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "409": {
            "description": "A payroll configuration with the same name already exists",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          }
        }
      }
    },
    "/v1/payrollconfig/{payrollConfigId}": {
      "get": {
        "tags": [
          "Pay API · PayrollConfig"
        ],
        "summary": "Read a payroll configuration",
        "description": "Needs permission organisation-settings:read, or any of pay-run:read.",
        "operationId": "Pay_ReadPayrollConfig",
        "x-flow-permission": "organisation-settings:read",
        "parameters": [
          {
            "name": "payrollConfigId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/Pay_Request-Id"
          }
        ],
        "x-flow-permission-also-accepts": [
          "pay-run:read"
        ],
        "responses": {
          "200": {
            "description": "Payroll Configuration Retrieved",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Pay_ResponseBody"
                    },
                    {
                      "properties": {
                        "content": {
                          "type": "object",
                          "properties": {
                            "data": {
                              "$ref": "#/components/schemas/Pay_PayrollConfigDto"
                            }
                          }
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "404": {
            "description": "Payroll Configuration not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          }
        },
        "x-mint": {
          "mcp": {
            "enabled": true
          }
        }
      },
      "put": {
        "tags": [
          "Pay API · PayrollConfig"
        ],
        "summary": "Update a payroll configuration",
        "description": "Needs permission organisation-settings:write.",
        "operationId": "Pay_UpdatePayrollConfig",
        "x-flow-permission": "organisation-settings:write",
        "parameters": [
          {
            "name": "payrollConfigId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/Pay_Request-Id"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Pay_UpdateablePayrollConfigDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Payroll Configuration Updated",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Pay_ResponseBody"
                    },
                    {
                      "properties": {
                        "content": {
                          "type": "object",
                          "properties": {
                            "data": {
                              "$ref": "#/components/schemas/Pay_PayrollConfigDto"
                            }
                          }
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "404": {
            "description": "Payroll Configuration not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "409": {
            "description": "A payroll configuration with the same name already exists, or the pay frequency or payment period configuration was changed on a payroll configuration that already has pay runs",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "Pay API · PayrollConfig"
        ],
        "summary": "Delete a payroll configuration",
        "description": "Needs permission organisation-settings:write.",
        "operationId": "Pay_DeletePayrollConfig",
        "x-flow-permission": "organisation-settings:write",
        "parameters": [
          {
            "name": "payrollConfigId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/Pay_Request-Id"
          }
        ],
        "responses": {
          "200": {
            "description": "Payroll Configuration Deleted",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Pay_ResponseBody"
                    },
                    {
                      "properties": {
                        "content": {
                          "type": "object",
                          "properties": {
                            "data": {
                              "$ref": "#/components/schemas/Pay_PayrollConfigDto"
                            }
                          }
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Could not delete payroll configuration",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "404": {
            "description": "Payroll Configuration not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          }
        }
      }
    },
    "/v1/payrollconfig/{payrollConfigId}/working-pattern-defaults": {
      "get": {
        "tags": [
          "Pay API · PayrollConfig"
        ],
        "summary": "Get a payroll config's default working pattern (overrides the organisation default)",
        "description": "Needs permission working-pattern:read.\n\nReturns the default for one payroll config, which overrides the organisation default for employees in that payroll config who have no pattern of their own. Responds with an empty default rather than 404 when none has been set.",
        "operationId": "Pay_GetPayrollConfigWorkingPatternDefaults",
        "x-flow-permission": "working-pattern:read",
        "parameters": [
          {
            "name": "payrollConfigId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The ID of the payroll config"
          },
          {
            "$ref": "#/components/parameters/Pay_Request-Id"
          }
        ],
        "responses": {
          "200": {
            "description": "Working pattern defaults retrieved successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Pay_ResponseBody"
                    },
                    {
                      "properties": {
                        "content": {
                          "type": "object",
                          "properties": {
                            "data": {
                              "$ref": "#/components/schemas/Pay_WorkingPatternDefaultsDto"
                            }
                          }
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "500": {
            "description": "An internal server error occurred",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          }
        },
        "x-mint": {
          "mcp": {
            "enabled": true
          }
        }
      },
      "post": {
        "tags": [
          "Pay API · PayrollConfig"
        ],
        "summary": "Set a payroll config's default working pattern (overrides the organisation default)",
        "description": "Needs permission working-pattern:write.\n\nReplaces the default for one payroll config, overriding the organisation default for employees in it who have no pattern of their own. An employee's own pattern still takes precedence over this.",
        "operationId": "Pay_UpdatePayrollConfigWorkingPatternDefaults",
        "x-flow-permission": "working-pattern:write",
        "parameters": [
          {
            "name": "payrollConfigId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The ID of the payroll config"
          },
          {
            "$ref": "#/components/parameters/Pay_Request-Id"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Pay_WorkingPatternDefaultsDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Working pattern defaults saved successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Pay_ResponseBody"
                    },
                    {
                      "properties": {
                        "content": {
                          "type": "object",
                          "properties": {
                            "data": {
                              "$ref": "#/components/schemas/Pay_WorkingPatternDefaultsDto"
                            }
                          }
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request data",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "500": {
            "description": "An internal server error occurred",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          }
        }
      }
    },
    "/v1/payslip/data/{employeeId}": {
      "get": {
        "tags": [
          "Pay API · Payslip"
        ],
        "summary": "Get all payslip data for an employee within a date range",
        "description": "Needs permission pay-run:read.\n\nRetrieves all payslip data for a specific employee within a specified date range. If no date range is provided, defaults to the last year from today.",
        "operationId": "Pay_GetAllPayslipData",
        "x-flow-permission": "pay-run:read",
        "parameters": [
          {
            "name": "employeeId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "ID of the employee",
            "example": "EMP01JPW80Q2B7Q9RGGRY29VGC8WM"
          },
          {
            "name": "beginDate",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date"
            },
            "description": "Start date for the payslip search range (YYYY-MM-DD format). Defaults to one year before endDate.",
            "example": "2024-01-01"
          },
          {
            "name": "endDate",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date"
            },
            "description": "End date for the payslip search range (YYYY-MM-DD format). Defaults to today.",
            "example": "2024-12-31"
          },
          {
            "$ref": "#/components/parameters/Pay_Request-Id"
          }
        ],
        "responses": {
          "200": {
            "description": "All payslip data retrieved successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Pay_ResponseBody"
                    },
                    {
                      "properties": {
                        "content": {
                          "type": "object",
                          "properties": {
                            "data": {
                              "type": "array",
                              "items": {
                                "$ref": "#/components/schemas/Pay_Payslip"
                              }
                            }
                          }
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Bad Request - Invalid date format or date range",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                },
                "example": {
                  "message": {
                    "text": "Invalid beginDate format",
                    "token": "invalidBeginDateFormat",
                    "tokenArguments": [
                      {
                        "name": "beginDate",
                        "value": "invalid-date"
                      }
                    ]
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "404": {
            "description": "Employee not found or payroll config not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                },
                "example": {
                  "message": {
                    "text": "Employee Id Does Not Exist",
                    "token": "employeeIdDoesNotExist",
                    "tokenArguments": [
                      {
                        "name": "employeeId",
                        "value": "EMP01JPW80Q2B7Q9RGGRY29VGC8WM"
                      }
                    ]
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal Server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                },
                "example": {
                  "message": {
                    "text": "Internal Server Error for requestId req-123456",
                    "token": "getPayslipDataInternalServerError",
                    "tokenArguments": [
                      {
                        "name": "requestId",
                        "value": "req-123456"
                      }
                    ]
                  }
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          }
        },
        "x-mint": {
          "mcp": {
            "enabled": true
          }
        }
      }
    },
    "/v1/payslip/data/{employeeId}/{year}/{period}": {
      "get": {
        "tags": [
          "Pay API · Payslip"
        ],
        "summary": "Get payslip data for an employee",
        "description": "Needs permission pay-run:read.\n\nRetrieves the payslip data for a specific employee in a given year and period",
        "operationId": "Pay_GetPayslipData",
        "x-flow-permission": "pay-run:read",
        "parameters": [
          {
            "name": "year",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            },
            "description": "Year of the payslip",
            "example": 2024
          },
          {
            "name": "period",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            },
            "description": "Pay period number within the year",
            "example": 2
          },
          {
            "name": "employeeId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "ID of the employee",
            "example": "EMP01JPW80Q2B7Q9RGGRY29VGC8WM"
          },
          {
            "name": "forceGenerate",
            "in": "query",
            "required": false,
            "schema": {
              "type": "boolean"
            },
            "description": "Optional flag to force the generation of a payslip. If true, the payslip will be generated even if it already exists.",
            "example": false
          },
          {
            "name": "frequency",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "Annual",
                "Monthly",
                "FourWeekly",
                "Fortnightly",
                "Weekly",
                "Daily",
                "Quarterly",
                "BiAnnually"
              ]
            },
            "description": "Optional payment frequency override. When provided, overrides the frequency from the employee's payroll config.",
            "example": "Monthly"
          },
          {
            "$ref": "#/components/parameters/Pay_Request-Id"
          }
        ],
        "responses": {
          "200": {
            "description": "Payslip data retrieved successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Pay_ResponseBody"
                    },
                    {
                      "properties": {
                        "content": {
                          "type": "object",
                          "properties": {
                            "data": {
                              "$ref": "#/components/schemas/Pay_Payslip"
                            }
                          }
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Bad Request - Invalid frequency parameter or unsupported formula",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "404": {
            "description": "Employee not found or payroll config not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                },
                "example": {
                  "message": {
                    "text": "Employee Id Does Not Exist",
                    "token": "employeeIdDoesNotExist",
                    "tokenArguments": [
                      {
                        "name": "employeeId",
                        "value": "EMP01JPW80Q2B7Q9RGGRY29VGC8WM"
                      }
                    ]
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal Server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                },
                "example": {
                  "message": {
                    "text": "Internal Server Error for requestId req-123456",
                    "token": "getPayslipDataInternalServerError",
                    "tokenArguments": [
                      {
                        "name": "requestId",
                        "value": "req-123456"
                      }
                    ]
                  }
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          }
        },
        "x-mint": {
          "mcp": {
            "enabled": true
          }
        }
      },
      "post": {
        "tags": [
          "Pay API · Payslip"
        ],
        "summary": "Create or update payslip metadata such as notes and payment date overwrite",
        "description": "Needs permission pay-run:write.\n\nCreates or updates data for a specific employee's payslip in a given year and period. The data is associated with the specific payroll configuration.",
        "operationId": "Pay_UpdatePayslipData",
        "x-flow-permission": "pay-run:write",
        "parameters": [
          {
            "name": "employeeId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "ID of the employee",
            "example": "EMP01JPW80Q2B7Q9RGGRY29VGC8WM"
          },
          {
            "name": "year",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            },
            "description": "Year of the payslip",
            "example": 2024
          },
          {
            "name": "period",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            },
            "description": "Pay period number within the year",
            "example": 2
          },
          {
            "$ref": "#/components/parameters/Pay_Request-Id"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Pay_PayslipMetadataDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Payslip metadata created or updated successfully",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                },
                "example": {
                  "message": {
                    "text": "Payslip metadata added or updated",
                    "token": "payslipMetadataAddedOrUpdated"
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                },
                "example": {
                  "message": {
                    "text": "Failed to add or update payslip metadata",
                    "token": "failedToAddOrUpdatePayslipMetadata"
                  }
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          }
        }
      }
    },
    "/v1/payslip/data/{employeeId}/{year}/{period}/file": {
      "get": {
        "tags": [
          "Pay API · Payslip"
        ],
        "summary": "Download the payslip as a PDF",
        "description": "Needs permission pay-run:read.\n\nReturns the employee's payslip for the given year and period as a PDF. The file is not password-protected; the copy emailed to the employee is, with their date of birth. With lockCycle, returns the payslip as it stood when its pay run was locked for that cycle: the document that lock issued, kept when the pay run was unlocked.",
        "operationId": "Pay_GetPayslipFile",
        "x-flow-permission": "pay-run:read",
        "parameters": [
          {
            "name": "year",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            },
            "description": "Tax year of the payslip",
            "example": 2024
          },
          {
            "name": "period",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            },
            "description": "Pay period number within the year",
            "example": 2
          },
          {
            "name": "employeeId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "ID of the employee",
            "example": "EMP01JPW80Q2B7Q9RGGRY29VGC8WM"
          },
          {
            "name": "frequency",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "Annual",
                "Monthly",
                "FourWeekly",
                "Fortnightly",
                "Weekly",
                "Daily",
                "Quarterly",
                "BiAnnually"
              ]
            },
            "description": "Optional payment frequency override. When provided, overrides the frequency from the employee's payroll config.",
            "example": "Monthly"
          },
          {
            "name": "lockCycle",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int32"
            },
            "description": "Optional lock cycle. When provided, the PDF of the payslip's version for that cycle (1 = the first lock) instead of the current payslip.",
            "example": 1
          },
          {
            "$ref": "#/components/parameters/Pay_Request-Id"
          }
        ],
        "responses": {
          "200": {
            "description": "The payslip PDF",
            "content": {
              "application/pdf": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "400": {
            "description": "Invalid frequency parameter",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                },
                "example": {
                  "message": {
                    "text": "Invalid frequency parameter",
                    "token": "invalidFrequencyParameter"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "404": {
            "description": "No payslip exists for the employee in that period, or no version was kept for that lock cycle",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                },
                "example": {
                  "message": {
                    "text": "Payslip Not Found",
                    "token": "payslipNotFound"
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal Server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          }
        },
        "x-mint": {
          "mcp": {
            "enabled": true
          }
        }
      }
    },
    "/v1/payslip/data/{employeeId}/{year}/{period}/versions": {
      "get": {
        "tags": [
          "Pay API · Payslip"
        ],
        "summary": "List the earlier versions of a payslip",
        "description": "Needs permission pay-run:read.\n\nLists the earlier versions of an employee's payslip for a year and period: one per lock\ncycle its pay run was unlocked from, oldest first. A payslip whose pay run was never\nunlocked has no versions. The live payslip is GET /payslip/data/{employeeId}/{year}/{period}.",
        "operationId": "Pay_ListPayslipVersions",
        "x-flow-permission": "pay-run:read",
        "parameters": [
          {
            "name": "year",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            },
            "description": "Year of the payslip",
            "example": 2026
          },
          {
            "name": "period",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            },
            "description": "Pay period number within the year",
            "example": 7
          },
          {
            "name": "employeeId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "ID of the employee",
            "example": "EMP01JPW80Q2B7Q9RGGRY29VGC8WM"
          },
          {
            "name": "frequency",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "Annual",
                "Monthly",
                "FourWeekly",
                "Fortnightly",
                "Weekly",
                "Daily",
                "Quarterly",
                "BiAnnually"
              ]
            },
            "description": "Optional payment frequency override. When provided, overrides the frequency from the employee's payroll config.",
            "example": "Monthly"
          },
          {
            "$ref": "#/components/parameters/Pay_Request-Id"
          }
        ],
        "responses": {
          "200": {
            "description": "The payslip versions were retrieved successfully; empty when the pay run was never unlocked",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Pay_ResponseBody"
                    },
                    {
                      "properties": {
                        "content": {
                          "type": "object",
                          "properties": {
                            "data": {
                              "type": "array",
                              "items": {
                                "$ref": "#/components/schemas/Pay_PayslipVersionSummaryDto"
                              }
                            }
                          }
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid frequency parameter",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          }
        },
        "x-mint": {
          "mcp": {
            "enabled": true
          }
        }
      }
    },
    "/v1/payslip/data/{employeeId}/{year}/{period}/versions/{lockCycle}": {
      "get": {
        "tags": [
          "Pay API · Payslip"
        ],
        "summary": "Get a payslip as it stood for a lock cycle",
        "description": "Needs permission pay-run:read.\n\nReturns the employee's payslip exactly as it stood when its pay run was locked for the given lock cycle.",
        "operationId": "Pay_GetPayslipVersion",
        "x-flow-permission": "pay-run:read",
        "parameters": [
          {
            "name": "year",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            },
            "description": "Year of the payslip",
            "example": 2026
          },
          {
            "name": "period",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            },
            "description": "Pay period number within the year",
            "example": 7
          },
          {
            "name": "employeeId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "ID of the employee",
            "example": "EMP01JPW80Q2B7Q9RGGRY29VGC8WM"
          },
          {
            "name": "lockCycle",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            },
            "description": "The lock cycle the version belongs to (1 = the first lock)",
            "example": 1
          },
          {
            "name": "frequency",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "Annual",
                "Monthly",
                "FourWeekly",
                "Fortnightly",
                "Weekly",
                "Daily",
                "Quarterly",
                "BiAnnually"
              ]
            },
            "description": "Optional payment frequency override. When provided, overrides the frequency from the employee's payroll config.",
            "example": "Monthly"
          },
          {
            "$ref": "#/components/parameters/Pay_Request-Id"
          }
        ],
        "responses": {
          "200": {
            "description": "The payslip version was retrieved successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Pay_ResponseBody"
                    },
                    {
                      "properties": {
                        "content": {
                          "type": "object",
                          "properties": {
                            "data": {
                              "$ref": "#/components/schemas/Pay_PayslipVersionDto"
                            }
                          }
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid frequency parameter",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "404": {
            "description": "No version of the payslip was kept for that lock cycle",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          }
        },
        "x-mint": {
          "mcp": {
            "enabled": true
          }
        }
      }
    },
    "/v1/payslip/payrun/{payrollConfigId}/{year}/{period}": {
      "get": {
        "tags": [
          "Pay API · Payslip"
        ],
        "summary": "Get all payslips by pay run",
        "description": "Needs permission pay-run:read.\n\nRetrieves all payslips for a specific pay run identified by payroll config ID, year, and period. The frequency is automatically determined from the payroll configuration. Supports pagination for large result sets. Supports gzip compression — send Accept: application/gzip header to receive compressed responses for better performance with large datasets. Small responses are returned as normal JSON. Clients decompress automatically via the Content-Encoding: gzip header.",
        "operationId": "Pay_GetPayslipsByPayRun",
        "x-flow-permission": "pay-run:read",
        "parameters": [
          {
            "name": "payrollConfigId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "ID of the payroll configuration",
            "example": "01JNR9P81W74HYCN35X1EEFDZE"
          },
          {
            "name": "year",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            },
            "description": "Year of the pay run",
            "example": 2024
          },
          {
            "name": "period",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            },
            "description": "Pay period number within the year",
            "example": 2
          },
          {
            "name": "pageSize",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "paginationToken",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "includeAttachments",
            "in": "query",
            "required": false,
            "schema": {
              "type": "boolean"
            },
            "description": "Whether to include attachment URLs on payslip summary items. Set to false for faster bulk loading when attachments are not needed."
          },
          {
            "$ref": "#/components/parameters/Pay_Request-Id"
          }
        ],
        "responses": {
          "200": {
            "description": "Payslips by pay run retrieved successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Pay_ResponseBody"
                    },
                    {
                      "properties": {
                        "content": {
                          "type": "object",
                          "properties": {
                            "data": {
                              "type": "array",
                              "items": {
                                "$ref": "#/components/schemas/Pay_Payslip"
                              }
                            },
                            "metadata": {
                              "type": "object",
                              "properties": {
                                "paginationToken": {
                                  "type": "string",
                                  "nullable": true
                                }
                              }
                            }
                          }
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "404": {
            "description": "Payroll configuration not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                },
                "example": {
                  "message": {
                    "text": "Payroll Config Not Found",
                    "token": "payrollConfigNotFound",
                    "tokenArguments": [
                      {
                        "name": "payrollConfigId",
                        "value": "01JNR9P81W74HYCN35X1EEFDZE"
                      }
                    ]
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal Server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                },
                "example": {
                  "message": {
                    "text": "Internal Server Error for requestId req-123456",
                    "token": "getPayslipsByPayRunInternalServerError",
                    "tokenArguments": [
                      {
                        "name": "requestId",
                        "value": "req-123456"
                      }
                    ]
                  }
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          }
        },
        "x-mint": {
          "mcp": {
            "enabled": true
          }
        }
      }
    },
    "/v1/payslip/recalculate": {
      "post": {
        "tags": [
          "Pay API · Payslip"
        ],
        "summary": "Recalculate payslips for employees in the open pay run",
        "description": "Needs permission pay-run:write.\n\nQueues a payslip recalculation for each employee given, in the organisation's currently open pay run. Each employee is reported on separately, so a partial success returns 200 with the failures described in the results rather than an error for the whole request.",
        "operationId": "Pay_RecalculatePayslips",
        "x-flow-permission": "pay-run:write",
        "parameters": [
          {
            "$ref": "#/components/parameters/Pay_Request-Id"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Pay_PayslipRecalculationRequestDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Every employee in the request was processed, successfully or not",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Pay_ResponseBody"
                    },
                    {
                      "properties": {
                        "content": {
                          "type": "object",
                          "properties": {
                            "data": {
                              "type": "array",
                              "items": {
                                "$ref": "#/components/schemas/Pay_PayslipRecalculationResultDto"
                              }
                            }
                          }
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "The request was rejected",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "500": {
            "description": "An error occurred",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          }
        }
      }
    },
    "/v1/payslip/samples": {
      "post": {
        "tags": [
          "Pay API · Payslip"
        ],
        "summary": "Make a sample payslip in your brand draft",
        "description": "Needs permission pay-run:read.\n\nReturns a made-up payslip as a PDF, drawn in your account's unpublished brand draft, so you can see a brand before you publish it. Send nothing to draw the saved draft, or send unsaved changes to draw them without saving. The account comes from your credentials. Nothing is stored and nothing is sent.",
        "operationId": "Pay_CreatePayslipSample",
        "x-flow-permission": "pay-run:read",
        "parameters": [
          {
            "name": "companyLogo",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "sample"
              ]
            },
            "description": "Send `sample` to draw it as an organisation with its own logo sees it, with a made-up company logo and your brand as \"Powered by\"."
          },
          {
            "$ref": "#/components/parameters/Pay_Request-Id"
          }
        ],
        "requestBody": {
          "description": "Unsaved changes to your brand draft, as a merge patch of the brand draft without `version`. Up to 16 KB. Every field is checked as a save would check it.",
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              },
              "example": {
                "primaryColour": "#0B7A75",
                "documentsShowProductName": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The sample payslip PDF",
            "content": {
              "application/pdf": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "400": {
            "description": "The changes could not be read, or a change is one a save of the draft would refuse",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                },
                "example": {
                  "message": {
                    "text": "The changes to preview could not be read. Reload the page and try again.",
                    "token": "payslip_sample_changes_invalid"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Your sign-in is not linked to an account",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                },
                "example": {
                  "message": {
                    "text": "Your sign-in is not linked to an account, so there is no brand to show. Sign out, sign back in and try again.",
                    "token": "payslip_sample_no_account"
                  }
                }
              }
            }
          },
          "404": {
            "description": "Your account has never saved a brand draft (only when no changes are sent)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                },
                "example": {
                  "message": {
                    "text": "There is no saved brand draft yet, so no sample payslip was made. Save your brand, then try again.",
                    "token": "payslip_sample_no_draft"
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "502": {
            "description": "Your brand draft could not be loaded. Try again in a minute.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          }
        }
      }
    },
    "/v1/rti/eps/monthly-balances/{taxYear}/{taxMonth}": {
      "post": {
        "tags": [
          "Pay API · RTI"
        ],
        "summary": "Submit EPS from monthly balances",
        "description": "Needs permission rti:submit.\n\nSubmit an EPS (Employer Payment Summary) to HMRC based on monthly balances for a specific tax year and month. The tax years 2024, 2025, 2026 and 2027 (the year each starts in) are supported, and every one reads the optional body as FinalSubmissionDetailsY2024To2026Dto. Any other tax year answers 500 `hmrcRtiEpsError`.",
        "operationId": "Pay_submitEpsFromMonthlyBalances",
        "x-flow-permission": "rti:submit",
        "parameters": [
          {
            "name": "taxYear",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            },
            "description": "The tax year to submit EPS for"
          },
          {
            "name": "taxMonth",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            },
            "description": "The tax month to submit EPS for"
          },
          {
            "name": "preview",
            "in": "query",
            "required": false,
            "schema": {
              "type": "boolean"
            },
            "description": "Whether to generate a preview without submitting to HMRC"
          },
          {
            "$ref": "#/components/parameters/Pay_Request-Id"
          }
        ],
        "requestBody": {
          "description": "Optional. The final submission details, for the last EPS of the tax year; omit the body otherwise.",
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Pay_FinalSubmissionDetailsY2024To2026Dto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "EPS submission preview generated successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Pay_ResponseBody"
                    },
                    {
                      "properties": {
                        "content": {
                          "type": "object",
                          "properties": {
                            "data": {
                              "type": "string",
                              "example": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>..."
                            }
                          }
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "202": {
            "description": "EPS submission triggered successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Pay_ResponseBody"
                    },
                    {
                      "properties": {
                        "content": {
                          "type": "object",
                          "properties": {
                            "data": {
                              "$ref": "#/components/schemas/Pay_EpsSubmissionEntryDto"
                            }
                          }
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request body, tax year, or tax month",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          }
        }
      }
    },
    "/v1/rti/eps/tax-years-with-submissions": {
      "get": {
        "tags": [
          "Pay API · RTI"
        ],
        "summary": "Get tax years with EPS submissions",
        "description": "Needs permission rti:read.",
        "operationId": "Pay_GetTaxYearsWithEpsSubmissions",
        "x-flow-permission": "rti:read",
        "parameters": [
          {
            "$ref": "#/components/parameters/Pay_Request-Id"
          }
        ],
        "responses": {
          "200": {
            "description": "Tax years with EPS submissions retrieved successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Pay_ResponseBody"
                    },
                    {
                      "properties": {
                        "content": {
                          "type": "object",
                          "properties": {
                            "data": {
                              "type": "array",
                              "items": {
                                "$ref": "#/components/schemas/Pay_AvailableDataTaxYear"
                              }
                            }
                          }
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "500": {
            "description": "An error occurred",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          }
        },
        "x-mint": {
          "mcp": {
            "enabled": true
          }
        }
      }
    },
    "/v1/rti/eps/{taxYear}/manual": {
      "post": {
        "tags": [
          "Pay API · RTI"
        ],
        "summary": "Submit EPS manually",
        "description": "Needs permission rti:submit.\n\nManually submit an EPS (Employer Payment Summary) to HMRC for a specific tax year. The tax year in the path (the year it starts in) picks the shape the body is read in: 2024 and 2025 read SendEpsRequestY2025To2026Dto, 2026 and 2027 read SendEpsRequestY2026To2027Dto. Any other tax year answers 400 `hmrcRtiEpsError`.",
        "operationId": "Pay_submitEpsManually",
        "x-flow-permission": "rti:submit",
        "parameters": [
          {
            "name": "taxYear",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            },
            "description": "The tax year to submit EPS for"
          },
          {
            "name": "preview",
            "in": "query",
            "required": false,
            "schema": {
              "type": "boolean"
            },
            "description": "Whether to generate a preview without submitting to HMRC"
          },
          {
            "$ref": "#/components/parameters/Pay_Request-Id"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Pay_SendEpsRequestDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "EPS submission preview generated successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Pay_ResponseBody"
                    },
                    {
                      "properties": {
                        "content": {
                          "type": "object",
                          "properties": {
                            "data": {
                              "type": "string",
                              "example": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>..."
                            }
                          }
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "202": {
            "description": "EPS submission triggered successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Pay_ResponseBody"
                    },
                    {
                      "properties": {
                        "content": {
                          "type": "object",
                          "properties": {
                            "data": {
                              "$ref": "#/components/schemas/Pay_EpsSubmissionEntryDto"
                            }
                          }
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request body or tax year",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          }
        }
      }
    },
    "/v1/rti/eps/{taxYear}/manual/{submissionId}/resubmit": {
      "post": {
        "tags": [
          "Pay API · RTI"
        ],
        "summary": "Resubmit EPS manually",
        "description": "Needs permission rti:submit.\n\nResubmit an EPS (Employer Payment Summary) to HMRC for a specific tax year and submission ID. The tax year in the path (the year it starts in) picks the shape the body is read in: 2024 and 2025 read SendEpsRequestY2025To2026Dto, 2026 and 2027 read SendEpsRequestY2026To2027Dto. Any other tax year answers 400 `hmrcRtiEpsError`.",
        "operationId": "Pay_resubmitEpsManually",
        "x-flow-permission": "rti:submit",
        "parameters": [
          {
            "name": "taxYear",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            },
            "description": "The tax year to submit EPS for"
          },
          {
            "name": "submissionId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The submission ID to resubmit"
          },
          {
            "name": "preview",
            "in": "query",
            "required": false,
            "schema": {
              "type": "boolean"
            },
            "description": "Whether to generate a preview without submitting to HMRC"
          },
          {
            "$ref": "#/components/parameters/Pay_Request-Id"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Pay_SendEpsRequestDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "EPS submission preview generated successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Pay_ResponseBody"
                    },
                    {
                      "properties": {
                        "content": {
                          "type": "object",
                          "properties": {
                            "data": {
                              "type": "string",
                              "example": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>..."
                            }
                          }
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "202": {
            "description": "EPS submission triggered successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Pay_ResponseBody"
                    },
                    {
                      "properties": {
                        "content": {
                          "type": "object",
                          "properties": {
                            "data": {
                              "$ref": "#/components/schemas/Pay_EpsSubmissionEntryDto"
                            }
                          }
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request body or tax year",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          }
        }
      }
    },
    "/v1/rti/eps/{taxYear}/submissions": {
      "get": {
        "tags": [
          "Pay API · RTI"
        ],
        "summary": "Get all EPS submissions by tax year",
        "description": "Needs permission rti:read.\n\nRetrieves all EPS submissions for the current organisation for a specific tax year with pagination support",
        "operationId": "Pay_getAllEpsSubmissionsByTaxYear",
        "x-flow-permission": "rti:read",
        "parameters": [
          {
            "name": "taxYear",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            },
            "description": "The tax year to retrieve EPS submissions for"
          },
          {
            "name": "pageSize",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Number of items per page (default: 20, max: 100)"
          },
          {
            "name": "paginationToken",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Token for pagination to get the next page of results"
          },
          {
            "$ref": "#/components/parameters/Pay_Request-Id"
          }
        ],
        "responses": {
          "200": {
            "description": "Successfully retrieved EPS submissions",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Pay_ResponseBody"
                    },
                    {
                      "properties": {
                        "content": {
                          "type": "object",
                          "properties": {
                            "data": {
                              "type": "array",
                              "items": {
                                "$ref": "#/components/schemas/Pay_EpsSubmissionEntryDto"
                              }
                            },
                            "metadata": {
                              "type": "object",
                              "properties": {
                                "paginationToken": {
                                  "type": "string",
                                  "nullable": true
                                }
                              }
                            }
                          }
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid tax year or pagination parameters",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          }
        },
        "x-mint": {
          "mcp": {
            "enabled": true
          }
        }
      }
    },
    "/v1/rti/eps/{taxYear}/submissions/{submissionId}": {
      "get": {
        "tags": [
          "Pay API · RTI"
        ],
        "summary": "Get EPS submission by tax year and submission ID",
        "description": "Needs permission rti:read.\n\nRetrieves a specific EPS submission for the current organisation by tax year and submission ID",
        "operationId": "Pay_getEpsSubmissionByTaxYearAndSubmissionId",
        "x-flow-permission": "rti:read",
        "parameters": [
          {
            "name": "taxYear",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            },
            "description": "The tax year of the EPS submission"
          },
          {
            "name": "submissionId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The unique submission ID"
          },
          {
            "$ref": "#/components/parameters/Pay_Request-Id"
          }
        ],
        "responses": {
          "200": {
            "description": "Successfully retrieved EPS submission",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Pay_ResponseBody"
                    },
                    {
                      "properties": {
                        "content": {
                          "type": "object",
                          "properties": {
                            "data": {
                              "$ref": "#/components/schemas/Pay_EpsSubmissionEntryDto"
                            }
                          }
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "404": {
            "description": "EPS submission not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          }
        },
        "x-mint": {
          "mcp": {
            "enabled": true
          }
        }
      }
    },
    "/v1/rti/fps/{payrollConfigId}/{taxYear}/{period}": {
      "get": {
        "tags": [
          "Pay API · RTI"
        ],
        "summary": "Get HMRC RTI FPS for payroll run",
        "description": "Needs permission rti:read.\n\nRetrieves the HMRC RTI FPS (Full Payment Submission) for a specific payroll run",
        "operationId": "Pay_getHmrcRtiFpsForPayrollRun",
        "x-flow-permission": "rti:read",
        "parameters": [
          {
            "name": "payrollConfigId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The payroll configuration ID"
          },
          {
            "name": "taxYear",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The tax year"
          },
          {
            "name": "period",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The payroll period"
          },
          {
            "$ref": "#/components/parameters/Pay_Request-Id"
          }
        ],
        "responses": {
          "200": {
            "description": "Successfully retrieved HMRC RTI FPS",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Pay_ResponseBody"
                    },
                    {
                      "properties": {
                        "content": {
                          "type": "object",
                          "properties": {
                            "data": {
                              "$ref": "#/components/schemas/Pay_HmrcRtiFpsDto"
                            }
                          }
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request parameters",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "404": {
            "description": "Payroll config or payroll run not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          }
        },
        "x-mint": {
          "mcp": {
            "enabled": true
          }
        }
      },
      "post": {
        "tags": [
          "Pay API · RTI"
        ],
        "summary": "Trigger send HMRC RTI FPS for payroll run",
        "description": "Needs permission rti:submit.\n\nTriggers the sending of HMRC RTI FPS (Full Payment Submission) for a specific payroll run. The tax year in the path (the year it starts in) must be 2024, 2025 or 2026; any other answers 400 `hmrcRtiFpsUnsupportedTaxYear`. Every supported tax year reads `finalSubmissionDetails` as FinalSubmissionDetailsY2024To2026Dto.",
        "operationId": "Pay_triggerSendHmrcRtiFpsForPayrollRun",
        "x-flow-permission": "rti:submit",
        "parameters": [
          {
            "name": "payrollConfigId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The payroll configuration ID"
          },
          {
            "name": "taxYear",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The tax year"
          },
          {
            "name": "period",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The payroll period"
          },
          {
            "name": "preview",
            "in": "query",
            "required": false,
            "schema": {
              "type": "boolean"
            },
            "description": "Whether to generate a preview without submitting to HMRC"
          },
          {
            "$ref": "#/components/parameters/Pay_Request-Id"
          }
        ],
        "requestBody": {
          "description": "Optional. Carries the final submission details (required for the last period of the tax year) and the HMRC late reporting reason. The body may be omitted when neither applies. Sending the bare final submission details object as the body (the shape before `finalSubmissionDetails` and `lateReason` existed) is deprecated as input since 5 October 2026 and stops being accepted on 15 January 2027; until then it is read as `finalSubmissionDetails` with no late reason, and behaves exactly as it did before. Wrap the details in `finalSubmissionDetails` instead.",
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Pay_TriggerFpsSubmissionRequestDto"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "FPS submission triggered successfully",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request, payroll run not completed, final submission details required, or an unrecognised or withdrawn late reporting reason",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Pay_ResponseBody"
                    },
                    {
                      "properties": {
                        "content": {
                          "type": "object",
                          "properties": {
                            "data": {
                              "$ref": "#/components/schemas/Pay_FinalSubmissionErrorResponseDto"
                            }
                          }
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "404": {
            "description": "Payroll config, payroll run, or HMRC settings not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "409": {
            "description": "Payroll run already submitted to HMRC",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pay_ResponseBody"
                }
              }
            }
          }
        }
      }
    },
    "/v1/statutory-pay/calculations/employees/{employeeId}": {
      "post": {
        "tags": [
          "Statutory pay · Statutory Calculations"
        ],
        "summary": "Preview statutory pay for an employee",
        "description": "Needs permission pay-run:read.\n\nWorks out what the employee would be paid, using their pay history, without saving anything.",
        "operationId": "Statutory_CalculateEmployeeStatutoryPayPreview",
        "parameters": [
          {
            "name": "employeeId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "oneOf": [
                  {
                    "$ref": "#/components/schemas/Statutory_CalculateStatutorySickPayRequest"
                  },
                  {
                    "$ref": "#/components/schemas/Statutory_CalculateStatutoryMaternityPayRequest"
                  },
                  {
                    "$ref": "#/components/schemas/Statutory_CalculateStatutoryPaternityPayRequest"
                  },
                  {
                    "$ref": "#/components/schemas/Statutory_CalculateStatutoryAdoptionPayRequest"
                  },
                  {
                    "$ref": "#/components/schemas/Statutory_CalculateStatutoryParentalBereavementPayRequest"
                  },
                  {
                    "$ref": "#/components/schemas/Statutory_CalculateStatutorySharedParentalPayRequest"
                  },
                  {
                    "$ref": "#/components/schemas/Statutory_CalculateStatutoryNeoNatalCarePayRequest"
                  }
                ],
                "discriminator": {
                  "propertyName": "statutoryType",
                  "mapping": {
                    "StatutorySickPay": "#/components/schemas/Statutory_CalculateStatutorySickPayRequest",
                    "StatutoryMaternityPay": "#/components/schemas/Statutory_CalculateStatutoryMaternityPayRequest",
                    "StatutoryPaternityPay": "#/components/schemas/Statutory_CalculateStatutoryPaternityPayRequest",
                    "StatutoryAdoptionPay": "#/components/schemas/Statutory_CalculateStatutoryAdoptionPayRequest",
                    "StatutoryParentalBereavementPay": "#/components/schemas/Statutory_CalculateStatutoryParentalBereavementPayRequest",
                    "StatutorySharedParentalPay": "#/components/schemas/Statutory_CalculateStatutorySharedParentalPayRequest",
                    "StatutoryNeoNatalCarePay": "#/components/schemas/Statutory_CalculateStatutoryNeoNatalCarePayRequest"
                  }
                }
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Statutory_ResponseBody_CalculatorOutputResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Statutory_ApiErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Statutory_ApiErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Statutory_ApiErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Statutory_ApiErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Statutory_ApiErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Statutory_ApiErrorResponse"
                }
              }
            }
          },
          "502": {
            "description": "Bad Gateway",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Statutory_ApiErrorResponse"
                }
              }
            }
          },
          "504": {
            "description": "Gateway Timeout",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Statutory_ApiErrorResponse"
                }
              }
            }
          }
        },
        "x-flow-permission": "pay-run:read"
      }
    },
    "/v1/statutory-pay/calculations/preview": {
      "post": {
        "tags": [
          "Statutory pay · Statutory Calculations"
        ],
        "summary": "Preview statutory pay from the details you send",
        "description": "Needs permission pay-run:read.\n\nWorks out statutory pay from the earnings and dates in the request, without saving anything.",
        "operationId": "Statutory_CalculateStatutoryPayPreview",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "oneOf": [
                  {
                    "$ref": "#/components/schemas/Statutory_StatutorySickPayPreviewBodyDto"
                  },
                  {
                    "$ref": "#/components/schemas/Statutory_StatutoryMaternityPayPreviewBodyDto"
                  },
                  {
                    "$ref": "#/components/schemas/Statutory_StatutoryPaternityPayPreviewBodyDto"
                  },
                  {
                    "$ref": "#/components/schemas/Statutory_StatutoryAdoptionPayPreviewBodyDto"
                  },
                  {
                    "$ref": "#/components/schemas/Statutory_StatutoryParentalBereavementPayPreviewBodyDto"
                  },
                  {
                    "$ref": "#/components/schemas/Statutory_StatutorySharedParentalPayPreviewBodyDto"
                  },
                  {
                    "$ref": "#/components/schemas/Statutory_StatutoryNeoNatalCarePayPreviewBodyDto"
                  }
                ],
                "discriminator": {
                  "propertyName": "statutoryType",
                  "mapping": {
                    "StatutorySickPay": "#/components/schemas/Statutory_StatutorySickPayPreviewBodyDto",
                    "StatutoryMaternityPay": "#/components/schemas/Statutory_StatutoryMaternityPayPreviewBodyDto",
                    "StatutoryPaternityPay": "#/components/schemas/Statutory_StatutoryPaternityPayPreviewBodyDto",
                    "StatutoryAdoptionPay": "#/components/schemas/Statutory_StatutoryAdoptionPayPreviewBodyDto",
                    "StatutoryParentalBereavementPay": "#/components/schemas/Statutory_StatutoryParentalBereavementPayPreviewBodyDto",
                    "StatutorySharedParentalPay": "#/components/schemas/Statutory_StatutorySharedParentalPayPreviewBodyDto",
                    "StatutoryNeoNatalCarePay": "#/components/schemas/Statutory_StatutoryNeoNatalCarePayPreviewBodyDto"
                  }
                }
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Statutory_ResponseBody_CalculatorOutputResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Statutory_ApiErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Statutory_ApiErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Statutory_ApiErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Statutory_ApiErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Statutory_ApiErrorResponse"
                }
              }
            }
          },
          "502": {
            "description": "Bad Gateway",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Statutory_ApiErrorResponse"
                }
              }
            }
          },
          "504": {
            "description": "Gateway Timeout",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Statutory_ApiErrorResponse"
                }
              }
            }
          }
        },
        "x-flow-permission": "pay-run:read"
      }
    },
    "/v1/statutory-pay/calculations/employees/{employeeId}/linking": {
      "post": {
        "tags": [
          "Statutory pay · Statutory Calculations"
        ],
        "summary": "Check whether a sickness absence links to an earlier one",
        "description": "Needs permission pay-run:read.\n\nLinked periods of incapacity for work share waiting days and the 28-week SSP limit.",
        "operationId": "Statutory_CheckLinkingPeriods",
        "parameters": [
          {
            "name": "employeeId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Statutory_CheckLinkingPeriodsRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Statutory_ResponseBody_CheckLinkingPeriodsResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Statutory_ApiErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Statutory_ApiErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Statutory_ApiErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Statutory_ApiErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Statutory_ApiErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Statutory_ApiErrorResponse"
                }
              }
            }
          },
          "502": {
            "description": "Bad Gateway",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Statutory_ApiErrorResponse"
                }
              }
            }
          },
          "504": {
            "description": "Gateway Timeout",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Statutory_ApiErrorResponse"
                }
              }
            }
          }
        },
        "x-flow-permission": "pay-run:read"
      }
    },
    "/v1/statutory-pay/calculations/employees/{employeeId}/history": {
      "get": {
        "tags": [
          "Statutory pay · Statutory Calculations"
        ],
        "summary": "Get an employee's statutory pay history used in calculations",
        "description": "Needs permission pay-run:read.",
        "operationId": "Statutory_GetStatutoryHistory",
        "parameters": [
          {
            "name": "employeeId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Statutory_ResponseBody_StatutoryHistoryResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Statutory_ApiErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Statutory_ApiErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Statutory_ApiErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Statutory_ApiErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Statutory_ApiErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Statutory_ApiErrorResponse"
                }
              }
            }
          },
          "502": {
            "description": "Bad Gateway",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Statutory_ApiErrorResponse"
                }
              }
            }
          },
          "504": {
            "description": "Gateway Timeout",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Statutory_ApiErrorResponse"
                }
              }
            }
          }
        },
        "x-flow-permission": "pay-run:read"
      }
    },
    "/v1/statutory-pay/payments/employees/{employeeId}": {
      "post": {
        "tags": [
          "Statutory pay · Statutory payments"
        ],
        "summary": "Create a statutory payment for an employee",
        "description": "Needs permission pay-run:write.\n\nCalculates and saves the payment, and schedules its payslip lines into the employee's pay runs.",
        "operationId": "Statutory_CreateEmployeeStatutoryPay",
        "parameters": [
          {
            "name": "employeeId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "source",
            "in": "query",
            "schema": {
              "enum": [
                "WizardCreate",
                "WizardImport",
                "ApiCreate",
                "ApiImport",
                "CsvImport"
              ],
              "type": "string",
              "nullable": true
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "oneOf": [
                  {
                    "$ref": "#/components/schemas/Statutory_CalculateStatutorySickPayRequest"
                  },
                  {
                    "$ref": "#/components/schemas/Statutory_CalculateStatutoryMaternityPayRequest"
                  },
                  {
                    "$ref": "#/components/schemas/Statutory_CalculateStatutoryPaternityPayRequest"
                  },
                  {
                    "$ref": "#/components/schemas/Statutory_CalculateStatutoryAdoptionPayRequest"
                  },
                  {
                    "$ref": "#/components/schemas/Statutory_CalculateStatutoryParentalBereavementPayRequest"
                  },
                  {
                    "$ref": "#/components/schemas/Statutory_CalculateStatutorySharedParentalPayRequest"
                  },
                  {
                    "$ref": "#/components/schemas/Statutory_CalculateStatutoryNeoNatalCarePayRequest"
                  }
                ],
                "discriminator": {
                  "propertyName": "statutoryType",
                  "mapping": {
                    "StatutorySickPay": "#/components/schemas/Statutory_CalculateStatutorySickPayRequest",
                    "StatutoryMaternityPay": "#/components/schemas/Statutory_CalculateStatutoryMaternityPayRequest",
                    "StatutoryPaternityPay": "#/components/schemas/Statutory_CalculateStatutoryPaternityPayRequest",
                    "StatutoryAdoptionPay": "#/components/schemas/Statutory_CalculateStatutoryAdoptionPayRequest",
                    "StatutoryParentalBereavementPay": "#/components/schemas/Statutory_CalculateStatutoryParentalBereavementPayRequest",
                    "StatutorySharedParentalPay": "#/components/schemas/Statutory_CalculateStatutorySharedParentalPayRequest",
                    "StatutoryNeoNatalCarePay": "#/components/schemas/Statutory_CalculateStatutoryNeoNatalCarePayRequest"
                  }
                }
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Statutory_ResponseBody_CalculatorOutputResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Statutory_ApiErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Statutory_ApiErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Statutory_ApiErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Statutory_ApiErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Statutory_ApiErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Statutory_ApiErrorResponse"
                }
              }
            }
          },
          "502": {
            "description": "Bad Gateway",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Statutory_ApiErrorResponse"
                }
              }
            }
          },
          "504": {
            "description": "Gateway Timeout",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Statutory_ApiErrorResponse"
                }
              }
            }
          }
        },
        "x-flow-permission": "pay-run:write"
      },
      "get": {
        "tags": [
          "Statutory pay · Statutory payments"
        ],
        "summary": "List an employee's statutory payments",
        "description": "Needs permission pay-run:read.\n\nFilter by status or type. Results are paged: pass the returned paginationToken to get the next page.",
        "operationId": "Statutory_GetEmployeeStatutoryPayments",
        "parameters": [
          {
            "name": "employeeId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "status",
            "in": "query",
            "schema": {
              "enum": [
                "Pending",
                "InProgress",
                "Paid"
              ],
              "type": "string",
              "nullable": true
            }
          },
          {
            "name": "statutoryPayType",
            "in": "query",
            "schema": {
              "enum": [
                "None",
                "StatutorySickPay",
                "StatutoryMaternityPay",
                "StatutoryPaternityPay",
                "StatutoryAdoptionPay",
                "StatutoryParentalBereavementPay",
                "StatutorySharedParentalPay",
                "StatutoryNeoNatalCarePay"
              ],
              "type": "string",
              "nullable": true
            }
          },
          {
            "name": "pageSize",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "paginationToken",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Statutory_ResponseBody_IEnumerable_StatutoryPayResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Statutory_ApiErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Statutory_ApiErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Statutory_ApiErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Statutory_ApiErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Statutory_ApiErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Statutory_ApiErrorResponse"
                }
              }
            }
          },
          "502": {
            "description": "Bad Gateway",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Statutory_ApiErrorResponse"
                }
              }
            }
          },
          "504": {
            "description": "Gateway Timeout",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Statutory_ApiErrorResponse"
                }
              }
            }
          }
        },
        "x-flow-permission": "pay-run:read"
      }
    },
    "/v1/statutory-pay/payments/organisations": {
      "get": {
        "tags": [
          "Statutory pay · Statutory payments"
        ],
        "summary": "List the organisation's statutory payments",
        "description": "Needs permission pay-run:read.\n\nFilter by status or type. Results are paged: pass the returned paginationToken to get the next page.",
        "operationId": "Statutory_GetOrganisationStatutoryPayments",
        "parameters": [
          {
            "name": "status",
            "in": "query",
            "schema": {
              "enum": [
                "Pending",
                "InProgress",
                "Paid"
              ],
              "type": "string",
              "nullable": true
            }
          },
          {
            "name": "statutoryPayType",
            "in": "query",
            "schema": {
              "enum": [
                "None",
                "StatutorySickPay",
                "StatutoryMaternityPay",
                "StatutoryPaternityPay",
                "StatutoryAdoptionPay",
                "StatutoryParentalBereavementPay",
                "StatutorySharedParentalPay",
                "StatutoryNeoNatalCarePay"
              ],
              "type": "string",
              "nullable": true
            }
          },
          {
            "name": "pageSize",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "paginationToken",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Statutory_ResponseBody_IEnumerable_StatutoryPayResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Statutory_ApiErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Statutory_ApiErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Statutory_ApiErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Statutory_ApiErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Statutory_ApiErrorResponse"
                }
              }
            }
          },
          "502": {
            "description": "Bad Gateway",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Statutory_ApiErrorResponse"
                }
              }
            }
          },
          "504": {
            "description": "Gateway Timeout",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Statutory_ApiErrorResponse"
                }
              }
            }
          }
        },
        "x-flow-permission": "pay-run:read"
      }
    },
    "/v1/statutory-pay/payments/employees/{employeeId}/{statutoryPayId}": {
      "get": {
        "tags": [
          "Statutory pay · Statutory payments"
        ],
        "summary": "Get a statutory payment",
        "description": "Needs permission pay-run:read.",
        "operationId": "Statutory_GetStatutoryPayById",
        "parameters": [
          {
            "name": "employeeId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "statutoryPayId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Statutory_ResponseBody_StatutoryPayResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Statutory_ApiErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Statutory_ApiErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Statutory_ApiErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Statutory_ApiErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Statutory_ApiErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Statutory_ApiErrorResponse"
                }
              }
            }
          },
          "502": {
            "description": "Bad Gateway",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Statutory_ApiErrorResponse"
                }
              }
            }
          },
          "504": {
            "description": "Gateway Timeout",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Statutory_ApiErrorResponse"
                }
              }
            }
          }
        },
        "x-flow-permission": "pay-run:read"
      },
      "put": {
        "tags": [
          "Statutory pay · Statutory payments"
        ],
        "summary": "Update a statutory payment",
        "description": "Needs permission pay-run:write.\n\nRecalculates the payment. Weeks already paid keep their amounts.",
        "operationId": "Statutory_UpdateStatutoryPay",
        "parameters": [
          {
            "name": "employeeId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "statutoryPayId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Statutory_UpdateStatutoryPayRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Statutory_ResponseBody_StatutoryPayResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Statutory_ApiErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Statutory_ApiErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Statutory_ApiErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Statutory_ApiErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Statutory_ApiErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Statutory_ApiErrorResponse"
                }
              }
            }
          },
          "502": {
            "description": "Bad Gateway",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Statutory_ApiErrorResponse"
                }
              }
            }
          },
          "504": {
            "description": "Gateway Timeout",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Statutory_ApiErrorResponse"
                }
              }
            }
          }
        },
        "x-flow-permission": "pay-run:write"
      },
      "delete": {
        "tags": [
          "Statutory pay · Statutory payments"
        ],
        "summary": "Delete a statutory payment",
        "description": "Needs permission pay-run:write.\n\nReturns the payment as it was before it was deleted.",
        "operationId": "Statutory_DeleteStatutoryPay",
        "parameters": [
          {
            "name": "employeeId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "statutoryPayId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Statutory_ResponseBody_StatutoryPayResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Statutory_ApiErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Statutory_ApiErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Statutory_ApiErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Statutory_ApiErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Statutory_ApiErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Statutory_ApiErrorResponse"
                }
              }
            }
          },
          "502": {
            "description": "Bad Gateway",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Statutory_ApiErrorResponse"
                }
              }
            }
          },
          "504": {
            "description": "Gateway Timeout",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Statutory_ApiErrorResponse"
                }
              }
            }
          }
        },
        "x-flow-permission": "pay-run:write"
      }
    },
    "/v1/statutory-pay/payments/calculations/employees/{employeeId}/average-earnings": {
      "get": {
        "tags": [
          "Statutory pay · Alabaster & earnings"
        ],
        "summary": "Calculate an employee's average weekly earnings",
        "description": "Needs permission pay-run:read.\n\nAverage weekly earnings (AWE) decide whether the employee qualifies and, for some types, how much they are paid.",
        "operationId": "Statutory_GetEmployeeAverageEarnings",
        "parameters": [
          {
            "name": "employeeId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "startDate",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Statutory_ResponseBody_AverageEarningsResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Statutory_ApiErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Statutory_ApiErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Statutory_ApiErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Statutory_ApiErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Statutory_ApiErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Statutory_ApiErrorResponse"
                }
              }
            }
          },
          "502": {
            "description": "Bad Gateway",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Statutory_ApiErrorResponse"
                }
              }
            }
          },
          "504": {
            "description": "Gateway Timeout",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Statutory_ApiErrorResponse"
                }
              }
            }
          }
        },
        "x-flow-permission": "pay-run:read"
      }
    },
    "/v1/statutory-pay/payments/employees/{employeeId}/{statutoryPayId}/line-items": {
      "get": {
        "tags": [
          "Statutory pay · Line items & schedule"
        ],
        "summary": "List a statutory payment's payslip lines",
        "description": "Needs permission pay-run:read.",
        "operationId": "Statutory_GetStatutoryPayLineItems",
        "parameters": [
          {
            "name": "employeeId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "statutoryPayId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Statutory_ResponseBody_IEnumerable_StatutoryPayLineItemResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Statutory_ApiErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Statutory_ApiErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Statutory_ApiErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Statutory_ApiErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Statutory_ApiErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Statutory_ApiErrorResponse"
                }
              }
            }
          },
          "502": {
            "description": "Bad Gateway",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Statutory_ApiErrorResponse"
                }
              }
            }
          },
          "504": {
            "description": "Gateway Timeout",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Statutory_ApiErrorResponse"
                }
              }
            }
          }
        },
        "x-flow-permission": "pay-run:read"
      }
    },
    "/v1/statutory-pay/payments/employees/{employeeId}/{statutoryPayId}/weeks/{weekNumber}": {
      "patch": {
        "tags": [
          "Statutory pay · Line items & schedule"
        ],
        "summary": "Change the amount for one unpaid week",
        "description": "Needs permission pay-run:write.\n\nRejected if the week has already been paid.",
        "operationId": "Statutory_OverrideStatutoryWeekAmount",
        "parameters": [
          {
            "name": "employeeId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "statutoryPayId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "weekNumber",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Statutory_OverrideStatutoryAmountRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Statutory_ResponseBody_Boolean"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Statutory_ApiErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Statutory_ApiErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Statutory_ApiErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Statutory_ApiErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Statutory_ApiErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Statutory_ApiErrorResponse"
                }
              }
            }
          },
          "502": {
            "description": "Bad Gateway",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Statutory_ApiErrorResponse"
                }
              }
            }
          },
          "504": {
            "description": "Gateway Timeout",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Statutory_ApiErrorResponse"
                }
              }
            }
          }
        },
        "x-flow-permission": "pay-run:write"
      }
    },
    "/v1/statutory-pay/payments/employees/{employeeId}/{statutoryPayId}/line-items/{lineItemSequence}": {
      "patch": {
        "tags": [
          "Statutory pay · Line items & schedule"
        ],
        "summary": "Change the amount on one unpaid payslip line",
        "description": "Needs permission pay-run:write.\n\nRejected if the line has already been paid.",
        "operationId": "Statutory_OverrideStatutoryLineAmount",
        "parameters": [
          {
            "name": "employeeId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "statutoryPayId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "lineItemSequence",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Statutory_OverrideStatutoryAmountRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Statutory_ResponseBody_Boolean"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Statutory_ApiErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Statutory_ApiErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Statutory_ApiErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Statutory_ApiErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Statutory_ApiErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Statutory_ApiErrorResponse"
                }
              }
            }
          },
          "502": {
            "description": "Bad Gateway",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Statutory_ApiErrorResponse"
                }
              }
            }
          },
          "504": {
            "description": "Gateway Timeout",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Statutory_ApiErrorResponse"
                }
              }
            }
          }
        },
        "x-flow-permission": "pay-run:write"
      }
    },
    "/v1/statutory-pay/payments/employees/{employeeId}/{statutoryPayId}/external-payments": {
      "post": {
        "tags": [
          "Statutory pay · External payments"
        ],
        "summary": "Record a payment made outside Flow Payroll",
        "description": "Needs permission pay-run:write.\n\nUse this when part of the payment was paid by another system, so it is counted when reconciling.",
        "operationId": "Statutory_RecordExternalStatutoryPayment",
        "parameters": [
          {
            "name": "employeeId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "statutoryPayId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Statutory_RecordExternalPaymentRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Statutory_ResponseBody_Boolean"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Statutory_ApiErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Statutory_ApiErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Statutory_ApiErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Statutory_ApiErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Statutory_ApiErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Statutory_ApiErrorResponse"
                }
              }
            }
          },
          "502": {
            "description": "Bad Gateway",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Statutory_ApiErrorResponse"
                }
              }
            }
          },
          "504": {
            "description": "Gateway Timeout",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Statutory_ApiErrorResponse"
                }
              }
            }
          }
        },
        "x-flow-permission": "pay-run:write"
      },
      "get": {
        "tags": [
          "Statutory pay · External payments"
        ],
        "summary": "List payments made outside Flow Payroll",
        "description": "Needs permission pay-run:read.",
        "operationId": "Statutory_GetExternalStatutoryPayments",
        "parameters": [
          {
            "name": "employeeId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "statutoryPayId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Statutory_ResponseBody_IEnumerable_StatutoryPayLineItemResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Statutory_ApiErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Statutory_ApiErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Statutory_ApiErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Statutory_ApiErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Statutory_ApiErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Statutory_ApiErrorResponse"
                }
              }
            }
          },
          "502": {
            "description": "Bad Gateway",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Statutory_ApiErrorResponse"
                }
              }
            }
          },
          "504": {
            "description": "Gateway Timeout",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Statutory_ApiErrorResponse"
                }
              }
            }
          }
        },
        "x-flow-permission": "pay-run:read"
      }
    },
    "/v1/statutory-pay/payments/employees/{employeeId}/{statutoryPayId}/external-payments/{lineItemSequence}": {
      "delete": {
        "tags": [
          "Statutory pay · External payments"
        ],
        "summary": "Remove a payment made outside Flow Payroll",
        "description": "Needs permission pay-run:write.",
        "operationId": "Statutory_RemoveExternalStatutoryPayment",
        "parameters": [
          {
            "name": "employeeId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "statutoryPayId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "lineItemSequence",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Statutory_ResponseBody_Boolean"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Statutory_ApiErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Statutory_ApiErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Statutory_ApiErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Statutory_ApiErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Statutory_ApiErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Statutory_ApiErrorResponse"
                }
              }
            }
          },
          "502": {
            "description": "Bad Gateway",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Statutory_ApiErrorResponse"
                }
              }
            }
          },
          "504": {
            "description": "Gateway Timeout",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Statutory_ApiErrorResponse"
                }
              }
            }
          }
        },
        "x-flow-permission": "pay-run:write"
      }
    },
    "/v1/statutory-pay/payments/employees/{employeeId}/{statutoryPayId}/schedule/export": {
      "get": {
        "tags": [
          "Statutory pay · Line items & schedule"
        ],
        "summary": "Download the payment schedule as CSV or PDF",
        "description": "Needs permission pay-run:read.\n\nPass format=csv (the default) or format=pdf.",
        "operationId": "Statutory_ExportStatutorySchedule",
        "parameters": [
          {
            "name": "employeeId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "statutoryPayId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "format",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/csv": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              },
              "application/pdf": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Statutory_ApiErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Statutory_ApiErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Statutory_ApiErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Statutory_ApiErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Statutory_ApiErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Statutory_ApiErrorResponse"
                }
              }
            }
          },
          "502": {
            "description": "Bad Gateway",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Statutory_ApiErrorResponse"
                }
              }
            }
          },
          "504": {
            "description": "Gateway Timeout",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Statutory_ApiErrorResponse"
                }
              }
            }
          }
        },
        "x-flow-permission": "pay-run:read"
      }
    },
    "/v1/statutory-pay/payments/employees/{employeeId}/{statutoryPayId}/attachments": {
      "post": {
        "tags": [
          "Statutory pay · Attachments"
        ],
        "summary": "Add supporting documents to a statutory payment",
        "description": "Needs permission pay-run:write.\n\nFor example a fit note or a MATB1 certificate.",
        "operationId": "Statutory_AddStatutoryPayAttachments",
        "parameters": [
          {
            "name": "employeeId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "statutoryPayId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Statutory_AddStatutoryAttachmentsRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Statutory_ResponseBody_IEnumerable_StatutoryAttachmentUploadResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Statutory_ApiErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Statutory_ApiErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Statutory_ApiErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Statutory_ApiErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Statutory_ApiErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Statutory_ApiErrorResponse"
                }
              }
            }
          },
          "502": {
            "description": "Bad Gateway",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Statutory_ApiErrorResponse"
                }
              }
            }
          },
          "504": {
            "description": "Gateway Timeout",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Statutory_ApiErrorResponse"
                }
              }
            }
          }
        },
        "x-flow-permission": "pay-run:write"
      },
      "get": {
        "tags": [
          "Statutory pay · Attachments"
        ],
        "summary": "List a statutory payment's supporting documents",
        "description": "Needs permission pay-run:read.",
        "operationId": "Statutory_GetStatutoryPayAttachments",
        "parameters": [
          {
            "name": "employeeId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "statutoryPayId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Statutory_ResponseBody_IEnumerable_StatutoryAttachmentResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Statutory_ApiErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Statutory_ApiErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Statutory_ApiErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Statutory_ApiErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Statutory_ApiErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Statutory_ApiErrorResponse"
                }
              }
            }
          },
          "502": {
            "description": "Bad Gateway",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Statutory_ApiErrorResponse"
                }
              }
            }
          },
          "504": {
            "description": "Gateway Timeout",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Statutory_ApiErrorResponse"
                }
              }
            }
          }
        },
        "x-flow-permission": "pay-run:read"
      }
    },
    "/v1/statutory-pay/payments/employees/{employeeId}/{statutoryPayId}/attachments/{attachmentId}": {
      "delete": {
        "tags": [
          "Statutory pay · Attachments"
        ],
        "summary": "Delete a supporting document",
        "description": "Needs permission pay-run:write.",
        "operationId": "Statutory_DeleteStatutoryPayAttachment",
        "parameters": [
          {
            "name": "employeeId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "statutoryPayId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "attachmentId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Statutory_ResponseBody_Boolean"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Statutory_ApiErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Statutory_ApiErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Statutory_ApiErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Statutory_ApiErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Statutory_ApiErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Statutory_ApiErrorResponse"
                }
              }
            }
          },
          "502": {
            "description": "Bad Gateway",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Statutory_ApiErrorResponse"
                }
              }
            }
          },
          "504": {
            "description": "Gateway Timeout",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Statutory_ApiErrorResponse"
                }
              }
            }
          }
        },
        "x-flow-permission": "pay-run:write"
      }
    },
    "/v1/statutory-pay/payments/reconcile": {
      "post": {
        "tags": [
          "Statutory pay · Import & reconcile"
        ],
        "summary": "Reconcile unpaid statutory payslip lines with pay runs",
        "description": "Needs permission pay-run:write.\n\nCovers the whole organisation, or one employee when employeeId is given.",
        "operationId": "Statutory_ReconcileStatutoryPayments",
        "parameters": [
          {
            "name": "employeeId",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Statutory_ResponseBody_Boolean"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Statutory_ApiErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Statutory_ApiErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Statutory_ApiErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Statutory_ApiErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Statutory_ApiErrorResponse"
                }
              }
            }
          },
          "502": {
            "description": "Bad Gateway",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Statutory_ApiErrorResponse"
                }
              }
            }
          },
          "504": {
            "description": "Gateway Timeout",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Statutory_ApiErrorResponse"
                }
              }
            }
          }
        },
        "x-flow-permission": "pay-run:write"
      }
    },
    "/v1/statutory-pay/payments/employees/{employeeId}/{statutoryPayId}/alabaster-detection": {
      "get": {
        "tags": [
          "Statutory pay · Alabaster & earnings"
        ],
        "summary": "Find pay rises that should increase maternity pay",
        "description": "Needs permission pay-run:read.\n\nUnder the Alabaster ruling, a pay rise that takes effect during the earnings period or maternity leave must be reflected in Statutory Maternity Pay.",
        "operationId": "Statutory_DetectAlabasterPayRises",
        "parameters": [
          {
            "name": "employeeId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "statutoryPayId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Statutory_ResponseBody_List_PayRiseHistoryItem"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Statutory_ApiErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Statutory_ApiErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Statutory_ApiErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Statutory_ApiErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Statutory_ApiErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Statutory_ApiErrorResponse"
                }
              }
            }
          },
          "502": {
            "description": "Bad Gateway",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Statutory_ApiErrorResponse"
                }
              }
            }
          },
          "504": {
            "description": "Gateway Timeout",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Statutory_ApiErrorResponse"
                }
              }
            }
          }
        },
        "x-flow-permission": "pay-run:read"
      }
    },
    "/v1/statutory-pay/payments/employees/{employeeId}/{statutoryPayId}/alabaster-recalculate": {
      "post": {
        "tags": [
          "Statutory pay · Alabaster & earnings"
        ],
        "summary": "Recalculate maternity pay after a pay rise",
        "description": "Needs permission pay-run:read.\n\nWorks out the Alabaster adjustment for the payment.",
        "operationId": "Statutory_RecalculateAlabasterSmp",
        "parameters": [
          {
            "name": "employeeId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "statutoryPayId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Statutory_RecalculateAlabasterRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Statutory_ResponseBody_AlabasterAdjustment"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Statutory_ApiErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Statutory_ApiErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Statutory_ApiErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Statutory_ApiErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Statutory_ApiErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Statutory_ApiErrorResponse"
                }
              }
            }
          },
          "502": {
            "description": "Bad Gateway",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Statutory_ApiErrorResponse"
                }
              }
            }
          },
          "504": {
            "description": "Gateway Timeout",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Statutory_ApiErrorResponse"
                }
              }
            }
          }
        },
        "x-flow-permission": "pay-run:read"
      }
    },
    "/v1/statutory-pay/payments/employees/{employeeId}/{statutoryPayId}/alabaster-update-line-items": {
      "post": {
        "tags": [
          "Statutory pay · Alabaster & earnings"
        ],
        "summary": "Apply an Alabaster adjustment to unpaid lines (not available yet)",
        "description": "Needs permission pay-run:write.\n\nThis operation is not available yet and always returns 501 Not Implemented.",
        "operationId": "Statutory_UpdatePendingLineItemsForAlabaster",
        "parameters": [
          {
            "name": "employeeId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "statutoryPayId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Statutory_UpdateAlabasterLineItemsRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Statutory_ApiErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Statutory_ApiErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Statutory_ApiErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Statutory_ApiErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Statutory_ApiErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Statutory_ApiErrorResponse"
                }
              }
            }
          },
          "501": {
            "description": "Not Implemented",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Statutory_ApiErrorResponse"
                }
              }
            }
          },
          "502": {
            "description": "Bad Gateway",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Statutory_ApiErrorResponse"
                }
              }
            }
          },
          "504": {
            "description": "Gateway Timeout",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Statutory_ApiErrorResponse"
                }
              }
            }
          }
        },
        "x-flow-permission": "pay-run:write"
      }
    },
    "/v1/statutory-pay/payments/import/{employeeId}": {
      "post": {
        "tags": [
          "Statutory pay · Import & reconcile"
        ],
        "summary": "Import a statutory payment from a previous provider",
        "description": "Needs permission pay-run:write.\n\nSupports payments already part-paid: weeks the previous provider paid are recorded as paid.",
        "operationId": "Statutory_ImportStatutoryPay",
        "parameters": [
          {
            "name": "employeeId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "source",
            "in": "query",
            "schema": {
              "enum": [
                "WizardCreate",
                "WizardImport",
                "ApiCreate",
                "ApiImport",
                "CsvImport"
              ],
              "type": "string",
              "nullable": true
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Statutory_ImportStatutoryPayRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Statutory_ResponseBody_ImportStatutoryPayResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Statutory_ApiErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Statutory_ApiErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Statutory_ApiErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Statutory_ApiErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Statutory_ApiErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Statutory_ApiErrorResponse"
                }
              }
            }
          },
          "502": {
            "description": "Bad Gateway",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Statutory_ApiErrorResponse"
                }
              }
            }
          },
          "504": {
            "description": "Gateway Timeout",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Statutory_ApiErrorResponse"
                }
              }
            }
          }
        },
        "x-flow-permission": "pay-run:write"
      }
    },
    "/v1/statutory-pay/payments/employees/{employeeId}/{statutoryPayId}/history": {
      "get": {
        "tags": [
          "Statutory pay · Statutory payments"
        ],
        "summary": "Get a statutory payment's change history",
        "description": "Needs permission pay-run:read.",
        "operationId": "Statutory_GetStatutoryPayHistory",
        "parameters": [
          {
            "name": "employeeId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "statutoryPayId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Statutory_ResponseBody_StatutoryPayHistoryResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Statutory_ApiErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Statutory_ApiErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Statutory_ApiErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Statutory_ApiErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Statutory_ApiErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Statutory_ApiErrorResponse"
                }
              }
            }
          },
          "502": {
            "description": "Bad Gateway",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Statutory_ApiErrorResponse"
                }
              }
            }
          },
          "504": {
            "description": "Gateway Timeout",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Statutory_ApiErrorResponse"
                }
              }
            }
          }
        },
        "x-flow-permission": "pay-run:read"
      }
    },
    "/v1/statutory-pay/statutory-rates/available-years": {
      "get": {
        "tags": [
          "Statutory pay · Statutory Rates"
        ],
        "summary": "List the tax years that have statutory rates",
        "description": "Needs permission pay-run:read.",
        "operationId": "Statutory_GetAvailableTaxYears",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Statutory_ResponseBody_AvailableTaxYearsResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Statutory_ApiErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Statutory_ApiErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Statutory_ApiErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Statutory_ApiErrorResponse"
                }
              }
            }
          },
          "502": {
            "description": "Bad Gateway",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Statutory_ApiErrorResponse"
                }
              }
            }
          },
          "504": {
            "description": "Gateway Timeout",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Statutory_ApiErrorResponse"
                }
              }
            }
          }
        },
        "x-flow-permission": "pay-run:read"
      }
    },
    "/v1/statutory-pay/statutory-rates/{taxYear}": {
      "get": {
        "tags": [
          "Statutory pay · Statutory Rates"
        ],
        "summary": "Get the statutory rates for a tax year",
        "description": "Needs permission pay-run:read.\n\ntaxYear is the year the tax year starts in, e.g. 2026 for 6 April 2026 to 5 April 2027.",
        "operationId": "Statutory_GetStatutoryRates",
        "parameters": [
          {
            "name": "taxYear",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Statutory_ResponseBody_StatutoryRatesResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Statutory_ApiErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Statutory_ApiErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Statutory_ApiErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Statutory_ApiErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Statutory_ApiErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Statutory_ApiErrorResponse"
                }
              }
            }
          },
          "502": {
            "description": "Bad Gateway",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Statutory_ApiErrorResponse"
                }
              }
            }
          },
          "504": {
            "description": "Gateway Timeout",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Statutory_ApiErrorResponse"
                }
              }
            }
          }
        },
        "x-flow-permission": "pay-run:read"
      }
    },
    "/v1/court-orders/orders": {
      "post": {
        "tags": [
          "Court orders · Court orders"
        ],
        "description": "Needs permission pay-run:write.",
        "operationId": "CourtOrders_CreateCourtOrder",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "oneOf": [
                  {
                    "$ref": "#/components/schemas/CourtOrders_CreateCmsDeoRequest"
                  },
                  {
                    "$ref": "#/components/schemas/CourtOrders_CreateAeoPriorityRequest"
                  },
                  {
                    "$ref": "#/components/schemas/CourtOrders_CreateAeoNonPriorityRequest"
                  },
                  {
                    "$ref": "#/components/schemas/CourtOrders_CreateDeaRequest"
                  },
                  {
                    "$ref": "#/components/schemas/CourtOrders_CreateCtaeoRequest"
                  },
                  {
                    "$ref": "#/components/schemas/CourtOrders_CreateEaRequest"
                  },
                  {
                    "$ref": "#/components/schemas/CourtOrders_CreateMcaeoRequest"
                  },
                  {
                    "$ref": "#/components/schemas/CourtOrders_CreateCmaRequest"
                  },
                  {
                    "$ref": "#/components/schemas/CourtOrders_CreateCaoRequest"
                  },
                  {
                    "$ref": "#/components/schemas/CourtOrders_CreateNiFinesAeoRequest"
                  },
                  {
                    "$ref": "#/components/schemas/CourtOrders_CreateNiEjoAeoRequest"
                  }
                ],
                "discriminator": {
                  "propertyName": "orderType",
                  "mapping": {
                    "CmsDeo": "#/components/schemas/CourtOrders_CreateCmsDeoRequest",
                    "AeoPriority": "#/components/schemas/CourtOrders_CreateAeoPriorityRequest",
                    "AeoNonPriority": "#/components/schemas/CourtOrders_CreateAeoNonPriorityRequest",
                    "Dea": "#/components/schemas/CourtOrders_CreateDeaRequest",
                    "Ctaeo": "#/components/schemas/CourtOrders_CreateCtaeoRequest",
                    "Ea": "#/components/schemas/CourtOrders_CreateEaRequest",
                    "Mcaeo": "#/components/schemas/CourtOrders_CreateMcaeoRequest",
                    "Cma": "#/components/schemas/CourtOrders_CreateCmaRequest",
                    "Cao": "#/components/schemas/CourtOrders_CreateCaoRequest",
                    "NiFinesAeo": "#/components/schemas/CourtOrders_CreateNiFinesAeoRequest",
                    "NiEjoAeo": "#/components/schemas/CourtOrders_CreateNiEjoAeoRequest"
                  }
                }
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CourtOrders_ResponseBody_CourtOrderResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CourtOrders_ResponseBody_Object"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CourtOrders_ApiErrorResponse"
                }
              }
            }
          }
        },
        "x-flow-permission": "pay-run:write",
        "summary": "Create court order"
      },
      "get": {
        "tags": [
          "Court orders · Court orders"
        ],
        "description": "Needs permission pay-run:read.",
        "operationId": "CourtOrders_GetCourtOrdersByOrganisation",
        "parameters": [
          {
            "name": "status",
            "in": "query",
            "schema": {
              "enum": [
                "Active",
                "Suspended",
                "OnHoldNoEligibleEarnings",
                "Discharged"
              ],
              "type": "string",
              "nullable": true
            }
          },
          {
            "name": "orderType",
            "in": "query",
            "schema": {
              "enum": [
                "CmsDeo",
                "AeoPriority",
                "AeoNonPriority",
                "Dea",
                "Ctaeo",
                "Ea",
                "Mcaeo",
                "Cma",
                "Cao",
                "NiFinesAeo",
                "NiEjoAeo"
              ],
              "type": "string",
              "nullable": true
            }
          },
          {
            "name": "priorityLevel",
            "in": "query",
            "schema": {
              "enum": [
                "Cms",
                "PriorityOrders",
                "NonPriority",
                "StudentLoans"
              ],
              "type": "string",
              "nullable": true
            }
          },
          {
            "name": "startDateFrom",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "name": "startDateTo",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "name": "dateReceivedFrom",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "name": "dateReceivedTo",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "name": "issuingAuthority",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "reference",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "paginationToken",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CourtOrders_ResponseBody_CourtOrderListResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CourtOrders_ApiErrorResponse"
                }
              }
            }
          }
        },
        "x-flow-permission": "pay-run:read",
        "summary": "Get court orders by organisation"
      }
    },
    "/v1/court-orders/orders/{orderId}": {
      "get": {
        "tags": [
          "Court orders · Court orders"
        ],
        "description": "Needs permission pay-run:read.",
        "operationId": "CourtOrders_GetCourtOrder",
        "parameters": [
          {
            "name": "orderId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CourtOrders_ResponseBody_CourtOrderResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CourtOrders_ApiErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CourtOrders_ResponseBody_Object"
                }
              }
            }
          }
        },
        "x-flow-permission": "pay-run:read",
        "summary": "Get court order"
      },
      "put": {
        "tags": [
          "Court orders · Court orders"
        ],
        "description": "Needs permission pay-run:write.",
        "operationId": "CourtOrders_UpdateCourtOrder",
        "parameters": [
          {
            "name": "orderId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CourtOrders_UpdateCourtOrderRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CourtOrders_ResponseBody_CourtOrderResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CourtOrders_ResponseBody_Object"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CourtOrders_ApiErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CourtOrders_ResponseBody_Object"
                }
              }
            }
          }
        },
        "x-flow-permission": "pay-run:write",
        "summary": "Update court order"
      },
      "delete": {
        "tags": [
          "Court orders · Court orders"
        ],
        "description": "Needs permission pay-run:write.",
        "operationId": "CourtOrders_DeleteCourtOrder",
        "parameters": [
          {
            "name": "orderId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CourtOrders_ResponseBody_Boolean"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CourtOrders_ApiErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CourtOrders_ResponseBody_Object"
                }
              }
            }
          }
        },
        "x-flow-permission": "pay-run:write",
        "summary": "Delete court order"
      }
    },
    "/v1/court-orders/orders/{orderId}/attachments": {
      "post": {
        "tags": [
          "Court orders · Attachments"
        ],
        "description": "Needs permission pay-run:write.",
        "operationId": "CourtOrders_AddCourtOrderAttachments",
        "parameters": [
          {
            "name": "orderId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CourtOrders_AddCourtOrderAttachmentsRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CourtOrders_ResponseBody_IReadOnlyList_AttachmentUploadResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CourtOrders_ResponseBody_Object"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CourtOrders_ApiErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CourtOrders_ResponseBody_Object"
                }
              }
            }
          }
        },
        "x-flow-permission": "pay-run:write",
        "summary": "Add court order attachments"
      }
    },
    "/v1/court-orders/orders/{orderId}/attachments/{attachmentId}": {
      "delete": {
        "tags": [
          "Court orders · Attachments"
        ],
        "description": "Needs permission pay-run:write.",
        "operationId": "CourtOrders_DeleteCourtOrderAttachment",
        "parameters": [
          {
            "name": "orderId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "attachmentId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CourtOrders_ResponseBody_Boolean"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CourtOrders_ResponseBody_Object"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CourtOrders_ApiErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CourtOrders_ResponseBody_Object"
                }
              }
            }
          }
        },
        "x-flow-permission": "pay-run:write",
        "summary": "Delete court order attachment"
      }
    },
    "/v1/court-orders/orders/constants/available-years": {
      "get": {
        "tags": [
          "Court orders · Reference data"
        ],
        "description": "Needs permission pay-run:read.",
        "operationId": "CourtOrders_GetCourtOrderConstantsAvailableYears",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CourtOrders_ResponseBody_CourtOrderAvailableTaxYearsResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CourtOrders_ApiErrorResponse"
                }
              }
            }
          }
        },
        "x-flow-permission": "pay-run:read",
        "summary": "List tax years with court order constants"
      }
    },
    "/v1/court-orders/orders/constants/{taxYear}": {
      "get": {
        "tags": [
          "Court orders · Reference data"
        ],
        "description": "Needs permission pay-run:read.",
        "operationId": "CourtOrders_GetCourtOrderConstants",
        "parameters": [
          {
            "name": "taxYear",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CourtOrders_ResponseBody_CourtOrderConstantsResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CourtOrders_ResponseBody_Object"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CourtOrders_ApiErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CourtOrders_ResponseBody_Object"
                }
              }
            }
          }
        },
        "x-flow-permission": "pay-run:read",
        "summary": "Get court order constants for a tax year"
      }
    },
    "/v1/court-orders/orders/employees/{employeeId}": {
      "get": {
        "tags": [
          "Court orders · Court orders"
        ],
        "description": "Needs permission pay-run:read.",
        "operationId": "CourtOrders_GetCourtOrdersByEmployee",
        "parameters": [
          {
            "name": "employeeId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "status",
            "in": "query",
            "schema": {
              "enum": [
                "Active",
                "Suspended",
                "OnHoldNoEligibleEarnings",
                "Discharged"
              ],
              "type": "string",
              "nullable": true
            }
          },
          {
            "name": "orderType",
            "in": "query",
            "schema": {
              "enum": [
                "CmsDeo",
                "AeoPriority",
                "AeoNonPriority",
                "Dea",
                "Ctaeo",
                "Ea",
                "Mcaeo",
                "Cma",
                "Cao",
                "NiFinesAeo",
                "NiEjoAeo"
              ],
              "type": "string",
              "nullable": true
            }
          },
          {
            "name": "priorityLevel",
            "in": "query",
            "schema": {
              "enum": [
                "Cms",
                "PriorityOrders",
                "NonPriority",
                "StudentLoans"
              ],
              "type": "string",
              "nullable": true
            }
          },
          {
            "name": "startDateFrom",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "name": "startDateTo",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "name": "dateReceivedFrom",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "name": "dateReceivedTo",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "name": "issuingAuthority",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "reference",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "paginationToken",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "payDate",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CourtOrders_ResponseBody_IEnumerable_CourtOrderResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CourtOrders_ApiErrorResponse"
                }
              }
            }
          }
        },
        "x-flow-permission": "pay-run:read",
        "summary": "Get court orders by employee"
      }
    },
    "/v1/court-orders/orders/reconcile": {
      "post": {
        "tags": [
          "Court orders · Court orders"
        ],
        "description": "Needs permission pay-run:write.",
        "operationId": "CourtOrders_ReconcileCourtOrders",
        "parameters": [
          {
            "name": "employeeId",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CourtOrders_ResponseBody_Boolean"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CourtOrders_ApiErrorResponse"
                }
              }
            }
          }
        },
        "x-flow-permission": "pay-run:write",
        "summary": "Reconcile court orders"
      }
    },
    "/v1/court-orders/payees": {
      "post": {
        "tags": [
          "Court orders · Payees"
        ],
        "description": "Needs permission pay-run:write.",
        "operationId": "CourtOrders_CreatePayee",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CourtOrders_CreatePayeeRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CourtOrders_ResponseBody_PayeeResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CourtOrders_ResponseBody_Object"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CourtOrders_ApiErrorResponse"
                }
              }
            }
          }
        },
        "x-flow-permission": "pay-run:write",
        "summary": "Create payee"
      },
      "get": {
        "tags": [
          "Court orders · Payees"
        ],
        "description": "Needs permission pay-run:read.",
        "operationId": "CourtOrders_GetAllPayees",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CourtOrders_ResponseBody_IEnumerable_PayeeResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CourtOrders_ApiErrorResponse"
                }
              }
            }
          }
        },
        "x-flow-permission": "pay-run:read",
        "summary": "Get all payees"
      }
    },
    "/v1/court-orders/payees/{payeeId}": {
      "get": {
        "tags": [
          "Court orders · Payees"
        ],
        "description": "Needs permission pay-run:read.",
        "operationId": "CourtOrders_GetPayee",
        "parameters": [
          {
            "name": "payeeId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CourtOrders_ResponseBody_PayeeResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CourtOrders_ApiErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CourtOrders_ResponseBody_Object"
                }
              }
            }
          }
        },
        "x-flow-permission": "pay-run:read",
        "summary": "Get payee"
      },
      "put": {
        "tags": [
          "Court orders · Payees"
        ],
        "description": "Needs permission pay-run:write.",
        "operationId": "CourtOrders_UpdatePayee",
        "parameters": [
          {
            "name": "payeeId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CourtOrders_UpdatePayeeRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CourtOrders_ResponseBody_PayeeResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CourtOrders_ResponseBody_Object"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CourtOrders_ApiErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CourtOrders_ResponseBody_Object"
                }
              }
            }
          }
        },
        "x-flow-permission": "pay-run:write",
        "summary": "Update payee"
      },
      "delete": {
        "tags": [
          "Court orders · Payees"
        ],
        "description": "Needs permission pay-run:write.",
        "operationId": "CourtOrders_DeletePayee",
        "parameters": [
          {
            "name": "payeeId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CourtOrders_ResponseBody_PayeeResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CourtOrders_ResponseBody_Object"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CourtOrders_ApiErrorResponse"
                }
              }
            }
          }
        },
        "x-flow-permission": "pay-run:write",
        "summary": "Delete payee"
      }
    },
    "/v1/holiday/employees/{employeeId}": {
      "get": {
        "tags": [
          "Holiday · Holiday Employee Configuration"
        ],
        "summary": "Get employee holiday configuration",
        "description": "Needs permission pay-run:read.\n\nRetrieves the holiday configuration for an employee",
        "operationId": "Holiday_holiday-employee-configuration-get",
        "parameters": [
          {
            "name": "employeeId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Holiday_ResponseBody_HolidayEmployeeConfigurationResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Holiday_ApiErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Holiday_ResponseBody_Object"
                }
              }
            }
          }
        },
        "x-flow-permission": "pay-run:read"
      },
      "post": {
        "tags": [
          "Holiday · Holiday Employee Configuration"
        ],
        "summary": "Create employee holiday configuration",
        "description": "Needs permission pay-run:write.\n\nCreates a holiday configuration for an employee",
        "operationId": "Holiday_holiday-employee-configuration-create",
        "parameters": [
          {
            "name": "employeeId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Holiday_CreateHolidayEmployeeConfigurationRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Holiday_ResponseBody_HolidayEmployeeConfigurationResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Holiday_ResponseBody_Object"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Holiday_ApiErrorResponse"
                }
              }
            }
          }
        },
        "x-flow-permission": "pay-run:write"
      },
      "put": {
        "tags": [
          "Holiday · Holiday Employee Configuration"
        ],
        "summary": "Update employee holiday configuration",
        "description": "Needs permission pay-run:write.\n\nUpdates the holiday configuration for an employee",
        "operationId": "Holiday_holiday-employee-configuration-update",
        "parameters": [
          {
            "name": "employeeId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Holiday_UpdateHolidayEmployeeConfigurationRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Holiday_ResponseBody_HolidayEmployeeConfigurationResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Holiday_ResponseBody_Object"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Holiday_ApiErrorResponse"
                }
              }
            }
          }
        },
        "x-flow-permission": "pay-run:write"
      },
      "delete": {
        "tags": [
          "Holiday · Holiday Employee Configuration"
        ],
        "summary": "Delete employee holiday configuration",
        "description": "Needs permission pay-run:write.\n\nDeletes the holiday configuration for an employee",
        "operationId": "Holiday_holiday-employee-configuration-delete",
        "parameters": [
          {
            "name": "employeeId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Holiday_ResponseBody_HolidayEmployeeConfigurationResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Holiday_ApiErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Holiday_ResponseBody_Object"
                }
              }
            }
          }
        },
        "x-flow-permission": "pay-run:write"
      }
    },
    "/v1/holiday/employees/{employeeId}/history": {
      "get": {
        "tags": [
          "Holiday · Holiday History"
        ],
        "summary": "Get holiday history for an employee",
        "description": "Needs permission pay-run:read.\n\nRetrieves the holiday history for an employee, optionally filtered by a date range",
        "operationId": "Holiday_holiday-history-get",
        "parameters": [
          {
            "name": "employeeId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "fromDate",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "toDate",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Holiday_ResponseBody_HolidayHistoryResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Holiday_ResponseBody_Object"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Holiday_ApiErrorResponse"
                }
              }
            }
          }
        },
        "x-flow-permission": "pay-run:read"
      }
    },
    "/v1/holiday/employees/{employeeId}/average-rate": {
      "get": {
        "tags": [
          "Holiday · Holiday History"
        ],
        "summary": "Get 52-week average rate for an employee",
        "description": "Needs permission pay-run:read.\n\nCalculates the 52-week average rate based on the last 104 weeks of accruals",
        "operationId": "Holiday_holiday-average-rate-get",
        "parameters": [
          {
            "name": "employeeId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Holiday_ResponseBody_HolidayAverageRateResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Holiday_ResponseBody_Object"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Holiday_ApiErrorResponse"
                }
              }
            }
          }
        },
        "x-flow-permission": "pay-run:read"
      }
    },
    "/v1/holiday/organisation": {
      "get": {
        "tags": [
          "Holiday · Holiday Organisation Configuration"
        ],
        "summary": "Get the holiday configuration",
        "description": "Needs permission organisation-settings:read.\n\nRetrieves the holiday configuration for the organisation",
        "operationId": "Holiday_holiday-organisation-configuration-get",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Holiday_ResponseBody_HolidayOrganisationConfigurationResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Holiday_ApiErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Holiday_ResponseBody_Object"
                }
              }
            }
          }
        },
        "x-flow-permission": "organisation-settings:read"
      },
      "post": {
        "tags": [
          "Holiday · Holiday Organisation Configuration"
        ],
        "summary": "Create a holiday configuration",
        "description": "Needs permission organisation-settings:write.\n\nCreates a holiday configuration for the organisation",
        "operationId": "Holiday_holiday-organisation-configuration-create",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Holiday_CreateHolidayOrganisationConfigurationRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Holiday_ResponseBody_HolidayOrganisationConfigurationResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Holiday_ResponseBody_Object"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Holiday_ApiErrorResponse"
                }
              }
            }
          }
        },
        "x-flow-permission": "organisation-settings:write"
      },
      "put": {
        "tags": [
          "Holiday · Holiday Organisation Configuration"
        ],
        "summary": "Update the holiday configuration",
        "description": "Needs permission organisation-settings:write.\n\nUpdates the holiday configuration for the organisation",
        "operationId": "Holiday_holiday-organisation-configuration-update",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Holiday_UpdateHolidayOrganisationConfigurationRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Holiday_ResponseBody_HolidayOrganisationConfigurationResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Holiday_ResponseBody_Object"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Holiday_ApiErrorResponse"
                }
              }
            }
          }
        },
        "x-flow-permission": "organisation-settings:write"
      },
      "delete": {
        "tags": [
          "Holiday · Holiday Organisation Configuration"
        ],
        "summary": "Delete the holiday configuration",
        "description": "Needs permission organisation-settings:write.\n\nDeletes the holiday configuration for the organisation",
        "operationId": "Holiday_holiday-organisation-configuration-delete",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Holiday_ResponseBody_HolidayOrganisationConfigurationResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Holiday_ApiErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Holiday_ResponseBody_Object"
                }
              }
            }
          }
        },
        "x-flow-permission": "organisation-settings:write"
      }
    },
    "/v1/holiday/employees/{employeeId}/taken/{id}": {
      "get": {
        "tags": [
          "Holiday · Holiday Taken"
        ],
        "summary": "Get a holiday taken record",
        "description": "Needs permission pay-run:read.\n\nRetrieves a specific holiday taken record by ID",
        "operationId": "Holiday_holiday-taken-get",
        "parameters": [
          {
            "name": "employeeId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Holiday_ResponseBody_HolidayLeaveResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Holiday_ApiErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Holiday_ResponseBody_Object"
                }
              }
            }
          }
        },
        "x-flow-permission": "pay-run:read"
      },
      "put": {
        "tags": [
          "Holiday · Holiday Taken"
        ],
        "summary": "Update holiday taken record",
        "description": "Needs permission pay-run:write.\n\nUpdates an existing holiday taken record",
        "operationId": "Holiday_holiday-taken-update",
        "parameters": [
          {
            "name": "employeeId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Holiday_UpdateHolidayLeaveRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Holiday_ResponseBody_HolidayLeaveResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Holiday_ResponseBody_Object"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Holiday_ApiErrorResponse"
                }
              }
            }
          }
        },
        "x-flow-permission": "pay-run:write"
      },
      "delete": {
        "tags": [
          "Holiday · Holiday Taken"
        ],
        "summary": "Delete holiday taken record",
        "description": "Needs permission pay-run:write.\n\nDeletes a holiday taken record",
        "operationId": "Holiday_holiday-taken-delete",
        "parameters": [
          {
            "name": "employeeId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Holiday_ResponseBody_HolidayLeaveResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Holiday_ApiErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Holiday_ResponseBody_Object"
                }
              }
            }
          }
        },
        "x-flow-permission": "pay-run:write"
      }
    },
    "/v1/holiday/employees/{employeeId}/taken": {
      "post": {
        "tags": [
          "Holiday · Holiday Taken"
        ],
        "summary": "Record holiday taken",
        "description": "Needs permission pay-run:write.\n\nCreates a new holiday taken record for an employee",
        "operationId": "Holiday_holiday-taken-create",
        "parameters": [
          {
            "name": "employeeId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Holiday_CreateHolidayLeaveRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Holiday_ResponseBody_HolidayLeaveResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Holiday_ResponseBody_Object"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Holiday_ApiErrorResponse"
                }
              }
            }
          }
        },
        "x-flow-permission": "pay-run:write"
      }
    },
    "/v1/holiday/employees/{employeeId}/opening-balance": {
      "get": {
        "tags": [
          "Holiday · Opening Balance"
        ],
        "summary": "Get opening balance",
        "description": "Needs permission pay-run:read.\n\nRetrieves the opening balance for an employee",
        "operationId": "Holiday_opening-balance-get",
        "parameters": [
          {
            "name": "employeeId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Holiday_ResponseBody_HolidayOpeningBalanceResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Holiday_ApiErrorResponse"
                }
              }
            }
          }
        },
        "x-flow-permission": "pay-run:read"
      },
      "post": {
        "tags": [
          "Holiday · Opening Balance"
        ],
        "summary": "Create opening balance",
        "description": "Needs permission pay-run:write.\n\nCreates an opening balance for an employee",
        "operationId": "Holiday_opening-balance-create",
        "parameters": [
          {
            "name": "employeeId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Holiday_CreateHolidayOpeningBalanceRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Holiday_ResponseBody_HolidayOpeningBalanceResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Holiday_ResponseBody_Object"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Holiday_ApiErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Holiday_ResponseBody_Object"
                }
              }
            }
          }
        },
        "x-flow-permission": "pay-run:write"
      },
      "put": {
        "tags": [
          "Holiday · Opening Balance"
        ],
        "summary": "Update opening balance",
        "description": "Needs permission pay-run:write.\n\nUpdates the opening balance for an employee",
        "operationId": "Holiday_opening-balance-update",
        "parameters": [
          {
            "name": "employeeId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Holiday_UpdateHolidayOpeningBalanceRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Holiday_ResponseBody_HolidayOpeningBalanceResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Holiday_ResponseBody_Object"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Holiday_ApiErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Holiday_ResponseBody_Object"
                }
              }
            }
          }
        },
        "x-flow-permission": "pay-run:write"
      },
      "delete": {
        "tags": [
          "Holiday · Opening Balance"
        ],
        "summary": "Delete opening balance",
        "description": "Needs permission pay-run:write.\n\nDeletes the opening balance for an employee",
        "operationId": "Holiday_opening-balance-delete",
        "parameters": [
          {
            "name": "employeeId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Holiday_ResponseBody_HolidayOpeningBalanceResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Holiday_ApiErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Holiday_ResponseBody_Object"
                }
              }
            }
          }
        },
        "x-flow-permission": "pay-run:write"
      }
    },
    "/v1/salary/employees/{employeeId}": {
      "get": {
        "tags": [
          "Salary · Salary employee configuration"
        ],
        "summary": "Get an employee's salary configuration",
        "description": "Needs permission employee-payroll:read. Always 200. `calculationMethod` is the employee's override (null when inheriting); `effectiveCalculationMethod` and `source` say what applies and where it came from (Employee, Organisation or Default).",
        "operationId": "Salary_GetSalaryEmployeeConfig",
        "parameters": [
          {
            "name": "employeeId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Salary_SalaryEmployeeConfigResponseResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Salary_ApiErrorResponse"
                }
              }
            }
          }
        },
        "x-flow-permission": "employee-payroll:read"
      },
      "put": {
        "tags": [
          "Salary · Salary employee configuration"
        ],
        "summary": "Set an employee's calculation-method override",
        "description": "Needs permission employee-payroll:write. Saves the override and re-previews the employee's open payslips so the pay run picks the new method up.",
        "operationId": "Salary_PutSalaryEmployeeConfig",
        "parameters": [
          {
            "name": "employeeId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Salary_UpsertSalaryEmployeeConfigRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Salary_SalaryEmployeeConfigResponseResponseBody"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Salary_ObjectResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Salary_ApiErrorResponse"
                }
              }
            }
          }
        },
        "x-flow-permission": "employee-payroll:write"
      },
      "delete": {
        "tags": [
          "Salary · Salary employee configuration"
        ],
        "summary": "Remove an employee's calculation-method override",
        "description": "Needs permission employee-payroll:write. The employee inherits the organisation's method again; the open payslips are re-previewed. Returns the configuration now in force, as the GET would.",
        "operationId": "Salary_DeleteSalaryEmployeeConfig",
        "parameters": [
          {
            "name": "employeeId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Salary_SalaryEmployeeConfigResponseResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Salary_ApiErrorResponse"
                }
              }
            }
          }
        },
        "x-flow-permission": "employee-payroll:write"
      }
    },
    "/v1/salary/employees/{employeeId}/calculate": {
      "post": {
        "tags": [
          "Salary · Salary lines"
        ],
        "summary": "Calculate the salary lines for a pay period",
        "description": "Needs permission employee-payroll:read. Runs the pro-rata calculation for one employee and pay period with no side effects, using the employee's salary history and working pattern exactly as a pay run does. Supply `year` and `period` to get the line item ids the pay run would receive. Supply `statutoryLines` to preview the salary adjustment and any top-up the employee's statutory leave policy produces for them; each result line carries its `kind`.",
        "operationId": "Salary_CalculateSalary",
        "parameters": [
          {
            "name": "employeeId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Salary_CalculateSalaryRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Salary_SalaryCalculationResponseResponseBody"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Salary_ObjectResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Salary_ApiErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Salary_ObjectResponseBody"
                }
              }
            }
          }
        },
        "x-flow-permission": "employee-payroll:read"
      }
    },
    "/v1/salary/organisation": {
      "get": {
        "tags": [
          "Salary · Salary organisation configuration"
        ],
        "summary": "Get the organisation's salary configuration",
        "description": "Needs permission organisation-settings:read. Returns the pro-rating method and whether the salary module is enabled for the organisation. 404 when nothing has been configured yet.",
        "operationId": "Salary_GetSalaryOrganisationConfig",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Salary_SalaryOrganisationConfigResponseResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Salary_ApiErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Salary_ObjectResponseBody"
                }
              }
            }
          }
        },
        "x-flow-permission": "organisation-settings:read"
      },
      "put": {
        "tags": [
          "Salary · Salary organisation configuration"
        ],
        "summary": "Create or replace the organisation's salary configuration",
        "description": "Needs permission organisation-settings:write. Sets the default pro-rating method and switches the module on or off. Every employee of the organisation is re-previewed on any open pay run, so the change reaches the current period as well as future ones.",
        "operationId": "Salary_PutSalaryOrganisationConfig",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Salary_UpsertSalaryOrganisationConfigRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Salary_SalaryOrganisationConfigResponseResponseBody"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Salary_ObjectResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Salary_ApiErrorResponse"
                }
              }
            }
          }
        },
        "x-flow-permission": "organisation-settings:write"
      },
      "delete": {
        "tags": [
          "Salary · Salary organisation configuration"
        ],
        "summary": "Delete the organisation's salary configuration",
        "description": "Needs permission organisation-settings:write. Removes the configuration and returns it; the module goes dormant for the organisation. 404 when nothing was configured.",
        "operationId": "Salary_DeleteSalaryOrganisationConfig",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Salary_SalaryOrganisationConfigResponseResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Salary_ApiErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Salary_ObjectResponseBody"
                }
              }
            }
          }
        },
        "x-flow-permission": "organisation-settings:write"
      }
    },
    "/v1/salary/organisation/leave": {
      "get": {
        "tags": [
          "Salary · Statutory leave policies"
        ],
        "summary": "Get the organisation's statutory leave policies",
        "description": "Needs permission organisation-settings:read. Always 200. `policies` is the document as stored (`isDefault` is true and the document empty when nothing is stored); `effective` gives the policy each statutory type resolves to and where it came from.",
        "operationId": "Salary_GetOrganisationStatutoryLeave",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Salary_OrganisationStatutoryLeaveResponseResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Salary_ApiErrorResponse"
                }
              }
            }
          }
        },
        "x-flow-permission": "organisation-settings:read"
      },
      "put": {
        "tags": [
          "Salary · Statutory leave policies"
        ],
        "summary": "Replace the organisation's statutory leave policies",
        "description": "Needs permission organisation-settings:write. `sickness` covers statutory sick pay, `familyLeave` every family-leave payment, and `byType` overrides either for one statutory type. A policy's `salaryTreatment` is `DeductAbsentDays` (the salary for the days on leave is taken back with a separate line; optional `topUp.tiers` pay a share of salary, statutory pay included, for a duration from the start of the leave such as `{ \"value\": 6, \"unit\": \"Week\" }`) or `FullPay` (the days on leave are taken back and topped up to 100% for the whole leave). Every employee is re-previewed on any open pay run.",
        "operationId": "Salary_PutOrganisationStatutoryLeave",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Salary_StatutoryLeavePolicyDocument"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Salary_OrganisationStatutoryLeaveResponseResponseBody"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Salary_ObjectResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Salary_ApiErrorResponse"
                }
              }
            }
          }
        },
        "x-flow-permission": "organisation-settings:write"
      },
      "delete": {
        "tags": [
          "Salary · Statutory leave policies"
        ],
        "summary": "Remove the organisation's statutory leave policies",
        "description": "Needs permission organisation-settings:write. Every statutory type falls back to the default: the salary for the absent days is deducted and nothing is topped up. Returns the policies now in force, as the GET would.",
        "operationId": "Salary_DeleteOrganisationStatutoryLeave",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Salary_OrganisationStatutoryLeaveResponseResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Salary_ApiErrorResponse"
                }
              }
            }
          }
        },
        "x-flow-permission": "organisation-settings:write"
      }
    },
    "/v1/salary/employees/{employeeId}/leave": {
      "get": {
        "tags": [
          "Salary · Statutory leave policies"
        ],
        "summary": "Get an employee's statutory leave policies",
        "description": "Needs permission employee-payroll:read. Always 200. `override` is the employee's own document (null when they inherit); `effective` gives, for every statutory type, the policy in force for this employee and its `source` (Employee, Organisation or Default).",
        "operationId": "Salary_GetEmployeeStatutoryLeave",
        "parameters": [
          {
            "name": "employeeId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Salary_EmployeeStatutoryLeaveResponseResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Salary_ApiErrorResponse"
                }
              }
            }
          }
        },
        "x-flow-permission": "employee-payroll:read"
      },
      "put": {
        "tags": [
          "Salary · Statutory leave policies"
        ],
        "summary": "Replace an employee's statutory leave override",
        "description": "Needs permission employee-payroll:write. Same document as the organisation's. Any part left out is inherited, so an override naming only `familyLeave` keeps the organisation's sickness policy. The employee's open payslips are re-previewed.",
        "operationId": "Salary_PutEmployeeStatutoryLeave",
        "parameters": [
          {
            "name": "employeeId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Salary_StatutoryLeavePolicyDocument"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Salary_EmployeeStatutoryLeaveResponseResponseBody"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Salary_ObjectResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Salary_ApiErrorResponse"
                }
              }
            }
          }
        },
        "x-flow-permission": "employee-payroll:write"
      },
      "delete": {
        "tags": [
          "Salary · Statutory leave policies"
        ],
        "summary": "Remove an employee's statutory leave override",
        "description": "Needs permission employee-payroll:write. The employee inherits the organisation's policies again; the open payslips are re-previewed. Returns the policies now in force, as the GET would.",
        "operationId": "Salary_DeleteEmployeeStatutoryLeave",
        "parameters": [
          {
            "name": "employeeId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Salary_EmployeeStatutoryLeaveResponseResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Salary_ApiErrorResponse"
                }
              }
            }
          }
        },
        "x-flow-permission": "employee-payroll:write"
      }
    },
    "/v2/pension/employee-pension/{employeeId}/additional-voluntary-contributions/{taxYear}/{period}": {
      "put": {
        "tags": [
          "Pensions v2 · AdditionalVoluntaryContribution"
        ],
        "summary": "Set an additional voluntary contribution for a pay period",
        "description": "Needs permission pension:write.\n\nSets a additional voluntary contribution for the addressed pay period only, on top of the group/override contribution and any regular additional contribution. Idempotent: repeating the call replaces the amount. The employee must be in a pension group. Applies to open pay runs only; the period's payslip is re-processed automatically.",
        "operationId": "PensionV2_PutAdditionalVoluntaryContribution",
        "parameters": [
          {
            "name": "employeeId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "taxYear",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "period",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PensionV2_PutAdditionalVoluntaryContributionRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_AdditionalVoluntaryContributionModelResponseBody"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ObjectResponseBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ObjectResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ApiErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ObjectResponseBody"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ObjectResponseBody"
                }
              }
            }
          }
        },
        "x-flow-permission": "pension:write"
      },
      "get": {
        "tags": [
          "Pensions v2 · AdditionalVoluntaryContribution"
        ],
        "summary": "Get the additional voluntary contribution for a pay period",
        "description": "Needs permission pension:read.\n\nReturns the additional voluntary contribution for the addressed pay period, or 404 when none is set.",
        "operationId": "PensionV2_GetAdditionalVoluntaryContribution",
        "parameters": [
          {
            "name": "employeeId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "taxYear",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "period",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_AdditionalVoluntaryContributionModelResponseBody"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ObjectResponseBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ObjectResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ApiErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ObjectResponseBody"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ObjectResponseBody"
                }
              }
            }
          }
        },
        "x-flow-permission": "pension:read"
      },
      "delete": {
        "tags": [
          "Pensions v2 · AdditionalVoluntaryContribution"
        ],
        "summary": "Remove the additional voluntary contribution for a pay period",
        "description": "Needs permission pension:write.\n\nRemoves the additional voluntary contribution for the addressed pay period; the period's payslip is re-processed automatically.",
        "operationId": "PensionV2_DeleteAdditionalVoluntaryContribution",
        "parameters": [
          {
            "name": "employeeId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "taxYear",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "period",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_BooleanResponseBody"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ObjectResponseBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ObjectResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ApiErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ObjectResponseBody"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ObjectResponseBody"
                }
              }
            }
          }
        },
        "x-flow-permission": "pension:write"
      }
    },
    "/v2/pension/employee-pension/{employeeId}/additional-voluntary-contributions": {
      "get": {
        "tags": [
          "Pensions v2 · AdditionalVoluntaryContribution"
        ],
        "summary": "List an employee's additional voluntary contributions",
        "description": "Needs permission pension:read.\n\nReturns the employee's additional voluntary contributions in pay-period order, one page at a time. The response carries the items plus a paginationToken when there is another page.",
        "operationId": "PensionV2_ListAdditionalVoluntaryContributions",
        "parameters": [
          {
            "name": "employeeId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "pageSize",
            "in": "query",
            "description": "The maximum number of additional voluntary contributions to return (1-100, default 50).",
            "schema": {
              "type": "integer",
              "description": "The maximum number of additional voluntary contributions to return (1-100, default 50).",
              "format": "int32"
            }
          },
          {
            "name": "paginationToken",
            "in": "query",
            "description": "The pagination token from the previous page. Always follow the token until it is absent rather than treating a short page as the last one.",
            "schema": {
              "type": "string",
              "description": "The pagination token from the previous page. Always follow the token until it is absent rather than treating a short page as the last one."
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_AdditionalVoluntaryContributionListModelResponseBody"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ObjectResponseBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ObjectResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ApiErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ObjectResponseBody"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ObjectResponseBody"
                }
              }
            }
          }
        },
        "x-flow-permission": "pension:read"
      }
    },
    "/v2/pension/auto-enrolment/enrolment-information/outstanding": {
      "get": {
        "tags": [
          "Pensions v2 · Auto-enrolment"
        ],
        "summary": "List statutory pension letters still to be given",
        "description": "Needs permission pension:read.\n\nLists every statutory pension letter a worker has not been given, worst first: failed sends, then overdue, then still due. letterType says which: Enrolment, ReEnrolment, OptInConfirmation or JoinConfirmation (counted from the date the membership starts), Postponement (from the day after the postponement's starting day) or OptInInformation (from the first assessment that found the worker can opt in or join); a JoinConfirmation has no legal deadline and is never Overdue. isScheduled says it will go by itself when the worker's next pay run is finalised. A failed or bounced send means it was never given, so a member's opt-out period has not started. Send any of them with POST /employee-pension/letters/{letterType}. Returns nothing for an organisation that has declared it issues the information itself. Paginated: follow paginationToken until it is absent, rather than treating a short page as the last.",
        "operationId": "PensionV2_GetOutstandingEnrolmentInformation",
        "parameters": [
          {
            "name": "asOfDate",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "name": "pageSize",
            "in": "query",
            "description": "Members per page, 1 to 100. Defaults to 50.",
            "schema": {
              "type": "integer",
              "description": "Members per page, 1 to 100. Defaults to 50.",
              "format": "int32"
            }
          },
          {
            "name": "paginationToken",
            "in": "query",
            "description": "The paginationToken from the previous page. Omit for the first page.",
            "schema": {
              "type": "string",
              "description": "The paginationToken from the previous page. Omit for the first page."
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_EnrolmentInformationDutyListModelResponseBody"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ObjectResponseBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ObjectResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ApiErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ObjectResponseBody"
                }
              }
            }
          }
        },
        "x-flow-permission": "pension:read"
      }
    },
    "/v2/pension/auto-enrolment/enrolment-information/sent": {
      "get": {
        "tags": [
          "Pensions v2 · Auto-enrolment"
        ],
        "summary": "List statutory pension letters that have been given",
        "description": "Needs permission pension:read.\n\nLists every statutory pension letter a worker HAS been given (letterType: Enrolment, ReEnrolment, Postponement, OptInInformation, OptInConfirmation or JoinConfirmation), most recently given first, with the date it was given and who gave it. The exact complement of /enrolment-information/outstanding: every letter owed appears in one list or the other, never both. The date returned is the date printed on the letter, which a member's opt-out period runs from, not the day somebody pressed send. Unlike the outstanding list this is not suppressed for an organisation that issues the information itself: Flow cannot say whether their duty is outstanding, but it can always say what it sent. Paginated: follow paginationToken until it is absent, rather than treating a short page as the last.",
        "operationId": "PensionV2_GetSentEnrolmentInformation",
        "parameters": [
          {
            "name": "pageSize",
            "in": "query",
            "description": "Members per page, 1 to 100. Defaults to 50.",
            "schema": {
              "type": "integer",
              "description": "Members per page, 1 to 100. Defaults to 50.",
              "format": "int32"
            }
          },
          {
            "name": "paginationToken",
            "in": "query",
            "description": "The paginationToken from the previous page. Omit for the first page.",
            "schema": {
              "type": "string",
              "description": "The paginationToken from the previous page. Omit for the first page."
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_EnrolmentInformationDutyListModelResponseBody"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ObjectResponseBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ObjectResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ApiErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ObjectResponseBody"
                }
              }
            }
          }
        },
        "x-flow-permission": "pension:read"
      }
    },
    "/v2/pension/auto-enrolment/not-complete": {
      "get": {
        "tags": [
          "Pensions v2 · Auto-enrolment"
        ],
        "summary": "List incomplete auto-enrolments",
        "description": "Needs permission pension:read.\n\nLists the employees the employer still owes an enrolment duty as at the given date (today when omitted): an eligible jobholder who has not been enrolled, or anybody whose enrolment a postponement is still deferring. Each row says which in enrolmentDuty (Due or Deferred). Exempt employees are left out.",
        "operationId": "PensionV2_GetNotCompleteAutoEnrolments",
        "parameters": [
          {
            "name": "includeEmployeeDetails",
            "in": "query",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "asOfDate",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_EmployeeAutoEnrolmentNotCompleteListResponseBody"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ObjectResponseBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ObjectResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ApiErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ObjectResponseBody"
                }
              }
            }
          }
        },
        "x-flow-permission": "pension:read"
      }
    },
    "/v2/pension/auto-enrolment/not-complete/payrun/{payrollConfigId}/{year}/{frequency}/{period}": {
      "get": {
        "tags": [
          "Pensions v2 · Auto-enrolment"
        ],
        "summary": "List incomplete auto-enrolments for a pay run",
        "description": "Needs permission pension:read.\n\nLists the employees the employer still owes an enrolment duty as at the given date (today when omitted) and whose latest assessment happened in the pay run for the given payroll configuration, tax year, frequency, and period: an eligible jobholder who has not been enrolled, or anybody whose enrolment a postponement is still deferring. Each row says which in enrolmentDuty (Due or Deferred). Exempt employees are left out.",
        "operationId": "PensionV2_GetNotCompleteAutoEnrolmentsByPayRun",
        "parameters": [
          {
            "name": "payrollConfigId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "year",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "frequency",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "period",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "includeEmployeeDetails",
            "in": "query",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "asOfDate",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_EmployeeAutoEnrolmentNotCompleteListResponseBody"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ObjectResponseBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ObjectResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ApiErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ObjectResponseBody"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ObjectResponseBody"
                }
              }
            }
          }
        },
        "x-flow-permission": "pension:read"
      }
    },
    "/v2/pension/auto-enrolment/complete/payrun/{payrollConfigId}/{year}/{frequency}/{period}": {
      "get": {
        "tags": [
          "Pensions v2 · Auto-enrolment"
        ],
        "summary": "List completed auto-enrolments for a pay run",
        "description": "Needs permission pension:read.\n\nLists employees whose auto-enrolment completed in the pay run for the given payroll configuration, tax year, frequency, and period.",
        "operationId": "PensionV2_GetCompleteAutoEnrolmentsByPayRun",
        "parameters": [
          {
            "name": "payrollConfigId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "year",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "frequency",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "period",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "includeEmployeeDetails",
            "in": "query",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "asOfDate",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_EmployeeAutoEnrolmentCompleteListResponseBody"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ObjectResponseBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ObjectResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ApiErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ObjectResponseBody"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ObjectResponseBody"
                }
              }
            }
          }
        },
        "x-flow-permission": "pension:read"
      }
    },
    "/v2/pension/auto-enrolment/not-auto-enrolments": {
      "get": {
        "tags": [
          "Pensions v2 · Auto-enrolment"
        ],
        "summary": "List employees not in auto-enrolment",
        "description": "Needs permission pension:read.\n\nLists employees who have no auto-enrolment, optionally including employee details.",
        "operationId": "PensionV2_GetNotAutoEnrolments",
        "parameters": [
          {
            "name": "includeEmployeeDetails",
            "in": "query",
            "schema": {
              "type": "boolean"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_EmployeeNotAutoEnrolmentListResponseBody"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ObjectResponseBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ObjectResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ApiErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ObjectResponseBody"
                }
              }
            }
          }
        },
        "x-flow-permission": "pension:read"
      }
    },
    "/v2/pension/auto-enrolment/not-auto-enrolments/payrun/{payrollConfigId}/{year}/{frequency}/{period}": {
      "get": {
        "tags": [
          "Pensions v2 · Auto-enrolment"
        ],
        "summary": "List employees not in auto-enrolment for a pay run",
        "description": "Needs permission pension:read.\n\nLists employees whose latest assessment happened in the given pay run and found them not eligible for auto-enrolment.",
        "operationId": "PensionV2_GetNotAutoEnrolmentsByPayRun",
        "parameters": [
          {
            "name": "payrollConfigId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "year",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "frequency",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "period",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "includeEmployeeDetails",
            "in": "query",
            "schema": {
              "type": "boolean"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_EmployeeNotAutoEnrolmentListResponseBody"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ObjectResponseBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ObjectResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ApiErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ObjectResponseBody"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ObjectResponseBody"
                }
              }
            }
          }
        },
        "x-flow-permission": "pension:read"
      }
    },
    "/v2/pension/auto-enrolment/assessments/payrun/{payrollConfigId}/{year}/{frequency}/{period}": {
      "get": {
        "tags": [
          "Pensions v2 · Auto-enrolment"
        ],
        "summary": "List assessments for a pay run",
        "description": "Needs permission pension:read.\n\nReturns the auto-enrolment assessments a pay run produced for the given payroll configuration, tax year, frequency, and period.",
        "operationId": "PensionV2_GetAssessmentsByPayRun",
        "parameters": [
          {
            "name": "payrollConfigId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "year",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "frequency",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "period",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_EmployeeAutoEnrolmentAssessmentModelListResponseBody"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ObjectResponseBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ObjectResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ApiErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ObjectResponseBody"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ObjectResponseBody"
                }
              }
            }
          }
        },
        "x-flow-permission": "pension:read"
      }
    },
    "/v2/pension/auto-enrolment/assessments/preview": {
      "post": {
        "tags": [
          "Pensions v2 · Auto-enrolment"
        ],
        "summary": "Preview an assessment",
        "description": "Needs permission pension:read.\n\nRuns a stateless auto-enrolment assessment from the request body alone: supply a date of birth, earnings with their frequency, and the pay reference period dates, and it returns the worker category with its consequences without reading or storing any employee data.",
        "operationId": "PensionV2_PreviewAutoEnrolmentAssessment",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PensionV2_PreviewAutoEnrolmentAssessmentRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_AutoEnrolmentAssessmentModelResponseBody"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ObjectResponseBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ObjectResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ApiErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ObjectResponseBody"
                }
              }
            }
          }
        },
        "x-flow-permission": "pension:read"
      }
    },
    "/v2/pension/auto-enrolment-exemption/{employeeId}": {
      "get": {
        "tags": [
          "Pensions v2 · AutoEnrolmentExemption"
        ],
        "summary": "Get an employee's auto-enrolment exemption",
        "description": "Needs permission pension:read.\n\nReturns an employee's auto-enrolment exemption, if one is set.",
        "operationId": "PensionV2_GetEmployeeAutoEnrolmentExemption",
        "parameters": [
          {
            "name": "employeeId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_EmployeeAutoEnrolmentExemptionResponseBody"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ObjectResponseBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ObjectResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ApiErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ObjectResponseBody"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ObjectResponseBody"
                }
              }
            }
          }
        },
        "x-flow-permission": "pension:read"
      },
      "delete": {
        "tags": [
          "Pensions v2 · AutoEnrolmentExemption"
        ],
        "summary": "Remove an employee's auto-enrolment exemption",
        "description": "Needs permission pension:write.\n\nRemoves an employee's auto-enrolment exemption so future assessments run normally.",
        "operationId": "PensionV2_DeleteEmployeeAutoEnrolmentExemption",
        "parameters": [
          {
            "name": "employeeId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ObjectResponseBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ObjectResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ApiErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ObjectResponseBody"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ObjectResponseBody"
                }
              }
            }
          }
        },
        "x-flow-permission": "pension:write"
      }
    },
    "/v2/pension/auto-enrolment-exemption": {
      "put": {
        "tags": [
          "Pensions v2 · AutoEnrolmentExemption"
        ],
        "summary": "Set an employee's auto-enrolment exemption",
        "description": "Needs permission pension:write.\n\nMarks an employee as exempt from the automatic enrolment and cyclical re-enrolment duties. While an exemption is in place the employee is not assessed and is never automatically enrolled; they may still opt in or be enrolled manually. Reasons follow The Pensions Regulator's exceptions to the employer duties: Director, OfficeHolder, LlpMember, TaxProtection, CeasedMembershipWithinTwelveMonths, WindingUpLumpSum, NoticeOfTermination.",
        "operationId": "PensionV2_PutEmployeeAutoEnrolmentExemption",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PensionV2_SubmitEmployeeAutoEnrolmentExemptionRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_EmployeeAutoEnrolmentExemptionResponseBody"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ObjectResponseBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ObjectResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ApiErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ObjectResponseBody"
                }
              }
            }
          }
        },
        "x-flow-permission": "pension:write"
      }
    },
    "/v2/pension/employee-pension/{employeeId}/contribution-overrides/{taxYear}/{period}": {
      "put": {
        "tags": [
          "Pensions v2 · ContributionOverride"
        ],
        "summary": "Set a contribution override for one pay period",
        "description": "Needs permission pension:write.\n\nSets the contribution for the addressed pay period only, replacing the group settings and any standing association override for that period (additional voluntary contributions stay additive on top). Idempotent: repeating the call replaces the override. The automatic enrolment minimum binds per pay reference period, so a below-minimum override needs acknowledgeBelowAutoEnrolmentMinimum. The employee must be in a pension group. Applies to open pay runs only; the period's payslip is re-processed automatically.",
        "operationId": "PensionV2_PutContributionOverride",
        "parameters": [
          {
            "name": "employeeId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "taxYear",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "period",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PensionV2_PutContributionOverrideRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ContributionOverrideModelResponseBody"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ObjectResponseBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ObjectResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ApiErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ObjectResponseBody"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ObjectResponseBody"
                }
              }
            }
          }
        },
        "x-flow-permission": "pension:write"
      },
      "get": {
        "tags": [
          "Pensions v2 · ContributionOverride"
        ],
        "summary": "Get the contribution override for one pay period",
        "description": "Needs permission pension:read.\n\nReturns the contribution override for the addressed pay period, or 404 when none is set.",
        "operationId": "PensionV2_GetContributionOverride",
        "parameters": [
          {
            "name": "employeeId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "taxYear",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "period",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ContributionOverrideModelResponseBody"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ObjectResponseBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ObjectResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ApiErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ObjectResponseBody"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ObjectResponseBody"
                }
              }
            }
          }
        },
        "x-flow-permission": "pension:read"
      },
      "delete": {
        "tags": [
          "Pensions v2 · ContributionOverride"
        ],
        "summary": "Remove the contribution override for one pay period",
        "description": "Needs permission pension:write.\n\nRemoves the contribution override for the addressed pay period; the period's contribution reverts to the standing settings and the payslip is re-processed automatically.",
        "operationId": "PensionV2_DeleteContributionOverride",
        "parameters": [
          {
            "name": "employeeId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "taxYear",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "period",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_BooleanResponseBody"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ObjectResponseBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ObjectResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ApiErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ObjectResponseBody"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ObjectResponseBody"
                }
              }
            }
          }
        },
        "x-flow-permission": "pension:write"
      }
    },
    "/v2/pension/employee-pension/{employeeId}/contribution-overrides": {
      "get": {
        "tags": [
          "Pensions v2 · ContributionOverride"
        ],
        "summary": "List an employee's contribution overrides",
        "description": "Needs permission pension:read.\n\nReturns the employee's contribution overrides in pay-period order, one page at a time. The response carries the items plus a paginationToken when there is another page.",
        "operationId": "PensionV2_ListContributionOverrides",
        "parameters": [
          {
            "name": "employeeId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "pageSize",
            "in": "query",
            "description": "The maximum number of contribution overrides to return (1-100, default 50).",
            "schema": {
              "type": "integer",
              "description": "The maximum number of contribution overrides to return (1-100, default 50).",
              "format": "int32"
            }
          },
          {
            "name": "paginationToken",
            "in": "query",
            "description": "The pagination token from the previous page. Always follow the token until it is absent rather than treating a short page as the last one.",
            "schema": {
              "type": "string",
              "description": "The pagination token from the previous page. Always follow the token until it is absent rather than treating a short page as the last one."
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ContributionOverrideListModelResponseBody"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ObjectResponseBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ObjectResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ApiErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ObjectResponseBody"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ObjectResponseBody"
                }
              }
            }
          }
        },
        "x-flow-permission": "pension:read"
      }
    },
    "/v2/pension/employee-pension/{employeeId}/opt-out-notices": {
      "post": {
        "tags": [
          "Pensions v2 · Employee enrolment"
        ],
        "summary": "Get somewhere to put a member's opt-out notice",
        "description": "Needs permission pension:write.\n\nReturns a short-lived URL to PUT the notice to, so the document goes straight to storage rather than through the service. The employer must keep the original or a copy of every opt-out notice for four years (TPR detailed guidance 7, paragraph 72), and it stays readable after the membership is deleted. Each notice gets its own id, so re-submitting one keeps the original as well.",
        "operationId": "PensionV2_CreateOptOutNoticeUpload",
        "parameters": [
          {
            "name": "employeeId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PensionV2_CreateOptOutNoticeUploadRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_OptOutNoticeUploadModelResponseBody"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ObjectResponseBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ObjectResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ApiErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ObjectResponseBody"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ObjectResponseBody"
                }
              }
            }
          }
        },
        "x-flow-permission": "pension:write"
      },
      "get": {
        "tags": [
          "Pensions v2 · Employee enrolment"
        ],
        "summary": "List the opt-out notices kept for one membership ending",
        "description": "Needs permission pension:read.\n\nEvery notice kept for the ending on the given date, newest first, each with a short-lived URL to read it and the date it must be kept until.",
        "operationId": "PensionV2_ListOptOutNotices",
        "parameters": [
          {
            "name": "employeeId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "membershipEndDate",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "format": "date"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_OptOutNoticeModelListResponseBody"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ObjectResponseBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ObjectResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ApiErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ObjectResponseBody"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ObjectResponseBody"
                }
              }
            }
          }
        },
        "x-flow-permission": "pension:read"
      }
    },
    "/v2/pension/employee-pension": {
      "post": {
        "tags": [
          "Pensions v2 · Employee enrolment"
        ],
        "summary": "Enrol an employee",
        "description": "Needs permission pension:write.\n\nAssociates an employee with a pension group, recording the enrolment date.",
        "operationId": "PensionV2_PostEmployeePensionAssociation",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PensionV2_SubmitEmployeePensionAssociationRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_EmployeePensionAssociationResponseBody"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ObjectResponseBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ObjectResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ApiErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ObjectResponseBody"
                }
              }
            }
          }
        },
        "x-flow-permission": "pension:write"
      }
    },
    "/v2/pension/employee-pension/{employeeId}": {
      "get": {
        "tags": [
          "Pensions v2 · Employee enrolment"
        ],
        "summary": "Get an employee's enrolment",
        "description": "Needs permission pension:read.\n\nReturns an employee's pension association: the link to their pension group and the enrolment date.",
        "operationId": "PensionV2_GetEmployeePensionAssociation",
        "parameters": [
          {
            "name": "employeeId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_EmployeePensionCompositionV2ResponseBody"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ObjectResponseBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ObjectResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ApiErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ObjectResponseBody"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ObjectResponseBody"
                }
              }
            }
          }
        },
        "x-flow-permission": "pension:read"
      },
      "delete": {
        "tags": [
          "Pensions v2 · Employee enrolment"
        ],
        "summary": "Remove an employee from their pension",
        "description": "Needs permission pension:write.\n\nThe single removal surface. optOutDate (or today) becomes the membership end date. processRefund=true refunds every settled member contribution from enrolment to that date on the next payslip, and is REFUSED when that date falls outside the statutory opt-out period unless refundOutsideOptOutPeriodReason says why. Use GET /employee-pension/{employeeId}/refund-preview first to show the operator what would be refunded. Returns the membership end reason and the refunded amounts per period.",
        "operationId": "PensionV2_DeleteEmployeePensionAssociation",
        "parameters": [
          {
            "name": "employeeId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "optOutDate",
            "in": "query",
            "description": "The date the member left the scheme. Pay runs whose pay period ends before it keep their contributions. Without it, the employee comes off from the latest pay run still open, and today is recorded as the end date. Supplying it asserts that the member left, so without a reason the ending is recorded as OptOut, or as MembershipCeased for a member with no right to opt out. Must not be earlier than the employee's enrolment date.",
            "schema": {
              "type": "string",
              "description": "The date the member left the scheme. Pay runs whose pay period ends before it keep their contributions. Without it, the employee comes off from the latest pay run still open, and today is recorded as the end date. Supplying it asserts that the member left, so without a reason the ending is recorded as OptOut, or as MembershipCeased for a member with no right to opt out. Must not be earlier than the employee's enrolment date.",
              "format": "date"
            }
          },
          {
            "name": "processRefund",
            "in": "query",
            "description": "The employer's decision to refund the member's contributions through payroll: every settled member contribution from enrolment to the opt-out date, on the next payslip. Defaults to false. Whether the opt-out is inside the statutory opt-out period is the employer's assessment (The Pensions Regulator's detailed guidance 7); the employer holds the notice and the evidence.",
            "schema": {
              "type": "boolean",
              "description": "The employer's decision to refund the member's contributions through payroll: every settled member contribution from enrolment to the opt-out date, on the next payslip. Defaults to false. Whether the opt-out is inside the statutory opt-out period is the employer's assessment (The Pensions Regulator's detailed guidance 7); the employer holds the notice and the evidence."
            }
          },
          {
            "name": "reason",
            "in": "query",
            "description": "Why the membership ended, as the employer asserts it: OptOut, MembershipCeased or AdministrativeRemoval. OptOut is refused (400) for a member put in under their contract or who asked to join as an entitled worker: the law gives them no right to opt out (The Pensions Regulator's detailed guidance 7, para 9), so their membership ceases instead. Defaults to OptOut when an optOutDate is supplied or processRefund=true (MembershipCeased for those members), and to AdministrativeRemoval for a bare removal with neither. Only OptOut and MembershipCeased suppress re-enrolment until the scheme's next 3-yearly cyclical re-enrolment date.",
            "schema": {
              "enum": [
                "OptOut",
                "MembershipCeased",
                "AdministrativeRemoval"
              ],
              "type": "string",
              "description": "Why the membership ended, as the employer asserts it: OptOut, MembershipCeased or AdministrativeRemoval. OptOut is refused (400) for a member put in under their contract or who asked to join as an entitled worker: the law gives them no right to opt out (The Pensions Regulator's detailed guidance 7, para 9), so their membership ceases instead. Defaults to OptOut when an optOutDate is supplied or processRefund=true (MembershipCeased for those members), and to AdministrativeRemoval for a bare removal with neither. Only OptOut and MembershipCeased suppress re-enrolment until the scheme's next 3-yearly cyclical re-enrolment date."
            }
          },
          {
            "name": "refundOutsideOptOutPeriodReason",
            "in": "query",
            "description": "Why a refund is being made even though the membership ended OUTSIDE the statutory opt-out period. Required in that case and rejected in any other. Outside the period a defined-contribution scheme owes no refund (The Pensions Regulator's detailed guidance 7, paras 25 and 55-57); the employer may still choose to pay one, and this records that it was a deliberate decision and who made it. Call GET /employee-pension/{employeeId}/refund-preview to find out whether the date is inside the period.",
            "schema": {
              "type": "string",
              "description": "Why a refund is being made even though the membership ended OUTSIDE the statutory opt-out period. Required in that case and rejected in any other. Outside the period a defined-contribution scheme owes no refund (The Pensions Regulator's detailed guidance 7, paras 25 and 55-57); the employer may still choose to pay one, and this records that it was a deliberate decision and who made it. Call GET /employee-pension/{employeeId}/refund-preview to find out whether the date is inside the period."
            }
          },
          {
            "name": "noPayrollRefundReason",
            "in": "query",
            "description": "Why the employee is not being refunded through payroll, for example \"Already refunded with a pay element\". Records the employer's refund decision on an opt-out without a refund. Refused with processRefund=true. An opt-out with neither stays on GET /organisation/opt-out-refunds?status=awaitingDecision until someone decides.",
            "schema": {
              "type": "string",
              "description": "Why the employee is not being refunded through payroll, for example \"Already refunded with a pay element\". Records the employer's refund decision on an opt-out without a refund. Refused with processRefund=true. An opt-out with neither stays on GET /organisation/opt-out-refunds?status=awaitingDecision until someone decides."
            }
          },
          {
            "name": "optOutNoticeReference",
            "in": "query",
            "description": "Only with an opt-out the member made by handing the employer the provider's paper opt-out form: the reference printed on it, exactly as printed (letters and numbers, up to 20, keeping leading zeros). Sent to the provider with the opt-out. Leave it out when the member opted out with the provider directly: the provider already holds that opt-out.",
            "schema": {
              "type": "string",
              "description": "Only with an opt-out the member made by handing the employer the provider's paper opt-out form: the reference printed on it, exactly as printed (letters and numbers, up to 20, keeping leading zeros). Sent to the provider with the opt-out. Leave it out when the member opted out with the provider directly: the provider already holds that opt-out."
            }
          },
          {
            "name": "optOutNoticeReceivedInTime",
            "in": "query",
            "description": "Required with optOutNoticeReference, and must be true: the employer's declaration that the paper form reached them within the opt-out period. A form that arrived later is not an opt-out, so the request is refused.",
            "schema": {
              "type": "boolean",
              "description": "Required with optOutNoticeReference, and must be true: the employer's declaration that the paper form reached them within the opt-out period. A form that arrived later is not an opt-out, so the request is refused."
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_EmployeePensionOptOutModelResponseBody"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ObjectResponseBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ObjectResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ApiErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ObjectResponseBody"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ObjectResponseBody"
                }
              }
            }
          }
        },
        "x-flow-permission": "pension:write"
      }
    },
    "/v2/pension/employee-pension/batch": {
      "get": {
        "tags": [
          "Pensions v2 · Employee enrolment"
        ],
        "summary": "List enrolments in batch",
        "description": "Needs permission pension:read.\n\nReturns pension associations for several employees at once via repeated employeeId query parameters.",
        "operationId": "PensionV2_GetEmployeePensionAssociations",
        "parameters": [
          {
            "name": "employeeId",
            "in": "query",
            "required": true,
            "schema": {
              "type": "array",
              "items": {
                "type": "string"
              }
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_EmployeePensionCompositionV2ListResponseBody"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ObjectResponseBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ObjectResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ApiErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ObjectResponseBody"
                }
              }
            }
          }
        },
        "x-flow-permission": "pension:read"
      }
    },
    "/v2/pension/employee-pension/{employeeId}/refund-preview": {
      "get": {
        "tags": [
          "Pensions v2 · Employee enrolment"
        ],
        "summary": "Preview an opt-out refund",
        "description": "Needs permission pension:read.\n\nSide-effect-free: exactly what a refund through payroll would pay back per settled period for an opt-out on the given date. Show this to the operator before they confirm the removal.",
        "operationId": "PensionV2_GetEmployeePensionRefundPreview",
        "parameters": [
          {
            "name": "employeeId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "optOutDate",
            "in": "query",
            "description": "The membership end date the refund is previewed up to. Defaults to today.",
            "schema": {
              "type": "string",
              "description": "The membership end date the refund is previewed up to. Defaults to today.",
              "format": "date"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_EmployeePensionOptOutModelResponseBody"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ObjectResponseBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ObjectResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ApiErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ObjectResponseBody"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ObjectResponseBody"
                }
              }
            }
          }
        },
        "x-flow-permission": "pension:read"
      }
    },
    "/v2/pension/employee-pension/{employeeId}/opt-out-refunds/{membershipEndDate}": {
      "get": {
        "tags": [
          "Pensions v2 · Employee enrolment"
        ],
        "summary": "Get an opt-out refund",
        "description": "Needs permission pension:read.\n\nAn opt-out whose membership has already ended, and what refunding it through payroll would pay back now: the employee's settled contributions per pay period, already-refunded periods left out. Side-effect-free. Show it to the employer before they decide.",
        "operationId": "PensionV2_GetOptOutRefund",
        "parameters": [
          {
            "name": "employeeId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "membershipEndDate",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "date"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_OptOutRefundModelResponseBody"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ObjectResponseBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ObjectResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ApiErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ObjectResponseBody"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ObjectResponseBody"
                }
              }
            }
          }
        },
        "x-flow-permission": "pension:read"
      }
    },
    "/v2/pension/employee-pension/{employeeId}/opt-out-refunds/{membershipEndDate}/decision": {
      "put": {
        "tags": [
          "Pensions v2 · Employee enrolment"
        ],
        "summary": "Decide an opt-out refund",
        "description": "Needs permission pension:write.\n\nRecords the employer's refund decision on an opt-out that has already ended. processRefund=true puts the employee's contributions back on their next payslip; otherwise noPayrollRefundReason says why not (for example, already refunded another way). A refund through payroll cannot be undone here: 409 once it has been made. The platform never decides this from a pension provider's own refund rules; the employer does.",
        "operationId": "PensionV2_PutOptOutRefundDecision",
        "parameters": [
          {
            "name": "employeeId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "membershipEndDate",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "date"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PensionV2_OptOutRefundDecisionRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_PensionMembershipEndModelResponseBody"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ObjectResponseBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ObjectResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ApiErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ObjectResponseBody"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ObjectResponseBody"
                }
              }
            }
          }
        },
        "x-flow-permission": "pension:write"
      }
    },
    "/v2/pension/employee-pension/{employeeId}/membership-ends": {
      "get": {
        "tags": [
          "Pensions v2 · Employee enrolment"
        ],
        "summary": "List an employee's membership endings",
        "description": "Needs permission pension:read.\n\nEvery time this employee's pension membership ended, oldest first: why it ended, when, the member contributions refunded through payroll, and the employer contributions the scheme owes back to the employer. Readable after the enrolment itself is deleted, so it answers 'what was refunded?' long after the event.",
        "operationId": "PensionV2_ListEmployeeMembershipEnds",
        "parameters": [
          {
            "name": "employeeId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "pageSize",
            "in": "query",
            "description": "Endings per page, 1 to 100. Defaults to 50.",
            "schema": {
              "type": "integer",
              "description": "Endings per page, 1 to 100. Defaults to 50.",
              "format": "int32"
            }
          },
          {
            "name": "paginationToken",
            "in": "query",
            "description": "The paginationToken from the previous page. Omit for the first page.",
            "schema": {
              "type": "string",
              "description": "The paginationToken from the previous page. Omit for the first page."
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_PensionMembershipEndListModelResponseBody"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ObjectResponseBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ObjectResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ApiErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ObjectResponseBody"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ObjectResponseBody"
                }
              }
            }
          }
        },
        "x-flow-permission": "pension:read"
      }
    },
    "/v2/pension/employee-pension/{employeeId}/enrolment-letter": {
      "post": {
        "tags": [
          "Pensions v2 · Employee enrolment"
        ],
        "summary": "Send an enrolment letter",
        "description": "Needs permission pension:write.\n\nTriggers the enrolment letter for an employee. Answers 409 when the letter cannot be sent until something is put right: one is already on its way (enrolment_letter_already_sending), the scheme does not say where staff get the opt-out form (pension_scheme_no_opt_out_contact), the pension has no enrolment date (pension_membership_no_enrolment_date), or nothing says how the worker joined, so the letter cannot say whether they may opt out (pension_membership_no_joining_route): send enrolmentBasis on their pension, then send the letter.",
        "operationId": "PensionV2_SendEnrolmentLetter",
        "parameters": [
          {
            "name": "employeeId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ObjectResponseBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ObjectResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ApiErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ObjectResponseBody"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ObjectResponseBody"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ObjectResponseBody"
                }
              }
            }
          }
        },
        "x-flow-permission": "pension:write"
      }
    },
    "/v2/pension/employee-pension/letters/{letterType}": {
      "post": {
        "tags": [
          "Pensions v2 · Employee enrolment"
        ],
        "summary": "Send pension letters",
        "description": "Needs permission pension:write.\n\nQueues the named pension letter for several employees and returns the job to watch. Nothing has been sent when this responds. Follow the job with GET /employee-pension/letters/jobs/{jobId}, or listen for the 'pensionLetterJobUpdated' websocket event and read it when one arrives.",
        "operationId": "PensionV2_SendPensionLetters",
        "parameters": [
          {
            "name": "letterType",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PensionV2_SendPensionLettersRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "202": {
            "description": "Accepted",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_PensionLetterJobAcceptedModelResponseBody"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ObjectResponseBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ObjectResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ApiErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ObjectResponseBody"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ObjectResponseBody"
                }
              }
            }
          }
        },
        "x-flow-permission": "pension:write"
      }
    },
    "/v2/pension/employee-pension/letters/jobs/{jobId}": {
      "get": {
        "tags": [
          "Pensions v2 · Employee enrolment"
        ],
        "summary": "Get a pension letter job",
        "description": "Needs permission pension:read.\n\nHow far a batch has got: how many letters are on their way, how many were not sent, and who they were. The source of truth for a batch, whether or not the websocket push arrived.",
        "operationId": "PensionV2_GetPensionLetterJob",
        "parameters": [
          {
            "name": "jobId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_PensionLetterJobModelResponseBody"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ObjectResponseBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ObjectResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ApiErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ObjectResponseBody"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ObjectResponseBody"
                }
              }
            }
          }
        },
        "x-flow-permission": "pension:read"
      }
    },
    "/v2/pension/employee-pension/letters/{letterType}/sending": {
      "put": {
        "tags": [
          "Pensions v2 · Employee enrolment"
        ],
        "summary": "Choose how pension letters are sent",
        "description": "Needs permission pension:write.\n\nFor each employee, whether the named letter goes by itself when their next pay run is finalised (sendAutomatically: true) or waits for somebody to send it (false). Applies to letters still to be given; a letter already given is reported in skipped as AlreadyGiven, and somebody owed no such letter as NotEnrolled, NoPostponementNotice or NoOptInInformation. The organisation's automaticLetterTypes decides it for letters that become owed later. Up to 1000 employees per request.",
        "operationId": "PensionV2_SetPensionLetterSending",
        "parameters": [
          {
            "name": "letterType",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PensionV2_PutLetterSendingRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_LetterSendingModelResponseBody"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ObjectResponseBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ObjectResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ApiErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ObjectResponseBody"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ObjectResponseBody"
                }
              }
            }
          }
        },
        "x-flow-permission": "pension:write"
      }
    },
    "/v2/pension/employee-pension/{employeeId}/letters": {
      "get": {
        "tags": [
          "Pensions v2 · Employee enrolment"
        ],
        "summary": "List one employee's pension letters",
        "description": "Needs permission pension:read.\n\nEvery statutory pension letter the employee is owed or has been given, by the same rules as /auto-enrolment/enrolment-information/outstanding and /sent: still owed first (failed, overdue, due), then given. isScheduled says a letter will go by itself when the employee's next pay run is finalised. Letters still owed are left out for an organisation that has declared it issues the information itself; letters Flow sent are always shown.",
        "operationId": "PensionV2_GetEmployeePensionLetters",
        "parameters": [
          {
            "name": "employeeId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "asOfDate",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_EnrolmentInformationDutyListModelResponseBody"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ObjectResponseBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ObjectResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ApiErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ObjectResponseBody"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ObjectResponseBody"
                }
              }
            }
          }
        },
        "x-flow-permission": "pension:read"
      }
    },
    "/v2/pension/export-file-retrieval/pension-calculation/year/{year}/period/{period}/frequency/{frequency}/payroll-config/{payrollConfigId}": {
      "get": {
        "tags": [
          "Pensions v2 · Pension calculations"
        ],
        "summary": "Retrieve export files",
        "description": "Needs permission pension:export.\n\nReturns the export files generated for a pay period, the current lock cycle's first and then every earlier cycle's (a file built before the pay run was unlocked is kept, marked superseded, and stays downloadable). Pass lockCycle to list one cycle's files only. Equivalent to listing them through the pension-calculation export endpoint.",
        "operationId": "PensionV2_ExportFileRetrieval_GetPensionCalculationExportFilesV2",
        "parameters": [
          {
            "name": "year",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "period",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "frequency",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "payrollConfigId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "lockCycle",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_PensionCalculationExportFileV2ListResponseBody"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ObjectResponseBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ObjectResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ApiErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ObjectResponseBody"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ObjectResponseBody"
                }
              }
            }
          }
        },
        "x-flow-permission": "pension:export"
      }
    },
    "/v2/pension/organisation": {
      "get": {
        "tags": [
          "Pensions v2 · Organisation defaults"
        ],
        "summary": "Get organisation pension defaults",
        "description": "Needs permission pension:read.\n\nReturns your organisation's pension defaults: the default pension group, default postponement definitions, and the auto-enrolment mode.",
        "operationId": "PensionV2_GetOrganisationPensionDefault",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_OrganisationPensionDefaultModelResponseBody"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ObjectResponseBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ObjectResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ApiErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ObjectResponseBody"
                }
              }
            }
          }
        },
        "x-flow-permission": "pension:read"
      }
    },
    "/v2/pension/organisation/pension-default/postponement-settings": {
      "put": {
        "tags": [
          "Pensions v2 · Organisation defaults"
        ],
        "summary": "Update postponement defaults",
        "description": "Needs permission pension:write.\n\nSets the organisation's default postponement start-date and eligibility-date definitions, each a value plus a frequency. Both may be set: one postpones from a worker's first day of employment, the other from the day they become an eligible jobholder, and a worker is postponed once, by whichever of the two ends later when both apply at their first assessment. Each lasts at most three months, counted from its own starting day (Pensions Act 2008, section 4(6)): at most 3 months, 13 weeks or 92 days. A longer or negative length is refused with 400 POSTPONEMENT_TOO_LONG, and 0 means no postponement. The deferral date is never set later than three calendar months after the starting day, whatever the unit.",
        "operationId": "PensionV2_PutPostponementSettings",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PensionV2_PutPostponementSettingsRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_OrganisationPensionDefaultModelResponseBody"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ObjectResponseBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ObjectResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ApiErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ObjectResponseBody"
                }
              }
            }
          }
        },
        "x-flow-permission": "pension:write"
      }
    },
    "/v2/pension/organisation/pension-default/auto-enrolment-settings": {
      "put": {
        "tags": [
          "Pensions v2 · Organisation defaults"
        ],
        "summary": "Update auto-enrolment settings",
        "description": "Needs permission pension:write.\n\nSets the organisation's auto-enrolment mode.",
        "operationId": "PensionV2_PutAutoEnrolmentSettings",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PensionV2_PutAutoEnrolmentSettingsRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_OrganisationPensionDefaultModelResponseBody"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ObjectResponseBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ObjectResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ApiErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ObjectResponseBody"
                }
              }
            }
          }
        },
        "x-flow-permission": "pension:write"
      }
    },
    "/v2/pension/organisation/opt-out-refunds": {
      "get": {
        "tags": [
          "Pensions v2 · Organisation defaults"
        ],
        "summary": "List opt-out refunds",
        "description": "Needs permission pension:read.\n\nOpt-outs whose refund the employer has not decided, oldest first, each with what refunding it through payroll would pay back now. Decide each with PUT /employee-pension/{employeeId}/opt-out-refunds/{membershipEndDate}/decision.",
        "operationId": "PensionV2_ListOptOutRefunds",
        "parameters": [
          {
            "name": "status",
            "in": "query",
            "description": "Which refunds to list. awaitingDecision (the default and, today, the only value): opt-outs not refunded through payroll and with no reason recorded for not doing so.",
            "schema": {
              "type": "string",
              "description": "Which refunds to list. awaitingDecision (the default and, today, the only value): opt-outs not refunded through payroll and with no reason recorded for not doing so."
            }
          },
          {
            "name": "pageSize",
            "in": "query",
            "description": "Refunds per page, 1 to 100. Defaults to 50.",
            "schema": {
              "type": "integer",
              "description": "Refunds per page, 1 to 100. Defaults to 50.",
              "format": "int32"
            }
          },
          {
            "name": "paginationToken",
            "in": "query",
            "description": "The paginationToken from the previous page. Omit for the first page.",
            "schema": {
              "type": "string",
              "description": "The paginationToken from the previous page. Omit for the first page."
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_OptOutRefundListModelResponseBody"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ObjectResponseBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ObjectResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ApiErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ObjectResponseBody"
                }
              }
            }
          }
        },
        "x-flow-permission": "pension:read"
      }
    },
    "/v2/pension/organisation/pension-membership-ends": {
      "get": {
        "tags": [
          "Pensions v2 · Organisation defaults"
        ],
        "summary": "List pension membership endings (refunds report)",
        "description": "Needs permission pension:read.\n\nEvery pension membership ending in the organisation over a date range, with the member and employer refund amounts for each. This is the report to reconcile against what the pension provider actually returned: employer contributions are repaid by the scheme to the employer directly and never appear on a payslip.",
        "operationId": "PensionV2_ListPensionMembershipEnds",
        "parameters": [
          {
            "name": "fromDate",
            "in": "query",
            "description": "Include endings on or after this date. Defaults to a year before toDate.",
            "schema": {
              "type": "string",
              "description": "Include endings on or after this date. Defaults to a year before toDate.",
              "format": "date"
            }
          },
          {
            "name": "toDate",
            "in": "query",
            "description": "Include endings on or before this date. Defaults to today.",
            "schema": {
              "type": "string",
              "description": "Include endings on or before this date. Defaults to today.",
              "format": "date"
            }
          },
          {
            "name": "pageSize",
            "in": "query",
            "description": "Endings per page, 1 to 100. Defaults to 50.",
            "schema": {
              "type": "integer",
              "description": "Endings per page, 1 to 100. Defaults to 50.",
              "format": "int32"
            }
          },
          {
            "name": "paginationToken",
            "in": "query",
            "description": "The paginationToken from the previous page. Omit for the first page.",
            "schema": {
              "type": "string",
              "description": "The paginationToken from the previous page. Omit for the first page."
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_PensionMembershipEndListModelResponseBody"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ObjectResponseBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ObjectResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ApiErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ObjectResponseBody"
                }
              }
            }
          }
        },
        "x-flow-permission": "pension:read"
      }
    },
    "/v2/pension/pension-calculation/by-year/{year}/by-month/{month}": {
      "get": {
        "tags": [
          "Pensions v2 · Pension calculations"
        ],
        "summary": "List calculations for a month",
        "description": "Needs permission pension:read.\n\nReturns every employee pension calculation in the organisation for the given calendar year and month.",
        "operationId": "PensionV2_GetEmployeePensionCalculationsForMonth",
        "parameters": [
          {
            "name": "year",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "month",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_EmployeePensionCalculationV2ListResponseBody"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ObjectResponseBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ObjectResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ApiErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ObjectResponseBody"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ObjectResponseBody"
                }
              }
            }
          }
        },
        "x-flow-permission": "pension:read"
      }
    },
    "/v2/pension/pension-calculation/pension-provider/{pensionProviderId}/by-year/{year}/by-month/{month}": {
      "get": {
        "tags": [
          "Pensions v2 · Pension calculations"
        ],
        "summary": "List calculations for a provider",
        "description": "Needs permission pension:read.\n\nReturns the employee pension calculations for one pension provider in the given calendar year and month.",
        "operationId": "PensionV2_GetEmployeePensionCalculationsByPensionProviderForMonth",
        "parameters": [
          {
            "name": "pensionProviderId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "year",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "month",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_EmployeePensionCalculationV2ListResponseBody"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ObjectResponseBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ObjectResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ApiErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ObjectResponseBody"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ObjectResponseBody"
                }
              }
            }
          }
        },
        "x-flow-permission": "pension:read"
      }
    },
    "/v2/pension/pension-calculation/csv/year/{year}/period/{period}/frequency/{frequency}/payroll-config/{payrollConfigId}": {
      "get": {
        "tags": [
          "Pensions v2 · Pension calculations"
        ],
        "summary": "Download the contributions CSV",
        "description": "Needs permission pension:export.\n\nReturns the pension contributions CSV for a pay period, addressed by tax year, period, frequency, and payroll configuration. Answers 409 while the pay run is still calculating: pension writes one contribution per payslip, so a CSV built before the last one lands would be short. The request is unchanged - retry once the run has finished.",
        "operationId": "PensionV2_GetPensionCalculationCsv",
        "parameters": [
          {
            "name": "frequency",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "year",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "period",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "payrollConfigId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_PensionCalculationCsvV2ResponseBody"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ObjectResponseBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ObjectResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ApiErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ObjectResponseBody"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ObjectResponseBody"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ObjectResponseBody"
                }
              }
            }
          }
        },
        "x-flow-permission": "pension:export"
      }
    },
    "/v2/pension/pension-calculation/export": {
      "post": {
        "tags": [
          "Pensions v2 · Pension calculations"
        ],
        "summary": "Generate provider export files",
        "description": "Needs permission pension:export.\n\nGenerates provider-format export files for a pay period; list the generated files with the export retrieval endpoints. Answers 409 while the pay run is still calculating, because a file built before every payslip has settled would be short of members. The request is unchanged - retry once the run has finished.",
        "operationId": "PensionV2_GenerateExportFiles",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PensionV2_GetPensionCalculationExportFileRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_PensionCalculationExportFileV2ListResponseBody"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ObjectResponseBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ObjectResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ApiErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ObjectResponseBody"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ObjectResponseBody"
                }
              }
            }
          }
        },
        "x-flow-permission": "pension:export"
      }
    },
    "/v2/pension/pension-calculation/export/year/{year}/period/{period}/frequency/{frequency}/payroll-config/{payrollConfigId}": {
      "get": {
        "tags": [
          "Pensions v2 · Pension calculations"
        ],
        "summary": "List generated export files",
        "description": "Needs permission pension:export.\n\nLists the export files generated for a pay period, including their file paths, provider slugs, export groups, and file types.",
        "operationId": "PensionV2_RetrieveExportFiles",
        "parameters": [
          {
            "name": "frequency",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "year",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "period",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "payrollConfigId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_PensionCalculationExportFileV2ListResponseBody"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ObjectResponseBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ObjectResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ApiErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ObjectResponseBody"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ObjectResponseBody"
                }
              }
            }
          }
        },
        "x-flow-permission": "pension:export"
      }
    },
    "/v2/pension/pension-calculation": {
      "post": {
        "tags": [
          "Pensions v2 · Pension calculations"
        ],
        "summary": "Record a calculation",
        "description": "Needs permission pension:write.\n\nRecords an employee's pension calculation for a pay period.",
        "operationId": "PensionV2_PostEmployeePensionCalculation",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PensionV2_SubmitEmployeePensionCalculationRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_EmployeePensionCalculationV2ResponseBody"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ObjectResponseBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ObjectResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ApiErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ObjectResponseBody"
                }
              }
            }
          }
        },
        "x-flow-permission": "pension:write"
      }
    },
    "/v2/pension/pension-group": {
      "post": {
        "tags": [
          "Pensions v2 · Pension groups"
        ],
        "summary": "Create a pension group",
        "description": "Needs permission pension:write.\n\nCreates a contribution group within a scheme: the pension type, contribution basis, employee and employer factors, and an optional external reference. One group can be marked as the organisation's default.",
        "operationId": "PensionV2_PostPensionGroup",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PensionV2_SubmitPensionGroupRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_PensionGroupV2ResponseBody"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ObjectResponseBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ObjectResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ApiErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ObjectResponseBody"
                }
              }
            }
          }
        },
        "x-flow-permission": "pension:write"
      }
    },
    "/v2/pension/pension-group/{id}": {
      "put": {
        "tags": [
          "Pensions v2 · Pension groups"
        ],
        "summary": "Update a pension group",
        "description": "Needs permission pension:write.\n\nUpdates a pension group's contribution rules.",
        "operationId": "PensionV2_PutPensionGroup",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PensionV2_SubmitPensionGroupRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_PensionGroupV2ResponseBody"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ObjectResponseBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ObjectResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ApiErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ObjectResponseBody"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ObjectResponseBody"
                }
              }
            }
          }
        },
        "x-flow-permission": "pension:write"
      },
      "get": {
        "tags": [
          "Pensions v2 · Pension groups"
        ],
        "summary": "Get a pension group",
        "description": "Needs permission pension:read.\n\nRetrieves a pension group by its identifier.",
        "operationId": "PensionV2_GetPensionGroup",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_PensionGroupV2ResponseBody"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ObjectResponseBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ObjectResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ApiErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ObjectResponseBody"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ObjectResponseBody"
                }
              }
            }
          }
        },
        "x-flow-permission": "pension:read"
      },
      "delete": {
        "tags": [
          "Pensions v2 · Pension groups"
        ],
        "summary": "Delete a pension group",
        "description": "Needs permission pension:write.\n\nDeletes a pension group.",
        "operationId": "PensionV2_DeletePensionGroup",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_PensionGroupV2ResponseBody"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ObjectResponseBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ObjectResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ApiErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ObjectResponseBody"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ObjectResponseBody"
                }
              }
            }
          }
        },
        "x-flow-permission": "pension:write"
      }
    },
    "/v2/pension/pension-group/allowed-bases": {
      "get": {
        "tags": [
          "Pensions v2 · Pension groups"
        ],
        "summary": "List allowed contribution bases",
        "description": "Needs permission pension:read.\n\nReturns the contribution bases the service accepts, for use when creating or updating pension groups.",
        "operationId": "PensionV2_GetAllowedPensionBases",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_StringListResponseBody"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ObjectResponseBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ObjectResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ApiErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ObjectResponseBody"
                }
              }
            }
          }
        },
        "x-flow-permission": "pension:read"
      }
    },
    "/v2/pension/pension-information/{employeeId}": {
      "get": {
        "tags": [
          "Pensions v2 · Pension information"
        ],
        "summary": "Get an employee's pension information",
        "description": "Needs permission pension:read.\n\nReturns an employee's full pension picture in one call: their pension composition, latest auto-enrolment determination, and any postponement.",
        "operationId": "PensionV2_GetPensionInformation",
        "parameters": [
          {
            "name": "employeeId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_PensionInformationModelResponseBody"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ObjectResponseBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ObjectResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ApiErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ObjectResponseBody"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ObjectResponseBody"
                }
              }
            }
          }
        },
        "x-flow-permission": "pension:read"
      }
    },
    "/v2/pension/pension-provider": {
      "get": {
        "tags": [
          "Pensions v2 · Pension providers"
        ],
        "summary": "List pension providers",
        "description": "Needs permission pension:read.\n\nLists the pension providers available to your organisation.",
        "operationId": "PensionV2_GetPensionProviders",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_PensionProviderV2ListResponseBody"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ObjectResponseBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ObjectResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ApiErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ObjectResponseBody"
                }
              }
            }
          }
        },
        "x-flow-permission": "pension:read"
      }
    },
    "/v2/pension/pension-provider/{id}": {
      "get": {
        "tags": [
          "Pensions v2 · Pension providers"
        ],
        "summary": "Get a pension provider",
        "description": "Needs permission pension:read.\n\nRetrieves a pension provider by its identifier.",
        "operationId": "PensionV2_GetPensionProvider",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_PensionProviderV2ResponseBody"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ObjectResponseBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ObjectResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ApiErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ObjectResponseBody"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ObjectResponseBody"
                }
              }
            }
          }
        },
        "x-flow-permission": "pension:read"
      }
    },
    "/v2/pension/pension-provider/slug/{slug}": {
      "get": {
        "tags": [
          "Pensions v2 · Pension providers"
        ],
        "summary": "Get a pension provider by slug",
        "description": "Needs permission pension:read.\n\nRetrieves a pension provider by its URL-friendly slug.",
        "operationId": "PensionV2_GetPensionProviderBySlug",
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_PensionProviderV2ResponseBody"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ObjectResponseBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ObjectResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ApiErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ObjectResponseBody"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ObjectResponseBody"
                }
              }
            }
          }
        },
        "x-flow-permission": "pension:read"
      }
    },
    "/v2/pension/pension-schema": {
      "post": {
        "tags": [
          "Pensions v2 · Pension schemes"
        ],
        "summary": "Create a pension scheme",
        "description": "Needs permission pension:write.\n\nCreates your organisation's arrangement with a provider, recording the payment source, duty start date, last re-enrolment date, and an optional external reference. Scheme endpoints use the path segment pension-schema.",
        "operationId": "PensionV2_PostPensionScheme",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PensionV2_SubmitPensionSchemeRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_PensionSchemeV2ResponseBody"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ObjectResponseBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ObjectResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ApiErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ObjectResponseBody"
                }
              }
            }
          }
        },
        "x-flow-permission": "pension:write"
      }
    },
    "/v2/pension/pension-schema/{id}": {
      "put": {
        "tags": [
          "Pensions v2 · Pension schemes"
        ],
        "summary": "Update a pension scheme",
        "description": "Needs permission pension:write.\n\nUpdates a pension scheme.",
        "operationId": "PensionV2_PutPensionScheme",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PensionV2_SubmitPensionSchemeRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_PensionSchemeV2ResponseBody"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ObjectResponseBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ObjectResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ApiErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ObjectResponseBody"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ObjectResponseBody"
                }
              }
            }
          }
        },
        "x-flow-permission": "pension:write"
      },
      "get": {
        "tags": [
          "Pensions v2 · Pension schemes"
        ],
        "summary": "Get a pension scheme",
        "description": "Needs permission pension:read.\n\nRetrieves a pension scheme by its identifier.",
        "operationId": "PensionV2_GetPensionScheme",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_FullPensionSchemeResponseBody"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ObjectResponseBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ObjectResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ApiErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ObjectResponseBody"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ObjectResponseBody"
                }
              }
            }
          }
        },
        "x-flow-permission": "pension:read"
      },
      "delete": {
        "tags": [
          "Pensions v2 · Pension schemes"
        ],
        "summary": "Delete a pension scheme",
        "description": "Needs permission pension:write.\n\nDeletes a pension scheme.",
        "operationId": "PensionV2_DeletePensionScheme",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_PensionSchemeV2ResponseBody"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ObjectResponseBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ObjectResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ApiErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ObjectResponseBody"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ObjectResponseBody"
                }
              }
            }
          }
        },
        "x-flow-permission": "pension:write"
      }
    },
    "/v2/pension/pension-schema/organisation": {
      "get": {
        "tags": [
          "Pensions v2 · Pension schemes"
        ],
        "summary": "List pension schemes",
        "description": "Needs permission pension:read.\n\nReturns every pension scheme in your organisation, each with its provider and groups embedded.",
        "operationId": "PensionV2_GetPensionSchemes",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_FullPensionSchemeListResponseBody"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ObjectResponseBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ObjectResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ApiErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ObjectResponseBody"
                }
              }
            }
          }
        },
        "x-flow-permission": "pension:read"
      }
    },
    "/v2/pension/postponement/{employeeId}": {
      "get": {
        "tags": [
          "Pensions v2 · Postponement"
        ],
        "summary": "Get an employee's postponement",
        "description": "Needs permission pension:read.\n\nReturns an employee's postponement definitions.",
        "operationId": "PensionV2_GetEmployeePostponement",
        "parameters": [
          {
            "name": "employeeId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_EmployeePostponementResponseBody"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ObjectResponseBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ObjectResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ApiErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ObjectResponseBody"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ObjectResponseBody"
                }
              }
            }
          }
        },
        "x-flow-permission": "pension:read"
      },
      "delete": {
        "tags": [
          "Pensions v2 · Postponement"
        ],
        "summary": "Remove an employee's postponement",
        "description": "Needs permission pension:write.\n\nRemoves an employee's postponement.",
        "operationId": "PensionV2_DeleteEmployeePostponement",
        "parameters": [
          {
            "name": "employeeId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_BooleanResponseBody"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ObjectResponseBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ObjectResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ApiErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ObjectResponseBody"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ObjectResponseBody"
                }
              }
            }
          }
        },
        "x-flow-permission": "pension:write"
      }
    },
    "/v2/pension/postponement": {
      "put": {
        "tags": [
          "Pensions v2 · Postponement"
        ],
        "summary": "Set an employee's postponement",
        "description": "Needs permission pension:write.\n\nSets an employee's postponement: a start-date definition and an eligibility-date definition that take the place of the organisation defaults for that employee. Each lasts at most three months from its starting day (Pensions Act 2008, section 4(6)): at most 3 months, 13 weeks or 92 days. A longer or negative length is refused with 400 POSTPONEMENT_TOO_LONG.",
        "operationId": "PensionV2_PutEmployeePostponement",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PensionV2_SubmitEmployeePostponementRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_EmployeePostponementResponseBody"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ObjectResponseBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ObjectResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ApiErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ObjectResponseBody"
                }
              }
            }
          }
        },
        "x-flow-permission": "pension:write"
      }
    },
    "/v2/pension/provider-sync/reconciliation": {
      "get": {
        "tags": [
          "Pensions v2 · Provider submissions"
        ],
        "summary": "Check the scheme matches its pension provider",
        "description": "Needs permission pension:read.\n\nCompares Flow's records with what the connected provider has reported: who is enrolled in Flow, the opt-outs the provider sent back and whether each was applied, plus stopped contributions and refunds awaiting attention.",
        "operationId": "PensionV2_GetProviderSyncReconciliation",
        "parameters": [
          {
            "name": "schemeId",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_SchemeReconciliationV2ResponseBody"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ObjectResponseBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ObjectResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ApiErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ObjectResponseBody"
                }
              }
            }
          }
        },
        "x-flow-permission": "pension:read"
      }
    },
    "/v2/pension/provider-sync/returns": {
      "get": {
        "tags": [
          "Pensions v2 · Provider submissions"
        ],
        "summary": "List what pension providers sent back",
        "description": "Needs permission pension:read.\n\nWhat connected pension providers have sent back, newest first: opt-outs, stopped contributions, refunds, payment schedules and scheme setup. Filter with type (for example pension.opt-outs.received). Each entry carries the full detail as document. Paginated: read paginationToken from the response and pass it back for the next page, and keep going while it is non-null rather than judging by the row count.",
        "operationId": "PensionV2_GetProviderReturns",
        "parameters": [
          {
            "name": "type",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "pageSize",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "paginationToken",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ProviderReturnListModelResponseBody"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ObjectResponseBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ObjectResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ApiErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ObjectResponseBody"
                }
              }
            }
          }
        },
        "x-flow-permission": "pension:read"
      }
    },
    "/v2/pension/provider-sync/member-changes": {
      "get": {
        "tags": [
          "Pensions v2 · Provider submissions"
        ],
        "summary": "Changes a pension provider has reported about members",
        "description": "Needs permission pension:read.\n\nWhat providers have told us about members: someone opted out, or stopped paying contributions. Nothing here has been applied. Reading from a provider never changes payroll on its own, so each of these waits for someone to apply or dismiss it, exactly as sending to a provider waits to be asked. Filter with status (Pending, Applied, Dismissed) and follow paginationToken while it is non-null.",
        "operationId": "PensionV2_GetProviderMemberChanges",
        "parameters": [
          {
            "name": "status",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "pageSize",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "paginationToken",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ProviderMemberChangeListModelResponseBody"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ObjectResponseBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ObjectResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ApiErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ObjectResponseBody"
                }
              }
            }
          }
        },
        "x-flow-permission": "pension:read"
      }
    },
    "/v2/pension/provider-sync/member-changes/summary": {
      "get": {
        "tags": [
          "Pensions v2 · Provider submissions"
        ],
        "summary": "How many provider changes are waiting",
        "description": "Needs permission pension:read.\n\nCounts what is waiting to be applied, so a screen can show that something needs attention without reading the whole list. Opt-outs are counted separately because they carry a refund duty and a deadline.",
        "operationId": "PensionV2_GetProviderMemberChangeSummary",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ProviderMemberChangeSummaryV2ResponseBody"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ObjectResponseBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ObjectResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ApiErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ObjectResponseBody"
                }
              }
            }
          }
        },
        "x-flow-permission": "pension:read"
      }
    },
    "/v2/pension/provider-sync/member-changes/{changeId}/apply": {
      "post": {
        "tags": [
          "Pensions v2 · Provider submissions"
        ],
        "summary": "Apply a provider's reported change to the member's pension",
        "description": "Needs permission pension:write.\n\nEnds the member's pension membership on the provider's own date, recording who decided. For an opt-out, the body carries the employer's refund decision: processRefund=true puts the employee's contributions back on their next payslip, or noPayrollRefundReason says why not. The provider repays the employer, never the employee, so whether the employee is refunded through payroll is always the employer's decision. With no body the change is applied and the opt-out waits on GET /organisation/opt-out-refunds?status=awaitingDecision. A stopped-contributions change takes no refund decision. A change that has already been applied or dismissed cannot be decided a second time.",
        "operationId": "PensionV2_PostApplyProviderMemberChange",
        "parameters": [
          {
            "name": "changeId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PensionV2_ApplyProviderMemberChangeRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ProviderMemberChangeV2ResponseBody"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ObjectResponseBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ObjectResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ApiErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ObjectResponseBody"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ObjectResponseBody"
                }
              }
            }
          }
        },
        "x-flow-permission": "pension:write"
      }
    },
    "/v2/pension/provider-sync/member-changes/{changeId}/dismiss": {
      "post": {
        "tags": [
          "Pensions v2 · Provider submissions"
        ],
        "summary": "Record that a provider's reported change was not applied",
        "description": "Needs permission pension:write.\n\nLeaves the member's pension as it is and takes the change off the waiting list, recording who decided and when. Use it when the change has already been handled another way, or when it does not apply to this payroll.",
        "operationId": "PensionV2_PostDismissProviderMemberChange",
        "parameters": [
          {
            "name": "changeId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ProviderMemberChangeV2ResponseBody"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ObjectResponseBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ObjectResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ApiErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ObjectResponseBody"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ObjectResponseBody"
                }
              }
            }
          }
        },
        "x-flow-permission": "pension:write"
      }
    },
    "/v2/pension/provider-sync/member-changes/{changeId}/acknowledge": {
      "post": {
        "tags": [
          "Pensions v2 · Provider submissions"
        ],
        "summary": "Mark a provider's reported change as seen",
        "description": "Needs permission pension:write.\n\nTakes the change off the waiting list without changing anybody's pension. Use it when the change is being handled another way and nobody should be chased about it again.",
        "operationId": "PensionV2_PostAcknowledgeProviderMemberChange",
        "parameters": [
          {
            "name": "changeId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ProviderMemberChangeV2ResponseBody"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ObjectResponseBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ObjectResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ApiErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ObjectResponseBody"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ObjectResponseBody"
                }
              }
            }
          }
        },
        "x-flow-permission": "pension:write"
      }
    },
    "/v2/pension/provider-sync/member-changes/{changeId}/delete": {
      "post": {
        "tags": [
          "Pensions v2 · Provider submissions"
        ],
        "summary": "Remove a provider's reported change from the lists",
        "description": "Needs permission pension:write.\n\nHides the change from every list. What a provider reported about a member is kept either way: it is evidence in an auto-enrolment audit, and so is the fact that somebody chose to remove it. Unlike the other decisions, this one can be used on a change that has already been decided.",
        "operationId": "PensionV2_PostDeleteProviderMemberChange",
        "parameters": [
          {
            "name": "changeId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_StringResponseBody"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ObjectResponseBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ObjectResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ApiErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ObjectResponseBody"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ObjectResponseBody"
                }
              }
            }
          }
        },
        "x-flow-permission": "pension:write"
      }
    },
    "/v2/pension/provider-sync/{payrollConfigId}/{year}/{frequency}/{period}": {
      "get": {
        "tags": [
          "Pensions v2 · Provider submissions"
        ],
        "summary": "List provider submissions for a pay run",
        "description": "Needs permission pension:read.\n\nShows what was sent to each scheme's connected pension provider for the pay run (enrolments, contribution schedules and payment approvals) with their current status.",
        "operationId": "PensionV2_GetPayRunProviderSubmissions",
        "parameters": [
          {
            "name": "payrollConfigId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "year",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "frequency",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "period",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ProviderSyncRecordV2ListResponseBody"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ObjectResponseBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ObjectResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ApiErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ObjectResponseBody"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ObjectResponseBody"
                }
              }
            }
          }
        },
        "x-flow-permission": "pension:read"
      }
    },
    "/v2/pension/provider-sync/operations/{operationId}": {
      "get": {
        "tags": [
          "Pensions v2 · Provider submissions"
        ],
        "summary": "Find the provider submission an operation belongs to",
        "description": "Needs permission pension:read.\n\nThe pension submission sent with this integrations operation, including the pay run it was for (payRun), its status and what the provider reported. Use it to open the pay run from a notification or the integrations activity, which know only the operation. 404 when this organisation sent nothing with that operation.",
        "operationId": "PensionV2_GetProviderSubmissionByOperation",
        "parameters": [
          {
            "name": "operationId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ProviderSyncRecordV2ResponseBody"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ObjectResponseBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ObjectResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ApiErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ObjectResponseBody"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ObjectResponseBody"
                }
              }
            }
          }
        },
        "x-flow-permission": "pension:read"
      }
    },
    "/v2/pension/provider-sync/{payrollConfigId}/{year}/{frequency}/{period}/sendable": {
      "get": {
        "tags": [
          "Pensions v2 · Provider submissions"
        ],
        "summary": "List the pay run's schemes that can be sent to a provider",
        "description": "Needs permission pension:read.\n\nEvery scheme in this pay run, and whether each can be sent to a pension provider right now. Schemes that cannot be sent are listed too, with sendable false and a reason: pension_scheme_not_connected for one that delivers by export file, connection_not_callable for one whose connection has to be finished or repaired. An empty list means the pay run holds no pension calculations at all. Use this to know what to offer before anything has been sent, since submissions never start on their own.",
        "operationId": "PensionV2_GetPayRunSendableSchemes",
        "parameters": [
          {
            "name": "payrollConfigId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "year",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "frequency",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "period",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_SendableSchemeV2ListResponseBody"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ObjectResponseBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ObjectResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ApiErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ObjectResponseBody"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ObjectResponseBody"
                }
              }
            }
          }
        },
        "x-flow-permission": "pension:read"
      }
    },
    "/v2/pension/provider-sync/{payrollConfigId}/{year}/{frequency}/{period}/issues": {
      "get": {
        "tags": [
          "Pensions v2 · Provider submissions"
        ],
        "summary": "Everything the provider refused about one submission",
        "description": "Needs permission pension:read.\n\nReturns every issue the pension provider reported for one part of a pay run, each with the record it relates to, the provider's own code, and the provider's own wording. A submission's record carries the first page of these and the total; use this when the total is larger than the page, or whenever the complete list is wanted. Returns an empty list for a submission the provider accepted.",
        "operationId": "PensionV2_GetPayRunSubmissionIssues",
        "parameters": [
          {
            "name": "payrollConfigId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "year",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "frequency",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "period",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "schemeId",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "operationType",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ProviderSyncIssueV2ListResponseBody"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ObjectResponseBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ObjectResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ApiErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ObjectResponseBody"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ObjectResponseBody"
                }
              }
            }
          }
        },
        "x-flow-permission": "pension:read"
      }
    },
    "/v2/pension/provider-sync/{payrollConfigId}/{year}/{frequency}/{period}/send": {
      "post": {
        "tags": [
          "Pensions v2 · Provider submissions"
        ],
        "summary": "Send the pay run to the connected pension providers",
        "description": "Needs permission pension:write.\n\nSubmits enrolments and the contribution schedule to each connected scheme in the pay run. Completing a pay run produces the export files and stops there, so a submission only happens when you ask for one. Pass schemeId to send a single scheme, and operationType (pension.members.enrol or pension.contributions.submit) to send just that part, which is how a part that did not land is sent again on its own. With both parts, enrolments go first, because a member the provider has never seen cannot appear on a contribution schedule. Read schemes in the response to find out what the send decided, scheme by scheme: Submitted, Skipped (not connected, or nothing outstanding), Blocked (the connection needs finishing or repairing) or Failed, each with a reason token. Do not read an empty submissions list as success. Submission is asynchronous, so submissions carries the ledger as it stands now; read the pay run's submissions to follow them. Sending the same unchanged data twice is deduplicated rather than submitted again. Naming a schemeId the pay run does not hold answers 404. Answers 409 while the pay run is still calculating: the schedule is built from the run's contributions, not from the export files, so sending early would put a schedule short of members in front of the provider. The request is unchanged - retry once the run has finished.",
        "operationId": "PensionV2_PostPayRunSendToProvider",
        "parameters": [
          {
            "name": "payrollConfigId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "year",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "frequency",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "period",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "schemeId",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "operationType",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_SendToProviderResultV2ResponseBody"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ObjectResponseBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ObjectResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ApiErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ObjectResponseBody"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ObjectResponseBody"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ObjectResponseBody"
                }
              }
            }
          }
        },
        "x-flow-permission": "pension:write"
      }
    },
    "/v2/pension/provider-sync/{payrollConfigId}/{year}/{frequency}/{period}/approve-payment": {
      "post": {
        "tags": [
          "Pensions v2 · Provider submissions"
        ],
        "summary": "Approve the pay run's contribution schedule for payment",
        "description": "Needs permission payment:release.\n\nTells the pension provider to collect the submitted contribution schedule. Available once the provider has accepted the contributions and issued a schedule reference.",
        "operationId": "PensionV2_PostPayRunApprovePayment",
        "parameters": [
          {
            "name": "payrollConfigId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "year",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "frequency",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "period",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "schemeId",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ProviderSyncRecordV2ResponseBody"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ObjectResponseBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ObjectResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ApiErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ObjectResponseBody"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ObjectResponseBody"
                }
              }
            }
          }
        },
        "x-flow-permission": "payment:release"
      }
    },
    "/v2/pension/provider-sync/{payrollConfigId}/{year}/{frequency}/{period}/refresh-members": {
      "post": {
        "tags": [
          "Pensions v2 · Provider submissions"
        ],
        "summary": "Re-read named members' details so a refused submission can be corrected",
        "description": "Needs permission pension:write.\n\nReads the named members from their employee records again and writes their details back onto this pay run, then leaves them ready to send. Use it when a provider refuses somebody for a detail rather than an amount, such as a missing National Insurance number that has since been added: the pay run does not have to be re-run. The pay run's figures are never touched, only the details a provider validates. Name the members by employee id, as the provider's refusals report them, up to 250 at a time. The response says which were re-read and why any were not.",
        "operationId": "PensionV2_PostPayRunRefreshMembers",
        "parameters": [
          {
            "name": "payrollConfigId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "year",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "frequency",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "period",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PensionV2_RefreshMemberDetailsRequestV2"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_RefreshMemberDetailsResponseV2ResponseBody"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ObjectResponseBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ObjectResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ApiErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ObjectResponseBody"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PensionV2_ObjectResponseBody"
                }
              }
            }
          }
        },
        "x-flow-permission": "pension:write"
      }
    },
    "/v1/integrations/bindings/{consumer}/{resourceType}/{resourceId}": {
      "put": {
        "tags": [
          "Integrations · Scheme links"
        ],
        "description": "Needs permission integration:write.",
        "operationId": "Integrations_PutBinding",
        "parameters": [
          {
            "name": "consumer",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "resourceType",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "resourceId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Integrations_PutBindingRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Integrations_BindingResponseResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Integrations_ApiErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Integrations_ObjectResponseBody"
                }
              }
            }
          }
        },
        "x-flow-permission": "integration:write",
        "summary": "Link a record to a connection"
      },
      "delete": {
        "tags": [
          "Integrations · Scheme links"
        ],
        "description": "Needs permission integration:write.",
        "operationId": "Integrations_DeleteBinding",
        "parameters": [
          {
            "name": "consumer",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "resourceType",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "resourceId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Integrations_BooleanResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Integrations_ApiErrorResponse"
                }
              }
            }
          }
        },
        "x-flow-permission": "integration:write",
        "summary": "Unlink a record from its connection"
      },
      "get": {
        "tags": [
          "Integrations · Scheme links"
        ],
        "description": "Needs permission integration:read.",
        "operationId": "Integrations_GetBinding",
        "parameters": [
          {
            "name": "consumer",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "resourceType",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "resourceId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Integrations_BindingResponseResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Integrations_ApiErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Integrations_ObjectResponseBody"
                }
              }
            }
          }
        },
        "x-flow-permission": "integration:read",
        "summary": "Read which connection a record is linked to"
      }
    },
    "/v1/integrations/connections": {
      "get": {
        "tags": [
          "Integrations · Connections"
        ],
        "description": "Needs permission integration:read.",
        "operationId": "Integrations_ListConnections",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Integrations_ConnectionResponseListResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Integrations_ApiErrorResponse"
                }
              }
            }
          }
        },
        "x-flow-permission": "integration:read",
        "summary": "List your connections"
      },
      "post": {
        "tags": [
          "Integrations · Connections"
        ],
        "description": "Needs permission integration:write.",
        "operationId": "Integrations_CreateConnection",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Integrations_CreateConnectionRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Integrations_ConnectionResponseResponseBody"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Integrations_ObjectResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Integrations_ApiErrorResponse"
                }
              }
            }
          }
        },
        "x-flow-permission": "integration:write",
        "summary": "Create a connection"
      }
    },
    "/v1/integrations/connections/{connectionId}": {
      "get": {
        "tags": [
          "Integrations · Connections"
        ],
        "description": "Needs permission integration:read.",
        "operationId": "Integrations_GetConnection",
        "parameters": [
          {
            "name": "connectionId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Integrations_ConnectionResponseResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Integrations_ApiErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Integrations_ObjectResponseBody"
                }
              }
            }
          }
        },
        "x-flow-permission": "integration:read",
        "summary": "Get a connection"
      },
      "put": {
        "tags": [
          "Integrations · Connections"
        ],
        "description": "Needs permission integration:write.",
        "operationId": "Integrations_UpdateConnection",
        "parameters": [
          {
            "name": "connectionId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Integrations_UpdateConnectionRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Integrations_ConnectionResponseResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Integrations_ApiErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Integrations_ObjectResponseBody"
                }
              }
            }
          }
        },
        "x-flow-permission": "integration:write",
        "summary": "Rename or pause a connection"
      },
      "delete": {
        "tags": [
          "Integrations · Connections"
        ],
        "summary": "Delete a connection for good",
        "description": "Needs permission integration:write.\n\nRemoves the connection permanently. The only condition is that nothing is bound to it: a connection does NOT have to be disconnected first, and may be deleted in any state. Returns 409 connection_has_bindings while a scheme or template still points at it, so unbind those first. Operations it already ran stay in the activity log, but they will no longer resolve its name. Use POST /connections/{connectionId}/disconnect instead to stop a connection while keeping it, and its history, readable.",
        "operationId": "Integrations_DeleteConnection",
        "parameters": [
          {
            "name": "connectionId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Integrations_ConnectionResponseResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Integrations_ApiErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Integrations_ObjectResponseBody"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Integrations_ObjectResponseBody"
                }
              }
            }
          }
        },
        "x-flow-permission": "integration:write"
      }
    },
    "/v1/integrations/connections/{connectionId}/disconnect": {
      "post": {
        "tags": [
          "Integrations · Connections"
        ],
        "summary": "Disconnect a connection, removing this organisation's access",
        "description": "Needs permission integration:write.\n\nRemoves this organisation's access at the provider where the provider supports it (Xero: the organisation stops listing Flow Payroll as a connected app; other organisations connected by the same Xero user are not affected), then deletes the stored sign-in and stops anything sending through this connection. The connection itself is kept, so its past activity stays readable under its own name. Removal at the provider is best effort: if the provider cannot be reached, the disconnect still completes. Reversible: authorise or supply credentials again to bring it back. Returns 409 connection_has_bindings while something still points at it, and nothing is removed. To remove it entirely, use DELETE /connections/{connectionId}.",
        "operationId": "Integrations_DisconnectConnection",
        "parameters": [
          {
            "name": "connectionId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Integrations_ConnectionResponseResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Integrations_ApiErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Integrations_ObjectResponseBody"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Integrations_ObjectResponseBody"
                }
              }
            }
          }
        },
        "x-flow-permission": "integration:write"
      }
    },
    "/v1/integrations/connections/{connectionId}/authorise": {
      "post": {
        "tags": [
          "Integrations · Connections"
        ],
        "description": "Needs permission integration:write.",
        "operationId": "Integrations_AuthoriseConnection",
        "parameters": [
          {
            "name": "connectionId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Integrations_AuthoriseConnectionRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Integrations_AuthoriseConnectionResponseResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Integrations_ApiErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Integrations_ObjectResponseBody"
                }
              }
            }
          }
        },
        "x-flow-permission": "integration:write",
        "summary": "Start signing in at the provider"
      }
    },
    "/v1/integrations/connections/{connectionId}/exchange": {
      "post": {
        "tags": [
          "Integrations · Connections"
        ],
        "summary": "Finish connecting with the provider's authorisation code",
        "description": "Needs permission integration:write.\n\nExchanges the code from the provider's sign-in for access. A provider organisation is connected at most once per organisation here: if it is already held by a connection that is not live (for example one that was disconnected), that connection is reconnected instead and the one in the path is deleted, so the response carries the EXISTING connection's id. Always continue with the id in the response. Returns 409 tenant_already_connected, and deletes the connection in the path, when a live connection already holds that provider organisation. Returns 409 tenant_mismatch when the connection is in use (it has bindings) and the sign-in chose a different provider organisation from the one it is tied to: the new sign-in is discarded, the connection stays disconnected with its bindings untouched, and the message carries tokenArguments currentTenantName and chosenTenantName.",
        "operationId": "Integrations_ExchangeConnection",
        "parameters": [
          {
            "name": "connectionId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Integrations_ExchangeAuthorisationCodeRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Integrations_ConnectionResponseResponseBody"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Integrations_ObjectResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Integrations_ApiErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Integrations_ObjectResponseBody"
                }
              }
            }
          }
        },
        "x-flow-permission": "integration:write"
      }
    },
    "/v1/integrations/connections/{connectionId}/tenants": {
      "get": {
        "tags": [
          "Integrations · Connections"
        ],
        "description": "Needs permission integration:read.",
        "operationId": "Integrations_ListConnectionTenants",
        "parameters": [
          {
            "name": "connectionId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Integrations_TenantResponseListResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Integrations_ApiErrorResponse"
                }
              }
            }
          }
        },
        "x-flow-permission": "integration:read",
        "summary": "List the organisations this sign-in can reach"
      }
    },
    "/v1/integrations/connections/{connectionId}/tenant": {
      "put": {
        "tags": [
          "Integrations · Connections"
        ],
        "summary": "Choose which provider organisation this connection uses",
        "description": "Needs permission integration:write.\n\nSame rule as the code exchange: if another connection that is not live already holds the chosen provider organisation, that connection is reconnected and returned instead, and the one in the path is deleted. Always continue with the id in the response. Returns 409 tenant_already_connected when a live connection already holds it. Returns 409 tenant_mismatch (tokenArguments currentTenantName, chosenTenantName) when the connection is in use and the chosen provider organisation differs from the one it is tied to; a live connection keeps working on its current one.",
        "operationId": "Integrations_SelectConnectionTenant",
        "parameters": [
          {
            "name": "connectionId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Integrations_SelectTenantRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Integrations_ConnectionResponseResponseBody"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Integrations_ObjectResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Integrations_ApiErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Integrations_ObjectResponseBody"
                }
              }
            }
          }
        },
        "x-flow-permission": "integration:write"
      }
    },
    "/v1/integrations/connections/{connectionId}/credentials": {
      "put": {
        "tags": [
          "Integrations · Connections"
        ],
        "description": "Needs permission integration:write.",
        "operationId": "Integrations_SetConnectionCredentials",
        "parameters": [
          {
            "name": "connectionId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Integrations_SetBasicCredentialsRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Integrations_ConnectionResponseResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Integrations_ApiErrorResponse"
                }
              }
            }
          }
        },
        "x-flow-permission": "integration:write",
        "summary": "Save the provider sign-in details"
      }
    },
    "/v1/integrations/connections/{connectionId}/test": {
      "post": {
        "tags": [
          "Integrations · Connections"
        ],
        "description": "Needs permission integration:write.",
        "operationId": "Integrations_TestConnection",
        "parameters": [
          {
            "name": "connectionId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Integrations_TestConnectionResponseResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Integrations_ApiErrorResponse"
                }
              }
            }
          }
        },
        "x-flow-permission": "integration:write",
        "summary": "Test the connection with the provider"
      }
    },
    "/v1/integrations/connections/{connectionId}/bindings": {
      "get": {
        "tags": [
          "Integrations · Connections"
        ],
        "description": "Needs permission integration:read.",
        "operationId": "Integrations_ListConnectionBindings",
        "parameters": [
          {
            "name": "connectionId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Integrations_BindingResponseListResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Integrations_ApiErrorResponse"
                }
              }
            }
          }
        },
        "x-flow-permission": "integration:read",
        "summary": "List what is linked to a connection"
      }
    },
    "/v1/integrations/connections/{connectionId}/pension/setup": {
      "get": {
        "tags": [
          "Integrations · Connections"
        ],
        "description": "Needs permission integration:read.",
        "operationId": "Integrations_GetConnectionPensionSetup",
        "parameters": [
          {
            "name": "connectionId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Integrations_PensionSetupResponseResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Integrations_ApiErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Integrations_ObjectResponseBody"
                }
              }
            }
          }
        },
        "x-flow-permission": "integration:read",
        "summary": "Groups and payment sources held by the provider"
      }
    },
    "/v1/integrations/connections/{connectionId}/accounting/accounts": {
      "get": {
        "tags": [
          "Integrations · Connections"
        ],
        "description": "Needs permission integration:read.",
        "operationId": "Integrations_GetConnectionAccounts",
        "parameters": [
          {
            "name": "connectionId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Integrations_AccountingAccountResponseListResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Integrations_ApiErrorResponse"
                }
              }
            }
          }
        },
        "x-flow-permission": "integration:read",
        "summary": "Read the chart of accounts"
      }
    },
    "/v1/integrations/connections/{connectionId}/accounting/tracking-categories": {
      "get": {
        "tags": [
          "Integrations · Connections"
        ],
        "description": "Needs permission integration:read.",
        "operationId": "Integrations_GetConnectionTrackingCategories",
        "parameters": [
          {
            "name": "connectionId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Integrations_TrackingCategoryResponseListResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Integrations_ApiErrorResponse"
                }
              }
            }
          }
        },
        "x-flow-permission": "integration:read",
        "summary": "Read the analysis dimensions"
      }
    },
    "/v1/integrations/connections/{connectionId}/accounting/tax-rates": {
      "get": {
        "tags": [
          "Integrations · Connections"
        ],
        "description": "Needs permission integration:read.",
        "operationId": "Integrations_GetConnectionTaxRates",
        "parameters": [
          {
            "name": "connectionId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Integrations_AccountingTaxRateResponseListResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Integrations_ApiErrorResponse"
                }
              }
            }
          }
        },
        "x-flow-permission": "integration:read",
        "summary": "Read the tax rates"
      }
    },
    "/v1/integrations/connections/{connectionId}/accounting/contacts": {
      "get": {
        "tags": [
          "Integrations · Connections"
        ],
        "summary": "One page of the provider's contacts",
        "description": "Needs permission integration:read.\n\nProviders page contacts differently, so the answer says whether there is more rather than a total. Ask for page 1 and keep going until hasMore is false.",
        "operationId": "Integrations_GetConnectionContacts",
        "parameters": [
          {
            "name": "connectionId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "page",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Integrations_AccountingContactPageResponseResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Integrations_ApiErrorResponse"
                }
              }
            }
          }
        },
        "x-flow-permission": "integration:read"
      }
    },
    "/v1/integrations/connections/{connectionId}/accounting/documents/{documentType}/{externalId}/pdf": {
      "get": {
        "tags": [
          "Integrations · Connections"
        ],
        "summary": "The provider's own rendering of a document",
        "description": "Needs permission integration:read.\n\nBase64 in the standard envelope, so a consumer reads it through the platform ApiClient like every other reply rather than signing a raw binary request by hand.",
        "operationId": "Integrations_GetConnectionDocumentPdf",
        "parameters": [
          {
            "name": "connectionId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "documentType",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "externalId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Integrations_AccountingDocumentPdfResponseResponseBody"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Integrations_ObjectResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Integrations_ApiErrorResponse"
                }
              }
            }
          }
        },
        "x-flow-permission": "integration:read"
      }
    },
    "/v1/integrations/connections/{connectionId}/accounting/documents/{documentType}/{externalId}/attachment-count": {
      "get": {
        "tags": [
          "Integrations · Connections"
        ],
        "summary": "How many files the document already holds",
        "description": "Needs permission integration:read.\n\nSubtract this from the catalogue's maxAttachmentsPerDocument to learn how many more will fit, so a consumer with too many files chooses which to send instead of having the rest refused.",
        "operationId": "Integrations_GetConnectionDocumentAttachmentCount",
        "parameters": [
          {
            "name": "connectionId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "documentType",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "externalId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Integrations_AccountingAttachmentCountResponseResponseBody"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Integrations_ObjectResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Integrations_ApiErrorResponse"
                }
              }
            }
          }
        },
        "x-flow-permission": "integration:read"
      }
    },
    "/v1/integrations/connections/{connectionId}/imports": {
      "get": {
        "tags": [
          "Integrations · Provider data"
        ],
        "summary": "How fresh the connection's provider data is",
        "description": "Needs permission integration:read.\n\nOne row per kind of data the provider can be read for: when it was last read successfully, the date it is synced through, whether a read is running now, and when the next unprompted read is due.",
        "operationId": "Integrations_ListConnectionImports",
        "parameters": [
          {
            "name": "connectionId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Integrations_ImportStateResponseListResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Integrations_ApiErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Integrations_ObjectResponseBody"
                }
              }
            }
          }
        },
        "x-flow-permission": "integration:read"
      },
      "post": {
        "tags": [
          "Integrations · Provider data"
        ],
        "summary": "Refresh the connection's provider data",
        "description": "Needs permission integration:write.\n\nAsks for the data to be no older than maxStalenessMinutes (0 = read now). Per kind, the outcome says whether it was already Fresh, a read was already InFlight, or a new read was Requested. Safe to call repeatedly: a running read is joined, never duplicated.",
        "operationId": "Integrations_RequestConnectionImports",
        "parameters": [
          {
            "name": "connectionId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Integrations_RequestConnectionImportsRequest"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Accepted",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Integrations_ConnectionImportsResponseResponseBody"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Integrations_ObjectResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Integrations_ApiErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Integrations_ObjectResponseBody"
                }
              }
            }
          }
        },
        "x-flow-permission": "integration:write"
      }
    },
    "/v1/integrations/operations": {
      "get": {
        "tags": [
          "Integrations · Activity"
        ],
        "description": "Needs permission integration:read.",
        "operationId": "Integrations_ListOperations",
        "parameters": [
          {
            "name": "connectionId",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "status",
            "in": "query",
            "schema": {
              "enum": [
                "Pending",
                "AwaitingProvider",
                "Succeeded",
                "Failed",
                "NeedsAttention",
                "Cancelled"
              ],
              "type": "string"
            }
          },
          {
            "name": "pageSize",
            "in": "query",
            "description": "Rows per page. Defaults to 20, maximum 100. A page may contain FEWER rows than this, or none at all, and still not be the last page — read `nextPaginationToken`, never the row count, to decide whether to continue.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "paginationToken",
            "in": "query",
            "description": "Cursor for the next page, or null when the listing is complete. IMPORTANT: keep following this token while it is non-null, even when `items` comes back empty. An empty page does NOT mean the end of the list — a filtered query can evaluate a full page of non-matching rows and return none of them, with more matches behind the cursor. Stopping on an empty page silently skips those rows. Tokens are opaque: pass them back unmodified and do not store them long-term.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Integrations_OperationResponseListPageResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Integrations_ApiErrorResponse"
                }
              }
            }
          }
        },
        "x-flow-permission": "integration:read",
        "summary": "List activity"
      }
    },
    "/v1/integrations/operations/{operationId}": {
      "get": {
        "tags": [
          "Integrations · Activity"
        ],
        "description": "Needs permission integration:read.",
        "operationId": "Integrations_GetOperation",
        "parameters": [
          {
            "name": "operationId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Integrations_OperationResponseResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Integrations_ApiErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Integrations_ObjectResponseBody"
                }
              }
            }
          }
        },
        "x-flow-permission": "integration:read",
        "summary": "Get one operation"
      }
    },
    "/v1/integrations/operations/{operationId}/retry": {
      "post": {
        "tags": [
          "Integrations · Activity"
        ],
        "description": "Needs permission integration:write.",
        "operationId": "Integrations_RetryOperation",
        "parameters": [
          {
            "name": "operationId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Integrations_OperationResponseResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Integrations_ApiErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Integrations_ObjectResponseBody"
                }
              }
            }
          }
        },
        "x-flow-permission": "integration:write",
        "summary": "Retry a failed operation"
      }
    },
    "/v1/integrations/operations/{operationId}/cancel": {
      "post": {
        "tags": [
          "Integrations · Activity"
        ],
        "description": "Needs permission integration:write.",
        "operationId": "Integrations_CancelOperation",
        "parameters": [
          {
            "name": "operationId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Integrations_OperationResponseResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Integrations_ApiErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Integrations_ObjectResponseBody"
                }
              }
            }
          }
        },
        "x-flow-permission": "integration:write",
        "summary": "Cancel a queued operation"
      }
    },
    "/v1/integrations/providers": {
      "get": {
        "tags": [
          "Integrations · Providers"
        ],
        "description": "Needs permission integration:read.",
        "operationId": "Integrations_ListProviders",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Integrations_ProviderResponseListResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Integrations_ApiErrorResponse"
                }
              }
            }
          }
        },
        "x-flow-permission": "integration:read",
        "summary": "List the providers you can connect"
      }
    },
    "/v1/integrations/providers/{slug}": {
      "get": {
        "tags": [
          "Integrations · Providers"
        ],
        "description": "Needs permission integration:read.",
        "operationId": "Integrations_GetProvider",
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Integrations_ProviderResponseResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Integrations_ApiErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Integrations_ObjectResponseBody"
                }
              }
            }
          }
        },
        "x-flow-permission": "integration:read",
        "summary": "Get one provider"
      }
    },
    "/v1/integrations/connections/{connectionId}/sync-sessions": {
      "post": {
        "tags": [
          "Integrations · Initial import"
        ],
        "summary": "Import the connection's existing provider data",
        "description": "Needs permission integration:write.\n\nFetches everything the provider can report for this employer (for a pension provider: setup, schedules, opt-outs, stopped contributions and refunds). Starting again while an import is running returns the running import.",
        "operationId": "Integrations_StartSyncSession",
        "parameters": [
          {
            "name": "connectionId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Integrations_SyncSessionResponseResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Integrations_ApiErrorResponse"
                }
              }
            }
          }
        },
        "x-flow-permission": "integration:write"
      }
    },
    "/v1/integrations/connections/{connectionId}/sync-sessions/latest": {
      "get": {
        "tags": [
          "Integrations · Initial import"
        ],
        "summary": "Progress of the connection's latest import",
        "description": "Needs permission integration:read.",
        "operationId": "Integrations_GetLatestSyncSession",
        "parameters": [
          {
            "name": "connectionId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Integrations_SyncSessionResponseResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Integrations_ApiErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Integrations_ObjectResponseBody"
                }
              }
            }
          }
        },
        "x-flow-permission": "integration:read"
      }
    },
    "/v1/recurring-line-items": {
      "post": {
        "tags": [
          "Recurring line items · Recurring Line Items"
        ],
        "description": "Needs permission pay-run:write.",
        "operationId": "Recurring_CreateRecurringLineItem",
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "description": "Makes a retry safe: the same key from the same person with the same body within 24 hours gets the first response back instead of running again. The same key with a different request is refused with 409.",
            "schema": {
              "maxLength": 255,
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Recurring_CreateRecurringLineItemRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Recurring_ResponseBody_RecurringLineItemResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Recurring_ResponseBody_Object"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Recurring_ApiErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Recurring_ResponseBody_Object"
                }
              }
            }
          }
        },
        "x-flow-permission": "pay-run:write",
        "summary": "Create a recurring line item"
      },
      "get": {
        "tags": [
          "Recurring line items · Recurring Line Items"
        ],
        "description": "Needs permission pay-run:read.",
        "operationId": "Recurring_GetRecurringLineItemsByOrganisation",
        "parameters": [
          {
            "name": "status",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "mode",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "pageSize",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "paginationToken",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Recurring_ResponseBody_List_RecurringLineItemResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Recurring_ResponseBody_Object"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Recurring_ApiErrorResponse"
                }
              }
            }
          }
        },
        "x-flow-permission": "pay-run:read",
        "summary": "List recurring line items for an organisation"
      }
    },
    "/v1/recurring-line-items/employees/{employeeId}": {
      "get": {
        "tags": [
          "Recurring line items · Recurring Line Items"
        ],
        "description": "Needs permission pay-run:read.",
        "operationId": "Recurring_GetRecurringLineItemsByEmployee",
        "parameters": [
          {
            "name": "employeeId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "status",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "pageSize",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "paginationToken",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Recurring_ResponseBody_List_RecurringLineItemResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Recurring_ResponseBody_Object"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Recurring_ApiErrorResponse"
                }
              }
            }
          }
        },
        "x-flow-permission": "pay-run:read",
        "summary": "List recurring line items for an employee"
      }
    },
    "/v1/recurring-line-items/{id}": {
      "get": {
        "tags": [
          "Recurring line items · Recurring Line Items"
        ],
        "description": "Needs permission pay-run:read.",
        "operationId": "Recurring_GetRecurringLineItemById",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Recurring_ResponseBody_RecurringLineItemResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Recurring_ApiErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Recurring_ResponseBody_Object"
                }
              }
            }
          }
        },
        "x-flow-permission": "pay-run:read",
        "summary": "Get a recurring line item"
      }
    },
    "/v1/recurring-line-items/{id}/employees/{employeeId}": {
      "patch": {
        "tags": [
          "Recurring line items · Recurring Line Items"
        ],
        "description": "Needs permission pay-run:write.",
        "operationId": "Recurring_PatchRecurringLineItem",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "employeeId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Recurring_UpdateRecurringLineItemRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Recurring_ResponseBody_RecurringLineItemResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Recurring_ResponseBody_Object"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Recurring_ApiErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Recurring_ResponseBody_Object"
                }
              }
            }
          }
        },
        "x-flow-permission": "pay-run:write",
        "summary": "Update a recurring line item"
      },
      "delete": {
        "tags": [
          "Recurring line items · Recurring Line Items"
        ],
        "description": "Needs permission pay-run:write.",
        "operationId": "Recurring_DeleteRecurringLineItem",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "employeeId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Recurring_ResponseBody_Object"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Recurring_ApiErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Recurring_ResponseBody_Object"
                }
              }
            }
          }
        },
        "x-flow-permission": "pay-run:write",
        "summary": "Delete a recurring line item"
      }
    },
    "/v1/recurring-line-items/{id}/employees/{employeeId}/tax-years": {
      "get": {
        "tags": [
          "Recurring line items · Recurring Line Items"
        ],
        "description": "Needs permission pay-run:read.",
        "operationId": "Recurring_GetRecurringLineItemTaxYears",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "employeeId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Recurring_ResponseBody_List_Int32"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Recurring_ApiErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Recurring_ResponseBody_Object"
                }
              }
            }
          }
        },
        "x-flow-permission": "pay-run:read",
        "summary": "List tax years for a recurring line item"
      }
    },
    "/v1/recurring-line-items/{id}/employees/{employeeId}/periods": {
      "get": {
        "tags": [
          "Recurring line items · Recurring Line Items"
        ],
        "description": "Needs permission pay-run:read.",
        "operationId": "Recurring_GetRecurringLineItemPeriods",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "employeeId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "taxYear",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "pageSize",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "paginationToken",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Recurring_ResponseBody_List_RecurringLineItemPeriodResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Recurring_ResponseBody_Object"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Recurring_ApiErrorResponse"
                }
              }
            }
          }
        },
        "x-flow-permission": "pay-run:read",
        "summary": "List periods for a recurring line item"
      }
    },
    "/v1/recurring-line-items/{id}/employees/{employeeId}/periods/{taxYear}/{sequence}": {
      "patch": {
        "tags": [
          "Recurring line items · Recurring Line Items"
        ],
        "description": "Needs permission pay-run:write.",
        "operationId": "Recurring_PatchRecurringLineItemPeriod",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "employeeId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "taxYear",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "sequence",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Recurring_EditPeriodRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Recurring_ResponseBody_RecurringLineItemPeriodResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Recurring_ResponseBody_Object"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Recurring_ApiErrorResponse"
                }
              }
            }
          }
        },
        "x-flow-permission": "pay-run:write",
        "summary": "Update a single period of a recurring line item"
      },
      "delete": {
        "tags": [
          "Recurring line items · Recurring Line Items"
        ],
        "description": "Needs permission pay-run:write.",
        "operationId": "Recurring_SkipRecurringLineItemPeriod",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "employeeId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "taxYear",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "sequence",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Recurring_ResponseBody_RecurringLineItemPeriodResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Recurring_ApiErrorResponse"
                }
              }
            }
          }
        },
        "x-flow-permission": "pay-run:write",
        "summary": "Skip a single period of a recurring line item"
      }
    },
    "/v1/hmrc-dps/notifications": {
      "get": {
        "tags": [
          "HMRC DPS · Notifications"
        ],
        "description": "Needs permission rti:read.",
        "operationId": "HmrcDps_GetStoredNotifications",
        "parameters": [
          {
            "name": "dataType",
            "in": "query",
            "schema": {
              "enum": [
                "P6",
                "P9",
                "SL1",
                "SL2",
                "PGL1",
                "PGL2",
                "AR",
                "NOT",
                "RTI",
                "CIS",
                "P35",
                "CISINFO29",
                "All"
              ],
              "type": "string",
              "nullable": true
            }
          },
          {
            "name": "status",
            "in": "query",
            "schema": {
              "enum": [
                "Due",
                "Applied",
                "Dismissed"
              ],
              "type": "string",
              "nullable": true
            }
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "lastEvaluatedKey",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HmrcDps_ResponseBody_DpsNotificationListDto"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HmrcDps_ResponseBody_DpsErrorDto"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HmrcDps_ApiErrorResponse"
                }
              }
            }
          }
        },
        "x-flow-permission": "rti:read",
        "summary": "Get stored notifications"
      }
    },
    "/v1/hmrc-dps/notifications/{notificationId}": {
      "get": {
        "tags": [
          "HMRC DPS · Notifications"
        ],
        "description": "Needs permission rti:read.",
        "operationId": "HmrcDps_GetNotification",
        "parameters": [
          {
            "name": "notificationId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HmrcDps_ResponseBody_DpsNotificationDisplayDto"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HmrcDps_ResponseBody_DpsErrorDto"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HmrcDps_ApiErrorResponse"
                }
              }
            }
          }
        },
        "x-flow-permission": "rti:read",
        "summary": "Get notification"
      }
    },
    "/v1/hmrc-dps/notifications/{notificationId}/status": {
      "put": {
        "tags": [
          "HMRC DPS · Notifications"
        ],
        "description": "Needs permission rti:submit.",
        "operationId": "HmrcDps_UpdateNotificationStatus",
        "parameters": [
          {
            "name": "notificationId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/HmrcDps_DpsNotificationStatusUpdateRequestDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HmrcDps_ResponseBody_DpsNotificationDisplayDto"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HmrcDps_ResponseBody_DpsErrorDto"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HmrcDps_ApiErrorResponse"
                }
              }
            }
          }
        },
        "x-flow-permission": "rti:submit",
        "summary": "Update notification status"
      }
    },
    "/v1/hmrc-dps/notifications/{notificationId}/apply": {
      "post": {
        "tags": [
          "HMRC DPS · Notifications"
        ],
        "description": "Needs permission rti:submit.",
        "operationId": "HmrcDps_ApplyNotification",
        "parameters": [
          {
            "name": "notificationId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HmrcDps_ResponseBody_DpsApplyResultDto"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HmrcDps_ResponseBody_DpsApplyResultDto"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HmrcDps_ResponseBody_DpsErrorDto"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HmrcDps_ApiErrorResponse"
                }
              }
            }
          }
        },
        "x-flow-permission": "rti:submit",
        "summary": "Apply notification"
      }
    },
    "/v1/hmrc-dps/notifications/{notificationId}/ignore": {
      "post": {
        "tags": [
          "HMRC DPS · Notifications"
        ],
        "description": "Needs permission rti:submit.",
        "operationId": "HmrcDps_DismissNotification",
        "parameters": [
          {
            "name": "notificationId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "reason",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HmrcDps_ResponseBody_DpsNotificationDisplayDto"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HmrcDps_ResponseBody_DpsErrorDto"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HmrcDps_ApiErrorResponse"
                }
              }
            }
          }
        },
        "x-flow-permission": "rti:submit",
        "summary": "Dismiss notification"
      }
    },
    "/v1/hmrc-dps/notifications/{notificationId}/employee": {
      "put": {
        "tags": [
          "HMRC DPS · Notifications"
        ],
        "description": "Needs permission rti:submit.",
        "operationId": "HmrcDps_AssignEmployee",
        "parameters": [
          {
            "name": "notificationId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/HmrcDps_AssignEmployeeRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HmrcDps_ResponseBody_DpsNotificationDisplayDto"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HmrcDps_ResponseBody_DpsErrorDto"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HmrcDps_ApiErrorResponse"
                }
              }
            }
          }
        },
        "x-flow-permission": "rti:submit",
        "summary": "Assign employee to notification"
      }
    },
    "/v1/hmrc-dps/notifications/bulk-apply-async": {
      "post": {
        "tags": [
          "HMRC DPS · Bulk actions"
        ],
        "description": "Needs permission rti:submit.",
        "operationId": "HmrcDps_BulkApplyNotificationsAsync",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/HmrcDps_BulkApplyNotificationAsyncRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HmrcDps_ResponseBody_BulkNotificationAsyncResponseDto"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HmrcDps_ResponseBody_DpsErrorDto"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HmrcDps_ApiErrorResponse"
                }
              }
            }
          }
        },
        "x-flow-permission": "rti:submit",
        "summary": "Start bulk apply of notifications"
      }
    },
    "/v1/hmrc-dps/notifications/bulk-dismiss-async": {
      "post": {
        "tags": [
          "HMRC DPS · Bulk actions"
        ],
        "description": "Needs permission rti:submit.",
        "operationId": "HmrcDps_BulkDismissNotificationsAsync",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/HmrcDps_BulkDismissNotificationAsyncRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HmrcDps_ResponseBody_BulkNotificationAsyncResponseDto"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HmrcDps_ResponseBody_DpsErrorDto"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HmrcDps_ApiErrorResponse"
                }
              }
            }
          }
        },
        "x-flow-permission": "rti:submit",
        "summary": "Start bulk dismiss of notifications"
      }
    },
    "/v1/hmrc-dps/notifications/retry-matching": {
      "post": {
        "tags": [
          "HMRC DPS · Bulk actions"
        ],
        "description": "Needs permission rti:submit.",
        "operationId": "HmrcDps_RetryMatchingForUnmatchedNotifications",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HmrcDps_ResponseBody_RetryMatchingResultDto"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HmrcDps_ResponseBody_DpsErrorDto"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HmrcDps_ApiErrorResponse"
                }
              }
            }
          }
        },
        "x-flow-permission": "rti:submit",
        "summary": "Retry matching for unmatched notifications"
      }
    },
    "/v1/hmrc-dps/notifications/counts": {
      "get": {
        "tags": [
          "HMRC DPS · Notifications"
        ],
        "description": "Needs permission rti:read.",
        "operationId": "HmrcDps_GetNotificationCounts",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HmrcDps_ResponseBody_NotificationCountsResultDto"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HmrcDps_ResponseBody_DpsErrorDto"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HmrcDps_ApiErrorResponse"
                }
              }
            }
          }
        },
        "x-flow-permission": "rti:read",
        "summary": "Get notification counts"
      }
    },
    "/v1/hmrc-dps/notifications/pagination/initialise": {
      "post": {
        "tags": [
          "HMRC DPS · Pagination"
        ],
        "summary": "Initialize pagination states for all data types",
        "description": "Needs permission rti:submit.\n\nInitializes pagination states for all supported HMRC DPS data types using date2index conversion. This endpoint can be used to set up pagination from a specific date for both PAYE and CIS services. Use the 'overwriteExisting' parameter to control whether existing pagination states should be replaced.",
        "operationId": "HmrcDps_InitializeOrganizationPagination",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/HmrcDps_InitializePaginationRequestDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HmrcDps_ResponseBody_InitializePaginationResponseDto"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HmrcDps_ResponseBody_DpsErrorDto"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HmrcDps_ApiErrorResponse"
                }
              }
            }
          }
        },
        "x-flow-permission": "rti:submit"
      }
    },
    "/v1/hmrc-dps/notifications/pagination": {
      "get": {
        "tags": [
          "HMRC DPS · Pagination"
        ],
        "summary": "Get all pagination states for the organization",
        "description": "Needs permission rti:read.\n\nRetrieves pagination states for all supported HMRC DPS data types for the organization. Returns pagination information even for data types that haven't been initialized yet (with highWaterMark = 0). This endpoint is useful for building UI that shows which data types have pagination configured.",
        "operationId": "HmrcDps_GetAllPaginationStates",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HmrcDps_ResponseBody_AllPaginationStatesResponseDto"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HmrcDps_ResponseBody_DpsErrorDto"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HmrcDps_ApiErrorResponse"
                }
              }
            }
          }
        },
        "x-flow-permission": "rti:read"
      }
    },
    "/v1/hmrc-dps/notifications/retrieve-all": {
      "post": {
        "tags": [
          "HMRC DPS · Bulk actions"
        ],
        "description": "Needs permission rti:submit.",
        "operationId": "HmrcDps_StartRetrieveAllNotifications",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/HmrcDps_DpsRetrieveAllRequestDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HmrcDps_ResponseBody_DpsAsyncJobResponseDto"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HmrcDps_ResponseBody_DpsErrorDto"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HmrcDps_ApiErrorResponse"
                }
              }
            }
          }
        },
        "x-flow-permission": "rti:submit",
        "summary": "Start retrieving all notifications"
      }
    },
    "/v1/hmrc-dps/notifications/jobs/{jobId}/status": {
      "get": {
        "tags": [
          "HMRC DPS · Jobs"
        ],
        "description": "Needs permission rti:read.",
        "operationId": "HmrcDps_GetAsyncJobStatus",
        "parameters": [
          {
            "name": "jobId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HmrcDps_ResponseBody_DpsAsyncJobStatusDto"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HmrcDps_ResponseBody_DpsErrorDto"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HmrcDps_ApiErrorResponse"
                }
              }
            }
          }
        },
        "x-flow-permission": "rti:read",
        "summary": "Get job status"
      }
    },
    "/v1/hmrc-dps/notifications/jobs": {
      "get": {
        "tags": [
          "HMRC DPS · Jobs"
        ],
        "description": "Needs permission rti:read.",
        "operationId": "HmrcDps_GetAsyncJobs",
        "parameters": [
          {
            "name": "status",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HmrcDps_ResponseBody_IEnumerable_DpsAsyncJobStatusDto"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HmrcDps_ResponseBody_DpsErrorDto"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HmrcDps_ApiErrorResponse"
                }
              }
            }
          }
        },
        "x-flow-permission": "rti:read",
        "summary": "Get jobs"
      }
    },
    "/v1/hmrc-dps/notifications/jobs/last/{jobType}": {
      "get": {
        "tags": [
          "HMRC DPS · Jobs"
        ],
        "summary": "Get the last job of a specific type for the organisation",
        "description": "Needs permission rti:read.\n\nRetrieves the most recent job of the specified type for the authenticated organisation. Valid job types: RetrieveAll, BulkApplyNotifications, BulkDismissNotifications",
        "operationId": "HmrcDps_GetLastJob",
        "parameters": [
          {
            "name": "jobType",
            "in": "path",
            "description": "The type of job to retrieve",
            "required": true,
            "schema": {
              "enum": [
                "RetrieveAll",
                "BulkApplyNotifications",
                "BulkDismissNotifications"
              ],
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HmrcDps_ResponseBody_DpsAsyncJobStatusDto"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HmrcDps_ResponseBody_DpsErrorDto"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HmrcDps_ApiErrorResponse"
                }
              }
            }
          }
        },
        "x-flow-permission": "rti:read"
      }
    },
    "/v1/hmrc-dps/notifications/jobs/{jobId}/cancel": {
      "post": {
        "tags": [
          "HMRC DPS · Jobs"
        ],
        "description": "Needs permission rti:submit.",
        "operationId": "HmrcDps_CancelAsyncJob",
        "parameters": [
          {
            "name": "jobId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HmrcDps_ResponseBody_Boolean"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HmrcDps_ResponseBody_DpsErrorDto"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HmrcDps_ApiErrorResponse"
                }
              }
            }
          }
        },
        "x-flow-permission": "rti:submit",
        "summary": "Cancel job"
      }
    },
    "/v1/hmrc-p-forms/p32/{year}/{month}/pdf": {
      "get": {
        "tags": [
          "HMRC P-forms · P32"
        ],
        "description": "Needs permission rti:read.",
        "operationId": "HmrcPForms_GetP32File",
        "parameters": [
          {
            "name": "year",
            "in": "path",
            "required": true,
            "schema": {
              "maxLength": 4,
              "minLength": 4,
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "month",
            "in": "path",
            "required": true,
            "schema": {
              "maximum": 12,
              "minimum": 1,
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "headers": {
              "Content-Disposition": {
                "description": "Suggested filename for the downloaded PDF, e.g. attachment; filename=\"P45-2025-2026-Doe-Jane.pdf\"",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/pdf": {
                "schema": {
                  "type": "string",
                  "description": "Binary PDF document",
                  "format": "binary"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HmrcPForms_ApiErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HmrcPForms_ObjectResponseBody"
                }
              }
            }
          }
        },
        "x-flow-permission": "rti:read",
        "summary": "Download a P32 PDF"
      }
    },
    "/v1/hmrc-p-forms/p32/{year}/{month}": {
      "get": {
        "tags": [
          "HMRC P-forms · P32"
        ],
        "description": "Needs permission rti:read.",
        "operationId": "HmrcPForms_GetP32",
        "parameters": [
          {
            "name": "year",
            "in": "path",
            "required": true,
            "schema": {
              "maxLength": 4,
              "minLength": 4,
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "month",
            "in": "path",
            "required": true,
            "schema": {
              "maximum": 12,
              "minimum": 1,
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HmrcPForms_P32FormResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HmrcPForms_ApiErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HmrcPForms_ObjectResponseBody"
                }
              }
            }
          }
        },
        "x-flow-permission": "rti:read",
        "summary": "Get P32 for a tax month"
      }
    },
    "/v1/hmrc-p-forms/p32/{year}": {
      "get": {
        "tags": [
          "HMRC P-forms · P32"
        ],
        "description": "Needs permission rti:read.",
        "operationId": "HmrcPForms_GetP32ForYear",
        "parameters": [
          {
            "name": "year",
            "in": "path",
            "required": true,
            "schema": {
              "maxLength": 4,
              "minLength": 4,
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HmrcPForms_P32FormListResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HmrcPForms_ApiErrorResponse"
                }
              }
            }
          }
        },
        "x-flow-permission": "rti:read",
        "summary": "Get all P32s for a tax year"
      }
    },
    "/v1/hmrc-p-forms/p45/tax-years": {
      "get": {
        "tags": [
          "HMRC P-forms · P45"
        ],
        "description": "Needs permission pay-run:read.",
        "operationId": "HmrcPForms_GetP45TaxYears",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HmrcPForms_Int32ListResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HmrcPForms_ApiErrorResponse"
                }
              }
            }
          }
        },
        "x-flow-permission": "pay-run:read",
        "summary": "List tax years with available P45s"
      }
    },
    "/v1/hmrc-p-forms/p45/list/{taxYear}/finalised": {
      "get": {
        "tags": [
          "HMRC P-forms · P45"
        ],
        "description": "Needs permission pay-run:read.",
        "operationId": "HmrcPForms_ListP45FinalisedForOrgYear",
        "parameters": [
          {
            "name": "taxYear",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "pageSize",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "paginationToken",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HmrcPForms_P45ModelListResponseBody"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HmrcPForms_ObjectResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HmrcPForms_ApiErrorResponse"
                }
              }
            }
          }
        },
        "x-flow-permission": "pay-run:read",
        "summary": "List finalised P45s for a tax year"
      }
    },
    "/v1/hmrc-p-forms/p45/list/{payrollConfigId}/{taxYear}/finalised": {
      "get": {
        "tags": [
          "HMRC P-forms · P45"
        ],
        "description": "Needs permission pay-run:read.",
        "operationId": "HmrcPForms_ListP45FinalisedForPayrollConfigYear",
        "parameters": [
          {
            "name": "payrollConfigId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "taxYear",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "pageSize",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "paginationToken",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HmrcPForms_P45ModelListResponseBody"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HmrcPForms_ObjectResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HmrcPForms_ApiErrorResponse"
                }
              }
            }
          }
        },
        "x-flow-permission": "pay-run:read",
        "summary": "List finalised P45s for a payroll config and tax year"
      }
    },
    "/v1/hmrc-p-forms/p45/{employeeId}/file": {
      "get": {
        "tags": [
          "HMRC P-forms · P45"
        ],
        "summary": "Get the P45 document",
        "description": "Needs permission pay-run:read.\n\nThe employee's latest P45 as a PDF. With lockCycle, the document that lock cycle issued: the current one, or the copy kept when the re-lock of an unlocked pay run replaced it (404 p45_version_not_found for a cycle that issued none).",
        "operationId": "HmrcPForms_GetP45File",
        "parameters": [
          {
            "name": "employeeId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "lockCycle",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "headers": {
              "Content-Disposition": {
                "description": "Suggested filename for the downloaded PDF, e.g. attachment; filename=\"P45-2025-2026-Doe-Jane.pdf\"",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/pdf": {
                "schema": {
                  "type": "string",
                  "description": "Binary PDF document",
                  "format": "binary"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HmrcPForms_ApiErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HmrcPForms_ObjectResponseBody"
                }
              }
            }
          }
        },
        "x-flow-permission": "pay-run:read"
      }
    },
    "/v1/hmrc-p-forms/p45/{employeeId}/versions": {
      "get": {
        "tags": [
          "HMRC P-forms · P45"
        ],
        "summary": "List the earlier versions of the P45",
        "description": "Needs permission pay-run:read.\n\nThe P45s earlier lock cycles issued for the employee's latest P45, kept when the re-lock of an unlocked pay run replaced them, earliest cycle first. Empty while the P45 was issued once. Each version's document is served by the file route with its lockCycle.",
        "operationId": "HmrcPForms_ListP45Versions",
        "parameters": [
          {
            "name": "employeeId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HmrcPForms_P45VersionModelListResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HmrcPForms_ApiErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HmrcPForms_ObjectResponseBody"
                }
              }
            }
          }
        },
        "x-flow-permission": "pay-run:read"
      }
    },
    "/v1/hmrc-p-forms/p45/{employeeId}/preview": {
      "get": {
        "tags": [
          "HMRC P-forms · P45"
        ],
        "description": "Needs permission pay-run:read.",
        "operationId": "HmrcPForms_GetP45Preview",
        "parameters": [
          {
            "name": "employeeId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "leavingDate",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "reason",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "headers": {
              "Content-Disposition": {
                "description": "Suggested filename for the downloaded PDF, e.g. attachment; filename=\"P45-2025-2026-Doe-Jane.pdf\"",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/pdf": {
                "schema": {
                  "type": "string",
                  "description": "Binary PDF document",
                  "format": "binary"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HmrcPForms_ObjectResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HmrcPForms_ApiErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HmrcPForms_ObjectResponseBody"
                }
              }
            }
          }
        },
        "x-flow-permission": "pay-run:read",
        "summary": "Preview an employee's P45 PDF"
      }
    },
    "/v1/hmrc-p-forms/p45/{employeeId}/replacements": {
      "post": {
        "tags": [
          "HMRC P-forms · P45"
        ],
        "description": "Needs permission pay-run:write.",
        "operationId": "HmrcPForms_CreateP45Replacement",
        "parameters": [
          {
            "name": "employeeId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HmrcPForms_P45ModelResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HmrcPForms_ApiErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HmrcPForms_ObjectResponseBody"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HmrcPForms_ObjectResponseBody"
                }
              }
            }
          }
        },
        "x-flow-permission": "pay-run:write",
        "summary": "Create a P45 replacement"
      }
    },
    "/v1/hmrc-p-forms/p45/send-notification": {
      "post": {
        "tags": [
          "HMRC P-forms · P45"
        ],
        "description": "Needs permission pay-run:write.",
        "operationId": "HmrcPForms_SendP45Notification",
        "parameters": [
          {
            "name": "force",
            "in": "query",
            "schema": {
              "type": "boolean"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/HmrcPForms_SendP45NotificationRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "202": {
            "description": "Accepted",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HmrcPForms_SendP45NotificationResponseResponseBody"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HmrcPForms_ObjectResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HmrcPForms_ApiErrorResponse"
                }
              }
            }
          }
        },
        "x-flow-permission": "pay-run:write",
        "summary": "Send P45 emails to one or more employees"
      }
    },
    "/v1/hmrc-p-forms/p45/{employeeId}": {
      "get": {
        "tags": [
          "HMRC P-forms · P45"
        ],
        "description": "Needs permission pay-run:read.",
        "operationId": "HmrcPForms_GetP45",
        "parameters": [
          {
            "name": "employeeId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HmrcPForms_P45ModelResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HmrcPForms_ApiErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HmrcPForms_ObjectResponseBody"
                }
              }
            }
          }
        },
        "x-flow-permission": "pay-run:read",
        "summary": "Get P45 data for an employee"
      }
    },
    "/v1/hmrc-p-forms/p60/{employeeId}/{taxYear}": {
      "get": {
        "tags": [
          "HMRC P-forms · P60"
        ],
        "description": "Needs permission pay-run:read.",
        "operationId": "HmrcPForms_GetP60",
        "parameters": [
          {
            "name": "employeeId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "taxYear",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HmrcPForms_P60ModelResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HmrcPForms_ApiErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HmrcPForms_ObjectResponseBody"
                }
              }
            }
          }
        },
        "x-flow-permission": "pay-run:read",
        "summary": "Get a P60 for an employee"
      }
    },
    "/v1/hmrc-p-forms/p60/{employeeId}/{taxYear}/file": {
      "get": {
        "tags": [
          "HMRC P-forms · P60"
        ],
        "description": "Needs permission pay-run:read.",
        "operationId": "HmrcPForms_GetP60File",
        "parameters": [
          {
            "name": "employeeId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "taxYear",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "headers": {
              "Content-Disposition": {
                "description": "Suggested filename for the downloaded PDF, e.g. attachment; filename=\"P45-2025-2026-Doe-Jane.pdf\"",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/pdf": {
                "schema": {
                  "type": "string",
                  "description": "Binary PDF document",
                  "format": "binary"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HmrcPForms_ApiErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HmrcPForms_ObjectResponseBody"
                }
              }
            }
          }
        },
        "x-flow-permission": "pay-run:read",
        "summary": "Download a P60 PDF"
      }
    },
    "/v1/hmrc-p-forms/p60/tax-years": {
      "get": {
        "tags": [
          "HMRC P-forms · P60"
        ],
        "description": "Needs permission pay-run:read.",
        "operationId": "HmrcPForms_GetP60TaxYears",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HmrcPForms_Int32ListResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HmrcPForms_ApiErrorResponse"
                }
              }
            }
          }
        },
        "x-flow-permission": "pay-run:read",
        "summary": "List tax years with available P60s"
      }
    },
    "/v1/hmrc-p-forms/p60/{employeeId}/preview-years": {
      "get": {
        "tags": [
          "HMRC P-forms · P60"
        ],
        "description": "Needs permission pay-run:read.",
        "operationId": "HmrcPForms_GetP60PreviewYears",
        "parameters": [
          {
            "name": "employeeId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HmrcPForms_Int32ListResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HmrcPForms_ApiErrorResponse"
                }
              }
            }
          }
        },
        "x-flow-permission": "pay-run:read",
        "summary": "List preview P60 tax years for an employee"
      }
    },
    "/v1/hmrc-p-forms/p60/{employeeId}/finalised-years": {
      "get": {
        "tags": [
          "HMRC P-forms · P60"
        ],
        "description": "Needs permission pay-run:read.",
        "operationId": "HmrcPForms_GetP60FinalisedYears",
        "parameters": [
          {
            "name": "employeeId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HmrcPForms_Int32ListResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HmrcPForms_ApiErrorResponse"
                }
              }
            }
          }
        },
        "x-flow-permission": "pay-run:read",
        "summary": "List finalised P60 tax years for an employee"
      }
    },
    "/v1/hmrc-p-forms/p60/list/{taxYear}/preview": {
      "get": {
        "tags": [
          "HMRC P-forms · P60"
        ],
        "description": "Needs permission pay-run:read.",
        "operationId": "HmrcPForms_ListP60PreviewsForOrgYear",
        "parameters": [
          {
            "name": "taxYear",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "pageSize",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "paginationToken",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HmrcPForms_P60ModelListResponseBody"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HmrcPForms_ObjectResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HmrcPForms_ApiErrorResponse"
                }
              }
            }
          }
        },
        "x-flow-permission": "pay-run:read",
        "summary": "List preview P60s for a tax year"
      }
    },
    "/v1/hmrc-p-forms/p60/list/{taxYear}/finalised": {
      "get": {
        "tags": [
          "HMRC P-forms · P60"
        ],
        "description": "Needs permission pay-run:read.",
        "operationId": "HmrcPForms_ListP60FinalisedForOrgYear",
        "parameters": [
          {
            "name": "taxYear",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "pageSize",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "paginationToken",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HmrcPForms_P60ModelListResponseBody"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HmrcPForms_ObjectResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HmrcPForms_ApiErrorResponse"
                }
              }
            }
          }
        },
        "x-flow-permission": "pay-run:read",
        "summary": "List finalised P60s for a tax year"
      }
    },
    "/v1/hmrc-p-forms/p60/list/{payrollConfigId}/{taxYear}/finalised": {
      "get": {
        "tags": [
          "HMRC P-forms · P60"
        ],
        "description": "Needs permission pay-run:read.",
        "operationId": "HmrcPForms_ListP60FinalisedForPayrollConfigYear",
        "parameters": [
          {
            "name": "payrollConfigId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "taxYear",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "pageSize",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "paginationToken",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HmrcPForms_P60ModelListResponseBody"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HmrcPForms_ObjectResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HmrcPForms_ApiErrorResponse"
                }
              }
            }
          }
        },
        "x-flow-permission": "pay-run:read",
        "summary": "List finalised P60s for a payroll config and tax year"
      }
    },
    "/v1/hmrc-p-forms/p60/{employeeId}/{taxYear}/regenerate": {
      "post": {
        "tags": [
          "HMRC P-forms · P60"
        ],
        "description": "Needs permission pay-run:write.",
        "operationId": "HmrcPForms_RegenerateP60",
        "parameters": [
          {
            "name": "employeeId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "taxYear",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HmrcPForms_P60ModelResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HmrcPForms_ApiErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HmrcPForms_ObjectResponseBody"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HmrcPForms_ObjectResponseBody"
                }
              }
            }
          }
        },
        "x-flow-permission": "pay-run:write",
        "summary": "Regenerate a finalised P60"
      }
    },
    "/v1/hmrc-p-forms/p60/send-notification": {
      "post": {
        "tags": [
          "HMRC P-forms · P60"
        ],
        "description": "Needs permission pay-run:write.",
        "operationId": "HmrcPForms_SendP60Notification",
        "parameters": [
          {
            "name": "force",
            "in": "query",
            "schema": {
              "type": "boolean"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/HmrcPForms_SendP60NotificationRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "202": {
            "description": "Accepted",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HmrcPForms_SendP60NotificationResponseResponseBody"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HmrcPForms_ObjectResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HmrcPForms_ApiErrorResponse"
                }
              }
            }
          }
        },
        "x-flow-permission": "pay-run:write",
        "summary": "Send P60 emails to one or more employees"
      }
    },
    "/v1/hmrc-p-forms/pforms/send-notification/jobs/{jobId}": {
      "get": {
        "tags": [
          "HMRC P-forms · PFormBulkSend"
        ],
        "description": "Needs permission pay-run:read.",
        "operationId": "HmrcPForms_GetPFormBulkSendJob",
        "parameters": [
          {
            "name": "jobId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HmrcPForms_PFormBulkSendJobModelResponseBody"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HmrcPForms_ObjectResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HmrcPForms_ApiErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HmrcPForms_ObjectResponseBody"
                }
              }
            }
          }
        },
        "x-flow-permission": "pay-run:read",
        "summary": "Check a P45 or P60 email send"
      }
    },
    "/v1/billing/clients/{clientId}/invoices/{invoiceId}/sync": {
      "post": {
        "tags": [
          "Billing · Accounting Sync"
        ],
        "summary": "Push invoice to accounting provider",
        "description": "Needs permission billing:write.",
        "operationId": "Billing_SyncInvoice",
        "parameters": [
          {
            "name": "clientId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "invoiceId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_InvoiceDtoResponseBody"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_AccountingSendRefusalDtoResponseBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_ObjectResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_ObjectResponseBody"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_AccountingSendRefusalDtoResponseBody"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_ObjectResponseBody"
                }
              }
            }
          }
        },
        "x-flow-permission": "billing:write"
      }
    },
    "/v1/billing/clients/{clientId}/sync": {
      "post": {
        "tags": [
          "Billing · Accounting Sync"
        ],
        "summary": "Push client and contacts to accounting provider",
        "description": "Needs permission billing:write.",
        "operationId": "Billing_SyncContact",
        "parameters": [
          {
            "name": "clientId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_StringResponseBody"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_AccountingSendRefusalDtoResponseBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_ObjectResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_ObjectResponseBody"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_AccountingSendRefusalDtoResponseBody"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_ObjectResponseBody"
                }
              }
            }
          }
        },
        "x-flow-permission": "billing:write"
      }
    },
    "/v1/billing/clients/{clientId}/credit-notes/{creditNoteId}/sync": {
      "post": {
        "tags": [
          "Billing · Accounting Sync"
        ],
        "summary": "Push credit note to accounting provider",
        "description": "Needs permission billing:write.",
        "operationId": "Billing_SyncCreditNote",
        "parameters": [
          {
            "name": "clientId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "creditNoteId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_CreditNoteDtoResponseBody"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_AccountingSendRefusalDtoResponseBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_ObjectResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_ObjectResponseBody"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_AccountingSendRefusalDtoResponseBody"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_ObjectResponseBody"
                }
              }
            }
          }
        },
        "x-flow-permission": "billing:write"
      }
    },
    "/v1/billing/clients/{clientId}/invoices/{invoiceId}/external-pdf": {
      "get": {
        "tags": [
          "Billing · Accounting Sync"
        ],
        "summary": "Download invoice PDF from provider",
        "description": "Needs permission billing:read.",
        "operationId": "Billing_GetInvoiceExternalPdf",
        "parameters": [
          {
            "name": "clientId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "invoiceId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/pdf": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_ObjectResponseBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_ObjectResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_ObjectResponseBody"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_ObjectResponseBody"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_ObjectResponseBody"
                }
              }
            }
          }
        },
        "x-flow-permission": "billing:read"
      }
    },
    "/v1/billing/clients/{clientId}/credit-notes/{creditNoteId}/external-pdf": {
      "get": {
        "tags": [
          "Billing · Accounting Sync"
        ],
        "summary": "Download credit note PDF from provider",
        "description": "Needs permission billing:read.",
        "operationId": "Billing_GetCreditNoteExternalPdf",
        "parameters": [
          {
            "name": "clientId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "creditNoteId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/pdf": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_ObjectResponseBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_ObjectResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_ObjectResponseBody"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_ObjectResponseBody"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_ObjectResponseBody"
                }
              }
            }
          }
        },
        "x-flow-permission": "billing:read"
      }
    },
    "/v1/billing/finance/tax-rates/provider-rates": {
      "get": {
        "tags": [
          "Billing · Accounting Sync"
        ],
        "summary": "List tax rates from connected provider (paginated, no import)",
        "description": "Needs permission billing:read.",
        "operationId": "Billing_ListProviderTaxRates",
        "parameters": [
          {
            "name": "pageToken",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "pageSize",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_ProviderTaxRatesListResponseResponseBody"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_ObjectResponseBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_ObjectResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_ObjectResponseBody"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_ObjectResponseBody"
                }
              }
            }
          },
          "502": {
            "description": "Bad Gateway",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_ObjectResponseBody"
                }
              }
            }
          }
        },
        "x-flow-permission": "billing:read"
      }
    },
    "/v1/billing/finance/tax-rates/import-from-provider": {
      "post": {
        "tags": [
          "Billing · Accounting Sync"
        ],
        "summary": "Import selected tax rates from connected provider",
        "description": "Needs permission billing:write.",
        "operationId": "Billing_ImportTaxRatesFromProvider",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Billing_ImportTaxRatesFromProviderRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_ImportSummaryDtoResponseBody"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_ObjectResponseBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_ObjectResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_ObjectResponseBody"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_ObjectResponseBody"
                }
              }
            }
          },
          "502": {
            "description": "Bad Gateway",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_ObjectResponseBody"
                }
              }
            }
          }
        },
        "x-flow-permission": "billing:write"
      }
    },
    "/v1/billing/finance/accounts/provider-accounts": {
      "get": {
        "tags": [
          "Billing · Accounting Sync"
        ],
        "summary": "List account codes from connected provider (paginated, no import)",
        "description": "Needs permission billing:read.",
        "operationId": "Billing_ListProviderAccountCodes",
        "parameters": [
          {
            "name": "pageToken",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "pageSize",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_ProviderAccountsListResponseResponseBody"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_ObjectResponseBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_ObjectResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_ObjectResponseBody"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_ObjectResponseBody"
                }
              }
            }
          },
          "502": {
            "description": "Bad Gateway",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_ObjectResponseBody"
                }
              }
            }
          }
        },
        "x-flow-permission": "billing:read"
      }
    },
    "/v1/billing/finance/accounts/import-from-provider": {
      "post": {
        "tags": [
          "Billing · Accounting Sync"
        ],
        "summary": "Import selected account codes from connected provider",
        "description": "Needs permission billing:write.",
        "operationId": "Billing_ImportAccountCodesFromProvider",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Billing_ImportAccountCodesFromProviderRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_ImportSummaryDtoResponseBody"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_ObjectResponseBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_ObjectResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_ObjectResponseBody"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_ObjectResponseBody"
                }
              }
            }
          },
          "502": {
            "description": "Bad Gateway",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_ObjectResponseBody"
                }
              }
            }
          }
        },
        "x-flow-permission": "billing:write"
      }
    },
    "/v1/billing/clients/provider-contacts": {
      "get": {
        "tags": [
          "Billing · Accounting Sync"
        ],
        "summary": "List contacts from connected provider (paginated, no import)",
        "description": "Needs permission billing:read.",
        "operationId": "Billing_ListProviderContacts",
        "parameters": [
          {
            "name": "pageToken",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "pageSize",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_ProviderContactsListResponseResponseBody"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_ObjectResponseBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_ObjectResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_ObjectResponseBody"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_ObjectResponseBody"
                }
              }
            }
          },
          "502": {
            "description": "Bad Gateway",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_ObjectResponseBody"
                }
              }
            }
          }
        },
        "x-flow-permission": "billing:read"
      }
    },
    "/v1/billing/clients/import-from-provider": {
      "post": {
        "tags": [
          "Billing · Accounting Sync"
        ],
        "summary": "Import selected contacts from connected provider",
        "description": "Needs permission billing:write.",
        "operationId": "Billing_ImportContactsFromProvider",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Billing_ImportContactsFromProviderRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_ImportSummaryDtoResponseBody"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_ObjectResponseBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_ObjectResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_ObjectResponseBody"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_ObjectResponseBody"
                }
              }
            }
          },
          "502": {
            "description": "Bad Gateway",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_ObjectResponseBody"
                }
              }
            }
          }
        },
        "x-flow-permission": "billing:write"
      }
    },
    "/v1/billing/clients/{clientId}/invoices": {
      "get": {
        "tags": [
          "Billing · Clients"
        ],
        "summary": "List Invoices for Client",
        "description": "Needs permission billing:read.\n\nLists invoices for a client (REST: sub-resource under client).",
        "operationId": "Billing_ListInvoicesByClient",
        "parameters": [
          {
            "name": "clientId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "paginationToken",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "pageSize",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int32",
              "default": 100
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_ListInvoicesResponseResponseBody"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_ObjectResponseBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_ObjectResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_ObjectResponseBody"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_ObjectResponseBody"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_StringResponseBody"
                }
              }
            }
          }
        },
        "x-flow-permission": "billing:read"
      }
    },
    "/v1/billing/clients/{clientId}/finance-settings": {
      "get": {
        "tags": [
          "Billing · Clients"
        ],
        "summary": "Get Client Finance Settings",
        "description": "Needs permission billing:read.\n\nGets the client's finance settings. Seeds with defaults if none exist.",
        "operationId": "Billing_GetClientFinanceSettings",
        "parameters": [
          {
            "name": "clientId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_ClientFinanceSettingsDtoResponseBody"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_ObjectResponseBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_ObjectResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_ObjectResponseBody"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_StringResponseBody"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_StringResponseBody"
                }
              }
            }
          }
        },
        "x-flow-permission": "billing:read"
      },
      "put": {
        "tags": [
          "Billing · Clients"
        ],
        "summary": "Update Client Finance Settings",
        "description": "Needs permission billing:write.\n\nUpdates the client's finance settings.",
        "operationId": "Billing_PutClientFinanceSettings",
        "parameters": [
          {
            "name": "clientId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Billing_ClientFinanceSettingsDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_ClientFinanceSettingsDtoResponseBody"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_ObjectResponseBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_ObjectResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_ObjectResponseBody"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_StringResponseBody"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_StringResponseBody"
                }
              }
            }
          }
        },
        "x-flow-permission": "billing:write"
      }
    },
    "/v1/billing/clients/{clientId}": {
      "get": {
        "tags": [
          "Billing · Clients"
        ],
        "summary": "Get Client by Id",
        "description": "Needs permission billing:read.\n\nRetrieves a client by its unique identifier.",
        "operationId": "Billing_GetClientById",
        "parameters": [
          {
            "name": "clientId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_ClientDtoResponseBody"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_ObjectResponseBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_ObjectResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_ObjectResponseBody"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_StringResponseBody"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_StringResponseBody"
                }
              }
            }
          }
        },
        "x-flow-permission": "billing:read"
      },
      "put": {
        "tags": [
          "Billing · Clients"
        ],
        "summary": "Update Client",
        "description": "Needs permission billing:write.\n\nUpdates a client.",
        "operationId": "Billing_UpdateClient",
        "parameters": [
          {
            "name": "clientId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "oneOf": [
                  {
                    "$ref": "#/components/schemas/Billing_UpdatableClientDto"
                  },
                  {
                    "$ref": "#/components/schemas/Billing_ClientDto"
                  }
                ],
                "description": "Updatable client DTO"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_ClientDtoResponseBody"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_ObjectResponseBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_ObjectResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_ObjectResponseBody"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_ObjectResponseBody"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_ObjectResponseBody"
                }
              }
            }
          }
        },
        "x-flow-permission": "billing:write"
      },
      "delete": {
        "tags": [
          "Billing · Clients"
        ],
        "summary": "Delete Client",
        "description": "Needs permission billing:write.\n\nDeletes a client by its unique identifier. If the client has invoices or credits, the client is archived (soft-delete). Otherwise the client is hard deleted. Returns the client in both cases (200 OK).",
        "operationId": "Billing_DeleteClient",
        "parameters": [
          {
            "name": "clientId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_ClientDtoResponseBody"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_ObjectResponseBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_ObjectResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_ObjectResponseBody"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_ObjectResponseBody"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_ObjectResponseBody"
                }
              }
            }
          }
        },
        "x-flow-permission": "billing:write"
      }
    },
    "/v1/billing/clients": {
      "get": {
        "tags": [
          "Billing · Clients"
        ],
        "summary": "List Clients",
        "description": "Needs permission billing:read.\n\nLists all clients.",
        "operationId": "Billing_ListClients",
        "parameters": [
          {
            "name": "paginationToken",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "pageSize",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int32",
              "default": 100
            }
          },
          {
            "name": "includeArchived",
            "in": "query",
            "schema": {
              "type": "boolean",
              "default": false
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_ListClientsResponseResponseBody"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_ObjectResponseBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_ObjectResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_ObjectResponseBody"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_ObjectResponseBody"
                }
              }
            }
          }
        },
        "x-flow-permission": "billing:read"
      },
      "post": {
        "tags": [
          "Billing · Clients"
        ],
        "summary": "Create Client",
        "description": "Needs permission billing:write.\n\nCreates a new client. When the organisation has finance defaults set (default revenue account and default tax), defaultRevenueAccountCode and defaultTaxType may be omitted and are auto-filled from org defaults; otherwise both fields are required.",
        "operationId": "Billing_CreateClient",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "oneOf": [
                  {
                    "$ref": "#/components/schemas/Billing_UpdatableClientDto"
                  },
                  {
                    "$ref": "#/components/schemas/Billing_ClientDto"
                  }
                ],
                "description": "Updatable client DTO"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_ClientDtoResponseBody"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_ObjectResponseBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_ObjectResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_ObjectResponseBody"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_ObjectResponseBody"
                }
              }
            }
          }
        },
        "x-flow-permission": "billing:write"
      }
    },
    "/v1/billing/clients/{clientId}/unarchive": {
      "patch": {
        "tags": [
          "Billing · Clients"
        ],
        "summary": "Unarchive Client",
        "description": "Needs permission billing:write.\n\nSets client status back to Active. Returns 404 if client not found or not archived.",
        "operationId": "Billing_UnarchiveClient",
        "parameters": [
          {
            "name": "clientId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_ClientDtoResponseBody"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_ObjectResponseBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_ObjectResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_ObjectResponseBody"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_ObjectResponseBody"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_ObjectResponseBody"
                }
              }
            }
          }
        },
        "x-flow-permission": "billing:write"
      }
    },
    "/v1/billing/credit-notes": {
      "get": {
        "tags": [
          "Billing · Credit Notes"
        ],
        "summary": "List Credit Notes for Organisation",
        "description": "Needs permission billing:read.\n\nLists credit notes for the organisation with optional filters (client, status, type, amount range, date range). Paginated.",
        "operationId": "Billing_ListCreditNotesByOrganisation",
        "parameters": [
          {
            "name": "clientId",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "status",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "type",
            "in": "query",
            "schema": {
              "enum": [
                "SalesCredit",
                "PurchaseCredit"
              ],
              "type": "string",
              "nullable": true
            }
          },
          {
            "name": "minAmount",
            "in": "query",
            "schema": {
              "type": "number",
              "format": "double"
            }
          },
          {
            "name": "maxAmount",
            "in": "query",
            "schema": {
              "type": "number",
              "format": "double"
            }
          },
          {
            "name": "startDate",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "endDate",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "pageSize",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "paginationToken",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_ListCreditNotesByOrgResponseResponseBody"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_ObjectResponseBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_ObjectResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_ObjectResponseBody"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_StringResponseBody"
                }
              }
            }
          }
        },
        "x-flow-permission": "billing:read"
      },
      "post": {
        "tags": [
          "Billing · Credit Notes"
        ],
        "summary": "Create Draft Credit Note",
        "description": "Needs permission billing:write.\n\nCreates a new credit note in DRAFT status with line items, tax calculations, and account codes.",
        "operationId": "Billing_CreateCreditNote",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Billing_CreateCreditNoteRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_CreditNoteDtoResponseBody"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_StringResponseBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_ObjectResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_ObjectResponseBody"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_StringResponseBody"
                }
              }
            }
          }
        },
        "x-flow-permission": "billing:write"
      }
    },
    "/v1/billing/clients/{clientId}/credit-notes": {
      "get": {
        "tags": [
          "Billing · Credit Notes"
        ],
        "summary": "List Credit Notes for Client",
        "description": "Needs permission billing:read.\n\nReturns all credit notes for a specific client (DRAFT, AUTHORISED, PAID, VOIDED).",
        "operationId": "Billing_ListCreditNotesByClient",
        "parameters": [
          {
            "name": "clientId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_IReadOnlyListCreditNoteDtoResponseBody"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_ObjectResponseBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_ObjectResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_ObjectResponseBody"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_ObjectResponseBody"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_StringResponseBody"
                }
              }
            }
          }
        },
        "x-flow-permission": "billing:read"
      }
    },
    "/v1/billing/clients/{clientId}/credit-notes/{creditNoteId}": {
      "get": {
        "tags": [
          "Billing · Credit Notes"
        ],
        "summary": "Get Credit Note by ID",
        "description": "Needs permission billing:read.\n\nRetrieves a credit note by its unique identifier, including all line items and allocations.",
        "operationId": "Billing_GetCreditNote",
        "parameters": [
          {
            "name": "clientId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "creditNoteId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_CreditNoteDtoResponseBody"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_ObjectResponseBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_ObjectResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_ObjectResponseBody"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_StringResponseBody"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_StringResponseBody"
                }
              }
            }
          }
        },
        "x-flow-permission": "billing:read"
      },
      "put": {
        "tags": [
          "Billing · Credit Notes"
        ],
        "summary": "Update Draft Credit Note",
        "description": "Needs permission billing:write.\n\nUpdates a DRAFT credit note. Only DRAFT credit notes can be edited. Recalculates totals automatically.",
        "operationId": "Billing_UpdateCreditNote",
        "parameters": [
          {
            "name": "clientId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "creditNoteId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Billing_UpdateCreditNoteRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_CreditNoteDtoResponseBody"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_StringResponseBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_ObjectResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_ObjectResponseBody"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_StringResponseBody"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_StringResponseBody"
                }
              }
            }
          }
        },
        "x-flow-permission": "billing:write"
      },
      "delete": {
        "tags": [
          "Billing · Credit Notes"
        ],
        "summary": "Delete Draft Credit Note",
        "description": "Needs permission billing:write.\n\nDeletes a credit note. Only DRAFT credit notes can be deleted.",
        "operationId": "Billing_DeleteCreditNote",
        "parameters": [
          {
            "name": "clientId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "creditNoteId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No Content"
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_ObjectResponseBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_ObjectResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_ObjectResponseBody"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_StringResponseBody"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_StringResponseBody"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_StringResponseBody"
                }
              }
            }
          }
        },
        "x-flow-permission": "billing:write"
      }
    },
    "/v1/billing/clients/{clientId}/credit-notes/{creditNoteId}/line-items": {
      "get": {
        "tags": [
          "Billing · Credit Notes"
        ],
        "summary": "List Credit Note Line Items",
        "description": "Needs permission billing:read.\n\nReturns paginated line items for a credit note. Use for credit notes with many lines (e.g. 10k+).",
        "operationId": "Billing_ListCreditNoteLineItems",
        "parameters": [
          {
            "name": "clientId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "creditNoteId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "pageSize",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "paginationToken",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "missingAttachments",
            "in": "query",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "missingPoNumber",
            "in": "query",
            "schema": {
              "type": "boolean"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_ListCreditNoteLineItemsResponseResponseBody"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_ObjectResponseBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_ObjectResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_ObjectResponseBody"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_StringResponseBody"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_StringResponseBody"
                }
              }
            }
          }
        },
        "x-flow-permission": "billing:read"
      }
    },
    "/v1/billing/clients/{clientId}/credit-notes/{creditNoteId}/attachments": {
      "post": {
        "tags": [
          "Billing · Credit Notes"
        ],
        "summary": "Add Credit Note Attachments",
        "description": "Needs permission billing:write.\n\nCreates attachment metadata and returns where to upload each file. PUT each file's bytes, and nothing else, to its uploadUrl with the returned headers within 15 minutes; the file must be exactly the declared type and size, at most 10 MB. Only draft credit notes.",
        "operationId": "Billing_AddCreditNoteAttachments",
        "parameters": [
          {
            "name": "clientId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "creditNoteId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Billing_AddDocumentAttachmentsRequestDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_IReadOnlyListDocumentAttachmentUploadResponseDtoResponseBody"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_StringResponseBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_ObjectResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_ObjectResponseBody"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_StringResponseBody"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_ObjectResponseBody"
                }
              }
            }
          }
        },
        "x-flow-permission": "billing:write"
      }
    },
    "/v1/billing/clients/{clientId}/credit-notes/{creditNoteId}/attachments/{attachmentId}": {
      "delete": {
        "tags": [
          "Billing · Credit Notes"
        ],
        "summary": "Delete Credit Note Attachment",
        "description": "Needs permission billing:write.\n\nDeletes an attachment from a draft credit note.",
        "operationId": "Billing_DeleteCreditNoteAttachment",
        "parameters": [
          {
            "name": "clientId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "creditNoteId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "attachmentId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_CreditNoteDtoResponseBody"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_ObjectResponseBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_ObjectResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_ObjectResponseBody"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_StringResponseBody"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_ObjectResponseBody"
                }
              }
            }
          }
        },
        "x-flow-permission": "billing:write"
      }
    },
    "/v1/billing/clients/{clientId}/credit-notes/{creditNoteId}/authorise": {
      "post": {
        "tags": [
          "Billing · Credit Notes"
        ],
        "summary": "Authorise Credit Note",
        "description": "Needs permission billing:write.\n\nLocks the credit note (status → AUTHORISED) and makes it available for allocation to invoices. Syncs to external accounting provider if connected.",
        "operationId": "Billing_AuthoriseCreditNote",
        "parameters": [
          {
            "name": "clientId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "creditNoteId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Billing_AuthoriseRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_CreditNoteDtoResponseBody"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_StringResponseBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_ObjectResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_ObjectResponseBody"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_StringResponseBody"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_StringResponseBody"
                }
              }
            }
          }
        },
        "x-flow-permission": "billing:write"
      }
    },
    "/v1/billing/clients/{clientId}/credit-notes/{creditNoteId}/void": {
      "post": {
        "tags": [
          "Billing · Credit Notes"
        ],
        "summary": "Void Credit Note",
        "description": "Needs permission billing:write.\n\nVoids a credit note (status → VOIDED). Cannot void fully allocated credit notes. Remaining credit becomes 0.",
        "operationId": "Billing_VoidCreditNote",
        "parameters": [
          {
            "name": "clientId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "creditNoteId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Billing_VoidRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_CreditNoteDtoResponseBody"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_StringResponseBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_ObjectResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_ObjectResponseBody"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_StringResponseBody"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_StringResponseBody"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_StringResponseBody"
                }
              }
            }
          }
        },
        "x-flow-permission": "billing:write"
      }
    },
    "/v1/billing/clients/{clientId}/credit-notes/{creditNoteId}/allocations": {
      "post": {
        "tags": [
          "Billing · Credit Notes"
        ],
        "summary": "Allocate Credit to Invoice",
        "description": "Needs permission billing:write.\n\nApplies a credit note to an invoice. Validates amount <= remaining credit and <= invoice balance due. Updates both credit note and invoice atomically.",
        "operationId": "Billing_AllocateCreditToInvoice",
        "parameters": [
          {
            "name": "clientId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "creditNoteId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Billing_AllocateCreditRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_AllocationDtoResponseBody"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_StringResponseBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_ObjectResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_ObjectResponseBody"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_StringResponseBody"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_StringResponseBody"
                }
              }
            }
          }
        },
        "x-flow-permission": "billing:write"
      }
    },
    "/v1/billing/clients/{clientId}/credit-notes/{creditNoteId}/allocations/{allocationId}": {
      "delete": {
        "tags": [
          "Billing · Credit Notes"
        ],
        "summary": "Remove Credit Allocation",
        "description": "Needs permission billing:write.\n\nRemoves an allocation between a credit note and invoice. Restores credit to the credit note and increases invoice balance due.",
        "operationId": "Billing_DeleteAllocation",
        "parameters": [
          {
            "name": "clientId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "creditNoteId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "allocationId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_CreditNoteDtoResponseBody"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_ObjectResponseBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_ObjectResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_ObjectResponseBody"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_StringResponseBody"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_StringResponseBody"
                }
              }
            }
          }
        },
        "x-flow-permission": "billing:write"
      }
    },
    "/v1/billing/finance/tax-rates": {
      "get": {
        "tags": [
          "Billing · Tax rates"
        ],
        "summary": "List Tax Rates",
        "description": "Needs permission billing:read.\n\nReturns all tax rates for the organisation (system defaults + custom rates). Used for credit note line item dropdowns.",
        "operationId": "Billing_GetTaxRates",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_IReadOnlyListTaxRateDtoResponseBody"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_ObjectResponseBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_ObjectResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_ObjectResponseBody"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_StringResponseBody"
                }
              }
            }
          }
        },
        "x-flow-permission": "billing:read"
      },
      "post": {
        "tags": [
          "Billing · Tax rates"
        ],
        "summary": "Create Custom Tax Rate",
        "description": "Needs permission billing:write.\n\nCreates a custom tax rate for the organisation (e.g., 'My Special 5% Tax').",
        "operationId": "Billing_CreateTaxRate",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Billing_CreateTaxRateRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_TaxRateDtoResponseBody"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_StringResponseBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_ObjectResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_ObjectResponseBody"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_StringResponseBody"
                }
              }
            }
          }
        },
        "x-flow-permission": "billing:write"
      }
    },
    "/v1/billing/finance/tax-rates/{taxType}": {
      "put": {
        "tags": [
          "Billing · Tax rates"
        ],
        "summary": "Update Tax Rate",
        "description": "Needs permission billing:write.\n\nUpdates a custom tax rate. System default rates cannot be updated.",
        "operationId": "Billing_UpdateTaxRate",
        "parameters": [
          {
            "name": "taxType",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Billing_TaxRateDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_TaxRateDtoResponseBody"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_StringResponseBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_ObjectResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_ObjectResponseBody"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_StringResponseBody"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_StringResponseBody"
                }
              }
            }
          }
        },
        "x-flow-permission": "billing:write"
      },
      "delete": {
        "tags": [
          "Billing · Tax rates"
        ],
        "summary": "Delete Tax Rate",
        "description": "Needs permission billing:write.\n\nPermanently deletes a tax rate. Returns 409 if the rate is in use by credit notes or client finance settings; archive it instead.",
        "operationId": "Billing_DeleteTaxRate",
        "parameters": [
          {
            "name": "taxType",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No Content"
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_ObjectResponseBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_ObjectResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_ObjectResponseBody"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_StringResponseBody"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_StringResponseBody"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_StringResponseBody"
                }
              }
            }
          }
        },
        "x-flow-permission": "billing:write"
      }
    },
    "/v1/billing/finance/tax-rates/{taxType}/archive": {
      "post": {
        "tags": [
          "Billing · Tax rates"
        ],
        "summary": "Archive Tax Rate",
        "description": "Needs permission billing:write.\n\nArchives a tax rate (status → ARCHIVED). Archived rates are hidden from dropdowns but existing credit notes retain the rate.",
        "operationId": "Billing_ArchiveTaxRate",
        "parameters": [
          {
            "name": "taxType",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_TaxRateDtoResponseBody"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_ObjectResponseBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_ObjectResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_ObjectResponseBody"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_StringResponseBody"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_StringResponseBody"
                }
              }
            }
          }
        },
        "x-flow-permission": "billing:write"
      }
    },
    "/v1/billing/finance/tax-rates/{taxType}/unarchive": {
      "post": {
        "tags": [
          "Billing · Tax rates"
        ],
        "summary": "Unarchive Tax Rate",
        "description": "Needs permission billing:write.\n\nRestores an archived tax rate (status → Active). Returns 404 if not found or not archived.",
        "operationId": "Billing_UnarchiveTaxRate",
        "parameters": [
          {
            "name": "taxType",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_TaxRateDtoResponseBody"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_ObjectResponseBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_ObjectResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_ObjectResponseBody"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_StringResponseBody"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_StringResponseBody"
                }
              }
            }
          }
        },
        "x-flow-permission": "billing:write"
      }
    },
    "/v1/billing/finance/accounts": {
      "get": {
        "tags": [
          "Billing · Account codes"
        ],
        "summary": "List Account Codes",
        "description": "Needs permission billing:read.\n\nReturns all account codes for the organisation (system defaults + custom accounts). Used for credit note line item dropdowns.",
        "operationId": "Billing_GetAccountCodes",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_IReadOnlyListAccountCodeDtoResponseBody"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_ObjectResponseBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_ObjectResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_ObjectResponseBody"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_StringResponseBody"
                }
              }
            }
          }
        },
        "x-flow-permission": "billing:read"
      },
      "post": {
        "tags": [
          "Billing · Account codes"
        ],
        "summary": "Create Account Code",
        "description": "Needs permission billing:write.\n\nCreates a custom account code for the organisation (e.g., '250 - Consulting Revenue').",
        "operationId": "Billing_CreateAccountCode",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Billing_CreateAccountCodeRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_AccountCodeDtoResponseBody"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_StringResponseBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_ObjectResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_ObjectResponseBody"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_StringResponseBody"
                }
              }
            }
          }
        },
        "x-flow-permission": "billing:write"
      }
    },
    "/v1/billing/finance/accounts/{code}": {
      "put": {
        "tags": [
          "Billing · Account codes"
        ],
        "summary": "Update Account Code",
        "description": "Needs permission billing:write.\n\nUpdates a custom account code. System default accounts cannot be updated.",
        "operationId": "Billing_UpdateAccountCode",
        "parameters": [
          {
            "name": "code",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Billing_AccountCodeDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_AccountCodeDtoResponseBody"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_StringResponseBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_ObjectResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_ObjectResponseBody"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_StringResponseBody"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_StringResponseBody"
                }
              }
            }
          }
        },
        "x-flow-permission": "billing:write"
      },
      "delete": {
        "tags": [
          "Billing · Account codes"
        ],
        "summary": "Delete Account Code",
        "description": "Needs permission billing:write.\n\nPermanently deletes an account code. Returns 409 if the code is in use by credit notes or client finance settings; archive it instead.",
        "operationId": "Billing_DeleteAccountCode",
        "parameters": [
          {
            "name": "code",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No Content"
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_ObjectResponseBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_ObjectResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_ObjectResponseBody"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_StringResponseBody"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_StringResponseBody"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_StringResponseBody"
                }
              }
            }
          }
        },
        "x-flow-permission": "billing:write"
      }
    },
    "/v1/billing/finance/accounts/{code}/archive": {
      "post": {
        "tags": [
          "Billing · Account codes"
        ],
        "summary": "Archive Account Code",
        "description": "Needs permission billing:write.\n\nArchives an account code (status → ARCHIVED). Archived accounts are hidden from dropdowns but existing credit notes retain the account code.",
        "operationId": "Billing_ArchiveAccountCode",
        "parameters": [
          {
            "name": "code",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_AccountCodeDtoResponseBody"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_ObjectResponseBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_ObjectResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_ObjectResponseBody"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_StringResponseBody"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_StringResponseBody"
                }
              }
            }
          }
        },
        "x-flow-permission": "billing:write"
      }
    },
    "/v1/billing/finance/accounts/{code}/unarchive": {
      "post": {
        "tags": [
          "Billing · Account codes"
        ],
        "summary": "Unarchive Account Code",
        "description": "Needs permission billing:write.\n\nRestores an archived account code (status → Active). Returns 404 if not found or not archived.",
        "operationId": "Billing_UnarchiveAccountCode",
        "parameters": [
          {
            "name": "code",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_AccountCodeDtoResponseBody"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_ObjectResponseBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_ObjectResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_ObjectResponseBody"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_StringResponseBody"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_StringResponseBody"
                }
              }
            }
          }
        },
        "x-flow-permission": "billing:write"
      }
    },
    "/v1/billing/finance/pay-element-mappings": {
      "get": {
        "tags": [
          "Billing · Finance defaults"
        ],
        "summary": "Get organisation pay element mappings",
        "description": "Needs permission billing:read.\n\nReturns organisation-level pay element mappings (global default). Clients without their own mapping use this.",
        "operationId": "Billing_GetPayElementMappings",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_OrganisationPayElementMappingsDtoResponseBody"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_ObjectResponseBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_ObjectResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_ObjectResponseBody"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_StringResponseBody"
                }
              }
            }
          }
        },
        "x-flow-permission": "billing:read"
      },
      "put": {
        "tags": [
          "Billing · Finance defaults"
        ],
        "summary": "Update organisation pay element mappings",
        "description": "Needs permission billing:write.\n\nUpdates organisation-level pay element mappings (global default).",
        "operationId": "Billing_PutPayElementMappings",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Billing_OrganisationPayElementMappingsDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_OrganisationPayElementMappingsDtoResponseBody"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_StringResponseBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_ObjectResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_ObjectResponseBody"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_StringResponseBody"
                }
              }
            }
          }
        },
        "x-flow-permission": "billing:write"
      }
    },
    "/v1/billing/finance/finance-defaults": {
      "get": {
        "tags": [
          "Billing · Finance defaults"
        ],
        "summary": "Get organisation finance defaults",
        "description": "Needs permission billing:read.\n\nReturns organisation-level default revenue account and default tax. When both are set, Create Client can omit these fields and they are auto-filled from org defaults. Returns nulls when never set.",
        "operationId": "Billing_GetFinanceDefaults",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_OrganisationFinanceDefaultsDtoResponseBody"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_ObjectResponseBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_ObjectResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_ObjectResponseBody"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_StringResponseBody"
                }
              }
            }
          }
        },
        "x-flow-permission": "billing:read"
      },
      "put": {
        "tags": [
          "Billing · Finance defaults"
        ],
        "summary": "Update organisation finance defaults",
        "description": "Needs permission billing:write.\n\nUpdates organisation-level default revenue account and default tax. Used by Billing settings and to auto-fill new client creation when omitted.",
        "operationId": "Billing_PutFinanceDefaults",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Billing_OrganisationFinanceDefaultsDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_OrganisationFinanceDefaultsDtoResponseBody"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_StringResponseBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_ObjectResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_ObjectResponseBody"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_StringResponseBody"
                }
              }
            }
          }
        },
        "x-flow-permission": "billing:write"
      }
    },
    "/v1/billing/finance/invoice-template": {
      "get": {
        "tags": [
          "Billing · Invoice & credit note templates"
        ],
        "summary": "Get organisation invoice template",
        "description": "Needs permission billing:read.\n\nReturns organisation-level invoice template. Uses defaults when never set. The template controls grouping (subsection header, subtotal in subsection, VAT and quantity total in subsection and in bottom subtotals), line description formula (placeholders from GET line-item-description-fields), optional tag group for {tagValue}, and attachment strategy.",
        "operationId": "Billing_GetInvoiceTemplate",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_DocumentTemplateDtoResponseBody"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_ObjectResponseBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_ObjectResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_ObjectResponseBody"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_StringResponseBody"
                }
              }
            }
          }
        },
        "x-flow-permission": "billing:read"
      },
      "put": {
        "tags": [
          "Billing · Invoice & credit note templates"
        ],
        "summary": "Update organisation invoice template",
        "description": "Needs permission billing:write.\n\nUpdates organisation-level invoice template (global default). Request body uses boolean flags for grouping: show subsection header, show subtotal in subsection, show VAT and quantity total in subsection and in bottom subtotals; line description formula with placeholders from GET line-item-description-fields (use returned id in curly braces); optional lineDescriptionTagGroupId when formula uses a placeholder with requiresTagGroup; attachment strategy.",
        "operationId": "Billing_PutInvoiceTemplate",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Billing_DocumentTemplateDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_DocumentTemplateDtoResponseBody"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_StringResponseBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_ObjectResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_ObjectResponseBody"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_StringResponseBody"
                }
              }
            }
          }
        },
        "x-flow-permission": "billing:write"
      }
    },
    "/v1/billing/finance/credit-note-template": {
      "get": {
        "tags": [
          "Billing · Invoice & credit note templates"
        ],
        "summary": "Get organisation credit note template",
        "description": "Needs permission billing:read.\n\nReturns organisation-level credit note template. Uses defaults when never set. Same structure as invoice template: grouping (subsection header, subtotal in subsection, VAT and quantity total), line description formula, optional tag group, attachment strategy.",
        "operationId": "Billing_GetCreditNoteTemplate",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_DocumentTemplateDtoResponseBody"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_ObjectResponseBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_ObjectResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_ObjectResponseBody"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_StringResponseBody"
                }
              }
            }
          }
        },
        "x-flow-permission": "billing:read"
      },
      "put": {
        "tags": [
          "Billing · Invoice & credit note templates"
        ],
        "summary": "Update organisation credit note template",
        "description": "Needs permission billing:write.\n\nUpdates organisation-level credit note template (global default). Request body: same as invoice template (boolean flags for grouping, line description formula with placeholders from GET line-item-description-fields, optional lineDescriptionTagGroupId, attachment strategy).",
        "operationId": "Billing_PutCreditNoteTemplate",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Billing_DocumentTemplateDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_DocumentTemplateDtoResponseBody"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_StringResponseBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_ObjectResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_ObjectResponseBody"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_StringResponseBody"
                }
              }
            }
          }
        },
        "x-flow-permission": "billing:write"
      }
    },
    "/v1/billing/finance/line-item-description-fields": {
      "get": {
        "tags": [
          "Billing · Invoice & credit note templates"
        ],
        "summary": "Get line item description formula placeholders",
        "description": "Needs permission billing:read.\n\nReturns placeholders that can be used in the line description formula (e.g. {description}, {employeeName}). Use the returned id in curly braces in the formula. When requiresTagGroup is true for a placeholder, set lineDescriptionTagGroupId on the invoice or credit note template when using that placeholder.",
        "operationId": "Billing_GetLineItemDescriptionFields",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_IReadOnlyListLineItemDescriptionFieldDtoResponseBody"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_ObjectResponseBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_ObjectResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_ObjectResponseBody"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_StringResponseBody"
                }
              }
            }
          }
        },
        "x-flow-permission": "billing:read"
      }
    },
    "/v1/billing/finance/invoice-reference-fields": {
      "get": {
        "tags": [
          "Billing · Invoice & credit note templates"
        ],
        "summary": "Get invoice reference formula tokens for a given invoice format",
        "description": "Needs permission billing:read.\n\nReturns available tokens that can be used in the invoice reference formula for a given invoice format. Use the returned id in curly braces in the formula (e.g. {payrollConfigName}). Separators (space, dash, underscore, slash) are always available.",
        "operationId": "Billing_GetInvoiceReferenceFields",
        "parameters": [
          {
            "name": "invoiceFormat",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_IReadOnlyListInvoiceReferenceFieldDtoResponseBody"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_ObjectResponseBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_ObjectResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_ObjectResponseBody"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_StringResponseBody"
                }
              }
            }
          }
        },
        "x-flow-permission": "billing:read"
      }
    },
    "/v1/billing/finance/attachment-limits": {
      "get": {
        "tags": [
          "Billing · Finance defaults"
        ],
        "summary": "Get attachment limits for connected provider",
        "description": "Needs permission billing:read.\n\nHow many files the connected accounting system will hold against one document. Nulls mean nothing is connected, or no limit is declared.",
        "operationId": "Billing_GetAttachmentLimits",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_AttachmentLimitsDtoResponseBody"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_ObjectResponseBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_ObjectResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_ObjectResponseBody"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_StringResponseBody"
                }
              }
            }
          }
        },
        "x-flow-permission": "billing:read"
      }
    },
    "/v1/billing/invoices": {
      "get": {
        "tags": [
          "Billing · Invoices"
        ],
        "summary": "List Invoices for Organisation",
        "description": "Needs permission billing:read.\n\nLists invoices for the organisation with optional filters (client, status, invoice type, invoice format, grouping key value, amount range, invoice date range, has attachments). Paginated.",
        "operationId": "Billing_ListInvoicesByOrganisation",
        "parameters": [
          {
            "name": "clientId",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "status",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "invoiceType",
            "in": "query",
            "schema": {
              "enum": [
                "Sales",
                "Purchase"
              ],
              "type": "string",
              "nullable": true
            }
          },
          {
            "name": "invoiceFormat",
            "in": "query",
            "schema": {
              "enum": [
                "None",
                "Date",
                "PayElementId",
                "PoNumber",
                "TagGroup",
                "PayrollConfigId"
              ],
              "type": "string",
              "nullable": true
            }
          },
          {
            "name": "groupingKeyValue",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "minAmount",
            "in": "query",
            "schema": {
              "type": "number",
              "format": "double"
            }
          },
          {
            "name": "maxAmount",
            "in": "query",
            "schema": {
              "type": "number",
              "format": "double"
            }
          },
          {
            "name": "startDate",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "endDate",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "hasAttachments",
            "in": "query",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "noAttachmentsWarning",
            "in": "query",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "noPoNumberWarning",
            "in": "query",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "hasAttachmentsWarning",
            "in": "query",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "hasPoNumberWarning",
            "in": "query",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "pageSize",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "paginationToken",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "invoiceNumber",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_ListInvoicesResponseResponseBody"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_ObjectResponseBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_ObjectResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_ObjectResponseBody"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_StringResponseBody"
                }
              }
            }
          }
        },
        "x-flow-permission": "billing:read"
      }
    },
    "/v1/billing/invoices/{clientId}/{invoiceId}": {
      "put": {
        "tags": [
          "Billing · Invoices"
        ],
        "summary": "Update open invoice",
        "description": "Needs permission billing:write.\n\nUpdates an open invoice (e.g. tags). Only open invoices can be updated. Returns 400 when invoice is not found or is closed.",
        "operationId": "Billing_UpdateInvoice",
        "parameters": [
          {
            "name": "clientId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "invoiceId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Billing_UpdatableInvoiceDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_InvoiceDtoResponseBody"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_StringResponseBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_ObjectResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_ObjectResponseBody"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_StringResponseBody"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_StringResponseBody"
                }
              }
            }
          }
        },
        "x-flow-permission": "billing:write"
      },
      "patch": {
        "tags": [
          "Billing · Invoices"
        ],
        "summary": "Update Invoice (e.g. close)",
        "description": "Needs permission billing:write.\n\nUpdates an invoice. Use to close: sets status to Issued once any line items still being processed have finished (waits up to 2 minutes).",
        "operationId": "Billing_PatchInvoice",
        "parameters": [
          {
            "name": "clientId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "invoiceId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_InvoiceDtoResponseBody"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_ObjectResponseBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_ObjectResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_ObjectResponseBody"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_StringResponseBody"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_StringResponseBody"
                }
              }
            }
          }
        },
        "x-flow-permission": "billing:write"
      },
      "get": {
        "tags": [
          "Billing · Invoices"
        ],
        "summary": "Get Invoice by Id",
        "description": "Needs permission billing:read.\n\nRetrieves an invoice by its unique identifier.",
        "operationId": "Billing_GetInvoiceById",
        "parameters": [
          {
            "name": "clientId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "invoiceId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_InvoiceDtoResponseBody"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_ObjectResponseBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_ObjectResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_ObjectResponseBody"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_StringResponseBody"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_StringResponseBody"
                }
              }
            }
          }
        },
        "x-flow-permission": "billing:read"
      }
    },
    "/v1/billing/invoices/{clientId}/{invoiceId}/line-items": {
      "get": {
        "tags": [
          "Billing · Invoices"
        ],
        "summary": "Get Invoice Line Items",
        "description": "Needs permission billing:read.\n\nRetrieves line items for an invoice (paginated; default page size 100, maximum 1000).",
        "operationId": "Billing_GetLineItemsByInvoiceId",
        "parameters": [
          {
            "name": "clientId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "invoiceId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "pageSize",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int32",
              "default": 100
            }
          },
          {
            "name": "paginationToken",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "missingAttachments",
            "in": "query",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "missingPoNumber",
            "in": "query",
            "schema": {
              "type": "boolean"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_ListInvoiceLineItemsResponseResponseBody"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_ObjectResponseBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_ObjectResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_ObjectResponseBody"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_StringResponseBody"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_StringResponseBody"
                }
              }
            }
          }
        },
        "x-flow-permission": "billing:read"
      }
    },
    "/v1/billing/invoices/{clientId}/{invoiceId}/attachments": {
      "post": {
        "tags": [
          "Billing · Invoices"
        ],
        "summary": "Add Invoice Attachments",
        "description": "Needs permission billing:write.\n\nCreates attachment metadata and returns where to upload each file. PUT each file's bytes, and nothing else, to its uploadUrl with the returned headers within 15 minutes; the file must be exactly the declared type and size, at most 10 MB.",
        "operationId": "Billing_AddInvoiceAttachments",
        "parameters": [
          {
            "name": "clientId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "invoiceId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Billing_AddDocumentAttachmentsRequestDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_IReadOnlyListDocumentAttachmentUploadResponseDtoResponseBody"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_StringResponseBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_ObjectResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_ObjectResponseBody"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_StringResponseBody"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_ObjectResponseBody"
                }
              }
            }
          }
        },
        "x-flow-permission": "billing:write"
      }
    },
    "/v1/billing/invoices/{clientId}/{invoiceId}/attachments/{attachmentId}": {
      "delete": {
        "tags": [
          "Billing · Invoices"
        ],
        "summary": "Delete Invoice Attachment",
        "description": "Needs permission billing:write.\n\nDeletes an attachment from an open invoice. Returns the updated invoice.",
        "operationId": "Billing_DeleteInvoiceAttachment",
        "parameters": [
          {
            "name": "clientId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "invoiceId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "attachmentId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_InvoiceDtoResponseBody"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_ObjectResponseBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_ObjectResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_ObjectResponseBody"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_StringResponseBody"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_ObjectResponseBody"
                }
              }
            }
          }
        },
        "x-flow-permission": "billing:write"
      }
    },
    "/v1/billing/invoices/{clientId}/{invoiceId}/void": {
      "post": {
        "tags": [
          "Billing · Invoices"
        ],
        "summary": "Void Invoice",
        "description": "Needs permission billing:write.\n\nVoids an Issued invoice (status → Voided, balance due → 0). Only Issued invoices can be voided. Returns 400 if invoice is Draft or already Paid/Voided.",
        "operationId": "Billing_VoidInvoice",
        "parameters": [
          {
            "name": "clientId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "invoiceId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_InvoiceDtoResponseBody"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_StringResponseBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_ObjectResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_ObjectResponseBody"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_StringResponseBody"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_StringResponseBody"
                }
              }
            }
          }
        },
        "x-flow-permission": "billing:write"
      }
    },
    "/v1/billing/invoices/{clientId}/{invoiceId}/refresh-line-item-mappings": {
      "post": {
        "tags": [
          "Billing · Invoices"
        ],
        "summary": "Refresh line item mappings",
        "description": "Needs permission billing:write.\n\nRe-applies the current pay element mapping to draft invoice line items. Optionally filter by account code and/or tax type. Returns refreshed line count and updated invoice.",
        "operationId": "Billing_RefreshLineItemMappings",
        "parameters": [
          {
            "name": "clientId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "invoiceId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Billing_RefreshLineItemMappingsRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_RefreshLineItemMappingsResponseResponseBody"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_StringResponseBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_ObjectResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_ObjectResponseBody"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_StringResponseBody"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_StringResponseBody"
                }
              }
            }
          }
        },
        "x-flow-permission": "billing:write"
      }
    },
    "/v1/billing/invoices/{clientId}/{invoiceId}/full-credit": {
      "post": {
        "tags": [
          "Billing · Invoices"
        ],
        "summary": "Credit Entire Invoice",
        "description": "Needs permission billing:write.\n\nCreates a matching credit note for the invoice, authorises it, allocates the full balance to the invoice (setting it to Paid). Only Issued invoices with balance due can be fully credited.",
        "operationId": "Billing_FullCreditInvoice",
        "parameters": [
          {
            "name": "clientId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "invoiceId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_CreditNoteDtoResponseBody"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_StringResponseBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_ObjectResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_ObjectResponseBody"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_StringResponseBody"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_StringResponseBody"
                }
              }
            }
          }
        },
        "x-flow-permission": "billing:write"
      }
    },
    "/v1/billing/invoices/bulk-action": {
      "post": {
        "tags": [
          "Billing · Invoices"
        ],
        "summary": "Bulk invoice action",
        "description": "Needs permission billing:write.\n\nExecute a bulk action (Issue) on multiple draft invoices. Each item is processed individually; successes and failures are aggregated.",
        "operationId": "Billing_BulkAction",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Billing_BulkInvoiceActionRequestDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_BulkInvoiceActionResponseDtoResponseBody"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_ObjectResponseBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_ObjectResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_ObjectResponseBody"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_StringResponseBody"
                }
              }
            }
          }
        },
        "x-flow-permission": "billing:write"
      }
    },
    "/v1/billing/invoices/{clientId}/{invoiceId}/email": {
      "post": {
        "tags": [
          "Billing · Invoices"
        ],
        "summary": "Email Invoice",
        "description": "Needs permission billing:write.\n\nSends the invoice via email through the connected accounting provider. Only Issued invoices that have been synced to the provider can be emailed. Marks the invoice as email sent.",
        "operationId": "Billing_EmailInvoice",
        "parameters": [
          {
            "name": "clientId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "invoiceId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_InvoiceDtoResponseBody"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_StringResponseBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_ObjectResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_ObjectResponseBody"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_StringResponseBody"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Billing_ObjectResponseBody"
                }
              }
            }
          }
        },
        "x-flow-permission": "billing:write"
      }
    },
    "/v1/payment/available/config": {
      "get": {
        "tags": [
          "Payment · AvailablePaymentConfig"
        ],
        "summary": "List all available payment configurations",
        "description": "Needs permission payment:read.",
        "operationId": "Payment_listAvailablePaymentConfigs",
        "x-flow-permission": "payment:read",
        "parameters": [
          {
            "$ref": "#/components/parameters/Payment_Request-Id"
          }
        ],
        "responses": {
          "200": {
            "description": "List of available payment configurations.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Payment_ResponseBody"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "content": {
                          "type": "object",
                          "properties": {
                            "data": {
                              "type": "array",
                              "items": {
                                "$ref": "#/components/schemas/Payment_AvailablePaymentConfigResponse"
                              }
                            },
                            "metadata": {
                              "$ref": "#/components/schemas/Payment_ContentMetadataResponse"
                            }
                          }
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "The access token is missing, expired or not valid (token `invalid_token`). Get a new token and send the request again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Payment_ResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "The caller lacks the permission in x-flow-permission (token `insufficient_permissions`), or cannot reach the organisation (token `access_denied`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Payment_ResponseBody"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Payment_ResponseBody"
                }
              }
            }
          },
          "503": {
            "description": "Access could not be checked just now. Retry after the seconds in Retry-After.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Payment_ResponseBody"
                }
              }
            }
          }
        }
      }
    },
    "/v1/payment/config/{payrollConfigId}": {
      "get": {
        "tags": [
          "Payment · OrganisationPaymentConfig"
        ],
        "summary": "Get payment configuration for an organisation",
        "description": "Needs permission payment:read.",
        "operationId": "Payment_getOrganisationPaymentConfig",
        "x-flow-permission": "payment:read",
        "parameters": [
          {
            "name": "payrollConfigId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The pay schedule (payroll configuration) the settings are for.",
            "example": "org-payroll-123"
          },
          {
            "$ref": "#/components/parameters/Payment_Request-Id"
          }
        ],
        "responses": {
          "200": {
            "description": "Payment configuration retrieved.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Payment_ResponseBody"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "content": {
                          "type": "object",
                          "properties": {
                            "data": {
                              "$ref": "#/components/schemas/Payment_PaymentConfigResponse"
                            },
                            "metadata": {
                              "$ref": "#/components/schemas/Payment_ContentMetadataResponse"
                            }
                          }
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "The access token is missing, expired or not valid (token `invalid_token`). Get a new token and send the request again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Payment_ResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "The caller lacks the permission in x-flow-permission (token `insufficient_permissions`), or cannot reach the organisation (token `access_denied`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Payment_ResponseBody"
                }
              }
            }
          },
          "404": {
            "description": "The pay schedule has no payment configuration.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Payment_ResponseBody"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Payment_ResponseBody"
                }
              }
            }
          },
          "503": {
            "description": "Access could not be checked just now. Retry after the seconds in Retry-After.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Payment_ResponseBody"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "Payment · OrganisationPaymentConfig"
        ],
        "summary": "Update payment configuration for an organisation",
        "description": "Needs permission payment:write.",
        "operationId": "Payment_updateOrganisationPaymentConfig",
        "x-flow-permission": "payment:write",
        "parameters": [
          {
            "name": "payrollConfigId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The pay schedule (payroll configuration) the settings are for.",
            "example": "org-payroll-123"
          },
          {
            "$ref": "#/components/parameters/Payment_Request-Id"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Payment_UpdatePaymentConfigRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Payment configuration updated.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Payment_ResponseBody"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "content": {
                          "type": "object",
                          "properties": {
                            "data": {
                              "$ref": "#/components/schemas/Payment_PaymentConfigResponse"
                            },
                            "metadata": {
                              "$ref": "#/components/schemas/Payment_ContentMetadataResponse"
                            }
                          }
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request: the method and format are not available, or a field is invalid. An invalid file layout lists every problem in validationIssues, each with its field (fileLayout.columns[2].width) and a stable reasonToken (fileLayoutColumnNeedsWidth, ...).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Payment_ResponseBody"
                }
              }
            }
          },
          "401": {
            "description": "The access token is missing, expired or not valid (token `invalid_token`). Get a new token and send the request again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Payment_ResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "The caller lacks the permission in x-flow-permission (token `insufficient_permissions`), or cannot reach the organisation (token `access_denied`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Payment_ResponseBody"
                }
              }
            }
          },
          "404": {
            "description": "The pay schedule has no payment configuration.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Payment_ResponseBody"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Payment_ResponseBody"
                }
              }
            }
          },
          "503": {
            "description": "Access could not be checked just now. Retry after the seconds in Retry-After.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Payment_ResponseBody"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "Payment · OrganisationPaymentConfig"
        ],
        "summary": "Create payment configuration for an organisation",
        "description": "Needs permission payment:write.",
        "operationId": "Payment_createOrganisationPaymentConfig",
        "x-flow-permission": "payment:write",
        "parameters": [
          {
            "name": "payrollConfigId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The pay schedule (payroll configuration) the settings are for.",
            "example": "org-payroll-123"
          },
          {
            "$ref": "#/components/parameters/Payment_Request-Id"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Payment_CreatePaymentConfigRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Payment configuration created.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Payment_ResponseBody"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "content": {
                          "type": "object",
                          "properties": {
                            "data": {
                              "$ref": "#/components/schemas/Payment_PaymentConfigResponse"
                            },
                            "metadata": {
                              "$ref": "#/components/schemas/Payment_ContentMetadataResponse"
                            }
                          }
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request: the method and format are not available, or a field is invalid. An invalid file layout lists every problem in validationIssues, each with its field (fileLayout.columns[2].width) and a stable reasonToken (fileLayoutColumnNeedsWidth, ...).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Payment_ResponseBody"
                }
              }
            }
          },
          "401": {
            "description": "The access token is missing, expired or not valid (token `invalid_token`). Get a new token and send the request again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Payment_ResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "The caller lacks the permission in x-flow-permission (token `insufficient_permissions`), or cannot reach the organisation (token `access_denied`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Payment_ResponseBody"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Payment_ResponseBody"
                }
              }
            }
          },
          "503": {
            "description": "Access could not be checked just now. Retry after the seconds in Retry-After.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Payment_ResponseBody"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "Payment · OrganisationPaymentConfig"
        ],
        "summary": "Delete payment configuration for an organisation",
        "description": "Needs permission payment:write.",
        "operationId": "Payment_deleteOrganisationPaymentConfig",
        "x-flow-permission": "payment:write",
        "parameters": [
          {
            "name": "payrollConfigId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The pay schedule (payroll configuration) the settings are for.",
            "example": "org-payroll-123"
          },
          {
            "$ref": "#/components/parameters/Payment_Request-Id"
          }
        ],
        "responses": {
          "200": {
            "description": "Payment configuration deleted.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Payment_ResponseBody"
                }
              }
            }
          },
          "401": {
            "description": "The access token is missing, expired or not valid (token `invalid_token`). Get a new token and send the request again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Payment_ResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "The caller lacks the permission in x-flow-permission (token `insufficient_permissions`), or cannot reach the organisation (token `access_denied`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Payment_ResponseBody"
                }
              }
            }
          },
          "404": {
            "description": "The pay schedule has no payment configuration.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Payment_ResponseBody"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Payment_ResponseBody"
                }
              }
            }
          },
          "503": {
            "description": "Access could not be checked just now. Retry after the seconds in Retry-After.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Payment_ResponseBody"
                }
              }
            }
          }
        }
      }
    },
    "/v1/payment/file/run/{payrollConfigId}/year/{year}/frequency/{frequency}/period/{period}": {
      "get": {
        "tags": [
          "Payment · PaymentFile"
        ],
        "summary": "Get payment file for a pay run",
        "description": "Needs permission payment:export.",
        "operationId": "Payment_getPaymentFileForPayRun",
        "x-flow-permission": "payment:export",
        "parameters": [
          {
            "name": "payrollConfigId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The pay schedule (payroll configuration) the pay run belongs to.",
            "example": "01KMKX9ZBHS65ZWGV2266K0S8K"
          },
          {
            "name": "year",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            },
            "description": "The tax year the pay run is in, by the year it starts (2025 is 2025/26).",
            "example": 2025
          },
          {
            "name": "frequency",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "How often the pay schedule pays, as it is named on the pay run (for example Weekly or Monthly).",
            "example": "Weekly"
          },
          {
            "name": "period",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            },
            "description": "The pay period number within the tax year.",
            "example": 25
          },
          {
            "$ref": "#/components/parameters/Payment_Request-Id"
          }
        ],
        "responses": {
          "200": {
            "description": "Payment file retrieved successfully. The body always carries a `PaymentFileResponse`\nwhose `status` field is the canonical outcome: GENERATED, PARTIAL_SUCCESS, FAILED, RETRYING, REBUILDING, GENERATING, SUBMITTED or QUEUED.\nClients branch on `status`; do not infer state from the HTTP code. `file` is non-null when a downloadable\nfile exists (GENERATED, SUBMITTED, PARTIAL_SUCCESS); `failure` is non-null when employees were not included\n(FAILED, PARTIAL_SUCCESS).",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Payment_ResponseBody"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "content": {
                          "type": "object",
                          "properties": {
                            "data": {
                              "$ref": "#/components/schemas/Payment_PaymentFileResponse"
                            },
                            "metadata": {
                              "$ref": "#/components/schemas/Payment_ContentMetadataResponse"
                            }
                          }
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "The access token is missing, expired or not valid (token `invalid_token`). Get a new token and send the request again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Payment_ResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "The caller lacks the permission in x-flow-permission (token `insufficient_permissions`), or cannot reach the organisation (token `access_denied`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Payment_ResponseBody"
                }
              }
            }
          },
          "404": {
            "description": "No payment file exists for this pay run.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Payment_ResponseBody"
                }
              }
            }
          },
          "500": {
            "description": "Something went wrong on our side. The pay run's own outcome is never reported as a 5xx: it is\nthe 200 body's `status`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Payment_ResponseBody"
                }
              }
            }
          },
          "503": {
            "description": "Access could not be checked just now. Retry after the seconds in Retry-After.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Payment_ResponseBody"
                }
              }
            }
          }
        }
      }
    },
    "/v1/payment/file/run/{payrollConfigId}/year/{year}/frequency/{frequency}/period/{period}/generate": {
      "post": {
        "tags": [
          "Payment · PaymentFile"
        ],
        "summary": "Create the payment file of a locked pay run that has none",
        "description": "Needs permission payment:export.\n\nFor a pay run that locked before its pay schedule had payment settings, so no payment file was produced. Once\nthe settings exist, this builds the file from the payments stored when the pay run locked, with those settings,\nwithout unlocking the pay run. The build runs in the background: `status` is GENERATING until it ends\nGENERATED, PARTIAL_SUCCESS or FAILED, and the outcome is announced as a payment file event with trigger\n`generate`. A pay run that already has a payment file is rebuilt or retried instead.",
        "operationId": "Payment_generatePaymentFile",
        "x-flow-permission": "payment:export",
        "parameters": [
          {
            "name": "payrollConfigId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The pay schedule (payroll configuration) the pay run belongs to.",
            "example": "01KMKX9ZBHS65ZWGV2266K0S8K"
          },
          {
            "name": "year",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            },
            "description": "The tax year the pay run is in, by the year it starts (2025 is 2025/26).",
            "example": 2025
          },
          {
            "name": "frequency",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "How often the pay schedule pays, as it is named on the pay run (for example Weekly or Monthly).",
            "example": "Weekly"
          },
          {
            "name": "period",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            },
            "description": "The pay period number within the tax year.",
            "example": 25
          },
          {
            "$ref": "#/components/parameters/Payment_Request-Id"
          }
        ],
        "responses": {
          "202": {
            "description": "The file is being created; the payment file is GENERATING.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Payment_ResponseBody"
                }
              }
            }
          },
          "401": {
            "description": "The access token is missing, expired or not valid (token `invalid_token`). Get a new token and send the request again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Payment_ResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "The caller lacks the permission in x-flow-permission (token `insufficient_permissions`), or cannot reach the organisation (token `access_denied`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Payment_ResponseBody"
                }
              }
            }
          },
          "404": {
            "description": "The pay run does not exist.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Payment_ResponseBody"
                }
              }
            }
          },
          "409": {
            "description": "The file cannot be created: the pay run already has one, is not locked, was locked again\nafter a correction, has no payments stored, or the payment settings are missing or incomplete. The message says\nwhich.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Payment_ResponseBody"
                }
              }
            }
          },
          "500": {
            "description": "Something went wrong on our side.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Payment_ResponseBody"
                }
              }
            }
          },
          "503": {
            "description": "Access could not be checked just now. Retry after the seconds in Retry-After.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Payment_ResponseBody"
                }
              }
            }
          }
        }
      }
    },
    "/v1/payment/file/run/{payrollConfigId}/year/{year}/frequency/{frequency}/period/{period}/history": {
      "get": {
        "tags": [
          "Payment · PaymentFile"
        ],
        "summary": "Get the payment file history of a pay run",
        "description": "Needs permission payment:export.\n\nEvery issue of the pay run's payment file, one entry per lock cycle, newest first. A pay run that was never\nunlocked has one entry. Nothing a lock produced is ever removed from the list: unlocking the pay run stamps the\nentry of the cycle it reopened (`unlock`), and locking it again adds the next cycle's entry and marks the\nearlier one `superseded`. Each entry carries its own signed download link, so the file that may have gone\nto the bank can be read beside the file the re-lock produced; a re-lock's entry also carries the\n`supplementary` file produced beside it, with its own link and the overpayments it found. A cycle whose\nfile is no longer stored keeps its entry with no `file`: history is read, never regenerated.",
        "operationId": "Payment_getPaymentFileHistoryForPayRun",
        "x-flow-permission": "payment:export",
        "parameters": [
          {
            "name": "payrollConfigId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The pay schedule (payroll configuration) the pay run belongs to.",
            "example": "01KMKX9ZBHS65ZWGV2266K0S8K"
          },
          {
            "name": "year",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            },
            "description": "The tax year the pay run is in, by the year it starts (2025 is 2025/26).",
            "example": 2025
          },
          {
            "name": "frequency",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "How often the pay schedule pays, as it is named on the pay run (for example Weekly or Monthly).",
            "example": "Weekly"
          },
          {
            "name": "period",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            },
            "description": "The pay period number within the tax year.",
            "example": 25
          },
          {
            "$ref": "#/components/parameters/Payment_Request-Id"
          }
        ],
        "responses": {
          "200": {
            "description": "The history, newest cycle first. `currentLockCycle` is the cycle the payment file\nresource is on; each entry's `file` is null when that cycle produced no file or its file is no longer\nstored.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Payment_ResponseBody"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "content": {
                          "type": "object",
                          "properties": {
                            "data": {
                              "$ref": "#/components/schemas/Payment_PaymentFileHistoryResponse"
                            },
                            "metadata": {
                              "$ref": "#/components/schemas/Payment_ContentMetadataResponse"
                            }
                          }
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "The access token is missing, expired or not valid (token `invalid_token`). Get a new token and send the request again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Payment_ResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "The caller lacks the permission in x-flow-permission (token `insufficient_permissions`), or cannot reach the organisation (token `access_denied`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Payment_ResponseBody"
                }
              }
            }
          },
          "404": {
            "description": "No payment file exists for this pay run.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Payment_ResponseBody"
                }
              }
            }
          },
          "500": {
            "description": "Something went wrong on our side.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Payment_ResponseBody"
                }
              }
            }
          },
          "503": {
            "description": "Access could not be checked just now. Retry after the seconds in Retry-After.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Payment_ResponseBody"
                }
              }
            }
          }
        }
      }
    },
    "/v1/payment/file/run/{payrollConfigId}/year/{year}/frequency/{frequency}/period/{period}/rebuild": {
      "post": {
        "tags": [
          "Payment · PaymentFile"
        ],
        "summary": "Rebuild a pay run's payment file with the current payment settings",
        "description": "Needs permission payment:export.\n\nBuilds the pay run's payment file again from the payments stored when it was locked, with the payment settings\nas they are now: use it after changing the bank or the file type (txt or csv) for a pay run that is already\nlocked. The payments are the same; only the file changes. The file it replaces is never deleted: it stays\ndownloadable from the history's `replacedFiles`. The rebuild runs in the background: `status` is\nREBUILDING until it ends GENERATED, PARTIAL_SUCCESS or FAILED, and the outcome is announced as a payment file\nevent with trigger `rebuild`. If the earlier file was already sent to the bank, do not send this one too.",
        "operationId": "Payment_rebuildPaymentFile",
        "x-flow-permission": "payment:export",
        "parameters": [
          {
            "name": "payrollConfigId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The pay schedule (payroll configuration) the pay run belongs to.",
            "example": "01KMKX9ZBHS65ZWGV2266K0S8K"
          },
          {
            "name": "year",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            },
            "description": "The tax year the pay run is in, by the year it starts (2025 is 2025/26).",
            "example": 2025
          },
          {
            "name": "frequency",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "How often the pay schedule pays, as it is named on the pay run (for example Weekly or Monthly).",
            "example": "Weekly"
          },
          {
            "name": "period",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            },
            "description": "The pay period number within the tax year.",
            "example": 25
          },
          {
            "$ref": "#/components/parameters/Payment_Request-Id"
          }
        ],
        "responses": {
          "202": {
            "description": "The rebuild has been queued; the payment file is REBUILDING.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Payment_ResponseBody"
                }
              }
            }
          },
          "401": {
            "description": "The access token is missing, expired or not valid (token `invalid_token`). Get a new token and send the request again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Payment_ResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "The caller lacks the permission in x-flow-permission (token `insufficient_permissions`), or cannot reach the organisation (token `access_denied`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Payment_ResponseBody"
                }
              }
            }
          },
          "404": {
            "description": "No payment file exists for this pay run.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Payment_ResponseBody"
                }
              }
            }
          },
          "409": {
            "description": "The file cannot be rebuilt now: a retry or a rebuild is already running, the pay run is\nreopened for a correction (its next lock builds the file), it has no generated file (only GENERATED and\nPARTIAL_SUCCESS can be rebuilt), it was already built with the current payment settings, or those settings are\nmissing or incomplete. The message says which.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Payment_ResponseBody"
                }
              }
            }
          },
          "500": {
            "description": "Something went wrong on our side.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Payment_ResponseBody"
                }
              }
            }
          },
          "503": {
            "description": "Access could not be checked just now. Retry after the seconds in Retry-After.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Payment_ResponseBody"
                }
              }
            }
          }
        }
      }
    },
    "/v1/payment/file/run/{payrollConfigId}/year/{year}/frequency/{frequency}/period/{period}/retry": {
      "post": {
        "tags": [
          "Payment · PaymentFile"
        ],
        "summary": "Retry failed payment file generation with refreshed employee data",
        "description": "Needs permission payment:export.",
        "operationId": "Payment_retryPaymentFile",
        "x-flow-permission": "payment:export",
        "parameters": [
          {
            "name": "payrollConfigId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The pay schedule (payroll configuration) the pay run belongs to.",
            "example": "01KMKX9ZBHS65ZWGV2266K0S8K"
          },
          {
            "name": "year",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            },
            "description": "The tax year the pay run is in, by the year it starts (2025 is 2025/26).",
            "example": 2025
          },
          {
            "name": "frequency",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "How often the pay schedule pays, as it is named on the pay run (for example Weekly or Monthly).",
            "example": "Weekly"
          },
          {
            "name": "period",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            },
            "description": "The pay period number within the tax year.",
            "example": 25
          },
          {
            "$ref": "#/components/parameters/Payment_Request-Id"
          }
        ],
        "responses": {
          "202": {
            "description": "Retry has been queued.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Payment_ResponseBody"
                }
              }
            }
          },
          "400": {
            "description": "Payment file is not in a retryable state (must be FAILED or PARTIAL_SUCCESS).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Payment_ResponseBody"
                }
              }
            }
          },
          "401": {
            "description": "The access token is missing, expired or not valid (token `invalid_token`). Get a new token and send the request again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Payment_ResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "The caller lacks the permission in x-flow-permission (token `insufficient_permissions`), or cannot reach the organisation (token `access_denied`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Payment_ResponseBody"
                }
              }
            }
          },
          "404": {
            "description": "Payment file not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Payment_ResponseBody"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Payment_ResponseBody"
                }
              }
            }
          },
          "503": {
            "description": "Access could not be checked just now. Retry after the seconds in Retry-After.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Payment_ResponseBody"
                }
              }
            }
          }
        }
      }
    },
    "/v1/journal/templates/{templateId}/control-account-mappings/{account}": {
      "put": {
        "tags": [
          "Payroll journals · Control account mappings"
        ],
        "summary": "Create or update a control account mapping",
        "description": "Needs permission journal:write.\n\nMap a control account (net pay, PAYE, NI, pension and other liabilities) to a nominal code on a template.",
        "operationId": "Journal_PutControlAccountMapping",
        "parameters": [
          {
            "name": "templateId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "account",
            "in": "path",
            "description": "The control account kind, matched case-insensitively. Any other value — including withdrawn kinds such as StatutoryRecoverySsp (removed 2026-08-07: SSP is not recoverable) — is rejected with a 400 envelope.",
            "required": true,
            "schema": {
              "enum": [
                "Paye",
                "EeNi",
                "ErNi",
                "ErNiClass1A",
                "EePensionTotal",
                "EePensionNetPayArrangement",
                "EePensionReliefAtSource",
                "EePensionSalarySacrifice",
                "ErPension",
                "StudentLoan",
                "PostgraduateLoan",
                "NetPay",
                "StatutoryRecoverySmp",
                "StatutoryRecoverySpp",
                "StatutoryRecoveryShpp",
                "StatutoryRecoverySap",
                "StatutoryRecoverySpbp",
                "StatutoryRecoverySncp",
                "StatutoryRecoveryCompensation",
                "ApprenticeshipLevy",
                "EmploymentAllowance",
                "CourtOrderAdminFee",
                "ApprenticeshipLevyAllowance"
              ],
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Journal_PutControlAccountMappingRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Journal_ControlAccountMappingResponseResponseBody"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Journal_ObjectResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Journal_ApiErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Journal_ObjectResponseBody"
                }
              }
            }
          }
        },
        "x-flow-permission": "journal:write"
      },
      "get": {
        "tags": [
          "Payroll journals · Control account mappings"
        ],
        "summary": "Get a control account mapping",
        "description": "Needs permission journal:read.\n\nRetrieve a single control account mapping from a template.",
        "operationId": "Journal_GetControlAccountMapping",
        "parameters": [
          {
            "name": "templateId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "account",
            "in": "path",
            "description": "The control account kind, matched case-insensitively. Any other value — including withdrawn kinds such as StatutoryRecoverySsp (removed 2026-08-07: SSP is not recoverable) — is rejected with a 400 envelope.",
            "required": true,
            "schema": {
              "enum": [
                "Paye",
                "EeNi",
                "ErNi",
                "ErNiClass1A",
                "EePensionTotal",
                "EePensionNetPayArrangement",
                "EePensionReliefAtSource",
                "EePensionSalarySacrifice",
                "ErPension",
                "StudentLoan",
                "PostgraduateLoan",
                "NetPay",
                "StatutoryRecoverySmp",
                "StatutoryRecoverySpp",
                "StatutoryRecoveryShpp",
                "StatutoryRecoverySap",
                "StatutoryRecoverySpbp",
                "StatutoryRecoverySncp",
                "StatutoryRecoveryCompensation",
                "ApprenticeshipLevy",
                "EmploymentAllowance",
                "CourtOrderAdminFee",
                "ApprenticeshipLevyAllowance"
              ],
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Journal_ControlAccountMappingResponseResponseBody"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Journal_ObjectResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Journal_ApiErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Journal_ObjectResponseBody"
                }
              }
            }
          }
        },
        "x-flow-permission": "journal:read"
      },
      "delete": {
        "tags": [
          "Payroll journals · Control account mappings"
        ],
        "summary": "Delete a control account mapping",
        "description": "Needs permission journal:write.\n\nRemove a control account mapping from a template.",
        "operationId": "Journal_DeleteControlAccountMapping",
        "parameters": [
          {
            "name": "templateId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "account",
            "in": "path",
            "description": "The control account kind, matched case-insensitively. Any other value — including withdrawn kinds such as StatutoryRecoverySsp (removed 2026-08-07: SSP is not recoverable) — is rejected with a 400 envelope.",
            "required": true,
            "schema": {
              "enum": [
                "Paye",
                "EeNi",
                "ErNi",
                "ErNiClass1A",
                "EePensionTotal",
                "EePensionNetPayArrangement",
                "EePensionReliefAtSource",
                "EePensionSalarySacrifice",
                "ErPension",
                "StudentLoan",
                "PostgraduateLoan",
                "NetPay",
                "StatutoryRecoverySmp",
                "StatutoryRecoverySpp",
                "StatutoryRecoveryShpp",
                "StatutoryRecoverySap",
                "StatutoryRecoverySpbp",
                "StatutoryRecoverySncp",
                "StatutoryRecoveryCompensation",
                "ApprenticeshipLevy",
                "EmploymentAllowance",
                "CourtOrderAdminFee",
                "ApprenticeshipLevyAllowance"
              ],
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Journal_ObjectResponseBody"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Journal_ObjectResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Journal_ApiErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Journal_ObjectResponseBody"
                }
              }
            }
          }
        },
        "x-flow-permission": "journal:write"
      }
    },
    "/v1/journal/templates/{templateId}/control-account-mappings": {
      "get": {
        "tags": [
          "Payroll journals · Control account mappings"
        ],
        "summary": "List control account mappings",
        "description": "Needs permission journal:read.\n\nList the control account mappings configured on a template.",
        "operationId": "Journal_ListControlAccountMappings",
        "parameters": [
          {
            "name": "templateId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Journal_ControlAccountMappingResponseListResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Journal_ApiErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Journal_ObjectResponseBody"
                }
              }
            }
          }
        },
        "x-flow-permission": "journal:read"
      }
    },
    "/v1/journal/export-options/date-format-presets": {
      "get": {
        "tags": [
          "Payroll journals · Journal export metadata"
        ],
        "summary": "List date-format presets",
        "description": "Needs permission journal:read.\n\nList the available date-format presets for journal exports.",
        "operationId": "Journal_GetJournalDateFormatPresets",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Journal_JournalDateFormatPresetListResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Journal_ApiErrorResponse"
                }
              }
            }
          }
        },
        "x-flow-permission": "journal:read"
      }
    },
    "/v1/journal/export-options/narration-tokens": {
      "get": {
        "tags": [
          "Payroll journals · Journal export metadata"
        ],
        "summary": "List narration tokens",
        "description": "Needs permission journal:read.\n\nList the tokens available for composing journal narration.",
        "operationId": "Journal_GetJournalNarrationTokens",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Journal_JournalNarrationTokenListResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Journal_ApiErrorResponse"
                }
              }
            }
          }
        },
        "x-flow-permission": "journal:read"
      }
    },
    "/v1/journal/export-options/reference-tokens": {
      "get": {
        "tags": [
          "Payroll journals · Journal export metadata"
        ],
        "summary": "List reference tokens",
        "description": "Needs permission journal:read.\n\nList the tokens available for composing journal references.",
        "operationId": "Journal_GetJournalReferenceTokens",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Journal_JournalNarrationTokenListResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Journal_ApiErrorResponse"
                }
              }
            }
          }
        },
        "x-flow-permission": "journal:read"
      }
    },
    "/v1/journal/export-options/presets": {
      "get": {
        "tags": [
          "Payroll journals · Journal export metadata"
        ],
        "summary": "List export presets",
        "description": "Needs permission journal:read.\n\nList the available export-format presets for building templates.",
        "operationId": "Journal_GetJournalExportPresets",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Journal_JournalPresetListResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Journal_ApiErrorResponse"
                }
              }
            }
          }
        },
        "x-flow-permission": "journal:read"
      }
    },
    "/v1/journal/export-options/split-sources": {
      "get": {
        "tags": [
          "Payroll journals · Journal export metadata"
        ],
        "summary": "List split sources and their known values",
        "description": "Needs permission journal:read.\n\nList the sources a split level can read from, with the value keys each one resolves to where that set is known in advance (e.g. director status). An empty value list means the values come from the organisation's own data, so any value may be mapped.",
        "operationId": "Journal_GetJournalSplitSources",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Journal_SplitSourceMetadataListResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Journal_ApiErrorResponse"
                }
              }
            }
          }
        },
        "x-flow-permission": "journal:read"
      }
    },
    "/v1/journal/export-options/formats": {
      "get": {
        "tags": [
          "Payroll journals · Journal export metadata"
        ],
        "summary": "List export formats",
        "description": "Needs permission journal:read.\n\nList the export destinations a journal can be rendered as (generic CSV, Xero manual journal, PDF), for format pickers and inline previews.",
        "operationId": "Journal_GetJournalExportFormats",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Journal_JournalExportFormatListResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Journal_ApiErrorResponse"
                }
              }
            }
          }
        },
        "x-flow-permission": "journal:read"
      }
    },
    "/v1/journal/export-options/account-code-separators": {
      "get": {
        "tags": [
          "Payroll journals · Journal export metadata"
        ],
        "summary": "List account-code separators",
        "description": "Needs permission journal:read.\n\nList the separators available when composing account codes.",
        "operationId": "Journal_GetJournalAccountCodeSeparators",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Journal_JournalAccountCodeSeparatorListResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Journal_ApiErrorResponse"
                }
              }
            }
          }
        },
        "x-flow-permission": "journal:read"
      }
    },
    "/v1/journal/templates": {
      "post": {
        "tags": [
          "Payroll journals · Journal templates"
        ],
        "summary": "Create a journal template",
        "description": "Needs permission journal:write.\n\nCreate a journal template defining how a pay run becomes an accounting journal.",
        "operationId": "Journal_CreateJournalTemplate",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Journal_CreateJournalTemplateRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Journal_JournalTemplateResponseResponseBody"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Journal_ObjectResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Journal_ApiErrorResponse"
                }
              }
            }
          }
        },
        "x-flow-permission": "journal:write"
      },
      "get": {
        "tags": [
          "Payroll journals · Journal templates"
        ],
        "summary": "List journal templates",
        "description": "Needs permission journal:read.\n\nList the journal templates configured for an organisation.",
        "operationId": "Journal_ListJournalTemplates",
        "parameters": [
          {
            "name": "pageSize",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "paginationToken",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Journal_JournalTemplateResponseListResponseBody"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Journal_ObjectResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Journal_ApiErrorResponse"
                }
              }
            }
          }
        },
        "x-flow-permission": "journal:read"
      }
    },
    "/v1/journal/templates/{templateId}": {
      "get": {
        "tags": [
          "Payroll journals · Journal templates"
        ],
        "summary": "Get a journal template",
        "description": "Needs permission journal:read.\n\nRetrieve a single journal template by its ID.",
        "operationId": "Journal_GetJournalTemplate",
        "parameters": [
          {
            "name": "templateId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Journal_JournalTemplateResponseResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Journal_ApiErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Journal_ObjectResponseBody"
                }
              }
            }
          }
        },
        "x-flow-permission": "journal:read"
      },
      "patch": {
        "tags": [
          "Payroll journals · Journal templates"
        ],
        "summary": "Update a journal template",
        "description": "Needs permission journal:write.\n\nUpdate the settings of an existing journal template.",
        "operationId": "Journal_PatchJournalTemplate",
        "parameters": [
          {
            "name": "templateId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Journal_UpdateJournalTemplateRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Journal_JournalTemplateResponseResponseBody"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Journal_ObjectResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Journal_ApiErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Journal_ObjectResponseBody"
                }
              }
            }
          }
        },
        "x-flow-permission": "journal:write"
      },
      "delete": {
        "tags": [
          "Payroll journals · Journal templates"
        ],
        "summary": "Delete a journal template",
        "description": "Needs permission journal:write.\n\nDelete a journal template.",
        "operationId": "Journal_DeleteJournalTemplate",
        "parameters": [
          {
            "name": "templateId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Journal_ObjectResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Journal_ApiErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Journal_ObjectResponseBody"
                }
              }
            }
          }
        },
        "x-flow-permission": "journal:write"
      }
    },
    "/v1/journal/templates/{templateId}/preview": {
      "post": {
        "tags": [
          "Payroll journals · Journal templates"
        ],
        "summary": "Preview a journal template",
        "description": "Needs permission journal:read.\n\nPreview the journal a template would produce for a pay run, as structured data.",
        "operationId": "Journal_PreviewJournalTemplate",
        "parameters": [
          {
            "name": "templateId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Journal_JournalDetailResponseResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Journal_ApiErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Journal_ObjectResponseBody"
                }
              }
            }
          }
        },
        "x-flow-permission": "journal:read"
      }
    },
    "/v1/journal/templates/{templateId}/clone": {
      "post": {
        "tags": [
          "Payroll journals · Journal templates"
        ],
        "summary": "Clone a journal template",
        "description": "Needs permission journal:write.\n\nCreate a copy of an existing journal template, including its mappings.",
        "operationId": "Journal_CloneJournalTemplate",
        "parameters": [
          {
            "name": "templateId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Journal_CloneJournalTemplateRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Journal_JournalTemplateResponseResponseBody"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Journal_ObjectResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Journal_ApiErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Journal_ObjectResponseBody"
                }
              }
            }
          }
        },
        "x-flow-permission": "journal:write"
      }
    },
    "/v1/journal/templates/{templateId}/export": {
      "get": {
        "tags": [
          "Payroll journals · Journal templates"
        ],
        "summary": "Export a journal template",
        "description": "Needs permission journal:read.\n\nExport a template's definition so it can be imported into another organisation.",
        "operationId": "Journal_ExportJournalTemplate",
        "parameters": [
          {
            "name": "templateId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Journal_JournalTemplatePackageResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Journal_ApiErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Journal_ObjectResponseBody"
                }
              }
            }
          }
        },
        "x-flow-permission": "journal:read"
      }
    },
    "/v1/journal/templates/import": {
      "post": {
        "tags": [
          "Payroll journals · Journal templates"
        ],
        "summary": "Import a journal template",
        "description": "Needs permission journal:write.\n\nCreate a journal template from a previously exported definition.",
        "operationId": "Journal_ImportJournalTemplate",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Journal_ImportJournalTemplateRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Journal_JournalTemplateResponseResponseBody"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Journal_ObjectResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Journal_ApiErrorResponse"
                }
              }
            }
          }
        },
        "x-flow-permission": "journal:write"
      }
    },
    "/v1/journal/templates/{templateId}/imports/mappings": {
      "post": {
        "tags": [
          "Payroll journals · Journal templates"
        ],
        "summary": "Import journal template mappings",
        "description": "Needs permission journal:write.\n\nBulk-import pay element and control account mappings into a template.",
        "operationId": "Journal_ImportJournalTemplateMappings",
        "parameters": [
          {
            "name": "templateId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Journal_ImportJournalTemplateMappingsRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Journal_ImportJournalTemplateMappingsResponseResponseBody"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Journal_ObjectResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Journal_ApiErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Journal_ObjectResponseBody"
                }
              }
            }
          }
        },
        "x-flow-permission": "journal:write"
      }
    },
    "/v1/journal/templates/{templateId}/history": {
      "get": {
        "tags": [
          "Payroll journals · Journal templates"
        ],
        "summary": "Get a journal template's history",
        "description": "Needs permission journal:read.\n\nReturn the change history for a journal template.",
        "operationId": "Journal_GetJournalTemplateHistory",
        "parameters": [
          {
            "name": "templateId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Journal_JournalTemplateAuditResponseListResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Journal_ApiErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Journal_ObjectResponseBody"
                }
              }
            }
          }
        },
        "x-flow-permission": "journal:read"
      }
    },
    "/v1/journal/templates/{templateId}/preview/exports/csv": {
      "post": {
        "tags": [
          "Payroll journals · Journal templates"
        ],
        "summary": "Preview a journal template as CSV",
        "description": "Needs permission journal:read.\n\nRender the CSV export a template would produce for a pay run. Optional `format` selects the destination shape (generic-csv, xero-csv); defaults to generic-csv.",
        "operationId": "Journal_PreviewJournalTemplateCsv",
        "parameters": [
          {
            "name": "templateId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "format",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/csv": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Journal_ObjectResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Journal_ApiErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Journal_ObjectResponseBody"
                }
              }
            }
          }
        },
        "x-flow-permission": "journal:read"
      }
    },
    "/v1/journal/templates/{templateId}/preview/exports/pdf": {
      "post": {
        "tags": [
          "Payroll journals · Journal templates"
        ],
        "summary": "Preview a journal template as PDF",
        "description": "Needs permission journal:read.\n\nRender the PDF export a template would produce for a pay run.",
        "operationId": "Journal_PreviewJournalTemplatePdf",
        "parameters": [
          {
            "name": "templateId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/pdf": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Journal_ApiErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Journal_ObjectResponseBody"
                }
              }
            }
          }
        },
        "x-flow-permission": "journal:read"
      }
    },
    "/v1/journal/journals": {
      "get": {
        "tags": [
          "Payroll journals · Journals"
        ],
        "summary": "List journals",
        "description": "Needs permission journal:read.\n\nList an organisation's journals, or filter to a single pay run with payrollConfigId, taxYear and taxPeriod.",
        "operationId": "Journal_ListJournals",
        "parameters": [
          {
            "name": "pageSize",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "paginationToken",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "payrollConfigId",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "taxYear",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "taxPeriod",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Journal_JournalResponseListResponseBody"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Journal_ObjectResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Journal_ApiErrorResponse"
                }
              }
            }
          }
        },
        "x-flow-permission": "journal:read"
      }
    },
    "/v1/journal/journals/latest": {
      "get": {
        "tags": [
          "Payroll journals · Journals"
        ],
        "summary": "Get the latest journal for a pay run",
        "description": "Needs permission journal:read.\n\nReturn the most recent journal version for a pay run, or an empty result if none has been generated yet.",
        "operationId": "Journal_GetLatestJournalForPayRun",
        "parameters": [
          {
            "name": "payrollConfigId",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "taxYear",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "taxPeriod",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Journal_JournalResponseResponseBody"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Journal_ObjectResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Journal_ApiErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Journal_ObjectResponseBody"
                }
              }
            }
          }
        },
        "x-flow-permission": "journal:read"
      }
    },
    "/v1/journal/journals/versions": {
      "get": {
        "tags": [
          "Payroll journals · Journals"
        ],
        "summary": "List journal versions for a pay run",
        "description": "Needs permission journal:read.\n\nList every journal version generated for a pay run, newest first.",
        "operationId": "Journal_ListJournalVersionsForPayRun",
        "parameters": [
          {
            "name": "payrollConfigId",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "taxYear",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "taxPeriod",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Journal_JournalResponseListResponseBody"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Journal_ObjectResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Journal_ApiErrorResponse"
                }
              }
            }
          }
        },
        "x-flow-permission": "journal:read"
      }
    },
    "/v1/journal/journals/{journalId}": {
      "get": {
        "tags": [
          "Payroll journals · Journals"
        ],
        "summary": "Get a journal",
        "description": "Needs permission journal:read.\n\nRetrieve a single journal by its ID. includeLines=false returns the header only (journal, reconciliation, summaries and warnings from the aggregate, no line list) for large journals; load lines from the lines endpoint. Defaults to including lines.",
        "operationId": "Journal_GetJournal",
        "parameters": [
          {
            "name": "journalId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "includeLines",
            "in": "query",
            "schema": {
              "type": "boolean"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Journal_JournalDetailResponseResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Journal_ApiErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Journal_ObjectResponseBody"
                }
              }
            }
          }
        },
        "x-flow-permission": "journal:read"
      }
    },
    "/v1/journal/journals/{journalId}/lines": {
      "get": {
        "tags": [
          "Payroll journals · Journals"
        ],
        "summary": "Get a page of a journal's lines",
        "description": "Needs permission journal:read.\n\nReturn one page of a journal's lines. Follow content.metadata.paginationToken to exhaustion to load every line; totals come from the header, never from a page.",
        "operationId": "Journal_GetJournalLines",
        "parameters": [
          {
            "name": "journalId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "pageSize",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "paginationToken",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Journal_JournalLineResponseListResponseBody"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Journal_ObjectResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Journal_ApiErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Journal_ObjectResponseBody"
                }
              }
            }
          }
        },
        "x-flow-permission": "journal:read"
      }
    },
    "/v1/journal/journals/{journalId}/exports/{format}": {
      "get": {
        "tags": [
          "Payroll journals · Journals"
        ],
        "summary": "Download a journal export",
        "description": "Needs permission journal:read.\n\nDownload a journal in the given format (pdf, generic-csv or xero-csv).",
        "operationId": "Journal_DownloadJournalExport",
        "parameters": [
          {
            "name": "journalId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "format",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Journal_ApiErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Journal_ObjectResponseBody"
                }
              }
            }
          }
        },
        "x-flow-permission": "journal:read"
      }
    },
    "/v1/journal/journals/{journalId}/exports/{format}/download-url": {
      "get": {
        "tags": [
          "Payroll journals · Journals"
        ],
        "summary": "Get a journal export download link",
        "description": "Needs permission journal:read.\n\nReturn a time-limited signed link to download a journal export in the given format. PDF is rejected with 400 for very large journals — use the CSV instead.",
        "operationId": "Journal_GetJournalDownloadUrl",
        "parameters": [
          {
            "name": "journalId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "format",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Journal_JournalDownloadResponseResponseBody"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Journal_ObjectResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Journal_ApiErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Journal_ObjectResponseBody"
                }
              }
            }
          }
        },
        "x-flow-permission": "journal:read"
      }
    },
    "/v1/journal/journals/rebuild": {
      "post": {
        "tags": [
          "Payroll journals · Journals"
        ],
        "summary": "Rebuild a journal for a pay run",
        "description": "Needs permission journal:write.\n\nRegenerate a pay run's journal from its latest payslips. For an open run this refreshes the draft; a locked journal must be re-issued instead.",
        "operationId": "Journal_RebuildJournalForPayRun",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Journal_RebuildJournalRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Journal_RebuildJournalResponseResponseBody"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Journal_ObjectResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Journal_ApiErrorResponse"
                }
              }
            }
          }
        },
        "x-flow-permission": "journal:write"
      }
    },
    "/v1/journal/journals/reissue": {
      "post": {
        "tags": [
          "Payroll journals · Journals"
        ],
        "summary": "Reissue a journal for a pay run (async)",
        "description": "Needs permission journal:write.\n\nSupersede a locked journal with a new version regenerated from the current template and the run's final payslips. Returns 202 immediately; the rebuild runs asynchronously and progress + the final result are pushed over the websocket (keyed by journalId). The previous version is kept as an audit record.",
        "operationId": "Journal_ReissueJournalForPayRun",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Journal_ReissueJournalRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "202": {
            "description": "Accepted",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Journal_ReissueJournalResponseResponseBody"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Journal_ObjectResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Journal_ApiErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Journal_ObjectResponseBody"
                }
              }
            }
          }
        },
        "x-flow-permission": "journal:write"
      }
    },
    "/v1/journal/journals/{journalId}/history": {
      "get": {
        "tags": [
          "Payroll journals · Journals"
        ],
        "summary": "Get a journal's history",
        "description": "Needs permission journal:read.\n\nReturn the audit history for a journal (rebuilds, re-issues and status changes).",
        "operationId": "Journal_GetJournalHistory",
        "parameters": [
          {
            "name": "journalId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Journal_JournalAuditResponseListResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Journal_ApiErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Journal_ObjectResponseBody"
                }
              }
            }
          }
        },
        "x-flow-permission": "journal:read"
      }
    },
    "/v1/journal/journals/{journalId}/reissue-progress": {
      "get": {
        "tags": [
          "Payroll journals · Journals"
        ],
        "summary": "Get a journal's rebuild/re-issue progress",
        "description": "Needs permission journal:read.\n\nCurrent progress of a rebuild or re-issue fan-out, for catching up after a missed websocket push (reload, reconnect, second tab). Reading also reconciles: a fan-out whose counter reached its target but was never locked is finalised here.",
        "operationId": "Journal_GetJournalReissueProgress",
        "parameters": [
          {
            "name": "journalId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Journal_JournalReissueProgressResponseResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Journal_ApiErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Journal_ObjectResponseBody"
                }
              }
            }
          }
        },
        "x-flow-permission": "journal:read"
      }
    },
    "/v1/journal/journals/{journalId}/postings": {
      "post": {
        "tags": [
          "Payroll journals · Journals"
        ],
        "summary": "Send a journal to your accounting system",
        "description": "Needs permission journal:write.\n\nSends this journal to the accounting system its template is linked to, as a draft entry. Returns 202: the send is tracked and its outcome appears on the journal's sends. Refused when the template is not linked to a connection, when that connection is not ready, or when a send for this journal is already under way.",
        "operationId": "Journal_PostJournalToAccountingSystem",
        "parameters": [
          {
            "name": "journalId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "202": {
            "description": "Accepted",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Journal_JournalPostingResponseResponseBody"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Journal_ObjectResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Journal_ApiErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Journal_ObjectResponseBody"
                }
              }
            }
          }
        },
        "x-flow-permission": "journal:write"
      },
      "get": {
        "tags": [
          "Payroll journals · Journals"
        ],
        "summary": "List this journal's sends",
        "description": "Needs permission journal:read.\n\nEvery attempt to send this journal to an accounting system, oldest first, with what came back.",
        "operationId": "Journal_ListJournalPostings",
        "parameters": [
          {
            "name": "journalId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Journal_JournalPostingListResponseResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Journal_ApiErrorResponse"
                }
              }
            }
          }
        },
        "x-flow-permission": "journal:read"
      }
    },
    "/v1/journal/org-journal-settings": {
      "get": {
        "tags": [
          "Payroll journals · Org journal settings"
        ],
        "summary": "Get organisation journal settings",
        "description": "Needs permission journal:read.\n\nRetrieve the organisation-level journal defaults.",
        "operationId": "Journal_GetOrgJournalSettings",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Journal_OrgJournalSettingsResponseResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Journal_ApiErrorResponse"
                }
              }
            }
          }
        },
        "x-flow-permission": "journal:read"
      },
      "put": {
        "tags": [
          "Payroll journals · Org journal settings"
        ],
        "summary": "Create or update organisation journal settings",
        "description": "Needs permission journal:write.\n\nCreate or update the organisation-level journal defaults.",
        "operationId": "Journal_UpsertOrgJournalSettings",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Journal_UpsertOrgJournalSettingsRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Journal_OrgJournalSettingsResponseResponseBody"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Journal_ObjectResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Journal_ApiErrorResponse"
                }
              }
            }
          }
        },
        "x-flow-permission": "journal:write"
      }
    },
    "/v1/journal/templates/{templateId}/pay-element-mappings/{payElementId}": {
      "put": {
        "tags": [
          "Payroll journals · Pay element mappings"
        ],
        "summary": "Create or update a pay element mapping",
        "description": "Needs permission journal:write.\n\nMap a pay element to the nominal code it posts to on a template.",
        "operationId": "Journal_PutPayElementMapping",
        "parameters": [
          {
            "name": "templateId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "payElementId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Journal_PutPayElementMappingRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Journal_PayElementMappingResponseResponseBody"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Journal_ObjectResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Journal_ApiErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Journal_ObjectResponseBody"
                }
              }
            }
          }
        },
        "x-flow-permission": "journal:write"
      },
      "get": {
        "tags": [
          "Payroll journals · Pay element mappings"
        ],
        "summary": "Get a pay element mapping",
        "description": "Needs permission journal:read.\n\nRetrieve a single pay element mapping from a template.",
        "operationId": "Journal_GetPayElementMapping",
        "parameters": [
          {
            "name": "templateId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "payElementId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Journal_PayElementMappingResponseResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Journal_ApiErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Journal_ObjectResponseBody"
                }
              }
            }
          }
        },
        "x-flow-permission": "journal:read"
      },
      "delete": {
        "tags": [
          "Payroll journals · Pay element mappings"
        ],
        "summary": "Delete a pay element mapping",
        "description": "Needs permission journal:write.\n\nRemove a pay element mapping from a template.",
        "operationId": "Journal_DeletePayElementMapping",
        "parameters": [
          {
            "name": "templateId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "payElementId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Journal_ObjectResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Journal_ApiErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Journal_ObjectResponseBody"
                }
              }
            }
          }
        },
        "x-flow-permission": "journal:write"
      }
    },
    "/v1/journal/templates/{templateId}/pay-element-mappings": {
      "get": {
        "tags": [
          "Payroll journals · Pay element mappings"
        ],
        "summary": "List pay element mappings",
        "description": "Needs permission journal:read.\n\nList the pay element mappings configured on a template.",
        "operationId": "Journal_ListPayElementMappings",
        "parameters": [
          {
            "name": "templateId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "includeSystemHandled",
            "in": "query",
            "schema": {
              "type": "boolean"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Journal_PayElementMappingResponseListResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Journal_ApiErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Journal_ObjectResponseBody"
                }
              }
            }
          }
        },
        "x-flow-permission": "journal:read"
      }
    },
    "/v1/journal/templates/{templateId}/split-dimensions": {
      "post": {
        "tags": [
          "Payroll journals · Split dimensions"
        ],
        "summary": "Create a split dimension",
        "description": "Needs permission journal:write.\n\nAdd an analysis dimension (for example department or cost centre) to a template.",
        "operationId": "Journal_CreateSplitDimension",
        "parameters": [
          {
            "name": "templateId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Journal_CreateSplitDimensionRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Journal_SplitDimensionResponseResponseBody"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Journal_ObjectResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Journal_ApiErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Journal_ObjectResponseBody"
                }
              }
            }
          }
        },
        "x-flow-permission": "journal:write"
      },
      "get": {
        "tags": [
          "Payroll journals · Split dimensions"
        ],
        "summary": "List split dimensions",
        "description": "Needs permission journal:read.\n\nList the split dimensions configured on a template.",
        "operationId": "Journal_ListSplitDimensions",
        "parameters": [
          {
            "name": "templateId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Journal_SplitDimensionResponseListResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Journal_ApiErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Journal_ObjectResponseBody"
                }
              }
            }
          }
        },
        "x-flow-permission": "journal:read"
      }
    },
    "/v1/journal/templates/{templateId}/split-dimensions/{sequence}": {
      "get": {
        "tags": [
          "Payroll journals · Split dimensions"
        ],
        "summary": "Get a split dimension",
        "description": "Needs permission journal:read.\n\nRetrieve a single split dimension by its sequence.",
        "operationId": "Journal_GetSplitDimension",
        "parameters": [
          {
            "name": "templateId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "sequence",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Journal_SplitDimensionResponseResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Journal_ApiErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Journal_ObjectResponseBody"
                }
              }
            }
          }
        },
        "x-flow-permission": "journal:read"
      },
      "patch": {
        "tags": [
          "Payroll journals · Split dimensions"
        ],
        "summary": "Update a split dimension",
        "description": "Needs permission journal:write.\n\nUpdate an existing split dimension on a template.",
        "operationId": "Journal_PatchSplitDimension",
        "parameters": [
          {
            "name": "templateId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "sequence",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Journal_UpdateSplitDimensionRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Journal_SplitDimensionResponseResponseBody"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Journal_ObjectResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Journal_ApiErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Journal_ObjectResponseBody"
                }
              }
            }
          }
        },
        "x-flow-permission": "journal:write"
      },
      "delete": {
        "tags": [
          "Payroll journals · Split dimensions"
        ],
        "summary": "Delete a split dimension",
        "description": "Needs permission journal:write.\n\nRemove a split dimension from a template.",
        "operationId": "Journal_DeleteSplitDimension",
        "parameters": [
          {
            "name": "templateId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "sequence",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Journal_ObjectResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Journal_ApiErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Journal_ObjectResponseBody"
                }
              }
            }
          }
        },
        "x-flow-permission": "journal:write"
      }
    },
    "/v1/journal/templates/{templateId}/split-dimensions/{sequence}/values/{splitValueKey}": {
      "put": {
        "tags": [
          "Payroll journals · Split value mappings"
        ],
        "summary": "Create or update a split value mapping",
        "description": "Needs permission journal:write.\n\nMap a split dimension value to its tracking code or account segment.",
        "operationId": "Journal_PutSplitValueMapping",
        "parameters": [
          {
            "name": "templateId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "sequence",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "splitValueKey",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Journal_PutSplitValueMappingRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Journal_SplitValueMappingResponseResponseBody"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Journal_ObjectResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Journal_ApiErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Journal_ObjectResponseBody"
                }
              }
            }
          }
        },
        "x-flow-permission": "journal:write"
      },
      "get": {
        "tags": [
          "Payroll journals · Split value mappings"
        ],
        "summary": "Get a split value mapping",
        "description": "Needs permission journal:read.\n\nRetrieve a single split value mapping.",
        "operationId": "Journal_GetSplitValueMapping",
        "parameters": [
          {
            "name": "templateId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "sequence",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "splitValueKey",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Journal_SplitValueMappingResponseResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Journal_ApiErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Journal_ObjectResponseBody"
                }
              }
            }
          }
        },
        "x-flow-permission": "journal:read"
      },
      "delete": {
        "tags": [
          "Payroll journals · Split value mappings"
        ],
        "summary": "Delete a split value mapping",
        "description": "Needs permission journal:write.\n\nRemove a value mapping from a split dimension.",
        "operationId": "Journal_DeleteSplitValueMapping",
        "parameters": [
          {
            "name": "templateId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "sequence",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "splitValueKey",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Journal_ObjectResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Journal_ApiErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Journal_ObjectResponseBody"
                }
              }
            }
          }
        },
        "x-flow-permission": "journal:write"
      }
    },
    "/v1/journal/templates/{templateId}/split-dimensions/{sequence}/values": {
      "get": {
        "tags": [
          "Payroll journals · Split value mappings"
        ],
        "summary": "List split value mappings",
        "description": "Needs permission journal:read.\n\nList the value mappings for a split dimension.",
        "operationId": "Journal_ListSplitValueMappings",
        "parameters": [
          {
            "name": "templateId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "sequence",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Journal_SplitValueMappingResponseListResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Journal_ApiErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Journal_ObjectResponseBody"
                }
              }
            }
          }
        },
        "x-flow-permission": "journal:read"
      }
    },
    "/v1/report/datasets": {
      "get": {
        "tags": [
          "Reports · Datasets"
        ],
        "summary": "List queryable datasets",
        "description": "Needs permission report:read.",
        "operationId": "Report_listDatasets",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Report_DatasetListResponse"
                }
              }
            }
          },
          "401": {
            "description": "No organisation context: the token is missing, invalid, expired, or grants no access to an organisation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Report_ServiceError"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Report_ApiErrorResponse"
                }
              }
            }
          }
        },
        "x-flow-permission": "report:read"
      }
    },
    "/v1/report/datasets/{name}": {
      "get": {
        "tags": [
          "Reports · Datasets"
        ],
        "summary": "Get a dataset's full field catalog",
        "description": "Needs permission report:read.",
        "operationId": "Report_getDataset",
        "parameters": [
          {
            "name": "name",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Report_Dataset"
                }
              }
            }
          },
          "401": {
            "description": "No organisation context: the token is missing, invalid, expired, or grants no access to an organisation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Report_ServiceError"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Report_ApiErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Report_ServiceError"
                }
              }
            }
          }
        },
        "x-flow-permission": "report:read"
      }
    },
    "/v1/report/exports": {
      "post": {
        "tags": [
          "Reports · Exports"
        ],
        "summary": "Queue an asynchronous CSV or JSONL export (row cap 5,000,000)",
        "description": "Needs permission report:export.",
        "operationId": "Report_createExport",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "allOf": [
                  {
                    "$ref": "#/components/schemas/Report_CreateExportRequest"
                  }
                ],
                "description": "Exactly one of definitionId (saved) or definition (inline)."
              }
            }
          },
          "required": true
        },
        "responses": {
          "202": {
            "description": "Accepted",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Report_ExportResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Report_ValidationErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "No organisation context: the token is missing, invalid, expired, or grants no access to an organisation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Report_ServiceError"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Report_ApiErrorResponse"
                }
              }
            }
          }
        },
        "x-flow-permission": "report:export"
      }
    },
    "/v1/report/exports/{id}": {
      "get": {
        "tags": [
          "Reports · Exports"
        ],
        "summary": "Export status; a download link when COMPLETED (12-hour expiry, refetch to re-issue)",
        "description": "Needs permission report:export.",
        "operationId": "Report_getExport",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Export id (ULID)",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Export id (ULID)"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Report_ExportResponse"
                }
              }
            }
          },
          "401": {
            "description": "No organisation context: the token is missing, invalid, expired, or grants no access to an organisation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Report_ServiceError"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Report_ApiErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Report_ServiceError"
                }
              }
            }
          }
        },
        "x-flow-permission": "report:export"
      }
    },
    "/v1/report/report-definitions": {
      "post": {
        "tags": [
          "Reports · Report definitions"
        ],
        "summary": "Save a report definition",
        "description": "Needs permission report:write.",
        "operationId": "Report_createReportDefinition",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "allOf": [
                  {
                    "$ref": "#/components/schemas/Report_SaveDefinitionRequest"
                  }
                ]
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Report_DefinitionResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Report_ValidationErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "No organisation context: the token is missing, invalid, expired, or grants no access to an organisation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Report_ServiceError"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Report_ApiErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Report_ServiceError"
                }
              }
            }
          }
        },
        "x-flow-permission": "report:write"
      },
      "get": {
        "tags": [
          "Reports · Report definitions"
        ],
        "summary": "List the organisation's saved report definitions",
        "description": "Needs permission report:read.",
        "operationId": "Report_listReportDefinitions",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Report_DefinitionListResponse"
                }
              }
            }
          },
          "401": {
            "description": "No organisation context: the token is missing, invalid, expired, or grants no access to an organisation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Report_ServiceError"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Report_ApiErrorResponse"
                }
              }
            }
          }
        },
        "x-flow-permission": "report:read"
      }
    },
    "/v1/report/report-definitions/{id}": {
      "get": {
        "tags": [
          "Reports · Report definitions"
        ],
        "summary": "Get a saved report definition",
        "description": "Needs permission report:read.",
        "operationId": "Report_getReportDefinition",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Report definition id (ULID)",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Report definition id (ULID)"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Report_DefinitionResponse"
                }
              }
            }
          },
          "401": {
            "description": "No organisation context: the token is missing, invalid, expired, or grants no access to an organisation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Report_ServiceError"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Report_ApiErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Report_ServiceError"
                }
              }
            }
          }
        },
        "x-flow-permission": "report:read"
      },
      "put": {
        "tags": [
          "Reports · Report definitions"
        ],
        "summary": "Replace a saved report definition",
        "description": "Needs permission report:write.",
        "operationId": "Report_updateReportDefinition",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Report definition id (ULID)",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Report definition id (ULID)"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "allOf": [
                  {
                    "$ref": "#/components/schemas/Report_SaveDefinitionRequest"
                  }
                ]
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Report_DefinitionResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Report_ValidationErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "No organisation context: the token is missing, invalid, expired, or grants no access to an organisation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Report_ServiceError"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Report_ApiErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Report_ServiceError"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Report_ServiceError"
                }
              }
            }
          }
        },
        "x-flow-permission": "report:write"
      },
      "delete": {
        "tags": [
          "Reports · Report definitions"
        ],
        "summary": "Delete a saved report definition (refuses while schedules reference it)",
        "description": "Needs permission report:write.",
        "operationId": "Report_deleteReportDefinition",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Report definition id (ULID)",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Report definition id (ULID)"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No Content"
          },
          "401": {
            "description": "No organisation context: the token is missing, invalid, expired, or grants no access to an organisation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Report_ServiceError"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Report_ApiErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Report_ServiceError"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Report_ServiceError"
                }
              }
            }
          }
        },
        "x-flow-permission": "report:write"
      }
    },
    "/v1/report/report-settings/pay-run": {
      "get": {
        "tags": [
          "Reports · report-settings"
        ],
        "summary": "The reports the pay run's Reports step shows",
        "description": "Needs permission report:read, or any of pay-run:read. Built-in and saved reports, in the order shown, for everyone in the organisation. Until someone chooses, every built-in report (isDefault).",
        "operationId": "Report_getPayRunReportSettings",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Report_PayRunReportSettings"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Report_ServiceError"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Report_ApiErrorResponse"
                }
              }
            }
          }
        },
        "x-flow-permission": "report:read",
        "x-flow-permission-also-accepts": [
          "pay-run:read"
        ]
      },
      "put": {
        "tags": [
          "Reports · report-settings"
        ],
        "summary": "Choose the reports the pay run's Reports step shows",
        "description": "Needs permission report:write. At most 30, each a built-in or saved report kept by pay run, each once, in the order shown.",
        "operationId": "Report_savePayRunReportSettings",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "allOf": [
                  {
                    "$ref": "#/components/schemas/Report_SavePayRunReportSettings"
                  }
                ],
                "description": "Choose the reports the pay run's Reports step shows, in order."
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Report_PayRunReportSettings"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Report_ValidationErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Report_ServiceError"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Report_ApiErrorResponse"
                }
              }
            }
          }
        },
        "x-flow-permission": "report:write"
      }
    },
    "/v1/report/reports/run": {
      "post": {
        "tags": [
          "Reports · Run reports"
        ],
        "summary": "Run an inline report definition synchronously",
        "description": "Needs permission report:read. Rows are capped at 10,000 and the truncated flag is set when the cap is hit. A definition that exceeds the synchronous time budget returns 408: narrow the filters or queue an export instead. Every run is recorded in the run history, which GET /runs returns.",
        "operationId": "Report_runReport",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "allOf": [
                  {
                    "$ref": "#/components/schemas/Report_ReportDefinition"
                  }
                ],
                "description": "The report-definition document: one contract drives sync runs, exports, saved\ndefinitions and schedules. select holds 1 to 50 entries."
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Report_RunReportResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Report_ValidationErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "No organisation context: the token is missing, invalid, expired, or grants no access to an organisation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Report_ServiceError"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Report_ApiErrorResponse"
                }
              }
            }
          },
          "408": {
            "description": "Request Timeout",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Report_ServiceError"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Report_ServiceError"
                }
              }
            }
          }
        },
        "x-flow-permission": "report:read"
      }
    },
    "/v1/report/report-definitions/{id}/run": {
      "post": {
        "tags": [
          "Reports · Run reports"
        ],
        "summary": "Run a saved report definition synchronously",
        "description": "Needs permission report:read.",
        "operationId": "Report_runReportDefinition",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Report definition id (ULID)",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Report definition id (ULID)"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Report_RunReportResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Report_ValidationErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "No organisation context: the token is missing, invalid, expired, or grants no access to an organisation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Report_ServiceError"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Report_ApiErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Report_ServiceError"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Report_ServiceError"
                }
              }
            }
          }
        },
        "x-flow-permission": "report:read"
      }
    },
    "/v1/report/payroll-runs/{payrollConfigId}/{year}/{period}/{frequency}/reports/{definitionId}/run": {
      "post": {
        "tags": [
          "Reports · Run reports"
        ],
        "summary": "Run a report over one pay run",
        "description": "Needs permission report:read, or any of pay-run:read. Runs a built-in or saved report over every payslip of the pay run (Preview, Final and Reopened), the run's keys added from the route, or over its pay schedule for a report that runs on one. A comparison report compares with compareYear/comparePeriod, else the previous pay run. A sensitive column the caller cannot read answers empty. Rows are capped at 10,000.",
        "operationId": "Report_runPayRunReport",
        "parameters": [
          {
            "name": "payrollConfigId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "year",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "period",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "frequency",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "compareYear",
            "in": "query",
            "description": "A comparison report compares with this year's pay run of the same pay schedule; with comparePeriod. Left out: the pay schedule's previous pay run.",
            "schema": {
              "type": "integer",
              "description": "A comparison report compares with this year's pay run of the same pay schedule; with comparePeriod. Left out: the pay schedule's previous pay run.",
              "format": "int32"
            }
          },
          {
            "name": "comparePeriod",
            "in": "query",
            "description": "The period of the pay run to compare with; with compareYear.",
            "schema": {
              "type": "integer",
              "description": "The period of the pay run to compare with; with compareYear.",
              "format": "int32"
            }
          },
          {
            "name": "definitionId",
            "in": "path",
            "description": "A built-in report (builtin.gross-to-net) or a saved one",
            "required": true,
            "schema": {
              "type": "string",
              "description": "A built-in report (builtin.gross-to-net) or a saved one"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Report_RunReportResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Report_ValidationErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Report_ServiceError"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Report_ApiErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Report_ServiceError"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Report_ServiceError"
                }
              }
            }
          }
        },
        "x-flow-permission": "report:read",
        "x-flow-permission-also-accepts": [
          "pay-run:read"
        ]
      }
    },
    "/v1/report/payroll-runs/{payrollConfigId}/{year}/{period}/{frequency}/reports/run": {
      "post": {
        "tags": [
          "Reports · Run reports"
        ],
        "summary": "Try a report on one pay run",
        "description": "Needs permission report:read. Runs an unsaved report definition over one pay run exactly as the pay run's Reports step would, for the report builder to show it before it is saved. Rows are capped at 10,000.",
        "operationId": "Report_tryPayRunReport",
        "parameters": [
          {
            "name": "payrollConfigId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "year",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "period",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "frequency",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "compareYear",
            "in": "query",
            "description": "A comparison report compares with this year's pay run of the same pay schedule; with comparePeriod. Left out: the pay schedule's previous pay run.",
            "schema": {
              "type": "integer",
              "description": "A comparison report compares with this year's pay run of the same pay schedule; with comparePeriod. Left out: the pay schedule's previous pay run.",
              "format": "int32"
            }
          },
          {
            "name": "comparePeriod",
            "in": "query",
            "description": "The period of the pay run to compare with; with compareYear.",
            "schema": {
              "type": "integer",
              "description": "The period of the pay run to compare with; with compareYear.",
              "format": "int32"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "allOf": [
                  {
                    "$ref": "#/components/schemas/Report_ReportDefinition"
                  }
                ],
                "description": "The report-definition document: one contract drives sync runs, exports, saved\ndefinitions and schedules. select holds 1 to 50 entries."
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Report_RunReportResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Report_ValidationErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Report_ServiceError"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Report_ApiErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Report_ServiceError"
                }
              }
            }
          }
        },
        "x-flow-permission": "report:read"
      }
    },
    "/v1/report/payroll-runs/{payrollConfigId}/{year}/{period}/{frequency}/reports/{definitionId}/rows": {
      "get": {
        "tags": [
          "Reports · Run reports"
        ],
        "summary": "A page of a report over one pay run",
        "description": "Needs permission report:read, or any of pay-run:read. A built-in or saved report over every payslip of the pay run (Preview, Final and Reopened), a page at a time in the report's own order (nulls last), then by row: send the page's nextCursor as after for the next one. The first page also counts the run's rows and sums each money column. A sensitive column the caller cannot read answers empty.",
        "operationId": "Report_listPayRunReportRows",
        "parameters": [
          {
            "name": "payrollConfigId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "year",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "period",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "frequency",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "compareYear",
            "in": "query",
            "description": "A comparison report compares with this year's pay run of the same pay schedule; with comparePeriod. Left out: the pay schedule's previous pay run.",
            "schema": {
              "type": "integer",
              "description": "A comparison report compares with this year's pay run of the same pay schedule; with comparePeriod. Left out: the pay schedule's previous pay run.",
              "format": "int32"
            }
          },
          {
            "name": "comparePeriod",
            "in": "query",
            "description": "The period of the pay run to compare with; with compareYear.",
            "schema": {
              "type": "integer",
              "description": "The period of the pay run to compare with; with compareYear.",
              "format": "int32"
            }
          },
          {
            "name": "definitionId",
            "in": "path",
            "description": "A built-in report (builtin.gross-to-net) or a saved one",
            "required": true,
            "schema": {
              "type": "string",
              "description": "A built-in report (builtin.gross-to-net) or a saved one"
            }
          },
          {
            "name": "after",
            "in": "query",
            "description": "The previous page's nextCursor",
            "schema": {
              "type": "string",
              "description": "The previous page's nextCursor"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "description": "Rows per page, 1 to 2000; 200 when left out",
            "schema": {
              "type": "integer",
              "description": "Rows per page, 1 to 2000; 200 when left out",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Report_PayRunReportPage"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Report_ValidationErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Report_ServiceError"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Report_ApiErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Report_ServiceError"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Report_ServiceError"
                }
              }
            }
          }
        },
        "x-flow-permission": "report:read",
        "x-flow-permission-also-accepts": [
          "pay-run:read"
        ]
      }
    },
    "/v1/report/runs": {
      "get": {
        "tags": [
          "Reports · Run history"
        ],
        "summary": "Run history / audit (most recent first)",
        "description": "Needs permission report:read. Every run this organisation has made, whichever way it was started: reports run on screen (SYNC), files queued from the export button (EXPORT) and reports a schedule started on its own (SCHEDULED). On-screen runs are kept for 90 days; exports and scheduled runs are kept indefinitely.",
        "operationId": "Report_listRuns",
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "description": "Rows to return, 1-200",
            "schema": {
              "type": "integer",
              "description": "Rows to return, 1-200",
              "format": "int32",
              "default": 50
            }
          },
          {
            "name": "mode",
            "in": "query",
            "description": "Restrict to one kind of run: SYNC, EXPORT or SCHEDULED",
            "schema": {
              "enum": [
                "SYNC",
                "EXPORT",
                "SCHEDULED"
              ],
              "type": "string",
              "description": "Restrict to one kind of run: SYNC, EXPORT or SCHEDULED"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Report_RunListResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Report_ValidationErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "No organisation context: the token is missing, invalid, expired, or grants no access to an organisation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Report_ServiceError"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Report_ApiErrorResponse"
                }
              }
            }
          }
        },
        "x-flow-permission": "report:read"
      }
    },
    "/v1/report/report-definitions/{definitionId}/schedules": {
      "post": {
        "tags": [
          "Reports · Schedules"
        ],
        "summary": "Schedule recurring exports of a saved definition",
        "description": "Needs permission report:export.",
        "operationId": "Report_createSchedule",
        "parameters": [
          {
            "name": "definitionId",
            "in": "path",
            "description": "Report definition id (ULID)",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Report definition id (ULID)"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "allOf": [
                  {
                    "$ref": "#/components/schemas/Report_CreateScheduleRequest"
                  }
                ]
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Report_ScheduleResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Report_ValidationErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "No organisation context: the token is missing, invalid, expired, or grants no access to an organisation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Report_ServiceError"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Report_ApiErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Report_ServiceError"
                }
              }
            }
          }
        },
        "x-flow-permission": "report:export"
      },
      "get": {
        "tags": [
          "Reports · Schedules"
        ],
        "summary": "List a definition's schedules",
        "description": "Needs permission report:read.",
        "operationId": "Report_listSchedules",
        "parameters": [
          {
            "name": "definitionId",
            "in": "path",
            "description": "Report definition id (ULID)",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Report definition id (ULID)"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Report_ScheduleListResponse"
                }
              }
            }
          },
          "401": {
            "description": "No organisation context: the token is missing, invalid, expired, or grants no access to an organisation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Report_ServiceError"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Report_ApiErrorResponse"
                }
              }
            }
          }
        },
        "x-flow-permission": "report:read"
      }
    },
    "/v1/report/schedules/{id}": {
      "delete": {
        "tags": [
          "Reports · Schedules"
        ],
        "summary": "Delete a schedule",
        "description": "Needs permission report:export.",
        "operationId": "Report_deleteSchedule",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Schedule id (ULID)",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Schedule id (ULID)"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No Content"
          },
          "401": {
            "description": "No organisation context: the token is missing, invalid, expired, or grants no access to an organisation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Report_ServiceError"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Report_ApiErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Report_ServiceError"
                }
              }
            }
          }
        },
        "x-flow-permission": "report:export"
      }
    },
    "/v1/webhooks/alert-contacts": {
      "get": {
        "tags": [
          "Webhooks · Alert contacts"
        ],
        "summary": "List default alert contacts",
        "description": "Needs permission integration:read.\n\nThe organisation's default alert contacts, or the account's with `scope=customer`. Every endpoint without its own list uses them: an organisation's endpoints the organisation's, then the account's.",
        "operationId": "Webhooks_GetAlertContacts",
        "parameters": [
          {
            "name": "scope",
            "in": "query",
            "description": "Whose resources: your organisation's (the default), or with account-wide access the account's (`customer`).",
            "schema": {
              "enum": [
                "organisation",
                "customer"
              ],
              "type": "string",
              "default": "organisation"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Webhooks_AlertContactsResponseResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Webhooks_ObjectResponseBody"
                }
              }
            }
          }
        },
        "x-flow-permission": "integration:read"
      },
      "put": {
        "tags": [
          "Webhooks · Alert contacts"
        ],
        "summary": "Replace default alert contacts",
        "description": "Needs permission integration:write.\n\nSets the full default list, at most 10 addresses. An empty list removes the defaults.",
        "operationId": "Webhooks_ReplaceAlertContacts",
        "parameters": [
          {
            "name": "scope",
            "in": "query",
            "description": "Whose resources: your organisation's (the default), or with account-wide access the account's (`customer`).",
            "schema": {
              "enum": [
                "organisation",
                "customer"
              ],
              "type": "string",
              "default": "organisation"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Webhooks_AlertContactsChangeRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Webhooks_AlertContactsResponseResponseBody"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Webhooks_ObjectResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Webhooks_ObjectResponseBody"
                }
              }
            }
          }
        },
        "x-flow-permission": "integration:write"
      },
      "post": {
        "tags": [
          "Webhooks · Alert contacts"
        ],
        "summary": "Add default alert contacts",
        "description": "Needs permission integration:write.\n\nAdds email addresses to the defaults, keeping the ones there. At most 10 in all.",
        "operationId": "Webhooks_AddAlertContacts",
        "parameters": [
          {
            "name": "scope",
            "in": "query",
            "description": "Whose resources: your organisation's (the default), or with account-wide access the account's (`customer`).",
            "schema": {
              "enum": [
                "organisation",
                "customer"
              ],
              "type": "string",
              "default": "organisation"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Webhooks_AlertContactsChangeRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Webhooks_AlertContactsResponseResponseBody"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Webhooks_ObjectResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Webhooks_ObjectResponseBody"
                }
              }
            }
          }
        },
        "x-flow-permission": "integration:write"
      },
      "delete": {
        "tags": [
          "Webhooks · Alert contacts"
        ],
        "summary": "Remove default alert contacts",
        "description": "Needs permission integration:write.\n\nRemoves the `email` values in the query string and returns the ones removed.",
        "operationId": "Webhooks_RemoveAlertContacts",
        "parameters": [
          {
            "name": "scope",
            "in": "query",
            "description": "Whose resources: your organisation's (the default), or with account-wide access the account's (`customer`).",
            "schema": {
              "enum": [
                "organisation",
                "customer"
              ],
              "type": "string",
              "default": "organisation"
            }
          },
          {
            "name": "email",
            "in": "query",
            "schema": {
              "type": "array",
              "items": {
                "type": "string"
              }
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Webhooks_AlertContactsResponseResponseBody"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Webhooks_ObjectResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Webhooks_ObjectResponseBody"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Webhooks_ObjectResponseBody"
                }
              }
            }
          }
        },
        "x-flow-permission": "integration:write"
      }
    },
    "/v1/webhooks/alert-contacts/{email}": {
      "delete": {
        "tags": [
          "Webhooks · Alert contacts"
        ],
        "summary": "Remove one default alert contact",
        "description": "Needs permission integration:write.\n\nRemoves one email address (URL-encoded in the path) and returns it.",
        "operationId": "Webhooks_RemoveAlertContact",
        "parameters": [
          {
            "name": "email",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "scope",
            "in": "query",
            "description": "Whose resources: your organisation's (the default), or with account-wide access the account's (`customer`).",
            "schema": {
              "enum": [
                "organisation",
                "customer"
              ],
              "type": "string",
              "default": "organisation"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Webhooks_AlertContactsResponseResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Webhooks_ObjectResponseBody"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Webhooks_ObjectResponseBody"
                }
              }
            }
          }
        },
        "x-flow-permission": "integration:write"
      }
    },
    "/v1/webhooks/endpoints/{endpointId}/alert-contacts": {
      "get": {
        "tags": [
          "Webhooks · Alert contacts"
        ],
        "summary": "List an endpoint's alert contacts",
        "description": "Needs permission integration:read.\n\nWho we email when this endpoint has been failing for a day and when we disable it. Empty means it uses the organisation's or account's defaults, or else its creator and the account owner.",
        "operationId": "Webhooks_GetEndpointAlertContacts",
        "parameters": [
          {
            "name": "endpointId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Webhooks_EndpointAlertContactsResponseResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Webhooks_ApiErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Webhooks_ObjectResponseBody"
                }
              }
            }
          }
        },
        "x-flow-permission": "integration:read"
      },
      "put": {
        "tags": [
          "Webhooks · Alert contacts"
        ],
        "summary": "Replace an endpoint's alert contacts",
        "description": "Needs permission integration:write.\n\nSets the full list, at most 10 addresses. An empty list goes back to the defaults.",
        "operationId": "Webhooks_ReplaceEndpointAlertContacts",
        "parameters": [
          {
            "name": "endpointId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Webhooks_AlertContactsChangeRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Webhooks_EndpointAlertContactsResponseResponseBody"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Webhooks_ObjectResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Webhooks_ApiErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Webhooks_ObjectResponseBody"
                }
              }
            }
          }
        },
        "x-flow-permission": "integration:write"
      },
      "post": {
        "tags": [
          "Webhooks · Alert contacts"
        ],
        "summary": "Add alert contacts to an endpoint",
        "description": "Needs permission integration:write.\n\nAdds email addresses to the endpoint's alert list, keeping the ones it has. At most 10 in all.",
        "operationId": "Webhooks_AddEndpointAlertContacts",
        "parameters": [
          {
            "name": "endpointId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Webhooks_AlertContactsChangeRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Webhooks_EndpointAlertContactsResponseResponseBody"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Webhooks_ObjectResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Webhooks_ApiErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Webhooks_ObjectResponseBody"
                }
              }
            }
          }
        },
        "x-flow-permission": "integration:write"
      },
      "delete": {
        "tags": [
          "Webhooks · Alert contacts"
        ],
        "summary": "Remove alert contacts from an endpoint",
        "description": "Needs permission integration:write.\n\nRemoves the `email` values in the query string and returns the ones removed. Removing the last one goes back to the defaults.",
        "operationId": "Webhooks_RemoveEndpointAlertContacts",
        "parameters": [
          {
            "name": "endpointId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "email",
            "in": "query",
            "schema": {
              "type": "array",
              "items": {
                "type": "string"
              }
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Webhooks_EndpointAlertContactsResponseResponseBody"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Webhooks_ObjectResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Webhooks_ApiErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Webhooks_ObjectResponseBody"
                }
              }
            }
          }
        },
        "x-flow-permission": "integration:write"
      }
    },
    "/v1/webhooks/endpoints/{endpointId}/alert-contacts/{email}": {
      "delete": {
        "tags": [
          "Webhooks · Alert contacts"
        ],
        "summary": "Remove one alert contact from an endpoint",
        "description": "Needs permission integration:write.\n\nRemoves one email address (URL-encoded in the path) and returns it.",
        "operationId": "Webhooks_RemoveEndpointAlertContact",
        "parameters": [
          {
            "name": "endpointId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "email",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Webhooks_EndpointAlertContactsResponseResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Webhooks_ApiErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Webhooks_ObjectResponseBody"
                }
              }
            }
          }
        },
        "x-flow-permission": "integration:write"
      }
    },
    "/v1/webhooks/deliveries": {
      "get": {
        "tags": [
          "Webhooks · Delivery log"
        ],
        "summary": "List deliveries",
        "description": "Needs permission integration:read.\n\nThe delivery log. Filter by `endpointId` (newest first, optionally by `status`) or by `eventId` for every endpoint an event went to.",
        "operationId": "Webhooks_ListDeliveries",
        "parameters": [
          {
            "name": "endpointId",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "eventId",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "status",
            "in": "query",
            "schema": {
              "type": "array",
              "items": {
                "type": "string"
              }
            }
          },
          {
            "name": "pageSize",
            "in": "query",
            "description": "Rows per page. Defaults to 20, maximum 100. Every page holds exactly this many results except the last, which may hold fewer.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "paginationToken",
            "in": "query",
            "description": "Cursor for the next page, present only when more results follow and null on the last page. Pass it back unmodified to continue; it is opaque and short-lived, so do not store it.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Webhooks_DeliveryResponseListResponseBody"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Webhooks_ObjectResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Webhooks_ApiErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Webhooks_ObjectResponseBody"
                }
              }
            }
          }
        },
        "x-flow-permission": "integration:read"
      }
    },
    "/v1/webhooks/deliveries/{deliveryId}": {
      "get": {
        "tags": [
          "Webhooks · Delivery log"
        ],
        "summary": "Retrieve a delivery",
        "description": "Needs permission integration:read.\n\nOne delivery and every attempt made at it: when, how long it took, what your receiver answered.",
        "operationId": "Webhooks_GetDelivery",
        "parameters": [
          {
            "name": "deliveryId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Webhooks_DeliveryDetailResponseResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Webhooks_ApiErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Webhooks_ObjectResponseBody"
                }
              }
            }
          }
        },
        "x-flow-permission": "integration:read"
      }
    },
    "/v1/webhooks/deliveries/{deliveryId}/attempts": {
      "get": {
        "tags": [
          "Webhooks · Delivery log"
        ],
        "summary": "List delivery attempts",
        "description": "Needs permission integration:read.\n\nEvery attempt at one delivery, oldest first.",
        "operationId": "Webhooks_ListDeliveryAttempts",
        "parameters": [
          {
            "name": "deliveryId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Webhooks_DeliveryAttemptResponseListResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Webhooks_ApiErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Webhooks_ObjectResponseBody"
                }
              }
            }
          }
        },
        "x-flow-permission": "integration:read"
      }
    },
    "/v1/webhooks/deliveries/{deliveryId}/replays": {
      "post": {
        "tags": [
          "Webhooks · Delivery log"
        ],
        "summary": "Resend a delivery",
        "description": "Needs permission integration:write.\n\nSends a finished delivery again as a new delivery with the same event id, so a receiver that de-duplicates on `webhook-id` is safe.",
        "operationId": "Webhooks_ReplayDelivery",
        "parameters": [
          {
            "name": "deliveryId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "description": "Makes a retry safe: the same key from the same person with the same body within 24 hours gets the first response back instead of running again. The same key with a different request is refused with 409.",
            "schema": {
              "maxLength": 255,
              "type": "string"
            }
          }
        ],
        "responses": {
          "201": {
            "description": "Created",
            "headers": {
              "Location": {
                "description": "Where the new resource can be read.",
                "schema": {
                  "type": "string",
                  "format": "uri"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Webhooks_DeliveryResponseResponseBody"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Webhooks_ObjectResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Webhooks_ApiErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Webhooks_ObjectResponseBody"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Webhooks_ObjectResponseBody"
                }
              }
            }
          }
        },
        "x-flow-permission": "integration:write"
      }
    },
    "/v1/webhooks/endpoints/{endpointId}/event-types": {
      "get": {
        "tags": [
          "Webhooks · Endpoint subscriptions"
        ],
        "summary": "List subscribed event types",
        "description": "Needs permission integration:read.\n\nThe event types and families the endpoint receives.",
        "operationId": "Webhooks_GetEndpointEventTypes",
        "parameters": [
          {
            "name": "endpointId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Webhooks_EndpointEventTypesResponseResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Webhooks_ApiErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Webhooks_ObjectResponseBody"
                }
              }
            }
          }
        },
        "x-flow-permission": "integration:read"
      },
      "put": {
        "tags": [
          "Webhooks · Endpoint subscriptions"
        ],
        "summary": "Replace subscribed event types",
        "description": "Needs permission integration:write.\n\nSets the full list. Use an exact type (`payslip.finalised`), a family (`payslip.*`) or `*` for everything.",
        "operationId": "Webhooks_ReplaceEndpointEventTypes",
        "parameters": [
          {
            "name": "endpointId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Webhooks_EventTypesChangeRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Webhooks_EndpointEventTypesResponseResponseBody"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Webhooks_ObjectResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Webhooks_ApiErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Webhooks_ObjectResponseBody"
                }
              }
            }
          }
        },
        "x-flow-permission": "integration:write"
      },
      "post": {
        "tags": [
          "Webhooks · Endpoint subscriptions"
        ],
        "summary": "Subscribe to event types",
        "description": "Needs permission integration:write.\n\nAdds event types or families to the endpoint, keeping the ones it has.",
        "operationId": "Webhooks_AddEndpointEventTypes",
        "parameters": [
          {
            "name": "endpointId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Webhooks_EventTypesChangeRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Webhooks_EndpointEventTypesResponseResponseBody"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Webhooks_ObjectResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Webhooks_ApiErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Webhooks_ObjectResponseBody"
                }
              }
            }
          }
        },
        "x-flow-permission": "integration:write"
      },
      "delete": {
        "tags": [
          "Webhooks · Endpoint subscriptions"
        ],
        "summary": "Unsubscribe from event types",
        "description": "Needs permission integration:write.\n\nRemoves the `eventType` values in the query string and returns the ones removed. An endpoint always keeps at least one.",
        "operationId": "Webhooks_RemoveEndpointEventTypes",
        "parameters": [
          {
            "name": "endpointId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "eventType",
            "in": "query",
            "schema": {
              "type": "array",
              "items": {
                "type": "string"
              }
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Webhooks_EndpointEventTypesResponseResponseBody"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Webhooks_ObjectResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Webhooks_ApiErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Webhooks_ObjectResponseBody"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Webhooks_ObjectResponseBody"
                }
              }
            }
          }
        },
        "x-flow-permission": "integration:write"
      }
    },
    "/v1/webhooks/endpoints/{endpointId}/event-types/{eventType}": {
      "delete": {
        "tags": [
          "Webhooks · Endpoint subscriptions"
        ],
        "summary": "Unsubscribe from one event type",
        "description": "Needs permission integration:write.\n\nRemoves one event type or family and returns it.",
        "operationId": "Webhooks_RemoveEndpointEventType",
        "parameters": [
          {
            "name": "endpointId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "eventType",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Webhooks_EndpointEventTypesResponseResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Webhooks_ApiErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Webhooks_ObjectResponseBody"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Webhooks_ObjectResponseBody"
                }
              }
            }
          }
        },
        "x-flow-permission": "integration:write"
      }
    },
    "/v1/webhooks/endpoints/{endpointId}/organisations": {
      "get": {
        "tags": [
          "Webhooks · Endpoint subscriptions"
        ],
        "summary": "List filtered organisations",
        "description": "Needs permission integration:read.\n\nFor an account-wide endpoint, the organisations it is limited to. Empty means every organisation on the account, less any it excludes.",
        "operationId": "Webhooks_GetEndpointOrganisations",
        "parameters": [
          {
            "name": "endpointId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Webhooks_EndpointOrganisationsResponseResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Webhooks_ApiErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Webhooks_ObjectResponseBody"
                }
              }
            }
          }
        },
        "x-flow-permission": "integration:read"
      },
      "put": {
        "tags": [
          "Webhooks · Endpoint subscriptions"
        ],
        "summary": "Replace the organisation filter",
        "description": "Needs permission integration:write.\n\nLimits an account-wide endpoint to exactly these organisations.",
        "operationId": "Webhooks_ReplaceEndpointOrganisations",
        "parameters": [
          {
            "name": "endpointId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Webhooks_OrganisationsChangeRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Webhooks_EndpointOrganisationsResponseResponseBody"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Webhooks_ObjectResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Webhooks_ApiErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Webhooks_ObjectResponseBody"
                }
              }
            }
          }
        },
        "x-flow-permission": "integration:write"
      },
      "post": {
        "tags": [
          "Webhooks · Endpoint subscriptions"
        ],
        "summary": "Add organisations to the filter",
        "description": "Needs permission integration:write.\n\nAdds organisations to an account-wide endpoint's filter.",
        "operationId": "Webhooks_AddEndpointOrganisations",
        "parameters": [
          {
            "name": "endpointId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Webhooks_OrganisationsChangeRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Webhooks_EndpointOrganisationsResponseResponseBody"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Webhooks_ObjectResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Webhooks_ApiErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Webhooks_ObjectResponseBody"
                }
              }
            }
          }
        },
        "x-flow-permission": "integration:write"
      },
      "delete": {
        "tags": [
          "Webhooks · Endpoint subscriptions"
        ],
        "summary": "Remove organisations from the filter",
        "description": "Needs permission integration:write.\n\nRemoves the `organisationId` values in the query string and returns the ones removed.",
        "operationId": "Webhooks_RemoveEndpointOrganisations",
        "parameters": [
          {
            "name": "endpointId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "organisationId",
            "in": "query",
            "schema": {
              "type": "array",
              "items": {
                "type": "string"
              }
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Webhooks_EndpointOrganisationsResponseResponseBody"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Webhooks_ObjectResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Webhooks_ApiErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Webhooks_ObjectResponseBody"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Webhooks_ObjectResponseBody"
                }
              }
            }
          }
        },
        "x-flow-permission": "integration:write"
      }
    },
    "/v1/webhooks/endpoints/{endpointId}/organisations/{organisationId}": {
      "delete": {
        "tags": [
          "Webhooks · Endpoint subscriptions"
        ],
        "summary": "Remove one organisation from the filter",
        "description": "Needs permission integration:write.\n\nRemoves one organisation and returns it.",
        "operationId": "Webhooks_RemoveEndpointOrganisation",
        "parameters": [
          {
            "name": "endpointId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "organisationId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Webhooks_EndpointOrganisationsResponseResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Webhooks_ApiErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Webhooks_ObjectResponseBody"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Webhooks_ObjectResponseBody"
                }
              }
            }
          }
        },
        "x-flow-permission": "integration:write"
      }
    },
    "/v1/webhooks/endpoints/{endpointId}/excluded-organisations": {
      "get": {
        "tags": [
          "Webhooks · Endpoint subscriptions"
        ],
        "summary": "List excluded organisations",
        "description": "Needs permission integration:read.\n\nFor an account-wide endpoint, the organisations it never sends for. Every other organisation on the account is included, including ones added later.",
        "operationId": "Webhooks_GetEndpointExcludedOrganisations",
        "parameters": [
          {
            "name": "endpointId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Webhooks_EndpointExcludedOrganisationsResponseResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Webhooks_ApiErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Webhooks_ObjectResponseBody"
                }
              }
            }
          }
        },
        "x-flow-permission": "integration:read"
      },
      "put": {
        "tags": [
          "Webhooks · Endpoint subscriptions"
        ],
        "summary": "Replace the excluded organisations",
        "description": "Needs permission integration:write.\n\nSets the full exclusion list, at most 500. An empty list excludes nobody. An endpoint can include chosen organisations or exclude some, not both.",
        "operationId": "Webhooks_ReplaceEndpointExcludedOrganisations",
        "parameters": [
          {
            "name": "endpointId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Webhooks_OrganisationsChangeRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Webhooks_EndpointExcludedOrganisationsResponseResponseBody"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Webhooks_ObjectResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Webhooks_ApiErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Webhooks_ObjectResponseBody"
                }
              }
            }
          }
        },
        "x-flow-permission": "integration:write"
      },
      "post": {
        "tags": [
          "Webhooks · Endpoint subscriptions"
        ],
        "summary": "Exclude organisations",
        "description": "Needs permission integration:write.\n\nStops an account-wide endpoint sending for these organisations, keeping the ones already excluded. To give one organisation different settings, exclude it here and create an endpoint for that organisation.",
        "operationId": "Webhooks_AddEndpointExcludedOrganisations",
        "parameters": [
          {
            "name": "endpointId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Webhooks_OrganisationsChangeRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Webhooks_EndpointExcludedOrganisationsResponseResponseBody"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Webhooks_ObjectResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Webhooks_ApiErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Webhooks_ObjectResponseBody"
                }
              }
            }
          }
        },
        "x-flow-permission": "integration:write"
      },
      "delete": {
        "tags": [
          "Webhooks · Endpoint subscriptions"
        ],
        "summary": "Stop excluding organisations",
        "description": "Needs permission integration:write.\n\nIncludes the `organisationId` values in the query string again and returns them.",
        "operationId": "Webhooks_RemoveEndpointExcludedOrganisations",
        "parameters": [
          {
            "name": "endpointId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "organisationId",
            "in": "query",
            "schema": {
              "type": "array",
              "items": {
                "type": "string"
              }
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Webhooks_EndpointExcludedOrganisationsResponseResponseBody"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Webhooks_ObjectResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Webhooks_ApiErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Webhooks_ObjectResponseBody"
                }
              }
            }
          }
        },
        "x-flow-permission": "integration:write"
      }
    },
    "/v1/webhooks/endpoints/{endpointId}/excluded-organisations/{organisationId}": {
      "delete": {
        "tags": [
          "Webhooks · Endpoint subscriptions"
        ],
        "summary": "Stop excluding one organisation",
        "description": "Needs permission integration:write.\n\nIncludes one organisation again and returns it.",
        "operationId": "Webhooks_RemoveEndpointExcludedOrganisation",
        "parameters": [
          {
            "name": "endpointId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "organisationId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Webhooks_EndpointExcludedOrganisationsResponseResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Webhooks_ApiErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Webhooks_ObjectResponseBody"
                }
              }
            }
          }
        },
        "x-flow-permission": "integration:write"
      }
    },
    "/v1/webhooks/endpoints": {
      "post": {
        "tags": [
          "Webhooks · Endpoints"
        ],
        "summary": "Create an endpoint",
        "description": "Needs permission integration:write.\n\nRegisters an HTTPS URL to receive events for your organisation, or with `scope=customer` for every organisation on your account, including ones added later, which needs account-wide access. The response carries the endpoint's signing secret, shown only this once: store it to verify every delivery's `v1` signature. It also carries the endpoint's public key, which verifies the `v1a` signature instead and can be read again at any time. Send an `Idempotency-Key` header to make a retried request safe.",
        "operationId": "Webhooks_CreateEndpoint",
        "parameters": [
          {
            "name": "scope",
            "in": "query",
            "description": "Whose resources: your organisation's (the default), or with account-wide access the account's (`customer`).",
            "schema": {
              "enum": [
                "organisation",
                "customer"
              ],
              "type": "string",
              "default": "organisation"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "description": "Makes a retry safe: the same key from the same person with the same body within 24 hours gets the first response back instead of running again. The same key with a different request is refused with 409.",
            "schema": {
              "maxLength": 255,
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Webhooks_CreateEndpointRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Created",
            "headers": {
              "Location": {
                "description": "Where the new resource can be read.",
                "schema": {
                  "type": "string",
                  "format": "uri"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Webhooks_CreatedEndpointResponseResponseBody"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Webhooks_ObjectResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Webhooks_ObjectResponseBody"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Webhooks_ObjectResponseBody"
                }
              }
            }
          }
        },
        "x-flow-permission": "integration:write"
      },
      "get": {
        "tags": [
          "Webhooks · Endpoints"
        ],
        "summary": "List endpoints",
        "description": "Needs permission integration:read.\n\nYour organisation's endpoints; with `scope=customer`, the endpoints that cover your whole account; with `scope=all`, those and every organisation's own endpoints on the account, in the order they were created. `scope=customer` and `scope=all` need account-wide access. Every page is full except the last; keep following `paginationToken` until it is absent.",
        "operationId": "Webhooks_ListEndpoints",
        "parameters": [
          {
            "name": "scope",
            "in": "query",
            "description": "Whose resources: your organisation's (the default), or with account-wide access the account's (`customer`).",
            "schema": {
              "enum": [
                "organisation",
                "customer",
                "all"
              ],
              "type": "string",
              "default": "organisation"
            }
          },
          {
            "name": "pageSize",
            "in": "query",
            "description": "Rows per page. Defaults to 20, maximum 100. Every page holds exactly this many results except the last, which may hold fewer.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "paginationToken",
            "in": "query",
            "description": "Cursor for the next page, present only when more results follow and null on the last page. Pass it back unmodified to continue; it is opaque and short-lived, so do not store it.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Webhooks_EndpointResponseListResponseBody"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Webhooks_ObjectResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Webhooks_ObjectResponseBody"
                }
              }
            }
          }
        },
        "x-flow-permission": "integration:read"
      }
    },
    "/v1/webhooks/endpoints/{endpointId}": {
      "get": {
        "tags": [
          "Webhooks · Endpoints"
        ],
        "summary": "Retrieve an endpoint",
        "description": "Needs permission integration:read.\n\nOne endpoint, with its subscriptions, status and settings.",
        "operationId": "Webhooks_GetEndpoint",
        "parameters": [
          {
            "name": "endpointId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Webhooks_EndpointResponseResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Webhooks_ApiErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Webhooks_ObjectResponseBody"
                }
              }
            }
          }
        },
        "x-flow-permission": "integration:read"
      },
      "patch": {
        "tags": [
          "Webhooks · Endpoints"
        ],
        "summary": "Update an endpoint",
        "description": "Needs permission integration:write.\n\nA JSON Merge Patch: a field you leave out stays as it is, a field you send as `null` is removed (so `\"rateLimitPerSecond\": null` removes the ceiling), anything else replaces it. `url`, `status`, `payloadStyle` and `eventTypes` cannot be removed. `eventTypes`, `organisationIds`, `excludedOrganisationIds` and `alertContacts` replace the whole list and change the same lists as the endpoint's `event-types`, `organisations`, `excluded-organisations` and `alert-contacts` resources, which add and remove single entries. Set `status` to `Paused` to stop deliveries while you work on your receiver; events that happen meanwhile are recorded as skipped and can be replayed. Two changes made to the same endpoint at the same moment both apply; if it keeps changing under your request you get a 409 `concurrent_change` and can simply try again.",
        "operationId": "Webhooks_UpdateEndpoint",
        "parameters": [
          {
            "name": "endpointId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Webhooks_UpdateEndpointRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Webhooks_EndpointResponseResponseBody"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Webhooks_ObjectResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Webhooks_ApiErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Webhooks_ObjectResponseBody"
                }
              }
            }
          }
        },
        "x-flow-permission": "integration:write"
      },
      "delete": {
        "tags": [
          "Webhooks · Endpoints"
        ],
        "summary": "Delete an endpoint",
        "description": "Needs permission integration:write.\n\nStops all deliveries to the endpoint and returns it as it was. Its delivery log stays available for the retention period.",
        "operationId": "Webhooks_DeleteEndpoint",
        "parameters": [
          {
            "name": "endpointId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Webhooks_EndpointResponseResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Webhooks_ApiErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Webhooks_ObjectResponseBody"
                }
              }
            }
          }
        },
        "x-flow-permission": "integration:write"
      }
    },
    "/v1/webhooks/endpoints/{endpointId}/test-deliveries": {
      "post": {
        "tags": [
          "Webhooks · Endpoints"
        ],
        "summary": "Send a test event",
        "description": "Needs permission integration:write.\n\nSends a signed `webhook.test` event to the endpoint straight away and reports what your receiver answered. Up to 5 a minute per endpoint.",
        "operationId": "Webhooks_SendTestEvent",
        "parameters": [
          {
            "name": "endpointId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Webhooks_TestDeliveryResponseResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Webhooks_ApiErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Webhooks_ObjectResponseBody"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Webhooks_ObjectResponseBody"
                }
              }
            }
          }
        },
        "x-flow-permission": "integration:write"
      }
    },
    "/v1/webhooks/endpoints/{endpointId}/secrets": {
      "get": {
        "tags": [
          "Webhooks · Endpoints"
        ],
        "summary": "List signing secrets",
        "description": "Needs permission integration:read.\n\nThe endpoint's secrets, their status and each one's public key. Secret values are never returned after they are issued.",
        "operationId": "Webhooks_ListSigningSecrets",
        "parameters": [
          {
            "name": "endpointId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Webhooks_SigningSecretResponseListResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Webhooks_ApiErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Webhooks_ObjectResponseBody"
                }
              }
            }
          }
        },
        "x-flow-permission": "integration:read"
      },
      "post": {
        "tags": [
          "Webhooks · Endpoints"
        ],
        "summary": "Rotate the signing secret",
        "description": "Needs permission integration:write.\n\nIssues a new secret, returned once, with a new public key. The previous secret and its key keep signing for 24 hours, so every delivery carries both sets of signatures while you switch over.",
        "operationId": "Webhooks_CreateSigningSecret",
        "parameters": [
          {
            "name": "endpointId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "description": "Makes a retry safe: the same key from the same person with the same body within 24 hours gets the first response back instead of running again. The same key with a different request is refused with 409.",
            "schema": {
              "maxLength": 255,
              "type": "string"
            }
          }
        ],
        "responses": {
          "201": {
            "description": "Created",
            "headers": {
              "Location": {
                "description": "Where the new resource can be read.",
                "schema": {
                  "type": "string",
                  "format": "uri"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Webhooks_CreatedSigningSecretResponseResponseBody"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Webhooks_ObjectResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Webhooks_ApiErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Webhooks_ObjectResponseBody"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Webhooks_ObjectResponseBody"
                }
              }
            }
          }
        },
        "x-flow-permission": "integration:write"
      }
    },
    "/v1/webhooks/endpoints/{endpointId}/secrets/{secretId}": {
      "get": {
        "tags": [
          "Webhooks · Endpoints"
        ],
        "summary": "Retrieve a signing secret",
        "description": "Needs permission integration:read.\n\nOne secret's status, dates and public key, without its value.",
        "operationId": "Webhooks_GetSigningSecret",
        "parameters": [
          {
            "name": "endpointId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "secretId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Webhooks_SigningSecretResponseResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Webhooks_ApiErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Webhooks_ObjectResponseBody"
                }
              }
            }
          }
        },
        "x-flow-permission": "integration:read"
      },
      "delete": {
        "tags": [
          "Webhooks · Endpoints"
        ],
        "summary": "Revoke a signing secret",
        "description": "Needs permission integration:write.\n\nStops a secret and its public key signing, for example once you have switched to a rotated one. The last active secret cannot be revoked; rotate first.",
        "operationId": "Webhooks_RevokeSigningSecret",
        "parameters": [
          {
            "name": "endpointId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "secretId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Webhooks_SigningSecretResponseResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Webhooks_ApiErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Webhooks_ObjectResponseBody"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Webhooks_ObjectResponseBody"
                }
              }
            }
          }
        },
        "x-flow-permission": "integration:write"
      }
    },
    "/v1/webhooks/event-types": {
      "get": {
        "tags": [
          "Webhooks · Event types"
        ],
        "summary": "List event types",
        "description": "Needs permission integration:read.\n\nEvery event type you can subscribe to, with a description and the API version it arrived in.",
        "operationId": "Webhooks_ListEventTypes",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Webhooks_WebhookEventDescriptorListResponseBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Webhooks_ObjectResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Webhooks_ApiErrorResponse"
                }
              }
            }
          }
        },
        "x-flow-permission": "integration:read"
      }
    },
    "/v1/webhooks/events": {
      "get": {
        "tags": [
          "Webhooks · Events"
        ],
        "summary": "List events",
        "description": "Needs permission integration:read.\n\nEvents recorded for your organisation in the last 90 days, newest first; with `organisationId`, for another organisation on your account; with `scope=customer`, for every organisation on your account in one list. Both need account-wide access. Filter by up to 10 types or families (`eventType=payslip.*,payroll_run.completed`) and by date.",
        "operationId": "Webhooks_ListEvents",
        "parameters": [
          {
            "name": "organisationId",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "scope",
            "in": "query",
            "description": "Whose resources: your organisation's (the default), or with account-wide access the account's (`customer`).",
            "schema": {
              "enum": [
                "organisation",
                "customer"
              ],
              "type": "string",
              "default": "organisation"
            }
          },
          {
            "name": "eventType",
            "in": "query",
            "schema": {
              "type": "array",
              "items": {
                "type": "string"
              }
            }
          },
          {
            "name": "startDate",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "endDate",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "pageSize",
            "in": "query",
            "description": "Rows per page. Defaults to 20, maximum 100. Every page holds exactly this many results except the last, which may hold fewer.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "paginationToken",
            "in": "query",
            "description": "Cursor for the next page, present only when more results follow and null on the last page. Pass it back unmodified to continue; it is opaque and short-lived, so do not store it.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Webhooks_WebhookEventRecordResponseListResponseBody"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Webhooks_ObjectResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Webhooks_ObjectResponseBody"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Webhooks_ObjectResponseBody"
                }
              }
            }
          }
        },
        "x-flow-permission": "integration:read"
      }
    },
    "/v1/webhooks/events/{eventId}": {
      "get": {
        "tags": [
          "Webhooks · Events"
        ],
        "summary": "Retrieve an event",
        "description": "Needs permission integration:read.\n\nOne event exactly as it was sent: from your organisation, from another on your account with `organisationId`, or from any organisation on your account with `scope=customer`. Both need account-wide access.",
        "operationId": "Webhooks_GetEvent",
        "parameters": [
          {
            "name": "eventId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "organisationId",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "scope",
            "in": "query",
            "description": "Whose resources: your organisation's (the default), or with account-wide access the account's (`customer`).",
            "schema": {
              "enum": [
                "organisation",
                "customer"
              ],
              "type": "string",
              "default": "organisation"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Webhooks_WebhookEventRecordResponseResponseBody"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Webhooks_ObjectResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Webhooks_ObjectResponseBody"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Webhooks_ObjectResponseBody"
                }
              }
            }
          }
        },
        "x-flow-permission": "integration:read"
      }
    },
    "/v1/webhooks/replays": {
      "post": {
        "tags": [
          "Webhooks · Replays"
        ],
        "summary": "Replay deliveries",
        "description": "Needs permission integration:write.\n\nResends deliveries from a window of up to 90 days, by outcome and event type, and optionally sends events an endpoint never received. With `scope=customer` it covers every endpoint on your account, account-wide and each organisation's own, and needs account-wide access. Runs in the background; follow it with the replay's id.",
        "operationId": "Webhooks_StartReplay",
        "parameters": [
          {
            "name": "scope",
            "in": "query",
            "description": "Whose resources: your organisation's (the default), or with account-wide access the account's (`customer`).",
            "schema": {
              "enum": [
                "organisation",
                "customer"
              ],
              "type": "string",
              "default": "organisation"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "description": "Makes a retry safe: the same key from the same person with the same body within 24 hours gets the first response back instead of running again. The same key with a different request is refused with 409.",
            "schema": {
              "maxLength": 255,
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Webhooks_CreateReplayRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "202": {
            "description": "Accepted",
            "headers": {
              "Location": {
                "description": "Where the new resource can be read.",
                "schema": {
                  "type": "string",
                  "format": "uri"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Webhooks_ReplayJobResponseResponseBody"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Webhooks_ObjectResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Webhooks_ObjectResponseBody"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Webhooks_ObjectResponseBody"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Webhooks_ObjectResponseBody"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Webhooks_ObjectResponseBody"
                }
              }
            }
          }
        },
        "x-flow-permission": "integration:write"
      },
      "get": {
        "tags": [
          "Webhooks · Replays"
        ],
        "summary": "List replays",
        "description": "Needs permission integration:read.\n\nYour replays, newest first.",
        "operationId": "Webhooks_ListReplays",
        "parameters": [
          {
            "name": "scope",
            "in": "query",
            "description": "Whose resources: your organisation's (the default), or with account-wide access the account's (`customer`).",
            "schema": {
              "enum": [
                "organisation",
                "customer"
              ],
              "type": "string",
              "default": "organisation"
            }
          },
          {
            "name": "pageSize",
            "in": "query",
            "description": "Rows per page. Defaults to 20, maximum 100. Every page holds exactly this many results except the last, which may hold fewer.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "paginationToken",
            "in": "query",
            "description": "Cursor for the next page, present only when more results follow and null on the last page. Pass it back unmodified to continue; it is opaque and short-lived, so do not store it.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Webhooks_ReplayJobResponseListResponseBody"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Webhooks_ObjectResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Webhooks_ObjectResponseBody"
                }
              }
            }
          }
        },
        "x-flow-permission": "integration:read"
      }
    },
    "/v1/webhooks/replays/{replayId}": {
      "get": {
        "tags": [
          "Webhooks · Replays"
        ],
        "summary": "Retrieve a replay",
        "description": "Needs permission integration:read.\n\nA replay's progress: how many deliveries it has resent so far and whether it has finished.",
        "operationId": "Webhooks_GetReplay",
        "parameters": [
          {
            "name": "replayId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "scope",
            "in": "query",
            "description": "Whose resources: your organisation's (the default), or with account-wide access the account's (`customer`).",
            "schema": {
              "enum": [
                "organisation",
                "customer"
              ],
              "type": "string",
              "default": "organisation"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Webhooks_ReplayJobResponseResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Webhooks_ObjectResponseBody"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Webhooks_ObjectResponseBody"
                }
              }
            }
          }
        },
        "x-flow-permission": "integration:read"
      },
      "patch": {
        "tags": [
          "Webhooks · Replays"
        ],
        "summary": "Cancel a replay",
        "description": "Needs permission integration:write.\n\nSet `status` to `Cancelled` to stop a replay that is still running.",
        "operationId": "Webhooks_UpdateReplay",
        "parameters": [
          {
            "name": "replayId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "scope",
            "in": "query",
            "description": "Whose resources: your organisation's (the default), or with account-wide access the account's (`customer`).",
            "schema": {
              "enum": [
                "organisation",
                "customer"
              ],
              "type": "string",
              "default": "organisation"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Webhooks_UpdateReplayRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Webhooks_ReplayJobResponseResponseBody"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Webhooks_ObjectResponseBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Webhooks_ObjectResponseBody"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Webhooks_ObjectResponseBody"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Webhooks_ObjectResponseBody"
                }
              }
            }
          }
        },
        "x-flow-permission": "integration:write"
      }
    }
  },
  "components": {
    "securitySchemes": {
      "X-Auth-Token": {
        "type": "apiKey",
        "in": "header",
        "name": "X-Auth-Token",
        "description": "Bearer token issued by the OAuth 2.0 client-credentials token endpoint."
      }
    },
    "schemas": {
      "Authentication_MyOrganisation": {
        "type": "object",
        "properties": {
          "organisationId": {
            "type": "string",
            "description": "The organisation identifier to send as the X-Org-Id header on subsequent requests."
          },
          "legalName": {
            "type": "string",
            "nullable": true,
            "description": "Registered legal name. Null if the organisation directory has no record yet."
          },
          "tradingName": {
            "type": "string",
            "nullable": true,
            "description": "Trading (display) name, if different from the legal name."
          }
        }
      },
      "Authentication_MyOrganisationsData": {
        "type": "object",
        "properties": {
          "organisations": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Authentication_MyOrganisation"
            }
          },
          "paginationToken": {
            "type": "string",
            "nullable": true,
            "description": "Pass back as `paginationToken` to fetch the next page. Null when there are no more pages."
          }
        }
      },
      "Authentication_Metadata": {
        "type": "object",
        "properties": {
          "dateFormat": {
            "type": "string",
            "nullable": true
          },
          "dateTimeFormat": {
            "type": "string",
            "nullable": true
          }
        }
      },
      "Authentication_ContentMyOrganisations": {
        "type": "object",
        "properties": {
          "data": {
            "$ref": "#/components/schemas/Authentication_MyOrganisationsData"
          },
          "metadata": {
            "$ref": "#/components/schemas/Authentication_Metadata"
          }
        }
      },
      "Authentication_Pair": {
        "type": "object",
        "properties": {
          "key": {
            "type": "string",
            "nullable": true
          },
          "value": {
            "type": "string",
            "nullable": true
          }
        }
      },
      "Authentication_Error": {
        "type": "object",
        "properties": {
          "field": {
            "type": "string",
            "nullable": true
          },
          "reasonText": {
            "type": "string",
            "nullable": true
          },
          "reasonId": {
            "type": "string",
            "nullable": true
          },
          "reasonParameters": {
            "type": "array",
            "nullable": true,
            "items": {
              "$ref": "#/components/schemas/Authentication_Pair"
            }
          }
        }
      },
      "Authentication_Message": {
        "type": "object",
        "properties": {
          "text": {
            "type": "string",
            "nullable": true
          },
          "textId": {
            "type": "string",
            "nullable": true
          },
          "textParameters": {
            "type": "array",
            "nullable": true,
            "items": {
              "$ref": "#/components/schemas/Authentication_Pair"
            }
          }
        }
      },
      "Authentication_ApiResponseMyOrganisations": {
        "type": "object",
        "properties": {
          "content": {
            "$ref": "#/components/schemas/Authentication_ContentMyOrganisations"
          },
          "metadata": {
            "$ref": "#/components/schemas/Authentication_Metadata"
          },
          "errors": {
            "type": "array",
            "nullable": true,
            "items": {
              "$ref": "#/components/schemas/Authentication_Error"
            }
          },
          "message": {
            "$ref": "#/components/schemas/Authentication_Message"
          }
        }
      },
      "Authentication_ApiResponseError": {
        "type": "object",
        "properties": {
          "content": {
            "nullable": true
          },
          "metadata": {
            "$ref": "#/components/schemas/Authentication_Metadata"
          },
          "errors": {
            "type": "array",
            "nullable": true,
            "items": {
              "$ref": "#/components/schemas/Authentication_Error"
            }
          },
          "message": {
            "$ref": "#/components/schemas/Authentication_Message"
          }
        }
      },
      "Administration_AccessChangeListResponse": {
        "type": "object",
        "properties": {
          "accessChanges": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Administration_AccessChangeResponse"
            }
          },
          "paginationToken": {
            "type": "string",
            "description": "Null on the last page. Also at `content.metadata.paginationToken`, which to prefer.",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "description": "A page of access changes, newest first."
      },
      "Administration_AccessChangeListResponseContentResponse": {
        "type": "object",
        "properties": {
          "data": {
            "$ref": "#/components/schemas/Administration_AccessChangeListResponse"
          },
          "metadata": {
            "$ref": "#/components/schemas/Administration_ContentMetadataResponse"
          }
        },
        "additionalProperties": false
      },
      "Administration_AccessChangeListResponseResponseBody": {
        "type": "object",
        "properties": {
          "message": {
            "$ref": "#/components/schemas/Administration_MessageWithTokenResponse"
          },
          "content": {
            "$ref": "#/components/schemas/Administration_AccessChangeListResponseContentResponse"
          },
          "validationIssues": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Administration_ValidationIssue"
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Administration_AccessChangeResponse": {
        "type": "object",
        "properties": {
          "accessChangeId": {
            "type": "string",
            "description": "The change's identifier."
          },
          "type": {
            "enum": [
              "Granted",
              "RoleChanged",
              "Removed"
            ],
            "type": "string",
            "description": "`Granted` (no access there before), `RoleChanged` or `Removed`."
          },
          "principalId": {
            "type": "string",
            "description": "The person (`USER#…`) or API token (`M2M#…`) whose access changed."
          },
          "principalType": {
            "enum": [
              "Person",
              "ApiToken"
            ],
            "type": "string",
            "description": "`Person` or `ApiToken`."
          },
          "scope": {
            "$ref": "#/components/schemas/Administration_AccessChangeScopeResponse"
          },
          "roleBefore": {
            "type": "string",
            "description": "The role before the change, such as `administrator`; null when it was granted.",
            "nullable": true
          },
          "roleAfter": {
            "type": "string",
            "description": "The role after the change; null when it was removed.",
            "nullable": true
          },
          "actor": {
            "type": "string",
            "description": "Who made the change: a person's email address, an API token's client id, or an operator; null when FlowPayroll made it\n(`source` is `Platform`) and nothing says by whom.",
            "nullable": true
          },
          "source": {
            "enum": [
              "Administration",
              "Platform"
            ],
            "type": "string",
            "description": "`Administration` when somebody in an account made it here; `Platform` when FlowPayroll made it outside this API."
          },
          "occurredDate": {
            "type": "string",
            "description": "When it happened, ISO 8601 UTC."
          },
          "requestId": {
            "type": "string",
            "description": "The request that made the change (`Request-Id`), for support; null when none was known.",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "description": "One change to somebody's access: who made it, to whom, where, and the role before and after."
      },
      "Administration_AccessChangeScopeResponse": {
        "type": "object",
        "properties": {
          "type": {
            "enum": [
              "Organisation",
              "OrganisationGroup",
              "Account"
            ],
            "type": "string",
            "description": "`Organisation`, `OrganisationGroup` or `Account` (every organisation of the account)."
          },
          "id": {
            "type": "string",
            "description": "The organisation, the organisation group or the account."
          }
        },
        "additionalProperties": false,
        "description": "What changed access reaches."
      },
      "Administration_AccessGrantRequest": {
        "type": "object",
        "properties": {
          "scope": {
            "$ref": "#/components/schemas/Administration_AccessScopeRequest"
          },
          "roleId": {
            "type": "string",
            "description": "Required. The role there, such as `payroll-manager` or one of your own (`custom.hr-team`); see `GET /roles`.",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "description": "One grant for the person or API token being created: a scope and the role it carries there."
      },
      "Administration_AccessGrantResponse": {
        "type": "object",
        "properties": {
          "scope": {
            "$ref": "#/components/schemas/Administration_AccessChangeScopeResponse"
          },
          "roleId": {
            "type": "string",
            "description": "The role there."
          }
        },
        "additionalProperties": false,
        "description": "One grant: a scope and the role it carries there, in the shape the create requests send it. The scope is the one\nthe access-change history publishes, with `id` always filled (the account's own id on `Account`)."
      },
      "Administration_AccessRoleRequest": {
        "type": "object",
        "properties": {
          "roleId": {
            "type": "string",
            "description": "Leave it out to keep the role they already hold there, or, when they had no access there before, to give your\naccount's default role (`GET /customer/access-settings`; `administrator` while your account cannot give\nroles yet).",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "description": "The role to give with one grant. The whole body is optional."
      },
      "Administration_AccessScopeRequest": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "The organisation or the organisation group; required for those. On `Account` leave it out (it is your own\naccount) or send your account's id.",
            "nullable": true
          },
          "type": {
            "enum": [
              "Organisation",
              "OrganisationGroup",
              "Account"
            ],
            "type": "string",
            "description": "`Account` (every organisation your account owns or manages, including ones added later), `Organisation` or\n            `OrganisationGroup`.",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "description": "Where a grant applies: the same scope the access-change history and the access reads name."
      },
      "Administration_AccessSettingsResponse": {
        "type": "object",
        "properties": {
          "defaultRoleId": {
            "type": "string"
          },
          "defaultRole": {
            "$ref": "#/components/schemas/Administration_RoleResponse"
          },
          "defaultRoleChosen": {
            "type": "boolean",
            "description": "False while your account uses the standard default, Viewer."
          }
        },
        "additionalProperties": false,
        "description": "Your account's access settings."
      },
      "Administration_AccessSettingsResponseContentResponse": {
        "type": "object",
        "properties": {
          "data": {
            "$ref": "#/components/schemas/Administration_AccessSettingsResponse"
          },
          "metadata": {
            "$ref": "#/components/schemas/Administration_ContentMetadataResponse"
          }
        },
        "additionalProperties": false
      },
      "Administration_AccessSettingsResponseResponseBody": {
        "type": "object",
        "properties": {
          "message": {
            "$ref": "#/components/schemas/Administration_MessageWithTokenResponse"
          },
          "content": {
            "$ref": "#/components/schemas/Administration_AccessSettingsResponseContentResponse"
          },
          "validationIssues": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Administration_ValidationIssue"
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Administration_AccountOfRecordResponse": {
        "type": "object",
        "properties": {
          "customerId": {
            "type": "string",
            "description": "Null when Source is `None`.",
            "nullable": true
          },
          "source": {
            "enum": [
              "None",
              "Owner",
              "Managing"
            ],
            "type": "string",
            "description": "Who decided an organisation's account of record."
          }
        },
        "additionalProperties": false,
        "description": "Whose brand an organisation's employees get. Read-only to customers."
      },
      "Administration_AccountReferenceResponse": {
        "type": "object",
        "properties": {
          "customerId": {
            "type": "string",
            "description": "The account's identifier."
          },
          "name": {
            "type": "string",
            "description": "The account's display name; its identifier when it has none."
          }
        },
        "additionalProperties": false,
        "description": "Another Flow Payroll account, as its own record names it."
      },
      "Administration_ActivityEventResponse": {
        "type": "object",
        "properties": {
          "activityId": {
            "type": "string",
            "description": "The event's identifier."
          },
          "action": {
            "enum": [
              "CustomerRenamed",
              "OwnershipTransferred",
              "OrganisationAdded",
              "OrganisationsAdded",
              "UserInvited",
              "UsersInvited",
              "UserRevoked",
              "UserAccessChanged",
              "InvitationResent",
              "TokenIssued",
              "TokenRotated",
              "TokenRenamed",
              "TokenRescoped",
              "TokenRevoked",
              "BrandingDraftSaved",
              "BrandingDraftDiscarded",
              "BrandingPublished",
              "BrandingUnpublished",
              "CompanyLogoChanged",
              "AccountOfRecordSet",
              "AccountOfRecordCleared",
              "PartnerDomainAdded",
              "PartnerDomainActive",
              "PartnerDomainFailed",
              "PartnerDomainLapsed",
              "PartnerDomainRemoved",
              "SendingDomainAdded",
              "SendingDomainVerified",
              "SendingDomainFailed",
              "SendingDomainRemoved",
              "RoleCreated",
              "RoleChanged",
              "RoleDeleted",
              "DefaultRoleChanged",
              "OrganisationGroupCreated",
              "OrganisationGroupChanged",
              "OrganisationGroupDeleted",
              "OrganisationAddedToGroup",
              "OrganisationRemovedFromGroup",
              "TokenIpRangesChanged",
              "DataOwnershipSet",
              "DataOwnershipCleared"
            ],
            "type": "string",
            "description": "What happened, as one of a closed PascalCase vocabulary published as an enum on this field. Not to\nbe confused with the snake_case reason tokens in `message.token`."
          },
          "actor": {
            "type": "string",
            "description": "Who did it: the email address of a person, or the client id of an API token."
          },
          "subject": {
            "type": "string",
            "description": "What was acted on, by its display name at the time. Null on bulk events.",
            "nullable": true
          },
          "subjectId": {
            "type": "string",
            "description": "The identifier of what was acted on. Null on bulk events.",
            "nullable": true
          },
          "subjectCount": {
            "type": "integer",
            "description": "How many things a bulk action touched. Null on single events.",
            "format": "int32",
            "nullable": true
          },
          "occurredDate": {
            "type": "string",
            "description": "When it happened, in ISO 8601 UTC."
          },
          "before": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "What a changed setting held before, such as the data an outside system managed. Null on other events.",
            "nullable": true
          },
          "after": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "What it holds after. Null on other events.",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "description": "One recent administration action: who did what to whom, and when."
      },
      "Administration_ActivityListResponse": {
        "type": "object",
        "properties": {
          "events": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Administration_ActivityEventResponse"
            },
            "description": "The page."
          },
          "paginationToken": {
            "type": "string",
            "description": "Null on the last page. Follow it until it is absent. Also published at\n`content.metadata.paginationToken`, which is the location to prefer.",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "description": "A page of events, newest first."
      },
      "Administration_ActivityListResponseContentResponse": {
        "type": "object",
        "properties": {
          "data": {
            "$ref": "#/components/schemas/Administration_ActivityListResponse"
          },
          "metadata": {
            "$ref": "#/components/schemas/Administration_ContentMetadataResponse"
          }
        },
        "additionalProperties": false
      },
      "Administration_ActivityListResponseResponseBody": {
        "type": "object",
        "properties": {
          "message": {
            "$ref": "#/components/schemas/Administration_MessageWithTokenResponse"
          },
          "content": {
            "$ref": "#/components/schemas/Administration_ActivityListResponseContentResponse"
          },
          "validationIssues": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Administration_ValidationIssue"
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Administration_AddressRequest": {
        "type": "object",
        "properties": {
          "line1": {
            "type": "string",
            "description": "The first line of the address.",
            "nullable": true
          },
          "line2": {
            "type": "string",
            "description": "The second line of the address.",
            "nullable": true
          },
          "city": {
            "type": "string",
            "description": "The town or city.",
            "nullable": true
          },
          "county": {
            "type": "string",
            "description": "The county.",
            "nullable": true
          },
          "postcode": {
            "type": "string",
            "description": "The postcode.",
            "nullable": true
          },
          "countryCode": {
            "type": "string",
            "description": "The country code, for example `GB`.",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "description": "A postal address."
      },
      "Administration_AddressResponse": {
        "type": "object",
        "properties": {
          "line1": {
            "type": "string",
            "description": "First line.",
            "nullable": true
          },
          "line2": {
            "type": "string",
            "description": "Second line.",
            "nullable": true
          },
          "city": {
            "type": "string",
            "description": "Town or city.",
            "nullable": true
          },
          "county": {
            "type": "string",
            "description": "County.",
            "nullable": true
          },
          "postcode": {
            "type": "string",
            "description": "Postcode.",
            "nullable": true
          },
          "countryCode": {
            "type": "string",
            "description": "ISO 3166-1 alpha-2 country, `GB` for the UK.",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "description": "A postal address; a part not recorded is null."
      },
      "Administration_ApiTokenDetailResponse": {
        "type": "object",
        "properties": {
          "token": {
            "$ref": "#/components/schemas/Administration_ApiTokenSummaryResponse"
          },
          "organisationIds": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Deprecated: use `access`. Deprecated: use `access`. Every organisation it reaches through a direct grant.",
            "deprecated": true
          },
          "coversWholeCustomer": {
            "type": "boolean",
            "description": "Deprecated: use `access`. Deprecated: use `access`. Whether it also holds account-wide access, which reaches every organisation the\naccount owns, including ones added later. When true, `organisationIds` is not the whole picture and is\nusually empty.",
            "deprecated": true
          },
          "access": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Administration_AccessGrantResponse"
            },
            "description": "Its grants in your account, in the shape `POST /api-tokens` takes: account-wide first, then each\norganisation group, then each organisation. A grant from before roles existed reads as `administrator`."
          }
        },
        "additionalProperties": false,
        "description": "An API token and everything it reaches."
      },
      "Administration_ApiTokenDetailResponseContentResponse": {
        "type": "object",
        "properties": {
          "data": {
            "$ref": "#/components/schemas/Administration_ApiTokenDetailResponse"
          },
          "metadata": {
            "$ref": "#/components/schemas/Administration_ContentMetadataResponse"
          }
        },
        "additionalProperties": false
      },
      "Administration_ApiTokenDetailResponseResponseBody": {
        "type": "object",
        "properties": {
          "message": {
            "$ref": "#/components/schemas/Administration_MessageWithTokenResponse"
          },
          "content": {
            "$ref": "#/components/schemas/Administration_ApiTokenDetailResponseContentResponse"
          },
          "validationIssues": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Administration_ValidationIssue"
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Administration_ApiTokenIssuedResponse": {
        "type": "object",
        "properties": {
          "clientId": {
            "type": "string",
            "description": "The credential's client id. Stable for the life of the token, across rotations."
          },
          "name": {
            "type": "string",
            "description": "The display name."
          },
          "clientSecret": {
            "type": "string",
            "description": "Shown once and stored nowhere. Null when the request replayed an earlier create, whose secret was\nreturned to the first attempt. If it is lost, rotate the token.",
            "nullable": true
          },
          "organisationIds": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "The organisations the token reaches through direct grants."
          },
          "coversWholeCustomer": {
            "type": "boolean",
            "description": "Whether it holds account-wide access, which reaches every organisation the account owns,\nincluding ones added later. When true, `organisationIds` is not the whole picture and is\nusually empty."
          },
          "alreadyExisted": {
            "type": "boolean",
            "description": "True when this `Idempotency-Key` had already been fulfilled and nothing was created now."
          },
          "roleId": {
            "type": "string",
            "description": "The role the token was issued with; null when the request sent `access`, whose entries carry their own.",
            "nullable": true
          },
          "allowedIpRanges": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "The address ranges it may be used from; null for anywhere.",
            "nullable": true
          },
          "access": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Administration_AccessGrantResponse"
            },
            "description": "The grants it was issued with, each with its role; null when the request used the deprecated fields.",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "description": "A newly created or rotated API token. The only response on this API that carries a secret."
      },
      "Administration_ApiTokenIssuedResponseContentResponse": {
        "type": "object",
        "properties": {
          "data": {
            "$ref": "#/components/schemas/Administration_ApiTokenIssuedResponse"
          },
          "metadata": {
            "$ref": "#/components/schemas/Administration_ContentMetadataResponse"
          }
        },
        "additionalProperties": false
      },
      "Administration_ApiTokenIssuedResponseResponseBody": {
        "type": "object",
        "properties": {
          "message": {
            "$ref": "#/components/schemas/Administration_MessageWithTokenResponse"
          },
          "content": {
            "$ref": "#/components/schemas/Administration_ApiTokenIssuedResponseContentResponse"
          },
          "validationIssues": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Administration_ValidationIssue"
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Administration_ApiTokenListResponse": {
        "type": "object",
        "properties": {
          "tokens": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Administration_ApiTokenSummaryResponse"
            },
            "description": "The page."
          },
          "paginationToken": {
            "type": "string",
            "description": "Null on the last page. Follow it until it is absent. Also published at\n`content.metadata.paginationToken`, which is the location to prefer.",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "description": "A page of API tokens."
      },
      "Administration_ApiTokenListResponseContentResponse": {
        "type": "object",
        "properties": {
          "data": {
            "$ref": "#/components/schemas/Administration_ApiTokenListResponse"
          },
          "metadata": {
            "$ref": "#/components/schemas/Administration_ContentMetadataResponse"
          }
        },
        "additionalProperties": false
      },
      "Administration_ApiTokenListResponseResponseBody": {
        "type": "object",
        "properties": {
          "message": {
            "$ref": "#/components/schemas/Administration_MessageWithTokenResponse"
          },
          "content": {
            "$ref": "#/components/schemas/Administration_ApiTokenListResponseContentResponse"
          },
          "validationIssues": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Administration_ValidationIssue"
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Administration_ApiTokenOrganisationsResponse": {
        "type": "object",
        "properties": {
          "clientId": {
            "type": "string",
            "description": "The token."
          },
          "organisationIds": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Every organisation it reaches through a direct grant."
          },
          "coversWholeCustomer": {
            "type": "boolean",
            "description": "Whether it also holds account-wide access, which reaches every organisation the account owns,\nincluding ones added later. Read this before treating an empty list as no access."
          },
          "roles": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Administration_GrantRoleResponse"
            },
            "description": "The role at each place it has access: account-wide first, then each organisation. A grant from before roles\nexisted reads as `administrator`."
          }
        },
        "additionalProperties": false,
        "description": "The organisations one API token reaches, after a read or a change."
      },
      "Administration_ApiTokenOrganisationsResponseContentResponse": {
        "type": "object",
        "properties": {
          "data": {
            "$ref": "#/components/schemas/Administration_ApiTokenOrganisationsResponse"
          },
          "metadata": {
            "$ref": "#/components/schemas/Administration_ContentMetadataResponse"
          }
        },
        "additionalProperties": false
      },
      "Administration_ApiTokenOrganisationsResponseResponseBody": {
        "type": "object",
        "properties": {
          "message": {
            "$ref": "#/components/schemas/Administration_MessageWithTokenResponse"
          },
          "content": {
            "$ref": "#/components/schemas/Administration_ApiTokenOrganisationsResponseContentResponse"
          },
          "validationIssues": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Administration_ValidationIssue"
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Administration_ApiTokenSummaryResponse": {
        "type": "object",
        "properties": {
          "clientId": {
            "type": "string",
            "description": "The credential's client id: what an integration exchanges for access tokens, and how the token is\naddressed on this API."
          },
          "name": {
            "type": "string",
            "description": "The display name you gave it.",
            "nullable": true
          },
          "createdDate": {
            "type": "string",
            "description": "When it was issued.",
            "nullable": true
          },
          "callerAccess": {
            "$ref": "#/components/schemas/Administration_CallerAccessResponse"
          },
          "allowedIpRanges": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "The address ranges it may be used from; null for anywhere. On a single token and on a change, not on the list.",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "description": "One API token as listed. No read model carries the secret."
      },
      "Administration_ApiTokenSummaryResponseContentResponse": {
        "type": "object",
        "properties": {
          "data": {
            "$ref": "#/components/schemas/Administration_ApiTokenSummaryResponse"
          },
          "metadata": {
            "$ref": "#/components/schemas/Administration_ContentMetadataResponse"
          }
        },
        "additionalProperties": false
      },
      "Administration_ApiTokenSummaryResponseResponseBody": {
        "type": "object",
        "properties": {
          "message": {
            "$ref": "#/components/schemas/Administration_MessageWithTokenResponse"
          },
          "content": {
            "$ref": "#/components/schemas/Administration_ApiTokenSummaryResponseContentResponse"
          },
          "validationIssues": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Administration_ValidationIssue"
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Administration_BrandDarkVersionsResponse": {
        "type": "object",
        "properties": {
          "logo": {
            "type": "boolean"
          },
          "icon": {
            "type": "boolean"
          },
          "loadingAnimation": {
            "type": "boolean"
          }
        },
        "additionalProperties": false,
        "description": "Which of the brand's files have a version for a dark background. The light one is used for any that do not."
      },
      "Administration_BrandSupportResponse": {
        "type": "object",
        "properties": {
          "supportUrl": {
            "type": "string",
            "description": "The brand's own help website; null when it has none.",
            "nullable": true
          },
          "supportEmail": {
            "type": "string",
            "description": "The address people write to for help; null when the brand gives none.",
            "nullable": true
          },
          "helpLinksFallback": {
            "enum": [
              "Hide",
              "FlowGuides"
            ],
            "type": "string",
            "description": "What a help link does when SupportUrl is null."
          },
          "supportEmbedUrl": {
            "type": "string",
            "description": "The brand's own support page, which the app shows in a panel; null when the brand offers none. The page is opened with\nthe address `POST /organisations/{organisationId}/support-sessions` answers, never with this one: this says only\nwhether to offer support.",
            "nullable": true
          },
          "supportPanelWidth": {
            "type": "integer",
            "description": "How wide, in pixels, to draw the support panel on a desktop: the brand's own, else 420. Null when the brand offers no\npanel. Phones show it at full width.",
            "format": "int32",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Administration_BrandingAssetPreviewsResponse": {
        "type": "object",
        "properties": {
          "logoSvgUrl": {
            "type": "string",
            "nullable": true
          },
          "iconSvgUrl": {
            "type": "string",
            "nullable": true
          },
          "logoDarkSvgUrl": {
            "type": "string",
            "nullable": true
          },
          "iconDarkSvgUrl": {
            "type": "string",
            "nullable": true
          },
          "loadingAnimationSvgUrl": {
            "type": "string",
            "nullable": true
          },
          "loadingAnimationDarkSvgUrl": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "description": "Short-lived links to the draft's own files, for the editor's preview. Each is null when its file is not set."
      },
      "Administration_BrandingAssetUploadResponse": {
        "type": "object",
        "properties": {
          "uploadId": {
            "type": "string",
            "description": "Ask `GET .../assets/{uploadId}` for the outcome after sending the file."
          },
          "type": {
            "enum": [
              "Logo",
              "IconMark",
              "CompanyLogo",
              "FontRegular",
              "FontMedium",
              "FontBold",
              "LoadingAnimation"
            ],
            "type": "string",
            "description": "Which brand file an upload is for."
          },
          "url": {
            "type": "string",
            "description": "Send the file's bytes here, as the whole request body, before ExpiresDate."
          },
          "method": {
            "type": "string",
            "description": "Always `PUT`."
          },
          "headers": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            },
            "description": "Send every one unchanged. The body must be exactly the size asked for."
          },
          "maxSizeBytes": {
            "type": "integer",
            "description": "The largest file accepted for this kind.",
            "format": "int64"
          },
          "expiresDate": {
            "type": "string"
          }
        },
        "additionalProperties": false,
        "description": "Where to send one brand file. The server chose where it goes; the browser only sends the file."
      },
      "Administration_BrandingAssetUploadResponseContentResponse": {
        "type": "object",
        "properties": {
          "data": {
            "$ref": "#/components/schemas/Administration_BrandingAssetUploadResponse"
          },
          "metadata": {
            "$ref": "#/components/schemas/Administration_ContentMetadataResponse"
          }
        },
        "additionalProperties": false
      },
      "Administration_BrandingAssetUploadResponseResponseBody": {
        "type": "object",
        "properties": {
          "message": {
            "$ref": "#/components/schemas/Administration_MessageWithTokenResponse"
          },
          "content": {
            "$ref": "#/components/schemas/Administration_BrandingAssetUploadResponseContentResponse"
          },
          "validationIssues": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Administration_ValidationIssue"
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Administration_BrandingAssetUploadStatusResponse": {
        "type": "object",
        "properties": {
          "uploadId": {
            "type": "string"
          },
          "type": {
            "enum": [
              "Logo",
              "IconMark",
              "CompanyLogo",
              "FontRegular",
              "FontMedium",
              "FontBold",
              "LoadingAnimation"
            ],
            "type": "string",
            "description": "Which brand file an upload is for."
          },
          "status": {
            "enum": [
              "Processing",
              "Ready",
              "Rejected"
            ],
            "type": "string",
            "description": "Where an uploaded brand file is in processing."
          },
          "assetId": {
            "type": "string",
            "description": "Set when Status is `Ready`: put it on the draft or the organisation.",
            "nullable": true
          },
          "fontFamily": {
            "type": "string",
            "description": "For a font: the family name read from the file, for the preview.",
            "nullable": true
          },
          "token": {
            "type": "string",
            "description": "Set when Status is `Rejected`: the reason token.",
            "nullable": true
          },
          "message": {
            "type": "string",
            "description": "Set when Status is `Rejected`: what to do instead.",
            "nullable": true
          },
          "previewUrl": {
            "type": "string",
            "description": "Short-lived link to the accepted file, for the editor's preview.",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "description": "What happened to one uploaded brand file."
      },
      "Administration_BrandingAssetUploadStatusResponseContentResponse": {
        "type": "object",
        "properties": {
          "data": {
            "$ref": "#/components/schemas/Administration_BrandingAssetUploadStatusResponse"
          },
          "metadata": {
            "$ref": "#/components/schemas/Administration_ContentMetadataResponse"
          }
        },
        "additionalProperties": false
      },
      "Administration_BrandingAssetUploadStatusResponseResponseBody": {
        "type": "object",
        "properties": {
          "message": {
            "$ref": "#/components/schemas/Administration_MessageWithTokenResponse"
          },
          "content": {
            "$ref": "#/components/schemas/Administration_BrandingAssetUploadStatusResponseContentResponse"
          },
          "validationIssues": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Administration_ValidationIssue"
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Administration_BrandingDraftResponse": {
        "type": "object",
        "properties": {
          "settings": {
            "$ref": "#/components/schemas/Administration_BrandingSettingsResponse"
          },
          "previews": {
            "$ref": "#/components/schemas/Administration_BrandingAssetPreviewsResponse"
          },
          "entitlement": {
            "$ref": "#/components/schemas/Administration_BrandingEntitlementResponse"
          },
          "version": {
            "type": "integer",
            "description": "Send it back unchanged; it detects two people editing at once.",
            "format": "int64"
          },
          "updatedDate": {
            "type": "string"
          },
          "updatedBy": {
            "type": "string"
          },
          "canChange": {
            "type": "boolean",
            "description": "Whether you can change the brand. One-organisation administrators can view only."
          }
        },
        "additionalProperties": false,
        "description": "The editable copy. Nothing anyone sees changes until it is published."
      },
      "Administration_BrandingDraftResponseContentResponse": {
        "type": "object",
        "properties": {
          "data": {
            "$ref": "#/components/schemas/Administration_BrandingDraftResponse"
          },
          "metadata": {
            "$ref": "#/components/schemas/Administration_ContentMetadataResponse"
          }
        },
        "additionalProperties": false
      },
      "Administration_BrandingDraftResponseResponseBody": {
        "type": "object",
        "properties": {
          "message": {
            "$ref": "#/components/schemas/Administration_MessageWithTokenResponse"
          },
          "content": {
            "$ref": "#/components/schemas/Administration_BrandingDraftResponseContentResponse"
          },
          "validationIssues": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Administration_ValidationIssue"
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Administration_BrandingEntitlementResponse": {
        "type": "object",
        "properties": {
          "whiteLabelEnabled": {
            "type": "boolean"
          },
          "poweredByFlow": {
            "type": "boolean"
          },
          "domainAllowance": {
            "type": "integer",
            "description": "How many partner domains the account may have.",
            "format": "int32"
          },
          "sendingDomainAllowance": {
            "type": "integer",
            "description": "How many sending domains the account may have.",
            "format": "int32"
          }
        },
        "additionalProperties": false,
        "description": "What Flow has switched on for the account. Read-only here; Flow operators set it."
      },
      "Administration_BrandingRevisionListResponse": {
        "type": "object",
        "properties": {
          "revisions": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Administration_BrandingRevisionResponse"
            }
          },
          "paginationToken": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Administration_BrandingRevisionListResponseContentResponse": {
        "type": "object",
        "properties": {
          "data": {
            "$ref": "#/components/schemas/Administration_BrandingRevisionListResponse"
          },
          "metadata": {
            "$ref": "#/components/schemas/Administration_ContentMetadataResponse"
          }
        },
        "additionalProperties": false
      },
      "Administration_BrandingRevisionListResponseResponseBody": {
        "type": "object",
        "properties": {
          "message": {
            "$ref": "#/components/schemas/Administration_MessageWithTokenResponse"
          },
          "content": {
            "$ref": "#/components/schemas/Administration_BrandingRevisionListResponseContentResponse"
          },
          "validationIssues": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Administration_ValidationIssue"
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Administration_BrandingRevisionResponse": {
        "type": "object",
        "properties": {
          "brandRevision": {
            "type": "string",
            "description": "Sorts by the time it was published."
          },
          "settings": {
            "$ref": "#/components/schemas/Administration_BrandingSettingsResponse"
          },
          "publishedDate": {
            "type": "string"
          },
          "publishedBy": {
            "type": "string"
          },
          "republishedFrom": {
            "type": "string",
            "description": "The older revision this one copied, when it was a republish.",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "description": "One published snapshot. Revisions never change once written."
      },
      "Administration_BrandingRevisionResponseContentResponse": {
        "type": "object",
        "properties": {
          "data": {
            "$ref": "#/components/schemas/Administration_BrandingRevisionResponse"
          },
          "metadata": {
            "$ref": "#/components/schemas/Administration_ContentMetadataResponse"
          }
        },
        "additionalProperties": false
      },
      "Administration_BrandingRevisionResponseResponseBody": {
        "type": "object",
        "properties": {
          "message": {
            "$ref": "#/components/schemas/Administration_MessageWithTokenResponse"
          },
          "content": {
            "$ref": "#/components/schemas/Administration_BrandingRevisionResponseContentResponse"
          },
          "validationIssues": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Administration_ValidationIssue"
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Administration_BrandingSettingsResponse": {
        "type": "object",
        "properties": {
          "productName": {
            "type": "string",
            "description": "2 to 40 characters. Shown in titles, emails and documents.",
            "nullable": true
          },
          "primaryColour": {
            "type": "string",
            "description": "Hex colour, `#RRGGBB`.",
            "nullable": true
          },
          "primaryForegroundColour": {
            "type": "string",
            "description": "Optional; derived when null. Must reach WCAG AA 4.5:1 on the primary colour.",
            "nullable": true
          },
          "accentColour": {
            "type": "string",
            "nullable": true
          },
          "fontSource": {
            "enum": [
              "Curated",
              "Uploaded"
            ],
            "type": "string",
            "description": "Where the app font comes from."
          },
          "fontCuratedKey": {
            "type": "string",
            "description": "One of FlowPayroll.Administration.Api.Enums.CuratedFontKeys when FontSource is `Curated`.",
            "nullable": true
          },
          "fontFamily": {
            "type": "string",
            "description": "Display family name of an uploaded font.",
            "nullable": true
          },
          "fontRegularAssetId": {
            "type": "string",
            "nullable": true
          },
          "fontMediumAssetId": {
            "type": "string",
            "nullable": true
          },
          "fontBoldAssetId": {
            "type": "string",
            "nullable": true
          },
          "fontLicenceConfirmedBy": {
            "type": "string",
            "description": "Who confirmed the account holds a web licence for the uploaded font.",
            "nullable": true
          },
          "fontLicenceConfirmedDate": {
            "type": "string",
            "nullable": true
          },
          "logoAssetId": {
            "type": "string",
            "description": "The account logo (SVG), from `POST /customer/branding/assets`.",
            "nullable": true
          },
          "iconAssetId": {
            "type": "string",
            "description": "The square icon (SVG) the favicon set is derived from.",
            "nullable": true
          },
          "supportEmail": {
            "type": "string",
            "nullable": true
          },
          "supportUrl": {
            "type": "string",
            "nullable": true
          },
          "privacyUrl": {
            "type": "string",
            "nullable": true
          },
          "termsUrl": {
            "type": "string",
            "nullable": true
          },
          "helpLinksFallback": {
            "enum": [
              "Hide",
              "FlowGuides"
            ],
            "type": "string",
            "description": "What a help link does when the account has no support website."
          },
          "emailFromName": {
            "type": "string",
            "nullable": true
          },
          "emailFromAddress": {
            "type": "string",
            "nullable": true
          },
          "emailSenderOverrides": {
            "type": "object",
            "additionalProperties": {
              "$ref": "#/components/schemas/Administration_EmailSenderResponse"
            }
          },
          "emailReplyTo": {
            "type": "string",
            "nullable": true
          },
          "emailFooterText": {
            "type": "string",
            "nullable": true
          },
          "legalFooter": {
            "type": "string",
            "description": "Registered name, number and office. Up to 300 characters.",
            "nullable": true
          },
          "documentsShowLogo": {
            "type": "boolean"
          },
          "documentsUseBrandColour": {
            "type": "boolean"
          },
          "appShowsProductName": {
            "type": "boolean"
          },
          "signInShowsProductName": {
            "type": "boolean"
          },
          "emailsShowProductName": {
            "type": "boolean"
          },
          "documentsShowProductName": {
            "type": "boolean"
          },
          "logoDarkAssetId": {
            "type": "string",
            "description": "The logo on a dark background; the light one is used when null.",
            "nullable": true
          },
          "iconDarkAssetId": {
            "type": "string",
            "description": "The icon on a dark background; the light one is used when null.",
            "nullable": true
          },
          "loadingStyle": {
            "enum": [
              "Spinner",
              "Icon",
              "Animation"
            ],
            "type": "string",
            "description": "What the app shows while it waits."
          },
          "loadingAnimationAssetId": {
            "type": "string",
            "description": "The animated SVG for `Animation`.",
            "nullable": true
          },
          "loadingAnimationDarkAssetId": {
            "type": "string",
            "description": "The animation on a dark background; the light one is used when null.",
            "nullable": true
          },
          "emailButtonShape": {
            "enum": [
              "Rounded",
              "Square",
              "Pill"
            ],
            "type": "string",
            "description": "The corners of the buttons in emails."
          },
          "emailHeaderStyle": {
            "enum": [
              "Plain",
              "BrandBar"
            ],
            "type": "string",
            "description": "How the top of each email looks."
          },
          "supportEmbedUrl": {
            "type": "string",
            "nullable": true
          },
          "supportPanelWidth": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "accessMessages": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            },
            "description": "The account's own sentence, per permissions area (`employee`, `working-pattern`, ...), for what its\npeople's roles cannot change there. An area left out keeps the app's wording. Empty when the account words none.",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "description": "The fields an account sets for its brand. Flat on purpose: the draft PATCH is a JSON Merge Patch of\nexactly this shape, so a field reads and writes under the same name."
      },
      "Administration_BulkCreateOrganisationsRequest": {
        "type": "object",
        "properties": {
          "defaults": {
            "$ref": "#/components/schemas/Administration_BulkOrganisationDefaultsRequest"
          },
          "entries": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Administration_BulkOrganisationEntryRequest"
            },
            "description": "The organisations to create, each processed exactly as `POST /organisations` would process it.\nOne `Idempotency-Key` covers the whole batch, and each entry claims under it by position.",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "description": "Adds several organisations to your account in one request: shared defaults plus per-entry overrides."
      },
      "Administration_BulkCreateOrganisationsResponse": {
        "type": "object",
        "properties": {
          "created": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Administration_OrganisationCreatedResponse"
            },
            "description": "The entries that were created, each with its setup outcome."
          },
          "failed": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Administration_BulkFailureResponse"
            },
            "description": "The entries that were refused, each with the reason."
          }
        },
        "additionalProperties": false,
        "description": "What a bulk create did, organisation by organisation. An organisation in `created` can still\nbe incomplete: its own `complete` and `outstandingSteps` say so."
      },
      "Administration_BulkCreateOrganisationsResponseContentResponse": {
        "type": "object",
        "properties": {
          "data": {
            "$ref": "#/components/schemas/Administration_BulkCreateOrganisationsResponse"
          },
          "metadata": {
            "$ref": "#/components/schemas/Administration_ContentMetadataResponse"
          }
        },
        "additionalProperties": false
      },
      "Administration_BulkCreateOrganisationsResponseResponseBody": {
        "type": "object",
        "properties": {
          "message": {
            "$ref": "#/components/schemas/Administration_MessageWithTokenResponse"
          },
          "content": {
            "$ref": "#/components/schemas/Administration_BulkCreateOrganisationsResponseContentResponse"
          },
          "validationIssues": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Administration_ValidationIssue"
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Administration_BulkFailureResponse": {
        "type": "object",
        "properties": {
          "reference": {
            "type": "string",
            "description": "The entry as you sent it, so you can find it in your own request: the email address for a person,\nthe legal name for an organisation."
          },
          "reason": {
            "type": "string",
            "description": "The same stable snake_case token the single-item endpoint would answer with in `message.token`,\nso there is one set of reasons to handle."
          },
          "message": {
            "type": "string",
            "description": "A sentence explaining the refusal."
          }
        },
        "additionalProperties": false,
        "description": "One entry of a bulk request that was refused."
      },
      "Administration_BulkInviteDefaultsRequest": {
        "type": "object",
        "properties": {
          "organisationIds": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Deprecated: use `access`. Deprecated: use `access`. The organisations to grant to every entry that does not name its own.",
            "nullable": true,
            "deprecated": true
          },
          "allOrganisations": {
            "type": "boolean",
            "description": "Deprecated: use `access`. Deprecated: use `access`. Give every entry account-wide access unless it opts out with\n`allOrganisations: false`.",
            "nullable": true,
            "deprecated": true
          },
          "access": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Administration_AccessGrantRequest"
            },
            "description": "The access to give: one grant per scope, each with its own role (on an entry: this person's, replacing the default set; on the\ndefaults: everybody's who does not state their own). Replaces `organisationIds`,\n`allOrganisations` and `roleId`, which are deprecated: send one or the other, never both (400\n`access_with_deprecated_fields`).",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "description": "The access every person in the request gets unless their own entry says otherwise."
      },
      "Administration_BulkInviteEntryRequest": {
        "type": "object",
        "properties": {
          "email": {
            "type": "string",
            "description": "Required. The address they sign in with.",
            "nullable": true
          },
          "givenName": {
            "type": "string",
            "description": "Their first name, used in the invitation.",
            "nullable": true
          },
          "familyName": {
            "type": "string",
            "description": "Their last name, used in the invitation.",
            "nullable": true
          },
          "organisationIds": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Deprecated: use `access`. Deprecated: use `access`. The organisations to grant this person. Replaces the default set rather than adding\nto it.",
            "nullable": true,
            "deprecated": true
          },
          "allOrganisations": {
            "type": "boolean",
            "description": "Deprecated: use `access`. Deprecated: use `access`. Nullable so that `false` can opt this person out of a default of `true`.\nOmit it to inherit.",
            "nullable": true,
            "deprecated": true
          },
          "access": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Administration_AccessGrantRequest"
            },
            "description": "The access to give: one grant per scope, each with its own role (on an entry: this person's, replacing the default set; on the\ndefaults: everybody's who does not state their own). Replaces `organisationIds`,\n`allOrganisations` and `roleId`, which are deprecated: send one or the other, never both (400\n`access_with_deprecated_fields`).",
            "nullable": true
          },
          "externalId": {
            "type": "string",
            "description": "Your own identifier for this person, such as their id in your HR system: 1 to 256 characters, case-sensitive,\nunique among your people and guests. It is the same value SCIM provisioning reads and writes as `externalId`.",
            "nullable": true,
            "example": "emp-00417"
          }
        },
        "additionalProperties": false,
        "description": "One person in a bulk invitation. Leave a field out to inherit the default; set it to override."
      },
      "Administration_BulkInviteUsersRequest": {
        "type": "object",
        "properties": {
          "defaults": {
            "$ref": "#/components/schemas/Administration_BulkInviteDefaultsRequest"
          },
          "entries": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Administration_BulkInviteEntryRequest"
            },
            "description": "The people to invite. Each is processed exactly as `POST /users` would process it.",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "description": "Invites several people in one request: shared defaults plus per-entry overrides."
      },
      "Administration_BulkInviteUsersResponse": {
        "type": "object",
        "properties": {
          "invited": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Administration_UserInvitedResponse"
            },
            "description": "The entries that went through, including access changes for people already in the account."
          },
          "failed": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Administration_BulkFailureResponse"
            },
            "description": "The entries that were refused, each with the reason."
          }
        },
        "additionalProperties": false,
        "description": "What a bulk invitation did, person by person. The status code says whether all, some or none of\nthe entries went through; this body says which."
      },
      "Administration_BulkInviteUsersResponseContentResponse": {
        "type": "object",
        "properties": {
          "data": {
            "$ref": "#/components/schemas/Administration_BulkInviteUsersResponse"
          },
          "metadata": {
            "$ref": "#/components/schemas/Administration_ContentMetadataResponse"
          }
        },
        "additionalProperties": false
      },
      "Administration_BulkInviteUsersResponseResponseBody": {
        "type": "object",
        "properties": {
          "message": {
            "$ref": "#/components/schemas/Administration_MessageWithTokenResponse"
          },
          "content": {
            "$ref": "#/components/schemas/Administration_BulkInviteUsersResponseContentResponse"
          },
          "validationIssues": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Administration_ValidationIssue"
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Administration_BulkOrganisationDefaultsRequest": {
        "type": "object",
        "properties": {
          "organisationType": {
            "enum": [
              "Branch",
              "Franchise",
              "Independent",
              "Parent",
              "Subsidiary"
            ],
            "type": "string",
            "description": "One of `Branch`, `Franchise`, `Independent`, `Parent` or `Subsidiary`.",
            "nullable": true
          },
          "businessType": {
            "enum": [
              "Charity",
              "LimitedCompany",
              "LimitedLiabilityPartnership",
              "Partnership",
              "PublicSector",
              "SoleTrader"
            ],
            "type": "string",
            "description": "One of `Charity`, `LimitedCompany`, `LimitedLiabilityPartnership`, `Partnership`,\n`PublicSector` or `SoleTrader`.",
            "nullable": true
          },
          "registeredOfficeAddress": {
            "$ref": "#/components/schemas/Administration_AddressRequest"
          },
          "correspondenceAddress": {
            "$ref": "#/components/schemas/Administration_AddressRequest"
          },
          "primaryContactDetails": {
            "$ref": "#/components/schemas/Administration_ContactDetailsRequest"
          },
          "companyContactDetails": {
            "$ref": "#/components/schemas/Administration_ContactDetailsRequest"
          }
        },
        "additionalProperties": false,
        "description": "What every organisation in the request gets unless its own entry says otherwise."
      },
      "Administration_BulkOrganisationEntryRequest": {
        "type": "object",
        "properties": {
          "legalName": {
            "type": "string",
            "description": "Required. The registered legal name.",
            "nullable": true
          },
          "tradingName": {
            "type": "string",
            "description": "The trading name, if it differs from the legal name.",
            "nullable": true
          },
          "organisationType": {
            "enum": [
              "Branch",
              "Franchise",
              "Independent",
              "Parent",
              "Subsidiary"
            ],
            "type": "string",
            "description": "One of `Branch`, `Franchise`, `Independent`, `Parent` or `Subsidiary`.",
            "nullable": true
          },
          "businessType": {
            "enum": [
              "Charity",
              "LimitedCompany",
              "LimitedLiabilityPartnership",
              "Partnership",
              "PublicSector",
              "SoleTrader"
            ],
            "type": "string",
            "description": "One of `Charity`, `LimitedCompany`, `LimitedLiabilityPartnership`, `Partnership`,\n`PublicSector` or `SoleTrader`.",
            "nullable": true
          },
          "companyRegistrationNumber": {
            "type": "string",
            "description": "The Companies House registration number.",
            "nullable": true
          },
          "registeredOfficeAddress": {
            "$ref": "#/components/schemas/Administration_AddressRequest"
          },
          "correspondenceAddress": {
            "$ref": "#/components/schemas/Administration_AddressRequest"
          },
          "primaryContactDetails": {
            "$ref": "#/components/schemas/Administration_ContactDetailsRequest"
          },
          "companyContactDetails": {
            "$ref": "#/components/schemas/Administration_ContactDetailsRequest"
          },
          "externalId": {
            "type": "string",
            "description": "Your own identifier for this organisation, such as its id in your practice management system: 1 to 256 characters,\ncase-sensitive, unique among your account's organisations. Only your account sees it.",
            "nullable": true,
            "example": "client-0042"
          }
        },
        "additionalProperties": false,
        "description": "One organisation in a bulk create. Only `legalName` is required; everything else inherits\nfrom the defaults unless set here."
      },
      "Administration_CallerAccessResponse": {
        "type": "object",
        "properties": {
          "granted": {
            "type": "boolean",
            "description": "Whether you can act on this organisation. There is nothing else to say about it: everybody who\nreaches an organisation may do everything in it."
          }
        },
        "additionalProperties": false,
        "description": "What you can do with an organisation."
      },
      "Administration_ContactDetailsRequest": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "description": "The contact's name.",
            "nullable": true
          },
          "email": {
            "type": "string",
            "description": "The contact's email address.",
            "nullable": true
          },
          "phone": {
            "type": "string",
            "description": "The contact's phone number.",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "description": "A named contact."
      },
      "Administration_ContactResponse": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "description": "Their name.",
            "nullable": true
          },
          "email": {
            "type": "string",
            "description": "Their email address.",
            "nullable": true
          },
          "phone": {
            "type": "string",
            "description": "Their phone number.",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "description": "A person to contact; a part not recorded is null."
      },
      "Administration_ContentMetadataResponse": {
        "type": "object",
        "properties": {
          "dateFormat": {
            "type": "string"
          },
          "dateTimeFormat": {
            "type": "string"
          },
          "paginationToken": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Administration_CreateBrandingAssetUploadRequest": {
        "type": "object",
        "properties": {
          "type": {
            "enum": [
              "Logo",
              "IconMark",
              "CompanyLogo",
              "FontRegular",
              "FontMedium",
              "FontBold",
              "LoadingAnimation"
            ],
            "type": "string",
            "description": "Required. A company logo is uploaded through the organisation's own route.",
            "nullable": true
          },
          "contentType": {
            "type": "string",
            "description": "`image/svg+xml`, `image/png` or `font/woff2`; checked again against the file's content.",
            "nullable": true
          },
          "sizeBytes": {
            "type": "integer",
            "description": "The file's exact size: an oversized file is refused before it is sent, and the upload accepts only this many bytes.",
            "format": "int64",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "description": "Asks for somewhere to upload one brand file."
      },
      "Administration_CreateOrganisationGroupRequest": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "description": "Required. 2 to 80 characters, such as \"North team clients\".",
            "nullable": true
          },
          "description": {
            "type": "string",
            "description": "Optional. Up to 300 characters.",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "description": "An organisation group: a named set of your organisations, such as the clients one team looks after."
      },
      "Administration_CreateOrganisationRequest": {
        "type": "object",
        "properties": {
          "legalName": {
            "type": "string",
            "description": "Required. The registered legal name.",
            "nullable": true
          },
          "tradingName": {
            "type": "string",
            "description": "The trading name, if it differs from the legal name.",
            "nullable": true
          },
          "organisationType": {
            "enum": [
              "Branch",
              "Franchise",
              "Independent",
              "Parent",
              "Subsidiary"
            ],
            "type": "string",
            "description": "One of `Branch`, `Franchise`, `Independent`, `Parent` or `Subsidiary`.",
            "nullable": true
          },
          "businessType": {
            "enum": [
              "Charity",
              "LimitedCompany",
              "LimitedLiabilityPartnership",
              "Partnership",
              "PublicSector",
              "SoleTrader"
            ],
            "type": "string",
            "description": "One of `Charity`, `LimitedCompany`, `LimitedLiabilityPartnership`, `Partnership`,\n`PublicSector` or `SoleTrader`.",
            "nullable": true
          },
          "companyRegistrationNumber": {
            "type": "string",
            "description": "The Companies House registration number.",
            "nullable": true
          },
          "registeredOfficeAddress": {
            "$ref": "#/components/schemas/Administration_AddressRequest"
          },
          "correspondenceAddress": {
            "$ref": "#/components/schemas/Administration_AddressRequest"
          },
          "primaryContactDetails": {
            "$ref": "#/components/schemas/Administration_ContactDetailsRequest"
          },
          "companyContactDetails": {
            "$ref": "#/components/schemas/Administration_ContactDetailsRequest"
          },
          "externalId": {
            "type": "string",
            "description": "Your own identifier for this organisation, such as its id in your practice management system: 1 to 256 characters,\ncase-sensitive, unique among your account's organisations. Only your account sees it.",
            "nullable": true,
            "example": "client-0042"
          }
        },
        "additionalProperties": false,
        "description": "Adds an organisation to your account. Only `legalName` is required."
      },
      "Administration_CreateProfilePhotoUploadRequest": {
        "type": "object",
        "properties": {
          "contentType": {
            "type": "string",
            "description": "`image/png`, `image/jpeg`, `image/gif`, `image/webp` or `image/svg+xml`. Only an early\n            check: the stored type is decided from the file's bytes.",
            "nullable": true
          },
          "sizeBytes": {
            "type": "integer",
            "description": "The file's size, so an oversized file is refused before it is sent.",
            "format": "int64",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "description": "Asks for somewhere to upload a new profile photo for the signed-in person."
      },
      "Administration_CreateRoleRequest": {
        "type": "object",
        "properties": {
          "roleId": {
            "type": "string",
            "description": "Optional. `custom.` followed by 3 to 40 lower-case letters, numbers or hyphens, such as `custom.hr-team`.\nMade from the name when left out. It never changes once the role exists.",
            "nullable": true
          },
          "name": {
            "type": "string",
            "description": "Required. 2 to 60 characters, such as \"HR team\".",
            "nullable": true
          },
          "description": {
            "type": "string",
            "description": "Optional. Up to 300 characters saying who the role is for.",
            "nullable": true
          },
          "permissions": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Required. 1 to 100 permissions from the catalogue: `resource:verb` (`employee:read`), `resource:*`\nfor every level of one area, or `*` for everything. You can only include permissions you hold yourself.",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "description": "A role of your own: what it is called and exactly what it lets people do."
      },
      "Administration_CustomerOriginResponse": {
        "type": "object",
        "properties": {
          "type": {
            "enum": [
              "GuestInvitation"
            ],
            "type": "string",
            "description": "`GuestInvitation`: a guest invitation created it for the person invited."
          },
          "invitedBy": {
            "$ref": "#/components/schemas/Administration_AccountReferenceResponse"
          }
        },
        "additionalProperties": false,
        "description": "How an account came to exist."
      },
      "Administration_CustomerOwnerResponse": {
        "type": "object",
        "properties": {
          "principalId": {
            "type": "string",
            "description": "The owner's identifier, as used on the `/users/{principalId}` routes."
          },
          "email": {
            "type": "string",
            "description": "The address they sign in with.",
            "nullable": true
          },
          "displayName": {
            "type": "string",
            "description": "Their name, for display next to the id.",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "description": "Who owns the account."
      },
      "Administration_CustomerOwnerResponseContentResponse": {
        "type": "object",
        "properties": {
          "data": {
            "$ref": "#/components/schemas/Administration_CustomerOwnerResponse"
          },
          "metadata": {
            "$ref": "#/components/schemas/Administration_ContentMetadataResponse"
          }
        },
        "additionalProperties": false
      },
      "Administration_CustomerOwnerResponseResponseBody": {
        "type": "object",
        "properties": {
          "message": {
            "$ref": "#/components/schemas/Administration_MessageWithTokenResponse"
          },
          "content": {
            "$ref": "#/components/schemas/Administration_CustomerOwnerResponseContentResponse"
          },
          "validationIssues": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Administration_ValidationIssue"
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Administration_CustomerResponse": {
        "type": "object",
        "properties": {
          "customerId": {
            "type": "string",
            "description": "Your account's identifier. Informational only: it is never a parameter anywhere on this API."
          },
          "displayName": {
            "type": "string",
            "description": "The name shown across the administration screens and in invitations."
          },
          "owner": {
            "$ref": "#/components/schemas/Administration_CustomerOwnerResponse"
          },
          "billingStatus": {
            "enum": [
              "Billable",
              "AwaitingSetup"
            ],
            "type": "string",
            "description": "`Billable` or `AwaitingSetup`. While awaiting setup, creating organisations and API\n            tokens answers 403 `billing_not_set_up`; everything the account already has stays manageable."
          },
          "signIn": {
            "$ref": "#/components/schemas/Administration_CustomerSignInResponse"
          },
          "origin": {
            "$ref": "#/components/schemas/Administration_CustomerOriginResponse"
          },
          "managedBy": {
            "$ref": "#/components/schemas/Administration_AccountReferenceResponse"
          }
        },
        "additionalProperties": false,
        "description": "Your account: the customer every resource on this API belongs to."
      },
      "Administration_CustomerResponseContentResponse": {
        "type": "object",
        "properties": {
          "data": {
            "$ref": "#/components/schemas/Administration_CustomerResponse"
          },
          "metadata": {
            "$ref": "#/components/schemas/Administration_ContentMetadataResponse"
          }
        },
        "additionalProperties": false
      },
      "Administration_CustomerResponseResponseBody": {
        "type": "object",
        "properties": {
          "message": {
            "$ref": "#/components/schemas/Administration_MessageWithTokenResponse"
          },
          "content": {
            "$ref": "#/components/schemas/Administration_CustomerResponseContentResponse"
          },
          "validationIssues": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Administration_ValidationIssue"
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Administration_CustomerSignInResponse": {
        "type": "object",
        "properties": {
          "providers": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "The identity providers new people are linked to when invited, by name. Empty when everybody\nsigns in with a password."
          },
          "passwordSignIn": {
            "type": "string",
            "description": "Whether a person may have a password as well. `Allowed`: everybody gets one, and the\ninvitation is emailed as usual. `OnRequest`: only when the invitation asks with\n`signIn: Password`, say for a bureau outside your identity provider. `Denied`: never;\npeople are created without an invitation email and sign in through the provider alone."
          }
        },
        "additionalProperties": false,
        "description": "How an account signs its people in."
      },
      "Administration_DnsRecordResponse": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "description": "`CNAME`, `TXT`, `ALIAS`, or `HTTP-REDIRECT` for a certificate token served from\n            the customer's existing site (no-downtime set-up)."
          },
          "name": {
            "type": "string",
            "description": "The full record name, e.g. `payroll.acme.example`."
          },
          "value": {
            "type": "string"
          },
          "purpose": {
            "enum": [
              "Routing",
              "CertificateValidation",
              "Dkim",
              "ReturnPath"
            ],
            "type": "string",
            "description": "What a DNS record the customer must create is for."
          }
        },
        "additionalProperties": false,
        "description": "One DNS record the customer must create at their DNS provider."
      },
      "Administration_EmailSenderPatch": {
        "type": "object",
        "properties": {
          "fromName": {
            "type": "string",
            "nullable": true
          },
          "fromAddress": {
            "type": "string",
            "description": "A full address on one of the account's email domains.",
            "nullable": true
          },
          "replyTo": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "description": "One email's sender, merged field by field: a value overrides the default, `null` (or blank) goes back to the\ndefault, and a field left out is unchanged."
      },
      "Administration_EmailSenderResponse": {
        "type": "object",
        "properties": {
          "fromName": {
            "type": "string",
            "nullable": true
          },
          "fromAddress": {
            "type": "string",
            "nullable": true
          },
          "replyTo": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "description": "One email's own sender: a null field uses the account's default."
      },
      "Administration_EmployeeCountsResponse": {
        "type": "object",
        "properties": {
          "totalEmployeeCount": {
            "type": "integer",
            "description": "On the books, whether or not they have left.",
            "format": "int32"
          },
          "activeEmployeeCount": {
            "type": "integer",
            "description": "On the books and not left.",
            "format": "int32"
          },
          "leaverEmployeeCount": {
            "type": "integer",
            "description": "On the books and left.",
            "format": "int32"
          }
        },
        "additionalProperties": false,
        "description": "Headcounts for an organisation today. They trail the payroll by seconds: a headline figure, never one to\nfile or pay on."
      },
      "Administration_GrantRoleResponse": {
        "type": "object",
        "properties": {
          "scope": {
            "type": "string",
            "description": "`Customer` for every organisation in your account, `Group` for an organisation group, or `Organisation`."
          },
          "organisationId": {
            "type": "string",
            "description": "Set when the scope is `Organisation`.",
            "nullable": true
          },
          "groupId": {
            "type": "string",
            "description": "Set when the scope is `Group`.",
            "nullable": true
          },
          "roleId": {
            "type": "string"
          },
          "createdBy": {
            "type": "string",
            "description": "Who gave this access, as recorded: their email address, or their sign-in id when none was known. Null on access given before this was recorded.",
            "nullable": true
          },
          "createdDate": {
            "type": "string",
            "description": "When this access was given (ISO 8601, UTC). Null on access given before this was recorded.",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "description": "The role somebody holds at one place."
      },
      "Administration_GuestReleasedResponse": {
        "type": "object",
        "properties": {
          "principalId": {
            "type": "string"
          },
          "signInMoved": {
            "type": "boolean",
            "description": "True when they signed in through your identity provider: they were emailed a password reset and your provider can no\nlonger sign them in."
          }
        },
        "additionalProperties": false,
        "description": "A guest your account no longer manages."
      },
      "Administration_GuestReleasedResponseContentResponse": {
        "type": "object",
        "properties": {
          "data": {
            "$ref": "#/components/schemas/Administration_GuestReleasedResponse"
          },
          "metadata": {
            "$ref": "#/components/schemas/Administration_ContentMetadataResponse"
          }
        },
        "additionalProperties": false
      },
      "Administration_GuestReleasedResponseResponseBody": {
        "type": "object",
        "properties": {
          "message": {
            "$ref": "#/components/schemas/Administration_MessageWithTokenResponse"
          },
          "content": {
            "$ref": "#/components/schemas/Administration_GuestReleasedResponseContentResponse"
          },
          "validationIssues": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Administration_ValidationIssue"
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Administration_InviteUserRequest": {
        "type": "object",
        "properties": {
          "email": {
            "type": "string",
            "description": "Required. The address they sign in with. It is also their identity here, so inviting the same\naddress twice is recognised as the same person and answered as an access change.",
            "nullable": true
          },
          "givenName": {
            "type": "string",
            "description": "Their first name, used in the invitation.",
            "nullable": true
          },
          "familyName": {
            "type": "string",
            "description": "Their last name, used in the invitation.",
            "nullable": true
          },
          "organisationIds": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Deprecated: use `access`. Deprecated: use `access` with `Organisation` entries. The organisations to grant. State exactly one of\nthis and `allOrganisations`.",
            "nullable": true,
            "deprecated": true
          },
          "allOrganisations": {
            "type": "boolean",
            "description": "Deprecated: use `access`. Deprecated: use `access` with an `Account` entry. Give access to every organisation the account owns,\nincluding ones added later. Only somebody who already holds account-wide access may grant it. State exactly one of\nthis and `organisationIds`; a request giving both is refused rather than merged.",
            "nullable": true,
            "deprecated": true
          },
          "asGuest": {
            "type": "boolean",
            "description": "The person belongs to another business. They are invited into the organisations you pick, never\ninto the account: they cannot see your other organisations, your people or your settings, and\nyou can take the access back at any time. Give them organisations only: an `Account` or\n`OrganisationGroup` entry (or AllOrganisations) is refused for guests."
          },
          "signIn": {
            "type": "string",
            "description": "How they sign in. `IdentityProvider` links them to your account's identity provider;\n`Password` gives them a password of their own, for somebody outside your identity provider\nsuch as a bureau; `IdentityProviderAndPassword` does both, for somebody who signs in through\nthe provider day to day and also needs a direct login. Leave it out to use your account's default.\nAnything with a password is refused when your account signs people in through its identity\nprovider only, and anything with the provider when it has none.",
            "nullable": true
          },
          "access": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Administration_AccessGrantRequest"
            },
            "description": "The access to give: one grant per scope, each with its own role. Replaces `organisationIds`,\n`allOrganisations` and `roleId`, which are deprecated: send one or the other, never both (400\n`access_with_deprecated_fields`).",
            "nullable": true
          },
          "externalId": {
            "type": "string",
            "description": "Your own identifier for this person, such as their id in your HR system: 1 to 256 characters, case-sensitive,\nunique among your people and guests. It is the same value SCIM provisioning reads and writes as `externalId`.",
            "nullable": true,
            "example": "emp-00417"
          }
        },
        "additionalProperties": false,
        "description": "Invites somebody into your account, or gives more access to somebody already in it."
      },
      "Administration_IssueApiTokenRequest": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "description": "Required. A display name, unique within your account.",
            "nullable": true
          },
          "organisationIds": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Deprecated: use `access`. Deprecated: use `access` with `Organisation` entries. The organisations the token reaches. State exactly\none of this and `allOrganisations`.",
            "nullable": true,
            "deprecated": true
          },
          "allOrganisations": {
            "type": "boolean",
            "description": "Deprecated: use `access`. Deprecated: use `access` with an `Account` entry. Give the credential access to every organisation the\naccount owns, including ones added later,\ninstead of the ones named in `organisationIds`. State exactly one of the two. This is the\nwidest grant this API makes, so only somebody who already holds account-wide access may ask for it.",
            "nullable": true,
            "deprecated": true
          },
          "access": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Administration_AccessGrantRequest"
            },
            "description": "The access to give: one grant per scope, each with its own role. Replaces `organisationIds`,\n`allOrganisations` and `roleId`, which are deprecated: send one or the other, never both (400\n`access_with_deprecated_fields`).",
            "nullable": true
          },
          "allowedIpRanges": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Optional. Address ranges the token may be used from, such as `[\"203.0.113.0/24\"]`: up to 20, IPv4 or IPv6.\nLeave it out to allow any address. A request from anywhere else is refused, here and on every other API.",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "description": "Issues a new API token (client credential) for your account."
      },
      "Administration_LargestOrganisationResponse": {
        "type": "object",
        "properties": {
          "organisationId": {
            "type": "string",
            "description": "The organisation's identifier."
          },
          "name": {
            "type": "string",
            "description": "The trading name, else the legal name, else the identifier."
          },
          "activeEmployeeCount": {
            "type": "integer",
            "description": "Employees on the books and not left.",
            "format": "int32"
          }
        },
        "additionalProperties": false,
        "description": "One of the organisations with the most employees."
      },
      "Administration_MessageWithTokenResponse": {
        "type": "object",
        "properties": {
          "text": {
            "type": "string"
          },
          "token": {
            "type": "string"
          },
          "tokenArguments": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Administration_ValidationIssueArgument"
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Administration_ObjectContentResponse": {
        "type": "object",
        "properties": {
          "data": {},
          "metadata": {
            "$ref": "#/components/schemas/Administration_ContentMetadataResponse"
          }
        },
        "additionalProperties": false
      },
      "Administration_ObjectResponseBody": {
        "type": "object",
        "properties": {
          "message": {
            "$ref": "#/components/schemas/Administration_MessageWithTokenResponse"
          },
          "content": {
            "$ref": "#/components/schemas/Administration_ObjectContentResponse"
          },
          "validationIssues": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Administration_ValidationIssue"
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Administration_OrganisationAccessListResponse": {
        "type": "object",
        "properties": {
          "access": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Administration_OrganisationAccessResponse"
            }
          },
          "paginationToken": {
            "type": "string",
            "description": "Null on the last page. Also at `content.metadata.paginationToken`, which to prefer.",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "description": "A page of who has access to an organisation: given it directly, then through each organisation group, then account-wide."
      },
      "Administration_OrganisationAccessListResponseContentResponse": {
        "type": "object",
        "properties": {
          "data": {
            "$ref": "#/components/schemas/Administration_OrganisationAccessListResponse"
          },
          "metadata": {
            "$ref": "#/components/schemas/Administration_ContentMetadataResponse"
          }
        },
        "additionalProperties": false
      },
      "Administration_OrganisationAccessListResponseResponseBody": {
        "type": "object",
        "properties": {
          "message": {
            "$ref": "#/components/schemas/Administration_MessageWithTokenResponse"
          },
          "content": {
            "$ref": "#/components/schemas/Administration_OrganisationAccessListResponseContentResponse"
          },
          "validationIssues": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Administration_ValidationIssue"
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Administration_OrganisationAccessResponse": {
        "type": "object",
        "properties": {
          "principalId": {
            "type": "string",
            "description": "The person (`USER#…`) or API token (`M2M#…`)."
          },
          "type": {
            "enum": [
              "Person",
              "ApiToken"
            ],
            "type": "string",
            "description": "`Person` or `ApiToken`."
          },
          "displayName": {
            "type": "string",
            "description": "The person's name, or their email address when no name is stored; the API token's name."
          },
          "roleId": {
            "type": "string",
            "description": "The role this way in gives them, such as `administrator` or `custom.hr-team`."
          },
          "roleName": {
            "type": "string",
            "description": "The role's name, as the account that gave it calls it."
          },
          "via": {
            "$ref": "#/components/schemas/Administration_OrganisationAccessViaResponse"
          },
          "accountOwner": {
            "type": "boolean",
            "description": "True for the account's owner, who is an administrator of everything the account has and cannot be removed here.",
            "nullable": true
          },
          "createdBy": {
            "type": "string",
            "description": "Who gave this access, as recorded: their email address, or their sign-in id when none was known. Null on access given before this was recorded, for an account's owner, and when another account gave it.",
            "nullable": true
          },
          "createdDate": {
            "type": "string",
            "description": "When this access was given (ISO 8601, UTC). Null on access given before this was recorded and for an account's owner.",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "description": "One person or API token with access to an organisation, one way in. Somebody with two ways in is listed twice."
      },
      "Administration_OrganisationAccessViaResponse": {
        "type": "object",
        "properties": {
          "type": {
            "enum": [
              "Direct",
              "Group",
              "Account"
            ],
            "type": "string",
            "description": "`Direct`: given this organisation. `Group`: given an organisation group it is in. `Account`: given every organisation of the account that owns or manages it."
          },
          "groupId": {
            "type": "string",
            "description": "On `Group`, when the group is your account's: the organisation group. Another account's group is not identified.",
            "nullable": true
          },
          "groupName": {
            "type": "string",
            "description": "On `Group`, when the group is your account's: its name.",
            "nullable": true
          },
          "customerId": {
            "type": "string",
            "description": "On `Account`: the account. On `Group`: the account the group belongs to.",
            "nullable": true
          },
          "customerName": {
            "type": "string",
            "description": "The account's name.",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "description": "How somebody has access to an organisation."
      },
      "Administration_OrganisationBrandingListResponse": {
        "type": "object",
        "properties": {
          "organisations": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Administration_OrganisationBrandingLogoResponse"
            }
          }
        },
        "additionalProperties": false,
        "description": "The company logos of the organisations asked for that the caller can reach, in the order asked."
      },
      "Administration_OrganisationBrandingListResponseContentResponse": {
        "type": "object",
        "properties": {
          "data": {
            "$ref": "#/components/schemas/Administration_OrganisationBrandingListResponse"
          },
          "metadata": {
            "$ref": "#/components/schemas/Administration_ContentMetadataResponse"
          }
        },
        "additionalProperties": false
      },
      "Administration_OrganisationBrandingListResponseResponseBody": {
        "type": "object",
        "properties": {
          "message": {
            "$ref": "#/components/schemas/Administration_MessageWithTokenResponse"
          },
          "content": {
            "$ref": "#/components/schemas/Administration_OrganisationBrandingListResponseContentResponse"
          },
          "validationIssues": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Administration_ValidationIssue"
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Administration_OrganisationBrandingLogoResponse": {
        "type": "object",
        "properties": {
          "organisationId": {
            "type": "string"
          },
          "companyLogoSvgUrl": {
            "type": "string",
            "description": "A short-lived link to its logo, built as the single read builds it; null when it has none.",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "description": "One organisation's company logo, from the bulk read."
      },
      "Administration_OrganisationBrandingResponse": {
        "type": "object",
        "properties": {
          "organisationId": {
            "type": "string"
          },
          "companyLogoAssetId": {
            "type": "string",
            "nullable": true
          },
          "companyLogoSvgUrl": {
            "type": "string",
            "nullable": true
          },
          "accountOfRecord": {
            "$ref": "#/components/schemas/Administration_AccountOfRecordResponse"
          }
        },
        "additionalProperties": false,
        "description": "An organisation's own branding: its company logo, and whose brand it carries."
      },
      "Administration_OrganisationBrandingResponseContentResponse": {
        "type": "object",
        "properties": {
          "data": {
            "$ref": "#/components/schemas/Administration_OrganisationBrandingResponse"
          },
          "metadata": {
            "$ref": "#/components/schemas/Administration_ContentMetadataResponse"
          }
        },
        "additionalProperties": false
      },
      "Administration_OrganisationBrandingResponseResponseBody": {
        "type": "object",
        "properties": {
          "message": {
            "$ref": "#/components/schemas/Administration_MessageWithTokenResponse"
          },
          "content": {
            "$ref": "#/components/schemas/Administration_OrganisationBrandingResponseContentResponse"
          },
          "validationIssues": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Administration_ValidationIssue"
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Administration_OrganisationCreatedResponse": {
        "type": "object",
        "properties": {
          "organisationId": {
            "type": "string",
            "description": "The new organisation's identifier. Stable across every replay of the same `Idempotency-Key`."
          },
          "complete": {
            "type": "boolean",
            "description": "True when every setup step finished."
          },
          "completedSteps": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "The setup steps that finished."
          },
          "outstandingSteps": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "The setup steps that did not finish. Empty when `complete` is true; otherwise the organisation\nexists but needs attention from Flow Payroll support."
          }
        },
        "additionalProperties": false,
        "description": "The outcome of adding an organisation."
      },
      "Administration_OrganisationCreatedResponseContentResponse": {
        "type": "object",
        "properties": {
          "data": {
            "$ref": "#/components/schemas/Administration_OrganisationCreatedResponse"
          },
          "metadata": {
            "$ref": "#/components/schemas/Administration_ContentMetadataResponse"
          }
        },
        "additionalProperties": false
      },
      "Administration_OrganisationCreatedResponseResponseBody": {
        "type": "object",
        "properties": {
          "message": {
            "$ref": "#/components/schemas/Administration_MessageWithTokenResponse"
          },
          "content": {
            "$ref": "#/components/schemas/Administration_OrganisationCreatedResponseContentResponse"
          },
          "validationIssues": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Administration_ValidationIssue"
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Administration_OrganisationDetailResponse": {
        "type": "object",
        "properties": {
          "organisationId": {
            "type": "string",
            "description": "The organisation's identifier. Send it as `X-Org-Id` on requests to the other Flow Payroll APIs."
          },
          "legalName": {
            "type": "string",
            "description": "The registered legal name.",
            "nullable": true
          },
          "tradingName": {
            "type": "string",
            "description": "The trading name, when one is recorded.",
            "nullable": true
          },
          "organisationType": {
            "enum": [
              "Branch",
              "Franchise",
              "Independent",
              "Parent",
              "Subsidiary"
            ],
            "type": "string",
            "description": "One of `Branch`, `Franchise`, `Independent`, `Parent` or `Subsidiary`.",
            "nullable": true
          },
          "companyRegistrationNumber": {
            "type": "string",
            "description": "The Companies House registration number, when recorded.",
            "nullable": true
          },
          "payeReference": {
            "type": "string",
            "description": "The employer PAYE reference, once payroll has been set up.",
            "nullable": true
          },
          "employees": {
            "$ref": "#/components/schemas/Administration_EmployeeCountsResponse"
          },
          "callerAccess": {
            "$ref": "#/components/schemas/Administration_CallerAccessResponse"
          },
          "managedFor": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Administration_AccountReferenceResponse"
              }
            ],
            "description": "Present only on an organisation your account manages on its owner's behalf: the owning account, so a screen can say \"Managed for {name}\". Absent (null) for an organisation you own or reach as a guest.",
            "nullable": true
          },
          "managedBy": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Administration_AccountReferenceResponse"
              }
            ],
            "description": "Present only on an organisation your account owns that another account manages: that account, so a screen can say \"Managed by {name}\". Absent (null) otherwise, including for a guest of either account.",
            "nullable": true
          },
          "payer": {
            "enum": [
              "Owner",
              "ManagingAccount"
            ],
            "type": "string",
            "description": "On an organisation someone manages (`ManagedFor` or `ManagedBy` set): who it is billed to, `Owner` or\n`ManagingAccount`, so the owner's screen can say \"Billed to {name}\". Null when nobody else manages it.",
            "nullable": true
          },
          "profile": {
            "$ref": "#/components/schemas/Administration_OrganisationProfileResponse"
          },
          "externalId": {
            "type": "string",
            "description": "Your account's own identifier for this organisation, set on creation or with\n`PATCH /organisations/{organisationId}`. Absent when none is set, and on an organisation you reach as a guest.\nAnother account that owns or manages the same organisation keeps its own, which you never see.",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "description": "One organisation in full, read from the system that owns its record."
      },
      "Administration_OrganisationDetailResponseContentResponse": {
        "type": "object",
        "properties": {
          "data": {
            "$ref": "#/components/schemas/Administration_OrganisationDetailResponse"
          },
          "metadata": {
            "$ref": "#/components/schemas/Administration_ContentMetadataResponse"
          }
        },
        "additionalProperties": false
      },
      "Administration_OrganisationDetailResponseResponseBody": {
        "type": "object",
        "properties": {
          "message": {
            "$ref": "#/components/schemas/Administration_MessageWithTokenResponse"
          },
          "content": {
            "$ref": "#/components/schemas/Administration_OrganisationDetailResponseContentResponse"
          },
          "validationIssues": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Administration_ValidationIssue"
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Administration_OrganisationGroupAccessRequest": {
        "type": "object",
        "properties": {
          "roleId": {
            "type": "string",
            "description": "Required. The role they get in every organisation in the group; see `GET /roles`.",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "description": "Access to every organisation in a group, now and as organisations are added."
      },
      "Administration_OrganisationGroupGrantResponse": {
        "type": "object",
        "properties": {
          "principalId": {
            "type": "string",
            "description": "The person (`USER#…`) or API token (`M2M#…`)."
          },
          "groupId": {
            "type": "string"
          },
          "roleId": {
            "type": "string"
          }
        },
        "additionalProperties": false,
        "description": "Somebody's access through an organisation group."
      },
      "Administration_OrganisationGroupGrantResponseContentResponse": {
        "type": "object",
        "properties": {
          "data": {
            "$ref": "#/components/schemas/Administration_OrganisationGroupGrantResponse"
          },
          "metadata": {
            "$ref": "#/components/schemas/Administration_ContentMetadataResponse"
          }
        },
        "additionalProperties": false
      },
      "Administration_OrganisationGroupGrantResponseResponseBody": {
        "type": "object",
        "properties": {
          "message": {
            "$ref": "#/components/schemas/Administration_MessageWithTokenResponse"
          },
          "content": {
            "$ref": "#/components/schemas/Administration_OrganisationGroupGrantResponseContentResponse"
          },
          "validationIssues": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Administration_ValidationIssue"
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Administration_OrganisationGroupListResponse": {
        "type": "object",
        "properties": {
          "groups": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Administration_OrganisationGroupResponse"
            }
          },
          "paginationToken": {
            "type": "string",
            "description": "Null on the last page. Also at `content.metadata.paginationToken`, which to prefer.",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "description": "A page of your organisation groups."
      },
      "Administration_OrganisationGroupListResponseContentResponse": {
        "type": "object",
        "properties": {
          "data": {
            "$ref": "#/components/schemas/Administration_OrganisationGroupListResponse"
          },
          "metadata": {
            "$ref": "#/components/schemas/Administration_ContentMetadataResponse"
          }
        },
        "additionalProperties": false
      },
      "Administration_OrganisationGroupListResponseResponseBody": {
        "type": "object",
        "properties": {
          "message": {
            "$ref": "#/components/schemas/Administration_MessageWithTokenResponse"
          },
          "content": {
            "$ref": "#/components/schemas/Administration_OrganisationGroupListResponseContentResponse"
          },
          "validationIssues": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Administration_ValidationIssue"
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Administration_OrganisationGroupMemberListResponse": {
        "type": "object",
        "properties": {
          "organisations": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Administration_OrganisationGroupMemberResponse"
            }
          },
          "paginationToken": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "description": "A page of the organisations in a group."
      },
      "Administration_OrganisationGroupMemberListResponseContentResponse": {
        "type": "object",
        "properties": {
          "data": {
            "$ref": "#/components/schemas/Administration_OrganisationGroupMemberListResponse"
          },
          "metadata": {
            "$ref": "#/components/schemas/Administration_ContentMetadataResponse"
          }
        },
        "additionalProperties": false
      },
      "Administration_OrganisationGroupMemberListResponseResponseBody": {
        "type": "object",
        "properties": {
          "message": {
            "$ref": "#/components/schemas/Administration_MessageWithTokenResponse"
          },
          "content": {
            "$ref": "#/components/schemas/Administration_OrganisationGroupMemberListResponseContentResponse"
          },
          "validationIssues": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Administration_ValidationIssue"
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Administration_OrganisationGroupMemberResponse": {
        "type": "object",
        "properties": {
          "groupId": {
            "type": "string"
          },
          "organisationId": {
            "type": "string"
          },
          "addedDate": {
            "type": "string"
          },
          "added": {
            "type": "boolean",
            "description": "On an addition only: false when the organisation was already in the group, so nothing changed.",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "description": "One organisation in one organisation group."
      },
      "Administration_OrganisationGroupMemberResponseContentResponse": {
        "type": "object",
        "properties": {
          "data": {
            "$ref": "#/components/schemas/Administration_OrganisationGroupMemberResponse"
          },
          "metadata": {
            "$ref": "#/components/schemas/Administration_ContentMetadataResponse"
          }
        },
        "additionalProperties": false
      },
      "Administration_OrganisationGroupMemberResponseResponseBody": {
        "type": "object",
        "properties": {
          "message": {
            "$ref": "#/components/schemas/Administration_MessageWithTokenResponse"
          },
          "content": {
            "$ref": "#/components/schemas/Administration_OrganisationGroupMemberResponseContentResponse"
          },
          "validationIssues": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Administration_ValidationIssue"
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Administration_OrganisationGroupReferenceResponse": {
        "type": "object",
        "properties": {
          "groupId": {
            "type": "string",
            "description": "Pass it as `groupId` on `GET /organisations` to list only the group's organisations."
          },
          "name": {
            "type": "string",
            "description": "The group's name."
          }
        },
        "additionalProperties": false,
        "description": "One of your organisation groups, as a listed organisation names it."
      },
      "Administration_OrganisationGroupResponse": {
        "type": "object",
        "properties": {
          "groupId": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "description": {
            "type": "string",
            "nullable": true
          },
          "createdDate": {
            "type": "string"
          },
          "updatedDate": {
            "type": "string"
          },
          "organisationCount": {
            "type": "integer",
            "description": "How many organisations are in the group.",
            "format": "int64"
          },
          "usedBy": {
            "$ref": "#/components/schemas/Administration_OrganisationGroupUsedByResponse"
          }
        },
        "additionalProperties": false,
        "description": "An organisation group of your account."
      },
      "Administration_OrganisationGroupResponseContentResponse": {
        "type": "object",
        "properties": {
          "data": {
            "$ref": "#/components/schemas/Administration_OrganisationGroupResponse"
          },
          "metadata": {
            "$ref": "#/components/schemas/Administration_ContentMetadataResponse"
          }
        },
        "additionalProperties": false
      },
      "Administration_OrganisationGroupResponseResponseBody": {
        "type": "object",
        "properties": {
          "message": {
            "$ref": "#/components/schemas/Administration_MessageWithTokenResponse"
          },
          "content": {
            "$ref": "#/components/schemas/Administration_OrganisationGroupResponseContentResponse"
          },
          "validationIssues": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Administration_ValidationIssue"
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Administration_OrganisationGroupUsedByResponse": {
        "type": "object",
        "properties": {
          "people": {
            "type": "integer",
            "format": "int64"
          },
          "apiTokens": {
            "type": "integer",
            "format": "int64"
          }
        },
        "additionalProperties": false,
        "description": "How many people and API tokens have access through an organisation group."
      },
      "Administration_OrganisationListResponse": {
        "type": "object",
        "properties": {
          "organisations": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Administration_OrganisationSummaryResponse"
            },
            "description": "The page, in name order."
          },
          "paginationToken": {
            "type": "string",
            "description": "Null on the last page. Follow it until it is absent. Also published at\n`content.metadata.paginationToken`, which is the location to prefer.",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "description": "A page of organisations."
      },
      "Administration_OrganisationListResponseContentResponse": {
        "type": "object",
        "properties": {
          "data": {
            "$ref": "#/components/schemas/Administration_OrganisationListResponse"
          },
          "metadata": {
            "$ref": "#/components/schemas/Administration_ContentMetadataResponse"
          }
        },
        "additionalProperties": false
      },
      "Administration_OrganisationListResponseResponseBody": {
        "type": "object",
        "properties": {
          "message": {
            "$ref": "#/components/schemas/Administration_MessageWithTokenResponse"
          },
          "content": {
            "$ref": "#/components/schemas/Administration_OrganisationListResponseContentResponse"
          },
          "validationIssues": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Administration_ValidationIssue"
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Administration_OrganisationProfileResponse": {
        "type": "object",
        "properties": {
          "payeReference": {
            "type": "string",
            "description": "The employer PAYE reference, office number and reference (`123/AB45678`).",
            "nullable": true
          },
          "accountsOfficeReference": {
            "type": "string",
            "description": "HMRC's accounts office reference, for paying PAYE.",
            "nullable": true
          },
          "registeredOffice": {
            "$ref": "#/components/schemas/Administration_AddressResponse"
          },
          "primaryContact": {
            "$ref": "#/components/schemas/Administration_ContactResponse"
          },
          "lastCompletedPayRun": {
            "$ref": "#/components/schemas/Administration_PayRunGlanceResponse"
          },
          "nextPayRun": {
            "$ref": "#/components/schemas/Administration_PayRunGlanceResponse"
          },
          "payrollConfigs": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Administration_PayrollConfigGlanceResponse"
            },
            "description": "The organisation's payroll configs (its pay schedules), by name."
          }
        },
        "additionalProperties": false,
        "description": "An organisation's registered details and where its payroll stands."
      },
      "Administration_OrganisationResolvedBrandingResponse": {
        "type": "object",
        "properties": {
          "organisationId": {
            "type": "string"
          },
          "source": {
            "enum": [
              "Flow",
              "Customer"
            ],
            "type": "string",
            "description": "Whose brand a resolution produced."
          },
          "customerId": {
            "type": "string",
            "description": "The account whose brand applies; null when Source is `Flow`.",
            "nullable": true
          },
          "brandRevision": {
            "type": "string",
            "description": "That account's published revision; null for Flow.",
            "nullable": true
          },
          "publishedBrandPath": {
            "type": "string",
            "description": "`/_brand-of/{customerId}/`, the account's published brand folder on the same origin (`theme.css`,\n            `logos/logo.svg`, ...); null when Flow's brand applies.",
            "nullable": true
          },
          "productName": {
            "type": "string"
          },
          "hasLogo": {
            "type": "boolean",
            "description": "Whether that folder holds `logos/logo.svg`; false for Flow and for an account with no logo."
          },
          "hasIcon": {
            "type": "boolean",
            "description": "Whether that folder's `icons/icon.svg` is an icon the account uploaded; false for Flow and for an account with\nnone, whose folder holds Flow's icon for the browser tab only."
          },
          "poweredByFlow": {
            "type": "boolean"
          },
          "appShowsProductName": {
            "type": "boolean"
          },
          "loadingStyle": {
            "enum": [
              "Spinner",
              "Icon",
              "Animation"
            ],
            "type": "string",
            "description": "What the app shows while it waits, for an account's own brand."
          },
          "dark": {
            "$ref": "#/components/schemas/Administration_BrandDarkVersionsResponse"
          },
          "support": {
            "$ref": "#/components/schemas/Administration_BrandSupportResponse"
          },
          "accessMessages": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            },
            "description": "What the app tells that brand's people when their role cannot change something, per permissions area\n(`employee`, `working-pattern`, ...), in place of its own \"Ask whoever manages your access to change your\nrole.\" An area left out, and every area under Flow's brand, keeps the app's wording. Empty when there are none.",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "description": "Which brand the app shows for an organisation on Flow's own host, after the server's resolution (managing\naccount, else owner, each only when entitled and published, else Flow). No links that expire: the browser reads\nthe published files from PublishedBrandPath on its own origin."
      },
      "Administration_OrganisationResolvedBrandingResponseContentResponse": {
        "type": "object",
        "properties": {
          "data": {
            "$ref": "#/components/schemas/Administration_OrganisationResolvedBrandingResponse"
          },
          "metadata": {
            "$ref": "#/components/schemas/Administration_ContentMetadataResponse"
          }
        },
        "additionalProperties": false
      },
      "Administration_OrganisationResolvedBrandingResponseResponseBody": {
        "type": "object",
        "properties": {
          "message": {
            "$ref": "#/components/schemas/Administration_MessageWithTokenResponse"
          },
          "content": {
            "$ref": "#/components/schemas/Administration_OrganisationResolvedBrandingResponseContentResponse"
          },
          "validationIssues": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Administration_ValidationIssue"
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Administration_OrganisationSummaryResponse": {
        "type": "object",
        "properties": {
          "organisationId": {
            "type": "string",
            "description": "The organisation's identifier. Send it as `X-Org-Id` on requests to the other Flow Payroll APIs."
          },
          "legalName": {
            "type": "string",
            "description": "The registered legal name.",
            "nullable": true
          },
          "tradingName": {
            "type": "string",
            "description": "The trading name, when one is recorded.",
            "nullable": true
          },
          "organisationType": {
            "enum": [
              "Branch",
              "Franchise",
              "Independent",
              "Parent",
              "Subsidiary"
            ],
            "type": "string",
            "description": "One of `Branch`, `Franchise`, `Independent`, `Parent` or `Subsidiary`.",
            "nullable": true
          },
          "employees": {
            "$ref": "#/components/schemas/Administration_EmployeeCountsResponse"
          },
          "callerAccess": {
            "$ref": "#/components/schemas/Administration_CallerAccessResponse"
          },
          "accessType": {
            "enum": [
              "Customer",
              "Guest"
            ],
            "type": "string",
            "description": "`Customer` for an organisation this account owns; `Guest` for one owned by another\n            business that you reach by invitation. A guest organisation is managed by its own account: you\n            can open it, never administer it here."
          },
          "relationship": {
            "enum": [
              "Owned",
              "Managed"
            ],
            "type": "string",
            "description": "`Owned` for an organisation your account owns, `Managed` for one it manages on its owner's behalf; null for an\n            organisation you reach as a guest of another business.",
            "nullable": true
          },
          "managedFor": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Administration_AccountReferenceResponse"
              }
            ],
            "description": "Present only on an organisation your account manages on its owner's behalf: the owning account, so a screen can say \"Managed for {name}\". Absent (null) for an organisation you own or reach as a guest.",
            "nullable": true
          },
          "managedBy": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Administration_AccountReferenceResponse"
              }
            ],
            "description": "Present only on an organisation your account owns that another account manages: that account, so a screen can say \"Managed by {name}\". Absent (null) otherwise, including for a guest of either account.",
            "nullable": true
          },
          "payer": {
            "enum": [
              "Owner",
              "ManagingAccount"
            ],
            "type": "string",
            "description": "On an organisation someone manages (`ManagedFor` or `ManagedBy` set): who it is billed to, `Owner` or\n`ManagingAccount`, so the owner's screen can say \"Billed to {name}\". Null when nobody else manages it.",
            "nullable": true
          },
          "profile": {
            "$ref": "#/components/schemas/Administration_OrganisationProfileResponse"
          },
          "groups": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Administration_OrganisationGroupReferenceResponse"
            },
            "description": "Your account's organisation groups this organisation is in, by name. Another account's groups are never named here,\nincluding those of an account that manages or owns the same organisation. Empty for an organisation you reach as a\nguest."
          },
          "externalId": {
            "type": "string",
            "description": "Your account's own identifier for this organisation, set on creation or with\n`PATCH /organisations/{organisationId}`. Absent when none is set, and on an organisation you reach as a guest.\nAnother account that owns or manages the same organisation keeps its own, which you never see.",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "description": "One organisation as it appears in your account's list."
      },
      "Administration_OrganisationsSummaryResponse": {
        "type": "object",
        "properties": {
          "organisationCount": {
            "type": "integer",
            "description": "How many organisations.",
            "format": "int32"
          },
          "employees": {
            "$ref": "#/components/schemas/Administration_EmployeeCountsResponse"
          },
          "payroll": {
            "$ref": "#/components/schemas/Administration_PayrollActivityResponse"
          },
          "largestOrganisations": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Administration_LargestOrganisationResponse"
            },
            "description": "Up to 8, most active employees first; empty without the employee figures."
          }
        },
        "additionalProperties": false,
        "description": "Every organisation you can see, in total: the ones `GET /organisations` lists (your account's own, the ones it\nmanages, then guests), each counted once."
      },
      "Administration_OrganisationsSummaryResponseContentResponse": {
        "type": "object",
        "properties": {
          "data": {
            "$ref": "#/components/schemas/Administration_OrganisationsSummaryResponse"
          },
          "metadata": {
            "$ref": "#/components/schemas/Administration_ContentMetadataResponse"
          }
        },
        "additionalProperties": false
      },
      "Administration_OrganisationsSummaryResponseResponseBody": {
        "type": "object",
        "properties": {
          "message": {
            "$ref": "#/components/schemas/Administration_MessageWithTokenResponse"
          },
          "content": {
            "$ref": "#/components/schemas/Administration_OrganisationsSummaryResponseContentResponse"
          },
          "validationIssues": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Administration_ValidationIssue"
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Administration_PartnerDomainListResponse": {
        "type": "object",
        "properties": {
          "domains": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Administration_PartnerDomainResponse"
            }
          }
        },
        "additionalProperties": false
      },
      "Administration_PartnerDomainListResponseContentResponse": {
        "type": "object",
        "properties": {
          "data": {
            "$ref": "#/components/schemas/Administration_PartnerDomainListResponse"
          },
          "metadata": {
            "$ref": "#/components/schemas/Administration_ContentMetadataResponse"
          }
        },
        "additionalProperties": false
      },
      "Administration_PartnerDomainListResponseResponseBody": {
        "type": "object",
        "properties": {
          "message": {
            "$ref": "#/components/schemas/Administration_MessageWithTokenResponse"
          },
          "content": {
            "$ref": "#/components/schemas/Administration_PartnerDomainListResponseContentResponse"
          },
          "validationIssues": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Administration_ValidationIssue"
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Administration_PartnerDomainResponse": {
        "type": "object",
        "properties": {
          "hostname": {
            "type": "string",
            "description": "Lowercase, IDNA (punycode) form."
          },
          "environment": {
            "enum": [
              "Sandbox",
              "Production"
            ],
            "type": "string",
            "description": "Which Flow environment a partner domain serves. Production hostnames only in prod."
          },
          "certificateMode": {
            "enum": [
              "FlowManaged",
              "FlowManagedNoDowntime",
              "CustomerProvided"
            ],
            "type": "string",
            "description": "Who issues and renews the partner domain's certificate."
          },
          "status": {
            "enum": [
              "AwaitingDns",
              "Validating",
              "Active",
              "Failed",
              "Removing",
              "Removed",
              "Lapsed"
            ],
            "type": "string",
            "description": "Where a partner domain is in its set-up."
          },
          "failureReason": {
            "enum": [
              "DnsNotPointingAtUs",
              "CaaRecordBlocksCertificate",
              "CertificateValidationTimedOut",
              "DomainInUseElsewhere",
              "ApexNeedsAliasOrFlattening",
              "DnsNoLongerPointsAtUs",
              "CertificateNoLongerValid",
              "EdgeNoLongerServing"
            ],
            "type": "string",
            "description": "Set only when Status is `Failed`.",
            "nullable": true
          },
          "dnsRecords": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Administration_DnsRecordResponse"
            }
          },
          "nextStep": {
            "type": "string",
            "description": "Plain-English next step for whoever is looking at it."
          },
          "createdDate": {
            "type": "string"
          },
          "createdBy": {
            "type": "string"
          },
          "updatedDate": {
            "type": "string"
          },
          "updatedBy": {
            "type": "string"
          },
          "role": {
            "enum": [
              "App",
              "Files"
            ],
            "type": "string",
            "description": "What the host serves: the app, or the account's files."
          },
          "suggestedFilesHostname": {
            "type": "string",
            "description": "For an App host: the files address to suggest when adding one (`files.` plus the address without its first label).\nNull for a Files host.",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "description": "A web address the account's app is served on. Set up by Flow on request."
      },
      "Administration_PayRunGlanceResponse": {
        "type": "object",
        "properties": {
          "payrollConfigId": {
            "type": "string",
            "description": "The pay schedule it belongs to, as the payroll API names it."
          },
          "frequency": {
            "type": "string",
            "description": "The schedule's frequency, such as `Monthly` or `Weekly`."
          },
          "year": {
            "type": "integer",
            "description": "The tax year it falls in, by its starting year (`2026` for 2026 to 2027).",
            "format": "int32"
          },
          "period": {
            "type": "integer",
            "description": "Its period in that tax year.",
            "format": "int32"
          },
          "paymentDate": {
            "type": "string",
            "description": "When employees are paid, `yyyy-MM-dd`; null until set.",
            "nullable": true
          },
          "totalEmployees": {
            "type": "integer",
            "description": "How many employees it pays.",
            "format": "int32"
          }
        },
        "additionalProperties": false,
        "description": "One pay run at a glance."
      },
      "Administration_PayrollActivityResponse": {
        "type": "object",
        "properties": {
          "from": {
            "type": "string",
            "description": "The period's first day, yyyy-MM-dd."
          },
          "to": {
            "type": "string",
            "description": "The period's last day, yyyy-MM-dd."
          },
          "organisationsPaid": {
            "type": "integer",
            "description": "Organisations with at least one issued payslip paid in the period.",
            "format": "int64"
          },
          "payslips": {
            "type": "integer",
            "description": "Issued payslips paid in the period.",
            "format": "int64"
          },
          "employeesPaid": {
            "type": "integer",
            "description": "Employees with gross or net pay on at least one of them.",
            "format": "int64"
          },
          "gross": {
            "type": "number",
            "description": "Their gross pay.",
            "format": "double"
          },
          "net": {
            "type": "number",
            "description": "Their net pay.",
            "format": "double"
          },
          "employerCost": {
            "type": "number",
            "description": "What they cost the employers in all.",
            "format": "double"
          },
          "organisationCount": {
            "type": "integer",
            "description": "How many organisations these figures cover: the ones where you can see pay runs (`pay-run:read`), which may be\nfewer than the organisations you can see.",
            "format": "int64"
          }
        },
        "additionalProperties": false,
        "description": "Payroll run across the organisations you can see, over a period."
      },
      "Administration_PayrollConfigGlanceResponse": {
        "type": "object",
        "properties": {
          "payrollConfigId": {
            "type": "string",
            "description": "The payroll config, as the payroll API names it."
          },
          "name": {
            "type": "string",
            "description": "Its name; null when not set.",
            "nullable": true
          },
          "payFrequency": {
            "type": "string",
            "description": "How often it pays: `Weekly`, `Fortnightly`, `FourWeekly`, `Monthly`, `Quarterly`, `BiAnnually`, `Annual` or `Daily`.",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "description": "One payroll config (a pay schedule)."
      },
      "Administration_PeopleNamesResponse": {
        "type": "object",
        "properties": {
          "people": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Administration_PersonNameResponse"
            }
          }
        },
        "additionalProperties": false,
        "description": "The people and API tokens named, in the order asked; an id that does not reach the organisation is left out."
      },
      "Administration_PeopleNamesResponseContentResponse": {
        "type": "object",
        "properties": {
          "data": {
            "$ref": "#/components/schemas/Administration_PeopleNamesResponse"
          },
          "metadata": {
            "$ref": "#/components/schemas/Administration_ContentMetadataResponse"
          }
        },
        "additionalProperties": false
      },
      "Administration_PeopleNamesResponseResponseBody": {
        "type": "object",
        "properties": {
          "message": {
            "$ref": "#/components/schemas/Administration_MessageWithTokenResponse"
          },
          "content": {
            "$ref": "#/components/schemas/Administration_PeopleNamesResponseContentResponse"
          },
          "validationIssues": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Administration_ValidationIssue"
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Administration_PeoplePreferencesResponse": {
        "type": "object",
        "properties": {
          "nameOrder": {
            "enum": [
              "LastName",
              "FirstName"
            ],
            "type": "string",
            "description": "`LastName` (the default) or `FirstName`. Names always read first name first."
          }
        },
        "additionalProperties": false,
        "description": "How lists of people (employees, payslips, people with access) are sorted for this person."
      },
      "Administration_PersonNameResponse": {
        "type": "object",
        "properties": {
          "principalId": {
            "type": "string",
            "description": "The id as you sent it."
          },
          "type": {
            "type": "string",
            "description": "`Person` or `ApiToken`."
          },
          "name": {
            "type": "string",
            "description": "A person's name, else their email; an API token's name."
          },
          "email": {
            "type": "string",
            "description": "A person's email; absent for an API token.",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "description": "Who did something in an organisation, for a history to say so."
      },
      "Administration_ProfilePhotoRemovedResponse": {
        "type": "object",
        "properties": {
          "updatedDate": {
            "type": "string",
            "description": "When the removed photo had been set, ISO 8601 UTC."
          }
        },
        "additionalProperties": false,
        "description": "The profile photo that was removed."
      },
      "Administration_ProfilePhotoRemovedResponseContentResponse": {
        "type": "object",
        "properties": {
          "data": {
            "$ref": "#/components/schemas/Administration_ProfilePhotoRemovedResponse"
          },
          "metadata": {
            "$ref": "#/components/schemas/Administration_ContentMetadataResponse"
          }
        },
        "additionalProperties": false
      },
      "Administration_ProfilePhotoRemovedResponseResponseBody": {
        "type": "object",
        "properties": {
          "message": {
            "$ref": "#/components/schemas/Administration_MessageWithTokenResponse"
          },
          "content": {
            "$ref": "#/components/schemas/Administration_ProfilePhotoRemovedResponseContentResponse"
          },
          "validationIssues": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Administration_ValidationIssue"
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Administration_ProfilePhotoResponse": {
        "type": "object",
        "properties": {
          "url": {
            "type": "string",
            "description": "A link to the photo that works for 15 minutes. Ask again for a fresh one."
          },
          "updatedDate": {
            "type": "string",
            "description": "When the photo was last set, ISO 8601 UTC."
          }
        },
        "additionalProperties": false,
        "description": "The signed-in person's profile photo."
      },
      "Administration_ProfilePhotoResponseContentResponse": {
        "type": "object",
        "properties": {
          "data": {
            "$ref": "#/components/schemas/Administration_ProfilePhotoResponse"
          },
          "metadata": {
            "$ref": "#/components/schemas/Administration_ContentMetadataResponse"
          }
        },
        "additionalProperties": false
      },
      "Administration_ProfilePhotoResponseResponseBody": {
        "type": "object",
        "properties": {
          "message": {
            "$ref": "#/components/schemas/Administration_MessageWithTokenResponse"
          },
          "content": {
            "$ref": "#/components/schemas/Administration_ProfilePhotoResponseContentResponse"
          },
          "validationIssues": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Administration_ValidationIssue"
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Administration_ProfilePhotoUploadResponse": {
        "type": "object",
        "properties": {
          "uploadId": {
            "type": "string",
            "description": "Ask `GET /users/me/photo/uploads/{uploadId}` for the outcome after sending the file."
          },
          "url": {
            "type": "string",
            "description": "Send the file's bytes here, as the whole request body, before ExpiresDate."
          },
          "method": {
            "type": "string",
            "description": "Always `PUT`."
          },
          "headers": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            },
            "description": "Send every one unchanged. The body must be exactly the size asked for."
          },
          "maxSizeBytes": {
            "type": "integer",
            "description": "The largest photo accepted.",
            "format": "int64"
          },
          "expiresDate": {
            "type": "string"
          }
        },
        "additionalProperties": false,
        "description": "Where to send a profile photo. The server chose where it goes; the browser only sends the file."
      },
      "Administration_ProfilePhotoUploadResponseContentResponse": {
        "type": "object",
        "properties": {
          "data": {
            "$ref": "#/components/schemas/Administration_ProfilePhotoUploadResponse"
          },
          "metadata": {
            "$ref": "#/components/schemas/Administration_ContentMetadataResponse"
          }
        },
        "additionalProperties": false
      },
      "Administration_ProfilePhotoUploadResponseResponseBody": {
        "type": "object",
        "properties": {
          "message": {
            "$ref": "#/components/schemas/Administration_MessageWithTokenResponse"
          },
          "content": {
            "$ref": "#/components/schemas/Administration_ProfilePhotoUploadResponseContentResponse"
          },
          "validationIssues": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Administration_ValidationIssue"
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Administration_ProfilePhotoUploadStatusResponse": {
        "type": "object",
        "properties": {
          "uploadId": {
            "type": "string"
          },
          "status": {
            "enum": [
              "Processing",
              "Ready",
              "Rejected"
            ],
            "type": "string",
            "description": "Where an uploaded profile photo is in processing."
          },
          "token": {
            "type": "string",
            "description": "Set when Status is `Rejected`: the reason token.",
            "nullable": true
          },
          "message": {
            "type": "string",
            "description": "Set when Status is `Rejected`: what to do instead.",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "description": "What happened to one uploaded profile photo."
      },
      "Administration_ProfilePhotoUploadStatusResponseContentResponse": {
        "type": "object",
        "properties": {
          "data": {
            "$ref": "#/components/schemas/Administration_ProfilePhotoUploadStatusResponse"
          },
          "metadata": {
            "$ref": "#/components/schemas/Administration_ContentMetadataResponse"
          }
        },
        "additionalProperties": false
      },
      "Administration_ProfilePhotoUploadStatusResponseResponseBody": {
        "type": "object",
        "properties": {
          "message": {
            "$ref": "#/components/schemas/Administration_MessageWithTokenResponse"
          },
          "content": {
            "$ref": "#/components/schemas/Administration_ProfilePhotoUploadStatusResponseContentResponse"
          },
          "validationIssues": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Administration_ValidationIssue"
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Administration_PublishBrandingRequest": {
        "type": "object",
        "properties": {
          "fromRevision": {
            "type": "string",
            "description": "Optional. Republish this revision instead of the draft; the draft is left as it is.",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "description": "Publishes the draft, or republishes an older revision as a new one."
      },
      "Administration_RenameApiTokenRequest": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "description": "The new display name, unique within your account.",
            "nullable": true
          },
          "allowedIpRanges": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Address ranges the token may be used from, such as `[\"203.0.113.0/24\", \"2001:db8::/32\"]`: up to 20, IPv4 or\nIPv6. The list replaces the old one; `null` lets it be used from anywhere again.",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "description": "Changes a token's name, where it may be used from, or both. Leave a field out to keep it."
      },
      "Administration_RenameCustomerRequest": {
        "type": "object",
        "properties": {
          "displayName": {
            "type": "string",
            "description": "Required. The new display name.",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "description": "Renames your account. Which account is never a field: it comes from your credentials."
      },
      "Administration_ReplaceApiTokenOrganisationsRequest": {
        "type": "object",
        "properties": {
          "organisationIds": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "The complete set of organisations the token reaches afterwards.",
            "nullable": true
          },
          "roleId": {
            "type": "string",
            "description": "The role to give, such as `payroll-manager` or one of your own (`custom.hr-team`); see `GET /roles`.\nLeave it out to give your account's default role (`GET /customer/access-settings`); while your account cannot\ngive roles yet, that is `administrator`. An API token whose account's default role is for people only must name one.",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "description": "Replaces which organisations the token reaches through direct grants. An empty list is refused:\nrevoke the token instead."
      },
      "Administration_ReplaceUserOrganisationsRequest": {
        "type": "object",
        "properties": {
          "organisationIds": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "The complete set of organisations they hold a direct grant on afterwards.",
            "nullable": true
          },
          "roleId": {
            "type": "string",
            "description": "The role to give, such as `payroll-manager` or one of your own (`custom.hr-team`); see `GET /roles`.\nLeave it out to give your account's default role (`GET /customer/access-settings`); while your account cannot\ngive roles yet, that is `administrator`.",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "description": "Replaces the whole set of organisations a person holds a direct grant on. Does not affect\naccount-wide access."
      },
      "Administration_RoleHolderResponse": {
        "type": "object",
        "properties": {
          "principalId": {
            "type": "string",
            "description": "The person (`USER#…`) or API token (`M2M#…`)."
          },
          "scope": {
            "type": "string",
            "description": "`Customer` for the whole account, `Group` for an organisation group, or `Organisation`."
          },
          "organisationId": {
            "type": "string",
            "nullable": true
          },
          "groupId": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "description": "Somebody who holds a role, and where."
      },
      "Administration_RoleHoldersResponse": {
        "type": "object",
        "properties": {
          "people": {
            "type": "integer",
            "description": "People with the role: on every organisation, on an organisation group, or on single organisations.",
            "format": "int64"
          },
          "apiTokens": {
            "type": "integer",
            "description": "API tokens with the role, counted the same way.",
            "format": "int64"
          },
          "wholeAccountOnly": {
            "type": "boolean",
            "description": "True for `administrator` only: the counts cover people and API tokens who are administrators on every\norganisation, not those who are administrators of single organisations or organisation groups."
          }
        },
        "additionalProperties": false,
        "description": "How many people and API tokens have a role in your account. Each is counted once, wherever they have it."
      },
      "Administration_RoleInUseResponse": {
        "type": "object",
        "properties": {
          "roleId": {
            "type": "string"
          },
          "holders": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Administration_RoleHolderResponse"
            }
          }
        },
        "additionalProperties": false,
        "description": "Why a role cannot be deleted yet: up to 20 of the people and API tokens who still hold it."
      },
      "Administration_RoleInUseResponseContentResponse": {
        "type": "object",
        "properties": {
          "data": {
            "$ref": "#/components/schemas/Administration_RoleInUseResponse"
          },
          "metadata": {
            "$ref": "#/components/schemas/Administration_ContentMetadataResponse"
          }
        },
        "additionalProperties": false
      },
      "Administration_RoleInUseResponseResponseBody": {
        "type": "object",
        "properties": {
          "message": {
            "$ref": "#/components/schemas/Administration_MessageWithTokenResponse"
          },
          "content": {
            "$ref": "#/components/schemas/Administration_RoleInUseResponseContentResponse"
          },
          "validationIssues": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Administration_ValidationIssue"
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Administration_RoleListResponse": {
        "type": "object",
        "properties": {
          "roles": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Administration_RoleResponse"
            }
          }
        },
        "additionalProperties": false,
        "description": "Every role your account can give out: the built-in ones first, then your own by name."
      },
      "Administration_RoleListResponseContentResponse": {
        "type": "object",
        "properties": {
          "data": {
            "$ref": "#/components/schemas/Administration_RoleListResponse"
          },
          "metadata": {
            "$ref": "#/components/schemas/Administration_ContentMetadataResponse"
          }
        },
        "additionalProperties": false
      },
      "Administration_RoleListResponseResponseBody": {
        "type": "object",
        "properties": {
          "message": {
            "$ref": "#/components/schemas/Administration_MessageWithTokenResponse"
          },
          "content": {
            "$ref": "#/components/schemas/Administration_RoleListResponseContentResponse"
          },
          "validationIssues": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Administration_ValidationIssue"
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Administration_RoleResponse": {
        "type": "object",
        "properties": {
          "roleId": {
            "type": "string",
            "description": "How grants name it: `payroll-manager`, or `custom.hr-team` for one of your own."
          },
          "name": {
            "type": "string"
          },
          "description": {
            "type": "string",
            "nullable": true
          },
          "permissions": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Exactly what it lets people do, as catalogue selectors: `resource:verb`, `resource:*`, or `*`."
          },
          "assignableTo": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "`person`, `api-token` or both: who the role can be given to."
          },
          "builtIn": {
            "type": "boolean",
            "description": "True for the roles every account has. They cannot be changed or deleted."
          },
          "available": {
            "type": "boolean",
            "description": "False while only administrator can be given out. The other roles are listed so a screen can show them, and become\navailable without any change on your side."
          },
          "isDefault": {
            "type": "boolean",
            "description": "Whether it is the role people get when none is chosen for them."
          },
          "revision": {
            "type": "integer",
            "description": "Your own roles only: 1 when made, one more on every change.",
            "format": "int64",
            "nullable": true
          },
          "createdDate": {
            "type": "string",
            "nullable": true
          },
          "updatedDate": {
            "type": "string",
            "nullable": true
          },
          "holders": {
            "$ref": "#/components/schemas/Administration_RoleHoldersResponse"
          }
        },
        "additionalProperties": false,
        "description": "A role: one of the built-in ones, or one your account made."
      },
      "Administration_RoleResponseContentResponse": {
        "type": "object",
        "properties": {
          "data": {
            "$ref": "#/components/schemas/Administration_RoleResponse"
          },
          "metadata": {
            "$ref": "#/components/schemas/Administration_ContentMetadataResponse"
          }
        },
        "additionalProperties": false
      },
      "Administration_RoleResponseResponseBody": {
        "type": "object",
        "properties": {
          "message": {
            "$ref": "#/components/schemas/Administration_MessageWithTokenResponse"
          },
          "content": {
            "$ref": "#/components/schemas/Administration_RoleResponseContentResponse"
          },
          "validationIssues": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Administration_ValidationIssue"
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Administration_RoleRevisionListResponse": {
        "type": "object",
        "properties": {
          "revisions": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Administration_RoleRevisionResponse"
            }
          },
          "paginationToken": {
            "type": "string",
            "description": "Null on the last page. Also at `content.metadata.paginationToken`, which to prefer.",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "description": "A role's history, newest first."
      },
      "Administration_RoleRevisionListResponseContentResponse": {
        "type": "object",
        "properties": {
          "data": {
            "$ref": "#/components/schemas/Administration_RoleRevisionListResponse"
          },
          "metadata": {
            "$ref": "#/components/schemas/Administration_ContentMetadataResponse"
          }
        },
        "additionalProperties": false
      },
      "Administration_RoleRevisionListResponseResponseBody": {
        "type": "object",
        "properties": {
          "message": {
            "$ref": "#/components/schemas/Administration_MessageWithTokenResponse"
          },
          "content": {
            "$ref": "#/components/schemas/Administration_RoleRevisionListResponseContentResponse"
          },
          "validationIssues": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Administration_ValidationIssue"
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Administration_RoleRevisionResponse": {
        "type": "object",
        "properties": {
          "roleId": {
            "type": "string"
          },
          "revision": {
            "type": "integer",
            "format": "int64"
          },
          "change": {
            "type": "string",
            "description": "`Created`, `Changed` or `Deleted`."
          },
          "name": {
            "type": "string"
          },
          "description": {
            "type": "string",
            "nullable": true
          },
          "permissions": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "changedBy": {
            "type": "string",
            "description": "Who made the change."
          },
          "changedDate": {
            "type": "string"
          }
        },
        "additionalProperties": false,
        "description": "What one of your own roles looked like after one change."
      },
      "Administration_ScimAccessExtension": {
        "required": [
          "scope"
        ],
        "type": "object",
        "properties": {
          "scope": {
            "type": "string"
          }
        },
        "additionalProperties": false
      },
      "Administration_ScimAccessGrant": {
        "required": [
          "roleId",
          "scope"
        ],
        "type": "object",
        "properties": {
          "scope": {
            "$ref": "#/components/schemas/Administration_ScimAccessScope"
          },
          "roleId": {
            "type": "string"
          }
        },
        "additionalProperties": false
      },
      "Administration_ScimAccessScope": {
        "required": [
          "type"
        ],
        "type": "object",
        "properties": {
          "type": {
            "type": "string"
          },
          "id": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Administration_ScimEmail": {
        "required": [
          "value"
        ],
        "type": "object",
        "properties": {
          "value": {
            "type": "string"
          },
          "type": {
            "type": "string"
          },
          "primary": {
            "type": "boolean"
          }
        },
        "additionalProperties": false
      },
      "Administration_ScimError": {
        "required": [
          "detail",
          "status"
        ],
        "type": "object",
        "properties": {
          "schemas": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "status": {
            "type": "string"
          },
          "scimType": {
            "type": "string",
            "nullable": true
          },
          "detail": {
            "type": "string"
          }
        },
        "additionalProperties": false
      },
      "Administration_ScimGroupResource": {
        "required": [
          "displayName",
          "id",
          "meta",
          "urn:flowpayroll:scim:schemas:extension:access:2.0:Group"
        ],
        "type": "object",
        "properties": {
          "schemas": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "id": {
            "type": "string"
          },
          "displayName": {
            "type": "string"
          },
          "members": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Administration_ScimMember"
            },
            "nullable": true
          },
          "urn:flowpayroll:scim:schemas:extension:access:2.0:Group": {
            "$ref": "#/components/schemas/Administration_ScimAccessExtension"
          },
          "meta": {
            "$ref": "#/components/schemas/Administration_ScimMeta"
          }
        },
        "additionalProperties": false
      },
      "Administration_ScimGroupResourceScimListResponse": {
        "type": "object",
        "properties": {
          "schemas": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "totalResults": {
            "type": "integer",
            "format": "int32"
          },
          "itemsPerPage": {
            "type": "integer",
            "format": "int32"
          },
          "startIndex": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "nextCursor": {
            "type": "string",
            "nullable": true
          },
          "Resources": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Administration_ScimGroupResource"
            }
          }
        },
        "additionalProperties": false
      },
      "Administration_ScimMember": {
        "required": [
          "$ref",
          "value"
        ],
        "type": "object",
        "properties": {
          "value": {
            "type": "string"
          },
          "$ref": {
            "type": "string"
          },
          "type": {
            "type": "string"
          }
        },
        "additionalProperties": false
      },
      "Administration_ScimMeta": {
        "required": [
          "location",
          "resourceType"
        ],
        "type": "object",
        "properties": {
          "resourceType": {
            "type": "string"
          },
          "created": {
            "type": "string",
            "nullable": true
          },
          "location": {
            "type": "string"
          }
        },
        "additionalProperties": false
      },
      "Administration_ScimName": {
        "type": "object",
        "properties": {
          "givenName": {
            "type": "string",
            "nullable": true
          },
          "familyName": {
            "type": "string",
            "nullable": true
          },
          "formatted": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Administration_ScimUserAccessExtension": {
        "required": [
          "userType"
        ],
        "type": "object",
        "properties": {
          "userType": {
            "type": "string"
          },
          "access": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Administration_ScimAccessGrant"
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Administration_ScimUserResource": {
        "required": [
          "id",
          "meta"
        ],
        "type": "object",
        "properties": {
          "schemas": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "id": {
            "type": "string"
          },
          "externalId": {
            "type": "string",
            "nullable": true
          },
          "userName": {
            "type": "string",
            "nullable": true
          },
          "name": {
            "$ref": "#/components/schemas/Administration_ScimName"
          },
          "displayName": {
            "type": "string",
            "nullable": true
          },
          "emails": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Administration_ScimEmail"
            },
            "nullable": true
          },
          "active": {
            "type": "boolean"
          },
          "urn:flowpayroll:scim:schemas:extension:access:2.0:User": {
            "$ref": "#/components/schemas/Administration_ScimUserAccessExtension"
          },
          "meta": {
            "$ref": "#/components/schemas/Administration_ScimMeta"
          }
        },
        "additionalProperties": false
      },
      "Administration_ScimUserResourceScimListResponse": {
        "type": "object",
        "properties": {
          "schemas": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "totalResults": {
            "type": "integer",
            "format": "int32"
          },
          "itemsPerPage": {
            "type": "integer",
            "format": "int32"
          },
          "startIndex": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "nextCursor": {
            "type": "string",
            "nullable": true
          },
          "Resources": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Administration_ScimUserResource"
            }
          }
        },
        "additionalProperties": false
      },
      "Administration_SendingDomainListResponse": {
        "type": "object",
        "properties": {
          "sendingDomains": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Administration_SendingDomainResponse"
            }
          },
          "standardFromAddress": {
            "type": "string",
            "description": "Flow's fallback address, for an email with no standard address of its own. While the account has no verified domain\neach email comes from its own standard address (notification's email list says which), in the account's name."
          },
          "firstVerifiedDomain": {
            "type": "string",
            "description": "The verified domain an unset sender address uses, as `noreply@` it; null while none is verified.",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Administration_SendingDomainListResponseContentResponse": {
        "type": "object",
        "properties": {
          "data": {
            "$ref": "#/components/schemas/Administration_SendingDomainListResponse"
          },
          "metadata": {
            "$ref": "#/components/schemas/Administration_ContentMetadataResponse"
          }
        },
        "additionalProperties": false
      },
      "Administration_SendingDomainListResponseResponseBody": {
        "type": "object",
        "properties": {
          "message": {
            "$ref": "#/components/schemas/Administration_MessageWithTokenResponse"
          },
          "content": {
            "$ref": "#/components/schemas/Administration_SendingDomainListResponseContentResponse"
          },
          "validationIssues": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Administration_ValidationIssue"
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Administration_SendingDomainResponse": {
        "type": "object",
        "properties": {
          "domain": {
            "type": "string"
          },
          "status": {
            "enum": [
              "AwaitingDns",
              "Verified",
              "Failed"
            ],
            "type": "string",
            "description": "Where a sending domain is in its verification with the email provider."
          },
          "failureReason": {
            "type": "string",
            "description": "The email provider's own words, or null.",
            "nullable": true
          },
          "dkimVerified": {
            "type": "boolean"
          },
          "returnPathVerified": {
            "type": "boolean"
          },
          "dmarcFound": {
            "type": "boolean",
            "description": "Whether a DMARC record exists for the domain. Large mailbox providers require at least `p=none`;\nFlow never sets it, it only warns. Null when it could not be checked.",
            "nullable": true
          },
          "dnsRecords": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Administration_DnsRecordResponse"
            }
          },
          "nextStep": {
            "type": "string",
            "description": "Plain-English next step for whoever is looking at it."
          },
          "createdDate": {
            "type": "string"
          },
          "createdBy": {
            "type": "string"
          },
          "updatedDate": {
            "type": "string"
          },
          "updatedBy": {
            "type": "string"
          }
        },
        "additionalProperties": false,
        "description": "An email domain the account's emails can be sent from once verified. Set up by Flow on request."
      },
      "Administration_SupportSessionAttributesResponse": {
        "type": "object",
        "properties": {
          "hasPayRun": {
            "type": "boolean",
            "description": "Whether the organisation has any pay run, open or completed."
          },
          "lastPayRunStatus": {
            "type": "string",
            "description": "`Open` while a pay run is open, else `Completed`. Left out before the first pay run.",
            "nullable": true
          },
          "lastCompletedPayRunPayDate": {
            "type": "string",
            "description": "The pay date of the last completed pay run (`yyyy-MM-dd`).",
            "nullable": true
          },
          "nextPayRunPayDate": {
            "type": "string",
            "description": "The pay date of the open pay run that pays soonest (`yyyy-MM-dd`).",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "description": "Where the organisation's payroll stands when the session starts."
      },
      "Administration_SupportSessionResponse": {
        "type": "object",
        "properties": {
          "sessionId": {
            "type": "string",
            "description": "This session's id, also the token's `jti`. Quote it to support to find the session; it opens nothing on its own."
          },
          "token": {
            "type": "string",
            "description": "A signed JSON Web Token (RS256) saying who is asking and which organisation they are working in. Hand it to the\nsupport page in a message once the page has loaded; never put it in the page's address. It gives no access to\nthis API."
          },
          "embedUrl": {
            "type": "string",
            "description": "The address of the account's support page, to show in a frame."
          },
          "expiresAt": {
            "type": "string",
            "description": "When the token stops verifying, UTC (ISO 8601). Ask for another shortly before."
          },
          "attributes": {
            "$ref": "#/components/schemas/Administration_SupportSessionAttributesResponse"
          }
        },
        "additionalProperties": false,
        "description": "What the app needs to open an account's own support page for the signed-in person in one organisation."
      },
      "Administration_SupportSessionResponseContentResponse": {
        "type": "object",
        "properties": {
          "data": {
            "$ref": "#/components/schemas/Administration_SupportSessionResponse"
          },
          "metadata": {
            "$ref": "#/components/schemas/Administration_ContentMetadataResponse"
          }
        },
        "additionalProperties": false
      },
      "Administration_SupportSessionResponseResponseBody": {
        "type": "object",
        "properties": {
          "message": {
            "$ref": "#/components/schemas/Administration_MessageWithTokenResponse"
          },
          "content": {
            "$ref": "#/components/schemas/Administration_SupportSessionResponseContentResponse"
          },
          "validationIssues": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Administration_ValidationIssue"
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Administration_TransferCustomerOwnerRequest": {
        "type": "object",
        "properties": {
          "principalId": {
            "type": "string",
            "description": "Required. The new owner, who must already be one of the account's people.",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "description": "Hands the account to another of its users. Only the current owner may."
      },
      "Administration_UpdateAccessSettingsRequest": {
        "type": "object",
        "properties": {
          "defaultRoleId": {
            "type": "string",
            "description": "The role new access gets when no role is named: inviting a person, issuing an API token, giving an organisation or\nthe whole account, and people a SCIM client adds. It cannot include managing people, roles, API tokens or the\naccount."
          }
        },
        "additionalProperties": false,
        "description": "A JSON Merge Patch of your account's access settings."
      },
      "Administration_UpdateBrandingDraftRequest": {
        "type": "object",
        "properties": {
          "productName": {
            "type": "string",
            "description": "Required to publish. 2 to 40 characters."
          },
          "primaryColour": {
            "type": "string",
            "description": "Required to publish. Hex colour, `#RRGGBB`."
          },
          "primaryForegroundColour": {
            "type": "string",
            "description": "`null` derives it from the primary colour.",
            "nullable": true
          },
          "accentColour": {
            "type": "string",
            "nullable": true
          },
          "fontSource": {
            "enum": [
              "Curated",
              "Uploaded"
            ],
            "type": "string"
          },
          "fontCuratedKey": {
            "type": "string",
            "nullable": true
          },
          "fontFamily": {
            "type": "string",
            "nullable": true
          },
          "fontRegularAssetId": {
            "type": "string",
            "nullable": true
          },
          "fontMediumAssetId": {
            "type": "string",
            "nullable": true
          },
          "fontBoldAssetId": {
            "type": "string",
            "nullable": true
          },
          "fontLicenceConfirmed": {
            "type": "boolean",
            "description": "`true` records the caller and the time as the licence confirmation. Required before an uploaded font can be published.",
            "nullable": true
          },
          "logoAssetId": {
            "type": "string",
            "nullable": true
          },
          "iconAssetId": {
            "type": "string",
            "nullable": true
          },
          "logoDarkAssetId": {
            "type": "string",
            "description": "The logo on a dark background (an asset id from a `Logo` upload). Null uses the light one.",
            "nullable": true
          },
          "iconDarkAssetId": {
            "type": "string",
            "description": "The icon on a dark background (an asset id from an `IconMark` upload). Null uses the light one.",
            "nullable": true
          },
          "loadingStyle": {
            "enum": [
              "Spinner",
              "Icon",
              "Animation"
            ],
            "type": "string"
          },
          "loadingAnimationAssetId": {
            "type": "string",
            "description": "From a `LoadingAnimation` upload.",
            "nullable": true
          },
          "loadingAnimationDarkAssetId": {
            "type": "string",
            "description": "From a `LoadingAnimation` upload. Null uses the light one.",
            "nullable": true
          },
          "emailButtonShape": {
            "enum": [
              "Rounded",
              "Square",
              "Pill"
            ],
            "type": "string",
            "description": "The corners of the buttons in emails."
          },
          "emailHeaderStyle": {
            "enum": [
              "Plain",
              "BrandBar"
            ],
            "type": "string",
            "description": "How the top of each email looks."
          },
          "supportEmail": {
            "type": "string",
            "nullable": true
          },
          "supportUrl": {
            "type": "string",
            "description": "`https` only.",
            "nullable": true
          },
          "supportEmbedUrl": {
            "type": "string",
            "description": "The address of the account's own support page, which the payroll app shows in a panel. `https` only, without\na fragment. Null offers no support panel.",
            "nullable": true
          },
          "supportPanelWidth": {
            "type": "integer",
            "description": "How wide, in pixels, the payroll app draws the support panel on a desktop: 360 to 720. Null uses 420. Phones always\nshow it at full width.",
            "format": "int32",
            "nullable": true
          },
          "privacyUrl": {
            "type": "string",
            "description": "`https` only.",
            "nullable": true
          },
          "termsUrl": {
            "type": "string",
            "description": "`https` only.",
            "nullable": true
          },
          "helpLinksFallback": {
            "enum": [
              "Hide",
              "FlowGuides"
            ],
            "type": "string"
          },
          "emailFromName": {
            "type": "string",
            "nullable": true
          },
          "emailFromAddress": {
            "type": "string",
            "description": "The address every email comes from, such as `payroll@acme.example`, on one of the account's email domains\n(`GET /customer/branding/sender-options`). Used while that domain is verified; removed, emails come from\n`noreply@` the account's first verified domain, or Flow's standard address when it has none.",
            "nullable": true
          },
          "emailSenderOverrides": {
            "type": "object",
            "additionalProperties": {
              "allOf": [
                {
                  "$ref": "#/components/schemas/Administration_EmailSenderPatch"
                }
              ],
              "nullable": true
            },
            "description": "Per kind of email, keyed by email type (`PayslipGeneratedEvent`, `P60GeneratedEvent`, ...), the name,\naddress or reply-to it uses instead of the default. Merged key by key: an object changes the fields it names,\n`null` puts that email back on the default, and keys left out are unchanged, so one request edits any number\nof emails. `null` for the whole field puts every email back on the default.",
            "nullable": true
          },
          "accessMessages": {
            "type": "object",
            "additionalProperties": {
              "type": "string",
              "nullable": true
            },
            "description": "What the payroll app tells the account's people when their role cannot change something, per permissions area\n(`employee`, `working-pattern`, ... as `GET /roles` names them), in place of the app's own\n\"Ask whoever manages your access to change your role.\" Plain text, up to 200 characters, e.g. \"Employee details\ncome from your HR system. Change them there.\" Merged key by key (RFC 7396): a string sets that area's sentence,\n`null` or an empty string puts the area back on the app's wording, and areas left out are unchanged.\n`null` for the whole field puts every area back.",
            "nullable": true
          },
          "emailReplyTo": {
            "type": "string",
            "nullable": true
          },
          "emailFooterText": {
            "type": "string",
            "nullable": true
          },
          "legalFooter": {
            "type": "string",
            "description": "Up to 300 characters.",
            "nullable": true
          },
          "documentsShowLogo": {
            "type": "boolean"
          },
          "documentsUseBrandColour": {
            "type": "boolean"
          },
          "appShowsProductName": {
            "type": "boolean",
            "description": "Show the product name beside the logo in the app. With no logo the name always shows."
          },
          "signInShowsProductName": {
            "type": "boolean",
            "description": "Show the product name beside the logo on the sign-in page. With no logo the name always shows."
          },
          "emailsShowProductName": {
            "type": "boolean",
            "description": "Show the product name beside the logo in emails. With no logo the name always shows."
          },
          "documentsShowProductName": {
            "type": "boolean",
            "description": "Show the product name beside the logo on payslips and letters. With no logo the name always shows."
          }
        },
        "additionalProperties": false,
        "description": "A JSON Merge Patch (RFC 7396) of the branding draft: a field left out stays as it is, a field sent as\n`null` is removed, anything else replaces it. Field names match `settings` on the draft.\nFlow-controlled fields (white label on, Powered by Flow, allowances) are not here and cannot be sent.\nWhich version it changes is the request's `If-Match`, never a body field."
      },
      "Administration_UpdateOrganisationBrandingRequest": {
        "type": "object",
        "properties": {
          "companyLogoAssetId": {
            "type": "string",
            "description": "From `POST /customer/branding/assets`; `null` removes the company logo.",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "description": "A JSON Merge Patch of an organisation's branding. The company logo is the only field an organisation sets."
      },
      "Administration_UpdateOrganisationGroupRequest": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "description": "2 to 80 characters."
          },
          "description": {
            "type": "string",
            "description": "Up to 300 characters. `null` clears it.",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "description": "A JSON Merge Patch (RFC 7396) of an organisation group: leave a field out to keep it, send `null` to clear the description."
      },
      "Administration_UpdateOrganisationRequest": {
        "type": "object",
        "properties": {
          "externalId": {
            "type": "string",
            "description": "Your account's own identifier for this organisation: 1 to 256 characters, case-sensitive, unique among your\naccount's organisations. `null` clears it.",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "description": "A JSON Merge Patch (RFC 7396) of what your account records about one of its organisations: leave a field out to keep\nit, send `null` to clear it. The organisation's names, type and references are its payroll record's, changed there."
      },
      "Administration_UpdatePeoplePreferencesRequest": {
        "type": "object",
        "properties": {
          "nameOrder": {
            "enum": [
              "LastName",
              "FirstName"
            ],
            "type": "string",
            "description": "`LastName` or `FirstName`; `null` puts it back to `LastName`.",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "description": "A merge patch of the people preferences."
      },
      "Administration_UpdateRoleRequest": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "description": "2 to 60 characters."
          },
          "description": {
            "type": "string",
            "description": "Up to 300 characters. `null` clears it.",
            "nullable": true
          },
          "permissions": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "The whole new list, replacing the old one."
          }
        },
        "additionalProperties": false,
        "description": "A JSON Merge Patch (RFC 7396) of one of your own roles: leave a field out to keep it, send `null` to clear the\ndescription. Everyone who holds the role gets the change at once."
      },
      "Administration_UpdateUserPreferencesRequest": {
        "type": "object",
        "properties": {
          "people": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Administration_UpdatePeoplePreferencesRequest"
              }
            ],
            "description": "How lists of people are sorted. `null` puts every one of them back to its default.",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "description": "A JSON Merge Patch (RFC 7396) of the signed-in person's preferences: name only what changes, and everything left\nout stays as it is. `null` puts a preference, or a whole group, back to its default. A field this API does not\nknow is refused rather than ignored, so a misspelt preference is never mistaken for a saved one."
      },
      "Administration_UpdateUserRequest": {
        "type": "object",
        "properties": {
          "externalId": {
            "type": "string",
            "description": "Your own identifier for this person or guest: 1 to 256 characters, case-sensitive, unique among your people and guests, and the same\nvalue SCIM provisioning reads and writes. `null` clears it.",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "description": "A JSON Merge Patch (RFC 7396) of a person in your account: leave a field out to keep it, send `null` to clear it.\nTheir name and sign-in address belong to their sign-in account and their access to the access routes, so neither\nchanges here."
      },
      "Administration_UserDetailResponse": {
        "type": "object",
        "properties": {
          "user": {
            "$ref": "#/components/schemas/Administration_UserSummaryResponse"
          },
          "organisationIds": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Deprecated: use `access`. Deprecated: use `access`. Every organisation they hold a direct grant on.",
            "deprecated": true
          },
          "coversWholeCustomer": {
            "type": "boolean",
            "description": "Deprecated: use `access`. Deprecated: use `access`. True when they also hold account-wide access, which reaches every organisation the\naccount owns, including ones added later. When true, `organisationIds` is not the whole picture and is\nusually empty.",
            "deprecated": true
          },
          "access": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Administration_AccessGrantResponse"
            },
            "description": "Their grants in your account, in the shape `POST /users` takes: account-wide first, then each organisation\ngroup, then each organisation. A grant from before roles existed reads as `administrator`."
          },
          "guestAccess": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Administration_AccessGrantResponse"
            },
            "description": "On `GET /users/me` only: your grants on other accounts' organisations, where you are a guest, in the same\nshape. Empty elsewhere."
          },
          "isOwner": {
            "type": "boolean",
            "description": "On `GET /users/me` only: whether you own your account. Absent elsewhere.",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "description": "One person in full: who they are, and everything they reach."
      },
      "Administration_UserDetailResponseContentResponse": {
        "type": "object",
        "properties": {
          "data": {
            "$ref": "#/components/schemas/Administration_UserDetailResponse"
          },
          "metadata": {
            "$ref": "#/components/schemas/Administration_ContentMetadataResponse"
          }
        },
        "additionalProperties": false
      },
      "Administration_UserDetailResponseResponseBody": {
        "type": "object",
        "properties": {
          "message": {
            "$ref": "#/components/schemas/Administration_MessageWithTokenResponse"
          },
          "content": {
            "$ref": "#/components/schemas/Administration_UserDetailResponseContentResponse"
          },
          "validationIssues": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Administration_ValidationIssue"
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Administration_UserInvitationResentResponse": {
        "type": "object",
        "properties": {
          "principalId": {
            "type": "string",
            "description": "The person the invitation went to."
          }
        },
        "additionalProperties": false,
        "description": "The person whose invitation was resent."
      },
      "Administration_UserInvitationResentResponseContentResponse": {
        "type": "object",
        "properties": {
          "data": {
            "$ref": "#/components/schemas/Administration_UserInvitationResentResponse"
          },
          "metadata": {
            "$ref": "#/components/schemas/Administration_ContentMetadataResponse"
          }
        },
        "additionalProperties": false
      },
      "Administration_UserInvitationResentResponseResponseBody": {
        "type": "object",
        "properties": {
          "message": {
            "$ref": "#/components/schemas/Administration_MessageWithTokenResponse"
          },
          "content": {
            "$ref": "#/components/schemas/Administration_UserInvitationResentResponseContentResponse"
          },
          "validationIssues": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Administration_ValidationIssue"
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Administration_UserInvitedResponse": {
        "type": "object",
        "properties": {
          "principalId": {
            "type": "string",
            "description": "The person invited or changed."
          },
          "alreadyExisted": {
            "type": "boolean",
            "description": "True when the address already belonged to somebody in your account, so this was an access change\nrather than a new invitation."
          },
          "grantedOrganisationIds": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Organisations this call added."
          },
          "alreadyHeldOrganisationIds": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Organisations they already held, so asking again changed nothing for them."
          },
          "coversWholeCustomer": {
            "type": "boolean",
            "description": "Whether they hold account-wide access after this call."
          },
          "invitationEmailed": {
            "type": "boolean",
            "description": "Whether an invitation email was sent. False on an access change: they already have a working\naccount, and a second invitation would replace the invitation link they may be part way through\nusing."
          },
          "roleId": {
            "type": "string",
            "description": "The role given with the access this call added. Access already held keeps its own role. Null when the request\nsent `access`, whose entries carry their own.",
            "nullable": true
          },
          "access": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Administration_AccessGrantResponse"
            },
            "description": "The grants this call gave, each with its role; ways in they already held are left out and keep\ntheir own role. Null when the request used the deprecated fields.",
            "nullable": true
          },
          "signsInElsewhere": {
            "type": "boolean",
            "description": "True when they already had an account and sign in through an identity provider that is not your account's own:\nwhoever runs that provider controls their sign-in, including turning it off. Check that is what you want."
          }
        },
        "additionalProperties": false,
        "description": "What an invitation did."
      },
      "Administration_UserInvitedResponseContentResponse": {
        "type": "object",
        "properties": {
          "data": {
            "$ref": "#/components/schemas/Administration_UserInvitedResponse"
          },
          "metadata": {
            "$ref": "#/components/schemas/Administration_ContentMetadataResponse"
          }
        },
        "additionalProperties": false
      },
      "Administration_UserInvitedResponseResponseBody": {
        "type": "object",
        "properties": {
          "message": {
            "$ref": "#/components/schemas/Administration_MessageWithTokenResponse"
          },
          "content": {
            "$ref": "#/components/schemas/Administration_UserInvitedResponseContentResponse"
          },
          "validationIssues": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Administration_ValidationIssue"
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Administration_UserListResponse": {
        "type": "object",
        "properties": {
          "users": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Administration_UserSummaryResponse"
            },
            "description": "The page."
          },
          "paginationToken": {
            "type": "string",
            "description": "Null on the last page. Follow it until it is absent. Also published at\n`content.metadata.paginationToken`, which is the location to prefer.",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "description": "A page of people."
      },
      "Administration_UserListResponseContentResponse": {
        "type": "object",
        "properties": {
          "data": {
            "$ref": "#/components/schemas/Administration_UserListResponse"
          },
          "metadata": {
            "$ref": "#/components/schemas/Administration_ContentMetadataResponse"
          }
        },
        "additionalProperties": false
      },
      "Administration_UserListResponseResponseBody": {
        "type": "object",
        "properties": {
          "message": {
            "$ref": "#/components/schemas/Administration_MessageWithTokenResponse"
          },
          "content": {
            "$ref": "#/components/schemas/Administration_UserListResponseContentResponse"
          },
          "validationIssues": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Administration_ValidationIssue"
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Administration_UserOrganisationsResponse": {
        "type": "object",
        "properties": {
          "principalId": {
            "type": "string",
            "description": "The person."
          },
          "organisationIds": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Every organisation they hold a direct grant on."
          },
          "coversWholeCustomer": {
            "type": "boolean",
            "description": "Whether they also hold account-wide access, which reaches every organisation the account owns,\nincluding ones added later. Read this before treating an empty list as no access. Nothing on the\norganisations collection can create or remove it."
          },
          "roles": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Administration_GrantRoleResponse"
            },
            "description": "The role at each place they have access: account-wide first, then each organisation. A grant from before roles\nexisted reads as `administrator`."
          }
        },
        "additionalProperties": false,
        "description": "The organisations one person reaches, after a read or a change."
      },
      "Administration_UserOrganisationsResponseContentResponse": {
        "type": "object",
        "properties": {
          "data": {
            "$ref": "#/components/schemas/Administration_UserOrganisationsResponse"
          },
          "metadata": {
            "$ref": "#/components/schemas/Administration_ContentMetadataResponse"
          }
        },
        "additionalProperties": false
      },
      "Administration_UserOrganisationsResponseResponseBody": {
        "type": "object",
        "properties": {
          "message": {
            "$ref": "#/components/schemas/Administration_MessageWithTokenResponse"
          },
          "content": {
            "$ref": "#/components/schemas/Administration_UserOrganisationsResponseContentResponse"
          },
          "validationIssues": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Administration_ValidationIssue"
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Administration_UserPreferencesResponse": {
        "type": "object",
        "properties": {
          "people": {
            "$ref": "#/components/schemas/Administration_PeoplePreferencesResponse"
          }
        },
        "additionalProperties": false,
        "description": "The signed-in person's own preferences, every one of them, each at its default until they choose. Grouped by the\npart of the app a preference is about; a new preference arrives inside its group, or as a new group, and never\nchanges the shape of one that exists."
      },
      "Administration_UserPreferencesResponseContentResponse": {
        "type": "object",
        "properties": {
          "data": {
            "$ref": "#/components/schemas/Administration_UserPreferencesResponse"
          },
          "metadata": {
            "$ref": "#/components/schemas/Administration_ContentMetadataResponse"
          }
        },
        "additionalProperties": false
      },
      "Administration_UserPreferencesResponseResponseBody": {
        "type": "object",
        "properties": {
          "message": {
            "$ref": "#/components/schemas/Administration_MessageWithTokenResponse"
          },
          "content": {
            "$ref": "#/components/schemas/Administration_UserPreferencesResponseContentResponse"
          },
          "validationIssues": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Administration_ValidationIssue"
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Administration_UserRevokedResponse": {
        "type": "object",
        "properties": {
          "principalId": {
            "type": "string",
            "description": "The person removed."
          },
          "signsInThroughIdentityProvider": {
            "type": "boolean",
            "description": "They sign in through their organisation's identity provider. Removing them here stops them signing in to Flow\nPayroll; their account at the identity provider is not ours to close, so tell whoever runs it."
          }
        },
        "additionalProperties": false,
        "description": "Confirmation that somebody was removed from the account."
      },
      "Administration_UserRevokedResponseContentResponse": {
        "type": "object",
        "properties": {
          "data": {
            "$ref": "#/components/schemas/Administration_UserRevokedResponse"
          },
          "metadata": {
            "$ref": "#/components/schemas/Administration_ContentMetadataResponse"
          }
        },
        "additionalProperties": false
      },
      "Administration_UserRevokedResponseResponseBody": {
        "type": "object",
        "properties": {
          "message": {
            "$ref": "#/components/schemas/Administration_MessageWithTokenResponse"
          },
          "content": {
            "$ref": "#/components/schemas/Administration_UserRevokedResponseContentResponse"
          },
          "validationIssues": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Administration_ValidationIssue"
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Administration_UserSummaryResponse": {
        "type": "object",
        "properties": {
          "principalId": {
            "type": "string",
            "description": "The person's stable identifier on this platform. Address them with it on every\n`/users/{principalId}` route."
          },
          "email": {
            "type": "string",
            "description": "The address they sign in with.",
            "nullable": true
          },
          "givenName": {
            "type": "string",
            "description": "Their first name, as invited.",
            "nullable": true
          },
          "familyName": {
            "type": "string",
            "description": "Their last name, as invited.",
            "nullable": true
          },
          "accountState": {
            "enum": [
              "unknown",
              "invited",
              "active",
              "disabled"
            ],
            "type": "string",
            "description": "`invited` until they first sign in, `active` once they have, `disabled` when their\n            sign-in has been switched off, and `unknown` when the identity directory could not be reached\n            for this row. Somebody linked to an identity provider is `active` from the start: there is\n            no invitation to accept."
          },
          "detailsAvailable": {
            "type": "boolean",
            "description": "False when the identity directory did not answer for this person. Their name and email address\nare then the last values stored and may be out of date or absent. The row is still returned."
          },
          "invitedDate": {
            "type": "string",
            "description": "When they were first given access to this account.",
            "nullable": true
          },
          "accessType": {
            "enum": [
              "Customer",
              "Guest"
            ],
            "type": "string",
            "description": "`Customer` for one of the account's own people; `Guest` for somebody from another\n            business who reaches organisations here by invitation. A guest row shows only the access this\n            account granted, and their account is not this account's to manage."
          },
          "signInProviders": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "The identity providers this person signs in through, by name. Empty or absent when they sign\nin with a password.",
            "nullable": true
          },
          "passwordSignIn": {
            "type": "string",
            "description": "`Denied` when they sign in through their identity provider alone: no invitation link was\n            sent, the invitation cannot be resent, and there is nothing to reset. `Allowed` when they\n            have a password. Absent on accounts created before sign-in was recorded.",
            "nullable": true
          },
          "externalId": {
            "type": "string",
            "description": "Your own identifier for this person, set with `PATCH /users/{principalId}` or on invitation, and the same value\nSCIM provisioning reads and writes. Absent when none is set. A guest's is your account's own label for them.",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "description": "One person in your account."
      },
      "Administration_ValidationIssue": {
        "type": "object",
        "properties": {
          "field": {
            "type": "string"
          },
          "reason": {
            "type": "string"
          },
          "reasonToken": {
            "type": "string"
          },
          "reasonTokenArguments": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Administration_ValidationIssueArgument"
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Administration_ValidationIssueArgument": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string"
          },
          "value": {}
        },
        "additionalProperties": false
      },
      "EmailWording_ContentMetadataResponse": {
        "type": "object",
        "required": [
          "dateFormat",
          "dateTimeFormat"
        ],
        "properties": {
          "dateFormat": {
            "type": "string"
          },
          "dateTimeFormat": {
            "type": "string"
          },
          "paginationToken": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "EmailWording_EmailRenderedPreviewRequest": {
        "type": "object",
        "description": "Both optional: no body previews what is saved, in the published brand.",
        "properties": {
          "wording": {
            "allOf": [
              {
                "$ref": "#/components/schemas/EmailWording_EmailWordingPatch"
              }
            ],
            "nullable": true
          },
          "brand": {
            "type": "string",
            "enum": [
              "Live",
              "Draft"
            ],
            "default": "Live"
          }
        },
        "additionalProperties": false
      },
      "EmailWording_EmailRenderedPreviewResponse": {
        "type": "object",
        "required": [
          "eventType",
          "subject",
          "html",
          "text"
        ],
        "properties": {
          "eventType": {
            "type": "string"
          },
          "subject": {
            "type": "string"
          },
          "html": {
            "type": "string"
          },
          "text": {
            "type": "string"
          }
        },
        "additionalProperties": false
      },
      "EmailWording_EmailRenderedPreviewResponseContentResponse": {
        "type": "object",
        "properties": {
          "data": {
            "$ref": "#/components/schemas/EmailWording_EmailRenderedPreviewResponse"
          },
          "metadata": {
            "$ref": "#/components/schemas/EmailWording_ContentMetadataResponse"
          }
        },
        "additionalProperties": false
      },
      "EmailWording_EmailRenderedPreviewResponseResponseBody": {
        "type": "object",
        "required": [
          "message"
        ],
        "properties": {
          "message": {
            "$ref": "#/components/schemas/EmailWording_MessageWithTokenResponse"
          },
          "validationIssues": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/EmailWording_ValidationIssue"
            },
            "nullable": true
          },
          "content": {
            "$ref": "#/components/schemas/EmailWording_EmailRenderedPreviewResponseContentResponse"
          }
        },
        "additionalProperties": false
      },
      "EmailWording_EmailTestSendResponse": {
        "type": "object",
        "required": [
          "eventType",
          "sentTo"
        ],
        "properties": {
          "eventType": {
            "type": "string"
          },
          "sentTo": {
            "type": "string"
          }
        },
        "additionalProperties": false
      },
      "EmailWording_EmailTestSendResponseContentResponse": {
        "type": "object",
        "properties": {
          "data": {
            "$ref": "#/components/schemas/EmailWording_EmailTestSendResponse"
          },
          "metadata": {
            "$ref": "#/components/schemas/EmailWording_ContentMetadataResponse"
          }
        },
        "additionalProperties": false
      },
      "EmailWording_EmailTestSendResponseResponseBody": {
        "type": "object",
        "required": [
          "message"
        ],
        "properties": {
          "message": {
            "$ref": "#/components/schemas/EmailWording_MessageWithTokenResponse"
          },
          "validationIssues": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/EmailWording_ValidationIssue"
            },
            "nullable": true
          },
          "content": {
            "$ref": "#/components/schemas/EmailWording_EmailTestSendResponseContentResponse"
          }
        },
        "additionalProperties": false
      },
      "EmailWording_EmailWording": {
        "type": "object",
        "properties": {
          "subject": {
            "type": "string",
            "nullable": true
          },
          "heading": {
            "type": "string",
            "nullable": true
          },
          "intro": {
            "type": "string",
            "nullable": true
          },
          "closing": {
            "type": "string",
            "nullable": true
          },
          "buttonLabel": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "EmailWording_EmailWordingPatch": {
        "type": "object",
        "description": "Absent: keep. null: clear and inherit. Text: set.",
        "properties": {
          "subject": {
            "type": "string",
            "nullable": true
          },
          "heading": {
            "type": "string",
            "nullable": true
          },
          "intro": {
            "type": "string",
            "nullable": true
          },
          "closing": {
            "type": "string",
            "nullable": true
          },
          "buttonLabel": {
            "type": "string",
            "nullable": true
          },
          "enabled": {
            "type": "boolean",
            "nullable": true,
            "description": "false: switch the email off. true: on. null: follow the account."
          }
        },
        "additionalProperties": false
      },
      "EmailWording_EmailWordingPreviewResponse": {
        "type": "object",
        "required": [
          "eventType",
          "wording"
        ],
        "properties": {
          "eventType": {
            "type": "string"
          },
          "wording": {
            "$ref": "#/components/schemas/EmailWording_EmailWording"
          }
        },
        "additionalProperties": false
      },
      "EmailWording_EmailWordingPreviewResponseContentResponse": {
        "type": "object",
        "properties": {
          "data": {
            "$ref": "#/components/schemas/EmailWording_EmailWordingPreviewResponse"
          },
          "metadata": {
            "$ref": "#/components/schemas/EmailWording_ContentMetadataResponse"
          }
        },
        "additionalProperties": false
      },
      "EmailWording_EmailWordingPreviewResponseResponseBody": {
        "type": "object",
        "required": [
          "message"
        ],
        "properties": {
          "message": {
            "$ref": "#/components/schemas/EmailWording_MessageWithTokenResponse"
          },
          "validationIssues": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/EmailWording_ValidationIssue"
            },
            "nullable": true
          },
          "content": {
            "$ref": "#/components/schemas/EmailWording_EmailWordingPreviewResponseContentResponse"
          }
        },
        "additionalProperties": false
      },
      "EmailWording_EmailWordingRevisionListResponse": {
        "type": "object",
        "required": [
          "revisions"
        ],
        "properties": {
          "revisions": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/EmailWording_EmailWordingRevisionResponse"
            }
          },
          "paginationToken": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "EmailWording_EmailWordingRevisionListResponseContentResponse": {
        "type": "object",
        "properties": {
          "data": {
            "$ref": "#/components/schemas/EmailWording_EmailWordingRevisionListResponse"
          },
          "metadata": {
            "$ref": "#/components/schemas/EmailWording_ContentMetadataResponse"
          }
        },
        "additionalProperties": false
      },
      "EmailWording_EmailWordingRevisionListResponseResponseBody": {
        "type": "object",
        "required": [
          "message"
        ],
        "properties": {
          "message": {
            "$ref": "#/components/schemas/EmailWording_MessageWithTokenResponse"
          },
          "validationIssues": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/EmailWording_ValidationIssue"
            },
            "nullable": true
          },
          "content": {
            "$ref": "#/components/schemas/EmailWording_EmailWordingRevisionListResponseContentResponse"
          }
        },
        "additionalProperties": false
      },
      "EmailWording_EmailWordingRevisionResponse": {
        "type": "object",
        "required": [
          "revisionId",
          "wording",
          "createdDate",
          "createdBy"
        ],
        "properties": {
          "revisionId": {
            "type": "string"
          },
          "wording": {
            "$ref": "#/components/schemas/EmailWording_EmailWording"
          },
          "enabled": {
            "type": "boolean",
            "nullable": true
          },
          "createdDate": {
            "type": "string",
            "format": "date-time"
          },
          "createdBy": {
            "type": "string"
          }
        },
        "additionalProperties": false
      },
      "EmailWording_EmailWordingSettingsResponse": {
        "type": "object",
        "required": [
          "eventType",
          "level",
          "audience",
          "enabled",
          "canBeSwitchedOff",
          "wording",
          "inherited",
          "standard",
          "placeholders",
          "hasButton",
          "locked"
        ],
        "properties": {
          "eventType": {
            "type": "string"
          },
          "level": {
            "type": "string",
            "enum": [
              "Organisation",
              "Account"
            ]
          },
          "audience": {
            "type": "string",
            "enum": [
              "Employees",
              "AppUsers",
              "Administrators"
            ]
          },
          "enabled": {
            "type": "boolean"
          },
          "canBeSwitchedOff": {
            "type": "boolean"
          },
          "wording": {
            "$ref": "#/components/schemas/EmailWording_EmailWording"
          },
          "inherited": {
            "$ref": "#/components/schemas/EmailWording_EmailWording"
          },
          "standard": {
            "$ref": "#/components/schemas/EmailWording_EmailWording"
          },
          "placeholders": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/EmailWording_WordingPlaceholderResponse"
            }
          },
          "hasButton": {
            "type": "boolean"
          },
          "locked": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "updatedDate": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "updatedBy": {
            "type": "string",
            "nullable": true
          },
          "standardFromAddress": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "EmailWording_EmailWordingSettingsResponseContentResponse": {
        "type": "object",
        "properties": {
          "data": {
            "$ref": "#/components/schemas/EmailWording_EmailWordingSettingsResponse"
          },
          "metadata": {
            "$ref": "#/components/schemas/EmailWording_ContentMetadataResponse"
          }
        },
        "additionalProperties": false
      },
      "EmailWording_EmailWordingSettingsResponseListContentResponse": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/EmailWording_EmailWordingSettingsResponse"
            }
          },
          "metadata": {
            "$ref": "#/components/schemas/EmailWording_ContentMetadataResponse"
          }
        },
        "additionalProperties": false
      },
      "EmailWording_EmailWordingSettingsResponseListResponseBody": {
        "type": "object",
        "required": [
          "message"
        ],
        "properties": {
          "message": {
            "$ref": "#/components/schemas/EmailWording_MessageWithTokenResponse"
          },
          "validationIssues": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/EmailWording_ValidationIssue"
            },
            "nullable": true
          },
          "content": {
            "$ref": "#/components/schemas/EmailWording_EmailWordingSettingsResponseListContentResponse"
          }
        },
        "additionalProperties": false
      },
      "EmailWording_EmailWordingSettingsResponseResponseBody": {
        "type": "object",
        "required": [
          "message"
        ],
        "properties": {
          "message": {
            "$ref": "#/components/schemas/EmailWording_MessageWithTokenResponse"
          },
          "validationIssues": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/EmailWording_ValidationIssue"
            },
            "nullable": true
          },
          "content": {
            "$ref": "#/components/schemas/EmailWording_EmailWordingSettingsResponseContentResponse"
          }
        },
        "additionalProperties": false
      },
      "EmailWording_MessageWithTokenResponse": {
        "type": "object",
        "required": [
          "text",
          "token"
        ],
        "properties": {
          "text": {
            "type": "string"
          },
          "token": {
            "type": "string"
          },
          "tokenArguments": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/EmailWording_ValidationIssueArgument"
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "EmailWording_ObjectResponseBody": {
        "type": "object",
        "required": [
          "message"
        ],
        "properties": {
          "message": {
            "$ref": "#/components/schemas/EmailWording_MessageWithTokenResponse"
          },
          "validationIssues": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/EmailWording_ValidationIssue"
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "EmailWording_ValidationIssue": {
        "type": "object",
        "required": [
          "field",
          "reason",
          "reasonToken"
        ],
        "properties": {
          "field": {
            "type": "string"
          },
          "reason": {
            "type": "string"
          },
          "reasonToken": {
            "type": "string"
          },
          "reasonTokenArguments": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/EmailWording_ValidationIssueArgument"
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "EmailWording_ValidationIssueArgument": {
        "type": "object",
        "required": [
          "name"
        ],
        "properties": {
          "name": {
            "type": "string"
          },
          "value": {}
        },
        "additionalProperties": false
      },
      "EmailWording_WordingPlaceholderResponse": {
        "type": "object",
        "required": [
          "key"
        ],
        "properties": {
          "key": {
            "type": "string"
          },
          "sample": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Pay_AddEmployeeToPayrollRunDto": {
        "type": "object",
        "required": [
          "employeeId"
        ],
        "properties": {
          "employeeId": {
            "type": "string",
            "description": "The ID of the former employee to add to the pay run",
            "example": "employee-001"
          }
        }
      },
      "Pay_AddPayrollLineItemAttachmentsRequestDto": {
        "type": "object",
        "required": [
          "attachments"
        ],
        "properties": {
          "attachments": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Pay_CreateAttachmentRequestDto"
            },
            "description": "The collection of attachment metadata to add"
          }
        }
      },
      "Pay_AddressDto": {
        "type": "object",
        "properties": {
          "line1": {
            "type": "string",
            "nullable": true,
            "description": "First line of the address; one of the address lines (line1, line2, county, city), each 1 to 35 characters starting with a letter or number.",
            "example": "123 Main Street"
          },
          "line2": {
            "type": "string",
            "nullable": true,
            "description": "Second line of the address; one of the address lines (line1, line2, county, city), each 1 to 35 characters starting with a letter or number.",
            "example": "Apt 4B"
          },
          "city": {
            "type": "string",
            "nullable": true,
            "description": "Town or city; one of the address lines (line1, line2, county, city), each 1 to 35 characters starting with a letter or number.",
            "example": "London"
          },
          "county": {
            "type": "string",
            "nullable": true,
            "description": "County; one of the address lines (line1, line2, county, city), each 1 to 35 characters starting with a letter or number.",
            "example": "Greater London"
          },
          "postcode": {
            "type": "string",
            "nullable": true,
            "description": "Postcode; checked against HMRC's UK postcode format when countryCode is GB or blank.",
            "example": "SW1A 1AA"
          },
          "countryCode": {
            "type": "string",
            "nullable": true,
            "description": "ISO 3166-1 alpha-2 country code. Defaults to \"GB\" when omitted or blank.",
            "example": "GB"
          }
        }
      },
      "Pay_AddressDtoMergePatch": {
        "type": "object",
        "properties": {
          "line1": {
            "type": "string",
            "nullable": true,
            "description": "First line of the address; one of the address lines (line1, line2, county, city), each 1 to 35 characters starting with a letter or number.",
            "example": "123 Main Street"
          },
          "line2": {
            "type": "string",
            "nullable": true,
            "description": "Second line of the address; one of the address lines (line1, line2, county, city), each 1 to 35 characters starting with a letter or number.",
            "example": "Apt 4B"
          },
          "city": {
            "type": "string",
            "nullable": true,
            "description": "Town or city; one of the address lines (line1, line2, county, city), each 1 to 35 characters starting with a letter or number.",
            "example": "London"
          },
          "county": {
            "type": "string",
            "nullable": true,
            "description": "County; one of the address lines (line1, line2, county, city), each 1 to 35 characters starting with a letter or number.",
            "example": "Greater London"
          },
          "postcode": {
            "type": "string",
            "nullable": true,
            "description": "Postcode; checked against HMRC's UK postcode format when countryCode is GB or blank.",
            "example": "SW1A 1AA"
          },
          "countryCode": {
            "type": "string",
            "nullable": true,
            "description": "ISO 3166-1 alpha-2 country code. Defaults to \"GB\" when omitted or blank.",
            "example": "GB"
          }
        }
      },
      "Pay_AgentGovernmentGatewayCretentialsDto": {
        "allOf": [
          {
            "$ref": "#/components/schemas/Pay_GovernmentGatewayCretentialsDto"
          },
          {
            "type": "object",
            "properties": {
              "agentId": {
                "type": "string",
                "nullable": true,
                "description": "The agent identifier stored with the agent credentials for reference; it is not sent to HMRC."
              }
            }
          }
        ]
      },
      "Pay_AmountUsageDto": {
        "type": "object",
        "properties": {
          "amountLeft": {
            "type": "number",
            "format": "decimal",
            "description": "Amount left",
            "example": 100
          },
          "amountUsed": {
            "type": "number",
            "format": "decimal",
            "description": "Amount used",
            "example": 100
          }
        }
      },
      "Pay_ApprenticeshipLevyDto": {
        "type": "object",
        "properties": {
          "levyDueYtd": {
            "type": "number",
            "format": "decimal",
            "description": "Levy due year to date",
            "example": 1000
          },
          "taxMonth": {
            "type": "integer",
            "format": "int32",
            "description": "Tax month",
            "example": 1
          },
          "annualAllowance": {
            "type": "number",
            "format": "decimal",
            "description": "Annual allowance",
            "example": 15000
          }
        }
      },
      "Pay_ApprenticeshipLevySettingsDto": {
        "type": "object",
        "properties": {
          "isEnabled": {
            "type": "boolean",
            "description": "Whether the organisation has an apprenticeship levy",
            "example": true
          },
          "annualAllowanceAmount": {
            "type": "number",
            "format": "decimal",
            "description": "The annual apprenticeship levy allowance amount set for the organisation",
            "example": 15000
          }
        }
      },
      "Pay_AttachmentResponseDto": {
        "type": "object",
        "required": [
          "id",
          "lineItemId",
          "filename",
          "contentType",
          "fileSize",
          "uploadedDate",
          "uploadedBy",
          "downloadUrl",
          "downloadUrlExpiresAt"
        ],
        "properties": {
          "id": {
            "type": "string",
            "description": "The unique identifier for the attachment"
          },
          "lineItemId": {
            "type": "string",
            "description": "The unique identifier of the associated payroll line item"
          },
          "filename": {
            "type": "string",
            "description": "The original filename of the attachment"
          },
          "contentType": {
            "type": "string",
            "description": "The MIME type of the file"
          },
          "fileSize": {
            "type": "integer",
            "format": "int64",
            "description": "The size of the file in bytes"
          },
          "uploadedDate": {
            "type": "string",
            "format": "date-time",
            "description": "The date and time the file was uploaded (ISO 8601 format)"
          },
          "uploadedBy": {
            "type": "string",
            "description": "The identifier of the user who uploaded the file"
          },
          "downloadUrl": {
            "type": "string",
            "format": "uri",
            "description": "A link that downloads the file, valid for 60 minutes. Open it as it is; it needs no credentials."
          },
          "downloadUrlExpiresAt": {
            "type": "string",
            "format": "date-time",
            "description": "When the download link stops working (ISO 8601 format)"
          }
        }
      },
      "Pay_AttachmentUploadResponseDto": {
        "type": "object",
        "required": [
          "attachmentId",
          "filename",
          "uploadUrl",
          "expiresAt",
          "method",
          "headers"
        ],
        "properties": {
          "attachmentId": {
            "type": "string",
            "description": "The unique identifier for the attachment"
          },
          "filename": {
            "type": "string",
            "description": "The original filename of the attachment"
          },
          "uploadUrl": {
            "type": "string",
            "format": "uri",
            "description": "The address to send the file to, valid for 15 minutes. Send the file's bytes, and nothing else, as the whole body of a PUT with every one of `headers`. The file must be exactly the size and type given when the attachment was added; anything else is refused."
          },
          "expiresAt": {
            "type": "string",
            "format": "date-time",
            "description": "When the upload address stops working (ISO 8601 format)"
          },
          "method": {
            "type": "string",
            "description": "The HTTP method of the upload. Always PUT."
          },
          "headers": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            },
            "description": "Headers the upload must carry, exactly as given.",
            "example": {
              "Content-Type": "application/pdf"
            }
          }
        }
      },
      "Pay_AvailableDataTaxYear": {
        "type": "object",
        "description": "Available data for a tax year",
        "required": [
          "taxYear",
          "itemCount"
        ],
        "properties": {
          "taxYear": {
            "type": "integer",
            "format": "int32",
            "description": "The tax year",
            "example": 2024
          },
          "itemCount": {
            "type": "integer",
            "format": "int32",
            "description": "The number of items in the year",
            "example": 12
          }
        }
      },
      "Pay_BankAccountDto": {
        "type": "object",
        "required": [
          "accountNumber",
          "sortCode"
        ],
        "properties": {
          "accountNumber": {
            "type": "string",
            "description": "UK bank account number. Must be 6-8 digits (zero-padded to 8 for BACS).",
            "example": "12345678"
          },
          "sortCode": {
            "type": "string",
            "description": "UK bank sort code. Must be 6 digits. Hyphens are stripped before validation.",
            "example": "123456"
          },
          "accountHolderName": {
            "type": "string",
            "description": "Name of the account holder. Optional — falls back to employee name for payment files.",
            "example": "John Smith"
          },
          "isPrimaryPayrollAccount": {
            "type": "boolean",
            "description": "At least one bank account must be set as primary.",
            "example": true
          },
          "allocationPercentage": {
            "type": "integer",
            "format": "int32",
            "description": "Percentage of salary allocated to this account. All accounts must total 100%.",
            "example": 100
          }
        }
      },
      "Pay_BaseValuesDto": {
        "type": "object",
        "properties": {
          "gross": {
            "type": "number",
            "format": "decimal",
            "description": "Gross pay",
            "example": 306
          },
          "grossTaxable": {
            "type": "number",
            "format": "decimal",
            "description": "Gross taxable pay",
            "example": 306
          },
          "grossNi": {
            "type": "number",
            "format": "decimal",
            "description": "Gross pay for National Insurance purposes",
            "example": 306
          },
          "grossForEmployerNi": {
            "type": "number",
            "format": "decimal",
            "description": "Gross pay for employer National Insurance purposes",
            "example": 306
          },
          "grossForEmployerClass1ANi": {
            "type": "number",
            "format": "decimal",
            "description": "Gross pay for employer Class 1A National Insurance purposes",
            "example": 306
          },
          "grossPensionable": {
            "type": "number",
            "format": "decimal",
            "description": "Gross pensionable pay",
            "example": 306
          },
          "grossForCourtOrders": {
            "type": "number",
            "format": "decimal",
            "description": "Gross pay for court orders",
            "example": 306
          },
          "tax": {
            "type": "number",
            "format": "decimal",
            "description": "Tax amount",
            "example": 45.2
          },
          "ni": {
            "type": "number",
            "format": "decimal",
            "description": "Employee National Insurance contribution",
            "example": 25.3
          },
          "pension": {
            "type": "number",
            "format": "decimal",
            "description": "The member's pension movement for the slice this object covers (period, year to date or employment to date): contributions deducted from pay, including additional voluntary contributions, minus any opt-out refunds paid back. Negative in a period that refunds more than it deducts. Salary-sacrifice contributions are employer money and live in employerPension, never here. Reconciles with the pension summary items: read one source or the other, never both.",
            "example": 0
          },
          "employerNi": {
            "type": "number",
            "format": "decimal",
            "description": "Employer National Insurance contribution",
            "example": 35.4
          },
          "employerClass1ANI": {
            "type": "number",
            "format": "decimal",
            "description": "Employer Class 1A National Insurance contribution",
            "example": 35.4
          },
          "employerPension": {
            "type": "number",
            "format": "decimal",
            "description": "The employer's pension contributions for the slice, including salary-sacrifice amounts (sacrificed pay is the employer's contribution), minus any salary-sacrifice opt-out refunds.",
            "example": 0
          },
          "studentLoan": {
            "type": "number",
            "format": "decimal",
            "description": "Student loan repayment",
            "example": 0
          },
          "postgraduateLoan": {
            "type": "number",
            "format": "decimal",
            "description": "Postgraduate loan repayment",
            "example": 0
          },
          "net": {
            "type": "number",
            "format": "decimal",
            "description": "Net pay after deductions including net deductions",
            "example": 235.5
          },
          "netDeductions": {
            "type": "number",
            "format": "decimal",
            "description": "Net deductions applied to the net pay",
            "example": 0
          },
          "totalPayable": {
            "type": "number",
            "format": "decimal",
            "description": "Total payable",
            "example": 235.5
          },
          "totalEmployerCost": {
            "type": "number",
            "format": "decimal",
            "description": "Total employer cost",
            "example": 306
          },
          "niBand": {
            "type": "object",
            "additionalProperties": {
              "$ref": "#/components/schemas/Pay_NiCalculationResultDto"
            },
            "description": "National Insurance band breakdown"
          },
          "statutory": {
            "type": "object",
            "additionalProperties": {
              "type": "number",
              "format": "decimal"
            },
            "description": "Statutory payments breakdown",
            "example": {
              "SSP": 0,
              "SMP": 0
            }
          },
          "pensionContributionsByType": {
            "type": "object",
            "additionalProperties": {
              "type": "number",
              "format": "decimal"
            },
            "description": "Pension contributions broken down by pension type. Contributions only: opt-out refunds never appear here, so read pensionRefundsByType for those. Net member movement per scheme = contributions minus refunds.",
            "example": {
              "NetPayArrangement": 0,
              "ReliefAtSource": 0,
              "SalarySacrifice": 0
            }
          },
          "qualifyingEarningsForPension": {
            "type": "number",
            "format": "decimal",
            "description": "Qualifying earnings for pension calculation",
            "example": 0
          },
          "apprenticeshipLevy": {
            "type": "number",
            "format": "decimal",
            "description": "Per-payslip gross apprenticeship levy attributable to this period. Equal to 0.5 percent of grossForEmployerNi when the organisation pays AL, otherwise 0. The org-level £15,000 annual allowance is applied at the EPS level, not deducted per payslip — so summing this across a pay run gives the gross levy used for reconciliation against the organisation's monthly AL balance.",
            "example": 1.53
          },
          "employmentAllowance": {
            "type": "number",
            "format": "decimal",
            "description": "Employment Allowance used by this pay run — an employer-level figure, populated on the pay run's totalBalances when the run completes. Not stamped on individual payslips: payslip forPeriod/yearToDate values are always 0 for payslips generated after per-payslip apportionment was removed; payslips written while it existed retain their historical share. Per-employee views (journal Employment Allowance lines) are derived from the run-level figure.",
            "example": 0
          },
          "apprenticeshipLevyAllowance": {
            "type": "number",
            "format": "decimal",
            "description": "Apprenticeship Levy allowance (annual £15,000 pot, accrued monthly) used by this pay run — an employer-level figure, populated on the pay run's totalBalances when the run completes. Not stamped on individual payslips: payslip forPeriod/yearToDate values are always 0 for payslips generated after per-payslip apportionment was removed; payslips written while it existed retain their historical share. Per-employee views are derived from the run-level figure.",
            "example": 0
          },
          "statutoryRecovery": {
            "type": "object",
            "additionalProperties": {
              "$ref": "#/components/schemas/Pay_StatutoryPaymentsReclaimDto"
            },
            "description": "Per-statutory-type recovery this payslip contributes to the EPS. Keys are the StatutoryTypeEnum string values (StatutoryMaternityPay, StatutoryPaternityPay, SharedParentalPay, StatutoryAdoptionPay, StatutoryParentalBereavementPay, StatutoryNeonatalCarePay). Statutory Sick Pay is never recoverable per HMRC DANSP37000 and is omitted from this map.",
            "example": {
              "StatutoryMaternityPay": {
                "reclaimed": 100,
                "nicCompensationRecovered": 8.5
              }
            }
          },
          "isEmpty": {
            "type": "boolean",
            "nullable": true,
            "description": "Whether every value in this record is zero, as judged by the producer. A pay run's totalBalances is written asynchronously after the run completes and reads back as an all-zero record until then, so a consumer cannot tell \"not written yet\" from \"genuinely nil\" by inspecting the figures. Null means this producer did not supply the flag — treat it as unknown, never as false.",
            "example": false
          },
          "pensionRefundsByType": {
            "type": "object",
            "additionalProperties": {
              "type": "number",
              "format": "decimal"
            },
            "description": "The MEMBER contributions paid back through this period, broken down by pension type. Absent unless a refund happened. The refund also appears as a Payable internal_pension_{scheme}_refund summary item and nets forPeriod.pension, so the period scalar can be negative in a refund period. The employer half is reported separately in employerPensionRefundsByType.",
            "example": {
              "ReliefAtSource": 146.76
            }
          },
          "employerPensionRefundsByType": {
            "type": "object",
            "additionalProperties": {
              "type": "number",
              "format": "decimal"
            },
            "description": "The EMPLOYER contributions reversed by an opt-out refund, broken down by pension type. Absent unless a refund happened. Employer money never passes through the member's net pay (the scheme repays the employer directly), but it is netted off employerPension for the period, and therefore off the monthly balance, the organisation year-to-date figures and the journal cost slices built from it. This field is the disclosure of what was reversed, so read it to explain a balance, never to subtract again.",
            "example": {
              "ReliefAtSource": 110.07
            }
          }
        }
      },
      "Pay_BulkCancelLeaverDetailsDto": {
        "type": "object",
        "required": [
          "employeeIds"
        ],
        "properties": {
          "employeeIds": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Identifiers of the employees whose leaver status should be cleared. Duplicates are deduped server-side before processing.",
            "example": [
              "emp_12345",
              "emp_67890"
            ]
          }
        }
      },
      "Pay_BulkCancelLeaverDetailsResultDto": {
        "type": "object",
        "required": [
          "succeeded",
          "failed"
        ],
        "properties": {
          "succeeded": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Employee ids whose leaver status was cleared. Also includes employees who had no leaver status to begin with (idempotent no-op)."
          },
          "failed": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Pay_BulkLeaverFailureDto"
            },
            "description": "The employees whose leaver status was not cleared, each with its reason: not_found, or leaver_reported_to_hmrc once the leaver is on a finalised payslip or reported to HMRC."
          }
        }
      },
      "Pay_BulkLeaverFailureDto": {
        "type": "object",
        "required": [
          "employeeId",
          "reason"
        ],
        "properties": {
          "employeeId": {
            "type": "string",
            "description": "The identifier of the employee the operation failed for.",
            "example": "emp_67890"
          },
          "reason": {
            "type": "string",
            "description": "Stable snake_case token identifying the failure mode. Frontends can branch on this value.",
            "example": "leaver_reported_to_hmrc"
          }
        }
      },
      "Pay_BulkSetLeaverDefaultsDto": {
        "type": "object",
        "required": [
          "leavingDate"
        ],
        "properties": {
          "leavingDate": {
            "type": "string",
            "format": "date",
            "description": "Default leaving date applied to every entry unless overridden.",
            "example": "2026-05-30"
          },
          "reason": {
            "type": "string",
            "nullable": true,
            "description": "Default reason applied to every entry unless overridden.",
            "example": "Resignation"
          }
        }
      },
      "Pay_BulkSetLeaverDetailsDto": {
        "type": "object",
        "required": [
          "defaults",
          "entries"
        ],
        "properties": {
          "defaults": {
            "$ref": "#/components/schemas/Pay_BulkSetLeaverDefaultsDto",
            "description": "The leaving date and reason used for every entry that does not set its own."
          },
          "entries": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Pay_BulkSetLeaverEntryDto"
            },
            "description": "The employees to mark as leavers; when an employee appears more than once, the last entry is used."
          }
        }
      },
      "Pay_BulkSetLeaverDetailsResultDto": {
        "type": "object",
        "required": [
          "succeeded",
          "failed"
        ],
        "properties": {
          "succeeded": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "The identifiers of the employees marked as leavers."
          },
          "failed": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Pay_BulkLeaverFailureDto"
            },
            "description": "The employees not marked as leavers, each with its reason: not_found, or invalid_date when the leaving date is not a valid date."
          }
        }
      },
      "Pay_BulkSetLeaverEntryDto": {
        "type": "object",
        "required": [
          "employeeId"
        ],
        "properties": {
          "employeeId": {
            "type": "string",
            "description": "The identifier of the employee to mark as a leaver.",
            "example": "emp_12345"
          },
          "leavingDate": {
            "type": "string",
            "nullable": true,
            "format": "date",
            "description": "Overrides the request `defaults.leavingDate` for this employee.",
            "example": "2026-06-15"
          },
          "reason": {
            "type": "string",
            "nullable": true,
            "description": "Overrides the request `defaults.reason` for this employee.",
            "example": "Retirement"
          }
        }
      },
      "Pay_CalculationResult": {
        "type": "object",
        "required": [
          "taxForPeriod",
          "employeeNiForPeriod",
          "employerNiForPeriod",
          "studentLoanForPeriod",
          "postGradLoanForPeriod",
          "netPay",
          "netDeductions"
        ],
        "properties": {
          "taxForPeriod": {
            "type": "number",
            "format": "decimal",
            "description": "Tax calculated for this period"
          },
          "employeeNiForPeriod": {
            "type": "number",
            "format": "decimal",
            "description": "Employee National Insurance for the period."
          },
          "employerNiForPeriod": {
            "type": "number",
            "format": "decimal",
            "description": "Employer National Insurance for the period."
          },
          "studentLoanForPeriod": {
            "type": "number",
            "format": "decimal",
            "description": "Student loan deduction for the period."
          },
          "postGradLoanForPeriod": {
            "type": "number",
            "format": "decimal",
            "description": "Postgraduate loan deduction for the period."
          },
          "netPay": {
            "type": "number",
            "format": "decimal",
            "description": "Net pay after all deductions"
          },
          "netDeductions": {
            "type": "number",
            "format": "decimal",
            "description": "Deductions taken from net pay."
          }
        }
      },
      "Pay_ContactDetailsDto": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "description": "Name of the contact.",
            "example": "HR Department"
          },
          "email": {
            "type": "string",
            "description": "Email of the contact.",
            "example": "hr@acme.com"
          },
          "phone": {
            "type": "string",
            "nullable": true,
            "description": "Phone of the contact.",
            "example": "0161 123 4567"
          }
        }
      },
      "Pay_CourtOrderEligibilityDto": {
        "type": "object",
        "description": "Which court order types may take money from this pay. Read-only: Flow Payroll sets every flag from the pay element's payType, taxType, isClass1ANiable and statutory type, as UK law defines attachable earnings. Taxable pay (wages, bonus, commission, overtime, holiday pay, statutory sick pay, contractual top-ups) can be attached by every order type. Deductions, non-taxable payments, benefits in kind and statutory maternity, paternity, adoption, shared parental, parental bereavement and neonatal care pay cannot.",
        "required": [
          "cmsDeo",
          "dea",
          "aeoPriority",
          "aeoNonPriority",
          "ctaeo",
          "ea",
          "mcaeo",
          "cma",
          "cao",
          "niFinesAeo",
          "niEjoAeo"
        ],
        "properties": {
          "cmsDeo": {
            "type": "boolean",
            "description": "Child Maintenance Service deduction from earnings order may take money from this pay.",
            "example": true
          },
          "dea": {
            "type": "boolean",
            "description": "Direct earnings attachment (DWP) may take money from this pay.",
            "example": true
          },
          "aeoPriority": {
            "type": "boolean",
            "description": "Attachment of earnings order, priority (maintenance) may take money from this pay.",
            "example": true
          },
          "aeoNonPriority": {
            "type": "boolean",
            "description": "Attachment of earnings order, non-priority (civil debt) may take money from this pay.",
            "example": true
          },
          "ctaeo": {
            "type": "boolean",
            "description": "Council tax attachment of earnings order may take money from this pay.",
            "example": true
          },
          "ea": {
            "type": "boolean",
            "description": "Earnings arrestment (Scotland) may take money from this pay.",
            "example": true
          },
          "mcaeo": {
            "type": "boolean",
            "description": "Magistrates' court attachment of earnings order (fines) may take money from this pay.",
            "example": true
          },
          "cma": {
            "type": "boolean",
            "description": "Current maintenance arrestment (Scotland) may take money from this pay.",
            "example": true
          },
          "cao": {
            "type": "boolean",
            "description": "Conjoined arrestment order (Scotland) may take money from this pay.",
            "example": true
          },
          "niFinesAeo": {
            "type": "boolean",
            "description": "Attachment of earnings order for fines (Northern Ireland) may take money from this pay.",
            "example": true
          },
          "niEjoAeo": {
            "type": "boolean",
            "description": "Attachment of earnings order made by the Enforcement of Judgments Office (Northern Ireland) may take money from this pay.",
            "example": true
          }
        }
      },
      "Pay_CourtOrderMetadataSectionDto": {
        "type": "object",
        "description": "DTO for court order metadata",
        "properties": {
          "protectedEarningsSetting": {
            "type": "string",
            "nullable": true,
            "description": "The protected earnings rule applied to this order."
          },
          "protectedEarningsAmount": {
            "type": "number",
            "format": "decimal",
            "nullable": true,
            "description": "Protected earnings amount (for AEO with court-specified PER)",
            "example": 100
          },
          "shortfallCarryForward": {
            "type": "number",
            "format": "decimal",
            "nullable": true,
            "description": "Shortfall carry-forward amount (for CMS DEO only)",
            "example": 0
          },
          "rateType": {
            "type": "string",
            "nullable": true,
            "description": "DEA rate type (StandardTable, HigherRateTable, or FixedAmount)",
            "example": "StandardTable"
          },
          "adminFeeApplied": {
            "type": "boolean",
            "nullable": true,
            "description": "Whether admin fee is applied (optional £1 per order per pay period)",
            "example": true
          },
          "tableType": {
            "type": "string",
            "nullable": true,
            "description": "Table type for table-based deductions (e.g., \"A\", \"B\", \"MONTHLY\", \"WEEKLY\")",
            "example": "A"
          },
          "remittanceReference": {
            "type": "string",
            "nullable": true,
            "description": "Remittance reference as instructed on the order",
            "example": "REF123"
          },
          "remittanceDeadline": {
            "type": "string",
            "nullable": true,
            "description": "Remittance deadline (e.g., \"5 days\", \"19th following month\")",
            "example": "5 days"
          },
          "jurisdiction": {
            "type": "string",
            "nullable": true,
            "description": "Jurisdiction for CTAEO orders (e.g., \"ENGLAND\", \"WALES\")",
            "example": "ENGLAND"
          },
          "aeoCategory": {
            "type": "string",
            "nullable": true,
            "description": "AEO category",
            "example": "Priority"
          },
          "instructionAmount": {
            "type": "number",
            "format": "decimal",
            "nullable": true,
            "description": "The amount the order instructs, before any protection is applied."
          },
          "orderDate": {
            "type": "string",
            "nullable": true,
            "format": "date",
            "description": "Date the order was made. Orders in the same priority class are deducted oldest first.",
            "example": "2026-04-01"
          },
          "dailyRate": {
            "type": "number",
            "format": "decimal",
            "nullable": true,
            "description": "Current maintenance arrestment (Scotland) only. The maintenance to collect for each day, in pounds. Each pay day collects this amount for every day since the last pay day on which a deduction was made, while leaving the employee at least £24.66 for each of those days.",
            "example": 10
          },
          "ordinaryDebtAmount": {
            "type": "number",
            "format": "decimal",
            "nullable": true,
            "description": "Conjoined arrestment order (Scotland) only. The total of the ordinary (non-maintenance) debts the order includes, in pounds. They are collected using the earnings arrestment tables.",
            "example": 5000
          },
          "maintenanceDailyRate": {
            "type": "number",
            "format": "decimal",
            "nullable": true,
            "description": "Conjoined arrestment order (Scotland) only. All the maintenance the order includes, added together, per day, in pounds.",
            "example": 5
          },
          "agreedHigherRatePercentage": {
            "type": "number",
            "format": "decimal",
            "nullable": true,
            "description": "Attachment of earnings order for fines (Northern Ireland) only. A higher percentage of take-home pay the employee has agreed to pay instead of the official table rate. If it cannot all be taken on a pay day, the part above the table rate is not carried over to the next pay day.",
            "example": 25
          },
          "normalDeductionRate": {
            "type": "number",
            "format": "decimal",
            "nullable": true,
            "description": "Enforcement of Judgments Office order (Northern Ireland) only. The amount the order says to take for each rate period, in pounds.",
            "example": 50
          },
          "protectedEarningsRate": {
            "type": "number",
            "format": "decimal",
            "nullable": true,
            "description": "Enforcement of Judgments Office order (Northern Ireland) only. The take-home pay the employee must keep for each rate period, in pounds. Nothing is taken when pay is at or below it, and an amount that cannot be taken is not carried over.",
            "example": 200
          },
          "ratePeriod": {
            "type": "string",
            "enum": [
              "Weekly",
              "Monthly",
              "Daily"
            ],
            "description": "Enforcement of Judgments Office order (Northern Ireland) only. The period the order's two rates are stated for.",
            "example": "Weekly"
          },
          "lastDeductedPayDate": {
            "type": "string",
            "nullable": true,
            "format": "date",
            "description": "The last pay day on which this order took money. A current maintenance arrestment or a conjoined arrestment order counts the days to collect for from the day after it. When it is not sent, the days are counted from startDate, or else the days in the pay period are used.",
            "example": "2026-04-30"
          },
          "startDate": {
            "type": "string",
            "nullable": true,
            "format": "date",
            "description": "The day the order took effect. For a current maintenance arrestment, the day it was served on the employer.",
            "example": "2026-04-01"
          },
          "lastPayDate": {
            "type": "string",
            "nullable": true,
            "format": "date",
            "description": "Enforcement of Judgments Office order (Northern Ireland) only. The employee's last pay day while the order ran, whether or not anything was deducted. The two rates apply to the period since it. When it is not sent, the pay period is used.",
            "example": "2026-04-30"
          },
          "firstPayDate": {
            "type": "string",
            "nullable": true,
            "format": "date",
            "description": "Direct Earnings Attachment only. The first pay day it was operated on. A Scottish earnings arrestment, current maintenance arrestment or conjoined arrestment order that had started by then is deducted before it; one that started later is deducted after it. When it is not sent, the arrestment is deducted first.",
            "example": "2026-04-30"
          }
        }
      },
      "Pay_CreateAgentGovernmentGatewayCretentialsDto": {
        "allOf": [
          {
            "$ref": "#/components/schemas/Pay_CreateGovernmentGatewayCretentialsDto"
          },
          {
            "type": "object",
            "properties": {
              "agentId": {
                "type": "string",
                "nullable": true,
                "description": "The agent identifier, stored for reference only and not sent to HMRC."
              }
            }
          }
        ]
      },
      "Pay_CreateAttachmentRequestDto": {
        "type": "object",
        "required": [
          "filename",
          "contentType",
          "fileSize"
        ],
        "properties": {
          "filename": {
            "type": "string",
            "description": "The original filename of the attachment",
            "example": "invoice.pdf"
          },
          "contentType": {
            "type": "string",
            "description": "The MIME type of the file (e.g., application/pdf, image/jpeg). The upload must send exactly this type.",
            "example": "application/pdf"
          },
          "fileSize": {
            "type": "integer",
            "format": "int64",
            "description": "The exact size of the file in bytes, at most 10 MB (10,485,760 bytes). The upload must be exactly this size.",
            "example": 102400
          }
        }
      },
      "Pay_CreateCsvHeaderMappingRequest": {
        "type": "object",
        "description": "Request body for creating a new CSV header mapping",
        "required": [
          "mappingName",
          "mappings"
        ],
        "properties": {
          "mappingName": {
            "type": "string",
            "description": "Name of the mapping configuration",
            "example": "Payroll System Export"
          },
          "mappings": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Pay_CsvFieldMapping"
            },
            "description": "Array of CSV header to field mappings"
          }
        }
      },
      "Pay_CreateEmployeeDto": {
        "allOf": [
          {
            "type": "object",
            "properties": {
              "id": {
                "type": "string",
                "nullable": true,
                "description": "The unique identifier for the employee. If not provided, a new ULID will be generated.",
                "example": "emp_12345"
              }
            }
          },
          {
            "$ref": "#/components/schemas/Pay_UpdatableEmployeeDto"
          },
          {
            "type": "object",
            "required": [
              "starterDetails"
            ],
            "properties": {
              "payrollId": {
                "type": "string",
                "nullable": true,
                "description": "Payroll ID. This is the ID of the payroll that the employee is associated with when sending the FPS submission to HMRC (payId field). If not provided a new one will be created. But this can affect the submission to HMRC.",
                "example": "payroll_2023_001"
              },
              "payrollIdChanged": {
                "$ref": "#/components/schemas/Pay_EmployeePayIdChangedDto",
                "nullable": true,
                "description": "The employee's previous payroll ID, stored as sent and reported to HMRC on the FPS as a payroll ID change."
              },
              "payrollConfigId": {
                "type": "string",
                "nullable": true,
                "description": "The payroll config to assign the employee to. Required when adding an employee. An employee saved earlier with HR details only has none: they wait for payroll set-up, are in no pay run and on no FPS until someone who manages payroll details sets it (PUT /employees/{employeeId}/payroll-config).",
                "example": "payroll_config_001"
              },
              "openingBalance": {
                "type": "object",
                "additionalProperties": {
                  "$ref": "#/components/schemas/Pay_EmployeeEarningsToDateDto"
                },
                "description": "Opening balance for this employment from a different payroll system (migration)."
              },
              "openingBalanceDirector": {
                "type": "object",
                "additionalProperties": {
                  "$ref": "#/components/schemas/Pay_DirectorEarningsToDateDto"
                },
                "description": "Opening balance for director earnings from a different payroll system (migration). Only NI-relevant fields."
              },
              "starterDetails": {
                "$ref": "#/components/schemas/Pay_EmployeeStarterDetailsDto",
                "description": "The employment start date, and the starter declaration or secondment details reported to HMRC on the FPS; required."
              },
              "leaverDetails": {
                "$ref": "#/components/schemas/Pay_EmployeeLeaverDetailsDto",
                "nullable": true,
                "description": "Leaver details for migrating employees from another system."
              },
              "contractedHoursPerWeek": {
                "type": "number",
                "format": "decimal",
                "nullable": true,
                "description": "The hours a week the employee is contracted to work at their starting salary, from 0 to 168. Recorded on the first salary version beside salary, so it needs salary too; it does not change how the salary is paid. Later changes go through PUT /employees/{employeeId}/salary.",
                "example": 37.5
              }
            }
          }
        ]
      },
      "Pay_CreateGovernmentGatewayCretentialsDto": {
        "type": "object",
        "required": [
          "userId",
          "password"
        ],
        "properties": {
          "userId": {
            "type": "string",
            "description": "The organisation's Government Gateway user ID used to sign RTI submissions to HMRC."
          },
          "password": {
            "type": "string",
            "description": "The organisation's Government Gateway password; send it empty to keep the password already stored."
          }
        }
      },
      "Pay_CreatePayElementDto": {
        "type": "object",
        "required": [
          "id",
          "description",
          "taxType",
          "niType",
          "payType"
        ],
        "properties": {
          "id": {
            "type": "string",
            "description": "The unique identifier for the pay element",
            "example": "PE001"
          },
          "description": {
            "type": "string",
            "description": "The description of the pay element",
            "example": "Basic Salary"
          },
          "taxType": {
            "type": "string",
            "enum": [
              "Taxable",
              "NonTaxable"
            ],
            "description": "The tax type for the pay element",
            "example": "Taxable"
          },
          "niType": {
            "type": "string",
            "enum": [
              "Niable",
              "NonNiable",
              "EmployerOnly"
            ],
            "description": "The National Insurance type for the pay element",
            "example": "Niable"
          },
          "payType": {
            "type": "string",
            "enum": [
              "Payable",
              "Deductible",
              "Informational"
            ],
            "description": "The pay type for the pay element",
            "example": "Payable"
          },
          "isPensionable": {
            "type": "boolean",
            "description": "Whether the pay element is pensionable",
            "example": true
          },
          "isClass1ANiable": {
            "type": "boolean",
            "description": "Whether the pay element is Class 1A National Insurance liable",
            "example": false
          },
          "accrueHoliday": {
            "type": "boolean",
            "description": "Whether the pay element accrues holiday",
            "example": true
          },
          "subjectToNmwCheck": {
            "type": "boolean",
            "description": "Whether the pay element is subject to National Minimum Wage checks",
            "example": true
          },
          "defaultUnitName": {
            "type": "string",
            "enum": [
              "Hour",
              "Day",
              "Week",
              "Month",
              "Year",
              "Fixed",
              "Informational",
              "Percentage"
            ],
            "description": "The default unit name for the pay element",
            "example": "Hour"
          },
          "defaultPayRate": {
            "type": "number",
            "format": "decimal",
            "nullable": true,
            "description": "The default pay rate for the pay element",
            "example": 15.5
          },
          "defaultUnitValue": {
            "type": "number",
            "format": "decimal",
            "nullable": true,
            "description": "The default unit value for the pay element",
            "example": 1
          },
          "defaultChargeRate": {
            "type": "number",
            "format": "decimal",
            "nullable": true,
            "description": "The default charge rate for the pay element",
            "example": 20
          }
        }
      },
      "Pay_CreditsBreakdownDto": {
        "type": "object",
        "description": "Breakdown of all credits that reduce the liability",
        "required": [
          "total",
          "statutoryPaymentsReclaims",
          "employmentAllowance"
        ],
        "properties": {
          "total": {
            "type": "number",
            "format": "decimal",
            "description": "Total credits amount",
            "example": 200
          },
          "statutoryPaymentsReclaims": {
            "type": "object",
            "additionalProperties": {
              "$ref": "#/components/schemas/Pay_StatutoryPaymentsReclaimDto"
            },
            "description": "Breakdown of statutory payments reclaims by type",
            "example": {
              "SMP": {
                "reclaimed": 150,
                "nicCompensationRecovered": 50
              },
              "SSP": {
                "reclaimed": 0,
                "nicCompensationRecovered": 0
              }
            }
          },
          "employmentAllowance": {
            "type": "number",
            "format": "decimal",
            "description": "Employment allowance for the period",
            "example": 100
          }
        }
      },
      "Pay_CsvFieldMapping": {
        "type": "object",
        "description": "Mapping between a CSV header and a target field",
        "required": [
          "csvHeader",
          "targetField"
        ],
        "properties": {
          "csvHeader": {
            "type": "string",
            "description": "Header name in the CSV file",
            "example": "Employee Name"
          },
          "targetField": {
            "type": "string",
            "description": "Target field in the system",
            "example": "fullName"
          },
          "defaultValue": {
            "type": "string",
            "nullable": true,
            "description": "Default value to use when the CSV field is empty or not mapped.",
            "example": "Above30Hours"
          }
        }
      },
      "Pay_CsvHeaderMapping": {
        "type": "object",
        "description": "A CSV header mapping configuration for importing data",
        "required": [
          "organisationId",
          "mappingId",
          "entityType",
          "mappingName",
          "mappings",
          "createdBy",
          "createdDate",
          "updatedBy",
          "updatedDate"
        ],
        "properties": {
          "organisationId": {
            "type": "string",
            "description": "Organisation identifier",
            "example": "org-123"
          },
          "mappingId": {
            "type": "string",
            "format": "uuid",
            "description": "Unique identifier for the mapping"
          },
          "entityType": {
            "type": "string",
            "enum": [
              "EMPLOYEE",
              "PAYROLL_LINE",
              "STATUTORY_PAYMENT",
              "PAY_ELEMENT",
              "JOURNAL_TEMPLATE",
              "PENSION_ENROLMENT",
              "EMPLOYEE_EXPORT",
              "EMPLOYEE_UPDATE"
            ],
            "description": "Type of entity this mapping is for",
            "example": "EMPLOYEE"
          },
          "mappingName": {
            "type": "string",
            "description": "Name of the mapping configuration",
            "example": "Standard Employee Import"
          },
          "mappings": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Pay_CsvFieldMapping"
            },
            "description": "Array of CSV header to field mappings"
          },
          "createdBy": {
            "type": "string",
            "description": "User ID who created the mapping",
            "example": "user-456"
          },
          "createdDate": {
            "type": "string",
            "format": "date-time",
            "description": "Date and time when the mapping was created",
            "example": "2024-12-31T10:00:00.000Z"
          },
          "updatedBy": {
            "type": "string",
            "description": "User ID who last updated the mapping",
            "example": "user-456"
          },
          "updatedDate": {
            "type": "string",
            "format": "date-time",
            "description": "Date and time when the mapping was last updated",
            "example": "2024-12-31T10:00:00.000Z"
          }
        }
      },
      "Pay_DirectorEarningsToDateDto": {
        "type": "object",
        "description": "Director earnings to date. Only contains the fields relevant to the annual NI calculation for directors. Send niBandResult keyed by NI category letter; when present it is authoritative and the deprecated scalar totals are ignored. When absent, the scalar totals are attributed to the employee's latest effective NI letter for the year — a lossy fallback that cannot express a director who paid NI under more than one letter.",
        "properties": {
          "grossForEmployeeNi": {
            "type": "number",
            "format": "decimal",
            "description": "Deprecated as input: send niBandResult instead. Ignored when niBandResult is present. Always populated on responses as the sum across letters.",
            "deprecated": true
          },
          "grossForEmployerNi": {
            "type": "number",
            "format": "decimal",
            "description": "Deprecated as input: send niBandResult instead. Ignored when niBandResult is present. Always populated on responses as the sum across letters.",
            "deprecated": true
          },
          "ni": {
            "type": "number",
            "format": "decimal",
            "description": "Deprecated as input: send niBandResult instead. Ignored when niBandResult is present. Always populated on responses as the sum across letters.",
            "deprecated": true
          },
          "employerNi": {
            "type": "number",
            "format": "decimal",
            "description": "Deprecated as input: send niBandResult instead. Ignored when niBandResult is present. Always populated on responses as the sum across letters.",
            "deprecated": true
          },
          "niBandResult": {
            "type": "object",
            "additionalProperties": {
              "$ref": "#/components/schemas/Pay_DirectorLetterAmountsDto"
            },
            "description": "Director NI-able gross, contributions, and band splits broken down by NI category letter — the same name and shape as the main opening balance's niBandResult, dedicated here to earnings paid while the director basis applied (from appointment). Earnings paid before the appointment belong in the main opening balance's niBandResult, which is dedicated to earnings assessed as a regular employee."
          }
        }
      },
      "Pay_DirectorLetterAmountsDto": {
        "type": "object",
        "description": "Director NI-able earnings, contributions, and band splits accrued under a single NI category letter while the director basis applied.",
        "properties": {
          "grossForEmployeeNi": {
            "type": "number",
            "format": "decimal",
            "description": "Gross earnings for employee NI accrued under this letter"
          },
          "grossForEmployerNi": {
            "type": "number",
            "format": "decimal",
            "description": "Gross earnings for employer NI accrued under this letter"
          },
          "employeeNi": {
            "type": "number",
            "format": "decimal",
            "description": "Employee NI already paid under this letter"
          },
          "employerNi": {
            "type": "number",
            "format": "decimal",
            "description": "Employer NI already paid under this letter"
          },
          "bandResults": {
            "type": "object",
            "additionalProperties": {
              "$ref": "#/components/schemas/Pay_NiBandResultDto"
            },
            "description": "NI band splits for earnings paid under this letter while the director basis applied — a subset of the main opening balance's niBandResult band splits, which cover the whole employment. This mirrors the per-letter scalar totals: the main opening balance carries the whole-employment figures, this entry carries the director portion, and for a director for the whole year the two are the same values. Populate for the Alternative method: at the annual reassessment the director portion of the accumulated band splits is superseded by the recomputed annual-basis split, and this subset identifies that portion. For the Annual method the values are stored as a record of what was previously reported, but the annualised calculation and FPS reporting re-derive the band split from cumulative gross and ignore what is entered here. Keys are NI band names matching the main opening balance's band split keys."
          }
        }
      },
      "Pay_EffectiveTaxInfoDto": {
        "type": "object",
        "description": "Response containing the effective tax code and NI category for a specific date",
        "required": [
          "effectiveTaxCode",
          "effectiveNiCategory",
          "effectiveDate",
          "taxYear"
        ],
        "properties": {
          "effectiveTaxCode": {
            "$ref": "#/components/schemas/Pay_EmployeeTaxCodeDto",
            "description": "The tax code in force on effectiveDate, taken from the employee's tax code history."
          },
          "effectiveNiCategory": {
            "$ref": "#/components/schemas/Pay_EmployeeNiCategoryDto",
            "description": "The NI category in force on effectiveDate, taken from the employee's NI category history."
          },
          "effectiveDate": {
            "type": "string",
            "format": "date",
            "description": "The date for which the effective values were calculated",
            "example": "2024-06-15"
          },
          "taxYear": {
            "type": "integer",
            "format": "int32",
            "description": "The tax year for which the effective values were calculated",
            "example": 2024
          }
        },
        "example": {
          "effectiveTaxCode": {
            "code": "1257L",
            "effectiveDate": "2024-04-06",
            "reason": "Annual Review",
            "issuedBy": "HMRC",
            "week1Month1": false
          },
          "effectiveNiCategory": {
            "category": "A",
            "effectiveDate": "2024-04-06",
            "reason": "Annual Review",
            "issuedBy": "HMRC"
          },
          "effectiveDate": "2024-06-15",
          "taxYear": 2024
        }
      },
      "Pay_EligibilityDto": {
        "type": "object",
        "description": "What this pay counts towards. Read-only: set by Flow Payroll from the pay element's other settings.",
        "properties": {
          "courtOrders": {
            "$ref": "#/components/schemas/Pay_CourtOrderEligibilityDto",
            "nullable": true,
            "description": "Which court order types may take money from this pay. Read-only."
          }
        },
        "example": {
          "courtOrders": {
            "cmsDeo": true,
            "dea": true,
            "aeoPriority": true,
            "aeoNonPriority": true,
            "ctaeo": true,
            "ea": true,
            "mcaeo": true,
            "cma": true,
            "cao": true,
            "niFinesAeo": true,
            "niEjoAeo": true
          }
        }
      },
      "Pay_EmployeeDirectorDetailsDto": {
        "type": "object",
        "properties": {
          "directorsNICType": {
            "type": "string",
            "enum": [
              "Annual",
              "Alternative"
            ],
            "description": "Director's National Insurance contribution calculation method. Put 'Annual' if you're using the standard annual method of work out the director's National Insurance contributions, or 'Alternative' if you're using the alternative method",
            "example": "Annual"
          },
          "appointmentDate": {
            "type": "string",
            "description": "The date of appointment of the employee's director.",
            "example": "2024-01-15"
          },
          "endDate": {
            "type": "string",
            "nullable": true,
            "description": "The date the employee ceased to be a director.",
            "example": "2025-03-31"
          }
        }
      },
      "Pay_EmployeeDirectorDetailsDtoMergePatch": {
        "type": "object",
        "properties": {
          "directorsNICType": {
            "type": "string",
            "enum": [
              "Annual",
              "Alternative"
            ],
            "description": "Director's National Insurance contribution calculation method. Put 'Annual' if you're using the standard annual method of work out the director's National Insurance contributions, or 'Alternative' if you're using the alternative method",
            "example": "Annual"
          },
          "appointmentDate": {
            "type": "string",
            "nullable": true,
            "description": "The date of appointment of the employee's director.",
            "example": "2024-01-15"
          },
          "endDate": {
            "type": "string",
            "nullable": true,
            "description": "The date the employee ceased to be a director.",
            "example": "2025-03-31"
          }
        }
      },
      "Pay_EmployeeDto": {
        "allOf": [
          {
            "$ref": "#/components/schemas/Pay_UpdatableEmployeeDto"
          },
          {
            "type": "object",
            "required": [
              "id",
              "payrollConfigId",
              "starterDetails"
            ],
            "properties": {
              "id": {
                "type": "string",
                "description": "The unique identifier for the employee.",
                "example": "emp_12345"
              },
              "payrollId": {
                "type": "string",
                "nullable": true,
                "description": "Payroll ID used as the payId field in HMRC FPS submissions. Updated via PUT /employees/{id}/payroll-id.",
                "example": "PAY123"
              },
              "payrollIdChanged": {
                "$ref": "#/components/schemas/Pay_EmployeePayIdChangedDto",
                "nullable": true,
                "description": "The employee's previous payroll ID, kept when the payroll ID is replaced and reported to HMRC on the FPS as a payroll ID change."
              },
              "payrollConfigId": {
                "type": "string",
                "description": "The payroll config the employee is assigned to.",
                "example": "payroll_config_001"
              },
              "starterDetails": {
                "$ref": "#/components/schemas/Pay_EmployeeStarterDetailsDto",
                "description": "The employment start date, and the starter declaration or secondment details reported to HMRC on the FPS."
              },
              "leaverDetails": {
                "$ref": "#/components/schemas/Pay_EmployeeLeaverDetailsDto",
                "nullable": true,
                "description": "The leaving date and reason once the employee is marked as a leaver; null otherwise."
              },
              "isLeaver": {
                "type": "boolean",
                "nullable": true,
                "description": "Whether the employee has left: marked as a leaver, or their leaving date has passed. Read only."
              },
              "earningsToDatePerYear": {
                "type": "object",
                "additionalProperties": {
                  "$ref": "#/components/schemas/Pay_EmployeeEarningsToDateDto"
                },
                "description": "Computed year-to-date earnings (opening balance + accumulated payslips). Read-only."
              },
              "openingBalance": {
                "type": "object",
                "additionalProperties": {
                  "$ref": "#/components/schemas/Pay_EmployeeEarningsToDateDto"
                },
                "description": "Opening balance for this employment. Updated via PUT /employees/{id}/opening-balance."
              },
              "openingBalanceDirector": {
                "type": "object",
                "additionalProperties": {
                  "$ref": "#/components/schemas/Pay_DirectorEarningsToDateDto"
                },
                "description": "Opening balance for director earnings. Updated via PUT /employees/{id}/opening-balance. Only NI-relevant fields."
              },
              "directorEarningsToDatePerYear": {
                "type": "object",
                "additionalProperties": {
                  "$ref": "#/components/schemas/Pay_DirectorEarningsToDateDto"
                },
                "description": "Computed year-to-date director earnings for NI calculation (opening balance + accumulated payslips). Read-only."
              },
              "salaryHistory": {
                "allOf": [
                  {
                    "$ref": "#/components/schemas/Pay_EmployeeSalaryHistoryResponseDto"
                  }
                ],
                "nullable": true,
                "description": "The effective-dated salary history, oldest first, with the version in force today. Managed via PUT /employees/{id}/salary; `salary` is the amount of the version in force."
              },
              "createdDate": {
                "type": "string",
                "nullable": true,
                "format": "date-time",
                "description": "When the employee record was created, as a UTC date and time.",
                "example": "2023-01-15T10:00:00Z"
              },
              "createdBy": {
                "type": "string",
                "nullable": true,
                "description": "The user who created the employee record.",
                "example": "admin@company.com"
              },
              "updatedDate": {
                "type": "string",
                "nullable": true,
                "format": "date-time",
                "description": "When the employee record was last changed, as a UTC date and time.",
                "example": "2023-06-01T12:00:00Z"
              },
              "updatedBy": {
                "type": "string",
                "nullable": true,
                "description": "The user who last changed the employee record.",
                "example": "hr@company.com"
              }
            }
          }
        ]
      },
      "Pay_EmployeeEarningsToDateDto": {
        "type": "object",
        "description": "The earnings to date for the employee",
        "properties": {
          "gross": {
            "type": "number",
            "format": "decimal",
            "description": "The total gross earnings to date",
            "example": 25000
          },
          "tax": {
            "type": "number",
            "format": "decimal",
            "description": "The total tax paid to date",
            "example": 5000
          },
          "taxable": {
            "type": "number",
            "format": "decimal",
            "description": "The total taxable earnings to date",
            "example": 24000
          },
          "ni": {
            "type": "number",
            "format": "decimal",
            "description": "The total National Insurance contributions to date",
            "example": 2000
          },
          "employerNi": {
            "type": "number",
            "format": "decimal",
            "description": "The total employer National Insurance contributions to date",
            "example": 2500
          },
          "employerClass1ANi": {
            "type": "number",
            "format": "decimal",
            "description": "The total employer Class 1A National Insurance contributions to date",
            "example": 2500
          },
          "studentLoan": {
            "type": "number",
            "format": "decimal",
            "description": "The total student loan repayments to date",
            "example": 500
          },
          "postgraduateLoan": {
            "type": "number",
            "format": "decimal",
            "description": "The total postgraduate loan repayments to date",
            "example": 300
          },
          "net": {
            "type": "number",
            "format": "decimal",
            "description": "The total net earnings to date",
            "example": 17200
          },
          "netDeductions": {
            "type": "number",
            "format": "decimal",
            "description": "Deductions taken from net pay, to date."
          },
          "totalEmployerCost": {
            "type": "number",
            "format": "decimal",
            "description": "The total employer cost to date",
            "example": 27500
          },
          "totalCost": {
            "type": "number",
            "format": "decimal",
            "description": "The total cost to date",
            "example": 30000
          },
          "grossForEmployeeNi": {
            "type": "number",
            "format": "decimal",
            "description": "The gross earnings for employee NI calculations to date",
            "example": 25000
          },
          "grossForEmployerNi": {
            "type": "number",
            "format": "decimal",
            "description": "The gross earnings for employer NI calculations to date",
            "example": 25000
          },
          "grossForEmployerClass1ANi": {
            "type": "number",
            "format": "decimal",
            "description": "The gross earnings for employer Class 1A NI calculations to date",
            "example": 25000
          },
          "pension": {
            "type": "number",
            "format": "decimal",
            "description": "Deprecated as input: the employee's total pension contributions to date. Send 'pensionContributionsByType' instead (employee contributions broken down by pension scheme type) so FPS YTD reporting can split NetPayArrangement vs ReliefAtSource correctly. On responses, this field is always populated as the sum of 'pensionContributionsByType' for client convenience. Will be removed from input in a future version.",
            "example": 500,
            "deprecated": true
          },
          "employerPension": {
            "type": "number",
            "format": "decimal",
            "description": "The employer pension contributions to date",
            "example": 375
          },
          "grossPensionable": {
            "type": "number",
            "format": "decimal",
            "description": "The gross pensionable earnings to date",
            "example": 25000
          },
          "qualifyingEarningsForPension": {
            "type": "number",
            "format": "decimal",
            "description": "Qualifying earnings for pension, to date."
          },
          "statutory": {
            "type": "object",
            "additionalProperties": {
              "type": "number",
              "format": "decimal"
            },
            "description": "Dictionary of statutory payment types and amounts.  Possible keys: None, StatutorySickPay, StatutoryMaternityPay,  StatutoryPaternityPay, StatutoryAdoptionPay, SharedParentalPay,  StatutoryParentalBereavementPay, StatutorySharedParentalPay,  StatutoryNeoNatalCarePay",
            "example": {
              "StatutorySickPay": 500,
              "StatutoryMaternityPay": 1000
            }
          },
          "niBandResult": {
            "type": "object",
            "additionalProperties": {
              "$ref": "#/components/schemas/Pay_NiCalculationResultDto"
            },
            "description": "Map of NI category letter (single char) to NI calculation results. Keys must be a single letter (A-Z, case insensitive). Example keys: \"A\", \"B\", \"C\", etc. The band splits (bandResults) in each entry cover the whole employment, both stretches — the same coverage as the per-letter scalar totals (gross, contributions). For directors, the portion of these band splits paid while the director basis applied must also be entered in openingBalanceDirector niBandResult[letter].bandResults as a subset of this map, so the annualised calculation can supersede exactly that portion."
          },
          "pensionContributionsByType": {
            "type": "object",
            "additionalProperties": {
              "type": "number",
              "format": "decimal"
            },
            "description": "Employee pension contributions broken down by pension scheme type. This represents the employee's contributions only, as employer contributions are tracked separately via 'employerPension' and are not part of this breakdown. Allowed keys: NetPayArrangement, ReliefAtSource, SalarySacrifice. Required at migration time so FPS YTD reporting (EmpeePenContribnsPaidYTD for NetPayArrangement, EmpeePenContribnsNotPaidYTD for ReliefAtSource) reflects opening-balance contributions correctly. The aggregate 'pension' field on responses is the sum of these values.",
            "example": {
              "NetPayArrangement": 300,
              "ReliefAtSource": 200
            }
          }
        }
      },
      "Pay_EmployeeExportColumnDto": {
        "type": "object",
        "description": "One column of the file.",
        "required": [
          "field"
        ],
        "properties": {
          "field": {
            "type": "string",
            "description": "An employee field as `GET /employee-fields` lists it, or a column of the app's \"Existing employees\" import by its key (`firstName`, `payrollConfigName`, `taxCode`, `ytdGross`), written as that import reads it back so the file imports there and into `POST /employees/imports` as it stands.",
            "example": "department"
          },
          "header": {
            "type": "string",
            "nullable": true,
            "description": "The column's heading; when omitted, the import's heading for an import key, else the field's path.",
            "example": "Team"
          }
        }
      },
      "Pay_EmployeeExportDto": {
        "type": "object",
        "description": "An employee export of the organisation. Everybody who can export employees there sees it; the file goes to whoever started it, or to somebody whose role reads every column it holds.",
        "required": [
          "exportId",
          "status",
          "requestedAt"
        ],
        "properties": {
          "exportId": {
            "type": "string",
            "description": "The export.",
            "example": "01JD8Y7Q3N4M5P6R7S8T9V0W1X"
          },
          "status": {
            "type": "string",
            "enum": [
              "Queued",
              "Running",
              "Completed",
              "Failed"
            ],
            "description": "Where it stands.",
            "example": "Completed"
          },
          "rowCount": {
            "type": "integer",
            "format": "int64",
            "nullable": true,
            "description": "How many employees the file holds, once completed.",
            "example": 6000
          },
          "downloadUrl": {
            "type": "string",
            "nullable": true,
            "description": "A link to the file, once completed. It works for 12 hours; ask again for a fresh one.",
            "example": "https://files.flowpayroll.ai/files/report/exports/..."
          },
          "expiresAt": {
            "type": "string",
            "format": "date-time",
            "nullable": true,
            "description": "When the link stops working.",
            "example": "2026-11-06T22:00:00Z"
          },
          "error": {
            "type": "string",
            "nullable": true,
            "description": "Why it failed.",
            "example": "niDetails.nationalInsuranceNumber is not a field this caller reads."
          },
          "requestedAt": {
            "type": "string",
            "format": "date-time",
            "description": "When it was asked for.",
            "example": "2026-11-06T10:00:00Z"
          },
          "completedAt": {
            "type": "string",
            "format": "date-time",
            "nullable": true,
            "description": "When it finished.",
            "example": "2026-11-06T10:00:12Z"
          },
          "requestedBy": {
            "type": "string",
            "nullable": true,
            "description": "Who started it: a person's or an API token's principal id, the id the users and API tokens routes take.",
            "example": "USER#01JD8Y7Q3N4M5P6R7S8T9V0W1Y"
          },
          "downloadUnavailable": {
            "type": "string",
            "nullable": true,
            "description": "Why there is no `downloadUrl` for you although the file is ready: it holds columns your role cannot read.",
            "example": "This file has columns your role can't see. Ask whoever exported it, or export the columns you can see."
          }
        }
      },
      "Pay_EmployeeExportListDto": {
        "type": "object",
        "description": "The organisation's latest employee exports, whoever started them, newest first.",
        "required": [
          "exports"
        ],
        "properties": {
          "exports": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Pay_EmployeeExportDto"
            },
            "description": "At most 100."
          }
        }
      },
      "Pay_EmployeeExportRequestDto": {
        "type": "object",
        "description": "A CSV of the employees a search matches, written in the background.",
        "required": [
          "columns"
        ],
        "properties": {
          "columns": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Pay_EmployeeExportColumnDto"
            },
            "description": "The file's columns, in order, each a field your role can read, or an import column whose fields your role can read."
          },
          "search": {
            "$ref": "#/components/schemas/Pay_EmployeeSearchRequestDto",
            "nullable": true,
            "description": "Which employees and in what order, as `POST /employees/search` takes it; every employee when omitted. Its `fields`, `limit` and `offset` are not used: the columns choose the fields and every match is written."
          }
        }
      },
      "Pay_EmployeeFieldDto": {
        "type": "object",
        "description": "One employee field your role can read, as search, sort, export and import name it.",
        "required": [
          "path",
          "type",
          "repeated",
          "updatable",
          "dated"
        ],
        "properties": {
          "path": {
            "type": "string",
            "description": "The field's path.",
            "example": "address.postcode"
          },
          "type": {
            "type": "string",
            "enum": [
              "Text",
              "Number",
              "Date",
              "Timestamp",
              "Boolean",
              "Choice"
            ],
            "description": "The kind of value it holds.",
            "example": "Text"
          },
          "choices": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "nullable": true,
            "description": "The values a `Choice` field takes.",
            "example": [
              "Single",
              "Married"
            ]
          },
          "repeated": {
            "type": "boolean",
            "description": "It holds several values (a list or a map lies on its path).",
            "example": false
          },
          "updatable": {
            "type": "boolean",
            "description": "`PATCH /employees/{employeeId}` accepts it; otherwise it is read-only or has an endpoint of its own.",
            "example": true
          },
          "dated": {
            "type": "boolean",
            "description": "Its value is read for the date asked about.",
            "example": false
          }
        }
      },
      "Pay_EmployeeHeadcountsDto": {
        "type": "object",
        "description": "The organisation's employees on a date. Active and leavers add up to the total.",
        "required": [
          "total",
          "active",
          "leavers",
          "futureLeavers"
        ],
        "properties": {
          "total": {
            "type": "integer",
            "format": "int32",
            "description": "Every employee.",
            "example": 6000
          },
          "active": {
            "type": "integer",
            "format": "int32",
            "description": "Not a leaver on the date, future leavers included.",
            "example": 5700
          },
          "leavers": {
            "type": "integer",
            "format": "int32",
            "description": "Marked a leaver, or left before the date.",
            "example": 300
          },
          "futureLeavers": {
            "type": "integer",
            "format": "int32",
            "description": "Active, with a leaving date on or after the date.",
            "example": 12
          }
        }
      },
      "Pay_EmployeeImportChangeDto": {
        "type": "object",
        "description": "One field a row changes.",
        "required": [
          "field"
        ],
        "properties": {
          "field": {
            "type": "string",
            "description": "The column that changes it: its \"Existing employees\" import key when the file's heading is one of that import's (`firstName`, `taxCode`), else the field's path.",
            "example": "department"
          },
          "from": {
            "type": "string",
            "nullable": true,
            "description": "Its value now; absent when it has none.",
            "example": "Sales"
          },
          "to": {
            "type": "string",
            "nullable": true,
            "description": "Its value after the update.",
            "example": "Operations"
          }
        }
      },
      "Pay_EmployeeImportColumnDto": {
        "type": "object",
        "description": "Which employee field a column of the file holds.",
        "required": [
          "header",
          "field"
        ],
        "properties": {
          "header": {
            "type": "string",
            "description": "The column's heading, exactly as in the file.",
            "example": "Team"
          },
          "field": {
            "type": "string",
            "description": "An employee field as `GET /employee-fields` lists it.",
            "example": "department"
          }
        }
      },
      "Pay_EmployeeImportCountsDto": {
        "type": "object",
        "description": "The rows of an import, counted.",
        "required": [
          "total",
          "changed",
          "unchanged",
          "problems",
          "updated",
          "failed"
        ],
        "properties": {
          "total": {
            "type": "integer",
            "format": "int32",
            "description": "Employee rows in the file.",
            "example": 120
          },
          "changed": {
            "type": "integer",
            "format": "int32",
            "description": "Rows that change at least one field.",
            "example": 37
          },
          "unchanged": {
            "type": "integer",
            "format": "int32",
            "description": "Rows equal to the employee now; nothing is sent for them.",
            "example": 80
          },
          "problems": {
            "type": "integer",
            "format": "int32",
            "description": "Rows that cannot be applied as they are.",
            "example": 3
          },
          "updated": {
            "type": "integer",
            "format": "int32",
            "description": "After applying: employees updated.",
            "example": 36
          },
          "failed": {
            "type": "integer",
            "format": "int32",
            "description": "After applying: rows that could not be saved; each says why.",
            "example": 1
          }
        }
      },
      "Pay_EmployeeImportDto": {
        "type": "object",
        "description": "A bulk update of employees from a file: its preview, then how applying it went. Only the person who started it can read it.",
        "required": [
          "importId",
          "status",
          "progress",
          "counts",
          "skippedColumns",
          "rows",
          "rowsTruncated",
          "createdAt",
          "matchBy"
        ],
        "properties": {
          "importId": {
            "type": "string",
            "description": "The import.",
            "example": "01JD8Y7Q3N4M5P6R7S8T9V0W1X"
          },
          "status": {
            "type": "string",
            "enum": [
              "Previewing",
              "Ready",
              "Applying",
              "Completed",
              "Failed",
              "CompletedWithFailures"
            ],
            "description": "Where it stands.",
            "example": "Ready"
          },
          "progress": {
            "$ref": "#/components/schemas/Pay_EmployeeImportProgressDto",
            "description": "How far applying has got: rows tried of rows to save."
          },
          "counts": {
            "$ref": "#/components/schemas/Pay_EmployeeImportCountsDto",
            "description": "How many rows the file holds, change, match the employee already, cannot be applied and, after applying, were updated or failed."
          },
          "skippedColumns": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Pay_EmployeeImportSkippedColumnDto"
            },
            "description": "Columns that change nothing, and why."
          },
          "rows": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Pay_EmployeeImportRowDto"
            },
            "description": "The rows that change something or cannot be applied, in file order: at most 1,000, `rowsTruncated` says when there are more."
          },
          "rowsTruncated": {
            "type": "boolean",
            "description": "More rows than `rows` holds.",
            "example": false
          },
          "error": {
            "type": "string",
            "nullable": true,
            "description": "Why it failed.",
            "example": "Add the Employee ID column: it is how each row finds its employee."
          },
          "createdAt": {
            "type": "string",
            "format": "date-time",
            "description": "When the file was sent.",
            "example": "2026-11-08T10:00:00Z"
          },
          "completedAt": {
            "type": "string",
            "format": "date-time",
            "nullable": true,
            "description": "When applying finished.",
            "example": "2026-11-08T10:00:40Z"
          },
          "matchBy": {
            "type": "string",
            "enum": [
              "EmployeeId",
              "PayrollId",
              "NiNumber",
              "EmployeeCode",
              "Email"
            ],
            "description": "How each row found its employee, as the sender chose: Employee ID, Payroll ID, NI number, Employee code or Email."
          }
        }
      },
      "Pay_EmployeeImportProblemDto": {
        "type": "object",
        "description": "A cell, or a whole row, that cannot be applied, and what to do about it.",
        "required": [
          "message"
        ],
        "properties": {
          "column": {
            "type": "string",
            "nullable": true,
            "description": "The column, when one cell is the problem.",
            "example": "Hours per week"
          },
          "message": {
            "type": "string",
            "description": "What is wrong, in words to act on.",
            "example": "Enter a number, such as 1234.56, not \"lots\""
          }
        }
      },
      "Pay_EmployeeImportProgressDto": {
        "type": "object",
        "description": "How far applying has got.",
        "required": [
          "done",
          "total"
        ],
        "properties": {
          "done": {
            "type": "integer",
            "format": "int32",
            "description": "Rows tried so far: updated or failed.",
            "example": 3120
          },
          "total": {
            "type": "integer",
            "format": "int32",
            "description": "Rows to save.",
            "example": 7000
          }
        }
      },
      "Pay_EmployeeImportRequestDto": {
        "type": "object",
        "description": "A CSV of changes to existing employees, one row per employee.",
        "required": [
          "csv"
        ],
        "properties": {
          "csv": {
            "type": "string",
            "description": "The file's text. Its first row is the headings, and one column must hold what `matchBy` names (by default `id`, the `Employee ID` the export leads with). Only the cells that differ from the employee now are changed; an empty cell leaves the field as it is."
          },
          "columns": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Pay_EmployeeImportColumnDto"
            },
            "nullable": true,
            "description": "Which field each heading holds, for headings that are not a field's path. Headings that are a field's path need no entry."
          },
          "matchBy": {
            "type": "string",
            "enum": [
              "EmployeeId",
              "PayrollId",
              "NiNumber",
              "EmployeeCode",
              "Email"
            ],
            "description": "How each row finds its employee: `EmployeeId` (default), `PayrollId` (compared without case), `NiNumber` (without spaces or case), `EmployeeCode` or `Email` (without case). That column is never changed by the import, and a value more than one employee holds is a problem on its row."
          }
        }
      },
      "Pay_EmployeeImportRowDto": {
        "type": "object",
        "description": "A row of the file that changes something, or cannot be applied.",
        "required": [
          "row",
          "employeeId",
          "changes",
          "problems",
          "warnings",
          "notices"
        ],
        "properties": {
          "row": {
            "type": "integer",
            "format": "int32",
            "description": "The row's line in the file, counting the headings as 1.",
            "example": 2
          },
          "employeeId": {
            "type": "string",
            "description": "The employee the row names.",
            "example": "01JD8Y7Q3N4M5P6R7S8T9V0W1X"
          },
          "changes": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Pay_EmployeeImportChangeDto"
            },
            "description": "The fields it changes."
          },
          "problems": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Pay_EmployeeImportProblemDto"
            },
            "description": "Why it cannot be applied, or why some of its cells are left out."
          },
          "outcome": {
            "type": "string",
            "nullable": true,
            "description": "After applying: `Updated`, or `Failed` with the reason in `problems`.",
            "example": "Updated"
          },
          "warnings": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Pay_EmployeeImportProblemDto"
            },
            "description": "Changes your role cannot make: never sent, and the rest of the row is applied."
          },
          "notices": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Pay_EmployeeImportProblemDto"
            },
            "description": "Changes that are applied, with what to know before applying them: for example that HMRC will get this employee's starter details again on the next FPS."
          }
        }
      },
      "Pay_EmployeeImportSkippedColumnDto": {
        "type": "object",
        "description": "A column of the file that changes nothing, and why.",
        "required": [
          "header",
          "reason"
        ],
        "properties": {
          "header": {
            "type": "string",
            "description": "The column's heading.",
            "example": "Payroll ID"
          },
          "reason": {
            "type": "string",
            "description": "Why it is left out.",
            "example": "Cannot be changed from a file; it has its own screen"
          }
        }
      },
      "Pay_EmployeeInForceDto": {
        "type": "object",
        "description": "The employee's dated values on the date asked about. A value is null when none is in force then, or when your role cannot read it.",
        "properties": {
          "taxCode": {
            "type": "string",
            "nullable": true,
            "description": "The tax code in force.",
            "example": "1257L"
          },
          "niCategory": {
            "type": "string",
            "nullable": true,
            "description": "The National Insurance category letter in force.",
            "example": "A"
          },
          "salary": {
            "type": "number",
            "format": "decimal",
            "nullable": true,
            "description": "The annual salary in force.",
            "example": 32000
          },
          "director": {
            "type": "boolean",
            "nullable": true,
            "description": "True while the employee is a director for National Insurance, through the end of the tax year their directorship ends in.",
            "example": true
          },
          "studentLoan": {
            "type": "string",
            "enum": [
              "Plan1",
              "Plan2",
              "Plan4",
              "Plan5"
            ],
            "description": "The student loan plan being repaid.",
            "example": "Plan2"
          },
          "postgraduateLoan": {
            "type": "string",
            "enum": [
              "PostgraduateLoan"
            ],
            "description": "The postgraduate loan being repaid.",
            "example": "PostgraduateLoan"
          }
        }
      },
      "Pay_EmployeeLeaverDetailsDto": {
        "type": "object",
        "properties": {
          "leavingDate": {
            "type": "string",
            "description": "The date the employee left the company.",
            "example": "2024-12-31"
          },
          "reason": {
            "type": "string",
            "nullable": true,
            "description": "The reason the employee left the company.",
            "example": "Retirement"
          },
          "issuedBy": {
            "type": "string",
            "nullable": true,
            "description": "The entity that issued the leaver certificate.",
            "example": "Employer"
          },
          "reportedToHmrc": {
            "type": "boolean",
            "description": "Whether the leaver details have been reported to HMRC.",
            "example": false
          },
          "finalisedOnPayslip": {
            "type": "boolean",
            "description": "Whether the leaver has been reported on a finalised payslip."
          }
        }
      },
      "Pay_EmployeeListItemDto": {
        "type": "object",
        "required": [
          "id",
          "payrollConfigId",
          "payrollId",
          "nationalInsuranceNumber",
          "name",
          "email",
          "currentTaxCodeWeek1Month1",
          "hasPostgraduateLoan",
          "isDirector"
        ],
        "properties": {
          "id": {
            "type": "string",
            "description": "The employee's unique identifier.",
            "example": "emp_12345"
          },
          "payrollConfigId": {
            "type": "string",
            "description": "ID of the payroll config the employee belongs to. Useful for grouping bulk actions per config without an extra fetch per row.",
            "example": "config_main_uk"
          },
          "payrollId": {
            "type": "string",
            "description": "The employee's payroll ID, reported to HMRC on the FPS.",
            "example": "payroll_2023_001"
          },
          "employeeCode": {
            "type": "string",
            "nullable": true,
            "description": "Employee code. An optional identifier for the employee.",
            "example": "EMP001"
          },
          "nationalInsuranceNumber": {
            "type": "string",
            "description": "The employee's National Insurance number.",
            "example": "QQ123456C"
          },
          "name": {
            "$ref": "#/components/schemas/Pay_EmployeeNameDto",
            "description": "The employee's name."
          },
          "email": {
            "type": "string",
            "format": "email",
            "description": "The employee's primary email address.",
            "example": "john.smith@company.com"
          },
          "department": {
            "type": "string",
            "nullable": true,
            "description": "The employee's department as free text.",
            "example": "Engineering"
          },
          "jobTitle": {
            "type": "string",
            "nullable": true,
            "description": "The employee's job title as free text.",
            "example": "Software Engineer"
          },
          "leaverDetails": {
            "$ref": "#/components/schemas/Pay_EmployeeLeaverDetailsDto",
            "nullable": true,
            "description": "The leaving date and reason once the employee is marked as a leaver; null otherwise."
          },
          "currentTaxCode": {
            "type": "string",
            "nullable": true,
            "description": "The tax code in force today, resolved from the employee's whole tax-code history. Null when the employee has no tax code on record for any year.",
            "example": "1257L"
          },
          "currentTaxCodeWeek1Month1": {
            "type": "boolean",
            "description": "Whether the current tax code is on a Week 1/Month 1 (non-cumulative) basis, which is what makes a code an emergency one.",
            "example": false
          },
          "currentNiCategory": {
            "type": "string",
            "nullable": true,
            "description": "The NI category in force today, resolved from the employee's whole NI-category history. Null when the employee has no category on record for any year.",
            "example": "A"
          },
          "studentLoanPlan": {
            "type": "string",
            "enum": [
              "Plan1",
              "Plan2",
              "Plan4",
              "Plan5"
            ],
            "description": "Student loan plan currently being deducted. Null when the employee has no plan, or the plan has already ended.",
            "example": "Plan2"
          },
          "hasPostgraduateLoan": {
            "type": "boolean",
            "description": "Whether a postgraduate loan is currently being deducted.",
            "example": false
          },
          "starterDeclaration": {
            "type": "string",
            "enum": [
              "ThisIsMyFirstJobSince6thApril",
              "ThisIsMyOnlyJob",
              "IHaveAnotherJobOrPension",
              "None"
            ],
            "description": "The starter declaration on record.",
            "example": "ThisIsMyOnlyJob"
          },
          "startDate": {
            "type": "string",
            "nullable": true,
            "format": "date",
            "description": "The date the employment started.",
            "example": "2026-05-01"
          },
          "isDirector": {
            "type": "boolean",
            "description": "Whether a directorship is in effect today, not merely one ever recorded.",
            "example": false
          },
          "directorsNICType": {
            "type": "string",
            "enum": [
              "Annual",
              "Alternative"
            ],
            "description": "Director's NI calculation method. Null when the employee is not a director.",
            "example": "Annual"
          }
        }
      },
      "Pay_EmployeeNameDto": {
        "type": "object",
        "required": [
          "firstName",
          "lastName"
        ],
        "properties": {
          "title": {
            "type": "string",
            "nullable": true,
            "description": "The person's title, such as Mr or Ms; optional, and checked against HMRC's title rules when sent.",
            "example": "Mr"
          },
          "firstName": {
            "type": "string",
            "description": "The first forename, reported to HMRC; 1 to 35 characters starting with a letter, using letters, spaces, hyphens and apostrophes.",
            "example": "John"
          },
          "lastName": {
            "type": "string",
            "description": "The surname, reported to HMRC; 1 to 35 characters starting with a letter, using letters, spaces, hyphens and apostrophes.",
            "example": "Smith"
          },
          "initials": {
            "type": "string",
            "nullable": true,
            "description": "The employee's initials."
          },
          "middleName": {
            "type": "string",
            "nullable": true,
            "description": "A second forename; optional, and checked against the same rules as firstName when sent.",
            "example": "Edward"
          }
        }
      },
      "Pay_EmployeeNameDtoMergePatch": {
        "type": "object",
        "properties": {
          "title": {
            "type": "string",
            "nullable": true,
            "description": "The person's title, such as Mr or Ms; optional, and checked against HMRC's title rules when sent.",
            "example": "Mr"
          },
          "firstName": {
            "type": "string",
            "nullable": true,
            "description": "The first forename, reported to HMRC; 1 to 35 characters starting with a letter, using letters, spaces, hyphens and apostrophes.",
            "example": "John"
          },
          "lastName": {
            "type": "string",
            "nullable": true,
            "description": "The surname, reported to HMRC; 1 to 35 characters starting with a letter, using letters, spaces, hyphens and apostrophes.",
            "example": "Smith"
          },
          "initials": {
            "type": "string",
            "nullable": true,
            "description": "The employee's initials."
          },
          "middleName": {
            "type": "string",
            "nullable": true,
            "description": "A second forename; optional, and checked against the same rules as firstName when sent.",
            "example": "Edward"
          }
        }
      },
      "Pay_EmployeeNiCategoriesResponseDto": {
        "type": "object",
        "description": "Response containing all NI categories for an employee grouped by year",
        "required": [
          "categoriesPerYear"
        ],
        "properties": {
          "categoriesPerYear": {
            "type": "object",
            "additionalProperties": {
              "type": "array",
              "items": {
                "$ref": "#/components/schemas/Pay_EmployeeNiCategoryDto"
              }
            },
            "description": "NI categories grouped by tax year",
            "example": {
              "2024": [
                {
                  "category": "A",
                  "effectiveDate": "2024-04-06",
                  "reason": "Annual Review",
                  "issuedBy": "HMRC"
                }
              ],
              "2025": [
                {
                  "category": "A",
                  "effectiveDate": "2025-04-06",
                  "reason": "Annual Review",
                  "issuedBy": "HMRC"
                }
              ]
            }
          }
        }
      },
      "Pay_EmployeeNiCategoryDto": {
        "type": "object",
        "required": [
          "category"
        ],
        "properties": {
          "category": {
            "type": "string",
            "enum": [
              "A",
              "B",
              "C",
              "D",
              "E",
              "F",
              "H",
              "I",
              "J",
              "K",
              "L",
              "M",
              "N",
              "S",
              "V",
              "X",
              "Z"
            ],
            "description": "HMRC-published NI category letter for payroll submissions.",
            "example": "A"
          },
          "effectiveDate": {
            "type": "string",
            "format": "date",
            "description": "Date when this category becomes effective",
            "example": "2025-04-06"
          },
          "reason": {
            "type": "string",
            "description": "Reason for the category",
            "example": "HMRC Update"
          },
          "issuedBy": {
            "type": "string",
            "description": "Who issued the category. Valid values: 'HMRC', 'Employer'",
            "example": "HMRC"
          }
        }
      },
      "Pay_EmployeeNiDto": {
        "type": "object",
        "properties": {
          "nationalInsuranceNumber": {
            "type": "string",
            "nullable": true,
            "description": "The National Insurance number for the employee (optional).",
            "example": "QQ123456C"
          },
          "categoriesPerYear": {
            "type": "object",
            "additionalProperties": {
              "type": "array",
              "items": {
                "$ref": "#/components/schemas/Pay_EmployeeNiCategoryDto"
              }
            },
            "description": "National Insurance categories organized by tax year"
          }
        }
      },
      "Pay_EmployeeNiDtoMergePatch": {
        "type": "object",
        "properties": {
          "nationalInsuranceNumber": {
            "type": "string",
            "nullable": true,
            "description": "The National Insurance number for the employee (optional).",
            "example": "QQ123456C"
          },
          "categoriesPerYear": {
            "type": "object",
            "additionalProperties": {
              "type": "array",
              "items": {
                "$ref": "#/components/schemas/Pay_EmployeeNiCategoryDto"
              }
            },
            "description": "National Insurance categories organized by tax year"
          }
        }
      },
      "Pay_EmployeeNinoDto": {
        "type": "object",
        "required": [
          "nationalInsuranceNumber"
        ],
        "properties": {
          "nationalInsuranceNumber": {
            "type": "string",
            "description": "The National Insurance Number",
            "example": "AB123456C"
          }
        }
      },
      "Pay_EmployeePartnerDetailsDto": {
        "type": "object",
        "properties": {
          "nationalInsuranceNumber": {
            "type": "string",
            "nullable": true,
            "description": "The partner's National Insurance number; optional, and checked against the NI number format when sent.",
            "example": "QQ654321A"
          },
          "name": {
            "$ref": "#/components/schemas/Pay_EmployeeNameDto",
            "description": "The partner's name, reported to HMRC on the FPS with the first payment of Shared Parental Pay."
          }
        }
      },
      "Pay_EmployeePartnerDetailsDtoMergePatch": {
        "type": "object",
        "properties": {
          "nationalInsuranceNumber": {
            "type": "string",
            "nullable": true,
            "description": "The partner's National Insurance number; optional, and checked against the NI number format when sent.",
            "example": "QQ654321A"
          },
          "name": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Pay_EmployeeNameDtoMergePatch"
              }
            ],
            "nullable": true,
            "description": "The partner's name, reported to HMRC on the FPS with the first payment of Shared Parental Pay."
          }
        }
      },
      "Pay_EmployeePayIdChangedDto": {
        "type": "object",
        "description": "Records that the employee's payroll id changed, for RTI continuity.",
        "properties": {
          "oldPayId": {
            "type": "string",
            "nullable": true,
            "description": "The payroll id this employee had before it was changed."
          }
        }
      },
      "Pay_EmployeePayrollConfigUpdateDto": {
        "type": "object",
        "required": [
          "payrollConfigId"
        ],
        "properties": {
          "payrollConfigId": {
            "type": "string",
            "description": "The ID of the new payroll config to assign the employee to",
            "example": "01HXYZ1234ABCDEF5678"
          }
        }
      },
      "Pay_EmployeePayrollIdUpdateDto": {
        "type": "object",
        "properties": {
          "payrollId": {
            "type": "string",
            "nullable": true,
            "description": "The new Payroll ID for the employee. Used as the payId field in HMRC FPS submissions. The previous Payroll ID is automatically saved for HMRC reporting.",
            "example": "PAY456"
          }
        }
      },
      "Pay_EmployeePostgraduateLoanDetailsDto": {
        "type": "object",
        "description": "The details of the postgraduate loan",
        "properties": {
          "loanType": {
            "type": "string",
            "enum": [
              "PostgraduateLoan"
            ],
            "description": "Type of postgraduate loan",
            "example": "PostgraduateLoan"
          },
          "startDate": {
            "type": "string",
            "nullable": true,
            "description": "The start date of the postgraduate loan",
            "example": "2015-09-01"
          },
          "endDate": {
            "type": "string",
            "nullable": true,
            "description": "The end date of the postgraduate loan",
            "example": "2028-07-31"
          }
        },
        "example": {
          "loanType": "PostgraduateLoan",
          "startDate": "2015-09-01",
          "endDate": "2028-07-31"
        }
      },
      "Pay_EmployeePostgraduateLoanDetailsDtoMergePatch": {
        "type": "object",
        "properties": {
          "loanType": {
            "type": "string",
            "enum": [
              "PostgraduateLoan"
            ],
            "description": "Type of postgraduate loan",
            "example": "PostgraduateLoan"
          },
          "startDate": {
            "type": "string",
            "nullable": true,
            "description": "The start date of the postgraduate loan",
            "example": "2015-09-01"
          },
          "endDate": {
            "type": "string",
            "nullable": true,
            "description": "The end date of the postgraduate loan",
            "example": "2028-07-31"
          }
        }
      },
      "Pay_EmployeePostgraduateLoanEndDto": {
        "type": "object",
        "required": [
          "endDate"
        ],
        "properties": {
          "endDate": {
            "type": "string",
            "format": "date",
            "description": "The end date of the postgraduate loan in YYYY-MM-DD format",
            "example": "2024-12-31"
          }
        }
      },
      "Pay_EmployeePostgraduateLoanStartDto": {
        "type": "object",
        "required": [
          "startDate"
        ],
        "properties": {
          "startDate": {
            "type": "string",
            "format": "date",
            "description": "The start date of the postgraduate loan in YYYY-MM-DD format",
            "example": "2024-04-06"
          }
        }
      },
      "Pay_EmployeeQualifyingDayPolicyHistoryResponseDto": {
        "type": "object",
        "description": "The full effective-dated history of an employee's qualifying-day policy.",
        "required": [
          "versions"
        ],
        "properties": {
          "versions": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Pay_EmployeeQualifyingDayPolicyVersionDto"
            },
            "description": "Every version of the employee's SSP qualifying-day policy, oldest first."
          }
        }
      },
      "Pay_EmployeeQualifyingDayPolicyVersionDto": {
        "type": "object",
        "description": "An effective-dated qualifying-day policy version with audit metadata.",
        "required": [
          "effectiveFrom",
          "mode",
          "createdDate",
          "createdBy",
          "updatedDate",
          "updatedBy"
        ],
        "properties": {
          "effectiveFrom": {
            "type": "string",
            "description": "The date this version of the policy takes effect (YYYY-MM-DD).",
            "example": "2026-04-06"
          },
          "mode": {
            "type": "string",
            "enum": [
              "DeriveFromPattern",
              "AgreedFixedDays",
              "WednesdayDefault"
            ],
            "description": "How the employee's SSP qualifying days are worked out from effectiveFrom: DeriveFromPattern, AgreedFixedDays or WednesdayDefault."
          },
          "agreedQualifyingDays": {
            "$ref": "#/components/schemas/Pay_StandardWorkingDaysDto",
            "nullable": true,
            "description": "The agreed qualifying weekdays when mode is AgreedFixedDays."
          },
          "createdDate": {
            "type": "string",
            "description": "When this version was first saved, as a UTC date and time."
          },
          "createdBy": {
            "type": "string",
            "description": "The user who first saved this version."
          },
          "updatedDate": {
            "type": "string",
            "description": "When this version was last saved, as a UTC date and time."
          },
          "updatedBy": {
            "type": "string",
            "description": "The user who last saved this version."
          }
        }
      },
      "Pay_EmployeeSalaryHistoryResponseDto": {
        "type": "object",
        "description": "The full effective-dated salary history of an employee, oldest first, with the version in force today.",
        "required": [
          "versions"
        ],
        "properties": {
          "versions": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Pay_EmployeeSalaryVersionDto"
            },
            "description": "Every version, oldest first."
          },
          "inForce": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Pay_EmployeeSalaryVersionDto"
              }
            ],
            "nullable": true,
            "description": "The version in force today; null when every version is still in the future."
          }
        }
      },
      "Pay_EmployeeSalaryVersionDto": {
        "type": "object",
        "description": "An effective-dated salary version with audit metadata.",
        "required": [
          "effectiveFrom",
          "annualSalary",
          "createdDate",
          "createdBy",
          "updatedDate",
          "updatedBy"
        ],
        "properties": {
          "effectiveFrom": {
            "type": "string",
            "format": "date",
            "description": "The date this salary takes effect (YYYY-MM-DD).",
            "example": "2026-04-06"
          },
          "annualSalary": {
            "type": "number",
            "format": "decimal",
            "description": "The annual salary in pounds in force from effectiveFrom.",
            "example": 52000
          },
          "reason": {
            "type": "string",
            "nullable": true,
            "description": "The note given when the salary was set, if any.",
            "example": "Annual review"
          },
          "createdDate": {
            "type": "string",
            "description": "When this version was first saved, as a UTC date and time."
          },
          "createdBy": {
            "type": "string",
            "description": "The user who first saved this version."
          },
          "updatedDate": {
            "type": "string",
            "description": "When this version was last saved, as a UTC date and time."
          },
          "updatedBy": {
            "type": "string",
            "description": "The user who last saved this version."
          },
          "contractedHoursPerWeek": {
            "type": "number",
            "format": "decimal",
            "nullable": true,
            "description": "The hours a week the employee is contracted to work at this salary; null when none were stated.",
            "example": 37.5
          }
        }
      },
      "Pay_EmployeeSearchFilterDto": {
        "type": "object",
        "description": "A condition on one employee field.",
        "required": [
          "field",
          "operator"
        ],
        "properties": {
          "field": {
            "type": "string",
            "description": "The field's path as `GET /employee-fields` lists it: dots between objects, `[]` for a list, `{}` for a map (`tags[].value`), or a dated value (`taxCode`, `niCategory`, `salary`, `director`, `studentLoan`, `postgraduateLoan`) read for `asAt`.",
            "example": "department"
          },
          "operator": {
            "type": "string",
            "enum": [
              "Equals",
              "NotEquals",
              "In",
              "NotIn",
              "Contains",
              "StartsWith",
              "GreaterThan",
              "GreaterThanOrEqual",
              "LessThan",
              "LessThanOrEqual",
              "Between",
              "IsEmpty",
              "IsNotEmpty",
              "ContainsAll"
            ],
            "description": "How the field is compared. `ContainsAll` is for a field with several values; `Contains` and `StartsWith` for text; `GreaterThan`, `LessThan` and `Between` for numbers and dates.",
            "example": "In"
          },
          "values": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "nullable": true,
            "description": "The values compared with; dates are yyyy-MM-dd. None for `IsEmpty` and `IsNotEmpty`, two for `Between`.",
            "example": [
              "Engineering",
              "Sales"
            ]
          }
        }
      },
      "Pay_EmployeeSearchItemDto": {
        "type": "object",
        "description": "One employee, holding only the fields asked for that your role can read.",
        "required": [
          "employeeId",
          "status",
          "employee",
          "inForce"
        ],
        "properties": {
          "employeeId": {
            "type": "string",
            "description": "The employee.",
            "example": "01JD8Y7Q3N4M5P6R7S8T9V0W1X"
          },
          "status": {
            "type": "string",
            "enum": [
              "Active",
              "Leaver",
              "FutureLeaver"
            ],
            "description": "Where the employee stands on the date asked about.",
            "example": "Active"
          },
          "employee": {
            "$ref": "#/components/schemas/Pay_EmployeeDto",
            "description": "The employee as `GET /employees/{employeeId}` answers it, holding only the fields asked for (every field when `fields` is omitted) that your role can read; any other field is absent, required or not. Year to date (`earningsToDatePerYear`, `directorEarningsToDatePerYear`) is never included: read it from `GET /employees/{employeeId}`. `isLeaver` is read for `asAt`, as `status` is."
          },
          "inForce": {
            "$ref": "#/components/schemas/Pay_EmployeeInForceDto",
            "description": "The dated values on the date asked about."
          }
        }
      },
      "Pay_EmployeeSearchRequestDto": {
        "type": "object",
        "description": "Employees of the organisation matching every filter, a page at a time, with how many match in all.",
        "properties": {
          "asAt": {
            "type": "string",
            "nullable": true,
            "format": "date",
            "description": "The date dated values and where each employee stands are read for, yyyy-MM-dd; today when omitted.",
            "example": "2026-11-05"
          },
          "status": {
            "type": "string",
            "enum": [
              "All",
              "Active",
              "Leaver",
              "FutureLeaver"
            ],
            "description": "`Leaver`: marked a leaver or left before the date. `FutureLeaver`: active with a leaving date on or after it. `All` when omitted.",
            "example": "Active"
          },
          "search": {
            "type": "string",
            "nullable": true,
            "description": "Name, email, employee code or payroll ID containing this, any case.",
            "example": "jane"
          },
          "filters": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Pay_EmployeeSearchFilterDto"
            },
            "nullable": true,
            "description": "Every one must hold."
          },
          "sort": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Pay_EmployeeSearchSortDto"
            },
            "nullable": true,
            "description": "Then by last name and first name."
          },
          "fields": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "nullable": true,
            "description": "The fields to answer; a group such as `address` answers all of it. Everything your role can read when omitted.",
            "example": [
              "name",
              "department",
              "taxCode"
            ]
          },
          "limit": {
            "type": "integer",
            "format": "int32",
            "description": "At most this many, from 1 to 500.",
            "example": 100
          },
          "offset": {
            "type": "integer",
            "format": "int32",
            "description": "How many matches to skip.",
            "example": 0
          },
          "consistentWith": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Pay_EmployeeWrittenVersionDto"
            },
            "nullable": true,
            "description": "Employees you have just written: the answer waits until it reflects them, or answers 503 with Retry-After when it cannot within ten seconds."
          }
        }
      },
      "Pay_EmployeeSearchResultDto": {
        "type": "object",
        "description": "A page of employees.",
        "required": [
          "items",
          "total",
          "hasMore"
        ],
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Pay_EmployeeSearchItemDto"
            },
            "description": "The page, in order."
          },
          "total": {
            "type": "integer",
            "format": "int32",
            "description": "How many employees match in all.",
            "example": 6000
          },
          "hasMore": {
            "type": "boolean",
            "description": "Whether more match after this page.",
            "example": true
          }
        }
      },
      "Pay_EmployeeSearchSortDto": {
        "type": "object",
        "description": "An order to list employees in.",
        "required": [
          "field"
        ],
        "properties": {
          "field": {
            "type": "string",
            "description": "A field that holds one value.",
            "example": "starterDetails.startDate"
          },
          "descending": {
            "type": "boolean",
            "description": "Largest or latest first.",
            "example": true
          }
        }
      },
      "Pay_EmployeeSecondedDetailsDto": {
        "type": "object",
        "properties": {
          "stayStatus": {
            "type": "string",
            "enum": [
              "Stay183DaysOrMore",
              "StayLessThan183Days",
              "InOutUK"
            ],
            "description": "Indicates the stay status of the employee Allowed values: 'Stay183DaysOrMore', 'StayLessThan183Days', or 'InOutUK'.",
            "example": "Stay183DaysOrMore"
          },
          "eEACitizen": {
            "type": "boolean",
            "description": "Indicates if the employee is an EEA citizen.",
            "example": true
          },
          "ePM6": {
            "type": "boolean",
            "description": "Indicator that this is an EPM 6 (modified) scheme",
            "example": false
          }
        }
      },
      "Pay_EmployeeStarterDetailsDto": {
        "type": "object",
        "required": [
          "startDate",
          "starterDeclaration"
        ],
        "properties": {
          "startDate": {
            "type": "string",
            "description": "The start date of the employee.",
            "example": "2024-01-15"
          },
          "starterDeclaration": {
            "type": "string",
            "enum": [
              "ThisIsMyFirstJobSince6thApril",
              "ThisIsMyOnlyJob",
              "IHaveAnotherJobOrPension",
              "None"
            ],
            "description": "The starter declaration of the employee. Use 'ThisIsMyFirstJobSince6thApril', 'ThisIsMyOnlyJob', or 'IHaveAnotherJobOrPension' for a new starter. Use 'None' for an existing employee who has already been reported to HMRC (for example, one migrated mid-year from another payroll provider); in that case alreadySentToHmrcFps must be true.",
            "example": "ThisIsMyOnlyJob"
          },
          "secondedDetails": {
            "$ref": "#/components/schemas/Pay_EmployeeSecondedDetailsDto",
            "nullable": true,
            "description": "For an employee seconded to work in the UK, the secondment details reported to HMRC in place of a starter declaration; cannot be sent with starterDeclaration."
          },
          "alreadySentToHmrcFps": {
            "type": "boolean",
            "description": "Whether HMRC already has the employee's start date and starter declaration. While false, the next FPS sends them, and it becomes true when HMRC accepts that FPS. Set to false for a new starter. Set to true for an existing employee whose previous payroll already reported them; this is required when starterDeclaration is 'None'. It can be changed at any time: setting it back to false sends the starter details again on the next FPS, and changing the start date or declaration while it is true only updates the employee's record, because HMRC is not sent them again.",
            "example": false
          }
        }
      },
      "Pay_EmployeeStudentDetailsDto": {
        "type": "object",
        "description": "The student details of the employee",
        "properties": {
          "studentLoanDetails": {
            "$ref": "#/components/schemas/Pay_EmployeeStudentLoanDetailsDto",
            "nullable": true,
            "description": "The details of the student loan"
          },
          "postgraduateLoanDetails": {
            "$ref": "#/components/schemas/Pay_EmployeePostgraduateLoanDetailsDto",
            "nullable": true,
            "description": "The details of the postgraduate loan"
          }
        },
        "example": {
          "studentLoanDetails": {
            "loanType": "Plan2",
            "startDate": "2010-09-01",
            "endDate": "2025-07-31"
          },
          "postgraduateLoanDetails": {
            "loanType": "PostgraduateLoan",
            "startDate": "2015-09-01",
            "endDate": "2028-07-31"
          }
        }
      },
      "Pay_EmployeeStudentDetailsDtoMergePatch": {
        "type": "object",
        "properties": {
          "studentLoanDetails": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Pay_EmployeeStudentLoanDetailsDtoMergePatch"
              }
            ],
            "nullable": true,
            "description": "The details of the student loan"
          },
          "postgraduateLoanDetails": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Pay_EmployeePostgraduateLoanDetailsDtoMergePatch"
              }
            ],
            "nullable": true,
            "description": "The details of the postgraduate loan"
          }
        }
      },
      "Pay_EmployeeStudentLoanDetailsDto": {
        "type": "object",
        "description": "The details of the student loan",
        "properties": {
          "loanType": {
            "type": "string",
            "enum": [
              "Plan1",
              "Plan2",
              "Plan4",
              "Plan5"
            ],
            "description": "Type of student loan",
            "example": "Plan2"
          },
          "startDate": {
            "type": "string",
            "nullable": true,
            "description": "The start date of the student loan",
            "example": "2010-09-01"
          },
          "endDate": {
            "type": "string",
            "nullable": true,
            "description": "The end date of the student loan",
            "example": "2025-07-31"
          }
        },
        "example": {
          "loanType": "Plan2",
          "startDate": "2010-09-01",
          "endDate": "2025-07-31"
        }
      },
      "Pay_EmployeeStudentLoanDetailsDtoMergePatch": {
        "type": "object",
        "properties": {
          "loanType": {
            "type": "string",
            "enum": [
              "Plan1",
              "Plan2",
              "Plan4",
              "Plan5"
            ],
            "description": "Type of student loan",
            "example": "Plan2"
          },
          "startDate": {
            "type": "string",
            "nullable": true,
            "description": "The start date of the student loan",
            "example": "2010-09-01"
          },
          "endDate": {
            "type": "string",
            "nullable": true,
            "description": "The end date of the student loan",
            "example": "2025-07-31"
          }
        }
      },
      "Pay_EmployeeStudentLoanEndDto": {
        "type": "object",
        "required": [
          "endDate"
        ],
        "properties": {
          "endDate": {
            "type": "string",
            "format": "date",
            "description": "The end date of the student loan in YYYY-MM-DD format",
            "example": "2024-12-31"
          }
        }
      },
      "Pay_EmployeeStudentLoanStartDto": {
        "type": "object",
        "required": [
          "loanType",
          "startDate"
        ],
        "properties": {
          "loanType": {
            "type": "string",
            "enum": [
              "Plan1",
              "Plan2",
              "Plan4",
              "Plan5"
            ],
            "description": "Type of student loan. Valid values: 'Plan1', 'Plan2', 'Plan4', 'Plan5'",
            "example": "Plan2"
          },
          "startDate": {
            "type": "string",
            "format": "date",
            "description": "The start date of the student loan in YYYY-MM-DD format",
            "example": "2024-04-06"
          }
        }
      },
      "Pay_EmployeeTaxCodeDto": {
        "type": "object",
        "required": [
          "code"
        ],
        "properties": {
          "code": {
            "type": "string",
            "description": "The tax code for the employee.",
            "example": "1257L"
          },
          "effectiveDate": {
            "type": "string",
            "nullable": true,
            "description": "The effective date of the tax code, if none is set, created date is used.",
            "example": "2024-04-06"
          },
          "reason": {
            "type": "string",
            "description": "Reason for the tax code change",
            "example": "Standard tax code"
          },
          "issuedBy": {
            "type": "string",
            "description": "Who issued the tax code change. Valid values: 'HMRC', 'Employer'",
            "example": "HMRC"
          },
          "week1Month1": {
            "type": "boolean",
            "description": "Whether the tax code is week1Month1, meaning basis non cumulative",
            "example": false
          }
        }
      },
      "Pay_EmployeeTaxCodesResponseDto": {
        "type": "object",
        "description": "Response containing all tax codes for an employee grouped by year",
        "required": [
          "taxCodesPerYear"
        ],
        "properties": {
          "taxCodesPerYear": {
            "type": "object",
            "additionalProperties": {
              "type": "array",
              "items": {
                "$ref": "#/components/schemas/Pay_EmployeeTaxCodeDto"
              }
            },
            "description": "Tax codes grouped by tax year",
            "example": {
              "2024": [
                {
                  "code": "1257L",
                  "effectiveDate": "2024-04-06",
                  "reason": "Annual Review",
                  "issuedBy": "HMRC",
                  "week1Month1": false
                }
              ],
              "2025": [
                {
                  "code": "1300L",
                  "effectiveDate": "2025-04-06",
                  "reason": "Annual Review",
                  "issuedBy": "HMRC",
                  "week1Month1": false
                }
              ]
            }
          }
        }
      },
      "Pay_EmployeeWorkingPatternHistoryResponseDto": {
        "type": "object",
        "description": "The full effective-dated history of an employee's working pattern.",
        "required": [
          "versions"
        ],
        "properties": {
          "versions": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Pay_EmployeeWorkingPatternVersionDto"
            },
            "description": "Every version of the employee's working pattern, oldest first."
          }
        }
      },
      "Pay_EmployeeWorkingPatternVersionDto": {
        "type": "object",
        "description": "An effective-dated working-pattern version with audit metadata.",
        "required": [
          "effectiveFrom",
          "configuration",
          "createdDate",
          "createdBy",
          "updatedDate",
          "updatedBy"
        ],
        "properties": {
          "effectiveFrom": {
            "type": "string",
            "description": "The date this version of the working pattern takes effect (YYYY-MM-DD).",
            "example": "2026-04-06"
          },
          "configuration": {
            "$ref": "#/components/schemas/Pay_WorkingDaysConfigurationDto",
            "description": "The working pattern in force from effectiveFrom."
          },
          "createdDate": {
            "type": "string",
            "description": "When this version was first saved, as a UTC date and time."
          },
          "createdBy": {
            "type": "string",
            "description": "The user who first saved this version."
          },
          "updatedDate": {
            "type": "string",
            "description": "When this version was last saved, as a UTC date and time."
          },
          "updatedBy": {
            "type": "string",
            "description": "The user who last saved this version."
          }
        }
      },
      "Pay_EmployeeWorkplaceDetailsDto": {
        "type": "object",
        "properties": {
          "workplacePostcode": {
            "type": "string",
            "nullable": true,
            "description": "The postcode of the workplace this employee reports to.",
            "example": "E1 6AN"
          }
        }
      },
      "Pay_EmployeeWorkplaceDetailsDtoMergePatch": {
        "type": "object",
        "properties": {
          "workplacePostcode": {
            "type": "string",
            "nullable": true,
            "description": "The postcode of the workplace this employee reports to.",
            "example": "E1 6AN"
          }
        }
      },
      "Pay_EmployeeWrittenVersionDto": {
        "type": "object",
        "description": "An employee you have just written, so the answer reflects the write.",
        "required": [
          "employeeId"
        ],
        "properties": {
          "employeeId": {
            "type": "string",
            "description": "The employee.",
            "example": "01JD8Y7Q3N4M5P6R7S8T9V0W1X"
          },
          "updatedDate": {
            "type": "string",
            "nullable": true,
            "description": "The `updatedDate` your write returned; null when it deleted the employee.",
            "example": "2026-11-05T10:00:00.000Z"
          }
        }
      },
      "Pay_EmploymentAllowanceSettingsDto": {
        "type": "object",
        "required": [
          "claimStatus"
        ],
        "properties": {
          "isEnabled": {
            "type": "boolean",
            "description": "Whether the organisation is eligible for employment allowance",
            "example": true
          },
          "claimStatus": {
            "type": "string",
            "enum": [
              "Claimed",
              "NotClaimed",
              "NotEligible"
            ],
            "description": "The status of the employment allowance claim",
            "example": "Claimed"
          },
          "deMinimisStateAidSectors": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "Agriculture",
                "FisheriesAndAquaculture",
                "RoadTransport",
                "Industry",
                "NA"
              ]
            },
            "nullable": true,
            "description": "The sectors that apply for de minimis state aid rules",
            "example": [
              "Agriculture",
              "Industry"
            ]
          }
        }
      },
      "Pay_EmploymentAllowanceY2025To2026Dto": {
        "type": "object",
        "description": "Employment Allowance with the employer's sectors for the De Minimis State Aid declaration: the\nshape read for tax years 2024/25 and 2025/26 (`HmrcTaxYearFactory.GetEpsTaxYearShape`).",
        "properties": {
          "isEnabled": {
            "type": "boolean",
            "description": "Whether the employer claims Employment Allowance.",
            "example": true
          },
          "employerSectors": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "Agriculture",
                "FisheriesAndAquaculture",
                "RoadTransport",
                "Industry",
                "NA"
              ]
            },
            "description": "The employer's sectors for the De Minimis State Aid declaration.",
            "example": [
              "Agriculture",
              "Industry"
            ]
          }
        }
      },
      "Pay_EmploymentAllowanceY2026To2027Dto": {
        "type": "object",
        "description": "Employment Allowance without a De Minimis State Aid declaration: the shape read for tax years\n2026/27 and 2027/28 (`HmrcTaxYearFactory.GetEpsTaxYearShape`).",
        "properties": {
          "isEnabled": {
            "type": "boolean",
            "description": "Whether the employer claims Employment Allowance.",
            "example": true
          }
        }
      },
      "Pay_EpsSubmissionEntryDto": {
        "type": "object",
        "required": [
          "submissionId",
          "taxYear",
          "organisationId",
          "hmrcEpsReportStatus",
          "createdDate",
          "createdBy",
          "updatedDate",
          "updatedBy",
          "figuresChangedSinceSubmission"
        ],
        "properties": {
          "submissionId": {
            "type": "string",
            "description": "The unique submission ID",
            "example": "EPS_2025_001"
          },
          "taxYear": {
            "type": "integer",
            "format": "int32",
            "description": "The tax year",
            "example": 2025
          },
          "taxMonth": {
            "type": "integer",
            "format": "int32",
            "nullable": true,
            "description": "The tax month (1-12)",
            "example": 6
          },
          "organisationId": {
            "type": "string",
            "description": "The organisation ID",
            "example": "org_123"
          },
          "hmrcEpsReportStatus": {
            "type": "string",
            "enum": [
              "NotSent",
              "Sending",
              "Sent",
              "Failed"
            ],
            "description": "The HMRC EPS report status",
            "example": "Sent"
          },
          "createdDate": {
            "type": "string",
            "format": "date-time",
            "description": "Creation date",
            "example": "2025-01-01T00:00:00Z"
          },
          "createdBy": {
            "type": "string",
            "description": "User who created the record",
            "example": "user_123"
          },
          "updatedDate": {
            "type": "string",
            "format": "date-time",
            "description": "Last update date",
            "example": "2025-01-02T00:00:00Z"
          },
          "updatedBy": {
            "type": "string",
            "description": "User who last updated the record",
            "example": "user_456"
          },
          "submissionBody": {
            "type": "string",
            "nullable": true,
            "description": "The submission body",
            "example": "Submission body content"
          },
          "correlationID": {
            "type": "string",
            "nullable": true,
            "description": "The correlation ID",
            "example": "corr_123"
          },
          "submissionDate": {
            "type": "string",
            "nullable": true,
            "format": "date-time",
            "description": "The submission date",
            "example": "2025-01-01T00:00:00Z"
          },
          "submissionResponse": {
            "type": "string",
            "nullable": true,
            "description": "The submission response",
            "example": "Response from HMRC"
          },
          "errors": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "nullable": true,
            "description": "List of errors",
            "example": [
              "Error message 1",
              "Error message 2"
            ]
          },
          "figuresChangedSinceSubmission": {
            "type": "boolean",
            "description": "True when a pay run of this tax month, or a later one, was unlocked after the EPS was sent: the figures it reported may no longer be what the payslips say. Advice to the person sending the next EPS; the sent EPS is never resent.",
            "example": false
          },
          "figuresChangedReason": {
            "type": "string",
            "nullable": true,
            "description": "Why the figures are flagged as changed, when they are",
            "example": "Pay run 2026-7 unlocked"
          },
          "figuresChangedDate": {
            "type": "string",
            "nullable": true,
            "description": "When the figures were flagged as changed, when they are",
            "example": "2026-10-27T09:15:00Z"
          }
        }
      },
      "Pay_ExplicitScheduleDto": {
        "type": "object",
        "description": "An explicit, week-by-week schedule for irregular workers whose pattern does not repeat.",
        "required": [
          "weeks"
        ],
        "properties": {
          "weeks": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Pay_ScheduledWeekDto"
            },
            "description": "The scheduled weeks. A week that is not listed counts as not worked."
          }
        }
      },
      "Pay_ExplicitScheduleDtoMergePatch": {
        "type": "object",
        "properties": {
          "weeks": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Pay_ScheduledWeekDto"
            },
            "nullable": true,
            "description": "The scheduled weeks. A week that is not listed counts as not worked."
          }
        }
      },
      "Pay_FinalSubmissionDetailsY2024To2026Dto": {
        "type": "object",
        "description": "Final submission details for tax years 2024/2025 and 2025/2026",
        "properties": {
          "becauseSchemeCeased": {
            "type": "boolean",
            "nullable": true,
            "description": "Indicates if the scheme has ceased",
            "example": true
          },
          "dateSchemeCeased": {
            "type": "string",
            "nullable": true,
            "format": "date",
            "description": "The date when the scheme ceased (format: yyyy-MM-dd)",
            "example": "2024-04-05"
          },
          "forYear": {
            "type": "boolean",
            "nullable": true,
            "description": "Indicates if this is the final submission for the tax year",
            "example": true
          }
        }
      },
      "Pay_FinalSubmissionErrorResponseDto": {
        "type": "object",
        "required": [
          "example",
          "description",
          "type",
          "taxYear"
        ],
        "properties": {
          "example": {
            "type": "object",
            "description": "Example of the required final submission details format",
            "example": {
              "field1": "value1",
              "field2": "value2"
            }
          },
          "description": {
            "type": "string",
            "description": "Description of what final submission details are required",
            "example": "Final submission details are required for the last period of the tax year 2025-2026. Please provide the details in the request body using the example format above."
          },
          "type": {
            "type": "string",
            "description": "The type of final submission details required",
            "example": "FinalSubmissionDetailsY2025To26"
          },
          "taxYear": {
            "type": "string",
            "description": "The tax year range",
            "example": "2025-2026"
          }
        }
      },
      "Pay_GovernmentGatewayCretentialsDto": {
        "type": "object",
        "required": [
          "userId",
          "hasPassword"
        ],
        "properties": {
          "userId": {
            "type": "string",
            "description": "The Government Gateway user ID used to sign RTI submissions to HMRC."
          },
          "password": {
            "type": "string",
            "nullable": true,
            "description": "Always returned empty: the stored password is never sent back, so read hasPassword instead."
          },
          "hasPassword": {
            "type": "boolean",
            "description": "Whether a Government Gateway password is stored for these credentials."
          }
        }
      },
      "Pay_GovernmentGatewaySettingsDto": {
        "type": "object",
        "required": [
          "hmrcSubmissionMethod"
        ],
        "properties": {
          "credentials": {
            "$ref": "#/components/schemas/Pay_GovernmentGatewayCretentialsDto",
            "nullable": true,
            "description": "Organisation credentials. Present when hmrcSubmissionMethod is Direct."
          },
          "hmrcSubmissionMethod": {
            "type": "string",
            "enum": [
              "Agent",
              "Direct"
            ],
            "description": "Whether RTI submissions are signed with the organisation's own credentials (Direct) or with agentCredentials (Agent).",
            "example": "Direct"
          },
          "agentCredentials": {
            "$ref": "#/components/schemas/Pay_AgentGovernmentGatewayCretentialsDto",
            "nullable": true,
            "description": "Agent credentials. Present when hmrcSubmissionMethod is Agent."
          }
        }
      },
      "Pay_GrossToNetDto": {
        "type": "object",
        "required": [
          "taxCode"
        ],
        "properties": {
          "taxCode": {
            "type": "string",
            "description": "Tax code for the calculation",
            "example": "1257L"
          },
          "gross": {
            "type": "number",
            "format": "decimal",
            "description": "Gross amount to calculate from"
          },
          "grossForEmployeeNi": {
            "type": "number",
            "format": "decimal",
            "nullable": true,
            "description": "Gross to use for the employee National Insurance calculation, when it differs from gross",
            "example": 2500
          },
          "grossForEmployerNi": {
            "type": "number",
            "format": "decimal",
            "nullable": true,
            "description": "Gross to use for the employer National Insurance calculation, when it differs from gross",
            "example": 2500
          },
          "studentLoanPlan": {
            "type": "string",
            "enum": [
              "Plan1",
              "Plan2",
              "Plan4",
              "Plan5"
            ],
            "description": "Student loan plan type"
          },
          "postGradLoanPlan": {
            "type": "boolean",
            "description": "Indicates if the employee has a postgraduate loan plan"
          },
          "calculationName": {
            "type": "string",
            "description": "Name of the calculation formula to use"
          },
          "grossToDate": {
            "type": "number",
            "format": "decimal",
            "description": "Gross amount to date"
          },
          "period": {
            "type": "integer",
            "format": "int32",
            "description": "Period for the calculation"
          },
          "payFrequency": {
            "type": "string",
            "enum": [
              "Annual",
              "Monthly",
              "FourWeekly",
              "Fortnightly",
              "Weekly",
              "Daily",
              "Quarterly",
              "BiAnnually"
            ],
            "description": "Unit of the period"
          },
          "week1Month1": {
            "type": "boolean",
            "description": "Indicates if the calculation is for Week 1/Month 1"
          },
          "niCategory": {
            "type": "string",
            "description": "National Insurance category",
            "example": "A"
          },
          "taxToDate": {
            "type": "number",
            "format": "decimal",
            "description": "Tax amount to date",
            "example": 1000
          },
          "netDeductions": {
            "type": "number",
            "format": "decimal",
            "description": "Deductions taken from net pay, after tax and National Insurance",
            "example": 50
          }
        }
      },
      "Pay_HmrcRtiFpsDto": {
        "type": "object",
        "required": [
          "hmrcFpsReportStatus"
        ],
        "properties": {
          "submissionBody": {
            "type": "string",
            "nullable": true,
            "description": "The XML of the FPS submission serialized to a string"
          },
          "submissionResponse": {
            "type": "string",
            "nullable": true,
            "description": "The XML of the FPS submission response serialized to a string"
          },
          "errors": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "nullable": true,
            "description": "The errors that occurred during the FPS HMRC submission",
            "example": [
              "Error 1",
              "Error 2"
            ]
          },
          "correlationId": {
            "type": "string",
            "nullable": true,
            "description": "The correlation id of the FPS HMRC submission",
            "example": "1234567890"
          },
          "hmrcFpsSubmissionId": {
            "type": "string",
            "nullable": true,
            "description": "The id of the FPS HMRC submission",
            "example": "1234567890"
          },
          "hmrcFpsSubmissionDate": {
            "type": "string",
            "nullable": true,
            "description": "The date and time the FPS HMRC submission was sent",
            "example": "2025-01-01T00:00:00Z"
          },
          "hmrcFpsReportStatus": {
            "type": "string",
            "enum": [
              "NotSent",
              "Sending",
              "Sent",
              "Failed",
              "GeneratingPreview",
              "PreviewReady"
            ],
            "description": "The status of the FPS HMRC submission",
            "example": "Sent"
          },
          "previewDownloadUrl": {
            "type": "string",
            "nullable": true,
            "description": "A link that downloads the preview XML, valid for 15 minutes"
          },
          "submissionDownloadUrl": {
            "type": "string",
            "nullable": true,
            "description": "A link that downloads the submitted FPS XML, valid for 15 minutes"
          }
        }
      },
      "Pay_HmrcSettingsDto": {
        "type": "object",
        "required": [
          "organisationId",
          "createdDate",
          "createdBy",
          "updatedBy",
          "updatedDate",
          "taxReferenceNumbers",
          "governmentGatewaySettings",
          "isCisContractor",
          "hasSmallEmployerRelief"
        ],
        "properties": {
          "organisationId": {
            "type": "string",
            "description": "The organisation these HMRC settings belong to.",
            "example": "org_123"
          },
          "createdDate": {
            "type": "string",
            "description": "When the HMRC settings were first saved, in UTC.",
            "example": "2025-01-01T00:00:00Z"
          },
          "createdBy": {
            "type": "string",
            "description": "The user who first saved the HMRC settings.",
            "example": "user_123"
          },
          "updatedBy": {
            "type": "string",
            "description": "The user who last saved the HMRC settings.",
            "example": "user_456"
          },
          "updatedDate": {
            "type": "string",
            "description": "When the HMRC settings were last saved, in UTC.",
            "example": "2025-01-02T00:00:00Z"
          },
          "taxReferenceNumbers": {
            "$ref": "#/components/schemas/Pay_TaxReferenceNumbersDto",
            "description": "The employer's HMRC tax references."
          },
          "governmentGatewaySettings": {
            "$ref": "#/components/schemas/Pay_GovernmentGatewaySettingsDto",
            "description": "How the organisation submits RTI returns to HMRC and the Government Gateway credentials it uses."
          },
          "isCisContractor": {
            "type": "boolean",
            "description": "Whether the organisation is a CIS(Construction Industry Scheme) contractor",
            "example": false
          },
          "employmentAllowanceSettings": {
            "$ref": "#/components/schemas/Pay_EmploymentAllowanceSettingsDto",
            "nullable": true,
            "description": "The Employment Allowance claim settings, used when building the EPS; null when never set."
          },
          "apprenticeshipLevySettings": {
            "$ref": "#/components/schemas/Pay_ApprenticeshipLevySettingsDto",
            "nullable": true,
            "description": "The Apprenticeship Levy settings; null when never set."
          },
          "bankAccount": {
            "$ref": "#/components/schemas/Pay_OrganisationBankAccountDto",
            "nullable": true,
            "description": "The organisation's bank account for repayments from HMRC; null when never set."
          },
          "hasSmallEmployerRelief": {
            "type": "boolean",
            "description": "Whether the organisation has a small employer relief",
            "example": false
          },
          "payeLiabilitySettings": {
            "$ref": "#/components/schemas/Pay_PayeLiabilitySettingsDto",
            "nullable": true,
            "description": "How often the organisation pays its PAYE liability to HMRC; null when never set."
          }
        }
      },
      "Pay_LiabilityBreakdownDto": {
        "type": "object",
        "description": "Breakdown of all liability components",
        "required": [
          "total",
          "apprenticeshipLevy",
          "tax",
          "studentLoan",
          "postgraduateLoan",
          "employeeNi",
          "employerNi",
          "class1ANi"
        ],
        "properties": {
          "total": {
            "type": "number",
            "format": "decimal",
            "description": "Total liability amount before credits",
            "example": 2500
          },
          "apprenticeshipLevy": {
            "type": "number",
            "format": "decimal",
            "description": "Apprenticeship levy amount for the period",
            "example": 100
          },
          "tax": {
            "type": "number",
            "format": "decimal",
            "description": "Tax amount for the period",
            "example": 1200
          },
          "studentLoan": {
            "type": "number",
            "format": "decimal",
            "description": "Student loan repayment amount for the period",
            "example": 150
          },
          "postgraduateLoan": {
            "type": "number",
            "format": "decimal",
            "description": "Postgraduate loan repayment amount for the period",
            "example": 50
          },
          "employeeNi": {
            "type": "number",
            "format": "decimal",
            "description": "Employee National Insurance contribution for the period",
            "example": 400
          },
          "employerNi": {
            "type": "number",
            "format": "decimal",
            "description": "Employer National Insurance contribution for the period",
            "example": 500
          },
          "class1ANi": {
            "type": "number",
            "format": "decimal",
            "description": "Class 1A National Insurance contribution for the period",
            "example": 50
          }
        }
      },
      "Pay_LineItemMetadataDto": {
        "type": "object",
        "description": "DTO for line item metadata stored with payroll line items",
        "properties": {
          "courtOrders": {
            "$ref": "#/components/schemas/Pay_CourtOrderMetadataSectionDto",
            "nullable": true,
            "description": "Court order metadata for this line item"
          },
          "recurringLineItem": {
            "$ref": "#/components/schemas/Pay_RecurringLineItemMetadataSectionDto",
            "nullable": true,
            "description": "The recurring line item this line was generated from, if any."
          },
          "pensions": {
            "$ref": "#/components/schemas/Pay_PensionMetadataSectionDto",
            "nullable": true,
            "description": "Pension metadata carried on deterministic pension contribution lines (internal_pension_contrib_* / internal_pension_topup_*) added by the platform under line-item contributions."
          }
        },
        "example": {
          "courtOrders": {
            "protectedEarningsAmount": 100,
            "shortfallCarryForward": 0,
            "rateType": "StandardTable",
            "adminFeeApplied": true,
            "tableType": "A",
            "remittanceReference": "REF123",
            "remittanceDeadline": "5 days",
            "jurisdiction": "ENGLAND",
            "aeoCategory": "Priority"
          }
        }
      },
      "Pay_MessageWithTokenResponse": {
        "type": "object",
        "required": [
          "text",
          "token"
        ],
        "properties": {
          "text": {
            "type": "string",
            "description": "The message in English, ready to show to a user."
          },
          "token": {
            "type": "string",
            "description": "A stable snake_case key for the message, so a client can show its own wording or a translation instead of text."
          },
          "tokenArguments": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Pay_ValidationIssueArgument"
            },
            "nullable": true,
            "description": "Values to fill into the client's own wording for token, such as the request id; absent when the message has none."
          }
        }
      },
      "Pay_MonthlyBalancesDto": {
        "allOf": [
          {
            "$ref": "#/components/schemas/Pay_UpdatableYearToDateBalancesDto"
          },
          {
            "type": "object",
            "required": [
              "taxMonth",
              "taxYear",
              "employmentAllowance",
              "apprenticeshipLevyAllowance",
              "apprenticeshipLevy",
              "createdDate",
              "createdBy",
              "updatedDate",
              "updatedBy"
            ],
            "properties": {
              "taxMonth": {
                "type": "integer",
                "format": "int32",
                "description": "The tax month (1-12)",
                "example": 6
              },
              "taxYear": {
                "type": "integer",
                "format": "int32",
                "description": "The tax year",
                "example": 2024
              },
              "employmentAllowance": {
                "allOf": [
                  {
                    "$ref": "#/components/schemas/Pay_AmountUsageDto"
                  }
                ],
                "description": "Employment Allowance claimed in the month and the running total"
              },
              "apprenticeshipLevyAllowance": {
                "allOf": [
                  {
                    "$ref": "#/components/schemas/Pay_AmountUsageDto"
                  }
                ],
                "description": "Apprenticeship Levy allowance used in the month and the running total"
              },
              "apprenticeshipLevy": {
                "type": "number",
                "format": "decimal",
                "description": "Apprenticeship Levy charged for the month",
                "example": 125.5
              },
              "createdDate": {
                "type": "string",
                "format": "date-time",
                "description": "Creation date",
                "example": "2024-01-01T00:00:00Z"
              },
              "createdBy": {
                "type": "string",
                "description": "User who created the record",
                "example": "user_123"
              },
              "updatedDate": {
                "type": "string",
                "format": "date-time",
                "description": "Last update date",
                "example": "2024-01-02T00:00:00Z"
              },
              "updatedBy": {
                "type": "string",
                "description": "User who last updated the record",
                "example": "user_456"
              }
            }
          }
        ]
      },
      "Pay_MultiStatusDataResponse": {
        "type": "object",
        "required": [
          "totalItems",
          "totalFailed",
          "failedItems"
        ],
        "properties": {
          "totalItems": {
            "type": "integer",
            "format": "int32",
            "description": "Total number of items attempted to process"
          },
          "totalFailed": {
            "type": "integer",
            "format": "int32",
            "description": "Number of items that failed to process"
          },
          "failedItems": {
            "type": "array",
            "items": {},
            "description": "List of items that failed to process"
          },
          "successfulItems": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Pay_PayrollLineOutputDto"
            },
            "nullable": true,
            "description": "List of items that were successfully processed"
          }
        }
      },
      "Pay_NiBandResultDto": {
        "type": "object",
        "properties": {
          "grossInBand": {
            "type": "number",
            "format": "decimal",
            "description": "Gross pay in this NI band",
            "example": 12570
          },
          "employeeNiForBand": {
            "type": "number",
            "format": "decimal",
            "description": "Employee NI contribution for this band",
            "example": 0
          },
          "employerNiForBand": {
            "type": "number",
            "format": "decimal",
            "description": "Employer NI contribution for this band",
            "example": 0
          }
        }
      },
      "Pay_NiCalculationResultDto": {
        "type": "object",
        "properties": {
          "employeeNi": {
            "type": "number",
            "format": "decimal",
            "description": "Employee National Insurance under this NI category letter."
          },
          "employerNi": {
            "type": "number",
            "format": "decimal",
            "description": "Employer National Insurance under this NI category letter."
          },
          "totalNi": {
            "type": "number",
            "format": "decimal",
            "description": "Employee and employer National Insurance added together."
          },
          "grossForEmployeeNi": {
            "type": "number",
            "format": "decimal",
            "description": "Earnings that employee National Insurance was worked out on under this letter."
          },
          "grossForEmployerNi": {
            "type": "number",
            "format": "decimal",
            "description": "Earnings that employer National Insurance was worked out on under this letter."
          },
          "bandResults": {
            "type": "object",
            "additionalProperties": {
              "$ref": "#/components/schemas/Pay_NiBandResultDto"
            },
            "description": "The same figures split by National Insurance band, keyed by band name."
          }
        },
        "example": {
          "employeeNi": 290.1,
          "employerNi": 310.25,
          "totalNi": 600.35,
          "grossForEmployeeNi": 3500,
          "grossForEmployerNi": 3500,
          "bandResults": {
            "PT-UEL": {
              "grossInBand": 2000,
              "employeeNiForBand": 180,
              "employerNiForBand": 220
            },
            "UEL+": {
              "grossInBand": 500,
              "employeeNiForBand": 110.1,
              "employerNiForBand": 90.25
            }
          }
        }
      },
      "Pay_NoPaymentForPeriodDto": {
        "type": "object",
        "required": [
          "fromDate",
          "toDate"
        ],
        "properties": {
          "fromDate": {
            "type": "string",
            "format": "date",
            "description": "From date",
            "example": "2025-01-01"
          },
          "toDate": {
            "type": "string",
            "format": "date",
            "description": "To date",
            "example": "2025-01-31"
          }
        }
      },
      "Pay_OrganisationBankAccountDto": {
        "type": "object",
        "properties": {
          "accountNumber": {
            "type": "string",
            "description": "Account number",
            "example": "12345678"
          },
          "sortCode": {
            "type": "string",
            "description": "Sort code",
            "example": "12-34-56"
          },
          "accountHolderName": {
            "type": "string",
            "description": "Account holder name",
            "example": "Acme Corporation Limited"
          },
          "buildingSocietyReference": {
            "type": "string",
            "nullable": true,
            "description": "Building society reference",
            "example": "BS123456"
          }
        }
      },
      "Pay_OrganisationInformationDto": {
        "allOf": [
          {
            "$ref": "#/components/schemas/Pay_UpdatableOrganisationInformationDto"
          },
          {
            "type": "object",
            "required": [
              "organisationId",
              "createdBy",
              "createdDate",
              "updatedBy",
              "updatedDate"
            ],
            "properties": {
              "organisationId": {
                "type": "string",
                "description": "Organisation id of the organisation",
                "example": "org_123"
              },
              "createdBy": {
                "type": "string",
                "description": "Created by of the organisation information. This is the user who created the organisation information",
                "example": "user_123"
              },
              "createdDate": {
                "type": "string",
                "format": "date-time",
                "description": "Created date of the organisation information. This is the date and time when the organisation information was created",
                "example": "2025-01-01T00:00:00Z"
              },
              "updatedBy": {
                "type": "string",
                "description": "Updated by of the organisation information. This is the user who updated the organisation information",
                "example": "user_456"
              },
              "updatedDate": {
                "type": "string",
                "format": "date-time",
                "description": "Updated date of the organisation information. This is the date and time when the organisation information was updated",
                "example": "2025-01-02T00:00:00Z"
              }
            }
          }
        ]
      },
      "Pay_OrganisationNameDto": {
        "type": "object",
        "properties": {
          "legalName": {
            "type": "string",
            "description": "Legal name of the organisation",
            "example": "Acme Corporation Ltd"
          },
          "tradingName": {
            "type": "string",
            "nullable": true,
            "description": "Trading name of the organisation",
            "example": "Acme Corp"
          }
        }
      },
      "Pay_PatchEmployeeDto": {
        "type": "object",
        "properties": {
          "name": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Pay_EmployeeNameDtoMergePatch"
              }
            ],
            "description": "The employee's name as reported to HMRC; the first and last names are required, each 1 to 35 characters starting with a letter."
          },
          "email": {
            "type": "string",
            "format": "email",
            "description": "The employee's primary email address; required, it must be a valid email address and is the address payslip emails are sent to.",
            "example": "john.smith@company.com"
          },
          "taxCodesPerYear": {
            "type": "object",
            "additionalProperties": {
              "type": "array",
              "items": {
                "$ref": "#/components/schemas/Pay_EmployeeTaxCodeDto"
              }
            },
            "description": "Tax codes for the employee per tax year",
            "example": {
              "2025": [
                {
                  "code": "1257L",
                  "effectiveDate": "2025-04-06",
                  "reason": "HMRC Update",
                  "issuedBy": "HMRC",
                  "week1Month1": false
                }
              ]
            }
          },
          "niDetails": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Pay_EmployeeNiDtoMergePatch"
              }
            ],
            "nullable": true,
            "description": "National Insurance details for the employee"
          },
          "birthGender": {
            "type": "string",
            "enum": [
              "Male",
              "Female"
            ],
            "description": "The gender reported to HMRC for the employee on the FPS; required.",
            "example": "Male"
          },
          "phone": {
            "type": "string",
            "nullable": true,
            "description": "The employee's primary phone number, stored as sent and carried on the payslip's recipient details."
          },
          "birthDate": {
            "type": "string",
            "format": "date",
            "description": "The employee's date of birth (YYYY-MM-DD); required, and the employee must be between 12 and 120 years old.",
            "example": "1985-07-23"
          },
          "maritalStatus": {
            "type": "string",
            "enum": [
              "Single",
              "Married",
              "Divorced",
              "Widowed",
              "CivilPartnership",
              "FormerCivilPartnership",
              "SurvivorCivilPartnership"
            ],
            "description": "The employee's marital status; optional, and refused when it is not one of the listed values.",
            "example": "Married"
          },
          "hoursWorkedCategory": {
            "type": "string",
            "enum": [
              "UpTo16Hours",
              "From16To24Hours",
              "From24To30Hours",
              "Above30Hours",
              "Other"
            ],
            "description": "The band of normal weekly hours the employee works, reported to HMRC on the FPS; required.",
            "example": "Above30Hours"
          },
          "salary": {
            "type": "number",
            "format": "decimal",
            "nullable": true,
            "description": "Deprecated as input on PUT and PATCH: record salary changes with PUT /employees/{employeeId}/salary instead, which keeps an effective-dated history the pay run pro-rates from. While still accepted, a value that differs from the salary in force today updates the most recent salary version in place; null or absent leaves the history untouched. Accepted unchanged on POST /employees, where it becomes the first salary version effective from the start date. Always populated on responses as the annual salary in force today (or the earliest version when every version is still in the future). Will be removed from input in a future version.\n",
            "example": 35000,
            "deprecated": true
          },
          "employeeCode": {
            "type": "string",
            "nullable": true,
            "description": "Employee code. An optional identifier for the employee.",
            "example": "EMP001"
          },
          "secondaryEmail": {
            "type": "string",
            "nullable": true,
            "format": "email",
            "description": "An optional second email address for the employee, checked as an email address when sent.",
            "example": "john.secondary@company.com"
          },
          "address": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Pay_AddressDtoMergePatch"
              }
            ],
            "nullable": true,
            "description": "The employee's home address, reported to HMRC on the FPS; line1, line2, county and city are its address lines."
          },
          "bankAccounts": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Pay_BankAccountDto"
            },
            "nullable": true,
            "description": "The employee's bank accounts; exactly one must be the primary payroll account, and with more than one their allocation percentages must add up to 100."
          },
          "studentDetails": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Pay_EmployeeStudentDetailsDtoMergePatch"
              }
            ],
            "nullable": true,
            "description": "The employee's student loan and postgraduate loan plans, with the dates each starts and ends."
          },
          "tags": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Pay_TagDto"
            },
            "nullable": true,
            "description": "Tags on the employee, copied onto the employee details of each payslip."
          },
          "previousEmployment": {
            "type": "object",
            "additionalProperties": {
              "$ref": "#/components/schemas/Pay_PreviousEmploymentEarningsDto"
            },
            "description": "Earnings from a previous employer in the same tax year. Used for cumulative tax calculations only. Does not affect FPS reporting.",
            "example": {
              "2026": {
                "grossTaxable": 15000,
                "tax": 3000
              }
            }
          },
          "gender": {
            "type": "string",
            "nullable": true,
            "description": "The employee's gender as free text, stored and returned as sent; birthGender is the value reported to HMRC.",
            "example": "Male"
          },
          "secondaryPhone": {
            "type": "string",
            "nullable": true,
            "description": "An optional second phone number for the employee, stored and returned as sent."
          },
          "passportNumber": {
            "type": "string",
            "nullable": true,
            "description": "The employee's passport number, reported to HMRC on the FPS; 1 to 35 letters, numbers, spaces and standard punctuation.",
            "example": "123456789"
          },
          "previousNames": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "nullable": true,
            "description": "Names the employee was previously known by; each must meet the same rules as a name and none may repeat.",
            "example": [
              "John Doe"
            ]
          },
          "directorDetails": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Pay_EmployeeDirectorDetailsDtoMergePatch"
              }
            ],
            "nullable": true,
            "description": "Set when the employee is a director: the director's NI calculation method, appointment date and, once it ends, the end date."
          },
          "isIrregularEmployment": {
            "type": "boolean",
            "nullable": true,
            "description": "Whether the employee is paid on an irregular pattern, reported to HMRC on the FPS; treated as false when absent.",
            "example": false
          },
          "isOffPayrollWorker": {
            "type": "boolean",
            "nullable": true,
            "description": "Whether the worker is engaged under the off-payroll working rules (IR35), reported to HMRC on the FPS; treated as false when absent.",
            "example": false
          },
          "workplaceDetails": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Pay_EmployeeWorkplaceDetailsDtoMergePatch"
              }
            ],
            "nullable": true,
            "description": "Where the employee works; its workplace postcode is reported to HMRC on the FPS."
          },
          "workingDays": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Pay_WorkingDaysConfigurationDtoMergePatch"
              }
            ],
            "nullable": true,
            "description": "The employee's working pattern in force today; its dated history is kept by the employee working pattern endpoints."
          },
          "partnerDetails": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Pay_EmployeePartnerDetailsDtoMergePatch"
              }
            ],
            "nullable": true,
            "description": "The employee's partner, reported to HMRC on the FPS with the first payment of Shared Parental Pay."
          },
          "department": {
            "type": "string",
            "nullable": true,
            "description": "The employee's department as free text, copied onto the employee details of each payslip.",
            "example": "Engineering"
          },
          "jobTitle": {
            "type": "string",
            "nullable": true,
            "description": "The employee's job title as free text, copied onto the employee details of each payslip.",
            "example": "Software Engineer"
          }
        }
      },
      "Pay_PayElementDto": {
        "type": "object",
        "description": "Pay element details",
        "required": [
          "id",
          "description",
          "taxType",
          "niType",
          "payType",
          "isPensionable",
          "accrueHoliday",
          "subjectToNmwCheck",
          "isSystemCode",
          "organisationId",
          "createdBy",
          "createdDate",
          "updatedBy",
          "updatedDate",
          "isClass1ANiable"
        ],
        "properties": {
          "id": {
            "type": "string",
            "description": "The unique identifier for the pay element",
            "example": "PE001"
          },
          "description": {
            "type": "string",
            "description": "The description of the pay element",
            "example": "Basic Salary"
          },
          "taxType": {
            "type": "string",
            "enum": [
              "Taxable",
              "NonTaxable"
            ],
            "description": "The tax type for the pay element",
            "example": "Taxable"
          },
          "niType": {
            "type": "string",
            "enum": [
              "Niable",
              "NonNiable",
              "EmployerOnly"
            ],
            "description": "The National Insurance type for the pay element",
            "example": "Niable"
          },
          "payType": {
            "type": "string",
            "enum": [
              "Payable",
              "Deductible",
              "Informational"
            ],
            "description": "The pay type for the pay element",
            "example": "Payable"
          },
          "isPensionable": {
            "type": "boolean",
            "description": "Whether the pay element is pensionable",
            "example": true
          },
          "accrueHoliday": {
            "type": "boolean",
            "description": "Whether the pay element accrues holiday",
            "example": true
          },
          "subjectToNmwCheck": {
            "type": "boolean",
            "description": "Whether the pay element is subject to National Minimum Wage checks",
            "example": true
          },
          "defaultUnitName": {
            "type": "string",
            "enum": [
              "Hour",
              "Day",
              "Week",
              "Month",
              "Year",
              "Fixed",
              "Informational",
              "Percentage"
            ],
            "description": "The default unit name for the pay element",
            "example": "Hour"
          },
          "defaultPayRate": {
            "type": "number",
            "format": "decimal",
            "nullable": true,
            "description": "The default pay rate for the pay element",
            "example": 15.5
          },
          "defaultUnitValue": {
            "type": "number",
            "format": "decimal",
            "nullable": true,
            "description": "The default unit value for the pay element",
            "example": 1
          },
          "defaultChargeRate": {
            "type": "number",
            "format": "decimal",
            "nullable": true,
            "description": "The default charge rate for the pay element",
            "example": 20
          },
          "isSystemCode": {
            "type": "boolean",
            "description": "Indicates if the pay element is a system code",
            "example": false
          },
          "organisationId": {
            "type": "string",
            "description": "The organisation ID to which the pay element belongs",
            "example": "org_123"
          },
          "createdBy": {
            "type": "string",
            "description": "The user who created the pay element",
            "example": "user_123"
          },
          "createdDate": {
            "type": "string",
            "description": "The date and time when the pay element was created",
            "example": "2024-01-01T00:00:00Z"
          },
          "updatedBy": {
            "type": "string",
            "description": "The user who last updated the pay element",
            "example": "user_456"
          },
          "updatedDate": {
            "type": "string",
            "description": "The date and time when the pay element was last updated",
            "example": "2024-01-02T00:00:00Z"
          },
          "eligibility": {
            "$ref": "#/components/schemas/Pay_EligibilityDto",
            "nullable": true,
            "description": "Which court order types may take money from this pay. Read-only: set from payType, taxType and isClass1ANiable."
          },
          "isClass1ANiable": {
            "type": "boolean",
            "description": "Whether the pay element is Class 1A National Insurance liable",
            "example": false
          }
        }
      },
      "Pay_PayeLiabilitySettingsDto": {
        "type": "object",
        "required": [
          "payFrequency"
        ],
        "properties": {
          "payFrequency": {
            "type": "string",
            "enum": [
              "Monthly",
              "Quarterly"
            ],
            "description": "The frequency of PAYE payments",
            "example": "Monthly"
          }
        }
      },
      "Pay_PayeLiabilitySummaryDto": {
        "type": "object",
        "description": "Simplified PAYE liability summary for a given period (month or quarter)",
        "required": [
          "taxYear",
          "period",
          "dueDate",
          "payFrequency",
          "liability",
          "credits",
          "due",
          "paid",
          "remaining",
          "payments"
        ],
        "properties": {
          "taxYear": {
            "type": "integer",
            "format": "int32",
            "description": "The tax year",
            "example": 2024
          },
          "period": {
            "type": "integer",
            "format": "int32",
            "description": "The period number (1-12 for monthly, 1-4 for quarterly)",
            "example": 5
          },
          "dueDate": {
            "type": "string",
            "format": "date",
            "description": "The due date for the period (22nd of next tax month or quarter)",
            "example": "2024-06-22"
          },
          "payFrequency": {
            "type": "string",
            "enum": [
              "Monthly",
              "Quarterly"
            ],
            "description": "The frequency of PAYE payments for this period",
            "example": "Monthly"
          },
          "liability": {
            "$ref": "#/components/schemas/Pay_LiabilityBreakdownDto",
            "description": "Breakdown of all liability components"
          },
          "credits": {
            "$ref": "#/components/schemas/Pay_CreditsBreakdownDto",
            "description": "Breakdown of all credits that reduce the liability"
          },
          "due": {
            "type": "number",
            "format": "decimal",
            "description": "Total amount due (Liability - Credits)",
            "example": 2300
          },
          "paid": {
            "type": "number",
            "format": "decimal",
            "description": "Total amount paid for this period",
            "example": 1500
          },
          "remaining": {
            "type": "number",
            "format": "decimal",
            "description": "Remaining amount to be paid (Due - Paid)",
            "example": 800
          },
          "payments": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Pay_PayePaymentDto"
            },
            "description": "List of payments made for this period"
          }
        }
      },
      "Pay_PayePaymentDto": {
        "description": "Response containing the recorded PAYE payment details",
        "allOf": [
          {
            "$ref": "#/components/schemas/Pay_UpdatablePayePaymentDto"
          },
          {
            "type": "object",
            "required": [
              "paymentId",
              "organisationId",
              "dueDate",
              "isOnTime",
              "period",
              "taxYear",
              "createdDate",
              "createdBy",
              "updatedDate",
              "updatedBy"
            ],
            "properties": {
              "paymentId": {
                "type": "string",
                "description": "The unique identifier for the payment",
                "example": "PAY_2024_001"
              },
              "organisationId": {
                "type": "string",
                "description": "The organisation ID",
                "example": "org_123"
              },
              "dueDate": {
                "type": "string",
                "format": "date",
                "description": "The due date for this payment (22nd of next tax month)",
                "example": "2024-05-22"
              },
              "isOnTime": {
                "type": "boolean",
                "description": "Whether the payment was made on time",
                "example": true
              },
              "period": {
                "type": "integer",
                "format": "int32",
                "description": "The period of the payment (1-12 for monthly, 1-4 for quarterly)",
                "example": 5
              },
              "taxYear": {
                "type": "integer",
                "format": "int32",
                "description": "The tax year this payment relates to",
                "example": 2024
              },
              "createdDate": {
                "type": "string",
                "format": "date-time",
                "description": "The created date",
                "example": "2024-05-22T10:00:00Z"
              },
              "createdBy": {
                "type": "string",
                "description": "The created by",
                "example": "user_123"
              },
              "updatedDate": {
                "type": "string",
                "format": "date-time",
                "description": "The updated date",
                "example": "2024-05-22T10:00:00Z"
              },
              "updatedBy": {
                "type": "string",
                "description": "The updated by",
                "example": "user_123"
              }
            }
          }
        ]
      },
      "Pay_PayeReferenceNumberDto": {
        "type": "object",
        "required": [
          "officeNumber",
          "referenceNumber"
        ],
        "properties": {
          "officeNumber": {
            "type": "string",
            "description": "HMRC Office number.",
            "example": "123"
          },
          "referenceNumber": {
            "type": "string",
            "description": "Company's unique reference number.",
            "example": "AB12345"
          }
        }
      },
      "Pay_PaymentDateConfigDto": {
        "type": "object",
        "required": [
          "payDayType"
        ],
        "properties": {
          "payDayType": {
            "type": "string",
            "enum": [
              "SameDateEachPeriod",
              "LastDayOfPeriod",
              "SpecificDayOfWeek",
              "SpecificDayOfWeekNearestToDate",
              "FirstWorkingDayAfterDate",
              "Custom"
            ],
            "description": "The rule that decides each pay run's payment date."
          },
          "dayOfMonth": {
            "type": "integer",
            "format": "int32",
            "nullable": true,
            "description": "The day of the month the rule works from: the pay day for SameDateEachPeriod, the date to pay nearest to for SpecificDayOfWeekNearestToDate, and the date to pay after for FirstWorkingDayAfterDate."
          },
          "dayOfWeek": {
            "type": "string",
            "enum": [
              "Sunday",
              "Monday",
              "Tuesday",
              "Wednesday",
              "Thursday",
              "Friday",
              "Saturday"
            ],
            "description": "The day of the week to pay on for SpecificDayOfWeek and SpecificDayOfWeekNearestToDate, as a day name or its number."
          },
          "weekOfMonth": {
            "type": "integer",
            "format": "int32",
            "nullable": true,
            "description": "1=first, 2=second, -1=last, etc."
          },
          "month": {
            "type": "integer",
            "format": "int32",
            "nullable": true,
            "description": "For annual/quarterly configs."
          },
          "isWorkingDay": {
            "type": "boolean",
            "description": "For SameDateEachPeriod, whether a pay day falling on a weekend or UK bank holiday moves to the next working day."
          },
          "customRuleParams": {
            "type": "string",
            "nullable": true,
            "description": "Parameters of a Custom pay day rule, required when payDayType is Custom."
          },
          "whichWeekInPeriod": {
            "type": "integer",
            "format": "int32",
            "nullable": true,
            "description": "1=first, 2=second, -1=last, etc."
          }
        }
      },
      "Pay_PaymentDetailsDto": {
        "type": "object",
        "description": "Payment details (BACS information) that can override default employee bank account",
        "properties": {
          "accountName": {
            "type": "string",
            "nullable": true,
            "description": "Account name",
            "example": "CMS Central Account"
          },
          "accountNumber": {
            "type": "string",
            "nullable": true,
            "description": "Account number",
            "example": "12345678"
          },
          "sortCode": {
            "type": "string",
            "nullable": true,
            "description": "Sort code",
            "example": "12-34-56"
          },
          "paymentReference": {
            "type": "string",
            "nullable": true,
            "description": "Payment reference to include with BACS payment (e.g., court order remittance reference)",
            "example": "CMS-2025-UK01"
          },
          "paymentCategory": {
            "type": "string",
            "enum": [
              "CourtOrders"
            ],
            "description": "Payment category for categorizing payment details",
            "example": "CourtOrders"
          }
        }
      },
      "Pay_PaymentPeriodConfigDto": {
        "type": "object",
        "properties": {
          "startingDayOfMonth": {
            "type": "integer",
            "format": "int32",
            "nullable": true,
            "description": "The starting day of the month for monthly based pay frequencies (eg. Monthly, Quarterly, Bi-Annually, Annual). It is mandatory for these pay frequencies.",
            "example": 1
          },
          "startingDayOfWeek": {
            "type": "string",
            "enum": [
              "Sunday",
              "Monday",
              "Tuesday",
              "Wednesday",
              "Thursday",
              "Friday",
              "Saturday"
            ],
            "description": "The starting day of the week for weekly based pay frequencies (eg. Weekly, Fortnightly, Four Weekly). It is mandatory for these pay frequencies.",
            "example": "Monday"
          },
          "startingDayOfWeekOffSet": {
            "type": "integer",
            "format": "int32",
            "nullable": true,
            "description": "The offset, in weeks, for the starting week. For example, if its value is -2, and the startingDayOfWeek is Monday, then it will refer back two Mondays. Allowed values are -4 to 4; defaults to 0 (current week).",
            "example": 0
          },
          "startingDayOfMonthOffSet": {
            "type": "integer",
            "format": "int32",
            "nullable": true,
            "description": "The offset, in months, applied to the reference period for the Monthly pay frequency. For example, -1 shifts the reference period back one month (pay in arrears) and +1 shifts it forward (advance). Only used for the Monthly pay frequency. Allowed values are -4 to 4; defaults to 0 (current tax month).",
            "example": 0
          }
        }
      },
      "Pay_PayrollConfigDto": {
        "allOf": [
          {
            "$ref": "#/components/schemas/Pay_UpdateablePayrollConfigDto"
          },
          {
            "type": "object",
            "required": [
              "id"
            ],
            "properties": {
              "id": {
                "type": "string",
                "description": "The id of the payroll configuration."
              },
              "createdBy": {
                "type": "string",
                "nullable": true,
                "description": "The user who created the payroll configuration."
              },
              "createdDate": {
                "type": "string",
                "nullable": true,
                "format": "date-time",
                "description": "When the payroll configuration was created, in UTC."
              },
              "updatedBy": {
                "type": "string",
                "nullable": true,
                "description": "The user who last changed the payroll configuration."
              },
              "updatedDate": {
                "type": "string",
                "nullable": true,
                "format": "date-time",
                "description": "When the payroll configuration was last changed, in UTC."
              },
              "organisationId": {
                "type": "string",
                "nullable": true,
                "description": "The organisation the payroll configuration belongs to."
              },
              "hasPayRuns": {
                "type": "boolean",
                "nullable": true,
                "description": "True when the payroll configuration already has pay runs, of any status, in which case payFrequency and paymentPeriodConfig can no longer be changed. Read-only and ignored on write; returned by GET /payrollconfig/{payrollConfigId} and omitted elsewhere."
              }
            }
          }
        ]
      },
      "Pay_PayrollLineDto": {
        "type": "object",
        "required": [
          "payElementId",
          "date",
          "unitName"
        ],
        "properties": {
          "id": {
            "type": "string",
            "description": "Optional unique identifier for the payroll line"
          },
          "payElementId": {
            "type": "string",
            "description": "The ID of the pay element associated with this payroll line."
          },
          "date": {
            "type": "string",
            "nullable": true,
            "description": "The date the line applies to, in yyyy-MM-dd; required; a date on or before the end of the latest locked pay run's period is placed on the day after that period."
          },
          "description": {
            "type": "string",
            "description": "The text shown for the line on the payslip; required."
          },
          "unitName": {
            "type": "string",
            "enum": [
              "Hour",
              "Day",
              "Week",
              "Month",
              "Year",
              "Fixed",
              "Informational",
              "Percentage"
            ],
            "description": "What one unit of the line is, such as Hour, Day or Fixed; required."
          },
          "unitType": {
            "type": "string",
            "enum": [
              "Amount",
              "Percentage"
            ],
            "description": "The unit type for calculation. Amount uses payRate * units, Percentage uses payRate * (units / 100)"
          },
          "units": {
            "type": "number",
            "format": "decimal",
            "description": "How many units the line pays; multiplied by payRate to give the line's value, or by payRate divided by 100 when unitType is Percentage."
          },
          "payRate": {
            "type": "number",
            "format": "decimal",
            "description": "The rate per unit; multiplied by units to give the line's value, or by units divided by 100 when unitType is Percentage."
          },
          "clientId": {
            "type": "string",
            "nullable": true,
            "description": "The client this line is billed to, if any."
          },
          "chargeRate": {
            "type": "number",
            "format": "decimal",
            "nullable": true,
            "description": "The rate the client is charged per charge unit; ignored once the line has been invoiced."
          },
          "chargeUnits": {
            "type": "number",
            "format": "decimal",
            "nullable": true,
            "description": "How many units the client is charged for; multiplied by chargeRate to give the charge, and ignored once the line has been invoiced.",
            "example": 1
          },
          "chargeDescription": {
            "type": "string",
            "nullable": true,
            "description": "Charge description for billing; when not provided and clientId is set, defaults to the pay description."
          },
          "tags": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Pay_TagDto"
            },
            "nullable": true,
            "description": "Tags to attach to the line, carried onto its payslip item."
          },
          "originalValue": {
            "type": "number",
            "format": "decimal",
            "nullable": true,
            "description": "The pre-adjustment value of this line, for callers that reduce a line and want the original kept for reporting. Stored as supplied."
          },
          "canEdit": {
            "type": "boolean",
            "nullable": true,
            "description": "Whether the line can be edited in the product. Defaults to editable. Set it false for lines your own system owns, so nobody edits them in Flow Payroll and has the change overwritten by your next upload."
          },
          "lineItemMetadata": {
            "$ref": "#/components/schemas/Pay_LineItemMetadataDto",
            "nullable": true,
            "description": "Context for lines that come from a court order, a recurring line item or a pension; pension details are kept only on the pension lines the platform adds itself."
          },
          "paymentDetails": {
            "$ref": "#/components/schemas/Pay_PaymentDetailsDto",
            "nullable": true,
            "description": "Payment details (BACS information) that can override default employee bank account"
          },
          "poNumber": {
            "type": "string",
            "nullable": true,
            "description": "Purchase order number for billing purposes",
            "example": "PO-2025-001"
          },
          "attachments": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Pay_CreateAttachmentRequestDto"
            },
            "nullable": true,
            "description": "Attachment metadata to include when creating the payroll line item (optional, only used during batch upload)"
          },
          "paymentAfterLeavingPattern": {
            "type": "string",
            "enum": [
              "Irregular",
              "Regular"
            ],
            "description": "Which National Insurance earnings period this payment takes when it is made after the employment has ended. Only read on a payment after leaving, and ignored entirely for anyone who has not left. Irregular (accrued holiday, an unexpected bonus, arrears after a backdated pay award, a late commission or service charge) is charged on weekly thresholds; Regular (a payment they were expecting on their usual cycle, such as an expected bonus) keeps the employee's usual earnings period. Per CWG2 section 1.14 and NIM08400/NIM08410. Omitting it means Irregular, which is the safe default because the other direction understates NI. National Insurance is charged once per payslip, so a single Irregular payment puts the whole payslip on weekly thresholds.",
            "example": "Irregular"
          }
        }
      },
      "Pay_PayrollLineOutputDto": {
        "type": "object",
        "required": [
          "id",
          "employeeId",
          "description",
          "unitName",
          "units",
          "payRate",
          "taxType",
          "niType",
          "payType",
          "isPensionable",
          "statutoryType",
          "createdDate",
          "createdBy",
          "updatedDate",
          "updatedBy",
          "canEdit",
          "billingStatus"
        ],
        "properties": {
          "id": {
            "type": "string",
            "description": "The line's id: the one supplied when it was created, or one generated when none was.",
            "example": "PAYLINE-001"
          },
          "clientId": {
            "type": "string",
            "nullable": true,
            "description": "The client this line is billed to, if any.",
            "example": "CLIENT-001"
          },
          "employeeId": {
            "type": "string",
            "description": "The employee the line belongs to.",
            "example": "EMPLOYEE-001"
          },
          "date": {
            "type": "string",
            "nullable": true,
            "description": "The date the line applies to, as supplied (yyyy-MM-dd).",
            "example": "2024-05-20"
          },
          "payrollDate": {
            "type": "string",
            "nullable": true,
            "description": "The date that decides which pay run takes the line: its own date, or the day after the latest locked pay run's period when its date fell on or before that.",
            "example": "2024-07-06"
          },
          "description": {
            "type": "string",
            "description": "The text shown for the line on the payslip.",
            "example": "Morning shift"
          },
          "unitName": {
            "type": "string",
            "enum": [
              "Hour",
              "Day",
              "Week",
              "Month",
              "Year",
              "Fixed",
              "Informational",
              "Percentage"
            ],
            "description": "What one unit of the line is, such as Hour, Day or Fixed."
          },
          "units": {
            "type": "number",
            "format": "decimal",
            "description": "How many units the line pays.",
            "example": 8
          },
          "payRate": {
            "type": "number",
            "format": "decimal",
            "description": "The rate per unit; with units it gives the line's value.",
            "example": 10.5
          },
          "chargeRate": {
            "type": "number",
            "format": "decimal",
            "nullable": true,
            "description": "The rate the client is charged per charge unit.",
            "example": 15.5
          },
          "chargeUnits": {
            "type": "number",
            "format": "decimal",
            "nullable": true,
            "description": "How many units the client is charged for; multiplied by chargeRate and rounded to the penny to give the charge.",
            "example": 1
          },
          "chargeDescription": {
            "type": "string",
            "nullable": true,
            "description": "Charge description for billing; when not provided and clientId is set, defaults to the pay description."
          },
          "payElementId": {
            "type": "string",
            "nullable": true,
            "description": "The pay element the line is paid under.",
            "example": "PAYELEM-001"
          },
          "taxType": {
            "type": "string",
            "enum": [
              "Taxable",
              "NonTaxable"
            ],
            "description": "Whether the line is taxable, copied from its pay element when the line was saved."
          },
          "niType": {
            "type": "string",
            "enum": [
              "Niable",
              "NonNiable",
              "EmployerOnly"
            ],
            "description": "How the line is treated for National Insurance, copied from its pay element when the line was saved."
          },
          "payType": {
            "type": "string",
            "enum": [
              "Payable",
              "Deductible",
              "Informational"
            ],
            "description": "The kind of pay the line is, copied from its pay element when the line was saved."
          },
          "isPensionable": {
            "type": "boolean",
            "description": "Whether the payroll line is pensionable",
            "example": true
          },
          "tags": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Pay_TagDto"
            },
            "nullable": true,
            "description": "Tags attached to the line."
          },
          "statutoryType": {
            "type": "string",
            "enum": [
              "None",
              "StatutorySickPay",
              "StatutoryMaternityPay",
              "StatutoryPaternityPay",
              "StatutoryAdoptionPay",
              "SharedParentalPay",
              "StatutoryParentalBereavementPay",
              "StatutorySharedParentalPay",
              "StatutoryNeoNatalCarePay",
              "StatutoryParentalBereavementPayNorthernIreland"
            ],
            "description": "The statutory type for this payroll line"
          },
          "createdDate": {
            "type": "string",
            "description": "When the line item was created",
            "example": "2024-01-01T00:00:00Z"
          },
          "createdBy": {
            "type": "string",
            "description": "Who created the line item",
            "example": "user_123"
          },
          "updatedDate": {
            "type": "string",
            "description": "When the line item was last updated",
            "example": "2024-01-02T00:00:00Z"
          },
          "updatedBy": {
            "type": "string",
            "description": "Who last updated the line item",
            "example": "user_456"
          },
          "poNumber": {
            "type": "string",
            "nullable": true,
            "description": "The purchase order number supplied with the line, for billing.",
            "example": "PO-12345"
          },
          "originalValue": {
            "type": "number",
            "format": "decimal",
            "nullable": true,
            "description": "The original deduction amount before protected earnings adjustment"
          },
          "canEdit": {
            "type": "boolean",
            "description": "Indicates whether this line item can be edited. Court order line items are not editable, for example, because they are automatically generated.",
            "example": true
          },
          "unitType": {
            "type": "string",
            "enum": [
              "Amount",
              "Percentage"
            ],
            "description": "The unit type for calculation. Amount uses payRate * units, Percentage uses payRate * (units / 100)"
          },
          "lineItemMetadata": {
            "$ref": "#/components/schemas/Pay_LineItemMetadataDto",
            "nullable": true,
            "description": "Metadata for this line item"
          },
          "eligibility": {
            "$ref": "#/components/schemas/Pay_EligibilityDto",
            "nullable": true,
            "description": "Which court order types may take money from this line, copied from its pay element. Read-only."
          },
          "paymentDetails": {
            "$ref": "#/components/schemas/Pay_PaymentDetailsDto",
            "nullable": true,
            "description": "Payment details (BACS information) that can override default employee bank account"
          },
          "attachmentUploadUrls": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Pay_AttachmentUploadResponseDto"
            },
            "nullable": true,
            "description": "Where to upload each attachment (only present during batch upload when attachments metadata was provided)"
          },
          "attachments": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Pay_AttachmentResponseDto"
            },
            "nullable": true,
            "description": "List of attachments with download URLs (only present when attachments exist)"
          },
          "invoiceId": {
            "type": "string",
            "nullable": true,
            "description": "The ID of the invoice associated with the payroll line item",
            "example": "INV-001"
          },
          "creditNoteId": {
            "type": "string",
            "nullable": true,
            "description": "The ID of the credit note associated with the payroll line item",
            "example": "CN-001"
          },
          "billingStatus": {
            "type": "string",
            "enum": [
              "None",
              "Accrued",
              "Invoiced"
            ],
            "description": "The billing status of the payroll line item",
            "example": "None"
          },
          "paymentAfterLeavingPattern": {
            "type": "string",
            "enum": [
              "Irregular",
              "Regular"
            ],
            "description": "Which National Insurance earnings period this payment takes when it is made after the employment has ended. Only read on a payment after leaving, and ignored entirely for anyone who has not left. Irregular (accrued holiday, an unexpected bonus, arrears after a backdated pay award, a late commission or service charge) is charged on weekly thresholds; Regular (a payment they were expecting on their usual cycle, such as an expected bonus) keeps the employee's usual earnings period. Per CWG2 section 1.14 and NIM08400/NIM08410. Omitting it means Irregular, which is the safe default because the other direction understates NI. National Insurance is charged once per payslip, so a single Irregular payment puts the whole payslip on weekly thresholds.",
            "example": "Irregular"
          }
        }
      },
      "Pay_PayrollRunBalancesDto": {
        "type": "object",
        "description": "Payroll run balances containing base values and statutory payments reclaims",
        "required": [
          "baseValues",
          "statutoryPaymentsReclaims"
        ],
        "properties": {
          "baseValues": {
            "$ref": "#/components/schemas/Pay_BaseValuesDto",
            "description": "Base values for the payroll run"
          },
          "statutoryPaymentsReclaims": {
            "type": "object",
            "additionalProperties": {
              "$ref": "#/components/schemas/Pay_StatutoryPaymentsReclaimDto"
            },
            "description": "Dictionary of statutory payments reclaims by type"
          }
        }
      },
      "Pay_PayrollRunEntryDto": {
        "type": "object",
        "required": [
          "organisationId",
          "payrollConfigId",
          "year",
          "period",
          "frequency",
          "paymentDate",
          "periodStartDate",
          "periodEndDate",
          "payPeriodStartDate",
          "payPeriodEndDate",
          "status",
          "lockStatus",
          "totalEmployees",
          "totalSucceeded",
          "totalFailed",
          "createdBy",
          "createdDate",
          "updatedBy",
          "updatedDate",
          "hmrcDetails",
          "totalBalances",
          "payslipContentVersion",
          "lockCycle"
        ],
        "properties": {
          "organisationId": {
            "type": "string",
            "description": "The organisation ID",
            "example": "LOAD_TEST"
          },
          "payrollConfigId": {
            "type": "string",
            "description": "The payroll config ID",
            "example": "01JNR9P81W74HYCN35X1EEFDZE"
          },
          "year": {
            "type": "integer",
            "format": "int32",
            "description": "The year in format yyyy",
            "example": 2024
          },
          "period": {
            "type": "string",
            "description": "The period in format mm",
            "example": "2"
          },
          "frequency": {
            "type": "string",
            "enum": [
              "Annual",
              "Monthly",
              "FourWeekly",
              "Fortnightly",
              "Weekly",
              "Daily",
              "Quarterly",
              "BiAnnually"
            ],
            "description": "The pay frequency, Valid values: 'Annual', 'Monthly', 'FourWeekly', 'Fortnightly', 'Weekly', 'Daily'.",
            "example": "Monthly"
          },
          "paymentDate": {
            "type": "string",
            "format": "date",
            "description": "The payment date in format yyyy-mm-dd",
            "example": "2024-05-06"
          },
          "periodStartDate": {
            "type": "string",
            "description": "The start date of the tax period in format yyyy-mm-dd",
            "example": "2024-05-06"
          },
          "periodEndDate": {
            "type": "string",
            "description": "The end date of the tax period in format yyyy-mm-dd",
            "example": "2024-06-05"
          },
          "payPeriodStartDate": {
            "type": "string",
            "description": "The start date of the pay period in format yyyy-mm-dd",
            "example": "2024-05-01"
          },
          "payPeriodEndDate": {
            "type": "string",
            "description": "The end date of the pay period in format yyyy-mm-dd",
            "example": "2024-05-31"
          },
          "status": {
            "type": "string",
            "enum": [
              "Processing",
              "Completed",
              "Open"
            ],
            "description": "The status of the payroll run, Valid values: 'Completed', 'Processing'.",
            "example": "Completed"
          },
          "lockStatus": {
            "type": "string",
            "enum": [
              "Locked",
              "Unlocked",
              "Reopened",
              "PartiallyReopened"
            ],
            "description": "The lock status of the payroll run, Valid values: 'Locked', 'Unlocked', 'Reopened', 'PartiallyReopened'. Only 'Locked' freezes the payslips; a reopened run accepts changes to its reopened payslips until it is locked again.",
            "example": "Locked"
          },
          "totalEmployees": {
            "type": "integer",
            "format": "int32",
            "description": "The total number of employees in the payroll run, including employees with no payroll line items.",
            "example": 10
          },
          "totalSucceeded": {
            "type": "integer",
            "format": "int32",
            "description": "The total number of employees in the payroll run that have successfully been processed.",
            "example": 10
          },
          "totalFailed": {
            "type": "integer",
            "format": "int32",
            "description": "The total number of employees in the payroll run that have failed to be processed.",
            "example": 0
          },
          "createdBy": {
            "type": "string",
            "description": "The user ID of who created the payroll run",
            "example": "System"
          },
          "createdDate": {
            "type": "string",
            "description": "The date and time the payroll run was created",
            "example": "2025-03-21T14:17:16.126Z"
          },
          "updatedBy": {
            "type": "string",
            "description": "The user ID of who updated the payroll run",
            "example": "System"
          },
          "updatedDate": {
            "type": "string",
            "description": "The date and time the payroll run was updated",
            "example": "2025-03-21T14:17:19.320Z"
          },
          "completedDate": {
            "type": "string",
            "nullable": true,
            "description": "The date and time the payroll run was completed",
            "example": "2025-03-21T14:17:19.320Z"
          },
          "lockedBy": {
            "type": "string",
            "nullable": true,
            "description": "The user ID of who locked the payroll run",
            "example": "System"
          },
          "lockedDate": {
            "type": "string",
            "nullable": true,
            "description": "When the pay run was last locked (UTC timestamp); null if it has never been locked."
          },
          "hmrcDetails": {
            "$ref": "#/components/schemas/Pay_PayrollRunEntryHmrcDetailsDto",
            "description": "The HMRC details for the payroll run"
          },
          "totalBalances": {
            "$ref": "#/components/schemas/Pay_PayrollRunBalancesDto",
            "description": "The balances for the payroll run"
          },
          "payslipContentVersion": {
            "type": "integer",
            "format": "int64",
            "description": "Increments when payslip content changes, so consumers can detect a rebuild."
          },
          "provisionalAllowances": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Pay_ProvisionalRunAllowancesDto"
              }
            ],
            "nullable": true,
            "description": "What this run would claim from the annual Employment Allowance and Apprenticeship Levy allowance pots if it locked now. Returned only while the run is open and the caller supplies runEmployerNi and runPayBill; once the run is locked the settled figures are on totalBalances instead."
          },
          "lockCycle": {
            "type": "integer",
            "format": "int32",
            "description": "How many times the run has been locked, counting the lock in progress or the last one. 1 for a run that has never been unlocked. Each cycle's files, FPS submissions and payslip versions are listed under the run's lock history.",
            "example": 1
          }
        }
      },
      "Pay_PayrollRunEntryFpsHmrcDetailsDto": {
        "type": "object",
        "required": [
          "hmrcFpsReportStatus"
        ],
        "properties": {
          "hmrcFpsSubmissionId": {
            "type": "string",
            "nullable": true,
            "description": "The id of the FPS HMRC submission"
          },
          "hmrcFpsSubmissionDate": {
            "type": "string",
            "nullable": true,
            "description": "The date and time the FPS HMRC submission was sent"
          },
          "hmrcFpsReportStatus": {
            "type": "string",
            "enum": [
              "NotSent",
              "Sending",
              "Sent",
              "Failed",
              "GeneratingPreview",
              "PreviewReady"
            ],
            "description": "The status of the FPS HMRC submission",
            "example": "NotSent"
          },
          "correlationId": {
            "type": "string",
            "nullable": true,
            "description": "The correlation ID of the FPS HMRC submission",
            "example": "1234567890"
          },
          "submissionBody": {
            "type": "string",
            "nullable": true,
            "description": "The XML of the FPS submission serialized to a string"
          },
          "submissionResponse": {
            "type": "string",
            "nullable": true,
            "description": "The XML of the FPS submission response serialized to a string"
          },
          "errors": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "nullable": true,
            "description": "The errors of the FPS HMRC submission",
            "example": [
              "Error 1",
              "Error 2"
            ]
          },
          "submissionDownloadUrl": {
            "type": "string",
            "nullable": true,
            "description": "A link that downloads the submitted FPS XML, valid for 15 minutes"
          },
          "previewDownloadUrl": {
            "type": "string",
            "nullable": true,
            "description": "A link that downloads the preview XML, valid for 15 minutes"
          },
          "lateReason": {
            "type": "string",
            "enum": [
              "NotionalPaymentToExpartByThirdPartyOrOverseasEmployer",
              "NotionalPaymentEmploymentRelatedSecurity",
              "NotionalPaymentOther",
              "PaymentSubjectToClass1NicButP11dP9dForTax",
              "MicroEmployerUsingTemporaryOnOrBeforeRelaxation",
              "NoRequirementToMaintainADeductionsWorkingSheetOrImpossibleToReportWorkDoneOnTheDay",
              "ReasonableExcuse",
              "CorrectionToEarlierSubmission"
            ],
            "description": "The HMRC late reporting reason the FPS was sent with (or, while a preview is ready, the one the preview was built with). Null when the FPS was reported on time or has not been sent. The values map to HMRC codes A, B, C, D, F, G and H respectively."
          }
        }
      },
      "Pay_PayrollRunEntryHmrcDetailsDto": {
        "type": "object",
        "required": [
          "fullPaymentSubmissionReportDetails"
        ],
        "properties": {
          "fullPaymentSubmissionReportDetails": {
            "$ref": "#/components/schemas/Pay_PayrollRunEntryFpsHmrcDetailsDto",
            "description": "The details of the full payment submission report"
          }
        }
      },
      "Pay_PayrollRunFpsSubmissionDto": {
        "type": "object",
        "description": "An FPS sent, or attempted, under one lock cycle.",
        "required": [
          "status",
          "recordedDate"
        ],
        "properties": {
          "status": {
            "type": "string",
            "description": "The submission status, Valid values: 'Sending', 'Sent', 'Failed'."
          },
          "recordedDate": {
            "type": "string",
            "description": "When this status was recorded."
          },
          "submissionId": {
            "type": "string",
            "nullable": true,
            "description": "HMRC's submission ID, once accepted."
          },
          "submissionDate": {
            "type": "string",
            "nullable": true,
            "description": "HMRC's submission timestamp, once accepted."
          },
          "correlationId": {
            "type": "string",
            "nullable": true,
            "description": "HMRC's correlation ID for the submission."
          },
          "lateReason": {
            "type": "string",
            "nullable": true,
            "description": "The late reporting reason the submission carried, if any."
          },
          "previewDownloadUrl": {
            "type": "string",
            "nullable": true,
            "description": "A link to the FPS XML as previewed before this attempt, valid for 15 minutes. Null when no preview was stored."
          },
          "submissionDownloadUrl": {
            "type": "string",
            "nullable": true,
            "description": "A link to the submitted FPS body, as sent to HMRC without the credentials, valid for 15 minutes. Null until the attempt was sent, or when no body was stored."
          },
          "errors": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "nullable": true,
            "description": "The errors HMRC answered the attempt with, when it was refused. Null or empty when it was accepted or has not been answered."
          },
          "hmrcResponse": {
            "type": "string",
            "nullable": true,
            "description": "HMRC's response to the attempt, as received. Null until HMRC has answered."
          }
        }
      },
      "Pay_PayrollRunLockCycleDto": {
        "type": "object",
        "description": "One lock of a pay run. A run that has never been unlocked has one cycle; every unlock starts\nthe next, so the list is the run's history: who locked it and when, who unlocked it and why,\nthe totals the lock settled, and every FPS sent under it. Nothing in a cycle is rewritten by a\nlater one.",
        "required": [
          "cycle",
          "unlockedEmployeeIds",
          "fpsSubmissions",
          "current"
        ],
        "properties": {
          "cycle": {
            "type": "integer",
            "format": "int32",
            "description": "The cycle number, from 1."
          },
          "lockedBy": {
            "type": "string",
            "nullable": true,
            "description": "The user ID of who locked the run for this cycle."
          },
          "lockedDate": {
            "type": "string",
            "nullable": true,
            "description": "The date and time the run was locked for this cycle."
          },
          "completedDate": {
            "type": "string",
            "nullable": true,
            "description": "The date and time this cycle's processing completed."
          },
          "unlockedBy": {
            "type": "string",
            "nullable": true,
            "description": "The user ID of who unlocked the run, ending this cycle. Null while the cycle is current."
          },
          "unlockedDate": {
            "type": "string",
            "nullable": true,
            "description": "The date and time the run was unlocked, ending this cycle."
          },
          "unlockReason": {
            "type": "string",
            "nullable": true,
            "description": "The reason given for unlocking."
          },
          "unlockScope": {
            "type": "string",
            "nullable": true,
            "description": "What was unlocked, Valid values: 'Full', 'Employees'."
          },
          "unlockedEmployeeIds": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "The employees reopened when the scope is 'Employees'."
          },
          "lateReportingReason": {
            "type": "string",
            "nullable": true,
            "description": "The HMRC late reporting reason the cycle's FPS carries, when the run was locked again after an earlier FPS."
          },
          "totalBalances": {
            "$ref": "#/components/schemas/Pay_PayrollRunBalancesDto",
            "nullable": true,
            "description": "The run totals settled by this cycle."
          },
          "fpsSubmissions": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Pay_PayrollRunFpsSubmissionDto"
            },
            "description": "Every FPS submission made under this cycle, oldest first."
          },
          "current": {
            "type": "boolean",
            "description": "True for the run's latest cycle."
          },
          "reopenExpected": {
            "type": "integer",
            "format": "int32",
            "nullable": true,
            "description": "How many Final payslips the unlock of this cycle set out to reopen. Null for a cycle that was never unlocked, or whose unlock has not started reopening payslips yet."
          },
          "reopenDone": {
            "type": "integer",
            "format": "int32",
            "nullable": true,
            "description": "How many of them the unlock has reopened so far. The run can be locked again once it equals `reopenExpected`."
          },
          "unlockOverriddenBy": {
            "type": "string",
            "nullable": true,
            "description": "The user who locked the run again before every payslip was reopened, with `X-Unlock-Override: true`. Null when nobody did."
          },
          "unlockedWith": {
            "type": "string",
            "nullable": true,
            "description": "The earlier pay run (`{year}-{period}`) whose unlock reopened this run as well, when this run was not the one unlocked. Null when the unlock was requested on this run."
          },
          "leaversWithIssuedP45": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "nullable": true,
            "description": "The leavers whose final payslip the unlock of this cycle reopened after their P45 had been issued. Their correction reaches HMRC on the next FPS; no new P45 is produced, so tell them in writing. Null when there were none."
          }
        }
      },
      "Pay_PayrollRunProcessingDto": {
        "type": "object",
        "description": "The payslips of a pay run that are queued for calculation and have not finished yet. A payslip\nis queued whenever something it depends on changes and leaves once its calculation has been\nwritten, so a run whose pending count is 0 has every payslip up to date.",
        "required": [
          "pendingCount",
          "payslips"
        ],
        "properties": {
          "pendingCount": {
            "type": "integer",
            "format": "int32",
            "description": "How many calculations are still outstanding; 0 when every payslip of the run is up to date",
            "example": 2
          },
          "oldestQueuedAt": {
            "type": "string",
            "nullable": true,
            "description": "When the oldest outstanding calculation was queued, UTC; null when none is outstanding. A calculation queued long ago that is still outstanding did not complete and will not finish on its own.",
            "example": "2026-11-06T10:15:02.114Z"
          },
          "payslips": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Pay_PayslipProcessingDto"
            },
            "description": "The outstanding calculations, oldest first. An employee appears once for each calculation still outstanding."
          }
        }
      },
      "Pay_Payslip": {
        "type": "object",
        "required": [
          "employeeDetails",
          "employerDetails",
          "year",
          "period",
          "payrollConfigId",
          "frequency",
          "summaryItems",
          "forPeriod",
          "yearToDate",
          "forEmployment",
          "createdDate",
          "createdBy",
          "updatedDate",
          "updatedBy",
          "status",
          "payslipMetadata",
          "payPeriodStartDate",
          "payPeriodEndDate",
          "lockCycle"
        ],
        "properties": {
          "employeeDetails": {
            "$ref": "#/components/schemas/Pay_PayslipEmployeeDetailsDto",
            "description": "Employee details"
          },
          "employerDetails": {
            "$ref": "#/components/schemas/Pay_PayslipEmployerDetailsDto",
            "description": "Employer details"
          },
          "year": {
            "type": "integer",
            "format": "int32",
            "description": "Year",
            "example": 2024
          },
          "period": {
            "type": "integer",
            "format": "int32",
            "description": "Period",
            "example": 2
          },
          "payrollConfigId": {
            "type": "string",
            "description": "Payroll config id",
            "example": "01JNR9P81W74HYCN35X1EEFDZE"
          },
          "frequency": {
            "type": "string",
            "enum": [
              "Annual",
              "Monthly",
              "FourWeekly",
              "Fortnightly",
              "Weekly",
              "Daily",
              "Quarterly",
              "BiAnnually"
            ],
            "description": "Frequency",
            "example": "Monthly"
          },
          "summaryItems": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Pay_PayslipSummaryItemDto"
            },
            "description": "Summary items"
          },
          "forPeriod": {
            "$ref": "#/components/schemas/Pay_BaseValuesDto",
            "description": "The totals for this pay period alone."
          },
          "yearToDate": {
            "$ref": "#/components/schemas/Pay_BaseValuesDto",
            "description": "The tax year's totals so far including this period, with pay and tax from a previous employment in the same tax year added in."
          },
          "forEmployment": {
            "$ref": "#/components/schemas/Pay_BaseValuesDto",
            "description": "The tax year's totals so far including this period for this employment only, without any previous employment."
          },
          "createdDate": {
            "type": "string",
            "description": "Created date",
            "example": "2025-03-21T14:17:19.076Z"
          },
          "createdBy": {
            "type": "string",
            "description": "Created by",
            "example": "System"
          },
          "updatedDate": {
            "type": "string",
            "description": "Updated date",
            "example": "2025-03-21T14:17:19.076Z"
          },
          "updatedBy": {
            "type": "string",
            "description": "Updated by",
            "example": "System"
          },
          "status": {
            "type": "string",
            "enum": [
              "Preview",
              "Final",
              "Reopened"
            ],
            "description": "Status",
            "example": "Final"
          },
          "payslipMetadata": {
            "$ref": "#/components/schemas/Pay_PayslipMetadataDto",
            "description": "Payslip metadata"
          },
          "paymentDate": {
            "type": "string",
            "nullable": true,
            "description": "Payment date"
          },
          "payPeriodStartDate": {
            "type": "string",
            "description": "Pay period start date",
            "example": "2024-02-01"
          },
          "payPeriodEndDate": {
            "type": "string",
            "description": "Pay period end date",
            "example": "2024-02-29"
          },
          "lateReason": {
            "type": "string",
            "enum": [
              "NotionalPaymentToExpartByThirdPartyOrOverseasEmployer",
              "NotionalPaymentEmploymentRelatedSecurity",
              "NotionalPaymentOther",
              "PaymentSubjectToClass1NicButP11dP9dForTax",
              "MicroEmployerUsingTemporaryOnOrBeforeRelaxation",
              "NoRequirementToMaintainADeductionsWorkingSheetOrImpossibleToReportWorkDoneOnTheDay",
              "ReasonableExcuse",
              "CorrectionToEarlierSubmission"
            ],
            "description": "Late reason",
            "example": "ReasonableExcuse"
          },
          "alerts": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Pay_PayslipAlertDto"
            },
            "nullable": true,
            "description": "Alerts raised for this payslip during calculation (e.g. missing bank account, NMW breach). Null or empty when no alerts apply."
          },
          "lastEmailedAt": {
            "type": "string",
            "nullable": true,
            "description": "Timestamp of the last payslip email-send attempt (ISO 8601). Null if the payslip has never been emailed.",
            "example": "2026-06-24T10:00:00.000Z"
          },
          "lastEmailedTo": {
            "type": "string",
            "nullable": true,
            "description": "Email address the payslip was last sent to.",
            "example": "jane.doe@example.com"
          },
          "lastEmailedBy": {
            "type": "string",
            "nullable": true,
            "description": "User who triggered the last payslip email (or 'system' for automated sends).",
            "example": "admin@example.com"
          },
          "lastEmailedStatus": {
            "type": "string",
            "enum": [
              "Sent",
              "Failed"
            ],
            "description": "Outcome of the last payslip email-send attempt.",
            "example": "Sent"
          },
          "lastEmailError": {
            "type": "string",
            "nullable": true,
            "description": "Reason the last payslip email failed. Null on success.",
            "example": "Mailbox full"
          },
          "versionId": {
            "type": "string",
            "nullable": true,
            "description": "Monotonic ULID stamped when this payslip's content was produced. Consumers use it as a freshness token: a payslip carrying a lower value than one already processed is stale and must not overwrite the newer state. Writes to the payslip itself are guarded on the same value. Null on payslips written before versioning existed — treat that as unknown, not as the oldest possible version.",
            "example": "01KZB4YMGGSKA1B3PFD5WJ5YFB"
          },
          "lockCycle": {
            "type": "integer",
            "format": "int32",
            "description": "The pay run lock cycle this payslip belongs to: 1 until the run is unlocked for the first time, then the cycle it was reopened under. Earlier cycles are kept as payslip versions.",
            "example": 1
          }
        }
      },
      "Pay_PayslipAlertDto": {
        "type": "object",
        "required": [
          "code",
          "severity"
        ],
        "properties": {
          "code": {
            "type": "string",
            "enum": [
              "MissingBankAccount",
              "NationalMinimumWageBreach",
              "NiCategoryChanged",
              "LeaverOnThisPayRun",
              "PaymentAfterLeaving",
              "CourtOrderNoTableForPayFrequency",
              "EmergencyTaxCode"
            ],
            "description": "Alert code identifying the rule that fired",
            "example": "MissingBankAccount"
          },
          "severity": {
            "type": "string",
            "enum": [
              "Info",
              "Warning",
              "Error"
            ],
            "description": "Alert severity",
            "example": "Warning"
          },
          "context": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            },
            "description": "Optional structured details about the alert. For NationalMinimumWageBreach this includes age, ageBracket, requiredRate, effectiveRate, nmwHours and nmwAmount. For NiCategoryChanged this includes to, effectiveDate (yyyy-MM-dd) and, when resolvable, from. For LeaverOnThisPayRun this includes leavingDate (yyyy-MM-dd) and, when the cessation missed its own pay run, reportedLate. For PaymentAfterLeaving this includes leavingDate (yyyy-MM-dd) and the taxCode applied. For CourtOrderNoTableForPayFrequency, raised when a Northern Ireland fines attachment of earnings order meets a pay frequency other than weekly or monthly (the only frequencies with official tables) and so took nothing, this includes message, courtOrderType, courtOrderIds (comma-separated) and payFrequency."
          }
        }
      },
      "Pay_PayslipEmailRecipientsDto": {
        "type": "object",
        "description": "Who a payslip email request goes to, sent in the background.",
        "required": [
          "type"
        ],
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "payRun",
              "employees"
            ],
            "description": "`payRun`: every payslip on the pay run that is not empty. `employees`: the payslips of\nthe employees in `employeeIds`, whatever their figures.",
            "example": "payRun"
          },
          "employeeIds": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "nullable": true,
            "description": "The employees whose payslips to email, for type `employees` only: at least one, at most\n5,000. Use `payRun` for everyone.",
            "example": [
              "01JNR9P81W74HYCN35X1EEFDZE"
            ]
          }
        }
      },
      "Pay_PayslipEmailSendDto": {
        "type": "object",
        "description": "A background payslip email send for a pay run: one runs at a time per pay run.",
        "required": [
          "sendId",
          "status",
          "queued",
          "done",
          "skipped",
          "failedEmployeeIds"
        ],
        "properties": {
          "sendId": {
            "type": "string",
            "description": "The send.",
            "example": "01JD8Y7Q3N4M5P6R7S8T9V0W1X"
          },
          "status": {
            "type": "string",
            "enum": [
              "Queued",
              "Sending",
              "Completed",
              "Failed"
            ],
            "description": "Where it stands.",
            "example": "Sending"
          },
          "queued": {
            "type": "integer",
            "format": "int32",
            "description": "Payslips it is emailing; 0 until they are worked out.",
            "example": 90
          },
          "done": {
            "type": "integer",
            "format": "int32",
            "description": "Payslips it has finished with, sent or not.",
            "example": 40
          },
          "skipped": {
            "type": "integer",
            "format": "int32",
            "description": "Payslips left out because they were already emailed as they stand.",
            "example": 3
          },
          "failedEmployeeIds": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "The employees whose payslip could not be sent, after every try.",
            "example": []
          }
        }
      },
      "Pay_PayslipEmployeeDetailsDto": {
        "type": "object",
        "required": [
          "id",
          "name",
          "email",
          "birthDate",
          "birthGender",
          "hoursWorkedCategory",
          "taxCode",
          "nationalInsuranceCategory",
          "nationalInsuranceNumber",
          "starterDetails",
          "isPaymentAfterLeaving"
        ],
        "properties": {
          "id": {
            "type": "string",
            "description": "Id",
            "example": "EMP01JPW80Q2B7Q9RGGRY29VGC8WM"
          },
          "name": {
            "$ref": "#/components/schemas/Pay_EmployeeNameDto",
            "description": "The employee's name when the payslip was calculated."
          },
          "email": {
            "type": "string",
            "description": "Email address",
            "example": "john.doe@example.com"
          },
          "secondaryEmail": {
            "type": "string",
            "nullable": true,
            "description": "Secondary email address",
            "example": "john.doe@example.com"
          },
          "address": {
            "$ref": "#/components/schemas/Pay_AddressDto",
            "nullable": true,
            "description": "The employee's address when the payslip was calculated."
          },
          "birthDate": {
            "type": "string",
            "description": "Birth date (YYYY-MM-DD)",
            "example": "1980-01-12"
          },
          "birthGender": {
            "type": "string",
            "enum": [
              "Male",
              "Female"
            ],
            "description": "Birth gender (Male or Female)",
            "example": "Female"
          },
          "payrollId": {
            "type": "string",
            "nullable": true,
            "description": "Payroll id (optional), only used for payroll runs PayId field in HMRC Full Payment Submission Report",
            "example": "PAY123"
          },
          "employeeCode": {
            "type": "string",
            "nullable": true,
            "description": "Employee code. An optional identifier for the employee.",
            "example": "EMP001"
          },
          "hoursWorkedCategory": {
            "type": "string",
            "enum": [
              "UpTo16Hours",
              "From16To24Hours",
              "From24To30Hours",
              "Above30Hours",
              "Other"
            ],
            "description": "Weekly hours worked category.",
            "example": "Above30Hours"
          },
          "taxCode": {
            "$ref": "#/components/schemas/Pay_EmployeeTaxCodeDto",
            "description": "The tax code in force for this pay period, which the payslip was calculated with."
          },
          "nationalInsuranceCategory": {
            "type": "string",
            "description": "National insurance category",
            "example": "A"
          },
          "nationalInsuranceNumber": {
            "type": "string",
            "description": "National insurance number",
            "example": "AB123456C"
          },
          "passportNumber": {
            "type": "string",
            "nullable": true,
            "description": "Passport number (optional)",
            "example": "123456789"
          },
          "starterDetails": {
            "$ref": "#/components/schemas/Pay_EmployeeStarterDetailsDto",
            "description": "The employee's starter details when the payslip was calculated."
          },
          "studentDetails": {
            "$ref": "#/components/schemas/Pay_EmployeeStudentDetailsDto",
            "nullable": true,
            "description": "The employee's student and postgraduate loan details when the payslip was calculated."
          },
          "directorDetails": {
            "$ref": "#/components/schemas/Pay_EmployeeDirectorDetailsDto",
            "nullable": true,
            "description": "The employee's director details when the payslip was calculated."
          },
          "leaverDetails": {
            "$ref": "#/components/schemas/Pay_EmployeeLeaverDetailsDto",
            "nullable": true,
            "description": "The employee's leaver details when the payslip was calculated."
          },
          "workplaceDetails": {
            "$ref": "#/components/schemas/Pay_EmployeeWorkplaceDetailsDto",
            "nullable": true,
            "description": "The employee's workplace details when the payslip was calculated."
          },
          "bankAccounts": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Pay_BankAccountDto"
            },
            "nullable": true,
            "description": "Bank accounts",
            "example": [
              {
                "accountNumber": "12345678",
                "sortCode": "123456",
                "accountHolderName": "John Doe",
                "isPrimaryPayrollAccount": true,
                "allocationPercentage": 100
              }
            ]
          },
          "department": {
            "type": "string",
            "nullable": true,
            "description": "The employee's department."
          },
          "jobTitle": {
            "type": "string",
            "nullable": true,
            "description": "The employee's job title."
          },
          "pensionDetails": {
            "$ref": "#/components/schemas/Pay_PensionEmployeeConfigDto",
            "nullable": true,
            "description": "Deprecated: stops being returned on 14 January 2027. Read the pension contribution items under summaryItems instead: pensionLineType names the kind of contribution, pensionMetadata.pensionType the pension type, and pensionMetadata.pensionGroupId the group. Until then it carries the configuration the group contribution line was calculated from, and is absent when the employee has no pension contribution this period.",
            "deprecated": true
          },
          "tags": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Pay_TagDto"
            },
            "nullable": true,
            "description": "Tags assigned to this employee."
          },
          "isPaymentAfterLeaving": {
            "type": "boolean",
            "description": "This payslip pays someone who had already left and been given their P45. HMRC requires a 0T week 1/month 1 tax code, sends the payment on the FPS with the payment-after-leaving indicator set alongside the original leaving date, and forbids issuing a second P45.",
            "example": false
          }
        }
      },
      "Pay_PayslipEmployerDetailsDto": {
        "type": "object",
        "required": [
          "id",
          "organisationInformation",
          "taxReferenceNumbers"
        ],
        "properties": {
          "id": {
            "type": "string",
            "description": "Organisation id as per our platform",
            "example": "LOAD_TEST"
          },
          "organisationInformation": {
            "$ref": "#/components/schemas/Pay_OrganisationInformationDto",
            "description": "The organisation's details when the payslip was calculated."
          },
          "taxReferenceNumbers": {
            "$ref": "#/components/schemas/Pay_TaxReferenceNumbersDto",
            "description": "The organisation's HMRC references when the payslip was calculated."
          }
        }
      },
      "Pay_PayslipMetadataDto": {
        "type": "object",
        "properties": {
          "notes": {
            "type": "string",
            "nullable": true,
            "description": "Notes to be added or updated for the payslip",
            "example": "Additional holiday pay included for this period"
          },
          "paymentDateOverwrite": {
            "type": "string",
            "nullable": true,
            "description": "Payment date overwrite for the payslip",
            "example": "2024-02-28"
          }
        }
      },
      "Pay_PayslipNotificationRequestDto": {
        "type": "object",
        "properties": {
          "employeeIds": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "nullable": true,
            "description": "The employees whose payslips to email, sent within the request. Give either this or\n`recipients`, never both.",
            "example": [
              "EMP01JPW80Q2B7Q9RGGRY29VGC8WM",
              "EMP02JPW80Q2B7Q9RGGRY29VGC8WN"
            ]
          },
          "skipAlreadyEmailed": {
            "type": "boolean",
            "description": "When true, a payslip already emailed as it stands now is left out and reported in\n`skippedEmployeeIds`; one recalculated since it was emailed (a figure changed, or the pay\nrun was unlocked and locked again) is sent again. Off by default: a plain request emails every\npayslip it names.",
            "example": false
          },
          "recipients": {
            "$ref": "#/components/schemas/Pay_PayslipEmailRecipientsDto",
            "nullable": true,
            "description": "Who to email, sent in the background, so a request of any size is accepted at once: everyone on\nthe pay run with figures (type `payRun`, the empty payslips left out), or the employees\nnamed (type `employees`). A payslip that cannot be sent is tried again. Give either this or\n`employeeIds`, never both."
          }
        }
      },
      "Pay_PayslipNotificationResponseDto": {
        "type": "object",
        "required": [
          "failedEmployeeIds"
        ],
        "properties": {
          "failedEmployeeIds": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "List of employee IDs for which the notification failed to send. Empty when the request named `recipients`: those are sent in the background.",
            "example": [
              "EMP03JPW80Q2B7Q9RGGRY29VGC8WO"
            ]
          },
          "skippedEmployeeIds": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "nullable": true,
            "description": "The employees left out because their payslip was already emailed as it stands (only when `skipAlreadyEmailed` was set)",
            "example": []
          },
          "send": {
            "$ref": "#/components/schemas/Pay_PayslipEmailSendDto",
            "nullable": true,
            "description": "For `recipients`: the background send this request started or, with a 409, the one already\nrunning for the pay run."
          }
        }
      },
      "Pay_PayslipProcessingDto": {
        "type": "object",
        "description": "A payslip of a pay run that is queued for calculation and has not finished yet. An employee\nappears once for each calculation still outstanding, so the same employee can appear more\nthan once when their payslip was queued again before the first calculation finished.",
        "required": [
          "employeeId",
          "processId",
          "reason",
          "queuedAt"
        ],
        "properties": {
          "employeeId": {
            "type": "string",
            "description": "The employee whose payslip is being calculated"
          },
          "processId": {
            "type": "string",
            "description": "Identifies this calculation"
          },
          "reason": {
            "type": "string",
            "enum": [
              "Other",
              "PayLineChanged",
              "EmployeeChanged",
              "AddedToPayRun",
              "PreviousPayslipChanged",
              "PayRunUnlocked"
            ],
            "description": "Why the payslip was queued: PayLineChanged (a pay line was added, changed or removed), EmployeeChanged (the employee's details changed, or a recalculation was requested), AddedToPayRun (the employee joined the pay run: it was opened with them, they were onboarded or changed so they belong in it, or a leaver was added to it to be paid), PreviousPayslipChanged (the employee's payslip for an earlier period changed or was finalised, so this one starts from new year-to-date figures), PayRunUnlocked (the pay run was unlocked), or Other. More values may be added: read any value you do not recognise as Other."
          },
          "queuedAt": {
            "type": "string",
            "description": "When the calculation was queued, UTC"
          },
          "correlationId": {
            "type": "string",
            "nullable": true,
            "description": "The id of the request that queued the calculation, when there was one"
          }
        }
      },
      "Pay_PayslipRecalculationRequestDto": {
        "type": "object",
        "description": "The employees whose payslips should be recalculated.",
        "required": [
          "employeeIds"
        ],
        "properties": {
          "employeeIds": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "The employees to recalculate, in the organisation's open pay run.",
            "example": [
              "employee-001",
              "employee-002"
            ]
          }
        }
      },
      "Pay_PayslipRecalculationResultDto": {
        "type": "object",
        "description": "The outcome of recalculating one employee's payslip.",
        "required": [
          "employeeId",
          "success"
        ],
        "properties": {
          "employeeId": {
            "type": "string",
            "description": "The employee this result is for.",
            "example": "employee-001"
          },
          "processId": {
            "type": "string",
            "nullable": true,
            "description": "The identifier of the recalculation that was queued, when one was.",
            "example": "01JBQ8Z3K9WZ7T2M4N6P8R0S1T"
          },
          "success": {
            "type": "boolean",
            "description": "Whether the recalculation was accepted for this employee."
          },
          "message": {
            "type": "string",
            "nullable": true,
            "description": "Why the recalculation was not accepted, when it was not."
          }
        }
      },
      "Pay_PayslipSummaryItemCalculationFlagsDto": {
        "type": "object",
        "description": "Eligibility flags taken from the source pay element, for apportioning per-element costs without re-reading the pay element's configuration.",
        "required": [
          "niType",
          "payType",
          "isPensionable",
          "accrueHoliday",
          "isClass1ANiable",
          "subjectToNmwCheck"
        ],
        "properties": {
          "niType": {
            "type": "string",
            "enum": [
              "Niable",
              "NonNiable",
              "EmployerOnly"
            ],
            "description": "NI eligibility. Niable = both employee and employer NI apply; EmployerOnly = employer NI only (typical for some benefits in kind); NonNiable = no NI applies."
          },
          "payType": {
            "type": "string",
            "enum": [
              "Payable",
              "Deductible",
              "Informational"
            ],
            "description": "Whether this line adds to gross (Payable), reduces it (Deductible), or is reporting-only (Informational)."
          },
          "isPensionable": {
            "type": "boolean",
            "description": "Whether this line contributes to gross pensionable earnings."
          },
          "accrueHoliday": {
            "type": "boolean",
            "description": "Whether this line counts toward holiday accrual."
          },
          "isClass1ANiable": {
            "type": "boolean",
            "description": "Whether this line is subject to employer Class 1A NI (typically benefits in kind)."
          },
          "subjectToNmwCheck": {
            "type": "boolean",
            "description": "Whether this item counts towards National Minimum Wage pay. Only Hour-unit items are assessed, so a Fixed-amount item is never part of the NMW calculation even when this is true."
          },
          "taxType": {
            "type": "string",
            "enum": [
              "Taxable",
              "NonTaxable"
            ],
            "description": "Tax eligibility. Payslips persisted before this was added may have it as null on legacy items."
          }
        }
      },
      "Pay_PayslipSummaryItemDto": {
        "type": "object",
        "required": [
          "id",
          "description",
          "amount",
          "type",
          "category",
          "payRate",
          "payElementId",
          "unitName",
          "units",
          "date",
          "isNetDeduction",
          "canEdit",
          "billingStatus",
          "wasReducedByProtectedEarnings"
        ],
        "properties": {
          "id": {
            "type": "string",
            "description": "Unique identifier for the summary item",
            "example": "PAYLINE-01JPW80Q2B5B76SQ2K56BZ3DHA"
          },
          "description": {
            "type": "string",
            "description": "Description of the item",
            "example": "Regular Hours"
          },
          "amount": {
            "type": "number",
            "format": "decimal",
            "description": "Amount for this item (payRate * units)",
            "example": 306
          },
          "type": {
            "type": "string",
            "enum": [
              "Employee",
              "Employer"
            ],
            "description": "Indicate if this line is linked to the employee or employer. 0 is Employee and 1 is Employer"
          },
          "category": {
            "type": "string",
            "enum": [
              "Earning",
              "Deduction",
              "Informational"
            ],
            "description": "Category of the item"
          },
          "payRate": {
            "type": "number",
            "format": "decimal",
            "description": "Pay rate for the item",
            "example": 10.5
          },
          "payElementId": {
            "type": "string",
            "description": "Pay element id",
            "example": "base_salary"
          },
          "unitName": {
            "type": "string",
            "enum": [
              "Hour",
              "Day",
              "Week",
              "Month",
              "Year",
              "Fixed",
              "Informational",
              "Percentage"
            ],
            "description": "Unit name"
          },
          "units": {
            "type": "number",
            "format": "decimal",
            "description": "Units"
          },
          "chargeRate": {
            "type": "number",
            "format": "decimal",
            "nullable": true,
            "description": "Charge rate"
          },
          "chargeUnits": {
            "type": "number",
            "format": "decimal",
            "nullable": true,
            "description": "How many units the client is charged for, copied from the payroll line.",
            "example": 1
          },
          "chargeValue": {
            "type": "number",
            "format": "decimal",
            "nullable": true,
            "description": "The charge value times the charge units",
            "example": 100
          },
          "chargeDescription": {
            "type": "string",
            "nullable": true,
            "description": "Charge description for billing."
          },
          "date": {
            "type": "string",
            "description": "Date of the item",
            "example": "2024-02-28"
          },
          "isNetDeduction": {
            "type": "boolean",
            "description": "Is net deduction",
            "example": false
          },
          "tags": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Pay_TagDto"
            },
            "nullable": true,
            "description": "Tags copied from the payroll line the item came from."
          },
          "unitType": {
            "type": "string",
            "enum": [
              "Amount",
              "Percentage"
            ],
            "description": "The unit type for calculation. Amount uses payRate * units, Percentage uses payRate * (units / 100). Defaults to Amount if not provided."
          },
          "originalValue": {
            "type": "number",
            "format": "decimal",
            "nullable": true,
            "description": "The original deduction amount before protected earnings adjustment. Shows what should have been deducted when deduction is reduced or zero."
          },
          "lineItemSequence": {
            "type": "integer",
            "format": "int32",
            "nullable": true,
            "description": "Line item sequence number for court orders"
          },
          "courtOrderId": {
            "type": "string",
            "nullable": true,
            "description": "Court order ID for court order line items"
          },
          "courtOrderType": {
            "type": "string",
            "enum": [
              "None",
              "CmsDeo",
              "AeoPriority",
              "AeoNonPriority",
              "Dea",
              "Ctaeo",
              "Ea",
              "Mcaeo",
              "Cma",
              "Cao",
              "NiFinesAeo",
              "NiEjoAeo"
            ],
            "description": "Court order type. One of CmsDeo, AeoPriority, AeoNonPriority, Dea, Ctaeo, Ea, Mcaeo, Cma (current maintenance arrestment, Scotland), Cao (conjoined arrestment order, Scotland), NiFinesAeo (attachment of earnings order for fines, Northern Ireland) or NiEjoAeo (attachment of earnings order made by the Enforcement of Judgments Office, Northern Ireland)."
          },
          "canEdit": {
            "type": "boolean",
            "description": "Indicates whether this summary item can be edited. Court order items are not editable.",
            "example": true
          },
          "eligibility": {
            "$ref": "#/components/schemas/Pay_EligibilityDto",
            "nullable": true,
            "description": "Which court order types may take money from this pay. Read-only: set from payType, taxType and isClass1ANiable."
          },
          "paymentDetails": {
            "$ref": "#/components/schemas/Pay_PaymentDetailsDto",
            "nullable": true,
            "description": "Payment details (BACS information) that can override default employee bank account"
          },
          "attachments": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Pay_AttachmentResponseDto"
            },
            "nullable": true,
            "description": "List of attachments with download URLs (only present when attachments exist)"
          },
          "poNumber": {
            "type": "string",
            "nullable": true,
            "description": "Purchase order number for billing purposes",
            "example": "PO-2025-001"
          },
          "clientId": {
            "type": "string",
            "nullable": true,
            "description": "Client ID",
            "example": "CLIENT-001"
          },
          "invoiceId": {
            "type": "string",
            "nullable": true,
            "description": "Invoice id when this line item has been allocated to an invoice."
          },
          "billingStatus": {
            "type": "string",
            "enum": [
              "None",
              "Accrued",
              "Invoiced"
            ],
            "description": "Billing status for billable line items."
          },
          "calculationFlags": {
            "$ref": "#/components/schemas/Pay_PayslipSummaryItemCalculationFlagsDto",
            "nullable": true,
            "description": "Eligibility flags taken from the source pay element. Use them to apportion per-element costs without re-reading the pay element's configuration."
          },
          "wasReducedByProtectedEarnings": {
            "type": "boolean",
            "description": "Whether this deduction line was reduced by the court order protected-earnings cap."
          },
          "tax": {
            "type": "number",
            "format": "decimal",
            "nullable": true,
            "description": "This line's share of forPeriod.tax (PAYE). Null when the line is not taxable; 0 when taxable but the apportioned share is zero this period. Σ across all items equals forPeriod.tax (penny-perfect via Hamilton's largest-remainder method)."
          },
          "employeeNi": {
            "type": "number",
            "format": "decimal",
            "nullable": true,
            "description": "This line's share of forPeriod.ni (employee NI). Null when not Niable; 0 when eligible but the share is zero. Σ = forPeriod.ni."
          },
          "employeePension": {
            "type": "number",
            "format": "decimal",
            "nullable": true,
            "description": "This line's share of forPeriod.pension (employee pension). Null when not pensionable; 0 when eligible but the share is zero. In SalarySacrifice mode this is 0 on every item because forPeriod.pension is 0, so the contribution lives on pensionContributionsByType[SalarySacrifice] and pensionSacrificeAmount on the synthetic sacrifice item."
          },
          "studentLoan": {
            "type": "number",
            "format": "decimal",
            "nullable": true,
            "description": "This line's share of forPeriod.studentLoan. Null when not taxable; 0 when eligible but the share is zero. Σ = forPeriod.studentLoan."
          },
          "postgraduateLoan": {
            "type": "number",
            "format": "decimal",
            "nullable": true,
            "description": "This line's share of forPeriod.postgraduateLoan. Same eligibility as tax. Σ = forPeriod.postgraduateLoan."
          },
          "employerNi": {
            "type": "number",
            "format": "decimal",
            "nullable": true,
            "description": "This line's share of forPeriod.employerNi. Null when neither Niable nor EmployerOnly; 0 when eligible but the share is zero. Σ = forPeriod.employerNi."
          },
          "employerClass1ANi": {
            "type": "number",
            "format": "decimal",
            "nullable": true,
            "description": "This line's share of forPeriod.employerClass1ANI (employer Class 1A NI on BIKs). Null when not Class 1A niable; 0 when eligible but the share is zero (Class 1A is normally settled annually on P11D, not per-pay-period)."
          },
          "employerPension": {
            "type": "number",
            "format": "decimal",
            "nullable": true,
            "description": "This line's share of forPeriod.employerPension. Null when not pensionable; 0 when eligible but the share is zero. Σ = forPeriod.employerPension."
          },
          "apprenticeshipLevy": {
            "type": "number",
            "format": "decimal",
            "nullable": true,
            "description": "This line's share of forPeriod.apprenticeshipLevy. Same eligibility as employerNi. Σ = forPeriod.apprenticeshipLevy."
          },
          "employmentAllowance": {
            "type": "number",
            "format": "decimal",
            "nullable": true,
            "description": "Historical only: per-item Employment Allowance slices are no longer written. Retained on summary items created while per-payslip apportionment existed; null on items written since. The run-level figure lives on the pay run's totalBalances."
          },
          "apprenticeshipLevyAllowance": {
            "type": "number",
            "format": "decimal",
            "nullable": true,
            "description": "Historical only: per-item Apprenticeship Levy allowance slices are no longer written. Retained on summary items created while per-payslip apportionment existed; null on items written since. The run-level figure lives on the pay run's totalBalances."
          },
          "pensionSacrificeAmount": {
            "type": "number",
            "format": "decimal",
            "nullable": true,
            "description": "The sacrificed amount on this line in SalarySacrifice pension schemes. Populated only on the internal_pension_salary_sacrifice synthetic item when the pension type is SalarySacrifice; null on every other item."
          },
          "pensionEmployerContribution": {
            "type": "number",
            "format": "decimal",
            "nullable": true,
            "description": "The employer contribution calculated for this pension contribution line under line-item contributions. Display metadata riding on the deduction item, already included in forPeriod.employerPension and never additive."
          },
          "pensionLineType": {
            "type": "string",
            "enum": [
              "Contribution",
              "RecurringAdditionalVoluntaryContribution",
              "AdditionalVoluntaryContribution",
              "OptOutRefund"
            ],
            "description": "Classifies a pension summary item so consumers never parse line ids. Contribution = a scheme contribution (group percentage/fixed, per-employee override, or a manually-added line on a pension pay element, including legacy salary sacrifice). RecurringAdditionalVoluntaryContribution = a standing additional voluntary contribution on top of the scheme contribution. AdditionalVoluntaryContribution = a single-period additional voluntary contribution. OptOutRefund = the payable line refunding the member's contributions after a valid opt-out. Null on every non-pension item."
          },
          "ordinaryDebtDeducted": {
            "type": "number",
            "format": "decimal",
            "nullable": true,
            "description": "Conjoined arrestment orders only: how much of the amount paid the ordinary debts; the rest paid maintenance. Null on every other item."
          },
          "pensionMetadata": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Pay_PensionMetadataSectionDto"
              }
            ],
            "nullable": true,
            "description": "The pension context this item calculated under (group id, basis, employer share, and contributionSource saying where the settings came from). Null on non-pension items and on payslips stored before the field existed."
          }
        }
      },
      "Pay_PayslipVersionDto": {
        "type": "object",
        "description": "A payslip version in full: the summary fields plus the payslip exactly as it was.",
        "required": [
          "lockCycle",
          "supersededAt",
          "supersededBy",
          "payslip"
        ],
        "properties": {
          "lockCycle": {
            "type": "integer",
            "format": "int32",
            "description": "The lock cycle this version belongs to (1 = the first lock)"
          },
          "supersededAt": {
            "type": "string",
            "description": "When the version was superseded, UTC"
          },
          "supersededBy": {
            "type": "string",
            "description": "Who unlocked the pay run"
          },
          "supersededReason": {
            "type": "string",
            "nullable": true,
            "description": "The reason given for the unlock, when one was given"
          },
          "payslip": {
            "$ref": "#/components/schemas/Pay_Payslip",
            "description": "The payslip as it stood"
          }
        }
      },
      "Pay_PayslipVersionSummaryDto": {
        "type": "object",
        "description": "One earlier version of a payslip: the payslip as it stood when its pay run was locked for\nthe given lock cycle, kept when that run was unlocked. Versions are never changed or removed.",
        "required": [
          "lockCycle",
          "supersededAt",
          "supersededBy",
          "status",
          "gross",
          "net",
          "tax",
          "forPeriod",
          "updatedDate"
        ],
        "properties": {
          "lockCycle": {
            "type": "integer",
            "format": "int32",
            "description": "The lock cycle this version belongs to (1 = the first lock)"
          },
          "supersededAt": {
            "type": "string",
            "description": "When the version was superseded, UTC"
          },
          "supersededBy": {
            "type": "string",
            "description": "Who unlocked the pay run"
          },
          "supersededReason": {
            "type": "string",
            "nullable": true,
            "description": "The reason given for the unlock, when one was given"
          },
          "status": {
            "type": "string",
            "enum": [
              "Preview",
              "Final",
              "Reopened"
            ],
            "description": "The payslip status at the time (Final)"
          },
          "gross": {
            "type": "number",
            "format": "decimal",
            "description": "Gross pay for the period as it stood"
          },
          "net": {
            "type": "number",
            "format": "decimal",
            "description": "Net pay for the period as it stood"
          },
          "tax": {
            "type": "number",
            "format": "decimal",
            "description": "Tax for the period as it stood"
          },
          "forPeriod": {
            "$ref": "#/components/schemas/Pay_BaseValuesDto",
            "description": "The whole period as it stood: gross, net, tax, NI, pension and the rest, so a version can be compared line by line without reading it in full"
          },
          "updatedDate": {
            "type": "string",
            "description": "When the payslip was last written before it was superseded"
          },
          "versionId": {
            "type": "string",
            "nullable": true,
            "description": "The payslip's freshness token at the time, when it had one"
          }
        }
      },
      "Pay_PensionEmployeeConfigDto": {
        "type": "object",
        "description": "Deprecated with pensionDetails (stops being returned on 14 January 2027). The pension configuration a payslip's contribution was calculated from: the group, the pension type, the percentage rates (0 for a fixed-amount contribution) and whether it uses qualifying earnings.",
        "required": [
          "employeeId",
          "pensionGroupId",
          "employeePensionRate",
          "employerPensionRate",
          "pensionType",
          "nationalInsuranceSavingFactor",
          "isQualifyingEarnings"
        ],
        "properties": {
          "employeeId": {
            "type": "string",
            "description": "The employee the payslip belongs to."
          },
          "pensionGroupId": {
            "type": "string",
            "description": "The pension group the contribution line was calculated under; empty when the line did not name one."
          },
          "employeePensionRate": {
            "type": "number",
            "format": "decimal",
            "description": "The employee contribution percentage; 0 when the employee contributes a fixed amount."
          },
          "employerPensionRate": {
            "type": "number",
            "format": "decimal",
            "description": "The employer contribution percentage; 0 when the employer contributes a fixed amount or nothing."
          },
          "pensionType": {
            "type": "string",
            "enum": [
              "NetPayArrangement",
              "ReliefAtSource",
              "SalarySacrifice"
            ],
            "description": "ReliefAtSource, NetPayArrangement or SalarySacrifice."
          },
          "nationalInsuranceSavingFactor": {
            "type": "number",
            "format": "decimal",
            "description": "Share of the employer NI saving passed into the pension, for salary sacrifice."
          },
          "isQualifyingEarnings": {
            "type": "boolean",
            "description": "Whether contributions are worked out on qualifying earnings rather than pensionable pay."
          }
        }
      },
      "Pay_PensionMetadataSectionDto": {
        "type": "object",
        "description": "The pension context a contribution line calculates under. basis 'QualifyingEarnings' banded against the statutory thresholds, anything else uses pensionable pay. Populated by the platform on the pension contribution lines it adds and read-only: it is ignored on caller-supplied lines.",
        "properties": {
          "pensionGroupId": {
            "type": "string",
            "nullable": true,
            "description": "The pension group the contribution line was calculated under."
          },
          "contributionSource": {
            "type": "string",
            "enum": [
              "Group",
              "RecurringContributionOverride",
              "ContributionOverride"
            ],
            "description": "Where the contribution settings came from: Group (the pension group), RecurringContributionOverride (the employee's standing override) or ContributionOverride (a one-off override for this pay period only). Only set on the group contribution line; null elsewhere."
          },
          "basis": {
            "type": "string",
            "nullable": true,
            "description": "Pensionable | QualifyingEarnings"
          },
          "employerContributionType": {
            "type": "string",
            "enum": [
              "Percentage",
              "FixedAmount"
            ],
            "description": "How the employer share is read. Null on lines with no employer share (additional voluntary contribution lines)."
          },
          "employerContributionValue": {
            "type": "number",
            "format": "decimal",
            "nullable": true,
            "description": "The employer percentage when employerContributionType is Percentage, or the employer per-period amount when it is FixedAmount."
          },
          "nationalInsuranceSavingsFactor": {
            "type": "number",
            "format": "decimal",
            "nullable": true,
            "description": "Share (0-100) of the employer's NI saving added to the pension under salary sacrifice."
          },
          "employerRefundAmount": {
            "type": "number",
            "format": "decimal",
            "nullable": true,
            "description": "The employer contribution paid back on an opt-out refund line. Set only on internal_pension_refund_* lines. Already netted off forPeriod.employerPension and reported in employerPensionRefundsByType, so it is disclosure and never additive. Ignored on any line the platform did not create."
          },
          "reliefAtSourceApplied": {
            "type": "boolean",
            "nullable": true,
            "description": "Relief at source lines only, whether the scheme's basic-rate relief was netted off the employee's deduction. false means the FULL gross contribution was deducted, because HMRC needs the member's National Insurance number for the scheme to reclaim the relief and this employee has none. That employee's deduction is therefore HIGHER than an identical colleague's while the same amount reaches their pot, which is correct and not a defect. Null where relief at source does not apply (net pay arrangement, salary sacrifice) and on payslips stored before this field existed."
          },
          "reliefAtSourceWithheldReason": {
            "type": "string",
            "enum": [
              "MissingNationalInsuranceNumber"
            ],
            "description": "Why relief at source was withheld when it would otherwise have applied. Null whenever reliefAtSourceApplied is not false."
          },
          "pensionType": {
            "type": "string",
            "nullable": true,
            "description": "The pension type of the scheme the item belongs to. Set on the payslip items of pension contributions, additional voluntary contributions and opt-out refunds; ignored on input."
          }
        }
      },
      "Pay_PeriodOfInactivityDto": {
        "type": "object",
        "required": [
          "fromDate",
          "toDate"
        ],
        "properties": {
          "fromDate": {
            "type": "string",
            "format": "date",
            "description": "From date",
            "example": "2025-01-01"
          },
          "toDate": {
            "type": "string",
            "format": "date",
            "description": "To date",
            "example": "2025-01-31"
          }
        }
      },
      "Pay_PreviousEmploymentEarningsDto": {
        "type": "object",
        "description": "Earnings from a previous employer in the same tax year (P45 previous employment). Only grossTaxable and tax are needed for cumulative tax calculations.",
        "properties": {
          "grossTaxable": {
            "type": "number",
            "format": "decimal",
            "description": "Taxable gross earnings from the previous employer (P45 taxable pay).",
            "example": 15000
          },
          "tax": {
            "type": "number",
            "format": "decimal",
            "description": "Tax paid at the previous employer (P45 tax paid).",
            "example": 3000
          }
        }
      },
      "Pay_ProvisionalRunAllowancesDto": {
        "type": "object",
        "description": "Allowance amounts an open pay run would claim if it locked as it currently stands.",
        "required": [
          "employmentAllowance",
          "apprenticeshipLevyAllowance"
        ],
        "properties": {
          "employmentAllowance": {
            "type": "number",
            "format": "decimal",
            "description": "Employment Allowance this run would claim",
            "example": 1250
          },
          "apprenticeshipLevyAllowance": {
            "type": "number",
            "format": "decimal",
            "description": "Apprenticeship Levy allowance this run would use",
            "example": 1250
          }
        }
      },
      "Pay_RecoverableAmountsY2025To2026Dto": {
        "type": "object",
        "description": "Statutory payments and CIS deductions the employer recovers: the shape read for tax years\n2024/25 and 2025/26 (`HmrcTaxYearFactory.GetEpsTaxYearShape`).",
        "properties": {
          "taxMonth": {
            "type": "integer",
            "format": "int32",
            "description": "The tax month (1 to 12) the recovered amounts are year to date at.",
            "example": 1
          },
          "smpRecovered": {
            "$ref": "#/components/schemas/Pay_StatutoryPaymentsReclaimDto",
            "nullable": true,
            "description": "Statutory Maternity Pay recovered year to date."
          },
          "sppRecovered": {
            "$ref": "#/components/schemas/Pay_StatutoryPaymentsReclaimDto",
            "nullable": true,
            "description": "Statutory Paternity Pay recovered year to date."
          },
          "sapRecovered": {
            "$ref": "#/components/schemas/Pay_StatutoryPaymentsReclaimDto",
            "nullable": true,
            "description": "Statutory Adoption Pay recovered year to date."
          },
          "shPPRecovered": {
            "$ref": "#/components/schemas/Pay_StatutoryPaymentsReclaimDto",
            "nullable": true,
            "description": "Statutory Shared Parental Pay recovered year to date."
          },
          "spbpRecovered": {
            "$ref": "#/components/schemas/Pay_StatutoryPaymentsReclaimDto",
            "nullable": true,
            "description": "Statutory Parental Bereavement Pay recovered year to date."
          },
          "sncpRecovered": {
            "$ref": "#/components/schemas/Pay_StatutoryPaymentsReclaimDto",
            "nullable": true,
            "description": "Statutory Neonatal Care Pay recovered year to date."
          },
          "cisDeductionsSuffered": {
            "type": "number",
            "format": "decimal",
            "description": "CIS deductions suffered year to date.",
            "example": 50
          }
        }
      },
      "Pay_RecoverableAmountsY2026To2027Dto": {
        "type": "object",
        "description": "Statutory payments and CIS deductions the employer recovers, with Northern Ireland Statutory\nParental Bereavement Pay on its own: the shape read for tax years 2026/27 and 2027/28\n(`HmrcTaxYearFactory.GetEpsTaxYearShape`).",
        "properties": {
          "taxMonth": {
            "type": "integer",
            "format": "int32",
            "description": "The tax month (1 to 12) the recovered amounts are year to date at.",
            "example": 1
          },
          "smpRecovered": {
            "$ref": "#/components/schemas/Pay_StatutoryPaymentsReclaimDto",
            "nullable": true,
            "description": "Statutory Maternity Pay recovered year to date."
          },
          "sppRecovered": {
            "$ref": "#/components/schemas/Pay_StatutoryPaymentsReclaimDto",
            "nullable": true,
            "description": "Statutory Paternity Pay recovered year to date."
          },
          "sapRecovered": {
            "$ref": "#/components/schemas/Pay_StatutoryPaymentsReclaimDto",
            "nullable": true,
            "description": "Statutory Adoption Pay recovered year to date."
          },
          "shPPRecovered": {
            "$ref": "#/components/schemas/Pay_StatutoryPaymentsReclaimDto",
            "nullable": true,
            "description": "Statutory Shared Parental Pay recovered year to date."
          },
          "spbpRecovered": {
            "$ref": "#/components/schemas/Pay_StatutoryPaymentsReclaimDto",
            "nullable": true,
            "description": "Statutory Parental Bereavement Pay recovered year to date."
          },
          "spbpRecoveredInNorthernIreland": {
            "$ref": "#/components/schemas/Pay_StatutoryPaymentsReclaimDto",
            "nullable": true,
            "description": "Northern Ireland Statutory Parental Bereavement Pay recovered year to date."
          },
          "sncpRecovered": {
            "$ref": "#/components/schemas/Pay_StatutoryPaymentsReclaimDto",
            "nullable": true,
            "description": "Statutory Neonatal Care Pay recovered year to date."
          },
          "cisDeductionsSuffered": {
            "type": "number",
            "format": "decimal",
            "description": "CIS deductions suffered year to date.",
            "example": 50
          }
        }
      },
      "Pay_RecurringLineItemMetadataSectionDto": {
        "type": "object",
        "description": "The recurring line item a payroll line was generated from.",
        "properties": {
          "recurringLineItemId": {
            "type": "string",
            "nullable": true,
            "description": "The id of the recurring line item this line was generated from."
          },
          "protectedEarningsSetting": {
            "type": "string",
            "nullable": true,
            "description": "The protected earnings rule applied to this recurring deduction."
          },
          "protectedEarningsAmount": {
            "type": "number",
            "format": "decimal",
            "nullable": true,
            "description": "The take-home pay to leave the employee, in pounds, when protectedEarningsSetting is FixedAmount."
          },
          "protectedEarningsPercentage": {
            "type": "number",
            "format": "decimal",
            "nullable": true,
            "description": "The percentage (0 to 100) of take-home pay to leave the employee when protectedEarningsSetting is CustomPercentage."
          }
        }
      },
      "Pay_ResponseBody": {
        "type": "object",
        "required": [
          "message"
        ],
        "properties": {
          "message": {
            "$ref": "#/components/schemas/Pay_MessageWithTokenResponse",
            "description": "A readable message about the outcome and a stable token a client can branch on."
          },
          "content": {
            "type": "object",
            "required": [
              "metadata"
            ],
            "properties": {
              "data": {
                "description": "The resource or list the request asked for; left out when there is none."
              },
              "metadata": {
                "type": "object",
                "required": [
                  "dateFormat",
                  "dateTimeFormat"
                ],
                "properties": {
                  "dateFormat": {
                    "type": "string",
                    "description": "The format of the dates in this response, yyyy-MM-dd."
                  },
                  "dateTimeFormat": {
                    "type": "string",
                    "description": "The format of the timestamps in this response, yyyy-MM-ddTHH:mm:ss.fffZ in UTC."
                  },
                  "paginationToken": {
                    "type": "string",
                    "nullable": true,
                    "description": "Send this value back as the paginationToken query parameter to get the next page; absent when there are no more pages."
                  }
                },
                "description": "The date formats the response uses and, on a paged list, the token for the next page."
              }
            },
            "description": "The data the request returns with its metadata; left out on a response that carries no data, such as most errors."
          },
          "validationIssues": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Pay_ValidationIssue"
            },
            "nullable": true,
            "description": "Each field the request was refused for and why; left out when the request was not refused for its fields."
          }
        }
      },
      "Pay_ScheduledWeekDto": {
        "type": "object",
        "description": "The working days for a single calendar week within an explicit schedule.",
        "required": [
          "weekCommencing",
          "workingDays"
        ],
        "properties": {
          "weekCommencing": {
            "type": "string",
            "description": "The date this week starts on (any weekday; a 7-day block). Format YYYY-MM-DD.",
            "example": "2026-07-06"
          },
          "workingDays": {
            "$ref": "#/components/schemas/Pay_StandardWorkingDaysDto",
            "description": "Which days of that week are worked."
          }
        }
      },
      "Pay_SendEpsRequestDto": {
        "description": "Read in the shape of the tax year in the path: SendEpsRequestY2025To2026Dto for 2024/25, 2025/26; SendEpsRequestY2026To2027Dto for 2026/27, 2027/28.",
        "oneOf": [
          {
            "$ref": "#/components/schemas/Pay_SendEpsRequestY2025To2026Dto"
          },
          {
            "$ref": "#/components/schemas/Pay_SendEpsRequestY2026To2027Dto"
          }
        ]
      },
      "Pay_SendEpsRequestY2025To2026Dto": {
        "type": "object",
        "properties": {
          "taxMonth": {
            "type": "integer",
            "format": "int32",
            "description": "The tax month (1 runs 6 April to 5 May, 12 runs 6 March to 5 April) whose end date is reported as the EPS period end."
          },
          "taxYear": {
            "type": "integer",
            "format": "int32",
            "description": "The year the tax year starts in (2025 for 2025/26), reported as the EPS related tax year."
          },
          "finalSubmissionDetails": {
            "$ref": "#/components/schemas/Pay_FinalSubmissionDetailsY2024To2026Dto",
            "nullable": true,
            "description": "Marks the EPS as the final submission for the tax year, with the employer's year-end declarations."
          },
          "noPaymentForPeriod": {
            "$ref": "#/components/schemas/Pay_NoPaymentForPeriodDto",
            "nullable": true,
            "description": "The dates of a period in which no employees were paid, reported to HMRC as no payment for period."
          },
          "periodOfInactivity": {
            "$ref": "#/components/schemas/Pay_PeriodOfInactivityDto",
            "nullable": true,
            "description": "The dates of a period in which the employer expects to pay no employees, reported to HMRC as a period of inactivity."
          },
          "employmentAllowance": {
            "$ref": "#/components/schemas/Pay_EmploymentAllowanceY2025To2026Dto",
            "nullable": true,
            "description": "Whether the employer claims Employment Allowance, read in the shape of the tax year in the route (up to 2025/26 it also carries the employer's sectors for the de minimis state aid declaration)."
          },
          "recoverableAmounts": {
            "$ref": "#/components/schemas/Pay_RecoverableAmountsY2025To2026Dto",
            "nullable": true,
            "description": "The year-to-date statutory payments and CIS deductions the employer recovers, read in the shape of the tax year in the route."
          },
          "apprenticeshipLevy": {
            "$ref": "#/components/schemas/Pay_ApprenticeshipLevyDto",
            "nullable": true,
            "description": "The Apprenticeship Levy due year to date and the annual allowance, reported to HMRC on the EPS."
          }
        },
        "description": "The body read when the path's tax year is 2024/25, 2025/26."
      },
      "Pay_SendEpsRequestY2026To2027Dto": {
        "type": "object",
        "properties": {
          "taxMonth": {
            "type": "integer",
            "format": "int32",
            "description": "The tax month (1 runs 6 April to 5 May, 12 runs 6 March to 5 April) whose end date is reported as the EPS period end."
          },
          "taxYear": {
            "type": "integer",
            "format": "int32",
            "description": "The year the tax year starts in (2025 for 2025/26), reported as the EPS related tax year."
          },
          "finalSubmissionDetails": {
            "$ref": "#/components/schemas/Pay_FinalSubmissionDetailsY2024To2026Dto",
            "nullable": true,
            "description": "Marks the EPS as the final submission for the tax year, with the employer's year-end declarations."
          },
          "noPaymentForPeriod": {
            "$ref": "#/components/schemas/Pay_NoPaymentForPeriodDto",
            "nullable": true,
            "description": "The dates of a period in which no employees were paid, reported to HMRC as no payment for period."
          },
          "periodOfInactivity": {
            "$ref": "#/components/schemas/Pay_PeriodOfInactivityDto",
            "nullable": true,
            "description": "The dates of a period in which the employer expects to pay no employees, reported to HMRC as a period of inactivity."
          },
          "employmentAllowance": {
            "$ref": "#/components/schemas/Pay_EmploymentAllowanceY2026To2027Dto",
            "nullable": true,
            "description": "Whether the employer claims Employment Allowance, read in the shape of the tax year in the route (up to 2025/26 it also carries the employer's sectors for the de minimis state aid declaration)."
          },
          "recoverableAmounts": {
            "$ref": "#/components/schemas/Pay_RecoverableAmountsY2026To2027Dto",
            "nullable": true,
            "description": "The year-to-date statutory payments and CIS deductions the employer recovers, read in the shape of the tax year in the route."
          },
          "apprenticeshipLevy": {
            "$ref": "#/components/schemas/Pay_ApprenticeshipLevyDto",
            "nullable": true,
            "description": "The Apprenticeship Levy due year to date and the annual allowance, reported to HMRC on the EPS."
          }
        },
        "description": "The body read when the path's tax year is 2026/27, 2027/28."
      },
      "Pay_ShiftDto": {
        "type": "object",
        "description": "One shift within a rotation: the days worked, and how long the shift lasts before the rotation moves on to the next entry in the list.",
        "required": [
          "name",
          "workingDays"
        ],
        "properties": {
          "name": {
            "type": "string",
            "description": "Name of the shift",
            "example": "Morning Shift"
          },
          "workingDays": {
            "$ref": "#/components/schemas/Pay_StandardWorkingDaysDto",
            "description": "Working days configuration for this shift"
          },
          "durationInDays": {
            "type": "integer",
            "format": "int32",
            "description": "How many days this shift lasts before the next one starts. Use 7 for a shift covering a whole week.",
            "example": 5
          }
        }
      },
      "Pay_ShiftPatternDto": {
        "type": "object",
        "description": "A repeating shift rotation. \"Custom\" spells the rotation out as an ordered list of shifts: starting on rotationStartDate, each shift runs for its durationInDays and the list then repeats from the top, so the cycle length is the sum of the durations. Every other patternType is a named rotation whose shape is built in, and ignores shifts.",
        "required": [
          "rotationStartDate",
          "shifts"
        ],
        "properties": {
          "rotationStartDate": {
            "type": "string",
            "format": "date",
            "description": "The date when the shift pattern rotation begins",
            "example": "2024-01-01"
          },
          "shifts": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Pay_ShiftDto"
            },
            "description": "The shifts making up one cycle, in the order they are worked. Only read when patternType is \"Custom\".",
            "example": [
              {
                "name": "Morning Shift",
                "workingDays": {
                  "monday": true,
                  "tuesday": true,
                  "wednesday": true,
                  "thursday": true,
                  "friday": true,
                  "saturday": false,
                  "sunday": false
                },
                "durationInDays": 5
              },
              {
                "name": "Night Shift",
                "workingDays": {
                  "monday": true,
                  "tuesday": true,
                  "wednesday": true,
                  "thursday": true,
                  "friday": true,
                  "saturday": false,
                  "sunday": false
                },
                "durationInDays": 5
              }
            ]
          },
          "patternType": {
            "type": "string",
            "enum": [
              "Custom",
              "FourFourFive",
              "FourOnFourOff",
              "ThreeOnThreeOff",
              "TwoOnTwoOff",
              "FiveOnTwoOff"
            ],
            "description": "Type of shift pattern",
            "example": "FourOnFourOff"
          }
        }
      },
      "Pay_ShiftPatternDtoMergePatch": {
        "type": "object",
        "properties": {
          "rotationStartDate": {
            "type": "string",
            "nullable": true,
            "format": "date",
            "description": "The date when the shift pattern rotation begins",
            "example": "2024-01-01"
          },
          "shifts": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Pay_ShiftDto"
            },
            "nullable": true,
            "description": "The shifts making up one cycle, in the order they are worked. Only read when patternType is \"Custom\".",
            "example": [
              {
                "name": "Morning Shift",
                "workingDays": {
                  "monday": true,
                  "tuesday": true,
                  "wednesday": true,
                  "thursday": true,
                  "friday": true,
                  "saturday": false,
                  "sunday": false
                },
                "durationInDays": 5
              },
              {
                "name": "Night Shift",
                "workingDays": {
                  "monday": true,
                  "tuesday": true,
                  "wednesday": true,
                  "thursday": true,
                  "friday": true,
                  "saturday": false,
                  "sunday": false
                },
                "durationInDays": 5
              }
            ]
          },
          "patternType": {
            "type": "string",
            "enum": [
              "Custom",
              "FourFourFive",
              "FourOnFourOff",
              "ThreeOnThreeOff",
              "TwoOnTwoOff",
              "FiveOnTwoOff"
            ],
            "description": "Type of shift pattern",
            "example": "FourOnFourOff"
          }
        }
      },
      "Pay_StandardWorkingDaysDto": {
        "type": "object",
        "description": "Standard working days configuration",
        "properties": {
          "monday": {
            "type": "boolean",
            "description": "Whether Monday is a working day",
            "example": true
          },
          "tuesday": {
            "type": "boolean",
            "description": "Whether Tuesday is a working day",
            "example": true
          },
          "wednesday": {
            "type": "boolean",
            "description": "Whether Wednesday is a working day",
            "example": true
          },
          "thursday": {
            "type": "boolean",
            "description": "Whether Thursday is a working day",
            "example": true
          },
          "friday": {
            "type": "boolean",
            "description": "Whether Friday is a working day",
            "example": true
          },
          "saturday": {
            "type": "boolean",
            "description": "Whether Saturday is a working day",
            "example": false
          },
          "sunday": {
            "type": "boolean",
            "description": "Whether Sunday is a working day",
            "example": false
          }
        }
      },
      "Pay_StandardWorkingDaysDtoMergePatch": {
        "type": "object",
        "properties": {
          "monday": {
            "type": "boolean",
            "nullable": true,
            "description": "Whether Monday is a working day",
            "example": true
          },
          "tuesday": {
            "type": "boolean",
            "nullable": true,
            "description": "Whether Tuesday is a working day",
            "example": true
          },
          "wednesday": {
            "type": "boolean",
            "nullable": true,
            "description": "Whether Wednesday is a working day",
            "example": true
          },
          "thursday": {
            "type": "boolean",
            "nullable": true,
            "description": "Whether Thursday is a working day",
            "example": true
          },
          "friday": {
            "type": "boolean",
            "nullable": true,
            "description": "Whether Friday is a working day",
            "example": true
          },
          "saturday": {
            "type": "boolean",
            "nullable": true,
            "description": "Whether Saturday is a working day",
            "example": false
          },
          "sunday": {
            "type": "boolean",
            "nullable": true,
            "description": "Whether Sunday is a working day",
            "example": false
          }
        }
      },
      "Pay_StatutoryPaymentsReclaimBalanceDto": {
        "type": "object",
        "properties": {
          "reclaimed": {
            "type": "number",
            "format": "decimal",
            "description": "Amount reclaimed this tax year",
            "example": 100
          },
          "nicCompensationRecovered": {
            "type": "number",
            "format": "decimal",
            "description": "National Insurance contribution compensation recovered this tax year",
            "example": 50
          }
        }
      },
      "Pay_StatutoryPaymentsReclaimDto": {
        "type": "object",
        "properties": {
          "reclaimed": {
            "type": "number",
            "format": "decimal",
            "description": "Amount reclaimed this tax year",
            "example": 100
          },
          "nicCompensationRecovered": {
            "type": "number",
            "format": "decimal",
            "description": "National Insurance contribution compensation recovered this tax year",
            "example": 50
          }
        }
      },
      "Pay_TagDto": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "description": "The tag's name within its group.",
            "example": "FullTime"
          },
          "group": {
            "type": "string",
            "description": "The group the tag belongs to.",
            "example": "EmploymentType"
          },
          "value": {
            "type": "string",
            "description": "The tag's value for that name.",
            "example": "FullTime"
          }
        }
      },
      "Pay_TaxReferenceNumbersDto": {
        "type": "object",
        "required": [
          "employerPayeReference",
          "accountsOfficeReference"
        ],
        "properties": {
          "employerPayeReference": {
            "$ref": "#/components/schemas/Pay_PayeReferenceNumberDto",
            "description": "The employer PAYE reference, split into the HMRC tax office number and the reference."
          },
          "accountsOfficeReference": {
            "type": "string",
            "description": "Accounts office reference.",
            "example": "123PX00123456"
          },
          "selfAssessmentUniqueTaxpayerReference": {
            "type": "string",
            "nullable": true,
            "description": "Self assessment unique taxpayer reference.",
            "example": "1234567890"
          },
          "corporationTaxReferenceUniqueTaxpayerReference": {
            "type": "string",
            "nullable": true,
            "description": "Corporation tax reference unique taxpayer reference.",
            "example": "1234567890"
          }
        }
      },
      "Pay_TriggerFpsSubmissionRequestDto": {
        "type": "object",
        "description": "Body of the FPS submit and preview request. Both members are optional.",
        "properties": {
          "finalSubmissionDetails": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Pay_FinalSubmissionDetailsY2024To2026Dto"
              }
            ],
            "nullable": true,
            "description": "Final submission details. Required for the last pay period of the tax year, otherwise omit it."
          },
          "lateReason": {
            "type": "string",
            "enum": [
              "NotionalPaymentToExpartByThirdPartyOrOverseasEmployer",
              "NotionalPaymentEmploymentRelatedSecurity",
              "NotionalPaymentOther",
              "PaymentSubjectToClass1NicButP11dP9dForTax",
              "NoRequirementToMaintainADeductionsWorkingSheetOrImpossibleToReportWorkDoneOnTheDay",
              "ReasonableExcuse",
              "CorrectionToEarlierSubmission"
            ],
            "description": "HMRC late reporting reason, when this FPS is sent after the employees' payment date. It is reported on every payment in the submission (HMRC's `Payment/LateReason`) and recorded on the pay run. Omit it when reporting on time. The values map to HMRC's codes: NotionalPaymentToExpartByThirdPartyOrOverseasEmployer (A), NotionalPaymentEmploymentRelatedSecurity (B), NotionalPaymentOther (C), PaymentSubjectToClass1NicButP11dP9dForTax (D), NoRequirementToMaintainADeductionsWorkingSheetOrImpossibleToReportWorkDoneOnTheDay (F), ReasonableExcuse (G), CorrectionToEarlierSubmission (H). The single code letter is also accepted. Code E (micro employer \"on or before\" relaxation) was withdrawn by HMRC on 6 April 2016 and is rejected with 400 `hmrcRtiFpsInvalidLateReason`, as is any other value.",
            "example": "ReasonableExcuse"
          }
        }
      },
      "Pay_UnlockPayrollRunDto": {
        "type": "object",
        "description": "The body of `POST /payroll/{payrollConfigId}/{year}/{period}/unlock`.",
        "properties": {
          "scope": {
            "type": "string",
            "description": "What to reopen: `Full` (every payslip of the run) or `Employees` (the listed employees' payslips only)"
          },
          "employeeIds": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "nullable": true,
            "description": "The employees whose payslips to reopen. Required for the `Employees` scope, ignored otherwise"
          },
          "reason": {
            "type": "string",
            "description": "Why the run is being unlocked. Recorded on the lock cycle and on every payslip version it supersedes. A leaver whose P45 is already issued is reopened like anyone else: the correction reaches HMRC on the next FPS, never as a new P45, and the run's history names them under `leaversWithIssuedP45`"
          }
        }
      },
      "Pay_UnlockPayrollRunResultDto": {
        "type": "object",
        "description": "The answer to `POST /payroll/{payrollConfigId}/{year}/{period}/unlock`: the run that was\nasked for, and every later locked run of the payroll config reopened with it.",
        "required": [
          "payrollRun",
          "alsoUnlocked"
        ],
        "properties": {
          "payrollRun": {
            "$ref": "#/components/schemas/Pay_PayrollRunEntryDto",
            "description": "The run that was unlocked, as reopened"
          },
          "alsoUnlocked": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Pay_PayrollRunEntryDto"
            },
            "description": "The later locked runs of the payroll config reopened with it, latest first. Their payslips were calculated from this run's cumulatives, so they take its changes and are locked again in period order, after it. Empty when it was the latest locked run"
          }
        }
      },
      "Pay_UpdatableEmployeeDto": {
        "type": "object",
        "required": [
          "name",
          "email",
          "birthGender",
          "birthDate",
          "hoursWorkedCategory"
        ],
        "properties": {
          "name": {
            "$ref": "#/components/schemas/Pay_EmployeeNameDto",
            "description": "The employee's name as reported to HMRC; the first and last names are required, each 1 to 35 characters starting with a letter."
          },
          "email": {
            "type": "string",
            "format": "email",
            "description": "The employee's primary email address; required, it must be a valid email address and is the address payslip emails are sent to.",
            "example": "john.smith@company.com"
          },
          "taxCodesPerYear": {
            "type": "object",
            "additionalProperties": {
              "type": "array",
              "items": {
                "$ref": "#/components/schemas/Pay_EmployeeTaxCodeDto"
              }
            },
            "description": "Tax codes for the employee per tax year",
            "example": {
              "2025": [
                {
                  "code": "1257L",
                  "effectiveDate": "2025-04-06",
                  "reason": "HMRC Update",
                  "issuedBy": "HMRC",
                  "week1Month1": false
                }
              ]
            }
          },
          "niDetails": {
            "$ref": "#/components/schemas/Pay_EmployeeNiDto",
            "nullable": true,
            "description": "National Insurance details for the employee"
          },
          "birthGender": {
            "type": "string",
            "enum": [
              "Male",
              "Female"
            ],
            "description": "The gender reported to HMRC for the employee on the FPS; required.",
            "example": "Male"
          },
          "phone": {
            "type": "string",
            "nullable": true,
            "description": "The employee's primary phone number, stored as sent and carried on the payslip's recipient details."
          },
          "birthDate": {
            "type": "string",
            "format": "date",
            "description": "The employee's date of birth (YYYY-MM-DD); required, and the employee must be between 12 and 120 years old.",
            "example": "1985-07-23"
          },
          "maritalStatus": {
            "type": "string",
            "enum": [
              "Single",
              "Married",
              "Divorced",
              "Widowed",
              "CivilPartnership",
              "FormerCivilPartnership",
              "SurvivorCivilPartnership"
            ],
            "description": "The employee's marital status; optional, and refused when it is not one of the listed values.",
            "example": "Married"
          },
          "hoursWorkedCategory": {
            "type": "string",
            "enum": [
              "UpTo16Hours",
              "From16To24Hours",
              "From24To30Hours",
              "Above30Hours",
              "Other"
            ],
            "description": "The band of normal weekly hours the employee works, reported to HMRC on the FPS; required.",
            "example": "Above30Hours"
          },
          "salary": {
            "type": "number",
            "format": "decimal",
            "nullable": true,
            "description": "Deprecated as input on PUT and PATCH: record salary changes with PUT /employees/{employeeId}/salary instead, which keeps an effective-dated history the pay run pro-rates from. While still accepted, a value that differs from the salary in force today updates the most recent salary version in place; null or absent leaves the history untouched. Accepted unchanged on POST /employees, where it becomes the first salary version effective from the start date. Always populated on responses as the annual salary in force today (or the earliest version when every version is still in the future). Will be removed from input in a future version.\n",
            "example": 35000
          },
          "employeeCode": {
            "type": "string",
            "nullable": true,
            "description": "Employee code. An optional identifier for the employee.",
            "example": "EMP001"
          },
          "secondaryEmail": {
            "type": "string",
            "nullable": true,
            "format": "email",
            "description": "An optional second email address for the employee, checked as an email address when sent.",
            "example": "john.secondary@company.com"
          },
          "address": {
            "$ref": "#/components/schemas/Pay_AddressDto",
            "nullable": true,
            "description": "The employee's home address, reported to HMRC on the FPS; line1, line2, county and city are its address lines."
          },
          "bankAccounts": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Pay_BankAccountDto"
            },
            "nullable": true,
            "description": "The employee's bank accounts; exactly one must be the primary payroll account, and with more than one their allocation percentages must add up to 100."
          },
          "studentDetails": {
            "$ref": "#/components/schemas/Pay_EmployeeStudentDetailsDto",
            "nullable": true,
            "description": "The employee's student loan and postgraduate loan plans, with the dates each starts and ends."
          },
          "tags": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Pay_TagDto"
            },
            "nullable": true,
            "description": "Tags on the employee, copied onto the employee details of each payslip."
          },
          "previousEmployment": {
            "type": "object",
            "additionalProperties": {
              "$ref": "#/components/schemas/Pay_PreviousEmploymentEarningsDto"
            },
            "description": "Earnings from a previous employer in the same tax year. Used for cumulative tax calculations only. Does not affect FPS reporting.",
            "example": {
              "2026": {
                "grossTaxable": 15000,
                "tax": 3000
              }
            }
          },
          "gender": {
            "type": "string",
            "nullable": true,
            "description": "The employee's gender as free text, stored and returned as sent; birthGender is the value reported to HMRC.",
            "example": "Male"
          },
          "secondaryPhone": {
            "type": "string",
            "nullable": true,
            "description": "An optional second phone number for the employee, stored and returned as sent."
          },
          "passportNumber": {
            "type": "string",
            "nullable": true,
            "description": "The employee's passport number, reported to HMRC on the FPS; 1 to 35 letters, numbers, spaces and standard punctuation.",
            "example": "123456789"
          },
          "previousNames": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "nullable": true,
            "description": "Names the employee was previously known by; each must meet the same rules as a name and none may repeat.",
            "example": [
              "John Doe"
            ]
          },
          "directorDetails": {
            "$ref": "#/components/schemas/Pay_EmployeeDirectorDetailsDto",
            "nullable": true,
            "description": "Set when the employee is a director: the director's NI calculation method, appointment date and, once it ends, the end date."
          },
          "isIrregularEmployment": {
            "type": "boolean",
            "nullable": true,
            "description": "Whether the employee is paid on an irregular pattern, reported to HMRC on the FPS; treated as false when absent.",
            "example": false
          },
          "isOffPayrollWorker": {
            "type": "boolean",
            "nullable": true,
            "description": "Whether the worker is engaged under the off-payroll working rules (IR35), reported to HMRC on the FPS; treated as false when absent.",
            "example": false
          },
          "workplaceDetails": {
            "$ref": "#/components/schemas/Pay_EmployeeWorkplaceDetailsDto",
            "nullable": true,
            "description": "Where the employee works; its workplace postcode is reported to HMRC on the FPS."
          },
          "workingDays": {
            "$ref": "#/components/schemas/Pay_WorkingDaysConfigurationDto",
            "nullable": true,
            "description": "The employee's working pattern in force today; its dated history is kept by the employee working pattern endpoints."
          },
          "partnerDetails": {
            "$ref": "#/components/schemas/Pay_EmployeePartnerDetailsDto",
            "nullable": true,
            "description": "The employee's partner, reported to HMRC on the FPS with the first payment of Shared Parental Pay."
          },
          "department": {
            "type": "string",
            "nullable": true,
            "description": "The employee's department as free text, copied onto the employee details of each payslip.",
            "example": "Engineering"
          },
          "jobTitle": {
            "type": "string",
            "nullable": true,
            "description": "The employee's job title as free text, copied onto the employee details of each payslip.",
            "example": "Software Engineer"
          }
        }
      },
      "Pay_UpdatableGovernmentGatewaySettingsDto": {
        "type": "object",
        "required": [
          "hmrcSubmissionMethod"
        ],
        "properties": {
          "credentials": {
            "$ref": "#/components/schemas/Pay_CreateGovernmentGatewayCretentialsDto",
            "nullable": true,
            "description": "Organisation credentials. Required when hmrcSubmissionMethod is Direct; omit or null when Agent."
          },
          "hmrcSubmissionMethod": {
            "type": "string",
            "enum": [
              "Agent",
              "Direct"
            ],
            "description": "Whether RTI submissions are signed with the organisation's own credentials (Direct) or with agentCredentials (Agent); it decides which of the two is required.",
            "example": "Direct"
          },
          "agentCredentials": {
            "$ref": "#/components/schemas/Pay_CreateAgentGovernmentGatewayCretentialsDto",
            "nullable": true,
            "description": "Agent credentials. Required when hmrcSubmissionMethod is Agent; omit or null when Direct."
          }
        }
      },
      "Pay_UpdatableHmrcSettingsDto": {
        "type": "object",
        "required": [
          "taxReferenceNumbers",
          "governmentGatewaySettings"
        ],
        "properties": {
          "taxReferenceNumbers": {
            "$ref": "#/components/schemas/Pay_TaxReferenceNumbersDto",
            "description": "The employer's HMRC tax references; required on every save."
          },
          "governmentGatewaySettings": {
            "$ref": "#/components/schemas/Pay_UpdatableGovernmentGatewaySettingsDto",
            "description": "How the organisation submits RTI returns to HMRC and the Government Gateway credentials it uses; required on every save."
          },
          "isCisContractor": {
            "type": "boolean",
            "nullable": true,
            "description": "Whether the organisation is a CIS(Construction Industry Scheme) contractor",
            "example": false
          },
          "employmentAllowanceSettings": {
            "$ref": "#/components/schemas/Pay_EmploymentAllowanceSettingsDto",
            "nullable": true,
            "description": "The Employment Allowance claim settings; leave out to keep the stored settings."
          },
          "apprenticeshipLevySettings": {
            "$ref": "#/components/schemas/Pay_ApprenticeshipLevySettingsDto",
            "nullable": true,
            "description": "The Apprenticeship Levy settings; leave out to keep the stored settings."
          },
          "bankAccount": {
            "$ref": "#/components/schemas/Pay_OrganisationBankAccountDto",
            "nullable": true,
            "description": "The organisation's bank account for repayments from HMRC; leave out to keep the stored account."
          },
          "hasSmallEmployerRelief": {
            "type": "boolean",
            "nullable": true,
            "description": "Whether the organisation has a small employer relief",
            "example": false
          },
          "payeLiabilitySettings": {
            "$ref": "#/components/schemas/Pay_PayeLiabilitySettingsDto",
            "nullable": true,
            "description": "How often the organisation pays its PAYE liability to HMRC; leave out to keep the stored settings."
          }
        }
      },
      "Pay_UpdatableOrganisationInformationDto": {
        "type": "object",
        "required": [
          "name",
          "organisationType",
          "companyRegistrationNumber",
          "businessType",
          "registredOfficeAddress",
          "correspondenceAddress",
          "companyContactDetails",
          "primaryContactDetails"
        ],
        "properties": {
          "name": {
            "$ref": "#/components/schemas/Pay_OrganisationNameDto",
            "description": "The organisation's legal name and optional trading name."
          },
          "organisationType": {
            "type": "string",
            "enum": [
              "Parent",
              "Subsidiary",
              "Independent",
              "Franchise",
              "Branch"
            ],
            "description": "Organisation type of the organisation"
          },
          "companyRegistrationNumber": {
            "type": "string",
            "description": "Company Registration Number (CRN), also known as a Companies House number, is a unique identifier assigned to a company when it's registered with Companies House. It's essentially a way to distinguish one company from another and verify its existence",
            "example": "12345678"
          },
          "businessType": {
            "type": "string",
            "enum": [
              "LimitedCompany",
              "LimitedLiabilityPartnership",
              "SoleTrader",
              "Partnership",
              "Charity",
              "PublicSector"
            ],
            "description": "Business type of the organisation",
            "example": "LimitedCompany"
          },
          "registredOfficeAddress": {
            "$ref": "#/components/schemas/Pay_AddressDto",
            "description": "The organisation's registered office address, printed as the employer address on payslips."
          },
          "correspondenceAddress": {
            "$ref": "#/components/schemas/Pay_AddressDto",
            "description": "The address the organisation receives correspondence at."
          },
          "companyContactDetails": {
            "$ref": "#/components/schemas/Pay_ContactDetailsDto",
            "description": "The organisation's general contact details."
          },
          "primaryContactDetails": {
            "$ref": "#/components/schemas/Pay_ContactDetailsDto",
            "description": "The details of the organisation's main contact person."
          }
        }
      },
      "Pay_UpdatablePayePaymentDto": {
        "type": "object",
        "description": "Request body for recording a PAYE payment",
        "required": [
          "paymentReference",
          "amountPaid",
          "paymentDate"
        ],
        "properties": {
          "paymentReference": {
            "type": "string",
            "description": "The payment reference used",
            "example": "PAYE_2024_001"
          },
          "amountPaid": {
            "type": "number",
            "format": "decimal",
            "description": "The amount paid to HMRC",
            "example": 1500
          },
          "paymentDate": {
            "type": "string",
            "format": "date",
            "description": "The date the payment was made",
            "example": "2024-05-22"
          },
          "notes": {
            "type": "string",
            "nullable": true,
            "description": "Notes about the payment (e.g., how it was made, who made it)",
            "example": "BACS payment via online banking"
          }
        }
      },
      "Pay_UpdatableYearToDateBalancesDto": {
        "type": "object",
        "required": [
          "baseValues",
          "apprenticeshipLevyAllowanceYtd",
          "apprenticeshipLevyYtd",
          "employmentAllowanceYtd"
        ],
        "properties": {
          "baseValues": {
            "$ref": "#/components/schemas/Pay_BaseValuesDto",
            "description": "Opening year-to-date pay, tax, NI and statutory payment totals, added to the totals of the pay runs in the tax year."
          },
          "apprenticeshipLevyAllowanceYtd": {
            "$ref": "#/components/schemas/Pay_AmountUsageDto",
            "description": "Apprenticeship Levy allowance already used and left at the start of the tax year, merged with the allowance the pay runs use."
          },
          "apprenticeshipLevyYtd": {
            "type": "number",
            "format": "decimal",
            "description": "Apprenticeship levy owed YTD",
            "example": 100
          },
          "employmentAllowanceYtd": {
            "$ref": "#/components/schemas/Pay_AmountUsageDto",
            "description": "Employment Allowance already claimed and left at the start of the tax year, merged with the allowance the pay runs claim."
          },
          "cisDeductions": {
            "type": "number",
            "format": "decimal",
            "description": "CIS deductions suffered so far in the tax year, added to the year-to-date total reported on the EPS."
          },
          "statutoryPaymentsReclaims": {
            "type": "object",
            "additionalProperties": {
              "$ref": "#/components/schemas/Pay_StatutoryPaymentsReclaimBalanceDto"
            },
            "description": "Dictionary where keys should be one of the StatutoryTypeEnum values (StatutorySickPay, StatutoryMaternityPay, StatutoryPaternityPay, StatutoryAdoptionPay, SharedParentalPay, StatutoryParentalBereavementPay, StatutorySharedParentalPay, StatutoryNeoNatalCarePay)"
          }
        }
      },
      "Pay_UpdateCsvHeaderMappingRequest": {
        "type": "object",
        "description": "Request body for updating an existing CSV header mapping",
        "required": [
          "mappingName",
          "mappings"
        ],
        "properties": {
          "mappingName": {
            "type": "string",
            "description": "Name of the mapping configuration",
            "example": "Updated Payroll System Export"
          },
          "mappings": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Pay_CsvFieldMapping"
            },
            "description": "Array of CSV header to field mappings"
          }
        }
      },
      "Pay_UpdateOpeningBalanceDto": {
        "type": "object",
        "description": "Request body for updating employee opening balance",
        "properties": {
          "openingBalance": {
            "type": "object",
            "additionalProperties": {
              "$ref": "#/components/schemas/Pay_EmployeeEarningsToDateDto"
            },
            "description": "Opening balance for this employment from a different payroll system (migration)."
          },
          "openingBalanceDirector": {
            "type": "object",
            "additionalProperties": {
              "$ref": "#/components/schemas/Pay_DirectorEarningsToDateDto"
            },
            "description": "Opening balance for director earnings from a different payroll system (migration). Only NI-relevant fields."
          }
        }
      },
      "Pay_UpdatePayElementDto": {
        "type": "object",
        "description": "The body of a pay element update: its settings. The pay element is the one the path names.",
        "required": [
          "description",
          "taxType",
          "niType",
          "payType"
        ],
        "properties": {
          "description": {
            "type": "string",
            "description": "The description of the pay element",
            "example": "Basic Salary"
          },
          "taxType": {
            "type": "string",
            "enum": [
              "Taxable",
              "NonTaxable"
            ],
            "description": "The tax type for the pay element",
            "example": "Taxable"
          },
          "niType": {
            "type": "string",
            "enum": [
              "Niable",
              "NonNiable",
              "EmployerOnly"
            ],
            "description": "The National Insurance type for the pay element",
            "example": "Niable"
          },
          "payType": {
            "type": "string",
            "enum": [
              "Payable",
              "Deductible",
              "Informational"
            ],
            "description": "The pay type for the pay element",
            "example": "Payable"
          },
          "isPensionable": {
            "type": "boolean",
            "description": "Whether the pay element is pensionable",
            "example": true
          },
          "isClass1ANiable": {
            "type": "boolean",
            "description": "Whether the pay element is Class 1A National Insurance liable",
            "example": false
          },
          "accrueHoliday": {
            "type": "boolean",
            "description": "Whether the pay element accrues holiday",
            "example": true
          },
          "subjectToNmwCheck": {
            "type": "boolean",
            "description": "Whether the pay element is subject to National Minimum Wage checks",
            "example": true
          },
          "defaultUnitName": {
            "type": "string",
            "enum": [
              "Hour",
              "Day",
              "Week",
              "Month",
              "Year",
              "Fixed",
              "Informational",
              "Percentage"
            ],
            "description": "The default unit name for the pay element",
            "example": "Hour"
          },
          "defaultPayRate": {
            "type": "number",
            "format": "decimal",
            "nullable": true,
            "description": "The default pay rate for the pay element",
            "example": 15.5
          },
          "defaultUnitValue": {
            "type": "number",
            "format": "decimal",
            "nullable": true,
            "description": "The default unit value for the pay element",
            "example": 1
          },
          "defaultChargeRate": {
            "type": "number",
            "format": "decimal",
            "nullable": true,
            "description": "The default charge rate for the pay element",
            "example": 20
          }
        }
      },
      "Pay_UpdateablePayrollConfigDto": {
        "type": "object",
        "required": [
          "name",
          "description",
          "paymentPeriodConfig",
          "payFrequency"
        ],
        "properties": {
          "name": {
            "type": "string",
            "description": "The name of the payroll configuration; must not be empty."
          },
          "description": {
            "type": "string",
            "description": "A description of the payroll configuration; must not be empty."
          },
          "paymentDateConfig": {
            "$ref": "#/components/schemas/Pay_PaymentDateConfigDto",
            "nullable": true,
            "description": "How the payment date of each pay run is worked out."
          },
          "paymentPeriodConfig": {
            "$ref": "#/components/schemas/Pay_PaymentPeriodConfigDto",
            "description": "How the start and end dates of each pay period are worked out for the pay frequency."
          },
          "payFrequency": {
            "type": "string",
            "enum": [
              "Annual",
              "Monthly",
              "FourWeekly",
              "Fortnightly",
              "Weekly",
              "Daily",
              "Quarterly",
              "BiAnnually"
            ],
            "description": "How often employees on this payroll configuration are paid."
          },
          "tags": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Pay_TagDto"
            },
            "nullable": true,
            "description": "Tags attached to the payroll configuration."
          },
          "processZeroGrossPayslips": {
            "type": "boolean",
            "description": "Whether to process payslips with no line items (zero gross). Defaults to false."
          },
          "includeZeroGrossPayslipsInFps": {
            "type": "boolean",
            "description": "When true (default), payslips with totally-zero values (Gross, Net, Tax, Ni etc all 0) are included in FPS preview AND submission. When false, they are filtered out of both so HMRC never sees zeroed records that have no payment to report. Same flag controls preview and submit (single source of truth — no drift)."
          }
        }
      },
      "Pay_UpsertEmployeeQualifyingDayPolicyRequestDto": {
        "type": "object",
        "description": "Set the employee's SSP qualifying-day policy from a given effective date.",
        "required": [
          "effectiveFrom",
          "mode"
        ],
        "properties": {
          "effectiveFrom": {
            "type": "string",
            "description": "The date this policy takes effect. Format YYYY-MM-DD.",
            "example": "2026-04-06"
          },
          "mode": {
            "type": "string",
            "enum": [
              "DeriveFromPattern",
              "AgreedFixedDays",
              "WednesdayDefault"
            ],
            "description": "How qualifying days are determined.",
            "example": "AgreedFixedDays"
          },
          "agreedQualifyingDays": {
            "$ref": "#/components/schemas/Pay_StandardWorkingDaysDto",
            "nullable": true,
            "description": "The agreed qualifying weekdays; required when mode is \"AgreedFixedDays\"."
          }
        }
      },
      "Pay_UpsertEmployeeSalaryRequestDto": {
        "type": "object",
        "description": "Set the employee's annual salary from a given effective date.",
        "required": [
          "effectiveFrom"
        ],
        "properties": {
          "effectiveFrom": {
            "type": "string",
            "format": "date",
            "description": "The date this salary takes effect. Format YYYY-MM-DD.",
            "example": "2026-04-06"
          },
          "annualSalary": {
            "type": "number",
            "format": "decimal",
            "description": "The annual salary in pounds. 0 states that no salary is paid from this date.",
            "example": 52000
          },
          "reason": {
            "type": "string",
            "nullable": true,
            "description": "Optional note on why the salary changed, shown in the history.",
            "example": "Annual review"
          },
          "contractedHoursPerWeek": {
            "type": "number",
            "format": "decimal",
            "nullable": true,
            "description": "The hours a week the employee is contracted to work at this salary, from 0 to 168. Optional; omit it or send null when no hours are stated. Saving a version replaces it whole, so send the hours again when correcting a version that has them.",
            "example": 37.5
          }
        }
      },
      "Pay_UpsertEmployeeWorkingPatternRequestDto": {
        "type": "object",
        "description": "Set the employee's working pattern from a given effective date.",
        "required": [
          "effectiveFrom",
          "configuration"
        ],
        "properties": {
          "effectiveFrom": {
            "type": "string",
            "description": "The date this pattern takes effect. Format YYYY-MM-DD.",
            "example": "2026-04-06"
          },
          "configuration": {
            "$ref": "#/components/schemas/Pay_WorkingDaysConfigurationDto",
            "description": "The working pattern itself. Supply the sub-object matching its workingPattern."
          }
        }
      },
      "Pay_UpsertScheduledWeeksRequestDto": {
        "type": "object",
        "description": "Feed a batch of scheduled weeks (e.g. from an external scheduler). Merged by week-commencing date, idempotently.",
        "required": [
          "effectiveFrom",
          "weeks"
        ],
        "properties": {
          "effectiveFrom": {
            "type": "string",
            "description": "The effective date of the explicit-schedule version to merge into. Format YYYY-MM-DD.",
            "example": "2026-04-06"
          },
          "weeks": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Pay_ScheduledWeekDto"
            },
            "description": "The weeks to upsert. Each is matched on weekCommencing, so re-sending a week updates it."
          }
        }
      },
      "Pay_ValidationIssue": {
        "type": "object",
        "description": "Field validation item. `reasonToken` is a stable snake_case key for i18n or custom client messages; `reason` is the default English text from the API.",
        "required": [
          "field",
          "reason",
          "reasonToken"
        ],
        "properties": {
          "field": {
            "type": "string",
            "description": "Dot-path of the field (e.g. name.firstName, address.line1)."
          },
          "reason": {
            "type": "string",
            "description": "Default human-readable message."
          },
          "reasonToken": {
            "type": "string",
            "description": "Machine-readable error identifier (snake_case)."
          },
          "reasonTokenArguments": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Pay_ValidationIssueArgument"
            },
            "nullable": true,
            "description": "Values to fill into the client's own wording for reasonToken; absent when the reason has none."
          }
        }
      },
      "Pay_ValidationIssueArgument": {
        "type": "object",
        "required": [
          "name",
          "value"
        ],
        "properties": {
          "name": {
            "type": "string",
            "description": "The name of the value, as a client's wording refers to it."
          },
          "value": {
            "description": "The value itself, as a string, number or other JSON value."
          }
        }
      },
      "Pay_WorkingDaysConfigurationDto": {
        "type": "object",
        "description": "Configuration of employee's working days",
        "properties": {
          "standardWorkingDays": {
            "$ref": "#/components/schemas/Pay_StandardWorkingDaysDto",
            "nullable": true,
            "description": "Standard working days configuration",
            "example": {
              "monday": true,
              "tuesday": true,
              "wednesday": true,
              "thursday": true,
              "friday": true,
              "saturday": false,
              "sunday": false
            }
          },
          "shiftPattern": {
            "$ref": "#/components/schemas/Pay_ShiftPatternDto",
            "nullable": true,
            "description": "Shift pattern configuration (if applicable)",
            "example": {
              "rotationStartDate": "2024-01-01",
              "shifts": [
                {
                  "name": "Morning Shift",
                  "workingDays": {
                    "monday": true,
                    "tuesday": true,
                    "wednesday": true,
                    "thursday": true,
                    "friday": true,
                    "saturday": false,
                    "sunday": false
                  },
                  "durationInDays": 5
                },
                {
                  "name": "Night Shift",
                  "workingDays": {
                    "monday": true,
                    "tuesday": true,
                    "wednesday": true,
                    "thursday": true,
                    "friday": true,
                    "saturday": false,
                    "sunday": false
                  },
                  "durationInDays": 5
                }
              ],
              "patternType": "FourOnFourOff"
            }
          },
          "workingPattern": {
            "type": "string",
            "enum": [
              "Standard",
              "Shift",
              "Explicit"
            ],
            "description": "Type of working pattern",
            "example": "Standard"
          },
          "explicitSchedule": {
            "$ref": "#/components/schemas/Pay_ExplicitScheduleDto",
            "nullable": true,
            "description": "Explicit week-by-week schedule, used when workingPattern is \"Explicit\""
          }
        }
      },
      "Pay_WorkingDaysConfigurationDtoMergePatch": {
        "type": "object",
        "properties": {
          "standardWorkingDays": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Pay_StandardWorkingDaysDtoMergePatch"
              }
            ],
            "nullable": true,
            "description": "Standard working days configuration",
            "example": {
              "monday": true,
              "tuesday": true,
              "wednesday": true,
              "thursday": true,
              "friday": true,
              "saturday": false,
              "sunday": false
            }
          },
          "shiftPattern": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Pay_ShiftPatternDtoMergePatch"
              }
            ],
            "nullable": true,
            "description": "Shift pattern configuration (if applicable)",
            "example": {
              "rotationStartDate": "2024-01-01",
              "shifts": [
                {
                  "name": "Morning Shift",
                  "workingDays": {
                    "monday": true,
                    "tuesday": true,
                    "wednesday": true,
                    "thursday": true,
                    "friday": true,
                    "saturday": false,
                    "sunday": false
                  },
                  "durationInDays": 5
                },
                {
                  "name": "Night Shift",
                  "workingDays": {
                    "monday": true,
                    "tuesday": true,
                    "wednesday": true,
                    "thursday": true,
                    "friday": true,
                    "saturday": false,
                    "sunday": false
                  },
                  "durationInDays": 5
                }
              ],
              "patternType": "FourOnFourOff"
            }
          },
          "workingPattern": {
            "type": "string",
            "enum": [
              "Standard",
              "Shift",
              "Explicit"
            ],
            "description": "Type of working pattern",
            "example": "Standard"
          },
          "explicitSchedule": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Pay_ExplicitScheduleDtoMergePatch"
              }
            ],
            "nullable": true,
            "description": "Explicit week-by-week schedule, used when workingPattern is \"Explicit\""
          }
        }
      },
      "Pay_WorkingPatternDefaultsDto": {
        "type": "object",
        "description": "A default working pattern and SSP qualifying-day policy, used at organisation and payroll-config scope as a fallback for employees with no pattern of their own.",
        "required": [
          "qualifyingDayMode"
        ],
        "properties": {
          "defaultWorkingDays": {
            "$ref": "#/components/schemas/Pay_WorkingDaysConfigurationDto",
            "nullable": true,
            "description": "The default working pattern. Omit to leave this scope with no pattern default."
          },
          "qualifyingDayMode": {
            "type": "string",
            "enum": [
              "DeriveFromPattern",
              "AgreedFixedDays",
              "WednesdayDefault"
            ],
            "description": "How SSP qualifying days are decided for employees falling back to this default."
          },
          "agreedQualifyingDays": {
            "$ref": "#/components/schemas/Pay_StandardWorkingDaysDto",
            "nullable": true,
            "description": "The agreed qualifying weekdays. Required when qualifyingDayMode is \"AgreedFixedDays\"."
          }
        }
      },
      "Pay_YearEndFinalisationDto": {
        "type": "object",
        "required": [
          "organisationId",
          "payrollConfigId",
          "taxYear",
          "finalisedBy",
          "finalisedDate",
          "createdBy",
          "createdDate",
          "updatedBy",
          "updatedDate"
        ],
        "properties": {
          "organisationId": {
            "type": "string",
            "description": "The organisation whose year end was finalised.",
            "example": "ORG-001"
          },
          "payrollConfigId": {
            "type": "string",
            "description": "The payroll configuration whose year end was finalised.",
            "example": "CONFIG-001"
          },
          "taxYear": {
            "type": "integer",
            "format": "int32",
            "description": "The tax year that was finalised, as given in the route.",
            "example": 2025
          },
          "finalisedBy": {
            "type": "string",
            "description": "The user who finalised the year end.",
            "example": "user@example.com"
          },
          "finalisedDate": {
            "type": "string",
            "description": "When the year end was finalised, in UTC.",
            "example": "2025-04-06T10:00:00.000Z"
          },
          "createdBy": {
            "type": "string",
            "description": "The user who created the finalisation record, the same as finalisedBy.",
            "example": "user@example.com"
          },
          "createdDate": {
            "type": "string",
            "description": "When the finalisation record was created, in UTC.",
            "example": "2025-04-06T10:00:00.000Z"
          },
          "updatedBy": {
            "type": "string",
            "description": "The user who last changed the finalisation record.",
            "example": "user@example.com"
          },
          "updatedDate": {
            "type": "string",
            "description": "When the finalisation record was last changed, in UTC.",
            "example": "2025-04-06T10:00:00.000Z"
          }
        }
      },
      "Pay_YearToDateBalancesDto": {
        "allOf": [
          {
            "$ref": "#/components/schemas/Pay_UpdatableYearToDateBalancesDto"
          },
          {
            "type": "object",
            "required": [
              "taxYear",
              "createdDate",
              "createdBy",
              "updatedDate",
              "updatedBy"
            ],
            "properties": {
              "taxYear": {
                "type": "integer",
                "format": "int32",
                "description": "The tax year these balances belong to",
                "example": 2024
              },
              "createdDate": {
                "type": "string",
                "format": "date-time",
                "description": "Creation date",
                "example": "2024-01-01T00:00:00Z"
              },
              "createdBy": {
                "type": "string",
                "description": "User who created the record",
                "example": "user_123"
              },
              "updatedDate": {
                "type": "string",
                "format": "date-time",
                "description": "Last update date",
                "example": "2024-01-02T00:00:00Z"
              },
              "updatedBy": {
                "type": "string",
                "description": "User who last updated the record",
                "example": "user_456"
              }
            }
          }
        ]
      },
      "Statutory_AddStatutoryAttachmentsRequest": {
        "type": "object",
        "properties": {
          "attachments": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Statutory_CreateStatutoryAttachmentRequest"
            }
          }
        },
        "additionalProperties": false
      },
      "Statutory_AlabasterAdjustment": {
        "type": "object",
        "properties": {
          "alabasterAdjustmentId": {
            "type": "string"
          },
          "statutoryPayId": {
            "type": "string"
          },
          "employeeId": {
            "type": "string"
          },
          "organisationId": {
            "type": "string"
          },
          "payRiseEffectiveDate": {
            "type": "string",
            "format": "date"
          },
          "payRiseAmount": {
            "type": "number",
            "format": "double"
          },
          "payRisePercentage": {
            "type": "number",
            "format": "double",
            "nullable": true
          },
          "oldAWE": {
            "type": "number",
            "format": "double"
          },
          "newAWE": {
            "type": "number",
            "format": "double"
          },
          "first6WeeksArrears": {
            "type": "number",
            "format": "double"
          },
          "remainingWeeksAdjustment": {
            "type": "number",
            "format": "double"
          },
          "totalAdjustment": {
            "type": "number",
            "format": "double"
          },
          "eligibilityChanged": {
            "type": "boolean"
          },
          "maternityAllowanceOffset": {
            "type": "number",
            "format": "double",
            "nullable": true
          },
          "status": {
            "enum": [
              "Pending",
              "Applied",
              "Paid"
            ],
            "type": "string"
          },
          "appliedDate": {
            "type": "string",
            "format": "date",
            "nullable": true
          },
          "paidDate": {
            "type": "string",
            "format": "date",
            "nullable": true
          },
          "createdDate": {
            "type": "string",
            "format": "date"
          },
          "createdBy": {
            "type": "string"
          },
          "notes": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Statutory_ApiErrorResponse": {
        "type": "object",
        "properties": {
          "message": {
            "$ref": "#/components/schemas/Statutory_MessageWithTokenResponse"
          },
          "validationIssues": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Statutory_ValidationIssue"
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Statutory_AvailableTaxYearsResponse": {
        "type": "object",
        "properties": {
          "taxYears": {
            "type": "array",
            "items": {
              "type": "integer",
              "format": "int32"
            }
          }
        },
        "additionalProperties": false
      },
      "Statutory_AverageEarningsResponse": {
        "type": "object",
        "properties": {
          "averageEarnings": {
            "type": "number",
            "format": "double"
          },
          "calculationDate": {
            "type": "string",
            "nullable": true
          },
          "payslipStartDate": {
            "type": "string",
            "nullable": true
          },
          "payslipEndDate": {
            "type": "string",
            "nullable": true
          },
          "payslipCount": {
            "type": "integer",
            "format": "int32"
          },
          "message": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Statutory_CalculateStatutoryAdoptionPayRequest": {
        "allOf": [
          {
            "$ref": "#/components/schemas/Statutory_CalculateStatutoryPayRequest"
          },
          {
            "type": "object",
            "properties": {
              "expectedWeekOfPlacement": {
                "type": "string",
                "nullable": true
              }
            },
            "additionalProperties": false
          }
        ]
      },
      "Statutory_CalculateStatutoryMaternityPayRequest": {
        "allOf": [
          {
            "$ref": "#/components/schemas/Statutory_CalculateStatutoryPayRequest"
          },
          {
            "type": "object",
            "properties": {
              "expectedWeekOfChildbirth": {
                "type": "string",
                "nullable": true
              }
            },
            "additionalProperties": false
          }
        ]
      },
      "Statutory_CalculateStatutoryNeoNatalCarePayRequest": {
        "allOf": [
          {
            "$ref": "#/components/schemas/Statutory_CalculateStatutoryPayRequest"
          },
          {
            "type": "object",
            "properties": {
              "dateOfBirthOrExpectedDateOfBirth": {
                "type": "string",
                "nullable": true
              },
              "neonatalCareStartDate": {
                "type": "string",
                "nullable": true
              },
              "neonatalCareEndDate": {
                "type": "string",
                "nullable": true
              }
            },
            "additionalProperties": false
          }
        ]
      },
      "Statutory_CalculateStatutoryParentalBereavementPayRequest": {
        "allOf": [
          {
            "$ref": "#/components/schemas/Statutory_CalculateStatutoryPayRequest"
          },
          {
            "type": "object",
            "properties": {
              "dateOfChildDeath": {
                "type": "string",
                "nullable": true
              }
            },
            "additionalProperties": false
          }
        ]
      },
      "Statutory_CalculateStatutoryPaternityPayRequest": {
        "allOf": [
          {
            "$ref": "#/components/schemas/Statutory_CalculateStatutoryPayRequest"
          },
          {
            "type": "object",
            "properties": {
              "expectedWeekOfChildbirth": {
                "type": "string",
                "nullable": true
              }
            },
            "additionalProperties": false
          }
        ]
      },
      "Statutory_CalculateStatutoryPayRequest": {
        "allOf": [
          {
            "$ref": "#/components/schemas/Statutory_CalculateStatutoryPayRequestBase"
          },
          {
            "required": [
              "statutoryType"
            ],
            "type": "object",
            "properties": {
              "statutoryType": {
                "type": "string"
              }
            },
            "additionalProperties": false,
            "discriminator": {
              "propertyName": "statutoryType",
              "mapping": {
                "StatutoryAdoptionPay": "#/components/schemas/Statutory_CalculateStatutoryAdoptionPayRequest",
                "StatutoryMaternityPay": "#/components/schemas/Statutory_CalculateStatutoryMaternityPayRequest",
                "StatutoryNeoNatalCarePay": "#/components/schemas/Statutory_CalculateStatutoryNeoNatalCarePayRequest",
                "StatutoryParentalBereavementPay": "#/components/schemas/Statutory_CalculateStatutoryParentalBereavementPayRequest",
                "StatutoryPaternityPay": "#/components/schemas/Statutory_CalculateStatutoryPaternityPayRequest",
                "StatutorySharedParentalPay": "#/components/schemas/Statutory_CalculateStatutorySharedParentalPayRequest",
                "StatutorySickPay": "#/components/schemas/Statutory_CalculateStatutorySickPayRequest"
              }
            }
          }
        ]
      },
      "Statutory_CalculateStatutoryPayRequestBase": {
        "required": [
          "statutoryType"
        ],
        "type": "object",
        "properties": {
          "statutoryType": {
            "enum": [
              "None",
              "StatutorySickPay",
              "StatutoryMaternityPay",
              "StatutoryPaternityPay",
              "StatutoryAdoptionPay",
              "StatutoryParentalBereavementPay",
              "StatutorySharedParentalPay",
              "StatutoryNeoNatalCarePay"
            ],
            "type": "string",
            "readOnly": true
          },
          "startDate": {
            "type": "string",
            "nullable": true
          },
          "endDate": {
            "type": "string",
            "nullable": true
          },
          "qualifyingEventDate": {
            "type": "string",
            "nullable": true
          },
          "averageEarningsOverride": {
            "type": "number",
            "format": "double",
            "nullable": true
          },
          "attachments": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Statutory_CreateStatutoryAttachmentRequest"
            },
            "nullable": true
          },
          "paidWeeks": {
            "type": "number",
            "format": "double",
            "nullable": true
          },
          "paidUntilDate": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "discriminator": {
          "propertyName": "statutoryType",
          "mapping": {
            "StatutorySickPay": "#/components/schemas/Statutory_CalculateStatutorySickPayRequest",
            "StatutoryMaternityPay": "#/components/schemas/Statutory_CalculateStatutoryMaternityPayRequest",
            "StatutoryPaternityPay": "#/components/schemas/Statutory_CalculateStatutoryPaternityPayRequest",
            "StatutoryAdoptionPay": "#/components/schemas/Statutory_CalculateStatutoryAdoptionPayRequest",
            "StatutoryParentalBereavementPay": "#/components/schemas/Statutory_CalculateStatutoryParentalBereavementPayRequest",
            "StatutorySharedParentalPay": "#/components/schemas/Statutory_CalculateStatutorySharedParentalPayRequest",
            "StatutoryNeoNatalCarePay": "#/components/schemas/Statutory_CalculateStatutoryNeoNatalCarePayRequest"
          }
        }
      },
      "Statutory_CalculateStatutorySharedParentalPayRequest": {
        "allOf": [
          {
            "$ref": "#/components/schemas/Statutory_CalculateStatutoryPayRequest"
          },
          {
            "type": "object",
            "properties": {
              "expectedWeekOfChildbirth": {
                "type": "string",
                "nullable": true
              },
              "expectedWeekOfPlacement": {
                "type": "string",
                "nullable": true
              },
              "isPrimaryParent": {
                "type": "boolean"
              },
              "previousPrimaryPayWeeks": {
                "type": "integer",
                "format": "int32",
                "nullable": true
              },
              "otherParentShppWeeks": {
                "type": "integer",
                "format": "int32",
                "nullable": true
              }
            },
            "additionalProperties": false
          }
        ]
      },
      "Statutory_CalculateStatutorySickPayRequest": {
        "allOf": [
          {
            "$ref": "#/components/schemas/Statutory_CalculateStatutoryPayRequest"
          },
          {
            "type": "object",
            "properties": {
              "isReceivingStatutoryMaternityPay": {
                "type": "boolean"
              },
              "previousSicknessPeriods": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/Statutory_SicknessPeriodDto"
                },
                "nullable": true
              }
            },
            "additionalProperties": false
          }
        ]
      },
      "Statutory_CalculatorOutputItemResponse": {
        "type": "object",
        "properties": {
          "year": {
            "type": "integer",
            "format": "int32"
          },
          "period": {
            "type": "integer",
            "format": "int32"
          },
          "frequency": {
            "type": "string"
          },
          "week": {
            "type": "integer",
            "format": "int32"
          },
          "value": {
            "type": "number",
            "format": "double"
          },
          "nonRoundedValue": {
            "type": "number",
            "format": "double"
          },
          "status": {
            "type": "string"
          }
        },
        "additionalProperties": false
      },
      "Statutory_CalculatorOutputResponse": {
        "allOf": [
          {
            "$ref": "#/components/schemas/Statutory_StatutoryCalculationResponse"
          },
          {
            "required": [
              "statutoryType"
            ],
            "type": "object",
            "properties": {
              "statutoryType": {
                "type": "string"
              }
            },
            "additionalProperties": false,
            "discriminator": {
              "propertyName": "statutoryType",
              "mapping": {
                "StatutoryAdoptionPay": "#/components/schemas/Statutory_StatutoryAdoptionPayCalculationResponse",
                "StatutoryMaternityPay": "#/components/schemas/Statutory_StatutoryMaternityPayCalculationResponse",
                "StatutoryNeoNatalCarePay": "#/components/schemas/Statutory_StatutoryNeoNatalCarePayCalculationResponse",
                "StatutoryParentalBereavementPay": "#/components/schemas/Statutory_StatutoryParentalBereavementPayCalculationResponse",
                "StatutoryPaternityPay": "#/components/schemas/Statutory_StatutoryPaternityPayCalculationResponse",
                "StatutorySharedParentalPay": "#/components/schemas/Statutory_StatutorySharedParentalPayCalculationResponse",
                "StatutorySickPay": "#/components/schemas/Statutory_StatutorySickPayCalculationResponse"
              }
            }
          }
        ]
      },
      "Statutory_CheckLinkingPeriodsRequest": {
        "type": "object",
        "properties": {
          "startDate": {
            "type": "string"
          },
          "endDate": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Statutory_CheckLinkingPeriodsResponse": {
        "type": "object",
        "properties": {
          "isLinked": {
            "type": "boolean"
          },
          "linkedPeriodCount": {
            "type": "integer",
            "format": "int32"
          },
          "totalLinkedWeeks": {
            "type": "integer",
            "format": "int32"
          },
          "remainingSspWeeks": {
            "type": "integer",
            "format": "int32"
          },
          "skipWaitingDays": {
            "type": "boolean"
          }
        },
        "additionalProperties": false
      },
      "Statutory_ClosedPeriodSummaryDto": {
        "type": "object",
        "properties": {
          "year": {
            "type": "integer",
            "format": "int32"
          },
          "period": {
            "type": "integer",
            "format": "int32"
          },
          "payPeriodStartDate": {
            "type": "string"
          },
          "payPeriodEndDate": {
            "type": "string"
          },
          "paymentDate": {
            "type": "string"
          }
        },
        "additionalProperties": false
      },
      "Statutory_ContentMetadataResponse": {
        "type": "object",
        "properties": {
          "dateFormat": {
            "type": "string"
          },
          "dateTimeFormat": {
            "type": "string"
          },
          "paginationToken": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Statutory_ContentResponse_AlabasterAdjustment": {
        "type": "object",
        "properties": {
          "data": {
            "$ref": "#/components/schemas/Statutory_AlabasterAdjustment"
          },
          "metadata": {
            "$ref": "#/components/schemas/Statutory_ContentMetadataResponse"
          }
        },
        "additionalProperties": false
      },
      "Statutory_ContentResponse_AvailableTaxYearsResponse": {
        "type": "object",
        "properties": {
          "data": {
            "$ref": "#/components/schemas/Statutory_AvailableTaxYearsResponse"
          },
          "metadata": {
            "$ref": "#/components/schemas/Statutory_ContentMetadataResponse"
          }
        },
        "additionalProperties": false
      },
      "Statutory_ContentResponse_AverageEarningsResponse": {
        "type": "object",
        "properties": {
          "data": {
            "$ref": "#/components/schemas/Statutory_AverageEarningsResponse"
          },
          "metadata": {
            "$ref": "#/components/schemas/Statutory_ContentMetadataResponse"
          }
        },
        "additionalProperties": false
      },
      "Statutory_ContentResponse_Boolean": {
        "type": "object",
        "properties": {
          "data": {
            "type": "boolean"
          },
          "metadata": {
            "$ref": "#/components/schemas/Statutory_ContentMetadataResponse"
          }
        },
        "additionalProperties": false
      },
      "Statutory_ContentResponse_CalculatorOutputResponse": {
        "type": "object",
        "properties": {
          "data": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/Statutory_StatutoryAdoptionPayCalculationResponse"
              },
              {
                "$ref": "#/components/schemas/Statutory_StatutoryMaternityPayCalculationResponse"
              },
              {
                "$ref": "#/components/schemas/Statutory_StatutoryNeoNatalCarePayCalculationResponse"
              },
              {
                "$ref": "#/components/schemas/Statutory_StatutoryParentalBereavementPayCalculationResponse"
              },
              {
                "$ref": "#/components/schemas/Statutory_StatutoryPaternityPayCalculationResponse"
              },
              {
                "$ref": "#/components/schemas/Statutory_StatutorySharedParentalPayCalculationResponse"
              },
              {
                "$ref": "#/components/schemas/Statutory_StatutorySickPayCalculationResponse"
              }
            ],
            "nullable": true
          },
          "metadata": {
            "$ref": "#/components/schemas/Statutory_ContentMetadataResponse"
          }
        },
        "additionalProperties": false
      },
      "Statutory_ContentResponse_CheckLinkingPeriodsResponse": {
        "type": "object",
        "properties": {
          "data": {
            "$ref": "#/components/schemas/Statutory_CheckLinkingPeriodsResponse"
          },
          "metadata": {
            "$ref": "#/components/schemas/Statutory_ContentMetadataResponse"
          }
        },
        "additionalProperties": false
      },
      "Statutory_ContentResponse_IEnumerable_StatutoryAttachmentResponse": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Statutory_StatutoryAttachmentResponse"
            },
            "nullable": true
          },
          "metadata": {
            "$ref": "#/components/schemas/Statutory_ContentMetadataResponse"
          }
        },
        "additionalProperties": false
      },
      "Statutory_ContentResponse_IEnumerable_StatutoryAttachmentUploadResponse": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Statutory_StatutoryAttachmentUploadResponse"
            },
            "nullable": true
          },
          "metadata": {
            "$ref": "#/components/schemas/Statutory_ContentMetadataResponse"
          }
        },
        "additionalProperties": false
      },
      "Statutory_ContentResponse_IEnumerable_StatutoryPayLineItemResponse": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Statutory_StatutoryPayLineItemResponse"
            },
            "nullable": true
          },
          "metadata": {
            "$ref": "#/components/schemas/Statutory_ContentMetadataResponse"
          }
        },
        "additionalProperties": false
      },
      "Statutory_ContentResponse_IEnumerable_StatutoryPayResponse": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "oneOf": [
                {
                  "$ref": "#/components/schemas/Statutory_StatutorySickPayResponse"
                },
                {
                  "$ref": "#/components/schemas/Statutory_StatutoryMaternityPayResponse"
                },
                {
                  "$ref": "#/components/schemas/Statutory_StatutoryPaternityPayResponse"
                },
                {
                  "$ref": "#/components/schemas/Statutory_StatutoryAdoptionPayResponse"
                },
                {
                  "$ref": "#/components/schemas/Statutory_StatutoryParentalBereavementPayResponse"
                },
                {
                  "$ref": "#/components/schemas/Statutory_StatutorySharedParentalPayResponse"
                },
                {
                  "$ref": "#/components/schemas/Statutory_StatutoryNeoNatalCarePayResponse"
                }
              ],
              "discriminator": {
                "propertyName": "statutoryPayType",
                "mapping": {
                  "StatutorySickPay": "#/components/schemas/Statutory_StatutorySickPayResponse",
                  "StatutoryMaternityPay": "#/components/schemas/Statutory_StatutoryMaternityPayResponse",
                  "StatutoryPaternityPay": "#/components/schemas/Statutory_StatutoryPaternityPayResponse",
                  "StatutoryAdoptionPay": "#/components/schemas/Statutory_StatutoryAdoptionPayResponse",
                  "StatutoryParentalBereavementPay": "#/components/schemas/Statutory_StatutoryParentalBereavementPayResponse",
                  "StatutorySharedParentalPay": "#/components/schemas/Statutory_StatutorySharedParentalPayResponse",
                  "StatutoryNeoNatalCarePay": "#/components/schemas/Statutory_StatutoryNeoNatalCarePayResponse"
                }
              }
            },
            "nullable": true
          },
          "metadata": {
            "$ref": "#/components/schemas/Statutory_ContentMetadataResponse"
          }
        },
        "additionalProperties": false
      },
      "Statutory_ContentResponse_ImportStatutoryPayResponse": {
        "type": "object",
        "properties": {
          "data": {
            "$ref": "#/components/schemas/Statutory_ImportStatutoryPayResponse"
          },
          "metadata": {
            "$ref": "#/components/schemas/Statutory_ContentMetadataResponse"
          }
        },
        "additionalProperties": false
      },
      "Statutory_ContentResponse_List_PayRiseHistoryItem": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Statutory_PayRiseHistoryItem"
            },
            "nullable": true
          },
          "metadata": {
            "$ref": "#/components/schemas/Statutory_ContentMetadataResponse"
          }
        },
        "additionalProperties": false
      },
      "Statutory_ContentResponse_StatutoryHistoryResponse": {
        "type": "object",
        "properties": {
          "data": {
            "$ref": "#/components/schemas/Statutory_StatutoryHistoryResponse"
          },
          "metadata": {
            "$ref": "#/components/schemas/Statutory_ContentMetadataResponse"
          }
        },
        "additionalProperties": false
      },
      "Statutory_ContentResponse_StatutoryPayHistoryResponse": {
        "type": "object",
        "properties": {
          "data": {
            "$ref": "#/components/schemas/Statutory_StatutoryPayHistoryResponse"
          },
          "metadata": {
            "$ref": "#/components/schemas/Statutory_ContentMetadataResponse"
          }
        },
        "additionalProperties": false
      },
      "Statutory_ContentResponse_StatutoryPayResponse": {
        "type": "object",
        "properties": {
          "data": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/Statutory_StatutorySickPayResponse"
              },
              {
                "$ref": "#/components/schemas/Statutory_StatutoryMaternityPayResponse"
              },
              {
                "$ref": "#/components/schemas/Statutory_StatutoryPaternityPayResponse"
              },
              {
                "$ref": "#/components/schemas/Statutory_StatutoryAdoptionPayResponse"
              },
              {
                "$ref": "#/components/schemas/Statutory_StatutoryParentalBereavementPayResponse"
              },
              {
                "$ref": "#/components/schemas/Statutory_StatutorySharedParentalPayResponse"
              },
              {
                "$ref": "#/components/schemas/Statutory_StatutoryNeoNatalCarePayResponse"
              }
            ],
            "nullable": true,
            "discriminator": {
              "propertyName": "statutoryPayType",
              "mapping": {
                "StatutorySickPay": "#/components/schemas/Statutory_StatutorySickPayResponse",
                "StatutoryMaternityPay": "#/components/schemas/Statutory_StatutoryMaternityPayResponse",
                "StatutoryPaternityPay": "#/components/schemas/Statutory_StatutoryPaternityPayResponse",
                "StatutoryAdoptionPay": "#/components/schemas/Statutory_StatutoryAdoptionPayResponse",
                "StatutoryParentalBereavementPay": "#/components/schemas/Statutory_StatutoryParentalBereavementPayResponse",
                "StatutorySharedParentalPay": "#/components/schemas/Statutory_StatutorySharedParentalPayResponse",
                "StatutoryNeoNatalCarePay": "#/components/schemas/Statutory_StatutoryNeoNatalCarePayResponse"
              }
            }
          },
          "metadata": {
            "$ref": "#/components/schemas/Statutory_ContentMetadataResponse"
          }
        },
        "additionalProperties": false
      },
      "Statutory_ContentResponse_StatutoryRatesResponse": {
        "type": "object",
        "properties": {
          "data": {
            "$ref": "#/components/schemas/Statutory_StatutoryRatesResponse"
          },
          "metadata": {
            "$ref": "#/components/schemas/Statutory_ContentMetadataResponse"
          }
        },
        "additionalProperties": false
      },
      "Statutory_CreateStatutoryAttachmentRequest": {
        "type": "object",
        "properties": {
          "filename": {
            "type": "string"
          },
          "contentType": {
            "type": "string"
          },
          "fileSize": {
            "type": "integer",
            "format": "int64"
          }
        },
        "additionalProperties": false
      },
      "Statutory_ExplicitScheduleDto": {
        "type": "object",
        "properties": {
          "weeks": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Statutory_ScheduledWeekDto"
            }
          }
        },
        "additionalProperties": false
      },
      "Statutory_ImportDetailsResponse": {
        "type": "object",
        "properties": {
          "source": {
            "enum": [
              "WizardCreate",
              "WizardImport",
              "ApiCreate",
              "ApiImport",
              "CsvImport"
            ],
            "type": "string"
          },
          "paidUntilDate": {
            "type": "string",
            "nullable": true
          },
          "paidWeeks": {
            "type": "number",
            "format": "double",
            "nullable": true
          },
          "higherRateWeeks": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "higherRateAmount": {
            "type": "number",
            "format": "double",
            "nullable": true
          },
          "standardRateWeeks": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "standardRateAmount": {
            "type": "number",
            "format": "double",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Statutory_ImportStatutoryPayRequest": {
        "type": "object",
        "properties": {
          "statutoryType": {
            "type": "string"
          },
          "startDate": {
            "type": "string"
          },
          "averageWeeklyEarnings": {
            "type": "number",
            "format": "double"
          },
          "endDate": {
            "type": "string",
            "nullable": true
          },
          "paidUntilDate": {
            "type": "string",
            "nullable": true
          },
          "paidWeeks": {
            "type": "number",
            "format": "double",
            "nullable": true
          },
          "qualifyingEventDate": {
            "type": "string",
            "nullable": true
          },
          "requestedStartDate": {
            "type": "string",
            "nullable": true
          },
          "isReceivingStatutoryMaternityPay": {
            "type": "boolean"
          },
          "previousSicknessPeriods": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Statutory_SicknessPeriodDto"
            },
            "nullable": true
          },
          "workingDays": {
            "$ref": "#/components/schemas/Statutory_WorkingDaysConfigurationDto"
          },
          "isPrimaryParent": {
            "type": "boolean"
          },
          "previousPrimaryPayWeeks": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "otherParentShppWeeks": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "neonatalCareStartDate": {
            "type": "string",
            "nullable": true
          },
          "neonatalCareEndDate": {
            "type": "string",
            "nullable": true
          },
          "higherRateWeeks": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "higherRateAmount": {
            "type": "number",
            "format": "double",
            "nullable": true
          },
          "standardRateWeeks": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "standardRateAmount": {
            "type": "number",
            "format": "double",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Statutory_ImportStatutoryPayResponse": {
        "type": "object",
        "properties": {
          "statutoryId": {
            "type": "string"
          },
          "employeeId": {
            "type": "string"
          },
          "statutoryType": {
            "type": "string"
          },
          "totalWeeks": {
            "type": "integer",
            "format": "int32"
          },
          "paidWeeks": {
            "type": "integer",
            "format": "int32"
          },
          "pendingWeeks": {
            "type": "integer",
            "format": "int32"
          },
          "totalAmount": {
            "type": "number",
            "format": "double"
          },
          "paidAmount": {
            "type": "number",
            "format": "double"
          },
          "pendingAmount": {
            "type": "number",
            "format": "double"
          }
        },
        "additionalProperties": false
      },
      "Statutory_MessageWithTokenResponse": {
        "type": "object",
        "properties": {
          "text": {
            "type": "string"
          },
          "token": {
            "type": "string"
          },
          "tokenArguments": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Statutory_ValidationIssueArgument"
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Statutory_OverrideStatutoryAmountRequest": {
        "type": "object",
        "properties": {
          "amount": {
            "type": "number",
            "format": "double"
          },
          "reason": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Statutory_PayRiseHistoryItem": {
        "type": "object",
        "properties": {
          "effectiveDate": {
            "type": "string",
            "format": "date"
          },
          "oldSalary": {
            "type": "number",
            "format": "double"
          },
          "newSalary": {
            "type": "number",
            "format": "double"
          },
          "payPeriodStartDate": {
            "type": "string",
            "format": "date"
          },
          "payPeriodEndDate": {
            "type": "string",
            "format": "date"
          },
          "detectedDate": {
            "type": "string",
            "format": "date"
          }
        },
        "additionalProperties": false
      },
      "Statutory_RecalculateAlabasterRequest": {
        "type": "object",
        "properties": {
          "payRiseEffectiveDate": {
            "type": "string"
          },
          "oldSalary": {
            "type": "number",
            "format": "double"
          },
          "newSalary": {
            "type": "number",
            "format": "double"
          },
          "payPeriodStartDate": {
            "type": "string"
          },
          "payPeriodEndDate": {
            "type": "string"
          }
        },
        "additionalProperties": false
      },
      "Statutory_RecordExternalPaymentRequest": {
        "type": "object",
        "properties": {
          "grossAmount": {
            "type": "number",
            "format": "double"
          },
          "netAmount": {
            "type": "number",
            "format": "double",
            "nullable": true
          },
          "paymentDate": {
            "type": "string",
            "nullable": true
          },
          "taxYear": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "period": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "payPeriodStart": {
            "type": "string",
            "nullable": true
          },
          "weekStart": {
            "type": "string",
            "nullable": true
          },
          "reference": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Statutory_RelevantPeriodEarningResponse": {
        "type": "object",
        "properties": {
          "payDate": {
            "type": "string"
          },
          "amount": {
            "type": "number",
            "format": "double"
          },
          "description": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Statutory_ResponseBody_AlabasterAdjustment": {
        "type": "object",
        "properties": {
          "message": {
            "$ref": "#/components/schemas/Statutory_MessageWithTokenResponse"
          },
          "content": {
            "$ref": "#/components/schemas/Statutory_ContentResponse_AlabasterAdjustment"
          },
          "validationIssues": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Statutory_ValidationIssue"
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Statutory_ResponseBody_AvailableTaxYearsResponse": {
        "type": "object",
        "properties": {
          "message": {
            "$ref": "#/components/schemas/Statutory_MessageWithTokenResponse"
          },
          "content": {
            "$ref": "#/components/schemas/Statutory_ContentResponse_AvailableTaxYearsResponse"
          },
          "validationIssues": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Statutory_ValidationIssue"
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Statutory_ResponseBody_AverageEarningsResponse": {
        "type": "object",
        "properties": {
          "message": {
            "$ref": "#/components/schemas/Statutory_MessageWithTokenResponse"
          },
          "content": {
            "$ref": "#/components/schemas/Statutory_ContentResponse_AverageEarningsResponse"
          },
          "validationIssues": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Statutory_ValidationIssue"
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Statutory_ResponseBody_Boolean": {
        "type": "object",
        "properties": {
          "message": {
            "$ref": "#/components/schemas/Statutory_MessageWithTokenResponse"
          },
          "content": {
            "$ref": "#/components/schemas/Statutory_ContentResponse_Boolean"
          },
          "validationIssues": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Statutory_ValidationIssue"
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Statutory_ResponseBody_CalculatorOutputResponse": {
        "type": "object",
        "properties": {
          "message": {
            "$ref": "#/components/schemas/Statutory_MessageWithTokenResponse"
          },
          "content": {
            "$ref": "#/components/schemas/Statutory_ContentResponse_CalculatorOutputResponse"
          },
          "validationIssues": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Statutory_ValidationIssue"
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Statutory_ResponseBody_CheckLinkingPeriodsResponse": {
        "type": "object",
        "properties": {
          "message": {
            "$ref": "#/components/schemas/Statutory_MessageWithTokenResponse"
          },
          "content": {
            "$ref": "#/components/schemas/Statutory_ContentResponse_CheckLinkingPeriodsResponse"
          },
          "validationIssues": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Statutory_ValidationIssue"
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Statutory_ResponseBody_IEnumerable_StatutoryAttachmentResponse": {
        "type": "object",
        "properties": {
          "message": {
            "$ref": "#/components/schemas/Statutory_MessageWithTokenResponse"
          },
          "content": {
            "$ref": "#/components/schemas/Statutory_ContentResponse_IEnumerable_StatutoryAttachmentResponse"
          },
          "validationIssues": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Statutory_ValidationIssue"
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Statutory_ResponseBody_IEnumerable_StatutoryAttachmentUploadResponse": {
        "type": "object",
        "properties": {
          "message": {
            "$ref": "#/components/schemas/Statutory_MessageWithTokenResponse"
          },
          "content": {
            "$ref": "#/components/schemas/Statutory_ContentResponse_IEnumerable_StatutoryAttachmentUploadResponse"
          },
          "validationIssues": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Statutory_ValidationIssue"
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Statutory_ResponseBody_IEnumerable_StatutoryPayLineItemResponse": {
        "type": "object",
        "properties": {
          "message": {
            "$ref": "#/components/schemas/Statutory_MessageWithTokenResponse"
          },
          "content": {
            "$ref": "#/components/schemas/Statutory_ContentResponse_IEnumerable_StatutoryPayLineItemResponse"
          },
          "validationIssues": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Statutory_ValidationIssue"
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Statutory_ResponseBody_IEnumerable_StatutoryPayResponse": {
        "type": "object",
        "properties": {
          "message": {
            "$ref": "#/components/schemas/Statutory_MessageWithTokenResponse"
          },
          "content": {
            "$ref": "#/components/schemas/Statutory_ContentResponse_IEnumerable_StatutoryPayResponse"
          },
          "validationIssues": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Statutory_ValidationIssue"
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Statutory_ResponseBody_ImportStatutoryPayResponse": {
        "type": "object",
        "properties": {
          "message": {
            "$ref": "#/components/schemas/Statutory_MessageWithTokenResponse"
          },
          "content": {
            "$ref": "#/components/schemas/Statutory_ContentResponse_ImportStatutoryPayResponse"
          },
          "validationIssues": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Statutory_ValidationIssue"
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Statutory_ResponseBody_List_PayRiseHistoryItem": {
        "type": "object",
        "properties": {
          "message": {
            "$ref": "#/components/schemas/Statutory_MessageWithTokenResponse"
          },
          "content": {
            "$ref": "#/components/schemas/Statutory_ContentResponse_List_PayRiseHistoryItem"
          },
          "validationIssues": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Statutory_ValidationIssue"
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Statutory_ResponseBody_StatutoryHistoryResponse": {
        "type": "object",
        "properties": {
          "message": {
            "$ref": "#/components/schemas/Statutory_MessageWithTokenResponse"
          },
          "content": {
            "$ref": "#/components/schemas/Statutory_ContentResponse_StatutoryHistoryResponse"
          },
          "validationIssues": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Statutory_ValidationIssue"
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Statutory_ResponseBody_StatutoryPayHistoryResponse": {
        "type": "object",
        "properties": {
          "message": {
            "$ref": "#/components/schemas/Statutory_MessageWithTokenResponse"
          },
          "content": {
            "$ref": "#/components/schemas/Statutory_ContentResponse_StatutoryPayHistoryResponse"
          },
          "validationIssues": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Statutory_ValidationIssue"
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Statutory_ResponseBody_StatutoryPayResponse": {
        "type": "object",
        "properties": {
          "message": {
            "$ref": "#/components/schemas/Statutory_MessageWithTokenResponse"
          },
          "content": {
            "$ref": "#/components/schemas/Statutory_ContentResponse_StatutoryPayResponse"
          },
          "validationIssues": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Statutory_ValidationIssue"
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Statutory_ResponseBody_StatutoryRatesResponse": {
        "type": "object",
        "properties": {
          "message": {
            "$ref": "#/components/schemas/Statutory_MessageWithTokenResponse"
          },
          "content": {
            "$ref": "#/components/schemas/Statutory_ContentResponse_StatutoryRatesResponse"
          },
          "validationIssues": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Statutory_ValidationIssue"
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Statutory_ScheduledWeekDto": {
        "type": "object",
        "properties": {
          "weekCommencing": {
            "type": "string"
          },
          "workingDays": {
            "$ref": "#/components/schemas/Statutory_StandardWorkingDaysDto"
          }
        },
        "additionalProperties": false
      },
      "Statutory_ShiftDto": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string"
          },
          "workingDays": {
            "$ref": "#/components/schemas/Statutory_StandardWorkingDaysDto"
          },
          "durationInDays": {
            "type": "integer",
            "format": "int32"
          }
        },
        "additionalProperties": false
      },
      "Statutory_ShiftPatternDto": {
        "type": "object",
        "properties": {
          "rotationStartDate": {
            "type": "string"
          },
          "shifts": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Statutory_ShiftDto"
            }
          },
          "patternType": {
            "type": "string"
          }
        },
        "additionalProperties": false
      },
      "Statutory_SicknessLinkingChainResponse": {
        "type": "object",
        "properties": {
          "chainId": {
            "type": "string"
          },
          "startDate": {
            "type": "string"
          },
          "endDate": {
            "type": "string",
            "nullable": true
          },
          "totalWeeksUsed": {
            "type": "integer",
            "format": "int32"
          },
          "remainingWeeks": {
            "type": "integer",
            "format": "int32"
          },
          "periods": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Statutory_StatutoryPaymentHistoryItemResponse"
            }
          }
        },
        "additionalProperties": false
      },
      "Statutory_SicknessPeriodDto": {
        "type": "object",
        "properties": {
          "startDate": {
            "type": "string"
          },
          "endDate": {
            "type": "string"
          },
          "wereFirstThreeDaysPaid": {
            "type": "boolean"
          }
        },
        "additionalProperties": false
      },
      "Statutory_StandardWorkingDaysDto": {
        "type": "object",
        "properties": {
          "monday": {
            "type": "boolean"
          },
          "tuesday": {
            "type": "boolean"
          },
          "wednesday": {
            "type": "boolean"
          },
          "thursday": {
            "type": "boolean"
          },
          "friday": {
            "type": "boolean"
          },
          "saturday": {
            "type": "boolean"
          },
          "sunday": {
            "type": "boolean"
          }
        },
        "additionalProperties": false
      },
      "Statutory_StatutoryAdoptionPayCalculationResponse": {
        "allOf": [
          {
            "$ref": "#/components/schemas/Statutory_CalculatorOutputResponse"
          },
          {
            "type": "object",
            "additionalProperties": false
          }
        ]
      },
      "Statutory_StatutoryAdoptionPayDetails": {
        "type": "object",
        "properties": {
          "qualifyingEventDate": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Statutory_StatutoryAdoptionPayPreviewBodyDto": {
        "allOf": [
          {
            "$ref": "#/components/schemas/Statutory_StatutoryCalculatorPreviewBodyDtoBase"
          },
          {
            "type": "object",
            "additionalProperties": false
          }
        ]
      },
      "Statutory_StatutoryAdoptionPayResponse": {
        "allOf": [
          {
            "$ref": "#/components/schemas/Statutory_StatutoryPayResponse"
          },
          {
            "type": "object",
            "properties": {
              "details": {
                "$ref": "#/components/schemas/Statutory_StatutoryAdoptionPayDetails"
              }
            },
            "additionalProperties": false
          }
        ]
      },
      "Statutory_StatutoryAttachmentResponse": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "statutoryPayId": {
            "type": "string"
          },
          "filename": {
            "type": "string"
          },
          "contentType": {
            "type": "string"
          },
          "fileSize": {
            "type": "integer",
            "format": "int64"
          },
          "uploadedDate": {
            "type": "string"
          },
          "uploadedBy": {
            "type": "string"
          },
          "downloadUrl": {
            "type": "string"
          },
          "downloadUrlExpiresAt": {
            "type": "string"
          }
        },
        "additionalProperties": false
      },
      "Statutory_StatutoryAttachmentUploadResponse": {
        "type": "object",
        "properties": {
          "attachmentId": {
            "type": "string"
          },
          "filename": {
            "type": "string"
          },
          "uploadUrl": {
            "type": "string"
          },
          "expiresAt": {
            "type": "string"
          },
          "method": {
            "type": "string"
          },
          "headers": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            }
          }
        },
        "additionalProperties": false
      },
      "Statutory_StatutoryCalculationResponse": {
        "required": [
          "statutoryType"
        ],
        "type": "object",
        "properties": {
          "statutoryType": {
            "minLength": 1,
            "type": "string",
            "readOnly": true
          },
          "totalAmount": {
            "type": "number",
            "format": "double"
          },
          "statutoryId": {
            "type": "string",
            "nullable": true
          },
          "uploadUrls": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Statutory_StatutoryAttachmentUploadResponse"
            },
            "nullable": true
          },
          "nonRoundedTotalAmount": {
            "type": "number",
            "format": "double"
          },
          "requestDate": {
            "type": "string"
          },
          "startDate": {
            "type": "string"
          },
          "endDate": {
            "type": "string"
          },
          "breakdown": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Statutory_CalculatorOutputItemResponse"
            }
          },
          "maxEndDate": {
            "type": "string",
            "nullable": true
          },
          "dailyBreakdown": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Statutory_StatutoryDailyBreakdown"
            },
            "nullable": true
          },
          "periodRange": {
            "type": "string",
            "nullable": true
          },
          "warnings": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Statutory_StatutoryWarningDto"
            }
          },
          "averageWeeklyEarnings": {
            "type": "number",
            "format": "double",
            "nullable": true
          },
          "paidUntilDate": {
            "type": "string",
            "nullable": true
          },
          "paidAmount": {
            "type": "number",
            "format": "double"
          },
          "pendingAmount": {
            "type": "number",
            "format": "double"
          },
          "paidThroughPayPeriodEnd": {
            "type": "string",
            "nullable": true
          },
          "paidThroughYear": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "paidThroughPeriod": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "discriminator": {
          "propertyName": "statutoryType",
          "mapping": {
            "StatutorySickPay": "#/components/schemas/Statutory_StatutorySickPayCalculationResponse",
            "StatutoryMaternityPay": "#/components/schemas/Statutory_StatutoryMaternityPayCalculationResponse",
            "StatutoryPaternityPay": "#/components/schemas/Statutory_StatutoryPaternityPayCalculationResponse",
            "StatutoryAdoptionPay": "#/components/schemas/Statutory_StatutoryAdoptionPayCalculationResponse",
            "StatutoryParentalBereavementPay": "#/components/schemas/Statutory_StatutoryParentalBereavementPayCalculationResponse",
            "StatutorySharedParentalPay": "#/components/schemas/Statutory_StatutorySharedParentalPayCalculationResponse",
            "StatutoryNeoNatalCarePay": "#/components/schemas/Statutory_StatutoryNeoNatalCarePayCalculationResponse"
          }
        }
      },
      "Statutory_StatutoryCalculatorPreviewBodyDto": {
        "allOf": [
          {
            "$ref": "#/components/schemas/Statutory_StatutoryCalculatorPreviewBodyDtoBase"
          },
          {
            "type": "object",
            "additionalProperties": false
          }
        ]
      },
      "Statutory_StatutoryCalculatorPreviewBodyDtoBase": {
        "required": [
          "earnings",
          "employmentStartDate",
          "payFrequency",
          "startDate",
          "statutoryType"
        ],
        "type": "object",
        "properties": {
          "statutoryType": {
            "enum": [
              "None",
              "StatutorySickPay",
              "StatutoryMaternityPay",
              "StatutoryPaternityPay",
              "StatutoryAdoptionPay",
              "StatutoryParentalBereavementPay",
              "StatutorySharedParentalPay",
              "StatutoryNeoNatalCarePay"
            ],
            "type": "string",
            "readOnly": true
          },
          "startDate": {
            "minLength": 1,
            "type": "string"
          },
          "endDate": {
            "type": "string",
            "nullable": true
          },
          "employmentStartDate": {
            "minLength": 1,
            "type": "string"
          },
          "payFrequency": {
            "minLength": 1,
            "type": "string"
          },
          "earnings": {
            "type": "array",
            "items": {
              "type": "number",
              "format": "double"
            }
          },
          "qualifyingEventDate": {
            "type": "string",
            "nullable": true
          },
          "workingDays": {
            "$ref": "#/components/schemas/Statutory_WorkingDaysConfigurationDto"
          },
          "paidWeeks": {
            "type": "number",
            "format": "double",
            "nullable": true
          },
          "paidUntilDate": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "discriminator": {
          "propertyName": "statutoryType",
          "mapping": {
            "StatutorySickPay": "#/components/schemas/Statutory_StatutorySickPayPreviewBodyDto",
            "StatutoryMaternityPay": "#/components/schemas/Statutory_StatutoryMaternityPayPreviewBodyDto",
            "StatutoryPaternityPay": "#/components/schemas/Statutory_StatutoryPaternityPayPreviewBodyDto",
            "StatutoryAdoptionPay": "#/components/schemas/Statutory_StatutoryAdoptionPayPreviewBodyDto",
            "StatutoryParentalBereavementPay": "#/components/schemas/Statutory_StatutoryParentalBereavementPayPreviewBodyDto",
            "StatutorySharedParentalPay": "#/components/schemas/Statutory_StatutorySharedParentalPayPreviewBodyDto",
            "StatutoryNeoNatalCarePay": "#/components/schemas/Statutory_StatutoryNeoNatalCarePayPreviewBodyDto"
          }
        }
      },
      "Statutory_StatutoryDailyBreakdown": {
        "type": "object",
        "properties": {
          "date": {
            "type": "string"
          },
          "status": {
            "enum": [
              "NonQualifyingDay",
              "WaitingDay",
              "PaidDay",
              "LimitReached",
              "NonWorkingDay"
            ],
            "type": "string"
          },
          "amount": {
            "type": "number",
            "format": "double",
            "nullable": true
          },
          "description": {
            "type": "string",
            "nullable": true
          },
          "isLinked": {
            "type": "boolean"
          }
        },
        "additionalProperties": false
      },
      "Statutory_StatutoryHistoryResponse": {
        "type": "object",
        "properties": {
          "employeeId": {
            "type": "string"
          },
          "sicknessChains": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Statutory_SicknessLinkingChainResponse"
            }
          },
          "otherPayments": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Statutory_StatutoryPaymentHistoryItemResponse"
            }
          }
        },
        "additionalProperties": false
      },
      "Statutory_StatutoryMaternityPayCalculationResponse": {
        "allOf": [
          {
            "$ref": "#/components/schemas/Statutory_CalculatorOutputResponse"
          },
          {
            "type": "object",
            "additionalProperties": false
          }
        ]
      },
      "Statutory_StatutoryMaternityPayDetails": {
        "type": "object",
        "properties": {
          "qualifyingEventDate": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Statutory_StatutoryMaternityPayPreviewBodyDto": {
        "allOf": [
          {
            "$ref": "#/components/schemas/Statutory_StatutoryCalculatorPreviewBodyDtoBase"
          },
          {
            "type": "object",
            "additionalProperties": false
          }
        ]
      },
      "Statutory_StatutoryMaternityPayResponse": {
        "allOf": [
          {
            "$ref": "#/components/schemas/Statutory_StatutoryPayResponse"
          },
          {
            "type": "object",
            "properties": {
              "details": {
                "$ref": "#/components/schemas/Statutory_StatutoryMaternityPayDetails"
              }
            },
            "additionalProperties": false
          }
        ]
      },
      "Statutory_StatutoryNeoNatalCarePayCalculationResponse": {
        "allOf": [
          {
            "$ref": "#/components/schemas/Statutory_CalculatorOutputResponse"
          },
          {
            "type": "object",
            "additionalProperties": false
          }
        ]
      },
      "Statutory_StatutoryNeoNatalCarePayDetails": {
        "type": "object",
        "properties": {
          "qualifyingEventDate": {
            "type": "string",
            "nullable": true
          },
          "neonatalCareStartDate": {
            "type": "string",
            "nullable": true
          },
          "neonatalCareEndDate": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Statutory_StatutoryNeoNatalCarePayPreviewBodyDto": {
        "allOf": [
          {
            "$ref": "#/components/schemas/Statutory_StatutoryCalculatorPreviewBodyDtoBase"
          },
          {
            "type": "object",
            "properties": {
              "neonatalCareStartDate": {
                "type": "string",
                "nullable": true
              },
              "neonatalCareEndDate": {
                "type": "string",
                "nullable": true
              }
            },
            "additionalProperties": false
          }
        ]
      },
      "Statutory_StatutoryNeoNatalCarePayResponse": {
        "allOf": [
          {
            "$ref": "#/components/schemas/Statutory_StatutoryPayResponse"
          },
          {
            "type": "object",
            "properties": {
              "details": {
                "$ref": "#/components/schemas/Statutory_StatutoryNeoNatalCarePayDetails"
              }
            },
            "additionalProperties": false
          }
        ]
      },
      "Statutory_StatutoryParentalBereavementPayCalculationResponse": {
        "allOf": [
          {
            "$ref": "#/components/schemas/Statutory_CalculatorOutputResponse"
          },
          {
            "type": "object",
            "additionalProperties": false
          }
        ]
      },
      "Statutory_StatutoryParentalBereavementPayDetails": {
        "type": "object",
        "properties": {
          "qualifyingEventDate": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Statutory_StatutoryParentalBereavementPayPreviewBodyDto": {
        "allOf": [
          {
            "$ref": "#/components/schemas/Statutory_StatutoryCalculatorPreviewBodyDtoBase"
          },
          {
            "type": "object",
            "additionalProperties": false
          }
        ]
      },
      "Statutory_StatutoryParentalBereavementPayResponse": {
        "allOf": [
          {
            "$ref": "#/components/schemas/Statutory_StatutoryPayResponse"
          },
          {
            "type": "object",
            "properties": {
              "details": {
                "$ref": "#/components/schemas/Statutory_StatutoryParentalBereavementPayDetails"
              }
            },
            "additionalProperties": false
          }
        ]
      },
      "Statutory_StatutoryPaternityPayCalculationResponse": {
        "allOf": [
          {
            "$ref": "#/components/schemas/Statutory_CalculatorOutputResponse"
          },
          {
            "type": "object",
            "additionalProperties": false
          }
        ]
      },
      "Statutory_StatutoryPaternityPayDetails": {
        "type": "object",
        "properties": {
          "qualifyingEventDate": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Statutory_StatutoryPaternityPayPreviewBodyDto": {
        "allOf": [
          {
            "$ref": "#/components/schemas/Statutory_StatutoryCalculatorPreviewBodyDtoBase"
          },
          {
            "type": "object",
            "additionalProperties": false
          }
        ]
      },
      "Statutory_StatutoryPaternityPayResponse": {
        "allOf": [
          {
            "$ref": "#/components/schemas/Statutory_StatutoryPayResponse"
          },
          {
            "type": "object",
            "properties": {
              "details": {
                "$ref": "#/components/schemas/Statutory_StatutoryPaternityPayDetails"
              }
            },
            "additionalProperties": false
          }
        ]
      },
      "Statutory_StatutoryPayBreakdownItemResponse": {
        "type": "object",
        "properties": {
          "year": {
            "type": "integer",
            "format": "int32"
          },
          "period": {
            "type": "integer",
            "format": "int32"
          },
          "frequency": {
            "type": "string"
          },
          "week": {
            "type": "integer",
            "format": "int32"
          },
          "value": {
            "type": "number",
            "format": "double"
          },
          "nonRoundedValue": {
            "type": "number",
            "format": "double"
          },
          "isManuallyAdjusted": {
            "type": "boolean"
          }
        },
        "additionalProperties": false
      },
      "Statutory_StatutoryPayHistoryEntry": {
        "type": "object",
        "properties": {
          "eventType": {
            "type": "string"
          },
          "timestamp": {
            "type": "string"
          },
          "actorId": {
            "type": "string",
            "nullable": true
          },
          "updatedFields": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "changes": {
            "type": "object",
            "additionalProperties": {
              "$ref": "#/components/schemas/Statutory_StatutoryPayHistoryFieldChange"
            }
          }
        },
        "additionalProperties": false
      },
      "Statutory_StatutoryPayHistoryFieldChange": {
        "type": "object",
        "properties": {
          "oldValue": {
            "type": "string",
            "nullable": true
          },
          "newValue": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Statutory_StatutoryPayHistoryResponse": {
        "type": "object",
        "properties": {
          "statutoryId": {
            "type": "string"
          },
          "entries": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Statutory_StatutoryPayHistoryEntry"
            }
          }
        },
        "additionalProperties": false
      },
      "Statutory_StatutoryPayLineItemResponse": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "statutoryPayId": {
            "type": "string"
          },
          "statutoryPayType": {
            "type": "string"
          },
          "lineItemSequence": {
            "type": "integer",
            "format": "int32"
          },
          "activityDate": {
            "type": "string"
          },
          "payPeriodStart": {
            "type": "string"
          },
          "payPeriodEnd": {
            "type": "string"
          },
          "aggregatedAmount": {
            "type": "number",
            "format": "double"
          },
          "nonRoundedAggregatedAmount": {
            "type": "number",
            "format": "double"
          },
          "paidAmount": {
            "type": "number",
            "format": "double"
          },
          "status": {
            "type": "string"
          },
          "weekItemIds": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "createdDate": {
            "type": "string"
          },
          "createdBy": {
            "type": "string"
          },
          "updatedDate": {
            "type": "string",
            "nullable": true
          },
          "updatedBy": {
            "type": "string",
            "nullable": true
          },
          "source": {
            "enum": [
              "PayrollRun",
              "ImportedFromPreviousProvider",
              "ExternalDirectPayment"
            ],
            "type": "string"
          },
          "isManuallyAdjusted": {
            "type": "boolean"
          },
          "adjustmentReason": {
            "type": "string",
            "nullable": true
          },
          "netAmount": {
            "type": "number",
            "format": "double",
            "nullable": true
          },
          "paymentDate": {
            "type": "string",
            "nullable": true
          },
          "externalReference": {
            "type": "string",
            "nullable": true
          },
          "paidDays": {
            "type": "integer",
            "description": "Paid days across every week on the line (qualifying days for SSP, calendar days otherwise); null when a week predates the day count. Drives the Day units on the payslip line.",
            "format": "int32",
            "nullable": true
          },
          "coveredFrom": {
            "type": "string",
            "description": "First day the line pays for (yyyy-MM-dd).",
            "nullable": true
          },
          "coveredTo": {
            "type": "string",
            "description": "Last day the line pays for (yyyy-MM-dd).",
            "nullable": true
          },
          "periodAmount": {
            "type": "number",
            "description": "The part of the amount paying for days inside the line's own pay period; equals the aggregate unless a late-entered payment swept up earlier periods.",
            "format": "double",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Statutory_StatutoryPayResponse": {
        "allOf": [
          {
            "$ref": "#/components/schemas/Statutory_StatutoryPayResponseBase"
          },
          {
            "required": [
              "statutoryPayType"
            ],
            "type": "object",
            "properties": {
              "statutoryPayType": {
                "type": "string"
              }
            },
            "additionalProperties": false,
            "discriminator": {
              "propertyName": "statutoryPayType",
              "mapping": {
                "StatutoryAdoptionPay": "#/components/schemas/Statutory_StatutoryAdoptionPayResponse",
                "StatutoryMaternityPay": "#/components/schemas/Statutory_StatutoryMaternityPayResponse",
                "StatutoryNeoNatalCarePay": "#/components/schemas/Statutory_StatutoryNeoNatalCarePayResponse",
                "StatutoryParentalBereavementPay": "#/components/schemas/Statutory_StatutoryParentalBereavementPayResponse",
                "StatutoryPaternityPay": "#/components/schemas/Statutory_StatutoryPaternityPayResponse",
                "StatutorySharedParentalPay": "#/components/schemas/Statutory_StatutorySharedParentalPayResponse",
                "StatutorySickPay": "#/components/schemas/Statutory_StatutorySickPayResponse"
              }
            }
          }
        ],
        "oneOf": [
          {
            "$ref": "#/components/schemas/Statutory_StatutorySickPayResponse"
          },
          {
            "$ref": "#/components/schemas/Statutory_StatutoryMaternityPayResponse"
          },
          {
            "$ref": "#/components/schemas/Statutory_StatutoryPaternityPayResponse"
          },
          {
            "$ref": "#/components/schemas/Statutory_StatutoryAdoptionPayResponse"
          },
          {
            "$ref": "#/components/schemas/Statutory_StatutoryParentalBereavementPayResponse"
          },
          {
            "$ref": "#/components/schemas/Statutory_StatutorySharedParentalPayResponse"
          },
          {
            "$ref": "#/components/schemas/Statutory_StatutoryNeoNatalCarePayResponse"
          }
        ],
        "discriminator": {
          "propertyName": "statutoryPayType",
          "mapping": {
            "StatutorySickPay": "#/components/schemas/Statutory_StatutorySickPayResponse",
            "StatutoryMaternityPay": "#/components/schemas/Statutory_StatutoryMaternityPayResponse",
            "StatutoryPaternityPay": "#/components/schemas/Statutory_StatutoryPaternityPayResponse",
            "StatutoryAdoptionPay": "#/components/schemas/Statutory_StatutoryAdoptionPayResponse",
            "StatutoryParentalBereavementPay": "#/components/schemas/Statutory_StatutoryParentalBereavementPayResponse",
            "StatutorySharedParentalPay": "#/components/schemas/Statutory_StatutorySharedParentalPayResponse",
            "StatutoryNeoNatalCarePay": "#/components/schemas/Statutory_StatutoryNeoNatalCarePayResponse"
          }
        }
      },
      "Statutory_StatutoryPayResponseBase": {
        "required": [
          "statutoryPayType"
        ],
        "type": "object",
        "properties": {
          "statutoryPayType": {
            "enum": [
              "None",
              "StatutorySickPay",
              "StatutoryMaternityPay",
              "StatutoryPaternityPay",
              "StatutoryAdoptionPay",
              "StatutoryParentalBereavementPay",
              "StatutorySharedParentalPay",
              "StatutoryNeoNatalCarePay"
            ],
            "type": "string",
            "readOnly": true
          },
          "organisationId": {
            "type": "string"
          },
          "statutoryId": {
            "type": "string"
          },
          "employeeId": {
            "type": "string"
          },
          "startDate": {
            "type": "string"
          },
          "requestedStartDate": {
            "type": "string"
          },
          "endDate": {
            "type": "string",
            "nullable": true
          },
          "maxEndDate": {
            "type": "string",
            "nullable": true
          },
          "totalAmount": {
            "type": "number",
            "format": "double"
          },
          "nonRoundedTotalAmount": {
            "type": "number",
            "format": "double"
          },
          "breakdownItems": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Statutory_StatutoryPayBreakdownItemResponse"
            }
          },
          "createdBy": {
            "type": "string"
          },
          "createdDate": {
            "type": "string"
          },
          "updatedBy": {
            "type": "string",
            "nullable": true
          },
          "updatedDate": {
            "type": "string",
            "nullable": true
          },
          "averageEarnings": {
            "type": "number",
            "format": "double"
          },
          "averageEarningsOverride": {
            "type": "number",
            "format": "double",
            "nullable": true
          },
          "relevantPeriodEarnings": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Statutory_RelevantPeriodEarningResponse"
            },
            "nullable": true
          },
          "dailyBreakdown": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Statutory_StatutoryDailyBreakdown"
            },
            "nullable": true
          },
          "lineItems": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Statutory_StatutoryPayLineItemResponse"
            },
            "nullable": true
          },
          "status": {
            "enum": [
              "Pending",
              "InProgress",
              "Paid"
            ],
            "type": "string"
          },
          "paidWeeksCount": {
            "type": "integer",
            "format": "int32"
          },
          "importDetails": {
            "$ref": "#/components/schemas/Statutory_ImportDetailsResponse"
          },
          "warnings": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Statutory_StatutoryWarningDto"
            }
          }
        },
        "additionalProperties": false,
        "discriminator": {
          "propertyName": "statutoryPayType",
          "mapping": {
            "StatutorySickPay": "#/components/schemas/Statutory_StatutorySickPayResponse",
            "StatutoryMaternityPay": "#/components/schemas/Statutory_StatutoryMaternityPayResponse",
            "StatutoryPaternityPay": "#/components/schemas/Statutory_StatutoryPaternityPayResponse",
            "StatutoryAdoptionPay": "#/components/schemas/Statutory_StatutoryAdoptionPayResponse",
            "StatutoryParentalBereavementPay": "#/components/schemas/Statutory_StatutoryParentalBereavementPayResponse",
            "StatutorySharedParentalPay": "#/components/schemas/Statutory_StatutorySharedParentalPayResponse",
            "StatutoryNeoNatalCarePay": "#/components/schemas/Statutory_StatutoryNeoNatalCarePayResponse"
          }
        }
      },
      "Statutory_StatutoryPaymentHistoryItemResponse": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "type": {
            "enum": [
              "None",
              "StatutorySickPay",
              "StatutoryMaternityPay",
              "StatutoryPaternityPay",
              "StatutoryAdoptionPay",
              "StatutoryParentalBereavementPay",
              "StatutorySharedParentalPay",
              "StatutoryNeoNatalCarePay"
            ],
            "type": "string"
          },
          "startDate": {
            "type": "string"
          },
          "endDate": {
            "type": "string"
          },
          "totalAmount": {
            "type": "number",
            "format": "double"
          },
          "averageEarnings": {
            "type": "number",
            "format": "double"
          },
          "relevantPeriodEarnings": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Statutory_RelevantPeriodEarningResponse"
            }
          },
          "dailyBreakdown": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Statutory_StatutoryDailyBreakdown"
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Statutory_StatutoryRatesResponse": {
        "type": "object",
        "properties": {
          "sspWeeklyRate": {
            "type": "number",
            "format": "double"
          },
          "sspWaitingDays": {
            "type": "integer",
            "format": "int32"
          },
          "sspDailyRates": {
            "type": "object",
            "additionalProperties": {
              "type": "number",
              "format": "double"
            }
          },
          "statutoryMaternityPayStandard": {
            "type": "number",
            "format": "double"
          },
          "statutoryPaternityPay": {
            "type": "number",
            "format": "double"
          },
          "statutoryAdoptionPayStandard": {
            "type": "number",
            "format": "double"
          },
          "statutorySharedParentalPay": {
            "type": "number",
            "format": "double"
          },
          "sharedParentalPayMaximumWeeks": {
            "type": "integer",
            "format": "int32"
          },
          "sharedParentalLeaveMaximumWeeks": {
            "type": "integer",
            "format": "int32"
          },
          "statutoryParentalBereavementPay": {
            "type": "number",
            "format": "double"
          },
          "statutoryNeonatalCarePay": {
            "type": "number",
            "format": "double",
            "nullable": true
          },
          "maternityAdoptionHigherRateMultiplier": {
            "type": "number",
            "format": "double"
          },
          "parentalPayDailyDivisor": {
            "type": "integer",
            "format": "int32"
          },
          "sspEarningsCapMultiplier": {
            "type": "number",
            "format": "double",
            "nullable": true
          },
          "lowerEarningsLimit": {
            "type": "number",
            "format": "double"
          },
          "recoveryRateStandard": {
            "type": "number",
            "format": "double"
          },
          "recoveryRateSmallEmployer": {
            "type": "number",
            "format": "double"
          },
          "smallEmployerThreshold": {
            "type": "number",
            "format": "double"
          }
        },
        "additionalProperties": false
      },
      "Statutory_StatutorySharedParentalPayCalculationResponse": {
        "allOf": [
          {
            "$ref": "#/components/schemas/Statutory_CalculatorOutputResponse"
          },
          {
            "type": "object",
            "additionalProperties": false
          }
        ]
      },
      "Statutory_StatutorySharedParentalPayDetails": {
        "type": "object",
        "properties": {
          "isPrimaryParent": {
            "type": "boolean"
          },
          "previousPrimaryPayWeeks": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "otherParentShppWeeks": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "qualifyingEventDate": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Statutory_StatutorySharedParentalPayPreviewBodyDto": {
        "allOf": [
          {
            "$ref": "#/components/schemas/Statutory_StatutoryCalculatorPreviewBodyDtoBase"
          },
          {
            "type": "object",
            "properties": {
              "isPrimaryParent": {
                "type": "boolean"
              },
              "previousPrimaryPayWeeks": {
                "type": "integer",
                "format": "int32",
                "nullable": true
              },
              "otherParentShppWeeks": {
                "type": "integer",
                "format": "int32",
                "nullable": true
              }
            },
            "additionalProperties": false
          }
        ]
      },
      "Statutory_StatutorySharedParentalPayResponse": {
        "allOf": [
          {
            "$ref": "#/components/schemas/Statutory_StatutoryPayResponse"
          },
          {
            "type": "object",
            "properties": {
              "details": {
                "$ref": "#/components/schemas/Statutory_StatutorySharedParentalPayDetails"
              }
            },
            "additionalProperties": false
          }
        ]
      },
      "Statutory_StatutorySickPayCalculationResponse": {
        "allOf": [
          {
            "$ref": "#/components/schemas/Statutory_CalculatorOutputResponse"
          },
          {
            "type": "object",
            "additionalProperties": false
          }
        ]
      },
      "Statutory_StatutorySickPayDetails": {
        "type": "object",
        "properties": {
          "isReceivingStatutoryMaternityPay": {
            "type": "boolean"
          },
          "previousSicknessPeriods": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Statutory_SicknessPeriodDto"
            },
            "nullable": true
          },
          "workingDays": {
            "$ref": "#/components/schemas/Statutory_WorkingDaysConfigurationDto"
          }
        },
        "additionalProperties": false
      },
      "Statutory_StatutorySickPayPreviewBodyDto": {
        "allOf": [
          {
            "$ref": "#/components/schemas/Statutory_StatutoryCalculatorPreviewBodyDtoBase"
          },
          {
            "type": "object",
            "properties": {
              "isReceivingStatutoryMaternityPay": {
                "type": "boolean"
              },
              "previousSicknessPeriods": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/Statutory_SicknessPeriodDto"
                },
                "nullable": true
              }
            },
            "additionalProperties": false
          }
        ]
      },
      "Statutory_StatutorySickPayResponse": {
        "allOf": [
          {
            "$ref": "#/components/schemas/Statutory_StatutoryPayResponse"
          },
          {
            "type": "object",
            "properties": {
              "details": {
                "$ref": "#/components/schemas/Statutory_StatutorySickPayDetails"
              }
            },
            "additionalProperties": false
          }
        ]
      },
      "Statutory_StatutoryWarningDetailsDto": {
        "type": "object",
        "properties": {
          "accruedWeeks": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "accruedAmount": {
            "type": "number",
            "format": "double",
            "nullable": true
          },
          "accrualPaymentDate": {
            "type": "string",
            "nullable": true
          },
          "closedPeriods": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Statutory_ClosedPeriodSummaryDto"
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Statutory_StatutoryWarningDto": {
        "type": "object",
        "properties": {
          "code": {
            "enum": [
              "BackdatedWeeksAccruedToNextOpenRun",
              "AverageWeeklyEarningsIsZero",
              "ScheduleTotalIsZeroDespiteQualifyingDays"
            ],
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "message": {
            "type": "string"
          },
          "details": {
            "$ref": "#/components/schemas/Statutory_StatutoryWarningDetailsDto"
          }
        },
        "additionalProperties": false
      },
      "Statutory_UpdateAlabasterLineItemsRequest": {
        "type": "object",
        "properties": {
          "adjustmentId": {
            "type": "string"
          }
        },
        "additionalProperties": false
      },
      "Statutory_UpdateStatutoryPayRequest": {
        "type": "object",
        "properties": {
          "startDate": {
            "type": "string",
            "nullable": true
          },
          "endDate": {
            "type": "string",
            "nullable": true
          },
          "qualifyingEventDate": {
            "type": "string",
            "nullable": true
          },
          "averageEarningsOverride": {
            "type": "number",
            "format": "double",
            "nullable": true
          },
          "clearAverageEarningsOverride": {
            "type": "boolean"
          },
          "isReceivingStatutoryMaternityPay": {
            "type": "boolean",
            "nullable": true
          },
          "previousSicknessPeriods": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Statutory_SicknessPeriodDto"
            },
            "nullable": true
          },
          "isPrimaryParent": {
            "type": "boolean",
            "nullable": true
          },
          "previousPrimaryPayWeeks": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "otherParentShppWeeks": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "neonatalCareStartDate": {
            "type": "string",
            "nullable": true
          },
          "neonatalCareEndDate": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Statutory_ValidationIssue": {
        "type": "object",
        "properties": {
          "field": {
            "type": "string"
          },
          "reason": {
            "type": "string"
          },
          "reasonToken": {
            "type": "string"
          },
          "reasonTokenArguments": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Statutory_ValidationIssueArgument"
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Statutory_ValidationIssueArgument": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string"
          },
          "value": {
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Statutory_WorkingDaysConfigurationDto": {
        "type": "object",
        "properties": {
          "standardWorkingDays": {
            "$ref": "#/components/schemas/Statutory_StandardWorkingDaysDto"
          },
          "shiftPattern": {
            "$ref": "#/components/schemas/Statutory_ShiftPatternDto"
          },
          "workingPattern": {
            "type": "string",
            "nullable": true
          },
          "explicitSchedule": {
            "$ref": "#/components/schemas/Statutory_ExplicitScheduleDto"
          }
        },
        "additionalProperties": false
      },
      "CourtOrders_AddCourtOrderAttachmentsRequest": {
        "type": "object",
        "properties": {
          "attachments": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CourtOrders_CreateAttachmentRequest"
            }
          }
        },
        "additionalProperties": false
      },
      "CourtOrders_AeoNonPriorityDetails": {
        "type": "object",
        "properties": {
          "category": {
            "enum": [
              "PriorityFines",
              "PriorityMaintenance",
              "NonPriorityCivilDebt"
            ],
            "type": "string"
          },
          "calculationTable": {
            "enum": [
              "TableA",
              "TableB",
              "TableC"
            ],
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "CourtOrders_AeoNonPriorityResponse": {
        "allOf": [
          {
            "$ref": "#/components/schemas/CourtOrders_CourtOrderResponse"
          },
          {
            "type": "object",
            "properties": {
              "details": {
                "$ref": "#/components/schemas/CourtOrders_AeoNonPriorityDetails"
              },
              "orderType": {
                "enum": [
                  "CmsDeo",
                  "AeoPriority",
                  "AeoNonPriority",
                  "Dea",
                  "Ctaeo",
                  "Ea",
                  "Mcaeo",
                  "Cma",
                  "Cao",
                  "NiFinesAeo",
                  "NiEjoAeo"
                ],
                "type": "string",
                "readOnly": true
              }
            },
            "additionalProperties": false
          }
        ]
      },
      "CourtOrders_AeoPriorityDetails": {
        "type": "object",
        "properties": {
          "category": {
            "enum": [
              "PriorityFines",
              "PriorityMaintenance",
              "NonPriorityCivilDebt"
            ],
            "type": "string"
          },
          "calculationTable": {
            "enum": [
              "TableA",
              "TableB",
              "TableC"
            ],
            "type": "string",
            "nullable": true
          },
          "protectedEarningsRate": {
            "type": "number",
            "format": "double",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "CourtOrders_AeoPriorityResponse": {
        "allOf": [
          {
            "$ref": "#/components/schemas/CourtOrders_CourtOrderResponse"
          },
          {
            "type": "object",
            "properties": {
              "details": {
                "$ref": "#/components/schemas/CourtOrders_AeoPriorityDetails"
              },
              "orderType": {
                "enum": [
                  "CmsDeo",
                  "AeoPriority",
                  "AeoNonPriority",
                  "Dea",
                  "Ctaeo",
                  "Ea",
                  "Mcaeo",
                  "Cma",
                  "Cao",
                  "NiFinesAeo",
                  "NiEjoAeo"
                ],
                "type": "string",
                "readOnly": true
              }
            },
            "additionalProperties": false
          }
        ]
      },
      "CourtOrders_ApiErrorResponse": {
        "type": "object",
        "properties": {
          "message": {
            "$ref": "#/components/schemas/CourtOrders_MessageWithTokenResponse"
          },
          "validationIssues": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CourtOrders_ValidationIssue"
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "CourtOrders_AttachmentResponse": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "orderId": {
            "type": "string"
          },
          "filename": {
            "type": "string"
          },
          "contentType": {
            "type": "string"
          },
          "fileSize": {
            "type": "integer",
            "format": "int64"
          },
          "uploadedDate": {
            "type": "string"
          },
          "uploadedBy": {
            "type": "string"
          },
          "downloadUrl": {
            "type": "string"
          },
          "downloadUrlExpiresAt": {
            "type": "string"
          }
        },
        "additionalProperties": false
      },
      "CourtOrders_AttachmentUploadResponse": {
        "type": "object",
        "properties": {
          "attachmentId": {
            "type": "string"
          },
          "filename": {
            "type": "string"
          },
          "uploadUrl": {
            "type": "string"
          },
          "expiresAt": {
            "type": "string"
          },
          "method": {
            "type": "string"
          },
          "headers": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            }
          }
        },
        "additionalProperties": false
      },
      "CourtOrders_BacsDetails": {
        "type": "object",
        "properties": {
          "accountNumber": {
            "type": "string"
          },
          "sortCode": {
            "type": "string"
          },
          "includeInRemittanceFile": {
            "type": "boolean",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "CourtOrders_CaoDetails": {
        "type": "object",
        "properties": {
          "ordinaryDebtAmount": {
            "type": "number",
            "format": "double",
            "nullable": true
          },
          "maintenanceDailyRate": {
            "type": "number",
            "format": "double",
            "nullable": true
          },
          "lastDeductionPayDate": {
            "type": "string",
            "format": "date",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "CourtOrders_CaoResponse": {
        "allOf": [
          {
            "$ref": "#/components/schemas/CourtOrders_CourtOrderResponse"
          },
          {
            "type": "object",
            "properties": {
              "details": {
                "$ref": "#/components/schemas/CourtOrders_CaoDetails"
              },
              "orderType": {
                "enum": [
                  "CmsDeo",
                  "AeoPriority",
                  "AeoNonPriority",
                  "Dea",
                  "Ctaeo",
                  "Ea",
                  "Mcaeo",
                  "Cma",
                  "Cao",
                  "NiFinesAeo",
                  "NiEjoAeo"
                ],
                "type": "string",
                "readOnly": true
              }
            },
            "additionalProperties": false
          }
        ]
      },
      "CourtOrders_CmaDetails": {
        "type": "object",
        "properties": {
          "dailyRate": {
            "type": "number",
            "format": "double",
            "nullable": true
          },
          "lastDeductionPayDate": {
            "type": "string",
            "format": "date",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "CourtOrders_CmaResponse": {
        "allOf": [
          {
            "$ref": "#/components/schemas/CourtOrders_CourtOrderResponse"
          },
          {
            "type": "object",
            "properties": {
              "details": {
                "$ref": "#/components/schemas/CourtOrders_CmaDetails"
              },
              "orderType": {
                "enum": [
                  "CmsDeo",
                  "AeoPriority",
                  "AeoNonPriority",
                  "Dea",
                  "Ctaeo",
                  "Ea",
                  "Mcaeo",
                  "Cma",
                  "Cao",
                  "NiFinesAeo",
                  "NiEjoAeo"
                ],
                "type": "string",
                "readOnly": true
              }
            },
            "additionalProperties": false
          }
        ]
      },
      "CourtOrders_CmsDeoDetails": {
        "type": "object",
        "properties": {
          "deductionType": {
            "enum": [
              "Percentage",
              "FixedAmount"
            ],
            "type": "string"
          },
          "percentageRate": {
            "type": "number",
            "format": "double",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "CourtOrders_CmsDeoResponse": {
        "allOf": [
          {
            "$ref": "#/components/schemas/CourtOrders_CourtOrderResponse"
          },
          {
            "type": "object",
            "properties": {
              "details": {
                "$ref": "#/components/schemas/CourtOrders_CmsDeoDetails"
              },
              "orderType": {
                "enum": [
                  "CmsDeo",
                  "AeoPriority",
                  "AeoNonPriority",
                  "Dea",
                  "Ctaeo",
                  "Ea",
                  "Mcaeo",
                  "Cma",
                  "Cao",
                  "NiFinesAeo",
                  "NiEjoAeo"
                ],
                "type": "string",
                "readOnly": true
              }
            },
            "additionalProperties": false
          }
        ]
      },
      "CourtOrders_ContentMetadataResponse": {
        "type": "object",
        "properties": {
          "dateFormat": {
            "type": "string"
          },
          "dateTimeFormat": {
            "type": "string"
          },
          "paginationToken": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "CourtOrders_ContentResponse_Boolean": {
        "type": "object",
        "properties": {
          "data": {
            "type": "boolean"
          },
          "metadata": {
            "$ref": "#/components/schemas/CourtOrders_ContentMetadataResponse"
          }
        },
        "additionalProperties": false
      },
      "CourtOrders_ContentResponse_CourtOrderAvailableTaxYearsResponse": {
        "type": "object",
        "properties": {
          "data": {
            "$ref": "#/components/schemas/CourtOrders_CourtOrderAvailableTaxYearsResponse"
          },
          "metadata": {
            "$ref": "#/components/schemas/CourtOrders_ContentMetadataResponse"
          }
        },
        "additionalProperties": false
      },
      "CourtOrders_ContentResponse_CourtOrderConstantsResponse": {
        "type": "object",
        "properties": {
          "data": {
            "$ref": "#/components/schemas/CourtOrders_CourtOrderConstantsResponse"
          },
          "metadata": {
            "$ref": "#/components/schemas/CourtOrders_ContentMetadataResponse"
          }
        },
        "additionalProperties": false
      },
      "CourtOrders_ContentResponse_CourtOrderListResponse": {
        "type": "object",
        "properties": {
          "data": {
            "$ref": "#/components/schemas/CourtOrders_CourtOrderListResponse"
          },
          "metadata": {
            "$ref": "#/components/schemas/CourtOrders_ContentMetadataResponse"
          }
        },
        "additionalProperties": false
      },
      "CourtOrders_ContentResponse_CourtOrderResponse": {
        "type": "object",
        "properties": {
          "data": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/CourtOrders_CmsDeoResponse"
              },
              {
                "$ref": "#/components/schemas/CourtOrders_AeoPriorityResponse"
              },
              {
                "$ref": "#/components/schemas/CourtOrders_AeoNonPriorityResponse"
              },
              {
                "$ref": "#/components/schemas/CourtOrders_DeaResponse"
              },
              {
                "$ref": "#/components/schemas/CourtOrders_CtaeoResponse"
              },
              {
                "$ref": "#/components/schemas/CourtOrders_EaResponse"
              },
              {
                "$ref": "#/components/schemas/CourtOrders_McaeoResponse"
              },
              {
                "$ref": "#/components/schemas/CourtOrders_CmaResponse"
              },
              {
                "$ref": "#/components/schemas/CourtOrders_CaoResponse"
              },
              {
                "$ref": "#/components/schemas/CourtOrders_NiFinesAeoResponse"
              },
              {
                "$ref": "#/components/schemas/CourtOrders_NiEjoAeoResponse"
              }
            ],
            "nullable": true,
            "discriminator": {
              "propertyName": "orderType",
              "mapping": {
                "CmsDeo": "#/components/schemas/CourtOrders_CmsDeoResponse",
                "AeoPriority": "#/components/schemas/CourtOrders_AeoPriorityResponse",
                "AeoNonPriority": "#/components/schemas/CourtOrders_AeoNonPriorityResponse",
                "Dea": "#/components/schemas/CourtOrders_DeaResponse",
                "Ctaeo": "#/components/schemas/CourtOrders_CtaeoResponse",
                "Ea": "#/components/schemas/CourtOrders_EaResponse",
                "Mcaeo": "#/components/schemas/CourtOrders_McaeoResponse",
                "Cma": "#/components/schemas/CourtOrders_CmaResponse",
                "Cao": "#/components/schemas/CourtOrders_CaoResponse",
                "NiFinesAeo": "#/components/schemas/CourtOrders_NiFinesAeoResponse",
                "NiEjoAeo": "#/components/schemas/CourtOrders_NiEjoAeoResponse"
              }
            }
          },
          "metadata": {
            "$ref": "#/components/schemas/CourtOrders_ContentMetadataResponse"
          }
        },
        "additionalProperties": false
      },
      "CourtOrders_ContentResponse_IEnumerable_CourtOrderResponse": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "oneOf": [
                {
                  "$ref": "#/components/schemas/CourtOrders_CmsDeoResponse"
                },
                {
                  "$ref": "#/components/schemas/CourtOrders_AeoPriorityResponse"
                },
                {
                  "$ref": "#/components/schemas/CourtOrders_AeoNonPriorityResponse"
                },
                {
                  "$ref": "#/components/schemas/CourtOrders_DeaResponse"
                },
                {
                  "$ref": "#/components/schemas/CourtOrders_CtaeoResponse"
                },
                {
                  "$ref": "#/components/schemas/CourtOrders_EaResponse"
                },
                {
                  "$ref": "#/components/schemas/CourtOrders_McaeoResponse"
                },
                {
                  "$ref": "#/components/schemas/CourtOrders_CmaResponse"
                },
                {
                  "$ref": "#/components/schemas/CourtOrders_CaoResponse"
                },
                {
                  "$ref": "#/components/schemas/CourtOrders_NiFinesAeoResponse"
                },
                {
                  "$ref": "#/components/schemas/CourtOrders_NiEjoAeoResponse"
                }
              ],
              "discriminator": {
                "propertyName": "orderType",
                "mapping": {
                  "CmsDeo": "#/components/schemas/CourtOrders_CmsDeoResponse",
                  "AeoPriority": "#/components/schemas/CourtOrders_AeoPriorityResponse",
                  "AeoNonPriority": "#/components/schemas/CourtOrders_AeoNonPriorityResponse",
                  "Dea": "#/components/schemas/CourtOrders_DeaResponse",
                  "Ctaeo": "#/components/schemas/CourtOrders_CtaeoResponse",
                  "Ea": "#/components/schemas/CourtOrders_EaResponse",
                  "Mcaeo": "#/components/schemas/CourtOrders_McaeoResponse",
                  "Cma": "#/components/schemas/CourtOrders_CmaResponse",
                  "Cao": "#/components/schemas/CourtOrders_CaoResponse",
                  "NiFinesAeo": "#/components/schemas/CourtOrders_NiFinesAeoResponse",
                  "NiEjoAeo": "#/components/schemas/CourtOrders_NiEjoAeoResponse"
                }
              }
            },
            "nullable": true
          },
          "metadata": {
            "$ref": "#/components/schemas/CourtOrders_ContentMetadataResponse"
          }
        },
        "additionalProperties": false
      },
      "CourtOrders_ContentResponse_IEnumerable_PayeeResponse": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CourtOrders_PayeeResponse"
            },
            "nullable": true
          },
          "metadata": {
            "$ref": "#/components/schemas/CourtOrders_ContentMetadataResponse"
          }
        },
        "additionalProperties": false
      },
      "CourtOrders_ContentResponse_IReadOnlyList_AttachmentUploadResponse": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CourtOrders_AttachmentUploadResponse"
            },
            "nullable": true
          },
          "metadata": {
            "$ref": "#/components/schemas/CourtOrders_ContentMetadataResponse"
          }
        },
        "additionalProperties": false
      },
      "CourtOrders_ContentResponse_Object": {
        "type": "object",
        "properties": {
          "data": {
            "nullable": true
          },
          "metadata": {
            "$ref": "#/components/schemas/CourtOrders_ContentMetadataResponse"
          }
        },
        "additionalProperties": false
      },
      "CourtOrders_ContentResponse_PayeeResponse": {
        "type": "object",
        "properties": {
          "data": {
            "$ref": "#/components/schemas/CourtOrders_PayeeResponse"
          },
          "metadata": {
            "$ref": "#/components/schemas/CourtOrders_ContentMetadataResponse"
          }
        },
        "additionalProperties": false
      },
      "CourtOrders_CourtOrderAvailableTaxYearsResponse": {
        "type": "object",
        "properties": {
          "taxYears": {
            "type": "array",
            "items": {
              "type": "integer",
              "format": "int32"
            }
          }
        },
        "additionalProperties": false
      },
      "CourtOrders_CourtOrderConstantsAeoDto": {
        "type": "object",
        "properties": {
          "regular": {
            "$ref": "#/components/schemas/CourtOrders_CourtOrderConstantsAeoVariantDto"
          },
          "magistratesCourt": {
            "$ref": "#/components/schemas/CourtOrders_CourtOrderConstantsAeoVariantDto"
          }
        },
        "additionalProperties": false
      },
      "CourtOrders_CourtOrderConstantsAeoVariantDto": {
        "type": "object",
        "properties": {
          "tableA": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CourtOrders_DeductionBandDto"
            }
          },
          "tableB": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CourtOrders_DeductionBandDto"
            }
          },
          "tableC": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CourtOrders_DeductionBandDto"
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "CourtOrders_CourtOrderConstantsCmaDto": {
        "type": "object",
        "properties": {
          "protectedEarningsPerDay": {
            "type": "number",
            "format": "double"
          }
        },
        "additionalProperties": false
      },
      "CourtOrders_CourtOrderConstantsCmsDeoDto": {
        "type": "object",
        "properties": {
          "maxDeductionPercentage": {
            "type": "number",
            "format": "double"
          }
        },
        "additionalProperties": false
      },
      "CourtOrders_CourtOrderConstantsCtaeoDto": {
        "type": "object",
        "properties": {
          "maxDeductionPercentage": {
            "type": "number",
            "format": "double"
          },
          "excessDeductionPercentage": {
            "type": "number",
            "format": "double"
          },
          "england": {
            "$ref": "#/components/schemas/CourtOrders_CourtOrderConstantsCtaeoJurisdictionDto"
          },
          "wales": {
            "$ref": "#/components/schemas/CourtOrders_CourtOrderConstantsCtaeoJurisdictionDto"
          }
        },
        "additionalProperties": false
      },
      "CourtOrders_CourtOrderConstantsCtaeoJurisdictionDto": {
        "type": "object",
        "properties": {
          "weekly": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CourtOrders_DeductionBandDto"
            }
          },
          "monthly": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CourtOrders_DeductionBandDto"
            }
          },
          "daily": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CourtOrders_DeductionBandDto"
            }
          }
        },
        "additionalProperties": false
      },
      "CourtOrders_CourtOrderConstantsDeaDto": {
        "type": "object",
        "properties": {
          "combinedCapPercentage": {
            "type": "number",
            "format": "double"
          },
          "standardRate": {
            "$ref": "#/components/schemas/CourtOrders_CourtOrderConstantsDeaTablesDto"
          },
          "higherRate": {
            "$ref": "#/components/schemas/CourtOrders_CourtOrderConstantsDeaTablesDto"
          }
        },
        "additionalProperties": false
      },
      "CourtOrders_CourtOrderConstantsDeaTablesDto": {
        "type": "object",
        "properties": {
          "daily": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CourtOrders_DeductionBandDto"
            }
          },
          "weekly": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CourtOrders_DeductionBandDto"
            }
          },
          "monthly": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CourtOrders_DeductionBandDto"
            }
          }
        },
        "additionalProperties": false
      },
      "CourtOrders_CourtOrderConstantsEaDto": {
        "type": "object",
        "properties": {
          "tableA": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CourtOrders_EaDeductionBandDto"
            }
          },
          "tableB": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CourtOrders_EaDeductionBandDto"
            }
          },
          "tableC": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CourtOrders_EaDeductionBandDto"
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "CourtOrders_CourtOrderConstantsGlobalDto": {
        "type": "object",
        "properties": {
          "protectedEarningsPercentage": {
            "type": "number",
            "format": "double"
          },
          "adminFeeAmount": {
            "type": "number",
            "format": "double"
          },
          "cmsRemittanceDays": {
            "type": "integer",
            "format": "int32"
          },
          "otherRemittanceDay": {
            "type": "integer",
            "format": "int32"
          },
          "deaNoticeDays": {
            "type": "integer",
            "format": "int32"
          },
          "aeoCtaeoNoticeDays": {
            "type": "integer",
            "format": "int32"
          },
          "monetaryPrecision": {
            "type": "integer",
            "format": "int32"
          },
          "maximumPercentageValue": {
            "type": "integer",
            "format": "int32"
          },
          "percentageConversionFactor": {
            "type": "number",
            "format": "double"
          }
        },
        "additionalProperties": false
      },
      "CourtOrders_CourtOrderConstantsNiFinesAeoDto": {
        "type": "object",
        "properties": {
          "tableA": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CourtOrders_DeductionBandDto"
            }
          },
          "tableB": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CourtOrders_DeductionBandDto"
            }
          }
        },
        "additionalProperties": false
      },
      "CourtOrders_CourtOrderConstantsResponse": {
        "type": "object",
        "properties": {
          "global": {
            "$ref": "#/components/schemas/CourtOrders_CourtOrderConstantsGlobalDto"
          },
          "cmsDeo": {
            "$ref": "#/components/schemas/CourtOrders_CourtOrderConstantsCmsDeoDto"
          },
          "dea": {
            "$ref": "#/components/schemas/CourtOrders_CourtOrderConstantsDeaDto"
          },
          "ctaeo": {
            "$ref": "#/components/schemas/CourtOrders_CourtOrderConstantsCtaeoDto"
          },
          "aeo": {
            "$ref": "#/components/schemas/CourtOrders_CourtOrderConstantsAeoDto"
          },
          "ea": {
            "$ref": "#/components/schemas/CourtOrders_CourtOrderConstantsEaDto"
          },
          "cma": {
            "$ref": "#/components/schemas/CourtOrders_CourtOrderConstantsCmaDto"
          },
          "niFinesAeo": {
            "$ref": "#/components/schemas/CourtOrders_CourtOrderConstantsNiFinesAeoDto"
          }
        },
        "additionalProperties": false
      },
      "CourtOrders_CourtOrderListResponse": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "oneOf": [
                {
                  "$ref": "#/components/schemas/CourtOrders_CmsDeoResponse"
                },
                {
                  "$ref": "#/components/schemas/CourtOrders_AeoPriorityResponse"
                },
                {
                  "$ref": "#/components/schemas/CourtOrders_AeoNonPriorityResponse"
                },
                {
                  "$ref": "#/components/schemas/CourtOrders_DeaResponse"
                },
                {
                  "$ref": "#/components/schemas/CourtOrders_CtaeoResponse"
                },
                {
                  "$ref": "#/components/schemas/CourtOrders_EaResponse"
                },
                {
                  "$ref": "#/components/schemas/CourtOrders_McaeoResponse"
                },
                {
                  "$ref": "#/components/schemas/CourtOrders_CmaResponse"
                },
                {
                  "$ref": "#/components/schemas/CourtOrders_CaoResponse"
                },
                {
                  "$ref": "#/components/schemas/CourtOrders_NiFinesAeoResponse"
                },
                {
                  "$ref": "#/components/schemas/CourtOrders_NiEjoAeoResponse"
                }
              ],
              "discriminator": {
                "propertyName": "orderType",
                "mapping": {
                  "CmsDeo": "#/components/schemas/CourtOrders_CmsDeoResponse",
                  "AeoPriority": "#/components/schemas/CourtOrders_AeoPriorityResponse",
                  "AeoNonPriority": "#/components/schemas/CourtOrders_AeoNonPriorityResponse",
                  "Dea": "#/components/schemas/CourtOrders_DeaResponse",
                  "Ctaeo": "#/components/schemas/CourtOrders_CtaeoResponse",
                  "Ea": "#/components/schemas/CourtOrders_EaResponse",
                  "Mcaeo": "#/components/schemas/CourtOrders_McaeoResponse",
                  "Cma": "#/components/schemas/CourtOrders_CmaResponse",
                  "Cao": "#/components/schemas/CourtOrders_CaoResponse",
                  "NiFinesAeo": "#/components/schemas/CourtOrders_NiFinesAeoResponse",
                  "NiEjoAeo": "#/components/schemas/CourtOrders_NiEjoAeoResponse"
                }
              }
            }
          },
          "paginationToken": {
            "type": "string",
            "nullable": true
          },
          "hasMorePages": {
            "type": "boolean"
          },
          "pageSize": {
            "type": "integer",
            "format": "int32"
          }
        },
        "additionalProperties": false
      },
      "CourtOrders_CourtOrderResponse": {
        "allOf": [
          {
            "$ref": "#/components/schemas/CourtOrders_CourtOrderResponseBase"
          },
          {
            "required": [
              "orderType"
            ],
            "type": "object",
            "properties": {
              "orderType": {
                "type": "string"
              }
            },
            "additionalProperties": false,
            "discriminator": {
              "propertyName": "orderType",
              "mapping": {
                "AeoNonPriorityResponse": "#/components/schemas/CourtOrders_AeoNonPriorityResponse",
                "AeoPriorityResponse": "#/components/schemas/CourtOrders_AeoPriorityResponse",
                "CaoResponse": "#/components/schemas/CourtOrders_CaoResponse",
                "CmaResponse": "#/components/schemas/CourtOrders_CmaResponse",
                "CmsDeoResponse": "#/components/schemas/CourtOrders_CmsDeoResponse",
                "CtaeoResponse": "#/components/schemas/CourtOrders_CtaeoResponse",
                "DeaResponse": "#/components/schemas/CourtOrders_DeaResponse",
                "EaResponse": "#/components/schemas/CourtOrders_EaResponse",
                "McaeoResponse": "#/components/schemas/CourtOrders_McaeoResponse",
                "NiEjoAeoResponse": "#/components/schemas/CourtOrders_NiEjoAeoResponse",
                "NiFinesAeoResponse": "#/components/schemas/CourtOrders_NiFinesAeoResponse"
              }
            }
          }
        ],
        "oneOf": [
          {
            "$ref": "#/components/schemas/CourtOrders_CmsDeoResponse"
          },
          {
            "$ref": "#/components/schemas/CourtOrders_AeoPriorityResponse"
          },
          {
            "$ref": "#/components/schemas/CourtOrders_AeoNonPriorityResponse"
          },
          {
            "$ref": "#/components/schemas/CourtOrders_DeaResponse"
          },
          {
            "$ref": "#/components/schemas/CourtOrders_CtaeoResponse"
          },
          {
            "$ref": "#/components/schemas/CourtOrders_EaResponse"
          },
          {
            "$ref": "#/components/schemas/CourtOrders_McaeoResponse"
          },
          {
            "$ref": "#/components/schemas/CourtOrders_CmaResponse"
          },
          {
            "$ref": "#/components/schemas/CourtOrders_CaoResponse"
          },
          {
            "$ref": "#/components/schemas/CourtOrders_NiFinesAeoResponse"
          },
          {
            "$ref": "#/components/schemas/CourtOrders_NiEjoAeoResponse"
          }
        ],
        "discriminator": {
          "propertyName": "orderType",
          "mapping": {
            "CmsDeo": "#/components/schemas/CourtOrders_CmsDeoResponse",
            "AeoPriority": "#/components/schemas/CourtOrders_AeoPriorityResponse",
            "AeoNonPriority": "#/components/schemas/CourtOrders_AeoNonPriorityResponse",
            "Dea": "#/components/schemas/CourtOrders_DeaResponse",
            "Ctaeo": "#/components/schemas/CourtOrders_CtaeoResponse",
            "Ea": "#/components/schemas/CourtOrders_EaResponse",
            "Mcaeo": "#/components/schemas/CourtOrders_McaeoResponse",
            "Cma": "#/components/schemas/CourtOrders_CmaResponse",
            "Cao": "#/components/schemas/CourtOrders_CaoResponse",
            "NiFinesAeo": "#/components/schemas/CourtOrders_NiFinesAeoResponse",
            "NiEjoAeo": "#/components/schemas/CourtOrders_NiEjoAeoResponse"
          }
        }
      },
      "CourtOrders_CourtOrderResponseBase": {
        "required": [
          "orderType"
        ],
        "type": "object",
        "properties": {
          "orderType": {
            "enum": [
              "CmsDeo",
              "AeoPriority",
              "AeoNonPriority",
              "Dea",
              "Ctaeo",
              "Ea",
              "Mcaeo",
              "Cma",
              "Cao",
              "NiFinesAeo",
              "NiEjoAeo"
            ],
            "type": "string",
            "readOnly": true
          },
          "id": {
            "type": "string"
          },
          "organisationId": {
            "type": "string"
          },
          "employeeId": {
            "type": "string"
          },
          "reference": {
            "type": "string"
          },
          "issuingAuthority": {
            "type": "string"
          },
          "dateReceived": {
            "type": "string",
            "format": "date"
          },
          "startDate": {
            "type": "string",
            "format": "date"
          },
          "endDate": {
            "type": "string",
            "format": "date",
            "nullable": true
          },
          "status": {
            "enum": [
              "Active",
              "Suspended",
              "OnHoldNoEligibleEarnings",
              "Discharged"
            ],
            "type": "string"
          },
          "priorityLevel": {
            "enum": [
              "Cms",
              "PriorityOrders",
              "NonPriority",
              "StudentLoans"
            ],
            "type": "string"
          },
          "isPriorityOrder": {
            "type": "boolean"
          },
          "deductionBasis": {
            "enum": [
              "Table",
              "Percentage",
              "FixedAmount"
            ],
            "type": "string"
          },
          "fixedAmount": {
            "type": "number",
            "format": "double",
            "nullable": true
          },
          "percentage": {
            "type": "number",
            "format": "double",
            "nullable": true
          },
          "tableType": {
            "type": "string",
            "nullable": true
          },
          "totalAmountOwed": {
            "type": "number",
            "format": "double",
            "nullable": true
          },
          "previouslyPaid": {
            "type": "number",
            "format": "double",
            "nullable": true
          },
          "amountRepaidToDate": {
            "type": "number",
            "format": "double",
            "nullable": true
          },
          "remainingBalance": {
            "type": "number",
            "format": "double",
            "nullable": true
          },
          "instructionAmount": {
            "type": "number",
            "format": "double",
            "nullable": true
          },
          "protectedEarningsSetting": {
            "enum": [
              "None",
              "CourtPerAmount",
              "SixtyPercentOfNet",
              "TableImplied"
            ],
            "type": "string"
          },
          "protectedEarningsAmount": {
            "type": "number",
            "format": "double",
            "nullable": true
          },
          "shortfallCarryForward": {
            "type": "number",
            "format": "double",
            "nullable": true
          },
          "adminFeeApplied": {
            "type": "boolean"
          },
          "payeeId": {
            "type": "string",
            "nullable": true
          },
          "remittanceReference": {
            "type": "string"
          },
          "remittanceDeadline": {
            "enum": [
              "FiveDays",
              "NineteenthOfFollowingMonth",
              "AsSoonAsReasonablyPracticable",
              "AsTheOrderRequires"
            ],
            "type": "string"
          },
          "studentLoanInteraction": {
            "enum": [
              "Normal",
              "SuppressWhileActive",
              "RestrictByPer"
            ],
            "type": "string"
          },
          "notes": {
            "type": "string",
            "nullable": true
          },
          "createdDate": {
            "type": "string"
          },
          "createdBy": {
            "type": "string"
          },
          "updatedDate": {
            "type": "string"
          },
          "updatedBy": {
            "type": "string"
          },
          "lineItemSequence": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "lineItems": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CourtOrders_LineItemResponse"
            },
            "nullable": true
          },
          "attachments": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CourtOrders_AttachmentResponse"
            },
            "nullable": true
          },
          "uploadUrls": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CourtOrders_AttachmentUploadResponse"
            },
            "nullable": true
          }
        },
        "additionalProperties": false,
        "discriminator": {
          "propertyName": "orderType",
          "mapping": {
            "CmsDeo": "#/components/schemas/CourtOrders_CmsDeoResponse",
            "AeoPriority": "#/components/schemas/CourtOrders_AeoPriorityResponse",
            "AeoNonPriority": "#/components/schemas/CourtOrders_AeoNonPriorityResponse",
            "Dea": "#/components/schemas/CourtOrders_DeaResponse",
            "Ctaeo": "#/components/schemas/CourtOrders_CtaeoResponse",
            "Ea": "#/components/schemas/CourtOrders_EaResponse",
            "Mcaeo": "#/components/schemas/CourtOrders_McaeoResponse",
            "Cma": "#/components/schemas/CourtOrders_CmaResponse",
            "Cao": "#/components/schemas/CourtOrders_CaoResponse",
            "NiFinesAeo": "#/components/schemas/CourtOrders_NiFinesAeoResponse",
            "NiEjoAeo": "#/components/schemas/CourtOrders_NiEjoAeoResponse"
          }
        }
      },
      "CourtOrders_CreateAeoNonPriorityRequest": {
        "allOf": [
          {
            "$ref": "#/components/schemas/CourtOrders_CreateCourtOrderRequestBase"
          },
          {
            "required": [
              "aeoCategory"
            ],
            "type": "object",
            "properties": {
              "aeoCategory": {
                "enum": [
                  "PriorityFines",
                  "PriorityMaintenance",
                  "NonPriorityCivilDebt"
                ],
                "type": "string"
              },
              "calculationTable": {
                "enum": [
                  "TableA",
                  "TableB",
                  "TableC"
                ],
                "type": "string",
                "description": "Optional. The table is chosen from the employee's pay frequency, as the law sets the tables by pay interval; this value is kept for backward compatibility and only used when the pay frequency is unknown.",
                "nullable": true
              },
              "orderType": {
                "enum": [
                  "CmsDeo",
                  "AeoPriority",
                  "AeoNonPriority",
                  "Dea",
                  "Ctaeo",
                  "Ea",
                  "Mcaeo",
                  "Cma",
                  "Cao",
                  "NiFinesAeo",
                  "NiEjoAeo"
                ],
                "type": "string",
                "readOnly": true
              }
            },
            "additionalProperties": false
          }
        ],
        "description": "Request for creating an AEO Non-Priority order (civil debts). Required fields: AeoCategory, TotalAmountOwed, DeductionBasis. If DeductionBasis is Table, the table is chosen from the employee's pay frequency; CalculationTable is optional. If DeductionBasis is FixedAmount, FixedAmount is required. Type: Total owed (repaid in instalments until balance is zero)."
      },
      "CourtOrders_CreateAeoPriorityRequest": {
        "allOf": [
          {
            "$ref": "#/components/schemas/CourtOrders_CreateCourtOrderRequestBase"
          },
          {
            "required": [
              "aeoCategory"
            ],
            "type": "object",
            "properties": {
              "aeoCategory": {
                "enum": [
                  "PriorityFines",
                  "PriorityMaintenance",
                  "NonPriorityCivilDebt"
                ],
                "type": "string"
              },
              "calculationTable": {
                "enum": [
                  "TableA",
                  "TableB",
                  "TableC"
                ],
                "type": "string",
                "description": "Optional. The table is chosen from the employee's pay frequency, as the law sets the tables by pay interval; this value is kept for backward compatibility and only used when the pay frequency is unknown.",
                "nullable": true
              },
              "protectedEarningsRate": {
                "type": "number",
                "format": "double",
                "nullable": true
              },
              "orderType": {
                "enum": [
                  "CmsDeo",
                  "AeoPriority",
                  "AeoNonPriority",
                  "Dea",
                  "Ctaeo",
                  "Ea",
                  "Mcaeo",
                  "Cma",
                  "Cao",
                  "NiFinesAeo",
                  "NiEjoAeo"
                ],
                "type": "string",
                "readOnly": true
              }
            },
            "additionalProperties": false
          }
        ],
        "description": "Request for creating an AEO Priority order (fines or maintenance). Required fields: AeoCategory, TotalAmountOwed, DeductionBasis. If DeductionBasis is Table, the table is chosen from the employee's pay frequency; CalculationTable is optional. If DeductionBasis is FixedAmount, FixedAmount is required. If AeoCategory is PriorityFines, ProtectedEarningsRate is required. Type: Total owed (repaid in instalments until balance is zero)."
      },
      "CourtOrders_CreateAttachmentRequest": {
        "type": "object",
        "properties": {
          "filename": {
            "type": "string"
          },
          "contentType": {
            "type": "string"
          },
          "fileSize": {
            "type": "integer",
            "format": "int64"
          }
        },
        "additionalProperties": false
      },
      "CourtOrders_CreateCaoRequest": {
        "allOf": [
          {
            "$ref": "#/components/schemas/CourtOrders_CreateCourtOrderRequestBase"
          },
          {
            "type": "object",
            "properties": {
              "ordinaryDebtAmount": {
                "type": "number",
                "format": "double",
                "nullable": true
              },
              "maintenanceDailyRate": {
                "type": "number",
                "format": "double",
                "nullable": true
              },
              "orderType": {
                "enum": [
                  "CmsDeo",
                  "AeoPriority",
                  "AeoNonPriority",
                  "Dea",
                  "Ctaeo",
                  "Ea",
                  "Mcaeo",
                  "Cma",
                  "Cao",
                  "NiFinesAeo",
                  "NiEjoAeo"
                ],
                "type": "string",
                "readOnly": true
              }
            },
            "additionalProperties": false
          }
        ],
        "description": "Request for creating a conjoined arrestment order (Scotland). Enter OrdinaryDebtAmount (total of the ordinary debts), MaintenanceDailyRate (combined maintenance per day), or both; at least one must be more than 0. Ordinary debts are deducted using the earnings arrestment tables until the debts are paid; maintenance is worked out like a current maintenance arrestment on what is left. Replaces any earnings arrestment or current maintenance arrestment, so end those first. Starts 7 days after it is served. No student loan is deducted while it runs. Pay the sheriff clerk."
      },
      "CourtOrders_CreateCmaRequest": {
        "allOf": [
          {
            "$ref": "#/components/schemas/CourtOrders_CreateCourtOrderRequestBase"
          },
          {
            "required": [
              "dailyRate"
            ],
            "type": "object",
            "properties": {
              "dailyRate": {
                "type": "number",
                "format": "double"
              },
              "orderType": {
                "enum": [
                  "CmsDeo",
                  "AeoPriority",
                  "AeoNonPriority",
                  "Dea",
                  "Ctaeo",
                  "Ea",
                  "Mcaeo",
                  "Cma",
                  "Cao",
                  "NiFinesAeo",
                  "NiEjoAeo"
                ],
                "type": "string",
                "readOnly": true
              }
            },
            "additionalProperties": false
          }
        ],
        "description": "Request for creating a current maintenance arrestment (Scotland). Required fields: DailyRate (pounds per day; convert a monthly amount with x 12 / 365, a quarterly amount with x 4 / 365). Each pay day deducts the daily rate for every day since the last pay day a deduction was taken, but never takes net earnings below £24.66 a day. Missed days roll into the next pay day; nothing else is carried forward. Only one can run for an employee at a time. No student loan is deducted while it runs. Pay the creditor as soon as reasonably practicable."
      },
      "CourtOrders_CreateCmsDeoRequest": {
        "allOf": [
          {
            "$ref": "#/components/schemas/CourtOrders_CreateCourtOrderRequestBase"
          },
          {
            "required": [
              "deductionType"
            ],
            "type": "object",
            "properties": {
              "deductionType": {
                "enum": [
                  "Percentage",
                  "FixedAmount"
                ],
                "type": "string"
              },
              "percentageRate": {
                "type": "number",
                "description": "Deprecated: use percentage. A CMS DEO alias of percentage, used only when percentage is not sent; the two are always stored equal.",
                "format": "double",
                "nullable": true,
                "deprecated": true
              },
              "orderType": {
                "enum": [
                  "CmsDeo",
                  "AeoPriority",
                  "AeoNonPriority",
                  "Dea",
                  "Ctaeo",
                  "Ea",
                  "Mcaeo",
                  "Cma",
                  "Cao",
                  "NiFinesAeo",
                  "NiEjoAeo"
                ],
                "type": "string",
                "readOnly": true
              }
            },
            "additionalProperties": false
          }
        ],
        "description": "Request for creating a CMS DEO (Child Maintenance Service Deduction from Earnings Order). Required fields: DeductionType, RemittanceReference, DeductionBasis (Percentage or FixedAmount, matching DeductionType). If DeductionType is Percentage, Percentage is required (PercentageRate is a deprecated alias). If DeductionType is FixedAmount, FixedAmount is required. Type: Periodic (weekly/monthly deduction). Protected Earnings: 60% of net (automatic)."
      },
      "CourtOrders_CreateCourtOrderRequest": {
        "allOf": [
          {
            "$ref": "#/components/schemas/CourtOrders_CreateCourtOrderRequestBase"
          },
          {
            "type": "object",
            "additionalProperties": false
          }
        ]
      },
      "CourtOrders_CreateCourtOrderRequestBase": {
        "required": [
          "dateReceived",
          "employeeId",
          "issuingAuthority",
          "orderType",
          "reference",
          "remittanceReference"
        ],
        "type": "object",
        "properties": {
          "orderType": {
            "enum": [
              "CmsDeo",
              "AeoPriority",
              "AeoNonPriority",
              "Dea",
              "Ctaeo",
              "Ea",
              "Mcaeo",
              "Cma",
              "Cao",
              "NiFinesAeo",
              "NiEjoAeo"
            ],
            "type": "string",
            "readOnly": true
          },
          "employeeId": {
            "minLength": 1,
            "type": "string"
          },
          "reference": {
            "minLength": 1,
            "type": "string"
          },
          "issuingAuthority": {
            "minLength": 1,
            "type": "string"
          },
          "dateReceived": {
            "type": "string",
            "format": "date"
          },
          "payeeId": {
            "type": "string",
            "nullable": true
          },
          "remittanceReference": {
            "minLength": 1,
            "type": "string"
          },
          "startDate": {
            "type": "string",
            "format": "date",
            "nullable": true
          },
          "endDate": {
            "type": "string",
            "format": "date",
            "nullable": true
          },
          "deductionBasis": {
            "enum": [
              "Table",
              "Percentage",
              "FixedAmount"
            ],
            "type": "string",
            "description": "How the deduction is worked out. When creating: required for priority and non-priority AEOs, MCAEOs and CMS DEOs; leave it out for a council tax order, earnings arrestment, CMA, CAO and both Northern Ireland orders (always Table) and for a DEA (set from rateType); a different value is rejected. When updating: accepted for priority and non-priority AEOs only. An AEO for maintenance or a civil debt uses FixedAmount, the normal deduction rate the court set, with protectedEarningsSetting CourtPerAmount (Attachment of Earnings Act 1971 s6(5)); Table is for fines orders. An order created before this rule keeps its method until an update changes it."
          },
          "fixedAmount": {
            "type": "number",
            "format": "double",
            "nullable": true
          },
          "percentage": {
            "type": "number",
            "format": "double",
            "nullable": true
          },
          "tableType": {
            "type": "string",
            "description": "Optional. The table is chosen from the employee's pay frequency, as the law sets the tables by pay interval; this value is kept for backward compatibility and only used when the pay frequency is unknown.",
            "nullable": true
          },
          "totalAmountOwed": {
            "type": "number",
            "description": "The total the order collects. For a conjoined arrestment order it is the ordinary debts: leave it out, or send the same amount.",
            "format": "double",
            "nullable": true
          },
          "previouslyPaid": {
            "type": "number",
            "format": "double",
            "nullable": true
          },
          "protectedEarningsSetting": {
            "enum": [
              "None",
              "CourtPerAmount",
              "SixtyPercentOfNet",
              "TableImplied"
            ],
            "type": "string",
            "nullable": true
          },
          "protectedEarningsAmount": {
            "type": "number",
            "description": "The court's protected earnings rate. Only accepted with protectedEarningsSetting CourtPerAmount.",
            "format": "double",
            "nullable": true
          },
          "adminFeeApplied": {
            "type": "boolean"
          },
          "instructionAmount": {
            "type": "number",
            "description": "The amount per pay period from a revised notice; replaces the calculated deduction. Not accepted for a current maintenance arrestment, conjoined arrestment order or either Northern Ireland order: their own rates are used.",
            "format": "double",
            "nullable": true
          },
          "notes": {
            "type": "string",
            "nullable": true
          },
          "attachments": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CourtOrders_CreateAttachmentRequest"
            },
            "nullable": true
          }
        },
        "additionalProperties": false,
        "discriminator": {
          "propertyName": "orderType",
          "mapping": {
            "CmsDeo": "#/components/schemas/CourtOrders_CreateCmsDeoRequest",
            "AeoPriority": "#/components/schemas/CourtOrders_CreateAeoPriorityRequest",
            "AeoNonPriority": "#/components/schemas/CourtOrders_CreateAeoNonPriorityRequest",
            "Dea": "#/components/schemas/CourtOrders_CreateDeaRequest",
            "Ctaeo": "#/components/schemas/CourtOrders_CreateCtaeoRequest",
            "Ea": "#/components/schemas/CourtOrders_CreateEaRequest",
            "Mcaeo": "#/components/schemas/CourtOrders_CreateMcaeoRequest",
            "Cma": "#/components/schemas/CourtOrders_CreateCmaRequest",
            "Cao": "#/components/schemas/CourtOrders_CreateCaoRequest",
            "NiFinesAeo": "#/components/schemas/CourtOrders_CreateNiFinesAeoRequest",
            "NiEjoAeo": "#/components/schemas/CourtOrders_CreateNiEjoAeoRequest"
          }
        }
      },
      "CourtOrders_CreateCtaeoRequest": {
        "allOf": [
          {
            "$ref": "#/components/schemas/CourtOrders_CreateCourtOrderRequestBase"
          },
          {
            "required": [
              "localAuthority"
            ],
            "type": "object",
            "properties": {
              "localAuthority": {
                "minLength": 1,
                "type": "string"
              },
              "table": {
                "enum": [
                  "Weekly",
                  "Monthly",
                  "Daily"
                ],
                "type": "string",
                "description": "Optional. The table is chosen from the employee's pay frequency, as the law sets the tables by pay interval; this value is kept for backward compatibility and only used when the pay frequency is unknown.",
                "nullable": true
              },
              "jurisdiction": {
                "enum": [
                  "England",
                  "Wales"
                ],
                "type": "string",
                "nullable": true
              },
              "orderType": {
                "enum": [
                  "CmsDeo",
                  "AeoPriority",
                  "AeoNonPriority",
                  "Dea",
                  "Ctaeo",
                  "Ea",
                  "Mcaeo",
                  "Cma",
                  "Cao",
                  "NiFinesAeo",
                  "NiEjoAeo"
                ],
                "type": "string",
                "readOnly": true
              }
            },
            "additionalProperties": false
          }
        ],
        "description": "Request for creating a CTAEO (Council Tax Attachment of Earnings Order). Required fields: LocalAuthority, Jurisdiction (England or Wales). DeductionBasis: always Table; leave it out (any other value is rejected). Table is optional: the table is chosen from the employee's pay frequency. Type: Periodic (fixed % of net earnings per statutory tables). Multiple CTAEOs: Later orders applied to residue after earlier orders."
      },
      "CourtOrders_CreateDeaRequest": {
        "allOf": [
          {
            "$ref": "#/components/schemas/CourtOrders_CreateCourtOrderRequestBase"
          },
          {
            "type": "object",
            "properties": {
              "rateType": {
                "enum": [
                  "StandardTable",
                  "HigherRateTable",
                  "FixedAmount"
                ],
                "type": "string",
                "nullable": true
              },
              "orderType": {
                "enum": [
                  "CmsDeo",
                  "AeoPriority",
                  "AeoNonPriority",
                  "Dea",
                  "Ctaeo",
                  "Ea",
                  "Mcaeo",
                  "Cma",
                  "Cao",
                  "NiFinesAeo",
                  "NiEjoAeo"
                ],
                "type": "string",
                "readOnly": true
              }
            },
            "additionalProperties": false
          }
        ],
        "description": "Request for creating a DEA (Direct Earnings Attachment). Required fields: RateType. DeductionBasis is set from RateType and may be left out: StandardTable or HigherRateTable is Table; FixedAmount is FixedAmount (the amount DWP calculated) and needs FixedAmount greater than 0. A percentage is rejected, as is a DeductionBasis that contradicts RateType. Type: Periodic (band-based % or fixed amount per pay period). Protected Earnings: 60% of net (automatic). Multiple DEAs: Combined deductions capped at 20% of net earnings (unless higher-rate DEA)."
      },
      "CourtOrders_CreateEaRequest": {
        "allOf": [
          {
            "$ref": "#/components/schemas/CourtOrders_CreateCourtOrderRequestBase"
          },
          {
            "type": "object",
            "properties": {
              "table": {
                "enum": [
                  "TableA",
                  "TableB",
                  "TableC"
                ],
                "type": "string",
                "description": "Optional. The table is chosen from the employee's pay frequency, as the law sets the tables by pay interval; this value is kept for backward compatibility and only used when the pay frequency is unknown.",
                "nullable": true
              },
              "orderType": {
                "enum": [
                  "CmsDeo",
                  "AeoPriority",
                  "AeoNonPriority",
                  "Dea",
                  "Ctaeo",
                  "Ea",
                  "Mcaeo",
                  "Cma",
                  "Cao",
                  "NiFinesAeo",
                  "NiEjoAeo"
                ],
                "type": "string",
                "readOnly": true
              }
            },
            "additionalProperties": false
          }
        ],
        "description": "Request for creating an earnings arrestment (Scotland). Always worked out from the earnings arrestment tables (Debtors (Scotland) Act 1987 s49, Sch 2): leave DeductionBasis out; a fixed amount or percentage is rejected. Table is optional: the table is chosen from the employee's pay frequency. Protected earnings are built into the tables (TableImplied). No student loan is deducted while it runs. InstructionAmount, when sent, replaces the table amount."
      },
      "CourtOrders_CreateMcaeoRequest": {
        "allOf": [
          {
            "$ref": "#/components/schemas/CourtOrders_CreateCourtOrderRequestBase"
          },
          {
            "required": [
              "protectedEarningsRate"
            ],
            "type": "object",
            "properties": {
              "protectedEarningsRate": {
                "type": "number",
                "format": "double"
              },
              "calculationTable": {
                "enum": [
                  "TableA",
                  "TableB",
                  "TableC"
                ],
                "type": "string",
                "description": "Optional. The table is chosen from the employee's pay frequency, as the law sets the tables by pay interval; this value is kept for backward compatibility and only used when the pay frequency is unknown.",
                "nullable": true
              },
              "orderType": {
                "enum": [
                  "CmsDeo",
                  "AeoPriority",
                  "AeoNonPriority",
                  "Dea",
                  "Ctaeo",
                  "Ea",
                  "Mcaeo",
                  "Cma",
                  "Cao",
                  "NiFinesAeo",
                  "NiEjoAeo"
                ],
                "type": "string",
                "readOnly": true
              }
            },
            "additionalProperties": false
          }
        ],
        "description": "Request for creating a MCAEO (Magistrates Court Attachment of Earnings Order). Required fields: TotalAmountOwed, ProtectedEarningsRate (always required for MCAEO), DeductionBasis. If DeductionBasis is Table, the table is chosen from the employee's pay frequency; CalculationTable is optional. If DeductionBasis is FixedAmount, FixedAmount is required. Type: Total owed (repaid in instalments until balance is zero). Uses Magistrates Court deduction tables."
      },
      "CourtOrders_CreateNiEjoAeoRequest": {
        "allOf": [
          {
            "$ref": "#/components/schemas/CourtOrders_CreateCourtOrderRequestBase"
          },
          {
            "required": [
              "normalDeductionRate",
              "protectedEarningsRate",
              "ratePeriod"
            ],
            "type": "object",
            "properties": {
              "normalDeductionRate": {
                "type": "number",
                "format": "double"
              },
              "protectedEarningsRate": {
                "type": "number",
                "format": "double"
              },
              "ratePeriod": {
                "enum": [
                  "Weekly",
                  "Monthly",
                  "Daily"
                ],
                "type": "string",
                "nullable": true
              },
              "orderType": {
                "enum": [
                  "CmsDeo",
                  "AeoPriority",
                  "AeoNonPriority",
                  "Dea",
                  "Ctaeo",
                  "Ea",
                  "Mcaeo",
                  "Cma",
                  "Cao",
                  "NiFinesAeo",
                  "NiEjoAeo"
                ],
                "type": "string",
                "readOnly": true
              }
            },
            "additionalProperties": false
          }
        ],
        "description": "Request for creating an attachment of earnings order made by the Enforcement of Judgments Office (Northern Ireland). Required fields: NormalDeductionRate, ProtectedEarningsRate, RatePeriod (Weekly, Monthly or Daily), TotalAmountOwed. Each pay day deducts up to the normal rate for the time since the last pay day, but only from pay above the protected earnings for the same time. Unpaid amounts are not carried forward. Deducted after every priority order; student loan comes first. Orders made by a court rather than the Office are not supported."
      },
      "CourtOrders_CreateNiFinesAeoRequest": {
        "allOf": [
          {
            "$ref": "#/components/schemas/CourtOrders_CreateCourtOrderRequestBase"
          },
          {
            "type": "object",
            "properties": {
              "agreedHigherRatePercentage": {
                "type": "number",
                "format": "double",
                "nullable": true
              },
              "orderType": {
                "enum": [
                  "CmsDeo",
                  "AeoPriority",
                  "AeoNonPriority",
                  "Dea",
                  "Ctaeo",
                  "Ea",
                  "Mcaeo",
                  "Cma",
                  "Cao",
                  "NiFinesAeo",
                  "NiEjoAeo"
                ],
                "type": "string",
                "readOnly": true
              }
            },
            "additionalProperties": false
          }
        ],
        "description": "Request for creating an attachment of earnings order for fines (Northern Ireland). Required fields: TotalAmountOwed. Optional: AgreedHigherRatePercentage, a higher rate the employee agreed to. Weekly pay uses Table A and monthly pay Table B; other pay frequencies use the table for each week or month the pay covers (fortnightly and four-weekly: weekly table; quarterly, twice-yearly and yearly: monthly table; daily: weekly table pro rata). The rate applies to all net earnings, and at least 60% of net earnings is always left. A shortfall is collected on the next pay day, except one caused by an agreed higher rate. Stops when the total is paid. Student loan follows the general rule for a priority order with protected earnings (per CSLM18015). Pay by the 19th of the following month."
      },
      "CourtOrders_CreatePayeeRequest": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string"
          },
          "paymentMethod": {
            "enum": [
              "Bacs",
              "Cheque",
              "Card"
            ],
            "type": "string"
          },
          "bacsDetails": {
            "$ref": "#/components/schemas/CourtOrders_BacsDetails"
          }
        },
        "additionalProperties": false
      },
      "CourtOrders_CtaeoDetails": {
        "type": "object",
        "properties": {
          "localAuthority": {
            "type": "string"
          },
          "table": {
            "enum": [
              "Weekly",
              "Monthly",
              "Daily"
            ],
            "type": "string",
            "nullable": true
          },
          "jurisdiction": {
            "enum": [
              "England",
              "Wales"
            ],
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "CourtOrders_CtaeoResponse": {
        "allOf": [
          {
            "$ref": "#/components/schemas/CourtOrders_CourtOrderResponse"
          },
          {
            "type": "object",
            "properties": {
              "details": {
                "$ref": "#/components/schemas/CourtOrders_CtaeoDetails"
              },
              "orderType": {
                "enum": [
                  "CmsDeo",
                  "AeoPriority",
                  "AeoNonPriority",
                  "Dea",
                  "Ctaeo",
                  "Ea",
                  "Mcaeo",
                  "Cma",
                  "Cao",
                  "NiFinesAeo",
                  "NiEjoAeo"
                ],
                "type": "string",
                "readOnly": true
              }
            },
            "additionalProperties": false
          }
        ]
      },
      "CourtOrders_DeaDetails": {
        "type": "object",
        "properties": {
          "rateType": {
            "enum": [
              "StandardTable",
              "HigherRateTable",
              "FixedAmount"
            ],
            "type": "string",
            "nullable": true
          },
          "combinedCap": {
            "type": "number",
            "format": "double",
            "nullable": true
          },
          "firstPayDate": {
            "type": "string",
            "format": "date",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "CourtOrders_DeaResponse": {
        "allOf": [
          {
            "$ref": "#/components/schemas/CourtOrders_CourtOrderResponse"
          },
          {
            "type": "object",
            "properties": {
              "details": {
                "$ref": "#/components/schemas/CourtOrders_DeaDetails"
              },
              "orderType": {
                "enum": [
                  "CmsDeo",
                  "AeoPriority",
                  "AeoNonPriority",
                  "Dea",
                  "Ctaeo",
                  "Ea",
                  "Mcaeo",
                  "Cma",
                  "Cao",
                  "NiFinesAeo",
                  "NiEjoAeo"
                ],
                "type": "string",
                "readOnly": true
              }
            },
            "additionalProperties": false
          }
        ]
      },
      "CourtOrders_DeductionBandDto": {
        "type": "object",
        "properties": {
          "minNetEarnings": {
            "type": "number",
            "format": "double"
          },
          "maxNetEarnings": {
            "type": "number",
            "format": "double",
            "nullable": true
          },
          "percentage": {
            "type": "number",
            "format": "double"
          }
        },
        "additionalProperties": false
      },
      "CourtOrders_EaDeductionBandDto": {
        "type": "object",
        "properties": {
          "minNetEarnings": {
            "type": "number",
            "format": "double"
          },
          "maxNetEarnings": {
            "type": "number",
            "format": "double",
            "nullable": true
          },
          "fixedAmount": {
            "type": "number",
            "format": "double"
          },
          "percentage": {
            "type": "number",
            "format": "double"
          }
        },
        "additionalProperties": false
      },
      "CourtOrders_EaDetails": {
        "type": "object",
        "properties": {
          "table": {
            "enum": [
              "TableA",
              "TableB",
              "TableC"
            ],
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "CourtOrders_EaResponse": {
        "allOf": [
          {
            "$ref": "#/components/schemas/CourtOrders_CourtOrderResponse"
          },
          {
            "type": "object",
            "properties": {
              "details": {
                "$ref": "#/components/schemas/CourtOrders_EaDetails"
              },
              "orderType": {
                "enum": [
                  "CmsDeo",
                  "AeoPriority",
                  "AeoNonPriority",
                  "Dea",
                  "Ctaeo",
                  "Ea",
                  "Mcaeo",
                  "Cma",
                  "Cao",
                  "NiFinesAeo",
                  "NiEjoAeo"
                ],
                "type": "string",
                "readOnly": true
              }
            },
            "additionalProperties": false
          }
        ]
      },
      "CourtOrders_LineItemResponse": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "orderId": {
            "type": "string"
          },
          "lineItemSequence": {
            "type": "integer",
            "format": "int32"
          },
          "activityDate": {
            "type": "string",
            "format": "date"
          },
          "originalValue": {
            "type": "number",
            "format": "double"
          },
          "remainingValue": {
            "type": "number",
            "format": "double"
          },
          "paidAmount": {
            "type": "number",
            "format": "double"
          },
          "status": {
            "enum": [
              "Pending",
              "Paid",
              "Discharged",
              "PartiallyPaid"
            ],
            "type": "string"
          },
          "createdDate": {
            "type": "string"
          },
          "updatedDate": {
            "type": "string"
          },
          "expectedDeduction": {
            "type": "number",
            "format": "double"
          },
          "wasReducedByProtectedEarnings": {
            "type": "boolean"
          }
        },
        "additionalProperties": false
      },
      "CourtOrders_McaeoDetails": {
        "type": "object",
        "properties": {
          "calculationTable": {
            "enum": [
              "TableA",
              "TableB",
              "TableC"
            ],
            "type": "string",
            "nullable": true
          },
          "protectedEarningsRate": {
            "type": "number",
            "format": "double",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "CourtOrders_McaeoResponse": {
        "allOf": [
          {
            "$ref": "#/components/schemas/CourtOrders_CourtOrderResponse"
          },
          {
            "type": "object",
            "properties": {
              "details": {
                "$ref": "#/components/schemas/CourtOrders_McaeoDetails"
              },
              "orderType": {
                "enum": [
                  "CmsDeo",
                  "AeoPriority",
                  "AeoNonPriority",
                  "Dea",
                  "Ctaeo",
                  "Ea",
                  "Mcaeo",
                  "Cma",
                  "Cao",
                  "NiFinesAeo",
                  "NiEjoAeo"
                ],
                "type": "string",
                "readOnly": true
              }
            },
            "additionalProperties": false
          }
        ]
      },
      "CourtOrders_MessageWithTokenResponse": {
        "type": "object",
        "properties": {
          "text": {
            "type": "string"
          },
          "token": {
            "type": "string"
          },
          "tokenArguments": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CourtOrders_ValidationIssueArgument"
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "CourtOrders_NiEjoAeoDetails": {
        "type": "object",
        "properties": {
          "normalDeductionRate": {
            "type": "number",
            "format": "double",
            "nullable": true
          },
          "protectedEarningsRate": {
            "type": "number",
            "format": "double",
            "nullable": true
          },
          "ratePeriod": {
            "enum": [
              "Weekly",
              "Monthly",
              "Daily"
            ],
            "type": "string",
            "nullable": true
          },
          "lastPayDate": {
            "type": "string",
            "format": "date",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "CourtOrders_NiEjoAeoResponse": {
        "allOf": [
          {
            "$ref": "#/components/schemas/CourtOrders_CourtOrderResponse"
          },
          {
            "type": "object",
            "properties": {
              "details": {
                "$ref": "#/components/schemas/CourtOrders_NiEjoAeoDetails"
              },
              "orderType": {
                "enum": [
                  "CmsDeo",
                  "AeoPriority",
                  "AeoNonPriority",
                  "Dea",
                  "Ctaeo",
                  "Ea",
                  "Mcaeo",
                  "Cma",
                  "Cao",
                  "NiFinesAeo",
                  "NiEjoAeo"
                ],
                "type": "string",
                "readOnly": true
              }
            },
            "additionalProperties": false
          }
        ]
      },
      "CourtOrders_NiFinesAeoDetails": {
        "type": "object",
        "properties": {
          "agreedHigherRatePercentage": {
            "type": "number",
            "format": "double",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "CourtOrders_NiFinesAeoResponse": {
        "allOf": [
          {
            "$ref": "#/components/schemas/CourtOrders_CourtOrderResponse"
          },
          {
            "type": "object",
            "properties": {
              "details": {
                "$ref": "#/components/schemas/CourtOrders_NiFinesAeoDetails"
              },
              "orderType": {
                "enum": [
                  "CmsDeo",
                  "AeoPriority",
                  "AeoNonPriority",
                  "Dea",
                  "Ctaeo",
                  "Ea",
                  "Mcaeo",
                  "Cma",
                  "Cao",
                  "NiFinesAeo",
                  "NiEjoAeo"
                ],
                "type": "string",
                "readOnly": true
              }
            },
            "additionalProperties": false
          }
        ]
      },
      "CourtOrders_PayeeResponse": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "organisationId": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "paymentMethod": {
            "enum": [
              "Bacs",
              "Cheque",
              "Card"
            ],
            "type": "string"
          },
          "bacsDetails": {
            "$ref": "#/components/schemas/CourtOrders_BacsDetails"
          },
          "createdDate": {
            "type": "string"
          },
          "createdBy": {
            "type": "string"
          },
          "updatedDate": {
            "type": "string"
          },
          "updatedBy": {
            "type": "string"
          }
        },
        "additionalProperties": false
      },
      "CourtOrders_ResponseBody_Boolean": {
        "type": "object",
        "properties": {
          "message": {
            "$ref": "#/components/schemas/CourtOrders_MessageWithTokenResponse"
          },
          "content": {
            "$ref": "#/components/schemas/CourtOrders_ContentResponse_Boolean"
          },
          "validationIssues": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CourtOrders_ValidationIssue"
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "CourtOrders_ResponseBody_CourtOrderAvailableTaxYearsResponse": {
        "type": "object",
        "properties": {
          "message": {
            "$ref": "#/components/schemas/CourtOrders_MessageWithTokenResponse"
          },
          "content": {
            "$ref": "#/components/schemas/CourtOrders_ContentResponse_CourtOrderAvailableTaxYearsResponse"
          },
          "validationIssues": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CourtOrders_ValidationIssue"
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "CourtOrders_ResponseBody_CourtOrderConstantsResponse": {
        "type": "object",
        "properties": {
          "message": {
            "$ref": "#/components/schemas/CourtOrders_MessageWithTokenResponse"
          },
          "content": {
            "$ref": "#/components/schemas/CourtOrders_ContentResponse_CourtOrderConstantsResponse"
          },
          "validationIssues": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CourtOrders_ValidationIssue"
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "CourtOrders_ResponseBody_CourtOrderListResponse": {
        "type": "object",
        "properties": {
          "message": {
            "$ref": "#/components/schemas/CourtOrders_MessageWithTokenResponse"
          },
          "content": {
            "$ref": "#/components/schemas/CourtOrders_ContentResponse_CourtOrderListResponse"
          },
          "validationIssues": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CourtOrders_ValidationIssue"
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "CourtOrders_ResponseBody_CourtOrderResponse": {
        "type": "object",
        "properties": {
          "message": {
            "$ref": "#/components/schemas/CourtOrders_MessageWithTokenResponse"
          },
          "content": {
            "$ref": "#/components/schemas/CourtOrders_ContentResponse_CourtOrderResponse"
          },
          "validationIssues": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CourtOrders_ValidationIssue"
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "CourtOrders_ResponseBody_IEnumerable_CourtOrderResponse": {
        "type": "object",
        "properties": {
          "message": {
            "$ref": "#/components/schemas/CourtOrders_MessageWithTokenResponse"
          },
          "content": {
            "$ref": "#/components/schemas/CourtOrders_ContentResponse_IEnumerable_CourtOrderResponse"
          },
          "validationIssues": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CourtOrders_ValidationIssue"
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "CourtOrders_ResponseBody_IEnumerable_PayeeResponse": {
        "type": "object",
        "properties": {
          "message": {
            "$ref": "#/components/schemas/CourtOrders_MessageWithTokenResponse"
          },
          "content": {
            "$ref": "#/components/schemas/CourtOrders_ContentResponse_IEnumerable_PayeeResponse"
          },
          "validationIssues": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CourtOrders_ValidationIssue"
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "CourtOrders_ResponseBody_IReadOnlyList_AttachmentUploadResponse": {
        "type": "object",
        "properties": {
          "message": {
            "$ref": "#/components/schemas/CourtOrders_MessageWithTokenResponse"
          },
          "content": {
            "$ref": "#/components/schemas/CourtOrders_ContentResponse_IReadOnlyList_AttachmentUploadResponse"
          },
          "validationIssues": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CourtOrders_ValidationIssue"
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "CourtOrders_ResponseBody_Object": {
        "type": "object",
        "properties": {
          "message": {
            "$ref": "#/components/schemas/CourtOrders_MessageWithTokenResponse"
          },
          "content": {
            "$ref": "#/components/schemas/CourtOrders_ContentResponse_Object"
          },
          "validationIssues": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CourtOrders_ValidationIssue"
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "CourtOrders_ResponseBody_PayeeResponse": {
        "type": "object",
        "properties": {
          "message": {
            "$ref": "#/components/schemas/CourtOrders_MessageWithTokenResponse"
          },
          "content": {
            "$ref": "#/components/schemas/CourtOrders_ContentResponse_PayeeResponse"
          },
          "validationIssues": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CourtOrders_ValidationIssue"
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "CourtOrders_UpdateCourtOrderRequest": {
        "type": "object",
        "properties": {
          "reference": {
            "type": "string",
            "nullable": true
          },
          "issuingAuthority": {
            "type": "string",
            "nullable": true
          },
          "dateReceived": {
            "type": "string",
            "format": "date",
            "nullable": true
          },
          "status": {
            "enum": [
              "Active",
              "Suspended",
              "OnHoldNoEligibleEarnings",
              "Discharged"
            ],
            "type": "string",
            "nullable": true
          },
          "startDate": {
            "type": "string",
            "format": "date",
            "nullable": true
          },
          "endDate": {
            "type": "string",
            "format": "date",
            "nullable": true
          },
          "fixedAmount": {
            "type": "number",
            "format": "double",
            "nullable": true
          },
          "percentage": {
            "type": "number",
            "format": "double",
            "nullable": true
          },
          "previouslyPaid": {
            "type": "number",
            "format": "double",
            "nullable": true
          },
          "amountRepaidToDate": {
            "type": "number",
            "format": "double",
            "nullable": true
          },
          "instructionAmount": {
            "type": "number",
            "description": "The amount per pay period from a revised notice; replaces the calculated deduction. Not accepted for a current maintenance arrestment, conjoined arrestment order or either Northern Ireland order: their own rates are used.",
            "format": "double",
            "nullable": true
          },
          "protectedEarningsSetting": {
            "enum": [
              "None",
              "CourtPerAmount",
              "SixtyPercentOfNet",
              "TableImplied"
            ],
            "type": "string",
            "nullable": true
          },
          "protectedEarningsAmount": {
            "type": "number",
            "description": "The court's protected earnings rate. Only accepted with protectedEarningsSetting CourtPerAmount.",
            "format": "double",
            "nullable": true
          },
          "adminFeeApplied": {
            "type": "boolean",
            "nullable": true
          },
          "payeeId": {
            "type": "string",
            "nullable": true
          },
          "remittanceReference": {
            "type": "string",
            "nullable": true
          },
          "notes": {
            "type": "string",
            "nullable": true
          },
          "rateType": {
            "enum": [
              "StandardTable",
              "HigherRateTable",
              "FixedAmount"
            ],
            "type": "string",
            "description": "DEA only: the rate on a varied DWP notice. A table rate clears any fixed amount; FixedAmount needs fixedAmount greater than 0. Only applied when sent; rejected for any other order type.",
            "nullable": true
          },
          "dailyRate": {
            "type": "number",
            "description": "Current maintenance arrestment only: the new maintenance per day, in pounds. Only applied when sent; rejected for any other order type.",
            "format": "double",
            "nullable": true
          },
          "ordinaryDebtAmount": {
            "type": "number",
            "description": "Conjoined arrestment order only: the ordinary debts on the varied order. Also becomes the total owed and recalculates the remaining balance; 0 leaves maintenance only, with no total. Only applied when sent; rejected for any other order type.",
            "format": "double",
            "nullable": true
          },
          "maintenanceDailyRate": {
            "type": "number",
            "description": "Conjoined arrestment order only: the combined maintenance per day, in pounds. Only applied when sent; rejected for any other order type.",
            "format": "double",
            "nullable": true
          },
          "agreedHigherRatePercentage": {
            "type": "number",
            "description": "Northern Ireland fines order only: a new higher rate the employee agreed to. Only applied when sent; rejected for any other order type.",
            "format": "double",
            "nullable": true
          },
          "normalDeductionRate": {
            "type": "number",
            "description": "Enforcement of Judgments Office order only: the varied normal deduction rate. Only applied when sent; rejected for any other order type.",
            "format": "double",
            "nullable": true
          },
          "protectedEarningsRate": {
            "type": "number",
            "description": "Enforcement of Judgments Office order only: the varied protected earnings rate. For other orders use protectedEarningsAmount. Only applied when sent; rejected for any other order type.",
            "format": "double",
            "nullable": true
          },
          "ratePeriod": {
            "enum": [
              "Weekly",
              "Monthly",
              "Daily"
            ],
            "type": "string",
            "description": "Enforcement of Judgments Office order only: whether the varied rates are per week, per month or per day. Only applied when sent; rejected for any other order type.",
            "nullable": true
          },
          "percentageRate": {
            "type": "number",
            "description": "Deprecated: use percentage. A CMS DEO alias of percentage, used only when percentage is not sent; the two are always stored equal.",
            "format": "double",
            "nullable": true,
            "deprecated": true
          },
          "deductionBasis": {
            "enum": [
              "Table",
              "Percentage",
              "FixedAmount"
            ],
            "type": "string",
            "description": "How the deduction is worked out. When creating: required for priority and non-priority AEOs, MCAEOs and CMS DEOs; leave it out for a council tax order, earnings arrestment, CMA, CAO and both Northern Ireland orders (always Table) and for a DEA (set from rateType); a different value is rejected. When updating: accepted for priority and non-priority AEOs only. An AEO for maintenance or a civil debt uses FixedAmount, the normal deduction rate the court set, with protectedEarningsSetting CourtPerAmount (Attachment of Earnings Act 1971 s6(5)); Table is for fines orders. An order created before this rule keeps its method until an update changes it.",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "CourtOrders_UpdatePayeeRequest": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "nullable": true
          },
          "paymentMethod": {
            "enum": [
              "Bacs",
              "Cheque",
              "Card"
            ],
            "type": "string",
            "nullable": true
          },
          "bacsDetails": {
            "$ref": "#/components/schemas/CourtOrders_BacsDetails"
          }
        },
        "additionalProperties": false
      },
      "CourtOrders_ValidationIssue": {
        "type": "object",
        "properties": {
          "field": {
            "type": "string"
          },
          "reason": {
            "type": "string"
          },
          "reasonToken": {
            "type": "string"
          },
          "reasonTokenArguments": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CourtOrders_ValidationIssueArgument"
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "CourtOrders_ValidationIssueArgument": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string"
          },
          "value": {
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Holiday_ApiErrorResponse": {
        "type": "object",
        "properties": {
          "message": {
            "$ref": "#/components/schemas/Holiday_MessageWithTokenResponse"
          },
          "validationIssues": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Holiday_ValidationIssue"
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Holiday_ContentMetadataResponse": {
        "type": "object",
        "properties": {
          "dateFormat": {
            "type": "string"
          },
          "dateTimeFormat": {
            "type": "string"
          },
          "paginationToken": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Holiday_ContentResponse_HolidayAverageRateResponse": {
        "type": "object",
        "properties": {
          "data": {
            "$ref": "#/components/schemas/Holiday_HolidayAverageRateResponse"
          },
          "metadata": {
            "$ref": "#/components/schemas/Holiday_ContentMetadataResponse"
          }
        },
        "additionalProperties": false
      },
      "Holiday_ContentResponse_HolidayEmployeeConfigurationResponse": {
        "type": "object",
        "properties": {
          "data": {
            "$ref": "#/components/schemas/Holiday_HolidayEmployeeConfigurationResponse"
          },
          "metadata": {
            "$ref": "#/components/schemas/Holiday_ContentMetadataResponse"
          }
        },
        "additionalProperties": false
      },
      "Holiday_ContentResponse_HolidayHistoryResponse": {
        "type": "object",
        "properties": {
          "data": {
            "$ref": "#/components/schemas/Holiday_HolidayHistoryResponse"
          },
          "metadata": {
            "$ref": "#/components/schemas/Holiday_ContentMetadataResponse"
          }
        },
        "additionalProperties": false
      },
      "Holiday_ContentResponse_HolidayLeaveResponse": {
        "type": "object",
        "properties": {
          "data": {
            "$ref": "#/components/schemas/Holiday_HolidayLeaveResponse"
          },
          "metadata": {
            "$ref": "#/components/schemas/Holiday_ContentMetadataResponse"
          }
        },
        "additionalProperties": false
      },
      "Holiday_ContentResponse_HolidayOpeningBalanceResponse": {
        "type": "object",
        "properties": {
          "data": {
            "$ref": "#/components/schemas/Holiday_HolidayOpeningBalanceResponse"
          },
          "metadata": {
            "$ref": "#/components/schemas/Holiday_ContentMetadataResponse"
          }
        },
        "additionalProperties": false
      },
      "Holiday_ContentResponse_HolidayOrganisationConfigurationResponse": {
        "type": "object",
        "properties": {
          "data": {
            "$ref": "#/components/schemas/Holiday_HolidayOrganisationConfigurationResponse"
          },
          "metadata": {
            "$ref": "#/components/schemas/Holiday_ContentMetadataResponse"
          }
        },
        "additionalProperties": false
      },
      "Holiday_ContentResponse_Object": {
        "type": "object",
        "properties": {
          "data": {},
          "metadata": {
            "$ref": "#/components/schemas/Holiday_ContentMetadataResponse"
          }
        },
        "additionalProperties": false
      },
      "Holiday_CreateHolidayEmployeeConfigurationRequest": {
        "type": "object",
        "properties": {
          "holidayAccrualType": {
            "enum": [
              "PercentageOfTime",
              "RolledUp"
            ],
            "type": "string"
          },
          "accrualResetMonth": {
            "type": "integer",
            "format": "int32"
          },
          "accrualResetDay": {
            "type": "integer",
            "format": "int32"
          },
          "percentageOfTime": {
            "$ref": "#/components/schemas/Holiday_PercentageOfTimeConfigurationDto"
          },
          "rolledUp": {
            "$ref": "#/components/schemas/Holiday_RolledUpConfigurationDto"
          }
        },
        "additionalProperties": false
      },
      "Holiday_CreateHolidayLeaveRequest": {
        "type": "object",
        "properties": {
          "date": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "hours": {
            "type": "number",
            "format": "double",
            "nullable": true
          },
          "rate": {
            "type": "number",
            "format": "double",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Holiday_CreateHolidayOpeningBalanceRequest": {
        "type": "object",
        "properties": {
          "description": {
            "type": "string"
          },
          "percentageOfTime": {
            "$ref": "#/components/schemas/Holiday_PercentageOfTimeOpeningBalanceDto"
          }
        },
        "additionalProperties": false
      },
      "Holiday_CreateHolidayOrganisationConfigurationRequest": {
        "type": "object",
        "properties": {
          "holidayAccrualType": {
            "enum": [
              "PercentageOfTime",
              "RolledUp"
            ],
            "type": "string"
          },
          "accrualResetMonth": {
            "type": "integer",
            "format": "int32"
          },
          "accrualResetDay": {
            "type": "integer",
            "format": "int32"
          },
          "percentageOfTime": {
            "$ref": "#/components/schemas/Holiday_PercentageOfTimeConfigurationDto"
          },
          "rolledUp": {
            "$ref": "#/components/schemas/Holiday_RolledUpConfigurationDto"
          }
        },
        "additionalProperties": false
      },
      "Holiday_HolidayAverageRateResponse": {
        "type": "object",
        "properties": {
          "averageRate": {
            "type": "number",
            "format": "double",
            "nullable": true
          },
          "weeksInAverage": {
            "type": "number",
            "format": "double"
          }
        },
        "additionalProperties": false
      },
      "Holiday_HolidayEmployeeConfigurationResponse": {
        "type": "object",
        "properties": {
          "employeeId": {
            "type": "string"
          },
          "holidayAccrualType": {
            "enum": [
              "PercentageOfTime",
              "RolledUp"
            ],
            "type": "string"
          },
          "accrualResetMonth": {
            "type": "integer",
            "format": "int32"
          },
          "accrualResetDay": {
            "type": "integer",
            "format": "int32"
          },
          "percentageOfTime": {
            "$ref": "#/components/schemas/Holiday_PercentageOfTimeConfigurationDto"
          },
          "rolledUp": {
            "$ref": "#/components/schemas/Holiday_RolledUpConfigurationDto"
          },
          "createdBy": {
            "type": "string"
          },
          "createdDate": {
            "type": "string",
            "format": "date-time"
          },
          "updatedBy": {
            "type": "string"
          },
          "updatedDate": {
            "type": "string",
            "format": "date-time"
          }
        },
        "additionalProperties": false
      },
      "Holiday_HolidayHistoryResponse": {
        "type": "object",
        "properties": {
          "yearlySummaries": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Holiday_YearlySummaryDto"
            }
          },
          "transactions": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Holiday_HolidayTransactionDto"
            }
          }
        },
        "additionalProperties": false
      },
      "Holiday_HolidayLeaveResponse": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "organisationId": {
            "type": "string"
          },
          "employeeId": {
            "type": "string"
          },
          "date": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "hours": {
            "type": "number",
            "format": "double",
            "nullable": true
          },
          "rate": {
            "type": "number",
            "format": "double",
            "nullable": true
          },
          "value": {
            "type": "number",
            "format": "double",
            "nullable": true
          },
          "createdBy": {
            "type": "string"
          },
          "createdDate": {
            "type": "string",
            "format": "date-time"
          },
          "updatedBy": {
            "type": "string"
          },
          "updatedDate": {
            "type": "string",
            "format": "date-time"
          }
        },
        "additionalProperties": false
      },
      "Holiday_HolidayOpeningBalanceResponse": {
        "type": "object",
        "properties": {
          "organisationId": {
            "type": "string"
          },
          "employeeId": {
            "type": "string"
          },
          "percentageOfTime": {
            "$ref": "#/components/schemas/Holiday_PercentageOfTimeOpeningBalanceDto"
          },
          "createdBy": {
            "type": "string"
          },
          "createdDate": {
            "type": "string",
            "format": "date-time"
          },
          "updatedBy": {
            "type": "string"
          },
          "updatedDate": {
            "type": "string",
            "format": "date-time"
          }
        },
        "additionalProperties": false
      },
      "Holiday_HolidayOrganisationConfigurationResponse": {
        "type": "object",
        "properties": {
          "organisationId": {
            "type": "string"
          },
          "configId": {
            "type": "string"
          },
          "holidayAccrualType": {
            "enum": [
              "PercentageOfTime",
              "RolledUp"
            ],
            "type": "string"
          },
          "accrualResetMonth": {
            "type": "integer",
            "format": "int32"
          },
          "accrualResetDay": {
            "type": "integer",
            "format": "int32"
          },
          "percentageOfTime": {
            "$ref": "#/components/schemas/Holiday_PercentageOfTimeConfigurationDto"
          },
          "rolledUp": {
            "$ref": "#/components/schemas/Holiday_RolledUpConfigurationDto"
          },
          "createdBy": {
            "type": "string"
          },
          "createdDate": {
            "type": "string",
            "format": "date-time"
          },
          "updatedBy": {
            "type": "string"
          },
          "updatedDate": {
            "type": "string",
            "format": "date-time"
          }
        },
        "additionalProperties": false
      },
      "Holiday_HolidayTransactionDto": {
        "required": [
          "id"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "date": {
            "type": "string"
          },
          "type": {
            "type": "string"
          },
          "description": {
            "type": "string",
            "nullable": true
          },
          "baseHours": {
            "type": "number",
            "format": "double",
            "nullable": true
          },
          "baseValue": {
            "type": "number",
            "format": "double",
            "nullable": true
          },
          "hours": {
            "type": "number",
            "format": "double",
            "nullable": true
          },
          "value": {
            "type": "number",
            "format": "double",
            "nullable": true
          },
          "configType": {
            "type": "string",
            "nullable": true
          },
          "configRate": {
            "type": "number",
            "format": "double",
            "nullable": true
          },
          "averageRate": {
            "type": "number",
            "format": "double",
            "nullable": true
          },
          "weeksCount": {
            "type": "number",
            "format": "double",
            "nullable": true
          },
          "balanceHours": {
            "type": "number",
            "format": "double",
            "nullable": true
          },
          "balanceValue": {
            "type": "number",
            "format": "double",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Holiday_MessageWithTokenResponse": {
        "type": "object",
        "properties": {
          "text": {
            "type": "string"
          },
          "token": {
            "type": "string"
          },
          "tokenArguments": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Holiday_ValidationIssueArgument"
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Holiday_PercentageOfTimeConfigurationDto": {
        "type": "object",
        "properties": {
          "accrualRatePercentage": {
            "type": "number",
            "format": "double"
          }
        },
        "additionalProperties": false
      },
      "Holiday_PercentageOfTimeOpeningBalanceDto": {
        "type": "object",
        "properties": {
          "weeksCount": {
            "type": "integer",
            "format": "int32"
          },
          "baseHours": {
            "type": "number",
            "format": "double"
          },
          "baseGross": {
            "type": "number",
            "format": "double"
          }
        },
        "additionalProperties": false
      },
      "Holiday_ResponseBody_HolidayAverageRateResponse": {
        "type": "object",
        "properties": {
          "message": {
            "$ref": "#/components/schemas/Holiday_MessageWithTokenResponse"
          },
          "content": {
            "$ref": "#/components/schemas/Holiday_ContentResponse_HolidayAverageRateResponse"
          },
          "validationIssues": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Holiday_ValidationIssue"
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Holiday_ResponseBody_HolidayEmployeeConfigurationResponse": {
        "type": "object",
        "properties": {
          "message": {
            "$ref": "#/components/schemas/Holiday_MessageWithTokenResponse"
          },
          "content": {
            "$ref": "#/components/schemas/Holiday_ContentResponse_HolidayEmployeeConfigurationResponse"
          },
          "validationIssues": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Holiday_ValidationIssue"
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Holiday_ResponseBody_HolidayHistoryResponse": {
        "type": "object",
        "properties": {
          "message": {
            "$ref": "#/components/schemas/Holiday_MessageWithTokenResponse"
          },
          "content": {
            "$ref": "#/components/schemas/Holiday_ContentResponse_HolidayHistoryResponse"
          },
          "validationIssues": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Holiday_ValidationIssue"
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Holiday_ResponseBody_HolidayLeaveResponse": {
        "type": "object",
        "properties": {
          "message": {
            "$ref": "#/components/schemas/Holiday_MessageWithTokenResponse"
          },
          "content": {
            "$ref": "#/components/schemas/Holiday_ContentResponse_HolidayLeaveResponse"
          },
          "validationIssues": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Holiday_ValidationIssue"
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Holiday_ResponseBody_HolidayOpeningBalanceResponse": {
        "type": "object",
        "properties": {
          "message": {
            "$ref": "#/components/schemas/Holiday_MessageWithTokenResponse"
          },
          "content": {
            "$ref": "#/components/schemas/Holiday_ContentResponse_HolidayOpeningBalanceResponse"
          },
          "validationIssues": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Holiday_ValidationIssue"
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Holiday_ResponseBody_HolidayOrganisationConfigurationResponse": {
        "type": "object",
        "properties": {
          "message": {
            "$ref": "#/components/schemas/Holiday_MessageWithTokenResponse"
          },
          "content": {
            "$ref": "#/components/schemas/Holiday_ContentResponse_HolidayOrganisationConfigurationResponse"
          },
          "validationIssues": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Holiday_ValidationIssue"
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Holiday_ResponseBody_Object": {
        "type": "object",
        "properties": {
          "message": {
            "$ref": "#/components/schemas/Holiday_MessageWithTokenResponse"
          },
          "content": {
            "$ref": "#/components/schemas/Holiday_ContentResponse_Object"
          },
          "validationIssues": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Holiday_ValidationIssue"
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Holiday_RolledUpConfigurationDto": {
        "type": "object",
        "properties": {
          "payRatePercentage": {
            "type": "number",
            "format": "double"
          }
        },
        "additionalProperties": false
      },
      "Holiday_UpdateHolidayEmployeeConfigurationRequest": {
        "type": "object",
        "properties": {
          "holidayAccrualType": {
            "enum": [
              "PercentageOfTime",
              "RolledUp"
            ],
            "type": "string"
          },
          "accrualResetMonth": {
            "type": "integer",
            "format": "int32"
          },
          "accrualResetDay": {
            "type": "integer",
            "format": "int32"
          },
          "percentageOfTime": {
            "$ref": "#/components/schemas/Holiday_PercentageOfTimeConfigurationDto"
          },
          "rolledUp": {
            "$ref": "#/components/schemas/Holiday_RolledUpConfigurationDto"
          }
        },
        "additionalProperties": false
      },
      "Holiday_UpdateHolidayLeaveRequest": {
        "type": "object",
        "properties": {
          "date": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "hours": {
            "type": "number",
            "format": "double",
            "nullable": true
          },
          "rate": {
            "type": "number",
            "format": "double",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Holiday_UpdateHolidayOpeningBalanceRequest": {
        "type": "object",
        "properties": {
          "description": {
            "type": "string"
          },
          "percentageOfTime": {
            "$ref": "#/components/schemas/Holiday_PercentageOfTimeOpeningBalanceDto"
          }
        },
        "additionalProperties": false
      },
      "Holiday_UpdateHolidayOrganisationConfigurationRequest": {
        "type": "object",
        "properties": {
          "holidayAccrualType": {
            "enum": [
              "PercentageOfTime",
              "RolledUp"
            ],
            "type": "string"
          },
          "accrualResetMonth": {
            "type": "integer",
            "format": "int32"
          },
          "accrualResetDay": {
            "type": "integer",
            "format": "int32"
          },
          "percentageOfTime": {
            "$ref": "#/components/schemas/Holiday_PercentageOfTimeConfigurationDto"
          },
          "rolledUp": {
            "$ref": "#/components/schemas/Holiday_RolledUpConfigurationDto"
          }
        },
        "additionalProperties": false
      },
      "Holiday_ValidationIssue": {
        "type": "object",
        "properties": {
          "field": {
            "type": "string"
          },
          "reason": {
            "type": "string"
          },
          "reasonToken": {
            "type": "string"
          },
          "reasonTokenArguments": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Holiday_ValidationIssueArgument"
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Holiday_ValidationIssueArgument": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string"
          },
          "value": {}
        },
        "additionalProperties": false
      },
      "Holiday_YearlySummaryDto": {
        "type": "object",
        "properties": {
          "year": {
            "type": "integer",
            "format": "int32"
          },
          "yearStartDate": {
            "type": "string"
          },
          "yearEndDate": {
            "type": "string"
          },
          "openingBalanceHours": {
            "type": "number",
            "format": "double",
            "nullable": true
          },
          "openingBalanceValue": {
            "type": "number",
            "format": "double",
            "nullable": true
          },
          "accruedHours": {
            "type": "number",
            "format": "double",
            "nullable": true
          },
          "accruedValue": {
            "type": "number",
            "format": "double",
            "nullable": true
          },
          "takenHours": {
            "type": "number",
            "format": "double",
            "nullable": true
          },
          "takenValue": {
            "type": "number",
            "format": "double",
            "nullable": true
          },
          "closingBalanceHours": {
            "type": "number",
            "format": "double",
            "nullable": true
          },
          "closingBalanceValue": {
            "type": "number",
            "format": "double",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Salary_ApiErrorResponse": {
        "type": "object",
        "properties": {
          "message": {
            "$ref": "#/components/schemas/Salary_MessageWithTokenResponse"
          },
          "validationIssues": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Salary_ValidationIssue"
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Salary_CalculateSalaryRequest": {
        "required": [
          "frequency",
          "payrollConfigId",
          "periodEndDate",
          "periodStartDate"
        ],
        "type": "object",
        "properties": {
          "payrollConfigId": {
            "minLength": 1,
            "type": "string",
            "description": "The payroll configuration the pay period belongs to."
          },
          "periodStartDate": {
            "minLength": 1,
            "type": "string",
            "description": "First day of the pay period, YYYY-MM-DD."
          },
          "periodEndDate": {
            "minLength": 1,
            "type": "string",
            "description": "Last day of the pay period, YYYY-MM-DD."
          },
          "frequency": {
            "minLength": 1,
            "type": "string",
            "description": "Pay frequency: Weekly, Fortnightly, FourWeekly, Monthly, Quarterly, BiAnnually or Annual."
          },
          "year": {
            "type": "integer",
            "description": "Tax year of the pay run. Optional; with `period` it makes the returned line item ids match the ones the pay run receives.",
            "format": "int32",
            "nullable": true
          },
          "period": {
            "type": "integer",
            "description": "Period number of the pay run. Optional; see `year`.",
            "format": "int32",
            "nullable": true
          },
          "statutoryLines": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Salary_CalculateStatutoryLineRequest"
            },
            "description": "Statutory pay lines to treat as if they were on the payslip, so the salary adjustment and any top-up can be previewed. Optional.",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "description": "Runs the salary calculation for one employee and one pay period without side effects."
      },
      "Salary_CalculateStatutoryLineRequest": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "The line's id; seeds the adjustment and top-up ids. Optional here.",
            "nullable": true
          },
          "statutoryType": {
            "type": "string",
            "description": "The statutory type name, e.g. `StatutoryMaternityPay`.",
            "nullable": true
          },
          "units": {
            "type": "number",
            "description": "Days paid (qualifying days for sick pay, calendar days otherwise).",
            "format": "double"
          },
          "unitName": {
            "type": "string",
            "description": "`Day` or `Fixed`.",
            "nullable": true
          },
          "amount": {
            "type": "number",
            "description": "The line's amount.",
            "format": "double"
          },
          "from": {
            "type": "string",
            "description": "First day the line pays for inside the period, YYYY-MM-DD.",
            "nullable": true
          },
          "to": {
            "type": "string",
            "description": "Last day the line pays for, YYYY-MM-DD.",
            "nullable": true
          },
          "leaveStart": {
            "type": "string",
            "description": "First day of the statutory payment, YYYY-MM-DD; top-up tiers count from it.",
            "nullable": true
          },
          "periodAmount": {
            "type": "number",
            "description": "Statutory pay for this period's days, when the line also covers earlier periods.",
            "format": "double",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "description": "A statutory pay line in the shape the statutory service posts it: its type, units and amount, and, when known, the days it pays for inside the period, the statutory payment's start date and the amount that pays for this period's days."
      },
      "Salary_ContentMetadataResponse": {
        "type": "object",
        "properties": {
          "dateFormat": {
            "type": "string"
          },
          "dateTimeFormat": {
            "type": "string"
          },
          "paginationToken": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Salary_DurationDto": {
        "type": "object",
        "properties": {
          "value": {
            "type": "integer",
            "description": "How many units, at least 1. For `Week`, 1 to 52.",
            "format": "int32",
            "nullable": true
          },
          "unit": {
            "$ref": "#/components/schemas/Salary_DurationUnit"
          }
        },
        "additionalProperties": false,
        "description": "A length of time, as a whole number of units, e.g. `{ \"value\": 6, \"unit\": \"Week\" }`."
      },
      "Salary_DurationUnit": {
        "enum": [
          "Week"
        ],
        "type": "string",
        "description": "The unit a `duration` is counted in. `Week`: seven days. New units may be added, so a client should treat one it does not recognise as unsupported rather than as an error."
      },
      "Salary_EffectiveStatutoryLeavePolicies": {
        "type": "object",
        "properties": {
          "StatutorySickPay": {
            "$ref": "#/components/schemas/Salary_EffectiveStatutoryLeavePolicyResponse"
          },
          "StatutoryMaternityPay": {
            "$ref": "#/components/schemas/Salary_EffectiveStatutoryLeavePolicyResponse"
          },
          "StatutoryPaternityPay": {
            "$ref": "#/components/schemas/Salary_EffectiveStatutoryLeavePolicyResponse"
          },
          "StatutoryAdoptionPay": {
            "$ref": "#/components/schemas/Salary_EffectiveStatutoryLeavePolicyResponse"
          },
          "StatutorySharedParentalPay": {
            "$ref": "#/components/schemas/Salary_EffectiveStatutoryLeavePolicyResponse"
          },
          "StatutoryParentalBereavementPay": {
            "$ref": "#/components/schemas/Salary_EffectiveStatutoryLeavePolicyResponse"
          },
          "StatutoryNeoNatalCarePay": {
            "$ref": "#/components/schemas/Salary_EffectiveStatutoryLeavePolicyResponse"
          }
        },
        "additionalProperties": false,
        "description": "The policy every statutory type resolves to, one field per type, so a client never re-implements the cascade."
      },
      "Salary_EffectiveStatutoryLeavePolicyResponse": {
        "type": "object",
        "properties": {
          "policy": {
            "$ref": "#/components/schemas/Salary_StatutoryLeavePolicyDto"
          },
          "source": {
            "enum": [
              "Default",
              "Organisation",
              "Employee"
            ],
            "type": "string",
            "description": "`Employee` (the employee's override), `Organisation` (the organisation's policies) or `Default` (nothing is set, so the absent days are deducted and nothing is topped up)."
          }
        },
        "additionalProperties": false,
        "description": "The policy in force for one statutory type and where it came from."
      },
      "Salary_EmployeeStatutoryLeaveResponse": {
        "type": "object",
        "properties": {
          "employeeId": {
            "type": "string",
            "description": "The employee."
          },
          "override": {
            "$ref": "#/components/schemas/Salary_StatutoryLeavePolicyDocument"
          },
          "effective": {
            "$ref": "#/components/schemas/Salary_EffectiveStatutoryLeavePolicies"
          },
          "createdBy": {
            "type": "string",
            "nullable": true
          },
          "createdDate": {
            "type": "string",
            "nullable": true
          },
          "updatedBy": {
            "type": "string",
            "nullable": true
          },
          "updatedDate": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "description": "One employee's override, and what each type resolves to for them."
      },
      "Salary_EmployeeStatutoryLeaveResponseContentResponse": {
        "type": "object",
        "properties": {
          "data": {
            "$ref": "#/components/schemas/Salary_EmployeeStatutoryLeaveResponse"
          },
          "metadata": {
            "$ref": "#/components/schemas/Salary_ContentMetadataResponse"
          }
        },
        "additionalProperties": false
      },
      "Salary_EmployeeStatutoryLeaveResponseResponseBody": {
        "type": "object",
        "properties": {
          "message": {
            "$ref": "#/components/schemas/Salary_MessageWithTokenResponse"
          },
          "content": {
            "$ref": "#/components/schemas/Salary_EmployeeStatutoryLeaveResponseContentResponse"
          },
          "validationIssues": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Salary_ValidationIssue"
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Salary_MessageWithTokenResponse": {
        "type": "object",
        "properties": {
          "text": {
            "type": "string"
          },
          "token": {
            "type": "string"
          },
          "tokenArguments": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Salary_ValidationIssueArgument"
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Salary_ObjectContentResponse": {
        "type": "object",
        "properties": {
          "data": {
            "nullable": true
          },
          "metadata": {
            "$ref": "#/components/schemas/Salary_ContentMetadataResponse"
          }
        },
        "additionalProperties": false
      },
      "Salary_ObjectResponseBody": {
        "type": "object",
        "properties": {
          "message": {
            "$ref": "#/components/schemas/Salary_MessageWithTokenResponse"
          },
          "content": {
            "$ref": "#/components/schemas/Salary_ObjectContentResponse"
          },
          "validationIssues": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Salary_ValidationIssue"
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Salary_OrganisationStatutoryLeaveResponse": {
        "type": "object",
        "properties": {
          "policies": {
            "$ref": "#/components/schemas/Salary_StatutoryLeavePolicyDocument"
          },
          "isDefault": {
            "type": "boolean",
            "description": "True when the organisation has stored no policies."
          },
          "effective": {
            "$ref": "#/components/schemas/Salary_EffectiveStatutoryLeavePolicies"
          },
          "createdBy": {
            "type": "string",
            "nullable": true
          },
          "createdDate": {
            "type": "string",
            "nullable": true
          },
          "updatedBy": {
            "type": "string",
            "nullable": true
          },
          "updatedDate": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "description": "The organisation's statutory leave policies as stored, and what each type resolves to."
      },
      "Salary_OrganisationStatutoryLeaveResponseContentResponse": {
        "type": "object",
        "properties": {
          "data": {
            "$ref": "#/components/schemas/Salary_OrganisationStatutoryLeaveResponse"
          },
          "metadata": {
            "$ref": "#/components/schemas/Salary_ContentMetadataResponse"
          }
        },
        "additionalProperties": false
      },
      "Salary_OrganisationStatutoryLeaveResponseResponseBody": {
        "type": "object",
        "properties": {
          "message": {
            "$ref": "#/components/schemas/Salary_MessageWithTokenResponse"
          },
          "content": {
            "$ref": "#/components/schemas/Salary_OrganisationStatutoryLeaveResponseContentResponse"
          },
          "validationIssues": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Salary_ValidationIssue"
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Salary_SalaryCalculationLine": {
        "type": "object",
        "properties": {
          "lineItemId": {
            "type": "string",
            "description": "The id the line would be posted under, derived from the employee, pay run, period and segment; null when the request carried no `year` and `period`.",
            "nullable": true
          },
          "description": {
            "type": "string",
            "description": "The line's description as it appears on the payslip."
          },
          "unitName": {
            "type": "string",
            "description": "What `units` counts: `Month`, `Week` or `Year` for a full period, `Day` for a part period or an adjustment, `Fixed` for a top-up."
          },
          "units": {
            "type": "number",
            "description": "How many of `unitName`.",
            "format": "double"
          },
          "payRate": {
            "type": "number",
            "description": "The rate per unit, to 4 decimal places.",
            "format": "double"
          },
          "amount": {
            "type": "number",
            "description": "The line's amount: units × payRate, rounded to the penny. Always positive; an adjustment is a deduction because of its pay element.",
            "format": "double"
          },
          "annualSalary": {
            "type": "number",
            "description": "The annual salary in force for the segment.",
            "format": "double"
          },
          "effectiveFrom": {
            "type": "string",
            "description": "The date that salary version took effect, YYYY-MM-DD."
          },
          "segmentStart": {
            "type": "string",
            "description": "First day the line pays for (or, for an adjustment, takes back), YYYY-MM-DD."
          },
          "segmentEnd": {
            "type": "string",
            "description": "Last day the line covers, YYYY-MM-DD."
          },
          "calculationMethod": {
            "enum": [
              "CalendarDays",
              "WorkingDays"
            ],
            "type": "string",
            "description": "How the days were counted."
          },
          "divisor": {
            "type": "integer",
            "description": "Qualifying days in the tax year containing the segment's first day, for a part period; null for a full period.",
            "format": "int32",
            "nullable": true
          },
          "kind": {
            "enum": [
              "Salary",
              "StatutoryAbsenceAdjustment",
              "StatutoryTopUp"
            ],
            "type": "string",
            "description": "`Salary`, `StatutoryAbsenceAdjustment` (the salary for days on statutory leave, taken back) or `StatutoryTopUp` (contractual pay on top of statutory pay)."
          },
          "payElementId": {
            "type": "string",
            "description": "The pay element the line is posted against, e.g. `internal_salary`.",
            "nullable": true
          },
          "statutoryType": {
            "enum": [
              "StatutorySickPay",
              "StatutoryMaternityPay",
              "StatutoryPaternityPay",
              "StatutoryAdoptionPay",
              "StatutorySharedParentalPay",
              "StatutoryParentalBereavementPay",
              "StatutoryNeoNatalCarePay"
            ],
            "type": "string",
            "description": "On an adjustment or top-up, the statutory payment it responds to.",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "description": "One pay-run line the calculation would produce."
      },
      "Salary_SalaryCalculationResponse": {
        "type": "object",
        "properties": {
          "calculationMethod": {
            "enum": [
              "CalendarDays",
              "WorkingDays"
            ],
            "type": "string",
            "description": "The method the calculation used."
          },
          "source": {
            "enum": [
              "Default",
              "Organisation",
              "Employee"
            ],
            "type": "string",
            "description": "Where that method came from: `Employee`, `Organisation` or `Default`."
          },
          "lines": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Salary_SalaryCalculationLine"
            },
            "description": "The salary lines, then for each statutory payment its adjustments and top-up."
          }
        },
        "additionalProperties": false
      },
      "Salary_SalaryCalculationResponseContentResponse": {
        "type": "object",
        "properties": {
          "data": {
            "$ref": "#/components/schemas/Salary_SalaryCalculationResponse"
          },
          "metadata": {
            "$ref": "#/components/schemas/Salary_ContentMetadataResponse"
          }
        },
        "additionalProperties": false
      },
      "Salary_SalaryCalculationResponseResponseBody": {
        "type": "object",
        "properties": {
          "message": {
            "$ref": "#/components/schemas/Salary_MessageWithTokenResponse"
          },
          "content": {
            "$ref": "#/components/schemas/Salary_SalaryCalculationResponseContentResponse"
          },
          "validationIssues": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Salary_ValidationIssue"
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Salary_SalaryEmployeeConfigResponse": {
        "type": "object",
        "properties": {
          "employeeId": {
            "type": "string"
          },
          "calculationMethod": {
            "enum": [
              "CalendarDays",
              "WorkingDays"
            ],
            "type": "string",
            "nullable": true
          },
          "effectiveCalculationMethod": {
            "enum": [
              "CalendarDays",
              "WorkingDays"
            ],
            "type": "string",
            "description": "How a partial pay period is pro-rated: `CalendarDays` or `WorkingDays`."
          },
          "source": {
            "enum": [
              "Default",
              "Organisation",
              "Employee"
            ],
            "type": "string",
            "description": "Where the effective calculation method for an employee came from."
          },
          "createdBy": {
            "type": "string",
            "nullable": true
          },
          "createdDate": {
            "type": "string",
            "nullable": true
          },
          "updatedBy": {
            "type": "string",
            "nullable": true
          },
          "updatedDate": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "description": "The employee's salary configuration. `calculationMethod` is the override (null when the employee inherits); `effectiveCalculationMethod` is what the calculation uses and `source` says where it came from."
      },
      "Salary_SalaryEmployeeConfigResponseContentResponse": {
        "type": "object",
        "properties": {
          "data": {
            "$ref": "#/components/schemas/Salary_SalaryEmployeeConfigResponse"
          },
          "metadata": {
            "$ref": "#/components/schemas/Salary_ContentMetadataResponse"
          }
        },
        "additionalProperties": false
      },
      "Salary_SalaryEmployeeConfigResponseResponseBody": {
        "type": "object",
        "properties": {
          "message": {
            "$ref": "#/components/schemas/Salary_MessageWithTokenResponse"
          },
          "content": {
            "$ref": "#/components/schemas/Salary_SalaryEmployeeConfigResponseContentResponse"
          },
          "validationIssues": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Salary_ValidationIssue"
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Salary_SalaryOrganisationConfigResponse": {
        "type": "object",
        "properties": {
          "organisationId": {
            "type": "string"
          },
          "calculationMethod": {
            "enum": [
              "CalendarDays",
              "WorkingDays"
            ],
            "type": "string",
            "description": "How a partial pay period is pro-rated: `CalendarDays` or `WorkingDays`."
          },
          "enabled": {
            "type": "boolean"
          },
          "createdBy": {
            "type": "string"
          },
          "createdDate": {
            "type": "string"
          },
          "updatedBy": {
            "type": "string"
          },
          "updatedDate": {
            "type": "string"
          }
        },
        "additionalProperties": false
      },
      "Salary_SalaryOrganisationConfigResponseContentResponse": {
        "type": "object",
        "properties": {
          "data": {
            "$ref": "#/components/schemas/Salary_SalaryOrganisationConfigResponse"
          },
          "metadata": {
            "$ref": "#/components/schemas/Salary_ContentMetadataResponse"
          }
        },
        "additionalProperties": false
      },
      "Salary_SalaryOrganisationConfigResponseResponseBody": {
        "type": "object",
        "properties": {
          "message": {
            "$ref": "#/components/schemas/Salary_MessageWithTokenResponse"
          },
          "content": {
            "$ref": "#/components/schemas/Salary_SalaryOrganisationConfigResponseContentResponse"
          },
          "validationIssues": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Salary_ValidationIssue"
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Salary_StatutoryLeavePolicyDocument": {
        "type": "object",
        "properties": {
          "sickness": {
            "$ref": "#/components/schemas/Salary_StatutoryLeavePolicyDto"
          },
          "familyLeave": {
            "$ref": "#/components/schemas/Salary_StatutoryLeavePolicyDto"
          },
          "byType": {
            "$ref": "#/components/schemas/Salary_StatutoryLeaveTypePolicies"
          }
        },
        "additionalProperties": false,
        "description": "What happens to a salaried employee's salary on the days they are paid statutory pay, for an organisation or as one employee's override. `sickness` covers `StatutorySickPay`. `familyLeave` covers `StatutoryMaternityPay`, `StatutoryPaternityPay`, `StatutoryAdoptionPay`, `StatutorySharedParentalPay`, `StatutoryParentalBereavementPay` and `StatutoryNeoNatalCarePay`. `byType` sets an exception for one of those six. Every part is optional; for each type the first that is set applies: the employee's `byType` entry, the employee's family, the organisation's `byType` entry, the organisation's family, then the default (the salary for the days on leave is deducted and nothing is topped up)."
      },
      "Salary_StatutoryLeavePolicyDto": {
        "type": "object",
        "properties": {
          "salaryTreatment": {
            "enum": [
              "DeductAbsentDays",
              "FullPay"
            ],
            "type": "string",
            "description": "`DeductAbsentDays` (the default): the salary for the days on leave is taken back with a separate line, so the statutory payment replaces it, and `topUp` can raise those days to a share of salary for part of the leave, in tiers. `FullPay`: the days on leave are taken back and topped up to 100%, statutory pay included, for the whole of the leave, so the employee is paid as though they were at work.",
            "nullable": true
          },
          "topUp": {
            "$ref": "#/components/schemas/Salary_StatutoryLeaveTopUpDto"
          }
        },
        "additionalProperties": false,
        "description": "What happens to the salary on the days a statutory type pays for."
      },
      "Salary_StatutoryLeaveTopUpDto": {
        "type": "object",
        "properties": {
          "tiers": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Salary_StatutoryLeaveTopUpTierDto"
            },
            "description": "Applied back to back from the first day of the statutory payment: the first tier's duration, then the next tier's, and so on; days after the last tier get no top-up. The tiers must end within 52 weeks of the start of the leave.",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Salary_StatutoryLeaveTopUpTierDto": {
        "type": "object",
        "properties": {
          "duration": {
            "$ref": "#/components/schemas/Salary_DurationDto"
          },
          "percentOfSalary": {
            "type": "number",
            "description": "The share of salary the employee receives for those days in total, statutory pay included, 1 to 100. 100 pays the days as though they were at work.",
            "format": "double",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "description": "One tier of a top-up: how much of the leave it covers (`duration`) and the share of salary paid for those days (`percentOfSalary`)."
      },
      "Salary_StatutoryLeaveTypePolicies": {
        "type": "object",
        "properties": {
          "StatutoryMaternityPay": {
            "$ref": "#/components/schemas/Salary_StatutoryLeavePolicyDto"
          },
          "StatutoryPaternityPay": {
            "$ref": "#/components/schemas/Salary_StatutoryLeavePolicyDto"
          },
          "StatutoryAdoptionPay": {
            "$ref": "#/components/schemas/Salary_StatutoryLeavePolicyDto"
          },
          "StatutorySharedParentalPay": {
            "$ref": "#/components/schemas/Salary_StatutoryLeavePolicyDto"
          },
          "StatutoryParentalBereavementPay": {
            "$ref": "#/components/schemas/Salary_StatutoryLeavePolicyDto"
          },
          "StatutoryNeoNatalCarePay": {
            "$ref": "#/components/schemas/Salary_StatutoryLeavePolicyDto"
          }
        },
        "additionalProperties": false,
        "description": "One optional policy per family-leave type. Keyed by the statutory type's own name, as the statutory service spells it, so a generated client gets one typed field per type rather than an open map a typo can slip into."
      },
      "Salary_UpsertSalaryEmployeeConfigRequest": {
        "required": [
          "calculationMethod"
        ],
        "type": "object",
        "properties": {
          "calculationMethod": {
            "enum": [
              "CalendarDays",
              "WorkingDays"
            ],
            "type": "string",
            "description": "The pro-rating method for this employee's partial periods.",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "description": "Sets the employee's calculation-method override."
      },
      "Salary_UpsertSalaryOrganisationConfigRequest": {
        "required": [
          "calculationMethod",
          "enabled"
        ],
        "type": "object",
        "properties": {
          "calculationMethod": {
            "enum": [
              "CalendarDays",
              "WorkingDays"
            ],
            "type": "string",
            "description": "The pro-rating method for partial periods.",
            "nullable": true
          },
          "enabled": {
            "type": "boolean",
            "description": "Whether the module posts salary lines for this organisation."
          }
        },
        "additionalProperties": false,
        "description": "Creates or replaces the organisation's salary configuration."
      },
      "Salary_ValidationIssue": {
        "type": "object",
        "properties": {
          "field": {
            "type": "string"
          },
          "reason": {
            "type": "string"
          },
          "reasonToken": {
            "type": "string"
          },
          "reasonTokenArguments": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Salary_ValidationIssueArgument"
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Salary_ValidationIssueArgument": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string"
          },
          "value": {
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "PensionV2_AdditionalVoluntaryContributionListModel": {
        "required": [
          "items"
        ],
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PensionV2_AdditionalVoluntaryContributionModel"
            },
            "description": "The additional voluntary contributions on this page, in pay-period order.",
            "nullable": true
          },
          "paginationToken": {
            "type": "string",
            "description": "Deprecated: the same value as `content.metadata.paginationToken`. Read that; this will be removed.",
            "nullable": true,
            "deprecated": true
          }
        },
        "additionalProperties": false,
        "description": "One page of an employee's additional voluntary contributions."
      },
      "PensionV2_AdditionalVoluntaryContributionListModelApiResponse": {
        "allOf": [
          {
            "$ref": "#/components/schemas/PensionV2_AdditionalVoluntaryContributionListModelResponseBody"
          }
        ],
        "description": "Deprecated: renamed to `AdditionalVoluntaryContributionListModelResponseBody`, which has the same fields and more.",
        "deprecated": true
      },
      "PensionV2_AdditionalVoluntaryContributionListModelContent": {
        "allOf": [
          {
            "$ref": "#/components/schemas/PensionV2_AdditionalVoluntaryContributionListModelContentResponse"
          }
        ],
        "description": "Deprecated: renamed to `AdditionalVoluntaryContributionListModelContentResponse`, which has the same fields and more.",
        "deprecated": true
      },
      "PensionV2_AdditionalVoluntaryContributionListModelContentResponse": {
        "type": "object",
        "properties": {
          "data": {
            "$ref": "#/components/schemas/PensionV2_AdditionalVoluntaryContributionListModel"
          },
          "metadata": {
            "$ref": "#/components/schemas/PensionV2_ContentMetadataResponse"
          }
        },
        "additionalProperties": false
      },
      "PensionV2_AdditionalVoluntaryContributionListModelResponseBody": {
        "required": [
          "message"
        ],
        "type": "object",
        "properties": {
          "message": {
            "$ref": "#/components/schemas/PensionV2_MessageWithTokenResponse"
          },
          "content": {
            "$ref": "#/components/schemas/PensionV2_AdditionalVoluntaryContributionListModelContentResponse"
          },
          "validationIssues": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PensionV2_ValidationIssue"
            },
            "nullable": true
          },
          "errors": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PensionV2_Error"
            },
            "description": "Deprecated: the same issues as `validationIssues` (`reasonText` is `reason`, `reasonId` is `reasonToken`, `reasonParameters` is `reasonTokenArguments`). Read `validationIssues`; this will be removed.",
            "nullable": true,
            "readOnly": true,
            "deprecated": true
          },
          "metadata": {
            "allOf": [
              {
                "$ref": "#/components/schemas/PensionV2_ContentMetadataResponse"
              }
            ],
            "description": "Deprecated: the same values as `content.metadata`. Read that; this will be removed.",
            "deprecated": true
          }
        },
        "additionalProperties": false,
        "description": "The response envelope every FlowPayroll API answers with: a `message`, the\n`content`, and any `validationIssues`. `errors` and the top-level\n`metadata` are deprecated copies of `validationIssues` and\n`content.metadata`, and will be removed."
      },
      "PensionV2_AdditionalVoluntaryContributionModel": {
        "required": [
          "amount",
          "createdBy",
          "createdDate",
          "employeeId",
          "period",
          "taxYear",
          "updatedBy",
          "updatedDate"
        ],
        "type": "object",
        "properties": {
          "employeeId": {
            "type": "string",
            "nullable": true
          },
          "taxYear": {
            "type": "integer",
            "format": "int32"
          },
          "period": {
            "type": "integer",
            "format": "int32"
          },
          "amount": {
            "type": "number",
            "description": "The gross additional voluntary contribution for the pay period. On relief-at-source schemes the\npayslip deduction is 80% of this; the provider claims the basic-rate\nrelief.",
            "format": "double"
          },
          "createdBy": {
            "type": "string",
            "nullable": true
          },
          "createdDate": {
            "type": "string",
            "format": "date-time"
          },
          "updatedBy": {
            "type": "string",
            "nullable": true
          },
          "updatedDate": {
            "type": "string",
            "format": "date-time"
          }
        },
        "additionalProperties": false,
        "description": "An additional voluntary contribution: an extra member\ncontribution for one pay period only, on top of the scheme contribution and\nany standing one. At most one per employee per pay period; a repeated PUT\nreplaces the amount."
      },
      "PensionV2_AdditionalVoluntaryContributionModelApiResponse": {
        "allOf": [
          {
            "$ref": "#/components/schemas/PensionV2_AdditionalVoluntaryContributionModelResponseBody"
          }
        ],
        "description": "Deprecated: renamed to `AdditionalVoluntaryContributionModelResponseBody`, which has the same fields and more.",
        "deprecated": true
      },
      "PensionV2_AdditionalVoluntaryContributionModelContent": {
        "allOf": [
          {
            "$ref": "#/components/schemas/PensionV2_AdditionalVoluntaryContributionModelContentResponse"
          }
        ],
        "description": "Deprecated: renamed to `AdditionalVoluntaryContributionModelContentResponse`, which has the same fields and more.",
        "deprecated": true
      },
      "PensionV2_AdditionalVoluntaryContributionModelContentResponse": {
        "type": "object",
        "properties": {
          "data": {
            "$ref": "#/components/schemas/PensionV2_AdditionalVoluntaryContributionModel"
          },
          "metadata": {
            "$ref": "#/components/schemas/PensionV2_ContentMetadataResponse"
          }
        },
        "additionalProperties": false
      },
      "PensionV2_AdditionalVoluntaryContributionModelResponseBody": {
        "required": [
          "message"
        ],
        "type": "object",
        "properties": {
          "message": {
            "$ref": "#/components/schemas/PensionV2_MessageWithTokenResponse"
          },
          "content": {
            "$ref": "#/components/schemas/PensionV2_AdditionalVoluntaryContributionModelContentResponse"
          },
          "validationIssues": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PensionV2_ValidationIssue"
            },
            "nullable": true
          },
          "errors": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PensionV2_Error"
            },
            "description": "Deprecated: the same issues as `validationIssues` (`reasonText` is `reason`, `reasonId` is `reasonToken`, `reasonParameters` is `reasonTokenArguments`). Read `validationIssues`; this will be removed.",
            "nullable": true,
            "readOnly": true,
            "deprecated": true
          },
          "metadata": {
            "allOf": [
              {
                "$ref": "#/components/schemas/PensionV2_ContentMetadataResponse"
              }
            ],
            "description": "Deprecated: the same values as `content.metadata`. Read that; this will be removed.",
            "deprecated": true
          }
        },
        "additionalProperties": false,
        "description": "The response envelope every FlowPayroll API answers with: a `message`, the\n`content`, and any `validationIssues`. `errors` and the top-level\n`metadata` are deprecated copies of `validationIssues` and\n`content.metadata`, and will be removed."
      },
      "PensionV2_ApiErrorMessage": {
        "type": "object",
        "properties": {
          "text": {
            "type": "string",
            "nullable": true
          },
          "token": {
            "type": "string",
            "nullable": true
          },
          "tokenArguments": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PensionV2_ValidationIssueArgument"
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "PensionV2_ApiErrorResponse": {
        "type": "object",
        "properties": {
          "message": {
            "$ref": "#/components/schemas/PensionV2_ApiErrorMessage"
          },
          "validationIssues": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PensionV2_ValidationIssue"
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "PensionV2_ApplyProviderMemberChangeRequest": {
        "type": "object",
        "properties": {
          "processRefund": {
            "type": "boolean"
          },
          "noPayrollRefundReason": {
            "type": "string",
            "nullable": true
          },
          "refundOutsideOptOutPeriodReason": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "description": "Applying a provider's reported change. For an opt-out, the employer's refund\ndecision; omit both refund fields to apply it now and decide the refund later\nfrom the list of refunds still to decide. A stopped-contributions change takes\nno refund decision."
      },
      "PensionV2_AutoEnrolmentAssessmentModel": {
        "required": [
          "autoEnrolled",
          "canOptIn",
          "earnings",
          "effectiveAssessmentDate",
          "employerPaysIn",
          "enrolmentType",
          "isUnderStatePensionAge",
          "result",
          "statePensionAgeDate",
          "workerAge"
        ],
        "type": "object",
        "properties": {
          "result": {
            "enum": [
              "EligibleJobholder",
              "NonEligibleJobholder",
              "EntitledWorker",
              "NotEligible"
            ],
            "type": "string",
            "nullable": true
          },
          "enrolmentType": {
            "enum": [
              "AutoEnrolment",
              "OptIn",
              "Voluntary",
              "NotEligible"
            ],
            "type": "string",
            "nullable": true
          },
          "autoEnrolled": {
            "type": "boolean"
          },
          "canOptIn": {
            "type": "boolean"
          },
          "employerPaysIn": {
            "type": "boolean"
          },
          "workerAge": {
            "type": "integer",
            "format": "int32"
          },
          "isUnderStatePensionAge": {
            "type": "boolean"
          },
          "statePensionAgeDate": {
            "type": "string",
            "format": "date"
          },
          "effectiveAssessmentDate": {
            "type": "string",
            "format": "date"
          },
          "earnings": {
            "$ref": "#/components/schemas/PensionV2_EarningsModel"
          }
        },
        "additionalProperties": false
      },
      "PensionV2_AutoEnrolmentAssessmentModelApiResponse": {
        "allOf": [
          {
            "$ref": "#/components/schemas/PensionV2_AutoEnrolmentAssessmentModelResponseBody"
          }
        ],
        "description": "Deprecated: renamed to `AutoEnrolmentAssessmentModelResponseBody`, which has the same fields and more.",
        "deprecated": true
      },
      "PensionV2_AutoEnrolmentAssessmentModelContent": {
        "allOf": [
          {
            "$ref": "#/components/schemas/PensionV2_AutoEnrolmentAssessmentModelContentResponse"
          }
        ],
        "description": "Deprecated: renamed to `AutoEnrolmentAssessmentModelContentResponse`, which has the same fields and more.",
        "deprecated": true
      },
      "PensionV2_AutoEnrolmentAssessmentModelContentResponse": {
        "type": "object",
        "properties": {
          "data": {
            "$ref": "#/components/schemas/PensionV2_AutoEnrolmentAssessmentModel"
          },
          "metadata": {
            "$ref": "#/components/schemas/PensionV2_ContentMetadataResponse"
          }
        },
        "additionalProperties": false
      },
      "PensionV2_AutoEnrolmentAssessmentModelResponseBody": {
        "required": [
          "message"
        ],
        "type": "object",
        "properties": {
          "message": {
            "$ref": "#/components/schemas/PensionV2_MessageWithTokenResponse"
          },
          "content": {
            "$ref": "#/components/schemas/PensionV2_AutoEnrolmentAssessmentModelContentResponse"
          },
          "validationIssues": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PensionV2_ValidationIssue"
            },
            "nullable": true
          },
          "errors": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PensionV2_Error"
            },
            "description": "Deprecated: the same issues as `validationIssues` (`reasonText` is `reason`, `reasonId` is `reasonToken`, `reasonParameters` is `reasonTokenArguments`). Read `validationIssues`; this will be removed.",
            "nullable": true,
            "readOnly": true,
            "deprecated": true
          },
          "metadata": {
            "allOf": [
              {
                "$ref": "#/components/schemas/PensionV2_ContentMetadataResponse"
              }
            ],
            "description": "Deprecated: the same values as `content.metadata`. Read that; this will be removed.",
            "deprecated": true
          }
        },
        "additionalProperties": false,
        "description": "The response envelope every FlowPayroll API answers with: a `message`, the\n`content`, and any `validationIssues`. `errors` and the top-level\n`metadata` are deprecated copies of `validationIssues` and\n`content.metadata`, and will be removed."
      },
      "PensionV2_BooleanApiResponse": {
        "allOf": [
          {
            "$ref": "#/components/schemas/PensionV2_BooleanResponseBody"
          }
        ],
        "description": "Deprecated: renamed to `BooleanResponseBody`, which has the same fields and more.",
        "deprecated": true
      },
      "PensionV2_BooleanContent": {
        "allOf": [
          {
            "$ref": "#/components/schemas/PensionV2_BooleanContentResponse"
          }
        ],
        "description": "Deprecated: renamed to `BooleanContentResponse`, which has the same fields and more.",
        "deprecated": true
      },
      "PensionV2_BooleanContentResponse": {
        "type": "object",
        "properties": {
          "data": {
            "type": "boolean"
          },
          "metadata": {
            "$ref": "#/components/schemas/PensionV2_ContentMetadataResponse"
          }
        },
        "additionalProperties": false
      },
      "PensionV2_BooleanResponseBody": {
        "required": [
          "message"
        ],
        "type": "object",
        "properties": {
          "message": {
            "$ref": "#/components/schemas/PensionV2_MessageWithTokenResponse"
          },
          "content": {
            "$ref": "#/components/schemas/PensionV2_BooleanContentResponse"
          },
          "validationIssues": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PensionV2_ValidationIssue"
            },
            "nullable": true
          },
          "errors": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PensionV2_Error"
            },
            "description": "Deprecated: the same issues as `validationIssues` (`reasonText` is `reason`, `reasonId` is `reasonToken`, `reasonParameters` is `reasonTokenArguments`). Read `validationIssues`; this will be removed.",
            "nullable": true,
            "readOnly": true,
            "deprecated": true
          },
          "metadata": {
            "allOf": [
              {
                "$ref": "#/components/schemas/PensionV2_ContentMetadataResponse"
              }
            ],
            "description": "Deprecated: the same values as `content.metadata`. Read that; this will be removed.",
            "deprecated": true
          }
        },
        "additionalProperties": false,
        "description": "The response envelope every FlowPayroll API answers with: a `message`, the\n`content`, and any `validationIssues`. `errors` and the top-level\n`metadata` are deprecated copies of `validationIssues` and\n`content.metadata`, and will be removed."
      },
      "PensionV2_ContentMetadataResponse": {
        "type": "object",
        "properties": {
          "dateFormat": {
            "type": "string",
            "nullable": true
          },
          "dateTimeFormat": {
            "type": "string",
            "nullable": true
          },
          "paginationToken": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "PensionV2_ContributionOverrideListModel": {
        "required": [
          "items"
        ],
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PensionV2_ContributionOverrideModel"
            },
            "description": "The overrides on this page, in pay-period order.",
            "nullable": true
          },
          "paginationToken": {
            "type": "string",
            "description": "Deprecated: the same value as `content.metadata.paginationToken`. Read that; this will be removed.",
            "nullable": true,
            "deprecated": true
          }
        },
        "additionalProperties": false,
        "description": "One page of an employee's contribution overrides."
      },
      "PensionV2_ContributionOverrideListModelApiResponse": {
        "allOf": [
          {
            "$ref": "#/components/schemas/PensionV2_ContributionOverrideListModelResponseBody"
          }
        ],
        "description": "Deprecated: renamed to `ContributionOverrideListModelResponseBody`, which has the same fields and more.",
        "deprecated": true
      },
      "PensionV2_ContributionOverrideListModelContent": {
        "allOf": [
          {
            "$ref": "#/components/schemas/PensionV2_ContributionOverrideListModelContentResponse"
          }
        ],
        "description": "Deprecated: renamed to `ContributionOverrideListModelContentResponse`, which has the same fields and more.",
        "deprecated": true
      },
      "PensionV2_ContributionOverrideListModelContentResponse": {
        "type": "object",
        "properties": {
          "data": {
            "$ref": "#/components/schemas/PensionV2_ContributionOverrideListModel"
          },
          "metadata": {
            "$ref": "#/components/schemas/PensionV2_ContentMetadataResponse"
          }
        },
        "additionalProperties": false
      },
      "PensionV2_ContributionOverrideListModelResponseBody": {
        "required": [
          "message"
        ],
        "type": "object",
        "properties": {
          "message": {
            "$ref": "#/components/schemas/PensionV2_MessageWithTokenResponse"
          },
          "content": {
            "$ref": "#/components/schemas/PensionV2_ContributionOverrideListModelContentResponse"
          },
          "validationIssues": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PensionV2_ValidationIssue"
            },
            "nullable": true
          },
          "errors": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PensionV2_Error"
            },
            "description": "Deprecated: the same issues as `validationIssues` (`reasonText` is `reason`, `reasonId` is `reasonToken`, `reasonParameters` is `reasonTokenArguments`). Read `validationIssues`; this will be removed.",
            "nullable": true,
            "readOnly": true,
            "deprecated": true
          },
          "metadata": {
            "allOf": [
              {
                "$ref": "#/components/schemas/PensionV2_ContentMetadataResponse"
              }
            ],
            "description": "Deprecated: the same values as `content.metadata`. Read that; this will be removed.",
            "deprecated": true
          }
        },
        "additionalProperties": false,
        "description": "The response envelope every FlowPayroll API answers with: a `message`, the\n`content`, and any `validationIssues`. `errors` and the top-level\n`metadata` are deprecated copies of `validationIssues` and\n`content.metadata`, and will be removed."
      },
      "PensionV2_ContributionOverrideModel": {
        "required": [
          "contributionOverride",
          "createdBy",
          "createdDate",
          "employeeId",
          "period",
          "taxYear",
          "updatedBy",
          "updatedDate"
        ],
        "type": "object",
        "properties": {
          "employeeId": {
            "type": "string",
            "nullable": true
          },
          "taxYear": {
            "type": "integer",
            "description": "The tax year the pay period belongs to (e.g. 2026 for 2026/27).",
            "format": "int32"
          },
          "period": {
            "type": "integer",
            "description": "The pay period number within the tax year.",
            "format": "int32"
          },
          "contributionOverride": {
            "$ref": "#/components/schemas/PensionV2_ContributionOverrideValuesModel"
          },
          "createdBy": {
            "type": "string",
            "nullable": true
          },
          "createdDate": {
            "type": "string",
            "format": "date-time"
          },
          "updatedBy": {
            "type": "string",
            "nullable": true
          },
          "updatedDate": {
            "type": "string",
            "format": "date-time"
          }
        },
        "additionalProperties": false,
        "description": "A contribution override for one pay period only: for that period it\nreplaces the group settings and any standing association override, then\nexpires. Additional voluntary contributions stay additive on top of it. At most one per employee per pay\nperiod; a repeated PUT replaces it."
      },
      "PensionV2_ContributionOverrideModelApiResponse": {
        "allOf": [
          {
            "$ref": "#/components/schemas/PensionV2_ContributionOverrideModelResponseBody"
          }
        ],
        "description": "Deprecated: renamed to `ContributionOverrideModelResponseBody`, which has the same fields and more.",
        "deprecated": true
      },
      "PensionV2_ContributionOverrideModelContent": {
        "allOf": [
          {
            "$ref": "#/components/schemas/PensionV2_ContributionOverrideModelContentResponse"
          }
        ],
        "description": "Deprecated: renamed to `ContributionOverrideModelContentResponse`, which has the same fields and more.",
        "deprecated": true
      },
      "PensionV2_ContributionOverrideModelContentResponse": {
        "type": "object",
        "properties": {
          "data": {
            "$ref": "#/components/schemas/PensionV2_ContributionOverrideModel"
          },
          "metadata": {
            "$ref": "#/components/schemas/PensionV2_ContentMetadataResponse"
          }
        },
        "additionalProperties": false
      },
      "PensionV2_ContributionOverrideModelResponseBody": {
        "required": [
          "message"
        ],
        "type": "object",
        "properties": {
          "message": {
            "$ref": "#/components/schemas/PensionV2_MessageWithTokenResponse"
          },
          "content": {
            "$ref": "#/components/schemas/PensionV2_ContributionOverrideModelContentResponse"
          },
          "validationIssues": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PensionV2_ValidationIssue"
            },
            "nullable": true
          },
          "errors": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PensionV2_Error"
            },
            "description": "Deprecated: the same issues as `validationIssues` (`reasonText` is `reason`, `reasonId` is `reasonToken`, `reasonParameters` is `reasonTokenArguments`). Read `validationIssues`; this will be removed.",
            "nullable": true,
            "readOnly": true,
            "deprecated": true
          },
          "metadata": {
            "allOf": [
              {
                "$ref": "#/components/schemas/PensionV2_ContentMetadataResponse"
              }
            ],
            "description": "Deprecated: the same values as `content.metadata`. Read that; this will be removed.",
            "deprecated": true
          }
        },
        "additionalProperties": false,
        "description": "The response envelope every FlowPayroll API answers with: a `message`, the\n`content`, and any `validationIssues`. `errors` and the top-level\n`metadata` are deprecated copies of `validationIssues` and\n`content.metadata`, and will be removed."
      },
      "PensionV2_ContributionOverrideValuesModel": {
        "required": [
          "contributionType"
        ],
        "type": "object",
        "properties": {
          "contributionType": {
            "enum": [
              "Percentage",
              "FixedAmount"
            ],
            "type": "string",
            "nullable": true
          },
          "employeeFactor": {
            "type": "number",
            "format": "float",
            "nullable": true
          },
          "employerFactor": {
            "type": "number",
            "format": "float",
            "nullable": true
          },
          "employeeFixedAmount": {
            "type": "number",
            "format": "double",
            "nullable": true
          },
          "employerFixedAmount": {
            "type": "number",
            "format": "double",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "description": "Per-employee contribution override. When present on an association it fully\nreplaces the pension group's contribution settings."
      },
      "PensionV2_CreateOptOutNoticeUploadRequest": {
        "required": [
          "fileName",
          "membershipEndDate",
          "sizeInBytes"
        ],
        "type": "object",
        "properties": {
          "membershipEndDate": {
            "type": "string",
            "description": "The ending this notice belongs to. The four years run from it.",
            "format": "date"
          },
          "fileName": {
            "type": "string",
            "nullable": true
          },
          "contentType": {
            "type": "string",
            "nullable": true
          },
          "sizeInBytes": {
            "type": "integer",
            "description": "The file's exact size in bytes. The upload link is signed for this size,\nand a file of any other size is refused. At most 10 MB.",
            "format": "int64"
          }
        },
        "additionalProperties": false,
        "description": "Ask for somewhere to put a member's opt-out notice."
      },
      "PensionV2_EarningsModel": {
        "required": [
          "frequency",
          "value"
        ],
        "type": "object",
        "properties": {
          "value": {
            "type": "number",
            "format": "double"
          },
          "frequency": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "PensionV2_EmployeeAutoEnrolmentAssessmentModel": {
        "required": [
          "employeeId",
          "payrollRunId",
          "result",
          "workerAge"
        ],
        "type": "object",
        "properties": {
          "payrollRunId": {
            "$ref": "#/components/schemas/PensionV2_PayRunId"
          },
          "employeeId": {
            "type": "string",
            "nullable": true
          },
          "result": {
            "enum": [
              "EligibleJobholder",
              "NonEligibleJobholder",
              "EntitledWorker",
              "NotEligible"
            ],
            "type": "string",
            "nullable": true
          },
          "workerAge": {
            "type": "integer",
            "format": "int32"
          },
          "earnings": {
            "$ref": "#/components/schemas/PensionV2_EarningsModel"
          },
          "effectiveAssessmentDate": {
            "type": "string",
            "format": "date",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "PensionV2_EmployeeAutoEnrolmentAssessmentModelListApiResponse": {
        "allOf": [
          {
            "$ref": "#/components/schemas/PensionV2_EmployeeAutoEnrolmentAssessmentModelListResponseBody"
          }
        ],
        "description": "Deprecated: renamed to `EmployeeAutoEnrolmentAssessmentModelListResponseBody`, which has the same fields and more.",
        "deprecated": true
      },
      "PensionV2_EmployeeAutoEnrolmentAssessmentModelListContent": {
        "allOf": [
          {
            "$ref": "#/components/schemas/PensionV2_EmployeeAutoEnrolmentAssessmentModelListContentResponse"
          }
        ],
        "description": "Deprecated: renamed to `EmployeeAutoEnrolmentAssessmentModelListContentResponse`, which has the same fields and more.",
        "deprecated": true
      },
      "PensionV2_EmployeeAutoEnrolmentAssessmentModelListContentResponse": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PensionV2_EmployeeAutoEnrolmentAssessmentModel"
            },
            "nullable": true
          },
          "metadata": {
            "$ref": "#/components/schemas/PensionV2_ContentMetadataResponse"
          }
        },
        "additionalProperties": false
      },
      "PensionV2_EmployeeAutoEnrolmentAssessmentModelListResponseBody": {
        "required": [
          "message"
        ],
        "type": "object",
        "properties": {
          "message": {
            "$ref": "#/components/schemas/PensionV2_MessageWithTokenResponse"
          },
          "content": {
            "$ref": "#/components/schemas/PensionV2_EmployeeAutoEnrolmentAssessmentModelListContentResponse"
          },
          "validationIssues": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PensionV2_ValidationIssue"
            },
            "nullable": true
          },
          "errors": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PensionV2_Error"
            },
            "description": "Deprecated: the same issues as `validationIssues` (`reasonText` is `reason`, `reasonId` is `reasonToken`, `reasonParameters` is `reasonTokenArguments`). Read `validationIssues`; this will be removed.",
            "nullable": true,
            "readOnly": true,
            "deprecated": true
          },
          "metadata": {
            "allOf": [
              {
                "$ref": "#/components/schemas/PensionV2_ContentMetadataResponse"
              }
            ],
            "description": "Deprecated: the same values as `content.metadata`. Read that; this will be removed.",
            "deprecated": true
          }
        },
        "additionalProperties": false,
        "description": "The response envelope every FlowPayroll API answers with: a `message`, the\n`content`, and any `validationIssues`. `errors` and the top-level\n`metadata` are deprecated copies of `validationIssues` and\n`content.metadata`, and will be removed."
      },
      "PensionV2_EmployeeAutoEnrolmentComplete": {
        "required": [
          "associatedPayRunId",
          "autoEnrolmentPensionGroup",
          "determinationDate",
          "employeeId",
          "isManualEnrolled",
          "organisationId",
          "revisionNumber",
          "status"
        ],
        "type": "object",
        "properties": {
          "organisationId": {
            "type": "string",
            "nullable": true
          },
          "employeeId": {
            "type": "string",
            "nullable": true
          },
          "determinationDate": {
            "type": "string",
            "format": "date"
          },
          "revisionNumber": {
            "type": "integer",
            "format": "int32"
          },
          "status": {
            "enum": [
              "EligibleJobholder",
              "NonEligibleJobholder",
              "EntitledWorker",
              "NotEligible"
            ],
            "type": "string",
            "nullable": true
          },
          "employee": {
            "$ref": "#/components/schemas/PensionV2_EmployeeMinimal"
          },
          "associatedPayRunId": {
            "$ref": "#/components/schemas/PensionV2_PayRunId"
          },
          "didPostpone": {
            "type": "boolean",
            "description": "Deprecated: true whenever the worker's record carries a postponement that had started by the date asked about, including after their deferral date, when they may have to be enrolled. Read `enrolmentDuty` for what is owed and `postponementEndDate` for the deferral date; this will be removed.",
            "deprecated": true
          },
          "didPostponementExpire": {
            "type": "boolean",
            "description": "Deprecated: true once the date asked about is after `postponementEndDate`, which says nothing about whether the worker has since been assessed or is due to be enrolled. Read `enrolmentDuty` and `postponementEndDate`; this will be removed.",
            "deprecated": true
          },
          "postponementEndDate": {
            "type": "string",
            "format": "date",
            "nullable": true
          },
          "enrolmentDuty": {
            "enum": [
              "Deferred",
              "Due"
            ],
            "type": "string",
            "description": "What the employer owes this worker as at the date asked about:\n`Deferred` while a postponement is still deferring their enrolment\n(nothing to do until `postponementEndDate`), or `Due` when\nthey are an eligible jobholder who has to be enrolled now. Read this\nrather than working it out from `didPostpone` and\n`didPostponementExpire`: a worker assessed on or after their\ndeferral date keeps the postponement on their record and is `Due`.",
            "nullable": true
          },
          "isManualEnrolled": {
            "type": "boolean"
          },
          "autoEnrolmentPensionGroup": {
            "$ref": "#/components/schemas/PensionV2_PensionGroupV2"
          }
        },
        "additionalProperties": false
      },
      "PensionV2_EmployeeAutoEnrolmentCompleteListApiResponse": {
        "allOf": [
          {
            "$ref": "#/components/schemas/PensionV2_EmployeeAutoEnrolmentCompleteListResponseBody"
          }
        ],
        "description": "Deprecated: renamed to `EmployeeAutoEnrolmentCompleteListResponseBody`, which has the same fields and more.",
        "deprecated": true
      },
      "PensionV2_EmployeeAutoEnrolmentCompleteListContent": {
        "allOf": [
          {
            "$ref": "#/components/schemas/PensionV2_EmployeeAutoEnrolmentCompleteListContentResponse"
          }
        ],
        "description": "Deprecated: renamed to `EmployeeAutoEnrolmentCompleteListContentResponse`, which has the same fields and more.",
        "deprecated": true
      },
      "PensionV2_EmployeeAutoEnrolmentCompleteListContentResponse": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PensionV2_EmployeeAutoEnrolmentComplete"
            },
            "nullable": true
          },
          "metadata": {
            "$ref": "#/components/schemas/PensionV2_ContentMetadataResponse"
          }
        },
        "additionalProperties": false
      },
      "PensionV2_EmployeeAutoEnrolmentCompleteListResponseBody": {
        "required": [
          "message"
        ],
        "type": "object",
        "properties": {
          "message": {
            "$ref": "#/components/schemas/PensionV2_MessageWithTokenResponse"
          },
          "content": {
            "$ref": "#/components/schemas/PensionV2_EmployeeAutoEnrolmentCompleteListContentResponse"
          },
          "validationIssues": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PensionV2_ValidationIssue"
            },
            "nullable": true
          },
          "errors": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PensionV2_Error"
            },
            "description": "Deprecated: the same issues as `validationIssues` (`reasonText` is `reason`, `reasonId` is `reasonToken`, `reasonParameters` is `reasonTokenArguments`). Read `validationIssues`; this will be removed.",
            "nullable": true,
            "readOnly": true,
            "deprecated": true
          },
          "metadata": {
            "allOf": [
              {
                "$ref": "#/components/schemas/PensionV2_ContentMetadataResponse"
              }
            ],
            "description": "Deprecated: the same values as `content.metadata`. Read that; this will be removed.",
            "deprecated": true
          }
        },
        "additionalProperties": false,
        "description": "The response envelope every FlowPayroll API answers with: a `message`, the\n`content`, and any `validationIssues`. `errors` and the top-level\n`metadata` are deprecated copies of `validationIssues` and\n`content.metadata`, and will be removed."
      },
      "PensionV2_EmployeeAutoEnrolmentDeterminationModel": {
        "required": [
          "assessmentResult",
          "determinationDate",
          "enrolmentType",
          "isComplete",
          "isManualEnrolled",
          "revisionNumber"
        ],
        "type": "object",
        "properties": {
          "determinationDate": {
            "type": "string",
            "format": "date"
          },
          "revisionNumber": {
            "type": "integer",
            "format": "int32"
          },
          "assessmentResult": {
            "enum": [
              "EligibleJobholder",
              "NonEligibleJobholder",
              "EntitledWorker",
              "NotEligible"
            ],
            "type": "string",
            "nullable": true
          },
          "enrolmentType": {
            "enum": [
              "AutoEnrolment",
              "OptIn",
              "Voluntary",
              "NotEligible"
            ],
            "type": "string",
            "nullable": true
          },
          "isComplete": {
            "type": "boolean"
          },
          "isManualEnrolled": {
            "type": "boolean"
          },
          "optOutDate": {
            "type": "string",
            "format": "date",
            "nullable": true
          },
          "membershipEndReason": {
            "enum": [
              "OptOut",
              "MembershipCeased",
              "AdministrativeRemoval"
            ],
            "type": "string",
            "description": "Why the membership ended: OptOut (valid notice inside the opt-out\nperiod, refunded through payroll), MembershipCeased (later notice,\nscheme rules govern any refund) or AdministrativeRemoval (operator\ndata correction). Null on records from before this was recorded.",
            "nullable": true
          },
          "postponement": {
            "$ref": "#/components/schemas/PensionV2_PostponementModel"
          }
        },
        "additionalProperties": false
      },
      "PensionV2_EmployeeAutoEnrolmentExemption": {
        "required": [
          "employeeId",
          "organisationId",
          "reason"
        ],
        "type": "object",
        "properties": {
          "organisationId": {
            "type": "string",
            "nullable": true
          },
          "employeeId": {
            "type": "string",
            "nullable": true
          },
          "reason": {
            "enum": [
              "Director",
              "OfficeHolder",
              "LlpMember",
              "TaxProtection",
              "CeasedMembershipWithinTwelveMonths",
              "WindingUpLumpSum",
              "NoticeOfTermination"
            ],
            "type": "string",
            "description": "The Pensions Regulator exception the exemption rests on: \"Director\" (no\ncontract of employment, so not a worker), \"OfficeHolder\",\n\"LlpMember\", \"TaxProtection\" (HMRC protection the employer has\nreasonable grounds to believe in), \"CeasedMembershipWithinTwelveMonths\",\n\"WindingUpLumpSum\" or \"NoticeOfTermination\".",
            "nullable": true
          },
          "note": {
            "type": "string",
            "description": "Free-text evidence or context, e.g. which HMRC protection certificate\nwas seen. Shown on the employee's pension record.",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "description": "A per-employee exemption from the automatic enrolment and cyclical\nre-enrolment duties. While one is in place the employee is never assessed\nor automatically enrolled, and stops appearing in the not-complete\nauto-enrolment listing; they keep the right to join, so manual enrolment\nand opt-in work as normal. Deleting the exemption resumes assessment on\nthe next pay run."
      },
      "PensionV2_EmployeeAutoEnrolmentExemptionApiResponse": {
        "allOf": [
          {
            "$ref": "#/components/schemas/PensionV2_EmployeeAutoEnrolmentExemptionResponseBody"
          }
        ],
        "description": "Deprecated: renamed to `EmployeeAutoEnrolmentExemptionResponseBody`, which has the same fields and more.",
        "deprecated": true
      },
      "PensionV2_EmployeeAutoEnrolmentExemptionContent": {
        "allOf": [
          {
            "$ref": "#/components/schemas/PensionV2_EmployeeAutoEnrolmentExemptionContentResponse"
          }
        ],
        "description": "Deprecated: renamed to `EmployeeAutoEnrolmentExemptionContentResponse`, which has the same fields and more.",
        "deprecated": true
      },
      "PensionV2_EmployeeAutoEnrolmentExemptionContentResponse": {
        "type": "object",
        "properties": {
          "data": {
            "$ref": "#/components/schemas/PensionV2_EmployeeAutoEnrolmentExemption"
          },
          "metadata": {
            "$ref": "#/components/schemas/PensionV2_ContentMetadataResponse"
          }
        },
        "additionalProperties": false
      },
      "PensionV2_EmployeeAutoEnrolmentExemptionResponseBody": {
        "required": [
          "message"
        ],
        "type": "object",
        "properties": {
          "message": {
            "$ref": "#/components/schemas/PensionV2_MessageWithTokenResponse"
          },
          "content": {
            "$ref": "#/components/schemas/PensionV2_EmployeeAutoEnrolmentExemptionContentResponse"
          },
          "validationIssues": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PensionV2_ValidationIssue"
            },
            "nullable": true
          },
          "errors": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PensionV2_Error"
            },
            "description": "Deprecated: the same issues as `validationIssues` (`reasonText` is `reason`, `reasonId` is `reasonToken`, `reasonParameters` is `reasonTokenArguments`). Read `validationIssues`; this will be removed.",
            "nullable": true,
            "readOnly": true,
            "deprecated": true
          },
          "metadata": {
            "allOf": [
              {
                "$ref": "#/components/schemas/PensionV2_ContentMetadataResponse"
              }
            ],
            "description": "Deprecated: the same values as `content.metadata`. Read that; this will be removed.",
            "deprecated": true
          }
        },
        "additionalProperties": false,
        "description": "The response envelope every FlowPayroll API answers with: a `message`, the\n`content`, and any `validationIssues`. `errors` and the top-level\n`metadata` are deprecated copies of `validationIssues` and\n`content.metadata`, and will be removed."
      },
      "PensionV2_EmployeeAutoEnrolmentNotComplete": {
        "required": [
          "associatedPayRunId",
          "determinationDate",
          "employeeId",
          "organisationId",
          "revisionNumber",
          "status"
        ],
        "type": "object",
        "properties": {
          "organisationId": {
            "type": "string",
            "nullable": true
          },
          "employeeId": {
            "type": "string",
            "nullable": true
          },
          "determinationDate": {
            "type": "string",
            "format": "date"
          },
          "revisionNumber": {
            "type": "integer",
            "format": "int32"
          },
          "status": {
            "enum": [
              "EligibleJobholder",
              "NonEligibleJobholder",
              "EntitledWorker",
              "NotEligible"
            ],
            "type": "string",
            "nullable": true
          },
          "employee": {
            "$ref": "#/components/schemas/PensionV2_EmployeeMinimal"
          },
          "associatedPayRunId": {
            "$ref": "#/components/schemas/PensionV2_PayRunId"
          },
          "didPostpone": {
            "type": "boolean",
            "description": "Deprecated: true whenever the worker's record carries a postponement that had started by the date asked about, including after their deferral date, when they may have to be enrolled. Read `enrolmentDuty` for what is owed and `postponementEndDate` for the deferral date; this will be removed.",
            "deprecated": true
          },
          "didPostponementExpire": {
            "type": "boolean",
            "description": "Deprecated: true once the date asked about is after `postponementEndDate`, which says nothing about whether the worker has since been assessed or is due to be enrolled. Read `enrolmentDuty` and `postponementEndDate`; this will be removed.",
            "deprecated": true
          },
          "postponementEndDate": {
            "type": "string",
            "format": "date",
            "nullable": true
          },
          "enrolmentDuty": {
            "enum": [
              "Deferred",
              "Due"
            ],
            "type": "string",
            "description": "What the employer owes this worker as at the date asked about:\n`Deferred` while a postponement is still deferring their enrolment\n(nothing to do until `postponementEndDate`), or `Due` when\nthey are an eligible jobholder who has to be enrolled now. Read this\nrather than working it out from `didPostpone` and\n`didPostponementExpire`: a worker assessed on or after their\ndeferral date keeps the postponement on their record and is `Due`.",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "PensionV2_EmployeeAutoEnrolmentNotCompleteListApiResponse": {
        "allOf": [
          {
            "$ref": "#/components/schemas/PensionV2_EmployeeAutoEnrolmentNotCompleteListResponseBody"
          }
        ],
        "description": "Deprecated: renamed to `EmployeeAutoEnrolmentNotCompleteListResponseBody`, which has the same fields and more.",
        "deprecated": true
      },
      "PensionV2_EmployeeAutoEnrolmentNotCompleteListContent": {
        "allOf": [
          {
            "$ref": "#/components/schemas/PensionV2_EmployeeAutoEnrolmentNotCompleteListContentResponse"
          }
        ],
        "description": "Deprecated: renamed to `EmployeeAutoEnrolmentNotCompleteListContentResponse`, which has the same fields and more.",
        "deprecated": true
      },
      "PensionV2_EmployeeAutoEnrolmentNotCompleteListContentResponse": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PensionV2_EmployeeAutoEnrolmentNotComplete"
            },
            "nullable": true
          },
          "metadata": {
            "$ref": "#/components/schemas/PensionV2_ContentMetadataResponse"
          }
        },
        "additionalProperties": false
      },
      "PensionV2_EmployeeAutoEnrolmentNotCompleteListResponseBody": {
        "required": [
          "message"
        ],
        "type": "object",
        "properties": {
          "message": {
            "$ref": "#/components/schemas/PensionV2_MessageWithTokenResponse"
          },
          "content": {
            "$ref": "#/components/schemas/PensionV2_EmployeeAutoEnrolmentNotCompleteListContentResponse"
          },
          "validationIssues": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PensionV2_ValidationIssue"
            },
            "nullable": true
          },
          "errors": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PensionV2_Error"
            },
            "description": "Deprecated: the same issues as `validationIssues` (`reasonText` is `reason`, `reasonId` is `reasonToken`, `reasonParameters` is `reasonTokenArguments`). Read `validationIssues`; this will be removed.",
            "nullable": true,
            "readOnly": true,
            "deprecated": true
          },
          "metadata": {
            "allOf": [
              {
                "$ref": "#/components/schemas/PensionV2_ContentMetadataResponse"
              }
            ],
            "description": "Deprecated: the same values as `content.metadata`. Read that; this will be removed.",
            "deprecated": true
          }
        },
        "additionalProperties": false,
        "description": "The response envelope every FlowPayroll API answers with: a `message`, the\n`content`, and any `validationIssues`. `errors` and the top-level\n`metadata` are deprecated copies of `validationIssues` and\n`content.metadata`, and will be removed."
      },
      "PensionV2_EmployeeMinimal": {
        "required": [
          "employeeId",
          "firstName",
          "lastName",
          "organisationId"
        ],
        "type": "object",
        "properties": {
          "organisationId": {
            "type": "string",
            "nullable": true
          },
          "employeeId": {
            "type": "string",
            "nullable": true
          },
          "firstName": {
            "type": "string",
            "nullable": true
          },
          "lastName": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "PensionV2_EmployeeNotAutoEnrolment": {
        "required": [
          "assessmentResult",
          "associatedPayRunId",
          "determinationDate",
          "employeeId",
          "organisationId",
          "revisionNumber",
          "status"
        ],
        "type": "object",
        "properties": {
          "organisationId": {
            "type": "string",
            "nullable": true
          },
          "employeeId": {
            "type": "string",
            "nullable": true
          },
          "determinationDate": {
            "type": "string",
            "format": "date"
          },
          "revisionNumber": {
            "type": "integer",
            "format": "int32"
          },
          "status": {
            "enum": [
              "EligibleJobholder",
              "NonEligibleJobholder",
              "EntitledWorker",
              "NotEligible"
            ],
            "type": "string",
            "nullable": true
          },
          "employee": {
            "$ref": "#/components/schemas/PensionV2_EmployeeMinimal"
          },
          "associatedPayRunId": {
            "$ref": "#/components/schemas/PensionV2_PayRunId"
          },
          "assessmentResult": {
            "enum": [
              "EligibleJobholder",
              "NonEligibleJobholder",
              "EntitledWorker",
              "NotEligible"
            ],
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "PensionV2_EmployeeNotAutoEnrolmentListApiResponse": {
        "allOf": [
          {
            "$ref": "#/components/schemas/PensionV2_EmployeeNotAutoEnrolmentListResponseBody"
          }
        ],
        "description": "Deprecated: renamed to `EmployeeNotAutoEnrolmentListResponseBody`, which has the same fields and more.",
        "deprecated": true
      },
      "PensionV2_EmployeeNotAutoEnrolmentListContent": {
        "allOf": [
          {
            "$ref": "#/components/schemas/PensionV2_EmployeeNotAutoEnrolmentListContentResponse"
          }
        ],
        "description": "Deprecated: renamed to `EmployeeNotAutoEnrolmentListContentResponse`, which has the same fields and more.",
        "deprecated": true
      },
      "PensionV2_EmployeeNotAutoEnrolmentListContentResponse": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PensionV2_EmployeeNotAutoEnrolment"
            },
            "nullable": true
          },
          "metadata": {
            "$ref": "#/components/schemas/PensionV2_ContentMetadataResponse"
          }
        },
        "additionalProperties": false
      },
      "PensionV2_EmployeeNotAutoEnrolmentListResponseBody": {
        "required": [
          "message"
        ],
        "type": "object",
        "properties": {
          "message": {
            "$ref": "#/components/schemas/PensionV2_MessageWithTokenResponse"
          },
          "content": {
            "$ref": "#/components/schemas/PensionV2_EmployeeNotAutoEnrolmentListContentResponse"
          },
          "validationIssues": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PensionV2_ValidationIssue"
            },
            "nullable": true
          },
          "errors": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PensionV2_Error"
            },
            "description": "Deprecated: the same issues as `validationIssues` (`reasonText` is `reason`, `reasonId` is `reasonToken`, `reasonParameters` is `reasonTokenArguments`). Read `validationIssues`; this will be removed.",
            "nullable": true,
            "readOnly": true,
            "deprecated": true
          },
          "metadata": {
            "allOf": [
              {
                "$ref": "#/components/schemas/PensionV2_ContentMetadataResponse"
              }
            ],
            "description": "Deprecated: the same values as `content.metadata`. Read that; this will be removed.",
            "deprecated": true
          }
        },
        "additionalProperties": false,
        "description": "The response envelope every FlowPayroll API answers with: a `message`, the\n`content`, and any `validationIssues`. `errors` and the top-level\n`metadata` are deprecated copies of `validationIssues` and\n`content.metadata`, and will be removed."
      },
      "PensionV2_EmployeePensionAssociation": {
        "required": [
          "createdBy",
          "createdDate",
          "employeeId",
          "enrolmentDate",
          "organisationId",
          "pensionGroupId",
          "updatedBy",
          "updatedDate"
        ],
        "type": "object",
        "properties": {
          "organisationId": {
            "type": "string",
            "nullable": true
          },
          "employeeId": {
            "type": "string",
            "nullable": true
          },
          "pensionGroupId": {
            "type": "string",
            "nullable": true
          },
          "enrolmentDate": {
            "type": "string",
            "format": "date",
            "nullable": true
          },
          "recurringContributionOverride": {
            "$ref": "#/components/schemas/PensionV2_ContributionOverrideValuesModel"
          },
          "recurringAdditionalVoluntaryContribution": {
            "$ref": "#/components/schemas/PensionV2_RecurringAdditionalVoluntaryContributionModel"
          },
          "enrolmentInformationSentDate": {
            "type": "string",
            "description": "The day the member was given their enrolment information, if the\nplatform can evidence it. The statutory opt-out period runs from the\nlater of this and the enrolment date (TPR DG7 paras 17-18), so it is\nthe first CONFIRMED send and never moves on a resend.\n            \n\nNull means the platform cannot evidence it, NOT that nothing was\nsent: a provider's own welcome pack, or a letter the employer posted,\nare dates it never sees. Check `enrolmentLetter` for what Flow\nitself did.",
            "format": "date",
            "nullable": true
          },
          "enrolmentInformationSentBy": {
            "type": "string",
            "description": "Who issued that first confirmed letter.",
            "nullable": true
          },
          "enrolmentLetter": {
            "$ref": "#/components/schemas/PensionV2_EnrolmentLetterModel"
          },
          "createdBy": {
            "type": "string",
            "nullable": true
          },
          "createdDate": {
            "type": "string",
            "format": "date-time"
          },
          "updatedBy": {
            "type": "string",
            "nullable": true
          },
          "updatedDate": {
            "type": "string",
            "format": "date-time"
          }
        },
        "additionalProperties": false
      },
      "PensionV2_EmployeePensionAssociationApiResponse": {
        "allOf": [
          {
            "$ref": "#/components/schemas/PensionV2_EmployeePensionAssociationResponseBody"
          }
        ],
        "description": "Deprecated: renamed to `EmployeePensionAssociationResponseBody`, which has the same fields and more.",
        "deprecated": true
      },
      "PensionV2_EmployeePensionAssociationContent": {
        "allOf": [
          {
            "$ref": "#/components/schemas/PensionV2_EmployeePensionAssociationContentResponse"
          }
        ],
        "description": "Deprecated: renamed to `EmployeePensionAssociationContentResponse`, which has the same fields and more.",
        "deprecated": true
      },
      "PensionV2_EmployeePensionAssociationContentResponse": {
        "type": "object",
        "properties": {
          "data": {
            "$ref": "#/components/schemas/PensionV2_EmployeePensionAssociation"
          },
          "metadata": {
            "$ref": "#/components/schemas/PensionV2_ContentMetadataResponse"
          }
        },
        "additionalProperties": false
      },
      "PensionV2_EmployeePensionAssociationResponseBody": {
        "required": [
          "message"
        ],
        "type": "object",
        "properties": {
          "message": {
            "$ref": "#/components/schemas/PensionV2_MessageWithTokenResponse"
          },
          "content": {
            "$ref": "#/components/schemas/PensionV2_EmployeePensionAssociationContentResponse"
          },
          "validationIssues": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PensionV2_ValidationIssue"
            },
            "nullable": true
          },
          "errors": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PensionV2_Error"
            },
            "description": "Deprecated: the same issues as `validationIssues` (`reasonText` is `reason`, `reasonId` is `reasonToken`, `reasonParameters` is `reasonTokenArguments`). Read `validationIssues`; this will be removed.",
            "nullable": true,
            "readOnly": true,
            "deprecated": true
          },
          "metadata": {
            "allOf": [
              {
                "$ref": "#/components/schemas/PensionV2_ContentMetadataResponse"
              }
            ],
            "description": "Deprecated: the same values as `content.metadata`. Read that; this will be removed.",
            "deprecated": true
          }
        },
        "additionalProperties": false,
        "description": "The response envelope every FlowPayroll API answers with: a `message`, the\n`content`, and any `validationIssues`. `errors` and the top-level\n`metadata` are deprecated copies of `validationIssues` and\n`content.metadata`, and will be removed."
      },
      "PensionV2_EmployeePensionCalculationV2": {
        "required": [
          "employeeAmount",
          "employeeId",
          "employerAmount",
          "frequency",
          "organisationId",
          "payrollConfigId",
          "period",
          "year"
        ],
        "type": "object",
        "properties": {
          "employeeId": {
            "type": "string",
            "nullable": true
          },
          "frequency": {
            "type": "string",
            "nullable": true
          },
          "year": {
            "type": "integer",
            "format": "int32"
          },
          "period": {
            "type": "integer",
            "format": "int32"
          },
          "payrollConfigId": {
            "type": "string",
            "nullable": true
          },
          "organisationId": {
            "type": "string",
            "nullable": true
          },
          "employeeAmount": {
            "type": "number",
            "format": "double"
          },
          "employerAmount": {
            "type": "number",
            "format": "double"
          },
          "additionalVoluntaryAmount": {
            "type": "number",
            "description": "The additional voluntary contribution portion of employeeAmount (standing\nplus any one-off top-up). Zero when the member pays only the scheme contribution.",
            "format": "double"
          },
          "periodStart": {
            "type": "string",
            "format": "date"
          },
          "periodEnd": {
            "type": "string",
            "format": "date"
          },
          "nationalInsuranceNumber": {
            "type": "string",
            "nullable": true
          },
          "externalReferenceId": {
            "type": "string",
            "nullable": true
          },
          "pensionProviderId": {
            "type": "string",
            "nullable": true
          },
          "refunded": {
            "type": "boolean",
            "description": "Whether these contributions have since been refunded because the member\nopted out. The amounts above are left as they were settled (the period\nreally did deduct them, and the provider file for that period reported\nthem), so this flag is the only thing that says the money went back.\nRead it before presenting a past period's contributions as still held.\nThe member's share is refunded through payroll; the employer's is repaid\nby the scheme to the employer, so see the pension membership endings\nendpoint for who owes what."
          },
          "lockCycle": {
            "type": "integer",
            "description": "The lock cycle of the Final payslip this was settled from: 1 for a run\nlocked once, n + 1 once the run was unlocked from cycle n and locked\nagain.",
            "format": "int32"
          },
          "reopenedOnLockCycle": {
            "type": "integer",
            "description": "Set while the payslip this was settled from is reopened by an unlock\nand no Final of the next cycle has replaced the figures: the cycle the\nrun reopened onto. The amounts are the ones being corrected.",
            "format": "int32",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "PensionV2_EmployeePensionCalculationV2ApiResponse": {
        "allOf": [
          {
            "$ref": "#/components/schemas/PensionV2_EmployeePensionCalculationV2ResponseBody"
          }
        ],
        "description": "Deprecated: renamed to `EmployeePensionCalculationV2ResponseBody`, which has the same fields and more.",
        "deprecated": true
      },
      "PensionV2_EmployeePensionCalculationV2Content": {
        "allOf": [
          {
            "$ref": "#/components/schemas/PensionV2_EmployeePensionCalculationV2ContentResponse"
          }
        ],
        "description": "Deprecated: renamed to `EmployeePensionCalculationV2ContentResponse`, which has the same fields and more.",
        "deprecated": true
      },
      "PensionV2_EmployeePensionCalculationV2ContentResponse": {
        "type": "object",
        "properties": {
          "data": {
            "$ref": "#/components/schemas/PensionV2_EmployeePensionCalculationV2"
          },
          "metadata": {
            "$ref": "#/components/schemas/PensionV2_ContentMetadataResponse"
          }
        },
        "additionalProperties": false
      },
      "PensionV2_EmployeePensionCalculationV2ListApiResponse": {
        "allOf": [
          {
            "$ref": "#/components/schemas/PensionV2_EmployeePensionCalculationV2ListResponseBody"
          }
        ],
        "description": "Deprecated: renamed to `EmployeePensionCalculationV2ListResponseBody`, which has the same fields and more.",
        "deprecated": true
      },
      "PensionV2_EmployeePensionCalculationV2ListContent": {
        "allOf": [
          {
            "$ref": "#/components/schemas/PensionV2_EmployeePensionCalculationV2ListContentResponse"
          }
        ],
        "description": "Deprecated: renamed to `EmployeePensionCalculationV2ListContentResponse`, which has the same fields and more.",
        "deprecated": true
      },
      "PensionV2_EmployeePensionCalculationV2ListContentResponse": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PensionV2_EmployeePensionCalculationV2"
            },
            "nullable": true
          },
          "metadata": {
            "$ref": "#/components/schemas/PensionV2_ContentMetadataResponse"
          }
        },
        "additionalProperties": false
      },
      "PensionV2_EmployeePensionCalculationV2ListResponseBody": {
        "required": [
          "message"
        ],
        "type": "object",
        "properties": {
          "message": {
            "$ref": "#/components/schemas/PensionV2_MessageWithTokenResponse"
          },
          "content": {
            "$ref": "#/components/schemas/PensionV2_EmployeePensionCalculationV2ListContentResponse"
          },
          "validationIssues": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PensionV2_ValidationIssue"
            },
            "nullable": true
          },
          "errors": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PensionV2_Error"
            },
            "description": "Deprecated: the same issues as `validationIssues` (`reasonText` is `reason`, `reasonId` is `reasonToken`, `reasonParameters` is `reasonTokenArguments`). Read `validationIssues`; this will be removed.",
            "nullable": true,
            "readOnly": true,
            "deprecated": true
          },
          "metadata": {
            "allOf": [
              {
                "$ref": "#/components/schemas/PensionV2_ContentMetadataResponse"
              }
            ],
            "description": "Deprecated: the same values as `content.metadata`. Read that; this will be removed.",
            "deprecated": true
          }
        },
        "additionalProperties": false,
        "description": "The response envelope every FlowPayroll API answers with: a `message`, the\n`content`, and any `validationIssues`. `errors` and the top-level\n`metadata` are deprecated copies of `validationIssues` and\n`content.metadata`, and will be removed."
      },
      "PensionV2_EmployeePensionCalculationV2ResponseBody": {
        "required": [
          "message"
        ],
        "type": "object",
        "properties": {
          "message": {
            "$ref": "#/components/schemas/PensionV2_MessageWithTokenResponse"
          },
          "content": {
            "$ref": "#/components/schemas/PensionV2_EmployeePensionCalculationV2ContentResponse"
          },
          "validationIssues": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PensionV2_ValidationIssue"
            },
            "nullable": true
          },
          "errors": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PensionV2_Error"
            },
            "description": "Deprecated: the same issues as `validationIssues` (`reasonText` is `reason`, `reasonId` is `reasonToken`, `reasonParameters` is `reasonTokenArguments`). Read `validationIssues`; this will be removed.",
            "nullable": true,
            "readOnly": true,
            "deprecated": true
          },
          "metadata": {
            "allOf": [
              {
                "$ref": "#/components/schemas/PensionV2_ContentMetadataResponse"
              }
            ],
            "description": "Deprecated: the same values as `content.metadata`. Read that; this will be removed.",
            "deprecated": true
          }
        },
        "additionalProperties": false,
        "description": "The response envelope every FlowPayroll API answers with: a `message`, the\n`content`, and any `validationIssues`. `errors` and the top-level\n`metadata` are deprecated copies of `validationIssues` and\n`content.metadata`, and will be removed."
      },
      "PensionV2_EmployeePensionCompositionV2": {
        "required": [
          "employeeId",
          "enrolmentDate",
          "enrolmentLetterScheduled",
          "isAutoEnrolled",
          "organisationId",
          "pensionGroup",
          "pensionGroupId"
        ],
        "type": "object",
        "properties": {
          "organisationId": {
            "type": "string",
            "nullable": true
          },
          "employeeId": {
            "type": "string",
            "nullable": true
          },
          "pensionGroupId": {
            "type": "string",
            "nullable": true
          },
          "enrolmentDate": {
            "type": "string",
            "format": "date",
            "nullable": true
          },
          "pensionGroup": {
            "$ref": "#/components/schemas/PensionV2_PensionGroupV2"
          },
          "isAutoEnrolled": {
            "type": "boolean"
          },
          "autoEnrolmentPensionGroup": {
            "allOf": [
              {
                "$ref": "#/components/schemas/PensionV2_PensionGroupV2"
              }
            ],
            "description": "Deprecated: exposes how the association is stored rather than the employee's pension. Rely on `pensionGroup` for the group in force, and `isAutoEnrolled` for how the employee came to be enrolled.",
            "deprecated": true
          },
          "manualEnrolmentPensionGroup": {
            "allOf": [
              {
                "$ref": "#/components/schemas/PensionV2_PensionGroupV2"
              }
            ],
            "description": "Deprecated: exposes how the association is stored rather than the employee's pension. Rely on `pensionGroup` for the group in force, and `isAutoEnrolled` for how the employee came to be enrolled.",
            "deprecated": true
          },
          "enrolmentType": {
            "enum": [
              "AutoEnrolment",
              "OptIn",
              "Voluntary",
              "NotEligible"
            ],
            "type": "string",
            "nullable": true
          },
          "enrolmentInformationSentDate": {
            "type": "string",
            "description": "The day the member was given their enrolment information, if the\nplatform can evidence it. The statutory opt-out period runs from the\nlater of this and the enrolment date (TPR DG7 paras 17-18), so it is\nthe first CONFIRMED send and never moves on a resend.\n            \n\nNull means the platform cannot evidence it, NOT that nothing was\nsent: a provider's own welcome pack, or a letter the employer posted,\nare dates it never sees. Check `enrolmentLetter` for what Flow\nitself did.",
            "format": "date",
            "nullable": true
          },
          "enrolmentInformationSentBy": {
            "type": "string",
            "description": "Who issued that first confirmed letter.",
            "nullable": true
          },
          "enrolmentLetter": {
            "$ref": "#/components/schemas/PensionV2_EnrolmentLetterModel"
          },
          "enrolmentLetterScheduled": {
            "type": "boolean",
            "description": "Flow will send this member's letter itself when their next pay run is\nfinalised, whether they were enrolled automatically or added by hand.\n            \n\nPublished so a screen can say so before offering to send one by\nhand. Sending anyway is allowed and is not a duplicate, because any send\ndischarges the pending automatic one, but somebody pressing the button\nshould know it was already coming."
          },
          "enrolmentRoute": {
            "enum": [
              "Contractual",
              "OptIn",
              "Join",
              "Duty"
            ],
            "type": "string",
            "description": "How a member added by hand joined: `Duty` (an eligible jobholder put in because the law\nrequires it; may opt out), `OptIn` (a jobholder who asked in writing; may opt out),\n`Join` (an entitled worker who asked to join) or `Contractual` (enrolled under\ntheir contract). Absent while the automatic membership is the active one.",
            "nullable": true
          },
          "recurringContributionOverride": {
            "$ref": "#/components/schemas/PensionV2_ContributionOverrideValuesModel"
          },
          "recurringAdditionalVoluntaryContribution": {
            "$ref": "#/components/schemas/PensionV2_RecurringAdditionalVoluntaryContributionModel"
          }
        },
        "additionalProperties": false
      },
      "PensionV2_EmployeePensionCompositionV2ApiResponse": {
        "allOf": [
          {
            "$ref": "#/components/schemas/PensionV2_EmployeePensionCompositionV2ResponseBody"
          }
        ],
        "description": "Deprecated: renamed to `EmployeePensionCompositionV2ResponseBody`, which has the same fields and more.",
        "deprecated": true
      },
      "PensionV2_EmployeePensionCompositionV2Content": {
        "allOf": [
          {
            "$ref": "#/components/schemas/PensionV2_EmployeePensionCompositionV2ContentResponse"
          }
        ],
        "description": "Deprecated: renamed to `EmployeePensionCompositionV2ContentResponse`, which has the same fields and more.",
        "deprecated": true
      },
      "PensionV2_EmployeePensionCompositionV2ContentResponse": {
        "type": "object",
        "properties": {
          "data": {
            "$ref": "#/components/schemas/PensionV2_EmployeePensionCompositionV2"
          },
          "metadata": {
            "$ref": "#/components/schemas/PensionV2_ContentMetadataResponse"
          }
        },
        "additionalProperties": false
      },
      "PensionV2_EmployeePensionCompositionV2ListApiResponse": {
        "allOf": [
          {
            "$ref": "#/components/schemas/PensionV2_EmployeePensionCompositionV2ListResponseBody"
          }
        ],
        "description": "Deprecated: renamed to `EmployeePensionCompositionV2ListResponseBody`, which has the same fields and more.",
        "deprecated": true
      },
      "PensionV2_EmployeePensionCompositionV2ListContent": {
        "allOf": [
          {
            "$ref": "#/components/schemas/PensionV2_EmployeePensionCompositionV2ListContentResponse"
          }
        ],
        "description": "Deprecated: renamed to `EmployeePensionCompositionV2ListContentResponse`, which has the same fields and more.",
        "deprecated": true
      },
      "PensionV2_EmployeePensionCompositionV2ListContentResponse": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PensionV2_EmployeePensionCompositionV2"
            },
            "nullable": true
          },
          "metadata": {
            "$ref": "#/components/schemas/PensionV2_ContentMetadataResponse"
          }
        },
        "additionalProperties": false
      },
      "PensionV2_EmployeePensionCompositionV2ListResponseBody": {
        "required": [
          "message"
        ],
        "type": "object",
        "properties": {
          "message": {
            "$ref": "#/components/schemas/PensionV2_MessageWithTokenResponse"
          },
          "content": {
            "$ref": "#/components/schemas/PensionV2_EmployeePensionCompositionV2ListContentResponse"
          },
          "validationIssues": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PensionV2_ValidationIssue"
            },
            "nullable": true
          },
          "errors": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PensionV2_Error"
            },
            "description": "Deprecated: the same issues as `validationIssues` (`reasonText` is `reason`, `reasonId` is `reasonToken`, `reasonParameters` is `reasonTokenArguments`). Read `validationIssues`; this will be removed.",
            "nullable": true,
            "readOnly": true,
            "deprecated": true
          },
          "metadata": {
            "allOf": [
              {
                "$ref": "#/components/schemas/PensionV2_ContentMetadataResponse"
              }
            ],
            "description": "Deprecated: the same values as `content.metadata`. Read that; this will be removed.",
            "deprecated": true
          }
        },
        "additionalProperties": false,
        "description": "The response envelope every FlowPayroll API answers with: a `message`, the\n`content`, and any `validationIssues`. `errors` and the top-level\n`metadata` are deprecated copies of `validationIssues` and\n`content.metadata`, and will be removed."
      },
      "PensionV2_EmployeePensionCompositionV2ResponseBody": {
        "required": [
          "message"
        ],
        "type": "object",
        "properties": {
          "message": {
            "$ref": "#/components/schemas/PensionV2_MessageWithTokenResponse"
          },
          "content": {
            "$ref": "#/components/schemas/PensionV2_EmployeePensionCompositionV2ContentResponse"
          },
          "validationIssues": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PensionV2_ValidationIssue"
            },
            "nullable": true
          },
          "errors": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PensionV2_Error"
            },
            "description": "Deprecated: the same issues as `validationIssues` (`reasonText` is `reason`, `reasonId` is `reasonToken`, `reasonParameters` is `reasonTokenArguments`). Read `validationIssues`; this will be removed.",
            "nullable": true,
            "readOnly": true,
            "deprecated": true
          },
          "metadata": {
            "allOf": [
              {
                "$ref": "#/components/schemas/PensionV2_ContentMetadataResponse"
              }
            ],
            "description": "Deprecated: the same values as `content.metadata`. Read that; this will be removed.",
            "deprecated": true
          }
        },
        "additionalProperties": false,
        "description": "The response envelope every FlowPayroll API answers with: a `message`, the\n`content`, and any `validationIssues`. `errors` and the top-level\n`metadata` are deprecated copies of `validationIssues` and\n`content.metadata`, and will be removed."
      },
      "PensionV2_EmployeePensionOptOutModel": {
        "required": [
          "employerRefundTotal",
          "membershipEndReason",
          "refundTotal",
          "refundedPeriods"
        ],
        "type": "object",
        "properties": {
          "membershipEndReason": {
            "enum": [
              "OptOut",
              "MembershipCeased",
              "AdministrativeRemoval"
            ],
            "type": "string",
            "description": "Why the membership ended (or would end, on a preview): \"OptOut\" (the\nemployer processed an opt-out), \"MembershipCeased\" (the member left\noutside the opt-out period, or has no right to opt out because they were\nput in under their contract or asked to join) or \"AdministrativeRemoval\"\n(a data correction with no statutory event). A preview gives the reason\nthe member leaving would be recorded with.",
            "nullable": true
          },
          "refundTotal": {
            "type": "number",
            "description": "Member contributions refunded (or, on a preview, refundable) to the\nemployee on their next payslip. Includes additional voluntary\ncontributions deducted from pay.",
            "format": "double"
          },
          "employerRefundTotal": {
            "type": "number",
            "description": "Employer contributions for the refunded periods. The provider returns\nthese to the employer directly; they never appear on the payslip.\nReported so the employer can reconcile the provider's refund.",
            "format": "double"
          },
          "enrolmentDate": {
            "type": "string",
            "description": "The date the member was enrolled. Shown so a reader can see what the\nopt-out period below was counted from. Null when it cannot be resolved.",
            "format": "date",
            "nullable": true
          },
          "optOutPeriodEndDate": {
            "type": "string",
            "description": "The last day an opt-out counted from the enrolment date would still\ncarry a refund (TPR DG7: one month beginning with that date).\n            \n\nINDICATIVE, not authoritative. The statutory period runs from the\nLATER of becoming an active member and receiving the enrolment\ninformation, and the platform does not hold the date the enrolment\nletter reached the worker. So this is the EARLIEST the period can end:\na leaving date on or before it is certainly inside, one after it may\nstill be inside if the letter went out later. Whether a refund is due\nremains the employer's assessment, against what the provider\nconfirms.",
            "format": "date",
            "nullable": true
          },
          "enrolmentInformationSentDate": {
            "type": "string",
            "description": "The day the member was given their enrolment information, where the\nplatform can evidence it. The window runs from the later of this and\nthe enrolment date, so without it the end date reads as bad arithmetic:\nenrolled on the 25th, period ending on the 27th of the next month.\nNull when we hold no evidence, in which case the window is counted from\nthe enrolment date.",
            "format": "date",
            "nullable": true
          },
          "withinOptOutPeriod": {
            "type": "boolean",
            "description": "Whether the date given falls on or before `optOutPeriodEndDate`.\nNull when the enrolment date is unknown, which is the one case nobody\ncan answer. Read it with the caveat on `optOutPeriodEndDate`:\nfalse does not prove a refund is not due.",
            "nullable": true
          },
          "optOutWindowBasis": {
            "type": "string",
            "description": "Which test the window came from, because they are not interchangeable:\n\"StatutoryOptOutPeriod\" is the one month an automatically enrolled\njobholder or an opt-in holds by right (TPR DG7 §7-8, §17-18);\n\"SchemeRulesCessation\" is the 30 days from active membership that a\ncontractually enrolled worker or an entitled worker gets instead, and\nonly where the scheme rules provide a refund (§9, §57-58);\n\"Unknown\" means nothing says how the member joined, so no test is\nasserted and the employer should not read the dates as an answer: send\nenrolmentBasis on their pension to settle it.",
            "nullable": true
          },
          "mayOptOut": {
            "type": "boolean",
            "description": "On the refund preview: false only when this member is known to have been put in under\ntheir contract or to have asked to join as an entitled worker, which gives them no right to\nopt out (TPR detailed guidance 7), so an opt-out is refused. That is known when the\nemployer said so (enrolmentBasis) or when the pay run's assessment still described them on\nthe day they were added. True otherwise, including when nothing says how they joined\n(optOutWindowBasis \"Unknown\"). Absent on a removal.",
            "nullable": true
          },
          "refundedPeriods": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PensionV2_RefundedPensionPeriodModel"
            },
            "description": "The settled pay periods whose contributions make up the refund, one\nentry per pay run. Empty when nothing was refunded through payroll.",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "description": "The result of removing an employee from their pension (or of a refund\npreview). Whether a removal is a statutory opt-out inside The Pensions\nRegulator's opt-out period is the employer's assessment; the platform\nrecords the assertion and processes the refund when asked to."
      },
      "PensionV2_EmployeePensionOptOutModelApiResponse": {
        "allOf": [
          {
            "$ref": "#/components/schemas/PensionV2_EmployeePensionOptOutModelResponseBody"
          }
        ],
        "description": "Deprecated: renamed to `EmployeePensionOptOutModelResponseBody`, which has the same fields and more.",
        "deprecated": true
      },
      "PensionV2_EmployeePensionOptOutModelContent": {
        "allOf": [
          {
            "$ref": "#/components/schemas/PensionV2_EmployeePensionOptOutModelContentResponse"
          }
        ],
        "description": "Deprecated: renamed to `EmployeePensionOptOutModelContentResponse`, which has the same fields and more.",
        "deprecated": true
      },
      "PensionV2_EmployeePensionOptOutModelContentResponse": {
        "type": "object",
        "properties": {
          "data": {
            "$ref": "#/components/schemas/PensionV2_EmployeePensionOptOutModel"
          },
          "metadata": {
            "$ref": "#/components/schemas/PensionV2_ContentMetadataResponse"
          }
        },
        "additionalProperties": false
      },
      "PensionV2_EmployeePensionOptOutModelResponseBody": {
        "required": [
          "message"
        ],
        "type": "object",
        "properties": {
          "message": {
            "$ref": "#/components/schemas/PensionV2_MessageWithTokenResponse"
          },
          "content": {
            "$ref": "#/components/schemas/PensionV2_EmployeePensionOptOutModelContentResponse"
          },
          "validationIssues": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PensionV2_ValidationIssue"
            },
            "nullable": true
          },
          "errors": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PensionV2_Error"
            },
            "description": "Deprecated: the same issues as `validationIssues` (`reasonText` is `reason`, `reasonId` is `reasonToken`, `reasonParameters` is `reasonTokenArguments`). Read `validationIssues`; this will be removed.",
            "nullable": true,
            "readOnly": true,
            "deprecated": true
          },
          "metadata": {
            "allOf": [
              {
                "$ref": "#/components/schemas/PensionV2_ContentMetadataResponse"
              }
            ],
            "description": "Deprecated: the same values as `content.metadata`. Read that; this will be removed.",
            "deprecated": true
          }
        },
        "additionalProperties": false,
        "description": "The response envelope every FlowPayroll API answers with: a `message`, the\n`content`, and any `validationIssues`. `errors` and the top-level\n`metadata` are deprecated copies of `validationIssues` and\n`content.metadata`, and will be removed."
      },
      "PensionV2_EmployeePostponement": {
        "required": [
          "employeeId",
          "organisationId"
        ],
        "type": "object",
        "properties": {
          "organisationId": {
            "type": "string",
            "nullable": true
          },
          "employeeId": {
            "type": "string",
            "nullable": true
          },
          "startDateDefinition": {
            "$ref": "#/components/schemas/PensionV2_PostponementValueModel"
          },
          "eligibilityDateDefinition": {
            "$ref": "#/components/schemas/PensionV2_PostponementValueModel"
          }
        },
        "additionalProperties": false
      },
      "PensionV2_EmployeePostponementApiResponse": {
        "allOf": [
          {
            "$ref": "#/components/schemas/PensionV2_EmployeePostponementResponseBody"
          }
        ],
        "description": "Deprecated: renamed to `EmployeePostponementResponseBody`, which has the same fields and more.",
        "deprecated": true
      },
      "PensionV2_EmployeePostponementContent": {
        "allOf": [
          {
            "$ref": "#/components/schemas/PensionV2_EmployeePostponementContentResponse"
          }
        ],
        "description": "Deprecated: renamed to `EmployeePostponementContentResponse`, which has the same fields and more.",
        "deprecated": true
      },
      "PensionV2_EmployeePostponementContentResponse": {
        "type": "object",
        "properties": {
          "data": {
            "$ref": "#/components/schemas/PensionV2_EmployeePostponement"
          },
          "metadata": {
            "$ref": "#/components/schemas/PensionV2_ContentMetadataResponse"
          }
        },
        "additionalProperties": false
      },
      "PensionV2_EmployeePostponementResponseBody": {
        "required": [
          "message"
        ],
        "type": "object",
        "properties": {
          "message": {
            "$ref": "#/components/schemas/PensionV2_MessageWithTokenResponse"
          },
          "content": {
            "$ref": "#/components/schemas/PensionV2_EmployeePostponementContentResponse"
          },
          "validationIssues": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PensionV2_ValidationIssue"
            },
            "nullable": true
          },
          "errors": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PensionV2_Error"
            },
            "description": "Deprecated: the same issues as `validationIssues` (`reasonText` is `reason`, `reasonId` is `reasonToken`, `reasonParameters` is `reasonTokenArguments`). Read `validationIssues`; this will be removed.",
            "nullable": true,
            "readOnly": true,
            "deprecated": true
          },
          "metadata": {
            "allOf": [
              {
                "$ref": "#/components/schemas/PensionV2_ContentMetadataResponse"
              }
            ],
            "description": "Deprecated: the same values as `content.metadata`. Read that; this will be removed.",
            "deprecated": true
          }
        },
        "additionalProperties": false,
        "description": "The response envelope every FlowPayroll API answers with: a `message`, the\n`content`, and any `validationIssues`. `errors` and the top-level\n`metadata` are deprecated copies of `validationIssues` and\n`content.metadata`, and will be removed."
      },
      "PensionV2_EnrolmentInformationDutyListModel": {
        "required": [
          "items",
          "totalCount"
        ],
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PensionV2_EnrolmentInformationDutyModel"
            },
            "description": "The members on this page, worst first: the send failed, then the six\nweeks have run out, then still in time.",
            "nullable": true
          },
          "paginationToken": {
            "type": "string",
            "description": "Deprecated: the same value as `content.metadata.paginationToken`. Read that; this will be removed.",
            "nullable": true,
            "deprecated": true
          },
          "totalCount": {
            "type": "integer",
            "description": "How many members are outstanding in total, across every page. What a\nscreen shows as \"N still to send\", and what tells the reader whether\nthe first page is the whole job or the start of it.",
            "format": "int32"
          }
        },
        "additionalProperties": false,
        "description": "One page of the members still owed their enrolment information."
      },
      "PensionV2_EnrolmentInformationDutyListModelApiResponse": {
        "allOf": [
          {
            "$ref": "#/components/schemas/PensionV2_EnrolmentInformationDutyListModelResponseBody"
          }
        ],
        "description": "Deprecated: renamed to `EnrolmentInformationDutyListModelResponseBody`, which has the same fields and more.",
        "deprecated": true
      },
      "PensionV2_EnrolmentInformationDutyListModelContent": {
        "allOf": [
          {
            "$ref": "#/components/schemas/PensionV2_EnrolmentInformationDutyListModelContentResponse"
          }
        ],
        "description": "Deprecated: renamed to `EnrolmentInformationDutyListModelContentResponse`, which has the same fields and more.",
        "deprecated": true
      },
      "PensionV2_EnrolmentInformationDutyListModelContentResponse": {
        "type": "object",
        "properties": {
          "data": {
            "$ref": "#/components/schemas/PensionV2_EnrolmentInformationDutyListModel"
          },
          "metadata": {
            "$ref": "#/components/schemas/PensionV2_ContentMetadataResponse"
          }
        },
        "additionalProperties": false
      },
      "PensionV2_EnrolmentInformationDutyListModelResponseBody": {
        "required": [
          "message"
        ],
        "type": "object",
        "properties": {
          "message": {
            "$ref": "#/components/schemas/PensionV2_MessageWithTokenResponse"
          },
          "content": {
            "$ref": "#/components/schemas/PensionV2_EnrolmentInformationDutyListModelContentResponse"
          },
          "validationIssues": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PensionV2_ValidationIssue"
            },
            "nullable": true
          },
          "errors": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PensionV2_Error"
            },
            "description": "Deprecated: the same issues as `validationIssues` (`reasonText` is `reason`, `reasonId` is `reasonToken`, `reasonParameters` is `reasonTokenArguments`). Read `validationIssues`; this will be removed.",
            "nullable": true,
            "readOnly": true,
            "deprecated": true
          },
          "metadata": {
            "allOf": [
              {
                "$ref": "#/components/schemas/PensionV2_ContentMetadataResponse"
              }
            ],
            "description": "Deprecated: the same values as `content.metadata`. Read that; this will be removed.",
            "deprecated": true
          }
        },
        "additionalProperties": false,
        "description": "The response envelope every FlowPayroll API answers with: a `message`, the\n`content`, and any `validationIssues`. `errors` and the top-level\n`metadata` are deprecated copies of `validationIssues` and\n`content.metadata`, and will be removed."
      },
      "PensionV2_EnrolmentInformationDutyModel": {
        "required": [
          "dueBy",
          "employeeId",
          "enrolmentDate",
          "isAutoEnrolled",
          "isScheduled",
          "letterType",
          "status"
        ],
        "type": "object",
        "properties": {
          "employeeId": {
            "type": "string",
            "nullable": true
          },
          "letterType": {
            "enum": [
              "Enrolment",
              "ReEnrolment",
              "Postponement",
              "OptInInformation",
              "OptInConfirmation",
              "JoinConfirmation"
            ],
            "type": "string",
            "description": "The letter that discharges this duty: Enrolment, ReEnrolment, Postponement, OptInInformation,\nOptInConfirmation or JoinConfirmation. Send it with\n`POST /employee-pension/letters/{letterType}`.",
            "nullable": true
          },
          "firstName": {
            "type": "string",
            "description": "Who this is. Absent only when the snapshot has not arrived yet.",
            "nullable": true
          },
          "lastName": {
            "type": "string",
            "nullable": true
          },
          "enrolmentDate": {
            "type": "string",
            "description": "The date the six weeks are counted from: the enrolment or re-enrolment date; for a\npostponement notice, the starting day (whose six weeks begin the day after); for opt-in\ninformation, the day the worker was first assessed as able to opt in or join; for an opt-in\nor join confirmation, the day their membership starts.",
            "format": "date"
          },
          "dueBy": {
            "type": "string",
            "description": "The last day the information can be given without breaching the duty.",
            "format": "date"
          },
          "status": {
            "type": "string",
            "description": "\"Failed\" (the send failed, so it was never given), \"Overdue\" (the six weeks have run out) or\n\"Due\" (still inside them). A join confirmation is never \"Overdue\": the law sets it no deadline.",
            "nullable": true
          },
          "isAutoEnrolled": {
            "type": "boolean",
            "description": "Whether this membership came from automatic enrolment. That cohort holds\nthe statutory opt-out right, whose clock does not start until the\ninformation is given, so they are the ones to chase first."
          },
          "lastAttemptedAt": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "lastAttemptError": {
            "type": "string",
            "nullable": true
          },
          "lastRefusalReason": {
            "type": "string",
            "description": "Why the letter was last refused for something the employer has to put right, as one of the\njob's failure reasons (NoOptOutContact, NoEnrolmentDate, NoJoiningRoute). Absent when it has not been refused\nsince its last attempt; the next send attempt clears it.",
            "nullable": true
          },
          "lastRefusedAt": {
            "type": "string",
            "description": "When the letter was last refused. Absent with lastRefusalReason.",
            "format": "date-time",
            "nullable": true
          },
          "lastAttemptStatus": {
            "enum": [
              "Sending",
              "Sent",
              "Failed"
            ],
            "type": "string",
            "description": "What the last attempt is doing now: \"Sending\", \"Sent\" or \"Failed\".\nA member stays on this list until the letter is confirmed delivered, so\n\"Sending\" is how a send already on its way is told apart from one\nnobody has started. Absent when nothing has been tried.",
            "nullable": true
          },
          "isScheduled": {
            "type": "boolean",
            "description": "Flow will send this one itself when the pay run that enrolled the member\nis finalised, so nobody needs to act on it. Still listed, because the\ninformation has not been given yet and the six weeks are still running."
          },
          "sentDate": {
            "type": "string",
            "description": "The day the letter was given, on a duty that is met. Null on every outstanding one. For the\nenrolment and re-enrolment letters and the opt-in confirmation, the member's opt-out period\nruns from it (TPR detailed guidance 7, paragraphs 17-18).",
            "format": "date",
            "nullable": true
          },
          "sentBy": {
            "type": "string",
            "description": "Who gave it: the person who sent it, or the system when Flow sent it as\npart of enrolling the member.",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "description": "A letter a worker is owed, or was given, and how long the employer has left to give it: the\nenrolment or re-enrolment information, the postponement notice, the opt-in and joining\ninformation, or the confirmation for a worker who opted in or asked to join."
      },
      "PensionV2_EnrolmentLetterModel": {
        "required": [
          "lastEmailedAt",
          "lastEmailedBy",
          "lastEmailedStatus"
        ],
        "type": "object",
        "properties": {
          "lastEmailedAt": {
            "type": "string",
            "format": "date-time"
          },
          "lastEmailedTo": {
            "type": "string",
            "nullable": true
          },
          "lastEmailedBy": {
            "type": "string",
            "description": "The user who pressed send, or `System` when Flow sent it as part of\nenrolling the member.",
            "nullable": true
          },
          "lastEmailedStatus": {
            "enum": [
              "Sending",
              "Sent",
              "Failed"
            ],
            "type": "string",
            "description": "`Sending`, `Sent` or `Failed`. Spelled as on a payslip,\n            with one addition: `Sending` means a send was asked for and has\n            not come back yet, so a second request is refused with a 409 until it\n            resolves or goes stale. It never means the information was GIVEN —\n            only `enrolmentInformationSentDate` means that, and the member's\n            opt-out period counts from that alone.",
            "nullable": true
          },
          "lastEmailError": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "description": "Whether this member has been sent their enrolment letter, and what happened.\n            \n\nDeliberately the same field names the platform already uses for\npayslips, P45s and P60s (`lastEmailed*`): a consumer that can answer\n\"has this gone out\" for a payslip answers it here the same way, with no\nsecond vocabulary to learn.\nAbsent on the parent when no letter has ever been attempted, which is\nthe honest answer to \"has it been sent\" and is different from a failed\nattempt."
      },
      "PensionV2_Error": {
        "type": "object",
        "properties": {
          "field": {
            "type": "string",
            "nullable": true
          },
          "reasonText": {
            "type": "string",
            "nullable": true
          },
          "reasonId": {
            "type": "string",
            "nullable": true
          },
          "reasonParameters": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PensionV2_Pair"
            },
            "nullable": true
          }
        },
        "additionalProperties": false,
        "description": "Deprecated: an entry of the old `errors` list. Read `validationIssues` instead.",
        "deprecated": true
      },
      "PensionV2_ErrorContent": {
        "type": "object",
        "properties": {
          "reasonPhrase": {
            "type": "string",
            "nullable": true
          }
        },
        "description": "Deprecated: error responses carry no content. Read `validationIssues`.",
        "deprecated": true
      },
      "PensionV2_ErrorContentApiResponse": {
        "allOf": [
          {
            "$ref": "#/components/schemas/PensionV2_ObjectResponseBody"
          }
        ],
        "description": "Deprecated: renamed to `ObjectResponseBody`, which has the same fields and more.",
        "deprecated": true
      },
      "PensionV2_ErrorContentContent": {
        "allOf": [
          {
            "$ref": "#/components/schemas/PensionV2_ObjectContentResponse"
          }
        ],
        "description": "Deprecated: renamed to `ObjectContentResponse`, which has the same fields and more.",
        "deprecated": true
      },
      "PensionV2_FullPensionScheme": {
        "required": [
          "createdBy",
          "createdDate",
          "groups",
          "id",
          "name",
          "organisationId",
          "pensionProviderId",
          "updatedBy",
          "updatedDate"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "nullable": true
          },
          "organisationId": {
            "type": "string",
            "nullable": true
          },
          "pensionProviderId": {
            "type": "string",
            "nullable": true
          },
          "name": {
            "type": "string",
            "nullable": true
          },
          "paymentSource": {
            "type": "string",
            "nullable": true
          },
          "lastReEnrolmentDate": {
            "type": "string",
            "format": "date",
            "nullable": true
          },
          "dutyStartDate": {
            "type": "string",
            "format": "date",
            "nullable": true
          },
          "externalReferenceId": {
            "type": "string",
            "nullable": true
          },
          "contributionDueDateOffsetDays": {
            "type": "integer",
            "description": "How many days after an earnings period ends the contributions are due\nat this provider.\n            \n\nThe due date on a contribution schedule belongs to the provider,\nand it has to match what the provider holds or the submission is\nrefused. Once the provider is connected its own published schedule is\nused and this is ignored; set it when there is no connection, so the\nfile carries the agreed date rather than the date employees were\npaid.",
            "format": "int32",
            "nullable": true
          },
          "employeeIdentifierField": {
            "enum": [
              "NationalInsuranceNumber",
              "PayrollId",
              "EmployeeCode",
              "EmployeeId"
            ],
            "type": "string",
            "nullable": true
          },
          "optOutContactPoint": {
            "type": "string",
            "description": "Where this scheme's members get the form to leave the scheme (the opt-out notice), shown\nin every enrolment and re-enrolment letter (SI 2010/772 Schedule 2 para 10). A web address,\nphone number or both. Empty uses the provider's own route\n(`PensionProviderV2.optOutContactPoint`); when neither is set, letters that must state\nit are not sent. On an update, leaving it out keeps the stored value and an empty value\nclears it.",
            "nullable": true
          },
          "createdBy": {
            "type": "string",
            "nullable": true
          },
          "createdDate": {
            "type": "string",
            "nullable": true
          },
          "updatedBy": {
            "type": "string",
            "nullable": true
          },
          "updatedDate": {
            "type": "string",
            "nullable": true
          },
          "groups": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PensionV2_PensionGroupV2"
            },
            "nullable": true
          },
          "pensionProvider": {
            "$ref": "#/components/schemas/PensionV2_PensionProviderV2"
          }
        },
        "additionalProperties": false
      },
      "PensionV2_FullPensionSchemeApiResponse": {
        "allOf": [
          {
            "$ref": "#/components/schemas/PensionV2_FullPensionSchemeResponseBody"
          }
        ],
        "description": "Deprecated: renamed to `FullPensionSchemeResponseBody`, which has the same fields and more.",
        "deprecated": true
      },
      "PensionV2_FullPensionSchemeContent": {
        "allOf": [
          {
            "$ref": "#/components/schemas/PensionV2_FullPensionSchemeContentResponse"
          }
        ],
        "description": "Deprecated: renamed to `FullPensionSchemeContentResponse`, which has the same fields and more.",
        "deprecated": true
      },
      "PensionV2_FullPensionSchemeContentResponse": {
        "type": "object",
        "properties": {
          "data": {
            "$ref": "#/components/schemas/PensionV2_FullPensionScheme"
          },
          "metadata": {
            "$ref": "#/components/schemas/PensionV2_ContentMetadataResponse"
          }
        },
        "additionalProperties": false
      },
      "PensionV2_FullPensionSchemeListApiResponse": {
        "allOf": [
          {
            "$ref": "#/components/schemas/PensionV2_FullPensionSchemeListResponseBody"
          }
        ],
        "description": "Deprecated: renamed to `FullPensionSchemeListResponseBody`, which has the same fields and more.",
        "deprecated": true
      },
      "PensionV2_FullPensionSchemeListContent": {
        "allOf": [
          {
            "$ref": "#/components/schemas/PensionV2_FullPensionSchemeListContentResponse"
          }
        ],
        "description": "Deprecated: renamed to `FullPensionSchemeListContentResponse`, which has the same fields and more.",
        "deprecated": true
      },
      "PensionV2_FullPensionSchemeListContentResponse": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PensionV2_FullPensionScheme"
            },
            "nullable": true
          },
          "metadata": {
            "$ref": "#/components/schemas/PensionV2_ContentMetadataResponse"
          }
        },
        "additionalProperties": false
      },
      "PensionV2_FullPensionSchemeListResponseBody": {
        "required": [
          "message"
        ],
        "type": "object",
        "properties": {
          "message": {
            "$ref": "#/components/schemas/PensionV2_MessageWithTokenResponse"
          },
          "content": {
            "$ref": "#/components/schemas/PensionV2_FullPensionSchemeListContentResponse"
          },
          "validationIssues": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PensionV2_ValidationIssue"
            },
            "nullable": true
          },
          "errors": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PensionV2_Error"
            },
            "description": "Deprecated: the same issues as `validationIssues` (`reasonText` is `reason`, `reasonId` is `reasonToken`, `reasonParameters` is `reasonTokenArguments`). Read `validationIssues`; this will be removed.",
            "nullable": true,
            "readOnly": true,
            "deprecated": true
          },
          "metadata": {
            "allOf": [
              {
                "$ref": "#/components/schemas/PensionV2_ContentMetadataResponse"
              }
            ],
            "description": "Deprecated: the same values as `content.metadata`. Read that; this will be removed.",
            "deprecated": true
          }
        },
        "additionalProperties": false,
        "description": "The response envelope every FlowPayroll API answers with: a `message`, the\n`content`, and any `validationIssues`. `errors` and the top-level\n`metadata` are deprecated copies of `validationIssues` and\n`content.metadata`, and will be removed."
      },
      "PensionV2_FullPensionSchemeResponseBody": {
        "required": [
          "message"
        ],
        "type": "object",
        "properties": {
          "message": {
            "$ref": "#/components/schemas/PensionV2_MessageWithTokenResponse"
          },
          "content": {
            "$ref": "#/components/schemas/PensionV2_FullPensionSchemeContentResponse"
          },
          "validationIssues": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PensionV2_ValidationIssue"
            },
            "nullable": true
          },
          "errors": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PensionV2_Error"
            },
            "description": "Deprecated: the same issues as `validationIssues` (`reasonText` is `reason`, `reasonId` is `reasonToken`, `reasonParameters` is `reasonTokenArguments`). Read `validationIssues`; this will be removed.",
            "nullable": true,
            "readOnly": true,
            "deprecated": true
          },
          "metadata": {
            "allOf": [
              {
                "$ref": "#/components/schemas/PensionV2_ContentMetadataResponse"
              }
            ],
            "description": "Deprecated: the same values as `content.metadata`. Read that; this will be removed.",
            "deprecated": true
          }
        },
        "additionalProperties": false,
        "description": "The response envelope every FlowPayroll API answers with: a `message`, the\n`content`, and any `validationIssues`. `errors` and the top-level\n`metadata` are deprecated copies of `validationIssues` and\n`content.metadata`, and will be removed."
      },
      "PensionV2_GetPensionCalculationExportFileRequest": {
        "required": [
          "frequency",
          "payrollConfigId",
          "period",
          "year"
        ],
        "type": "object",
        "properties": {
          "frequency": {
            "type": "string",
            "nullable": true
          },
          "year": {
            "type": "integer",
            "format": "int32"
          },
          "period": {
            "type": "integer",
            "format": "int32"
          },
          "payrollConfigId": {
            "type": "string",
            "nullable": true
          },
          "lockCycle": {
            "type": "integer",
            "description": "When listing, only the files of this lock cycle (the current cycle's\nand every earlier cycle's are listed when absent). Ignored when\ngenerating: a build is always the current cycle's.",
            "format": "int32",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "PensionV2_LetterSendingModel": {
        "required": [
          "employeeIds",
          "letterType",
          "sendAutomatically",
          "skipped"
        ],
        "type": "object",
        "properties": {
          "letterType": {
            "enum": [
              "Enrolment",
              "ReEnrolment",
              "Postponement",
              "OptInInformation",
              "OptInConfirmation",
              "JoinConfirmation"
            ],
            "type": "string",
            "nullable": true
          },
          "sendAutomatically": {
            "type": "boolean"
          },
          "employeeIds": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "The workers whose letter now goes the way asked.",
            "nullable": true
          },
          "skipped": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PensionV2_PensionLetterFailureModel"
            },
            "description": "Workers left as they were, each with a reason:\n`AlreadyGiven`, `NotEnrolled`, `NoPostponementNotice` or `NoOptInInformation`.",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "description": "What changed, and who was left alone and why."
      },
      "PensionV2_LetterSendingModelApiResponse": {
        "allOf": [
          {
            "$ref": "#/components/schemas/PensionV2_LetterSendingModelResponseBody"
          }
        ],
        "description": "Deprecated: renamed to `LetterSendingModelResponseBody`, which has the same fields and more.",
        "deprecated": true
      },
      "PensionV2_LetterSendingModelContent": {
        "allOf": [
          {
            "$ref": "#/components/schemas/PensionV2_LetterSendingModelContentResponse"
          }
        ],
        "description": "Deprecated: renamed to `LetterSendingModelContentResponse`, which has the same fields and more.",
        "deprecated": true
      },
      "PensionV2_LetterSendingModelContentResponse": {
        "type": "object",
        "properties": {
          "data": {
            "$ref": "#/components/schemas/PensionV2_LetterSendingModel"
          },
          "metadata": {
            "$ref": "#/components/schemas/PensionV2_ContentMetadataResponse"
          }
        },
        "additionalProperties": false
      },
      "PensionV2_LetterSendingModelResponseBody": {
        "required": [
          "message"
        ],
        "type": "object",
        "properties": {
          "message": {
            "$ref": "#/components/schemas/PensionV2_MessageWithTokenResponse"
          },
          "content": {
            "$ref": "#/components/schemas/PensionV2_LetterSendingModelContentResponse"
          },
          "validationIssues": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PensionV2_ValidationIssue"
            },
            "nullable": true
          },
          "errors": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PensionV2_Error"
            },
            "description": "Deprecated: the same issues as `validationIssues` (`reasonText` is `reason`, `reasonId` is `reasonToken`, `reasonParameters` is `reasonTokenArguments`). Read `validationIssues`; this will be removed.",
            "nullable": true,
            "readOnly": true,
            "deprecated": true
          },
          "metadata": {
            "allOf": [
              {
                "$ref": "#/components/schemas/PensionV2_ContentMetadataResponse"
              }
            ],
            "description": "Deprecated: the same values as `content.metadata`. Read that; this will be removed.",
            "deprecated": true
          }
        },
        "additionalProperties": false,
        "description": "The response envelope every FlowPayroll API answers with: a `message`, the\n`content`, and any `validationIssues`. `errors` and the top-level\n`metadata` are deprecated copies of `validationIssues` and\n`content.metadata`, and will be removed."
      },
      "PensionV2_Message": {
        "allOf": [
          {
            "$ref": "#/components/schemas/PensionV2_MessageWithTokenResponse"
          }
        ],
        "description": "Deprecated: renamed to `MessageWithTokenResponse`, which has the same fields and more.",
        "deprecated": true
      },
      "PensionV2_MessageWithTokenResponse": {
        "required": [
          "token"
        ],
        "type": "object",
        "properties": {
          "text": {
            "type": "string",
            "nullable": true
          },
          "token": {
            "type": "string",
            "description": "Stable snake_case key for the message, for clients that translate it.",
            "nullable": true
          },
          "tokenArguments": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PensionV2_ValidationIssueArgument"
            },
            "nullable": true
          },
          "textId": {
            "type": "string",
            "description": "Deprecated: the same value as `token`. Read that; this will be removed.",
            "nullable": true,
            "readOnly": true,
            "deprecated": true
          },
          "textParameters": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PensionV2_Pair"
            },
            "description": "Deprecated: the same values as `tokenArguments`. Read that; this will be removed.",
            "nullable": true,
            "readOnly": true,
            "deprecated": true
          }
        },
        "additionalProperties": false,
        "description": "What happened, as English `text` and a stable `token` to translate from.\n`textId` and `textParameters` are deprecated copies of `token` and `tokenArguments`."
      },
      "PensionV2_Metadata": {
        "allOf": [
          {
            "$ref": "#/components/schemas/PensionV2_ContentMetadataResponse"
          }
        ],
        "description": "Deprecated: renamed to `ContentMetadataResponse`, which has the same fields and more.",
        "deprecated": true
      },
      "PensionV2_ObjectApiResponse": {
        "allOf": [
          {
            "$ref": "#/components/schemas/PensionV2_ObjectResponseBody"
          }
        ],
        "description": "Deprecated: renamed to `ObjectResponseBody`, which has the same fields and more.",
        "deprecated": true
      },
      "PensionV2_ObjectContent": {
        "allOf": [
          {
            "$ref": "#/components/schemas/PensionV2_ObjectContentResponse"
          }
        ],
        "description": "Deprecated: renamed to `ObjectContentResponse`, which has the same fields and more.",
        "deprecated": true
      },
      "PensionV2_ObjectContentResponse": {
        "type": "object",
        "properties": {
          "data": {
            "nullable": true
          },
          "metadata": {
            "$ref": "#/components/schemas/PensionV2_ContentMetadataResponse"
          }
        },
        "additionalProperties": false
      },
      "PensionV2_ObjectResponseBody": {
        "required": [
          "message"
        ],
        "type": "object",
        "properties": {
          "message": {
            "$ref": "#/components/schemas/PensionV2_MessageWithTokenResponse"
          },
          "content": {
            "$ref": "#/components/schemas/PensionV2_ObjectContentResponse"
          },
          "validationIssues": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PensionV2_ValidationIssue"
            },
            "nullable": true
          },
          "errors": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PensionV2_Error"
            },
            "description": "Deprecated: the same issues as `validationIssues` (`reasonText` is `reason`, `reasonId` is `reasonToken`, `reasonParameters` is `reasonTokenArguments`). Read `validationIssues`; this will be removed.",
            "nullable": true,
            "readOnly": true,
            "deprecated": true
          },
          "metadata": {
            "allOf": [
              {
                "$ref": "#/components/schemas/PensionV2_ContentMetadataResponse"
              }
            ],
            "description": "Deprecated: the same values as `content.metadata`. Read that; this will be removed.",
            "deprecated": true
          }
        },
        "additionalProperties": false,
        "description": "The response envelope every FlowPayroll API answers with: a `message`, the\n`content`, and any `validationIssues`. `errors` and the top-level\n`metadata` are deprecated copies of `validationIssues` and\n`content.metadata`, and will be removed."
      },
      "PensionV2_OptOutNoticeModel": {
        "required": [
          "fileName",
          "membershipEndDate",
          "noticeId",
          "retainUntil",
          "sizeInBytes",
          "uploadedAt",
          "url"
        ],
        "type": "object",
        "properties": {
          "noticeId": {
            "type": "string",
            "nullable": true
          },
          "fileName": {
            "type": "string",
            "nullable": true
          },
          "membershipEndDate": {
            "type": "string",
            "format": "date"
          },
          "retainUntil": {
            "type": "string",
            "format": "date"
          },
          "uploadedAt": {
            "type": "string",
            "format": "date-time"
          },
          "sizeInBytes": {
            "type": "integer",
            "format": "int64"
          },
          "url": {
            "type": "string",
            "description": "A signed link to the notice, valid for one hour.",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "description": "A kept opt-out notice, with a short-lived link to read it."
      },
      "PensionV2_OptOutNoticeModelListApiResponse": {
        "allOf": [
          {
            "$ref": "#/components/schemas/PensionV2_OptOutNoticeModelListResponseBody"
          }
        ],
        "description": "Deprecated: renamed to `OptOutNoticeModelListResponseBody`, which has the same fields and more.",
        "deprecated": true
      },
      "PensionV2_OptOutNoticeModelListContent": {
        "allOf": [
          {
            "$ref": "#/components/schemas/PensionV2_OptOutNoticeModelListContentResponse"
          }
        ],
        "description": "Deprecated: renamed to `OptOutNoticeModelListContentResponse`, which has the same fields and more.",
        "deprecated": true
      },
      "PensionV2_OptOutNoticeModelListContentResponse": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PensionV2_OptOutNoticeModel"
            },
            "nullable": true
          },
          "metadata": {
            "$ref": "#/components/schemas/PensionV2_ContentMetadataResponse"
          }
        },
        "additionalProperties": false
      },
      "PensionV2_OptOutNoticeModelListResponseBody": {
        "required": [
          "message"
        ],
        "type": "object",
        "properties": {
          "message": {
            "$ref": "#/components/schemas/PensionV2_MessageWithTokenResponse"
          },
          "content": {
            "$ref": "#/components/schemas/PensionV2_OptOutNoticeModelListContentResponse"
          },
          "validationIssues": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PensionV2_ValidationIssue"
            },
            "nullable": true
          },
          "errors": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PensionV2_Error"
            },
            "description": "Deprecated: the same issues as `validationIssues` (`reasonText` is `reason`, `reasonId` is `reasonToken`, `reasonParameters` is `reasonTokenArguments`). Read `validationIssues`; this will be removed.",
            "nullable": true,
            "readOnly": true,
            "deprecated": true
          },
          "metadata": {
            "allOf": [
              {
                "$ref": "#/components/schemas/PensionV2_ContentMetadataResponse"
              }
            ],
            "description": "Deprecated: the same values as `content.metadata`. Read that; this will be removed.",
            "deprecated": true
          }
        },
        "additionalProperties": false,
        "description": "The response envelope every FlowPayroll API answers with: a `message`, the\n`content`, and any `validationIssues`. `errors` and the top-level\n`metadata` are deprecated copies of `validationIssues` and\n`content.metadata`, and will be removed."
      },
      "PensionV2_OptOutNoticeUploadModel": {
        "required": [
          "contentType",
          "headers",
          "method",
          "noticeId",
          "retainUntil",
          "uploadUrl"
        ],
        "type": "object",
        "properties": {
          "noticeId": {
            "type": "string",
            "nullable": true
          },
          "uploadUrl": {
            "type": "string",
            "description": "A signed link that accepts one upload of this file.",
            "nullable": true
          },
          "method": {
            "type": "string",
            "description": "Always `PUT`.",
            "nullable": true
          },
          "headers": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            },
            "description": "Send every one of these with the upload, exactly as given.",
            "nullable": true
          },
          "contentType": {
            "type": "string",
            "description": "Must be sent as the Content-Type of the PUT, or the URL will not accept it. Also in `headers`.",
            "nullable": true
          },
          "retainUntil": {
            "type": "string",
            "description": "The last day this notice must be kept (TPR DG7 para 72: four years).",
            "format": "date"
          }
        },
        "additionalProperties": false,
        "description": "Where to send the notice: `PUT` the file itself (never a form) to\n`uploadUrl` with every one of `headers`, within 15 minutes. The\ndocument goes straight to storage rather than through the service."
      },
      "PensionV2_OptOutNoticeUploadModelApiResponse": {
        "allOf": [
          {
            "$ref": "#/components/schemas/PensionV2_OptOutNoticeUploadModelResponseBody"
          }
        ],
        "description": "Deprecated: renamed to `OptOutNoticeUploadModelResponseBody`, which has the same fields and more.",
        "deprecated": true
      },
      "PensionV2_OptOutNoticeUploadModelContent": {
        "allOf": [
          {
            "$ref": "#/components/schemas/PensionV2_OptOutNoticeUploadModelContentResponse"
          }
        ],
        "description": "Deprecated: renamed to `OptOutNoticeUploadModelContentResponse`, which has the same fields and more.",
        "deprecated": true
      },
      "PensionV2_OptOutNoticeUploadModelContentResponse": {
        "type": "object",
        "properties": {
          "data": {
            "$ref": "#/components/schemas/PensionV2_OptOutNoticeUploadModel"
          },
          "metadata": {
            "$ref": "#/components/schemas/PensionV2_ContentMetadataResponse"
          }
        },
        "additionalProperties": false
      },
      "PensionV2_OptOutNoticeUploadModelResponseBody": {
        "required": [
          "message"
        ],
        "type": "object",
        "properties": {
          "message": {
            "$ref": "#/components/schemas/PensionV2_MessageWithTokenResponse"
          },
          "content": {
            "$ref": "#/components/schemas/PensionV2_OptOutNoticeUploadModelContentResponse"
          },
          "validationIssues": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PensionV2_ValidationIssue"
            },
            "nullable": true
          },
          "errors": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PensionV2_Error"
            },
            "description": "Deprecated: the same issues as `validationIssues` (`reasonText` is `reason`, `reasonId` is `reasonToken`, `reasonParameters` is `reasonTokenArguments`). Read `validationIssues`; this will be removed.",
            "nullable": true,
            "readOnly": true,
            "deprecated": true
          },
          "metadata": {
            "allOf": [
              {
                "$ref": "#/components/schemas/PensionV2_ContentMetadataResponse"
              }
            ],
            "description": "Deprecated: the same values as `content.metadata`. Read that; this will be removed.",
            "deprecated": true
          }
        },
        "additionalProperties": false,
        "description": "The response envelope every FlowPayroll API answers with: a `message`, the\n`content`, and any `validationIssues`. `errors` and the top-level\n`metadata` are deprecated copies of `validationIssues` and\n`content.metadata`, and will be removed."
      },
      "PensionV2_OptOutRefundDecisionRequest": {
        "type": "object",
        "properties": {
          "processRefund": {
            "type": "boolean",
            "description": "True puts the refund of the employee's contributions on their next payslip."
          },
          "noPayrollRefundReason": {
            "type": "string",
            "description": "Why the employee is not being refunded through payroll, for example\n\"Already refunded with a pay element\". Required when processRefund is\nfalse; refused when it is true.",
            "nullable": true
          },
          "refundOutsideOptOutPeriodReason": {
            "type": "string",
            "description": "Why a refund is being made even though the opt-out was recorded as outside\nits opt-out period. Required only in that case.",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "description": "The employer's refund decision for an opt-out. Exactly one of: refund\nthrough payroll, or a reason for not doing so. Whether the employee is owed\nmoney back through payroll is the employer's decision; the platform shows\nthe amounts and records what was decided, it never decides from a\nprovider's own refund rules."
      },
      "PensionV2_OptOutRefundEmployeeModel": {
        "type": "object",
        "properties": {
          "firstName": {
            "type": "string",
            "nullable": true
          },
          "lastName": {
            "type": "string",
            "nullable": true
          },
          "payrollId": {
            "type": "string",
            "nullable": true
          },
          "nationalInsuranceNumber": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "PensionV2_OptOutRefundListModel": {
        "required": [
          "items"
        ],
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PensionV2_OptOutRefundModel"
            },
            "nullable": true
          },
          "paginationToken": {
            "type": "string",
            "description": "Deprecated: the same value as `content.metadata.paginationToken`. Read that; this will be removed.",
            "nullable": true,
            "deprecated": true
          }
        },
        "additionalProperties": false
      },
      "PensionV2_OptOutRefundListModelApiResponse": {
        "allOf": [
          {
            "$ref": "#/components/schemas/PensionV2_OptOutRefundListModelResponseBody"
          }
        ],
        "description": "Deprecated: renamed to `OptOutRefundListModelResponseBody`, which has the same fields and more.",
        "deprecated": true
      },
      "PensionV2_OptOutRefundListModelContent": {
        "allOf": [
          {
            "$ref": "#/components/schemas/PensionV2_OptOutRefundListModelContentResponse"
          }
        ],
        "description": "Deprecated: renamed to `OptOutRefundListModelContentResponse`, which has the same fields and more.",
        "deprecated": true
      },
      "PensionV2_OptOutRefundListModelContentResponse": {
        "type": "object",
        "properties": {
          "data": {
            "$ref": "#/components/schemas/PensionV2_OptOutRefundListModel"
          },
          "metadata": {
            "$ref": "#/components/schemas/PensionV2_ContentMetadataResponse"
          }
        },
        "additionalProperties": false
      },
      "PensionV2_OptOutRefundListModelResponseBody": {
        "required": [
          "message"
        ],
        "type": "object",
        "properties": {
          "message": {
            "$ref": "#/components/schemas/PensionV2_MessageWithTokenResponse"
          },
          "content": {
            "$ref": "#/components/schemas/PensionV2_OptOutRefundListModelContentResponse"
          },
          "validationIssues": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PensionV2_ValidationIssue"
            },
            "nullable": true
          },
          "errors": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PensionV2_Error"
            },
            "description": "Deprecated: the same issues as `validationIssues` (`reasonText` is `reason`, `reasonId` is `reasonToken`, `reasonParameters` is `reasonTokenArguments`). Read `validationIssues`; this will be removed.",
            "nullable": true,
            "readOnly": true,
            "deprecated": true
          },
          "metadata": {
            "allOf": [
              {
                "$ref": "#/components/schemas/PensionV2_ContentMetadataResponse"
              }
            ],
            "description": "Deprecated: the same values as `content.metadata`. Read that; this will be removed.",
            "deprecated": true
          }
        },
        "additionalProperties": false,
        "description": "The response envelope every FlowPayroll API answers with: a `message`, the\n`content`, and any `validationIssues`. `errors` and the top-level\n`metadata` are deprecated copies of `validationIssues` and\n`content.metadata`, and will be removed."
      },
      "PensionV2_OptOutRefundModel": {
        "required": [
          "employerRefundTotal",
          "membershipEnd",
          "refundTotal",
          "refundablePeriods"
        ],
        "type": "object",
        "properties": {
          "membershipEnd": {
            "$ref": "#/components/schemas/PensionV2_PensionMembershipEndModel"
          },
          "employee": {
            "$ref": "#/components/schemas/PensionV2_OptOutRefundEmployeeModel"
          },
          "refundTotal": {
            "type": "number",
            "description": "The employee's contributions a refund through payroll would pay back.",
            "format": "double"
          },
          "employerRefundTotal": {
            "type": "number",
            "description": "Employer contributions for the same pay periods. Never paid through the\npayslip: the scheme repays the employer, in its own way.",
            "format": "double"
          },
          "refundablePeriods": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PensionV2_RefundedPensionPeriodModel"
            },
            "nullable": true
          }
        },
        "additionalProperties": false,
        "description": "An opt-out and what refunding it through payroll would pay back now: the\nemployee's settled contributions per pay period, already-refunded periods\nleft out."
      },
      "PensionV2_OptOutRefundModelApiResponse": {
        "allOf": [
          {
            "$ref": "#/components/schemas/PensionV2_OptOutRefundModelResponseBody"
          }
        ],
        "description": "Deprecated: renamed to `OptOutRefundModelResponseBody`, which has the same fields and more.",
        "deprecated": true
      },
      "PensionV2_OptOutRefundModelContent": {
        "allOf": [
          {
            "$ref": "#/components/schemas/PensionV2_OptOutRefundModelContentResponse"
          }
        ],
        "description": "Deprecated: renamed to `OptOutRefundModelContentResponse`, which has the same fields and more.",
        "deprecated": true
      },
      "PensionV2_OptOutRefundModelContentResponse": {
        "type": "object",
        "properties": {
          "data": {
            "$ref": "#/components/schemas/PensionV2_OptOutRefundModel"
          },
          "metadata": {
            "$ref": "#/components/schemas/PensionV2_ContentMetadataResponse"
          }
        },
        "additionalProperties": false
      },
      "PensionV2_OptOutRefundModelResponseBody": {
        "required": [
          "message"
        ],
        "type": "object",
        "properties": {
          "message": {
            "$ref": "#/components/schemas/PensionV2_MessageWithTokenResponse"
          },
          "content": {
            "$ref": "#/components/schemas/PensionV2_OptOutRefundModelContentResponse"
          },
          "validationIssues": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PensionV2_ValidationIssue"
            },
            "nullable": true
          },
          "errors": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PensionV2_Error"
            },
            "description": "Deprecated: the same issues as `validationIssues` (`reasonText` is `reason`, `reasonId` is `reasonToken`, `reasonParameters` is `reasonTokenArguments`). Read `validationIssues`; this will be removed.",
            "nullable": true,
            "readOnly": true,
            "deprecated": true
          },
          "metadata": {
            "allOf": [
              {
                "$ref": "#/components/schemas/PensionV2_ContentMetadataResponse"
              }
            ],
            "description": "Deprecated: the same values as `content.metadata`. Read that; this will be removed.",
            "deprecated": true
          }
        },
        "additionalProperties": false,
        "description": "The response envelope every FlowPayroll API answers with: a `message`, the\n`content`, and any `validationIssues`. `errors` and the top-level\n`metadata` are deprecated copies of `validationIssues` and\n`content.metadata`, and will be removed."
      },
      "PensionV2_OrganisationPensionDefaultModel": {
        "required": [
          "organisationId"
        ],
        "type": "object",
        "properties": {
          "organisationId": {
            "type": "string",
            "nullable": true
          },
          "defaultPensionGroupId": {
            "type": "string",
            "nullable": true
          },
          "defaultPensionGroup": {
            "$ref": "#/components/schemas/PensionV2_PensionGroupV2"
          },
          "defaultPostponementStartDateDefinition": {
            "$ref": "#/components/schemas/PensionV2_PostponementValueModel"
          },
          "defaultPostponementEligibilityDateDefinition": {
            "$ref": "#/components/schemas/PensionV2_PostponementValueModel"
          },
          "autoEnrolmentMode": {
            "enum": [
              "None",
              "Manual",
              "Automatic"
            ],
            "type": "string",
            "nullable": true
          },
          "sendEnrolmentLetterOnAutoEnrolment": {
            "type": "boolean",
            "description": "Whether Flow emails the enrolment letter by itself: true when `automaticLetterTypes`\nholds `Enrolment`. False is the meaningful answer here, not an absent field, so it is\nalways written."
          },
          "automaticLetterTypes": {
            "type": "array",
            "items": {
              "enum": [
                "Enrolment",
                "ReEnrolment",
                "Postponement",
                "OptInInformation",
                "OptInConfirmation",
                "JoinConfirmation"
              ],
              "type": "string"
            },
            "description": "The letters Flow sends by itself when the pay run that made them owed is finalised, each a letter\ntype (Enrolment, ReEnrolment, Postponement, OptInInformation, OptInConfirmation or JoinConfirmation). Every other letter waits for a person. The\ndefault for letters that become owed from now on; each letter waiting on the list carries\nits own `isScheduled`.",
            "nullable": true
          },
          "employerGivenLetterTypes": {
            "type": "array",
            "items": {
              "enum": [
                "Enrolment",
                "ReEnrolment",
                "Postponement",
                "OptInInformation",
                "OptInConfirmation",
                "JoinConfirmation"
              ],
              "type": "string"
            },
            "description": "The letters the employer has declared they give workers themselves, by post, their provider\nor their own systems, each a letter type. Flow neither sends these by itself nor lists them\nas waiting, so a letter type is never both here and in `automaticLetterTypes`. Holding\n`Enrolment` is also what a provider is told when it asks whether workers were given\ntheir enrolment information.",
            "nullable": true
          },
          "reEnrolRecentOptOuts": {
            "type": "boolean",
            "description": "Whether this employer re-enrols workers who left the scheme at their own\nrequest in the 12 months before the automatic re-enrolment date. TPR\nDG11 para 30 leaves that choice to the employer; false is the answer\nfor everyone who has not made it, so it is always written."
          },
          "enrolmentInformationDeclaredBy": {
            "type": "string",
            "description": "Who made that declaration, and when. Absent until one is made.",
            "nullable": true
          },
          "enrolmentInformationDeclaredDate": {
            "type": "string",
            "format": "date",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "PensionV2_OrganisationPensionDefaultModelApiResponse": {
        "allOf": [
          {
            "$ref": "#/components/schemas/PensionV2_OrganisationPensionDefaultModelResponseBody"
          }
        ],
        "description": "Deprecated: renamed to `OrganisationPensionDefaultModelResponseBody`, which has the same fields and more.",
        "deprecated": true
      },
      "PensionV2_OrganisationPensionDefaultModelContent": {
        "allOf": [
          {
            "$ref": "#/components/schemas/PensionV2_OrganisationPensionDefaultModelContentResponse"
          }
        ],
        "description": "Deprecated: renamed to `OrganisationPensionDefaultModelContentResponse`, which has the same fields and more.",
        "deprecated": true
      },
      "PensionV2_OrganisationPensionDefaultModelContentResponse": {
        "type": "object",
        "properties": {
          "data": {
            "$ref": "#/components/schemas/PensionV2_OrganisationPensionDefaultModel"
          },
          "metadata": {
            "$ref": "#/components/schemas/PensionV2_ContentMetadataResponse"
          }
        },
        "additionalProperties": false
      },
      "PensionV2_OrganisationPensionDefaultModelResponseBody": {
        "required": [
          "message"
        ],
        "type": "object",
        "properties": {
          "message": {
            "$ref": "#/components/schemas/PensionV2_MessageWithTokenResponse"
          },
          "content": {
            "$ref": "#/components/schemas/PensionV2_OrganisationPensionDefaultModelContentResponse"
          },
          "validationIssues": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PensionV2_ValidationIssue"
            },
            "nullable": true
          },
          "errors": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PensionV2_Error"
            },
            "description": "Deprecated: the same issues as `validationIssues` (`reasonText` is `reason`, `reasonId` is `reasonToken`, `reasonParameters` is `reasonTokenArguments`). Read `validationIssues`; this will be removed.",
            "nullable": true,
            "readOnly": true,
            "deprecated": true
          },
          "metadata": {
            "allOf": [
              {
                "$ref": "#/components/schemas/PensionV2_ContentMetadataResponse"
              }
            ],
            "description": "Deprecated: the same values as `content.metadata`. Read that; this will be removed.",
            "deprecated": true
          }
        },
        "additionalProperties": false,
        "description": "The response envelope every FlowPayroll API answers with: a `message`, the\n`content`, and any `validationIssues`. `errors` and the top-level\n`metadata` are deprecated copies of `validationIssues` and\n`content.metadata`, and will be removed."
      },
      "PensionV2_Pair": {
        "type": "object",
        "properties": {
          "key": {
            "type": "string",
            "nullable": true
          },
          "value": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "description": "Deprecated: a key and value of the old `textParameters` and `reasonParameters`.",
        "deprecated": true
      },
      "PensionV2_PayRunId": {
        "required": [
          "frequency",
          "organisationId",
          "payrollConfigId",
          "period",
          "year"
        ],
        "type": "object",
        "properties": {
          "organisationId": {
            "type": "string",
            "nullable": true
          },
          "year": {
            "type": "integer",
            "format": "int32"
          },
          "period": {
            "type": "integer",
            "format": "int32"
          },
          "frequency": {
            "type": "string",
            "nullable": true
          },
          "payrollConfigId": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "PensionV2_PensionCalculationCsvV2": {
        "required": [
          "file_url",
          "frequency",
          "organisationId",
          "payrollConfigId",
          "period",
          "year"
        ],
        "type": "object",
        "properties": {
          "frequency": {
            "type": "string",
            "nullable": true
          },
          "year": {
            "type": "integer",
            "format": "int32"
          },
          "period": {
            "type": "integer",
            "format": "int32"
          },
          "payrollConfigId": {
            "type": "string",
            "nullable": true
          },
          "organisationId": {
            "type": "string",
            "nullable": true
          },
          "file_url": {
            "type": "string",
            "description": "A signed link to download the CSV, valid for one hour; empty when the run has no contributions.",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "PensionV2_PensionCalculationCsvV2ApiResponse": {
        "allOf": [
          {
            "$ref": "#/components/schemas/PensionV2_PensionCalculationCsvV2ResponseBody"
          }
        ],
        "description": "Deprecated: renamed to `PensionCalculationCsvV2ResponseBody`, which has the same fields and more.",
        "deprecated": true
      },
      "PensionV2_PensionCalculationCsvV2Content": {
        "allOf": [
          {
            "$ref": "#/components/schemas/PensionV2_PensionCalculationCsvV2ContentResponse"
          }
        ],
        "description": "Deprecated: renamed to `PensionCalculationCsvV2ContentResponse`, which has the same fields and more.",
        "deprecated": true
      },
      "PensionV2_PensionCalculationCsvV2ContentResponse": {
        "type": "object",
        "properties": {
          "data": {
            "$ref": "#/components/schemas/PensionV2_PensionCalculationCsvV2"
          },
          "metadata": {
            "$ref": "#/components/schemas/PensionV2_ContentMetadataResponse"
          }
        },
        "additionalProperties": false
      },
      "PensionV2_PensionCalculationCsvV2ResponseBody": {
        "required": [
          "message"
        ],
        "type": "object",
        "properties": {
          "message": {
            "$ref": "#/components/schemas/PensionV2_MessageWithTokenResponse"
          },
          "content": {
            "$ref": "#/components/schemas/PensionV2_PensionCalculationCsvV2ContentResponse"
          },
          "validationIssues": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PensionV2_ValidationIssue"
            },
            "nullable": true
          },
          "errors": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PensionV2_Error"
            },
            "description": "Deprecated: the same issues as `validationIssues` (`reasonText` is `reason`, `reasonId` is `reasonToken`, `reasonParameters` is `reasonTokenArguments`). Read `validationIssues`; this will be removed.",
            "nullable": true,
            "readOnly": true,
            "deprecated": true
          },
          "metadata": {
            "allOf": [
              {
                "$ref": "#/components/schemas/PensionV2_ContentMetadataResponse"
              }
            ],
            "description": "Deprecated: the same values as `content.metadata`. Read that; this will be removed.",
            "deprecated": true
          }
        },
        "additionalProperties": false,
        "description": "The response envelope every FlowPayroll API answers with: a `message`, the\n`content`, and any `validationIssues`. `errors` and the top-level\n`metadata` are deprecated copies of `validationIssues` and\n`content.metadata`, and will be removed."
      },
      "PensionV2_PensionCalculationExportFileV2": {
        "required": [
          "filePath",
          "fileType",
          "frequency",
          "payrollConfigId",
          "payrollRunId",
          "pensionProviderSlug",
          "period",
          "year"
        ],
        "type": "object",
        "properties": {
          "payrollRunId": {
            "type": "string",
            "nullable": true
          },
          "frequency": {
            "type": "string",
            "nullable": true
          },
          "year": {
            "type": "integer",
            "format": "int32"
          },
          "period": {
            "type": "integer",
            "format": "int32"
          },
          "payrollConfigId": {
            "type": "string",
            "nullable": true
          },
          "pensionProviderSlug": {
            "type": "string",
            "nullable": true
          },
          "pensionSchemeId": {
            "type": "string",
            "description": "The pension scheme this file was built for. A provider can hold more\nthan one scheme for an employer, each with its own employer reference\nand payment source, so this is what says which account the file\nbelongs to. Null on files exported before they were split by scheme.",
            "nullable": true
          },
          "pensionSchemeName": {
            "type": "string",
            "description": "The scheme's name, so a file can be labelled without a second lookup.",
            "nullable": true
          },
          "pensionProviderName": {
            "type": "string",
            "description": "The provider's display name, for grouping files by provider.",
            "nullable": true
          },
          "employerReference": {
            "type": "string",
            "description": "The provider's own reference for the employer account this file is\nsubmitted under, so it is visible which account receives it.",
            "nullable": true
          },
          "recordCount": {
            "type": "integer",
            "description": "How many people the file covers.",
            "format": "int32",
            "nullable": true
          },
          "totalAmount": {
            "type": "number",
            "description": "What this file is worth: employee plus employer contributions across\nevery member on it, so a screen can state the figure without totalling\nthe file. Absent for a file that moves no money, such as an enrolment.",
            "format": "double",
            "nullable": true
          },
          "exportGroup": {
            "type": "string",
            "nullable": true
          },
          "filePath": {
            "type": "string",
            "description": "A signed link to download the file, valid for one hour.",
            "nullable": true
          },
          "fileType": {
            "type": "string",
            "nullable": true
          },
          "lockCycle": {
            "type": "integer",
            "description": "The lock cycle of the pay run this file was built for: 1 for a run\nlocked once, n + 1 for the files built after the n-th unlock. The list\ncarries the current cycle's files first and then every earlier\ncycle's, so what was sent on cycle 1 stays beside what cycle 2\nproduced.",
            "format": "int32"
          },
          "superseded": {
            "type": "boolean",
            "description": "Whether the pay run was unlocked after this file was built. A\nsuperseded file is kept as the record of what its cycle produced and\nstays downloadable; the current cycle's files read false."
          },
          "supersededOnLockCycle": {
            "type": "integer",
            "description": "The cycle the run reopened onto when this file was superseded; absent while it is current.",
            "format": "int32",
            "nullable": true
          },
          "supersededDate": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "PensionV2_PensionCalculationExportFileV2ListApiResponse": {
        "allOf": [
          {
            "$ref": "#/components/schemas/PensionV2_PensionCalculationExportFileV2ListResponseBody"
          }
        ],
        "description": "Deprecated: renamed to `PensionCalculationExportFileV2ListResponseBody`, which has the same fields and more.",
        "deprecated": true
      },
      "PensionV2_PensionCalculationExportFileV2ListContent": {
        "allOf": [
          {
            "$ref": "#/components/schemas/PensionV2_PensionCalculationExportFileV2ListContentResponse"
          }
        ],
        "description": "Deprecated: renamed to `PensionCalculationExportFileV2ListContentResponse`, which has the same fields and more.",
        "deprecated": true
      },
      "PensionV2_PensionCalculationExportFileV2ListContentResponse": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PensionV2_PensionCalculationExportFileV2"
            },
            "nullable": true
          },
          "metadata": {
            "$ref": "#/components/schemas/PensionV2_ContentMetadataResponse"
          }
        },
        "additionalProperties": false
      },
      "PensionV2_PensionCalculationExportFileV2ListResponseBody": {
        "required": [
          "message"
        ],
        "type": "object",
        "properties": {
          "message": {
            "$ref": "#/components/schemas/PensionV2_MessageWithTokenResponse"
          },
          "content": {
            "$ref": "#/components/schemas/PensionV2_PensionCalculationExportFileV2ListContentResponse"
          },
          "validationIssues": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PensionV2_ValidationIssue"
            },
            "nullable": true
          },
          "errors": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PensionV2_Error"
            },
            "description": "Deprecated: the same issues as `validationIssues` (`reasonText` is `reason`, `reasonId` is `reasonToken`, `reasonParameters` is `reasonTokenArguments`). Read `validationIssues`; this will be removed.",
            "nullable": true,
            "readOnly": true,
            "deprecated": true
          },
          "metadata": {
            "allOf": [
              {
                "$ref": "#/components/schemas/PensionV2_ContentMetadataResponse"
              }
            ],
            "description": "Deprecated: the same values as `content.metadata`. Read that; this will be removed.",
            "deprecated": true
          }
        },
        "additionalProperties": false,
        "description": "The response envelope every FlowPayroll API answers with: a `message`, the\n`content`, and any `validationIssues`. `errors` and the top-level\n`metadata` are deprecated copies of `validationIssues` and\n`content.metadata`, and will be removed."
      },
      "PensionV2_PensionGroupV2": {
        "required": [
          "basis",
          "createdBy",
          "createdDate",
          "employeeFactor",
          "employerFactor",
          "id",
          "isDefault",
          "name",
          "nationalInsuranceSavingsFactor",
          "organisationId",
          "pensionSchemaId",
          "pensionType",
          "updatedBy",
          "updatedDate"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "nullable": true
          },
          "organisationId": {
            "type": "string",
            "description": "Deprecated: a pension group always belongs to the organisation in the access token. Rely on the `organisationId` of the enclosing resource where one is present, or on the organisation the request was authenticated as.",
            "nullable": true,
            "deprecated": true
          },
          "pensionSchemaId": {
            "type": "string",
            "nullable": true
          },
          "name": {
            "type": "string",
            "nullable": true
          },
          "isDefault": {
            "type": "boolean"
          },
          "pensionType": {
            "enum": [
              "ReliefAtSource",
              "SalarySacrifice",
              "NetPayArrangement"
            ],
            "type": "string",
            "nullable": true
          },
          "isSalarySacrifice": {
            "type": "boolean",
            "description": "Deprecated: derived field, true only when `pensionType` is `SalarySacrifice`. Rely on `pensionType`, which also distinguishes `ReliefAtSource` from `NetPayArrangement`.",
            "readOnly": true,
            "deprecated": true
          },
          "basis": {
            "enum": [
              "Pensionable",
              "QualifyingEarnings"
            ],
            "type": "string",
            "nullable": true
          },
          "employeeFactor": {
            "type": "number",
            "format": "float"
          },
          "employerFactor": {
            "type": "number",
            "format": "float"
          },
          "nationalInsuranceSavingsFactor": {
            "type": "number",
            "format": "float"
          },
          "contributionType": {
            "enum": [
              "Percentage",
              "FixedAmount"
            ],
            "type": "string",
            "nullable": true
          },
          "employeeFixedAmount": {
            "type": "number",
            "format": "double",
            "nullable": true
          },
          "employerFixedAmount": {
            "type": "number",
            "format": "double",
            "nullable": true
          },
          "externalReferenceId": {
            "type": "string",
            "nullable": true
          },
          "createdBy": {
            "type": "string",
            "nullable": true
          },
          "createdDate": {
            "type": "string",
            "format": "date-time"
          },
          "updatedBy": {
            "type": "string",
            "nullable": true
          },
          "updatedDate": {
            "type": "string",
            "format": "date-time"
          }
        },
        "additionalProperties": false
      },
      "PensionV2_PensionGroupV2ApiResponse": {
        "allOf": [
          {
            "$ref": "#/components/schemas/PensionV2_PensionGroupV2ResponseBody"
          }
        ],
        "description": "Deprecated: renamed to `PensionGroupV2ResponseBody`, which has the same fields and more.",
        "deprecated": true
      },
      "PensionV2_PensionGroupV2Content": {
        "allOf": [
          {
            "$ref": "#/components/schemas/PensionV2_PensionGroupV2ContentResponse"
          }
        ],
        "description": "Deprecated: renamed to `PensionGroupV2ContentResponse`, which has the same fields and more.",
        "deprecated": true
      },
      "PensionV2_PensionGroupV2ContentResponse": {
        "type": "object",
        "properties": {
          "data": {
            "$ref": "#/components/schemas/PensionV2_PensionGroupV2"
          },
          "metadata": {
            "$ref": "#/components/schemas/PensionV2_ContentMetadataResponse"
          }
        },
        "additionalProperties": false
      },
      "PensionV2_PensionGroupV2ResponseBody": {
        "required": [
          "message"
        ],
        "type": "object",
        "properties": {
          "message": {
            "$ref": "#/components/schemas/PensionV2_MessageWithTokenResponse"
          },
          "content": {
            "$ref": "#/components/schemas/PensionV2_PensionGroupV2ContentResponse"
          },
          "validationIssues": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PensionV2_ValidationIssue"
            },
            "nullable": true
          },
          "errors": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PensionV2_Error"
            },
            "description": "Deprecated: the same issues as `validationIssues` (`reasonText` is `reason`, `reasonId` is `reasonToken`, `reasonParameters` is `reasonTokenArguments`). Read `validationIssues`; this will be removed.",
            "nullable": true,
            "readOnly": true,
            "deprecated": true
          },
          "metadata": {
            "allOf": [
              {
                "$ref": "#/components/schemas/PensionV2_ContentMetadataResponse"
              }
            ],
            "description": "Deprecated: the same values as `content.metadata`. Read that; this will be removed.",
            "deprecated": true
          }
        },
        "additionalProperties": false,
        "description": "The response envelope every FlowPayroll API answers with: a `message`, the\n`content`, and any `validationIssues`. `errors` and the top-level\n`metadata` are deprecated copies of `validationIssues` and\n`content.metadata`, and will be removed."
      },
      "PensionV2_PensionInformationModel": {
        "type": "object",
        "properties": {
          "pension": {
            "$ref": "#/components/schemas/PensionV2_EmployeePensionCompositionV2"
          },
          "autoEnrolmentDetermination": {
            "$ref": "#/components/schemas/PensionV2_EmployeeAutoEnrolmentDeterminationModel"
          },
          "postponement": {
            "$ref": "#/components/schemas/PensionV2_EmployeePostponement"
          },
          "exemption": {
            "$ref": "#/components/schemas/PensionV2_EmployeeAutoEnrolmentExemption"
          },
          "latestMembershipEnd": {
            "$ref": "#/components/schemas/PensionV2_PensionMembershipEndModel"
          }
        },
        "additionalProperties": false
      },
      "PensionV2_PensionInformationModelApiResponse": {
        "allOf": [
          {
            "$ref": "#/components/schemas/PensionV2_PensionInformationModelResponseBody"
          }
        ],
        "description": "Deprecated: renamed to `PensionInformationModelResponseBody`, which has the same fields and more.",
        "deprecated": true
      },
      "PensionV2_PensionInformationModelContent": {
        "allOf": [
          {
            "$ref": "#/components/schemas/PensionV2_PensionInformationModelContentResponse"
          }
        ],
        "description": "Deprecated: renamed to `PensionInformationModelContentResponse`, which has the same fields and more.",
        "deprecated": true
      },
      "PensionV2_PensionInformationModelContentResponse": {
        "type": "object",
        "properties": {
          "data": {
            "$ref": "#/components/schemas/PensionV2_PensionInformationModel"
          },
          "metadata": {
            "$ref": "#/components/schemas/PensionV2_ContentMetadataResponse"
          }
        },
        "additionalProperties": false
      },
      "PensionV2_PensionInformationModelResponseBody": {
        "required": [
          "message"
        ],
        "type": "object",
        "properties": {
          "message": {
            "$ref": "#/components/schemas/PensionV2_MessageWithTokenResponse"
          },
          "content": {
            "$ref": "#/components/schemas/PensionV2_PensionInformationModelContentResponse"
          },
          "validationIssues": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PensionV2_ValidationIssue"
            },
            "nullable": true
          },
          "errors": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PensionV2_Error"
            },
            "description": "Deprecated: the same issues as `validationIssues` (`reasonText` is `reason`, `reasonId` is `reasonToken`, `reasonParameters` is `reasonTokenArguments`). Read `validationIssues`; this will be removed.",
            "nullable": true,
            "readOnly": true,
            "deprecated": true
          },
          "metadata": {
            "allOf": [
              {
                "$ref": "#/components/schemas/PensionV2_ContentMetadataResponse"
              }
            ],
            "description": "Deprecated: the same values as `content.metadata`. Read that; this will be removed.",
            "deprecated": true
          }
        },
        "additionalProperties": false,
        "description": "The response envelope every FlowPayroll API answers with: a `message`, the\n`content`, and any `validationIssues`. `errors` and the top-level\n`metadata` are deprecated copies of `validationIssues` and\n`content.metadata`, and will be removed."
      },
      "PensionV2_PensionLetterFailureModel": {
        "required": [
          "employeeId",
          "reason"
        ],
        "type": "object",
        "properties": {
          "employeeId": {
            "type": "string",
            "nullable": true
          },
          "reason": {
            "enum": [
              "AlreadySending",
              "NotEnrolled",
              "SendFailed",
              "UnsupportedLetterType",
              "NoOptOutContact",
              "NoEnrolmentDate",
              "NoJoiningRoute",
              "NoPostponementNotice",
              "NoOptInInformation",
              "AlreadyGiven"
            ],
            "type": "string",
            "description": "Why this employee's letter was left alone. A stable token, so a caller can branch on it\nand say it in its own words.",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "PensionV2_PensionLetterJobAcceptedModel": {
        "required": [
          "jobId",
          "letterType",
          "totalCount"
        ],
        "type": "object",
        "properties": {
          "jobId": {
            "type": "string",
            "nullable": true
          },
          "letterType": {
            "enum": [
              "Enrolment",
              "ReEnrolment",
              "Postponement",
              "OptInInformation",
              "OptInConfirmation",
              "JoinConfirmation"
            ],
            "type": "string",
            "nullable": true
          },
          "totalCount": {
            "type": "integer",
            "description": "How many members the batch covers, after repeats are collapsed.",
            "format": "int32"
          }
        },
        "additionalProperties": false,
        "description": "What a POST returns: the job to watch, not the outcome."
      },
      "PensionV2_PensionLetterJobAcceptedModelApiResponse": {
        "allOf": [
          {
            "$ref": "#/components/schemas/PensionV2_PensionLetterJobAcceptedModelResponseBody"
          }
        ],
        "description": "Deprecated: renamed to `PensionLetterJobAcceptedModelResponseBody`, which has the same fields and more.",
        "deprecated": true
      },
      "PensionV2_PensionLetterJobAcceptedModelContent": {
        "allOf": [
          {
            "$ref": "#/components/schemas/PensionV2_PensionLetterJobAcceptedModelContentResponse"
          }
        ],
        "description": "Deprecated: renamed to `PensionLetterJobAcceptedModelContentResponse`, which has the same fields and more.",
        "deprecated": true
      },
      "PensionV2_PensionLetterJobAcceptedModelContentResponse": {
        "type": "object",
        "properties": {
          "data": {
            "$ref": "#/components/schemas/PensionV2_PensionLetterJobAcceptedModel"
          },
          "metadata": {
            "$ref": "#/components/schemas/PensionV2_ContentMetadataResponse"
          }
        },
        "additionalProperties": false
      },
      "PensionV2_PensionLetterJobAcceptedModelResponseBody": {
        "required": [
          "message"
        ],
        "type": "object",
        "properties": {
          "message": {
            "$ref": "#/components/schemas/PensionV2_MessageWithTokenResponse"
          },
          "content": {
            "$ref": "#/components/schemas/PensionV2_PensionLetterJobAcceptedModelContentResponse"
          },
          "validationIssues": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PensionV2_ValidationIssue"
            },
            "nullable": true
          },
          "errors": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PensionV2_Error"
            },
            "description": "Deprecated: the same issues as `validationIssues` (`reasonText` is `reason`, `reasonId` is `reasonToken`, `reasonParameters` is `reasonTokenArguments`). Read `validationIssues`; this will be removed.",
            "nullable": true,
            "readOnly": true,
            "deprecated": true
          },
          "metadata": {
            "allOf": [
              {
                "$ref": "#/components/schemas/PensionV2_ContentMetadataResponse"
              }
            ],
            "description": "Deprecated: the same values as `content.metadata`. Read that; this will be removed.",
            "deprecated": true
          }
        },
        "additionalProperties": false,
        "description": "The response envelope every FlowPayroll API answers with: a `message`, the\n`content`, and any `validationIssues`. `errors` and the top-level\n`metadata` are deprecated copies of `validationIssues` and\n`content.metadata`, and will be removed."
      },
      "PensionV2_PensionLetterJobModel": {
        "required": [
          "createdDate",
          "failedCount",
          "failures",
          "jobId",
          "letterType",
          "sentCount",
          "status",
          "totalCount"
        ],
        "type": "object",
        "properties": {
          "jobId": {
            "type": "string",
            "nullable": true
          },
          "letterType": {
            "enum": [
              "Enrolment",
              "ReEnrolment",
              "Postponement",
              "OptInInformation",
              "OptInConfirmation",
              "JoinConfirmation"
            ],
            "type": "string",
            "description": "The letter being sent. Currently always `Enrolment`.",
            "nullable": true
          },
          "status": {
            "enum": [
              "Queued",
              "InProgress",
              "Completed",
              "Failed"
            ],
            "type": "string",
            "description": "Where the job has got to: `Queued`, `InProgress`, `Completed` or `Failed`.",
            "nullable": true
          },
          "totalCount": {
            "type": "integer",
            "format": "int32"
          },
          "sentCount": {
            "type": "integer",
            "description": "How many are on their way. Never \"delivered\": each letter still has a\nqueue, the notification service and an email provider to cross, and the\nmember stays on the outstanding list until delivery is confirmed.",
            "format": "int32"
          },
          "failedCount": {
            "type": "integer",
            "format": "int32"
          },
          "failures": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PensionV2_PensionLetterFailureModel"
            },
            "description": "Who did not get one, and why, so the failure is findable.",
            "nullable": true
          },
          "createdDate": {
            "type": "string",
            "nullable": true
          },
          "completedDate": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "description": "A batch of letters and how far it has got.\n            \n\nPoll this, or listen for the `pension.letter-job` push and read\nit when one arrives. It is the source of truth either way: a push that never\nlands costs a client nothing but latency."
      },
      "PensionV2_PensionLetterJobModelApiResponse": {
        "allOf": [
          {
            "$ref": "#/components/schemas/PensionV2_PensionLetterJobModelResponseBody"
          }
        ],
        "description": "Deprecated: renamed to `PensionLetterJobModelResponseBody`, which has the same fields and more.",
        "deprecated": true
      },
      "PensionV2_PensionLetterJobModelContent": {
        "allOf": [
          {
            "$ref": "#/components/schemas/PensionV2_PensionLetterJobModelContentResponse"
          }
        ],
        "description": "Deprecated: renamed to `PensionLetterJobModelContentResponse`, which has the same fields and more.",
        "deprecated": true
      },
      "PensionV2_PensionLetterJobModelContentResponse": {
        "type": "object",
        "properties": {
          "data": {
            "$ref": "#/components/schemas/PensionV2_PensionLetterJobModel"
          },
          "metadata": {
            "$ref": "#/components/schemas/PensionV2_ContentMetadataResponse"
          }
        },
        "additionalProperties": false
      },
      "PensionV2_PensionLetterJobModelResponseBody": {
        "required": [
          "message"
        ],
        "type": "object",
        "properties": {
          "message": {
            "$ref": "#/components/schemas/PensionV2_MessageWithTokenResponse"
          },
          "content": {
            "$ref": "#/components/schemas/PensionV2_PensionLetterJobModelContentResponse"
          },
          "validationIssues": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PensionV2_ValidationIssue"
            },
            "nullable": true
          },
          "errors": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PensionV2_Error"
            },
            "description": "Deprecated: the same issues as `validationIssues` (`reasonText` is `reason`, `reasonId` is `reasonToken`, `reasonParameters` is `reasonTokenArguments`). Read `validationIssues`; this will be removed.",
            "nullable": true,
            "readOnly": true,
            "deprecated": true
          },
          "metadata": {
            "allOf": [
              {
                "$ref": "#/components/schemas/PensionV2_ContentMetadataResponse"
              }
            ],
            "description": "Deprecated: the same values as `content.metadata`. Read that; this will be removed.",
            "deprecated": true
          }
        },
        "additionalProperties": false,
        "description": "The response envelope every FlowPayroll API answers with: a `message`, the\n`content`, and any `validationIssues`. `errors` and the top-level\n`metadata` are deprecated copies of `validationIssues` and\n`content.metadata`, and will be removed."
      },
      "PensionV2_PensionMembershipEndListModel": {
        "required": [
          "items"
        ],
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PensionV2_PensionMembershipEndModel"
            },
            "nullable": true
          },
          "paginationToken": {
            "type": "string",
            "description": "Deprecated: the same value as `content.metadata.paginationToken`. Read that; this will be removed.",
            "nullable": true,
            "deprecated": true
          }
        },
        "additionalProperties": false,
        "description": "A page of membership endings."
      },
      "PensionV2_PensionMembershipEndListModelApiResponse": {
        "allOf": [
          {
            "$ref": "#/components/schemas/PensionV2_PensionMembershipEndListModelResponseBody"
          }
        ],
        "description": "Deprecated: renamed to `PensionMembershipEndListModelResponseBody`, which has the same fields and more.",
        "deprecated": true
      },
      "PensionV2_PensionMembershipEndListModelContent": {
        "allOf": [
          {
            "$ref": "#/components/schemas/PensionV2_PensionMembershipEndListModelContentResponse"
          }
        ],
        "description": "Deprecated: renamed to `PensionMembershipEndListModelContentResponse`, which has the same fields and more.",
        "deprecated": true
      },
      "PensionV2_PensionMembershipEndListModelContentResponse": {
        "type": "object",
        "properties": {
          "data": {
            "$ref": "#/components/schemas/PensionV2_PensionMembershipEndListModel"
          },
          "metadata": {
            "$ref": "#/components/schemas/PensionV2_ContentMetadataResponse"
          }
        },
        "additionalProperties": false
      },
      "PensionV2_PensionMembershipEndListModelResponseBody": {
        "required": [
          "message"
        ],
        "type": "object",
        "properties": {
          "message": {
            "$ref": "#/components/schemas/PensionV2_MessageWithTokenResponse"
          },
          "content": {
            "$ref": "#/components/schemas/PensionV2_PensionMembershipEndListModelContentResponse"
          },
          "validationIssues": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PensionV2_ValidationIssue"
            },
            "nullable": true
          },
          "errors": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PensionV2_Error"
            },
            "description": "Deprecated: the same issues as `validationIssues` (`reasonText` is `reason`, `reasonId` is `reasonToken`, `reasonParameters` is `reasonTokenArguments`). Read `validationIssues`; this will be removed.",
            "nullable": true,
            "readOnly": true,
            "deprecated": true
          },
          "metadata": {
            "allOf": [
              {
                "$ref": "#/components/schemas/PensionV2_ContentMetadataResponse"
              }
            ],
            "description": "Deprecated: the same values as `content.metadata`. Read that; this will be removed.",
            "deprecated": true
          }
        },
        "additionalProperties": false,
        "description": "The response envelope every FlowPayroll API answers with: a `message`, the\n`content`, and any `validationIssues`. `errors` and the top-level\n`metadata` are deprecated copies of `validationIssues` and\n`content.metadata`, and will be removed."
      },
      "PensionV2_PensionMembershipEndModel": {
        "required": [
          "awaitsRefundDecision",
          "employeeId",
          "employeeRefundTotal",
          "employerRefundTotal",
          "membershipEndDate",
          "membershipEndReason",
          "organisationId",
          "recordedBy",
          "recordedDate",
          "refundProcessedThroughPayroll",
          "refundedPeriods"
        ],
        "type": "object",
        "properties": {
          "organisationId": {
            "type": "string",
            "nullable": true
          },
          "employeeId": {
            "type": "string",
            "nullable": true
          },
          "membershipEndDate": {
            "type": "string",
            "description": "The date the membership ended (the opt-out date, for an opt-out).",
            "nullable": true
          },
          "membershipEndReason": {
            "enum": [
              "OptOut",
              "MembershipCeased",
              "AdministrativeRemoval"
            ],
            "type": "string",
            "description": "Why the membership ended, as the employer asserted it: \"OptOut\" (a valid\nopt-out notice), \"MembershipCeased\" (a later notice, so scheme rules\ngovern any refund) or \"AdministrativeRemoval\" (a data correction, no\nstatutory event).",
            "nullable": true
          },
          "enrolmentDate": {
            "type": "string",
            "description": "When the membership began, so the span the refund covers is visible.",
            "nullable": true
          },
          "pensionGroupId": {
            "type": "string",
            "nullable": true
          },
          "pensionProviderId": {
            "type": "string",
            "description": "The provider that holds the money. It is the provider, not the employer,\nwho repays employer contributions, and providers differ in how: some pay\ncash to a nominated bank account, others credit the employer's balance\nagainst the next contribution schedule.",
            "nullable": true
          },
          "refundProcessedThroughPayroll": {
            "type": "boolean",
            "description": "Whether the member refund was put through payroll. False when the\noperator chose to handle it outside payroll, or when there was nothing\nto refund."
          },
          "employeeRefundTotal": {
            "type": "number",
            "description": "Member contributions refunded through payroll. Always 0 for a salary\nsacrifice arrangement: the employee gave up salary rather than paying a\ncontribution, so the whole amount is the employer's and appears in\nemployerRefundTotal instead.",
            "format": "double"
          },
          "employerRefundTotal": {
            "type": "number",
            "description": "Employer contributions the scheme owes back to the employer. Never paid\nthrough the payslip and never part of the employee's pay: the scheme\nrepays the employer directly (The Pensions Regulator's detailed guidance\n7, paragraphs 46 to 47). A scheme may retain it to offset its\nadministrative expenses (paragraph 48), so treat this as the amount to\nreconcile against the provider rather than a guaranteed receipt.",
            "format": "double"
          },
          "refundedPeriods": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PensionV2_RefundedPensionPeriodModel"
            },
            "description": "The settled pay periods the refund covers, one entry per pay run.",
            "nullable": true
          },
          "enrolmentInformationSentDate": {
            "type": "string",
            "description": "When the member was given their enrolment information, as at the moment\nthe membership ended. The opt-out period runs from the later of this and\nthe enrolment date. Absent when the platform could not evidence it, or\non endings recorded before it was kept.",
            "nullable": true
          },
          "optOutPeriodEndDate": {
            "type": "string",
            "description": "The last day an opt-out still carried a payroll refund, as assessed when\nthe membership ended. Absent when no refund was requested, or on endings\nrecorded before the window was assessed.",
            "nullable": true
          },
          "withinOptOutPeriod": {
            "type": "boolean",
            "description": "Whether the end date fell inside that window. Absent means it was not\nassessed, which is not the same as false.",
            "nullable": true
          },
          "refundOutsideOptOutPeriodReason": {
            "type": "string",
            "description": "Why a refund was made even though the membership ended outside the\nopt-out period. Present only on that case, and the audit trail for it.",
            "nullable": true
          },
          "noPayrollRefundReason": {
            "type": "string",
            "description": "Why the employer chose not to refund through payroll, in their words.\nAbsent while nobody has decided, and after a refund through payroll.",
            "nullable": true
          },
          "optOutNoticeReference": {
            "type": "string",
            "description": "The reference on the paper opt-out form the member handed the employer within the opt-out\nperiod, as recorded. Absent for every other ending, including an opt-out made with the\nprovider directly.",
            "nullable": true
          },
          "awaitsRefundDecision": {
            "type": "boolean",
            "description": "True for an opt-out whose refund nobody has decided yet: not refunded\nthrough payroll and no reason recorded for not doing so. Decide it with\nPUT /employee-pension/{employeeId}/membership-ends/{membershipEndDate}/refund-decision."
          },
          "recordedBy": {
            "type": "string",
            "nullable": true
          },
          "recordedDate": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "description": "The record of a pension membership ending: why it ended, when, and what\neach side is owed. Kept after the enrolment itself is deleted, so an\noperator or an auditor can answer \"what was refunded, and what is the\nprovider sending back?\" months later."
      },
      "PensionV2_PensionMembershipEndModelApiResponse": {
        "allOf": [
          {
            "$ref": "#/components/schemas/PensionV2_PensionMembershipEndModelResponseBody"
          }
        ],
        "description": "Deprecated: renamed to `PensionMembershipEndModelResponseBody`, which has the same fields and more.",
        "deprecated": true
      },
      "PensionV2_PensionMembershipEndModelContent": {
        "allOf": [
          {
            "$ref": "#/components/schemas/PensionV2_PensionMembershipEndModelContentResponse"
          }
        ],
        "description": "Deprecated: renamed to `PensionMembershipEndModelContentResponse`, which has the same fields and more.",
        "deprecated": true
      },
      "PensionV2_PensionMembershipEndModelContentResponse": {
        "type": "object",
        "properties": {
          "data": {
            "$ref": "#/components/schemas/PensionV2_PensionMembershipEndModel"
          },
          "metadata": {
            "$ref": "#/components/schemas/PensionV2_ContentMetadataResponse"
          }
        },
        "additionalProperties": false
      },
      "PensionV2_PensionMembershipEndModelResponseBody": {
        "required": [
          "message"
        ],
        "type": "object",
        "properties": {
          "message": {
            "$ref": "#/components/schemas/PensionV2_MessageWithTokenResponse"
          },
          "content": {
            "$ref": "#/components/schemas/PensionV2_PensionMembershipEndModelContentResponse"
          },
          "validationIssues": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PensionV2_ValidationIssue"
            },
            "nullable": true
          },
          "errors": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PensionV2_Error"
            },
            "description": "Deprecated: the same issues as `validationIssues` (`reasonText` is `reason`, `reasonId` is `reasonToken`, `reasonParameters` is `reasonTokenArguments`). Read `validationIssues`; this will be removed.",
            "nullable": true,
            "readOnly": true,
            "deprecated": true
          },
          "metadata": {
            "allOf": [
              {
                "$ref": "#/components/schemas/PensionV2_ContentMetadataResponse"
              }
            ],
            "description": "Deprecated: the same values as `content.metadata`. Read that; this will be removed.",
            "deprecated": true
          }
        },
        "additionalProperties": false,
        "description": "The response envelope every FlowPayroll API answers with: a `message`, the\n`content`, and any `validationIssues`. `errors` and the top-level\n`metadata` are deprecated copies of `validationIssues` and\n`content.metadata`, and will be removed."
      },
      "PensionV2_PensionProviderV2": {
        "required": [
          "id",
          "name",
          "record_end",
          "record_start",
          "slug"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "nullable": true
          },
          "name": {
            "type": "string",
            "nullable": true
          },
          "slug": {
            "type": "string",
            "nullable": true
          },
          "paymentSourceRequired": {
            "type": "boolean",
            "nullable": true
          },
          "optOutContactPoint": {
            "type": "string",
            "description": "The provider's own published route for members to get the opt-out notice, used when a\nscheme states none (SI 2010/772 Schedule 2 para 10). Absent when the provider publishes\nnone, in which case each scheme must set `optOutContactPoint`.",
            "nullable": true
          },
          "exportSupported": {
            "type": "boolean",
            "description": "Whether a completed pay run produces an export file for schemes on\nthis provider. False for a provider the employer deals with\nthemselves: the run still assesses, enrols and calculates, but\nnothing is written for them to download or send. Defaults to true,\nwhich is what every provider did before the flag existed, so a client\non this model reading an older service's answer is not refused."
          },
          "record_start": {
            "type": "string",
            "format": "date-time"
          },
          "record_end": {
            "type": "string",
            "format": "date-time"
          }
        },
        "additionalProperties": false
      },
      "PensionV2_PensionProviderV2ApiResponse": {
        "allOf": [
          {
            "$ref": "#/components/schemas/PensionV2_PensionProviderV2ResponseBody"
          }
        ],
        "description": "Deprecated: renamed to `PensionProviderV2ResponseBody`, which has the same fields and more.",
        "deprecated": true
      },
      "PensionV2_PensionProviderV2Content": {
        "allOf": [
          {
            "$ref": "#/components/schemas/PensionV2_PensionProviderV2ContentResponse"
          }
        ],
        "description": "Deprecated: renamed to `PensionProviderV2ContentResponse`, which has the same fields and more.",
        "deprecated": true
      },
      "PensionV2_PensionProviderV2ContentResponse": {
        "type": "object",
        "properties": {
          "data": {
            "$ref": "#/components/schemas/PensionV2_PensionProviderV2"
          },
          "metadata": {
            "$ref": "#/components/schemas/PensionV2_ContentMetadataResponse"
          }
        },
        "additionalProperties": false
      },
      "PensionV2_PensionProviderV2ListApiResponse": {
        "allOf": [
          {
            "$ref": "#/components/schemas/PensionV2_PensionProviderV2ListResponseBody"
          }
        ],
        "description": "Deprecated: renamed to `PensionProviderV2ListResponseBody`, which has the same fields and more.",
        "deprecated": true
      },
      "PensionV2_PensionProviderV2ListContent": {
        "allOf": [
          {
            "$ref": "#/components/schemas/PensionV2_PensionProviderV2ListContentResponse"
          }
        ],
        "description": "Deprecated: renamed to `PensionProviderV2ListContentResponse`, which has the same fields and more.",
        "deprecated": true
      },
      "PensionV2_PensionProviderV2ListContentResponse": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PensionV2_PensionProviderV2"
            },
            "nullable": true
          },
          "metadata": {
            "$ref": "#/components/schemas/PensionV2_ContentMetadataResponse"
          }
        },
        "additionalProperties": false
      },
      "PensionV2_PensionProviderV2ListResponseBody": {
        "required": [
          "message"
        ],
        "type": "object",
        "properties": {
          "message": {
            "$ref": "#/components/schemas/PensionV2_MessageWithTokenResponse"
          },
          "content": {
            "$ref": "#/components/schemas/PensionV2_PensionProviderV2ListContentResponse"
          },
          "validationIssues": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PensionV2_ValidationIssue"
            },
            "nullable": true
          },
          "errors": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PensionV2_Error"
            },
            "description": "Deprecated: the same issues as `validationIssues` (`reasonText` is `reason`, `reasonId` is `reasonToken`, `reasonParameters` is `reasonTokenArguments`). Read `validationIssues`; this will be removed.",
            "nullable": true,
            "readOnly": true,
            "deprecated": true
          },
          "metadata": {
            "allOf": [
              {
                "$ref": "#/components/schemas/PensionV2_ContentMetadataResponse"
              }
            ],
            "description": "Deprecated: the same values as `content.metadata`. Read that; this will be removed.",
            "deprecated": true
          }
        },
        "additionalProperties": false,
        "description": "The response envelope every FlowPayroll API answers with: a `message`, the\n`content`, and any `validationIssues`. `errors` and the top-level\n`metadata` are deprecated copies of `validationIssues` and\n`content.metadata`, and will be removed."
      },
      "PensionV2_PensionProviderV2ResponseBody": {
        "required": [
          "message"
        ],
        "type": "object",
        "properties": {
          "message": {
            "$ref": "#/components/schemas/PensionV2_MessageWithTokenResponse"
          },
          "content": {
            "$ref": "#/components/schemas/PensionV2_PensionProviderV2ContentResponse"
          },
          "validationIssues": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PensionV2_ValidationIssue"
            },
            "nullable": true
          },
          "errors": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PensionV2_Error"
            },
            "description": "Deprecated: the same issues as `validationIssues` (`reasonText` is `reason`, `reasonId` is `reasonToken`, `reasonParameters` is `reasonTokenArguments`). Read `validationIssues`; this will be removed.",
            "nullable": true,
            "readOnly": true,
            "deprecated": true
          },
          "metadata": {
            "allOf": [
              {
                "$ref": "#/components/schemas/PensionV2_ContentMetadataResponse"
              }
            ],
            "description": "Deprecated: the same values as `content.metadata`. Read that; this will be removed.",
            "deprecated": true
          }
        },
        "additionalProperties": false,
        "description": "The response envelope every FlowPayroll API answers with: a `message`, the\n`content`, and any `validationIssues`. `errors` and the top-level\n`metadata` are deprecated copies of `validationIssues` and\n`content.metadata`, and will be removed."
      },
      "PensionV2_PensionSchemeV2": {
        "required": [
          "createdBy",
          "createdDate",
          "id",
          "name",
          "organisationId",
          "pensionProviderId",
          "updatedBy",
          "updatedDate"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "nullable": true
          },
          "organisationId": {
            "type": "string",
            "nullable": true
          },
          "pensionProviderId": {
            "type": "string",
            "nullable": true
          },
          "name": {
            "type": "string",
            "nullable": true
          },
          "paymentSource": {
            "type": "string",
            "nullable": true
          },
          "lastReEnrolmentDate": {
            "type": "string",
            "format": "date",
            "nullable": true
          },
          "dutyStartDate": {
            "type": "string",
            "format": "date",
            "nullable": true
          },
          "externalReferenceId": {
            "type": "string",
            "nullable": true
          },
          "contributionDueDateOffsetDays": {
            "type": "integer",
            "description": "How many days after an earnings period ends the contributions are due\nat this provider.\n            \n\nThe due date on a contribution schedule belongs to the provider,\nand it has to match what the provider holds or the submission is\nrefused. Once the provider is connected its own published schedule is\nused and this is ignored; set it when there is no connection, so the\nfile carries the agreed date rather than the date employees were\npaid.",
            "format": "int32",
            "nullable": true
          },
          "employeeIdentifierField": {
            "enum": [
              "NationalInsuranceNumber",
              "PayrollId",
              "EmployeeCode",
              "EmployeeId"
            ],
            "type": "string",
            "nullable": true
          },
          "optOutContactPoint": {
            "type": "string",
            "description": "Where this scheme's members get the form to leave the scheme (the opt-out notice), shown\nin every enrolment and re-enrolment letter (SI 2010/772 Schedule 2 para 10). A web address,\nphone number or both. Empty uses the provider's own route\n(`PensionProviderV2.optOutContactPoint`); when neither is set, letters that must state\nit are not sent. On an update, leaving it out keeps the stored value and an empty value\nclears it.",
            "nullable": true
          },
          "createdBy": {
            "type": "string",
            "nullable": true
          },
          "createdDate": {
            "type": "string",
            "nullable": true
          },
          "updatedBy": {
            "type": "string",
            "nullable": true
          },
          "updatedDate": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "PensionV2_PensionSchemeV2ApiResponse": {
        "allOf": [
          {
            "$ref": "#/components/schemas/PensionV2_PensionSchemeV2ResponseBody"
          }
        ],
        "description": "Deprecated: renamed to `PensionSchemeV2ResponseBody`, which has the same fields and more.",
        "deprecated": true
      },
      "PensionV2_PensionSchemeV2Content": {
        "allOf": [
          {
            "$ref": "#/components/schemas/PensionV2_PensionSchemeV2ContentResponse"
          }
        ],
        "description": "Deprecated: renamed to `PensionSchemeV2ContentResponse`, which has the same fields and more.",
        "deprecated": true
      },
      "PensionV2_PensionSchemeV2ContentResponse": {
        "type": "object",
        "properties": {
          "data": {
            "$ref": "#/components/schemas/PensionV2_PensionSchemeV2"
          },
          "metadata": {
            "$ref": "#/components/schemas/PensionV2_ContentMetadataResponse"
          }
        },
        "additionalProperties": false
      },
      "PensionV2_PensionSchemeV2ResponseBody": {
        "required": [
          "message"
        ],
        "type": "object",
        "properties": {
          "message": {
            "$ref": "#/components/schemas/PensionV2_MessageWithTokenResponse"
          },
          "content": {
            "$ref": "#/components/schemas/PensionV2_PensionSchemeV2ContentResponse"
          },
          "validationIssues": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PensionV2_ValidationIssue"
            },
            "nullable": true
          },
          "errors": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PensionV2_Error"
            },
            "description": "Deprecated: the same issues as `validationIssues` (`reasonText` is `reason`, `reasonId` is `reasonToken`, `reasonParameters` is `reasonTokenArguments`). Read `validationIssues`; this will be removed.",
            "nullable": true,
            "readOnly": true,
            "deprecated": true
          },
          "metadata": {
            "allOf": [
              {
                "$ref": "#/components/schemas/PensionV2_ContentMetadataResponse"
              }
            ],
            "description": "Deprecated: the same values as `content.metadata`. Read that; this will be removed.",
            "deprecated": true
          }
        },
        "additionalProperties": false,
        "description": "The response envelope every FlowPayroll API answers with: a `message`, the\n`content`, and any `validationIssues`. `errors` and the top-level\n`metadata` are deprecated copies of `validationIssues` and\n`content.metadata`, and will be removed."
      },
      "PensionV2_PostponementModel": {
        "required": [
          "endDate",
          "postponementType",
          "startDate"
        ],
        "type": "object",
        "properties": {
          "startDate": {
            "type": "string",
            "format": "date"
          },
          "endDate": {
            "type": "string",
            "format": "date"
          },
          "postponementType": {
            "enum": [
              "StartDate",
              "EligibilityDate"
            ],
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "PensionV2_PostponementValueModel": {
        "required": [
          "frequency",
          "value"
        ],
        "type": "object",
        "properties": {
          "value": {
            "type": "integer",
            "format": "int32"
          },
          "frequency": {
            "enum": [
              "Days",
              "Weeks",
              "Months"
            ],
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "description": "How long a postponement lasts: a number of Days, Weeks or Months. At most three months from\nits starting day (Pensions Act 2008, section 4(6)): 3 months, 13 weeks or 92 days. 0 means no\npostponement."
      },
      "PensionV2_PreviewAutoEnrolmentAssessmentRequest": {
        "required": [
          "dateOfBirth",
          "earnings",
          "payReferencePeriodEndDate",
          "payReferencePeriodStartDate"
        ],
        "type": "object",
        "properties": {
          "dateOfBirth": {
            "type": "string",
            "format": "date"
          },
          "earnings": {
            "$ref": "#/components/schemas/PensionV2_EarningsModel"
          },
          "payReferencePeriodStartDate": {
            "type": "string",
            "format": "date"
          },
          "payReferencePeriodEndDate": {
            "type": "string",
            "format": "date"
          }
        },
        "additionalProperties": false
      },
      "PensionV2_ProviderMemberChangeListModel": {
        "required": [
          "items"
        ],
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PensionV2_ProviderMemberChangeV2"
            },
            "nullable": true
          },
          "paginationToken": {
            "type": "string",
            "description": "Deprecated: the same value as `content.metadata.paginationToken`. Read that; this will be removed.",
            "nullable": true,
            "deprecated": true
          }
        },
        "additionalProperties": false,
        "description": "A page of provider-reported changes. Follow the token while it is\nnon-null: a full page can still be the last one."
      },
      "PensionV2_ProviderMemberChangeListModelApiResponse": {
        "allOf": [
          {
            "$ref": "#/components/schemas/PensionV2_ProviderMemberChangeListModelResponseBody"
          }
        ],
        "description": "Deprecated: renamed to `ProviderMemberChangeListModelResponseBody`, which has the same fields and more.",
        "deprecated": true
      },
      "PensionV2_ProviderMemberChangeListModelContent": {
        "allOf": [
          {
            "$ref": "#/components/schemas/PensionV2_ProviderMemberChangeListModelContentResponse"
          }
        ],
        "description": "Deprecated: renamed to `ProviderMemberChangeListModelContentResponse`, which has the same fields and more.",
        "deprecated": true
      },
      "PensionV2_ProviderMemberChangeListModelContentResponse": {
        "type": "object",
        "properties": {
          "data": {
            "$ref": "#/components/schemas/PensionV2_ProviderMemberChangeListModel"
          },
          "metadata": {
            "$ref": "#/components/schemas/PensionV2_ContentMetadataResponse"
          }
        },
        "additionalProperties": false
      },
      "PensionV2_ProviderMemberChangeListModelResponseBody": {
        "required": [
          "message"
        ],
        "type": "object",
        "properties": {
          "message": {
            "$ref": "#/components/schemas/PensionV2_MessageWithTokenResponse"
          },
          "content": {
            "$ref": "#/components/schemas/PensionV2_ProviderMemberChangeListModelContentResponse"
          },
          "validationIssues": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PensionV2_ValidationIssue"
            },
            "nullable": true
          },
          "errors": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PensionV2_Error"
            },
            "description": "Deprecated: the same issues as `validationIssues` (`reasonText` is `reason`, `reasonId` is `reasonToken`, `reasonParameters` is `reasonTokenArguments`). Read `validationIssues`; this will be removed.",
            "nullable": true,
            "readOnly": true,
            "deprecated": true
          },
          "metadata": {
            "allOf": [
              {
                "$ref": "#/components/schemas/PensionV2_ContentMetadataResponse"
              }
            ],
            "description": "Deprecated: the same values as `content.metadata`. Read that; this will be removed.",
            "deprecated": true
          }
        },
        "additionalProperties": false,
        "description": "The response envelope every FlowPayroll API answers with: a `message`, the\n`content`, and any `validationIssues`. `errors` and the top-level\n`metadata` are deprecated copies of `validationIssues` and\n`content.metadata`, and will be removed."
      },
      "PensionV2_ProviderMemberChangeSummaryV2": {
        "required": [
          "pendingCount",
          "pendingOptOutCount"
        ],
        "type": "object",
        "properties": {
          "pendingCount": {
            "type": "integer",
            "format": "int32"
          },
          "pendingOptOutCount": {
            "type": "integer",
            "description": "Of those, how many are opt-outs. They carry a statutory refund duty\nand a deadline, so they are the ones worth chasing.",
            "format": "int32"
          },
          "oldestEffectiveDate": {
            "type": "string",
            "description": "The oldest thing still waiting, or null when nothing is.",
            "format": "date",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "description": "How many provider changes are waiting, so a screen can show that\nsomething needs attention without reading the whole list."
      },
      "PensionV2_ProviderMemberChangeSummaryV2ApiResponse": {
        "allOf": [
          {
            "$ref": "#/components/schemas/PensionV2_ProviderMemberChangeSummaryV2ResponseBody"
          }
        ],
        "description": "Deprecated: renamed to `ProviderMemberChangeSummaryV2ResponseBody`, which has the same fields and more.",
        "deprecated": true
      },
      "PensionV2_ProviderMemberChangeSummaryV2Content": {
        "allOf": [
          {
            "$ref": "#/components/schemas/PensionV2_ProviderMemberChangeSummaryV2ContentResponse"
          }
        ],
        "description": "Deprecated: renamed to `ProviderMemberChangeSummaryV2ContentResponse`, which has the same fields and more.",
        "deprecated": true
      },
      "PensionV2_ProviderMemberChangeSummaryV2ContentResponse": {
        "type": "object",
        "properties": {
          "data": {
            "$ref": "#/components/schemas/PensionV2_ProviderMemberChangeSummaryV2"
          },
          "metadata": {
            "$ref": "#/components/schemas/PensionV2_ContentMetadataResponse"
          }
        },
        "additionalProperties": false
      },
      "PensionV2_ProviderMemberChangeSummaryV2ResponseBody": {
        "required": [
          "message"
        ],
        "type": "object",
        "properties": {
          "message": {
            "$ref": "#/components/schemas/PensionV2_MessageWithTokenResponse"
          },
          "content": {
            "$ref": "#/components/schemas/PensionV2_ProviderMemberChangeSummaryV2ContentResponse"
          },
          "validationIssues": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PensionV2_ValidationIssue"
            },
            "nullable": true
          },
          "errors": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PensionV2_Error"
            },
            "description": "Deprecated: the same issues as `validationIssues` (`reasonText` is `reason`, `reasonId` is `reasonToken`, `reasonParameters` is `reasonTokenArguments`). Read `validationIssues`; this will be removed.",
            "nullable": true,
            "readOnly": true,
            "deprecated": true
          },
          "metadata": {
            "allOf": [
              {
                "$ref": "#/components/schemas/PensionV2_ContentMetadataResponse"
              }
            ],
            "description": "Deprecated: the same values as `content.metadata`. Read that; this will be removed.",
            "deprecated": true
          }
        },
        "additionalProperties": false,
        "description": "The response envelope every FlowPayroll API answers with: a `message`, the\n`content`, and any `validationIssues`. `errors` and the top-level\n`metadata` are deprecated copies of `validationIssues` and\n`content.metadata`, and will be removed."
      },
      "PensionV2_ProviderMemberChangeV2": {
        "required": [
          "changeType",
          "createdDate",
          "effectiveDate",
          "id",
          "providerSlug",
          "status"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Stable name for this change, used to apply or dismiss it.",
            "nullable": true
          },
          "employeeId": {
            "type": "string",
            "description": "The employee it was matched to, absent when nothing matched.",
            "nullable": true
          },
          "memberName": {
            "type": "string",
            "description": "Who the provider says this is. Show this, not the reference.",
            "nullable": true
          },
          "memberReference": {
            "type": "string",
            "description": "The provider's own reference for the member, for an unmatched change.",
            "nullable": true
          },
          "changeType": {
            "type": "string",
            "description": "What happened: OptOut when the member opted out inside the window, so\na statutory refund follows; StoppedContributions when they stopped\nafterwards, when none does.",
            "nullable": true
          },
          "effectiveDate": {
            "type": "string",
            "description": "The provider's date for the change, which is the one that counts.",
            "format": "date"
          },
          "providerSlug": {
            "type": "string",
            "nullable": true
          },
          "status": {
            "type": "string",
            "description": "Pending, Applied or Dismissed.",
            "nullable": true
          },
          "decidedBy": {
            "type": "string",
            "nullable": true
          },
          "decidedDate": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "createdDate": {
            "type": "string",
            "format": "date-time"
          }
        },
        "additionalProperties": false,
        "description": "Something a pension provider reported about a member, waiting for the\nemployer to decide what payroll does about it. Nothing here has been\napplied."
      },
      "PensionV2_ProviderMemberChangeV2ApiResponse": {
        "allOf": [
          {
            "$ref": "#/components/schemas/PensionV2_ProviderMemberChangeV2ResponseBody"
          }
        ],
        "description": "Deprecated: renamed to `ProviderMemberChangeV2ResponseBody`, which has the same fields and more.",
        "deprecated": true
      },
      "PensionV2_ProviderMemberChangeV2Content": {
        "allOf": [
          {
            "$ref": "#/components/schemas/PensionV2_ProviderMemberChangeV2ContentResponse"
          }
        ],
        "description": "Deprecated: renamed to `ProviderMemberChangeV2ContentResponse`, which has the same fields and more.",
        "deprecated": true
      },
      "PensionV2_ProviderMemberChangeV2ContentResponse": {
        "type": "object",
        "properties": {
          "data": {
            "$ref": "#/components/schemas/PensionV2_ProviderMemberChangeV2"
          },
          "metadata": {
            "$ref": "#/components/schemas/PensionV2_ContentMetadataResponse"
          }
        },
        "additionalProperties": false
      },
      "PensionV2_ProviderMemberChangeV2ResponseBody": {
        "required": [
          "message"
        ],
        "type": "object",
        "properties": {
          "message": {
            "$ref": "#/components/schemas/PensionV2_MessageWithTokenResponse"
          },
          "content": {
            "$ref": "#/components/schemas/PensionV2_ProviderMemberChangeV2ContentResponse"
          },
          "validationIssues": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PensionV2_ValidationIssue"
            },
            "nullable": true
          },
          "errors": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PensionV2_Error"
            },
            "description": "Deprecated: the same issues as `validationIssues` (`reasonText` is `reason`, `reasonId` is `reasonToken`, `reasonParameters` is `reasonTokenArguments`). Read `validationIssues`; this will be removed.",
            "nullable": true,
            "readOnly": true,
            "deprecated": true
          },
          "metadata": {
            "allOf": [
              {
                "$ref": "#/components/schemas/PensionV2_ContentMetadataResponse"
              }
            ],
            "description": "Deprecated: the same values as `content.metadata`. Read that; this will be removed.",
            "deprecated": true
          }
        },
        "additionalProperties": false,
        "description": "The response envelope every FlowPayroll API answers with: a `message`, the\n`content`, and any `validationIssues`. `errors` and the top-level\n`metadata` are deprecated copies of `validationIssues` and\n`content.metadata`, and will be removed."
      },
      "PensionV2_ProviderReturnListModel": {
        "required": [
          "items"
        ],
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PensionV2_ProviderReturnV2"
            },
            "nullable": true
          },
          "paginationToken": {
            "type": "string",
            "description": "Deprecated: the same value as `content.metadata.paginationToken`. Read that; this will be removed.",
            "nullable": true,
            "deprecated": true
          }
        },
        "additionalProperties": false,
        "description": "One page of what pension providers have sent back, newest first."
      },
      "PensionV2_ProviderReturnListModelApiResponse": {
        "allOf": [
          {
            "$ref": "#/components/schemas/PensionV2_ProviderReturnListModelResponseBody"
          }
        ],
        "description": "Deprecated: renamed to `ProviderReturnListModelResponseBody`, which has the same fields and more.",
        "deprecated": true
      },
      "PensionV2_ProviderReturnListModelContent": {
        "allOf": [
          {
            "$ref": "#/components/schemas/PensionV2_ProviderReturnListModelContentResponse"
          }
        ],
        "description": "Deprecated: renamed to `ProviderReturnListModelContentResponse`, which has the same fields and more.",
        "deprecated": true
      },
      "PensionV2_ProviderReturnListModelContentResponse": {
        "type": "object",
        "properties": {
          "data": {
            "$ref": "#/components/schemas/PensionV2_ProviderReturnListModel"
          },
          "metadata": {
            "$ref": "#/components/schemas/PensionV2_ContentMetadataResponse"
          }
        },
        "additionalProperties": false
      },
      "PensionV2_ProviderReturnListModelResponseBody": {
        "required": [
          "message"
        ],
        "type": "object",
        "properties": {
          "message": {
            "$ref": "#/components/schemas/PensionV2_MessageWithTokenResponse"
          },
          "content": {
            "$ref": "#/components/schemas/PensionV2_ProviderReturnListModelContentResponse"
          },
          "validationIssues": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PensionV2_ValidationIssue"
            },
            "nullable": true
          },
          "errors": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PensionV2_Error"
            },
            "description": "Deprecated: the same issues as `validationIssues` (`reasonText` is `reason`, `reasonId` is `reasonToken`, `reasonParameters` is `reasonTokenArguments`). Read `validationIssues`; this will be removed.",
            "nullable": true,
            "readOnly": true,
            "deprecated": true
          },
          "metadata": {
            "allOf": [
              {
                "$ref": "#/components/schemas/PensionV2_ContentMetadataResponse"
              }
            ],
            "description": "Deprecated: the same values as `content.metadata`. Read that; this will be removed.",
            "deprecated": true
          }
        },
        "additionalProperties": false,
        "description": "The response envelope every FlowPayroll API answers with: a `message`, the\n`content`, and any `validationIssues`. `errors` and the top-level\n`metadata` are deprecated copies of `validationIssues` and\n`content.metadata`, and will be removed."
      },
      "PensionV2_ProviderReturnV2": {
        "required": [
          "document",
          "operationId",
          "receivedDate",
          "type"
        ],
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "nullable": true
          },
          "operationId": {
            "type": "string",
            "nullable": true
          },
          "receivedDate": {
            "type": "string",
            "format": "date-time"
          },
          "document": {}
        },
        "additionalProperties": false
      },
      "PensionV2_ProviderSyncIssueV2": {
        "required": [
          "message"
        ],
        "type": "object",
        "properties": {
          "reference": {
            "type": "string",
            "description": "The identifier the submission sent for the record concerned, so it\ncan be matched back to a person. Absent when the provider refused\nthe submission as a whole rather than one of its records.",
            "nullable": true
          },
          "referenceLabel": {
            "type": "string",
            "description": "Who that reference is, resolved from the pay run: show this rather\nthan the raw reference. Absent when the reference matches nobody in\nthe run, or when the provider refused the submission as a whole.",
            "nullable": true
          },
          "employeeId": {
            "type": "string",
            "description": "The employee this refusal is about, as their own id. The reference is\nwhatever identifier the scheme sends the provider (a payroll id, say),\nwhich is not something a caller can look an employee up by, so the\nlink to the person is carried rather than inferred from it.",
            "nullable": true
          },
          "code": {
            "type": "string",
            "description": "The provider's own error code, for support and audit.",
            "nullable": true
          },
          "message": {
            "type": "string",
            "description": "The provider's own wording. Safe to show a user as-is.",
            "nullable": true
          },
          "noActionNeeded": {
            "type": "boolean",
            "description": "True when the provider is confirming this record already holds what\nthe submission asked for, rather than refusing it: a worker an\nearlier send already enrolled, which is what a re-sent batch looks\nlike from the provider's side.\n            \n\nShow these, so what is on screen matches the provider's own\nanswer, but apart from the ones somebody has to act on and never as\na reason the submission failed. A record with `Status``Succeeded` can still carry them."
          }
        },
        "additionalProperties": false,
        "description": "One thing the pension provider refused."
      },
      "PensionV2_ProviderSyncIssueV2ListApiResponse": {
        "allOf": [
          {
            "$ref": "#/components/schemas/PensionV2_ProviderSyncIssueV2ListResponseBody"
          }
        ],
        "description": "Deprecated: renamed to `ProviderSyncIssueV2ListResponseBody`, which has the same fields and more.",
        "deprecated": true
      },
      "PensionV2_ProviderSyncIssueV2ListContent": {
        "allOf": [
          {
            "$ref": "#/components/schemas/PensionV2_ProviderSyncIssueV2ListContentResponse"
          }
        ],
        "description": "Deprecated: renamed to `ProviderSyncIssueV2ListContentResponse`, which has the same fields and more.",
        "deprecated": true
      },
      "PensionV2_ProviderSyncIssueV2ListContentResponse": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PensionV2_ProviderSyncIssueV2"
            },
            "nullable": true
          },
          "metadata": {
            "$ref": "#/components/schemas/PensionV2_ContentMetadataResponse"
          }
        },
        "additionalProperties": false
      },
      "PensionV2_ProviderSyncIssueV2ListResponseBody": {
        "required": [
          "message"
        ],
        "type": "object",
        "properties": {
          "message": {
            "$ref": "#/components/schemas/PensionV2_MessageWithTokenResponse"
          },
          "content": {
            "$ref": "#/components/schemas/PensionV2_ProviderSyncIssueV2ListContentResponse"
          },
          "validationIssues": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PensionV2_ValidationIssue"
            },
            "nullable": true
          },
          "errors": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PensionV2_Error"
            },
            "description": "Deprecated: the same issues as `validationIssues` (`reasonText` is `reason`, `reasonId` is `reasonToken`, `reasonParameters` is `reasonTokenArguments`). Read `validationIssues`; this will be removed.",
            "nullable": true,
            "readOnly": true,
            "deprecated": true
          },
          "metadata": {
            "allOf": [
              {
                "$ref": "#/components/schemas/PensionV2_ContentMetadataResponse"
              }
            ],
            "description": "Deprecated: the same values as `content.metadata`. Read that; this will be removed.",
            "deprecated": true
          }
        },
        "additionalProperties": false,
        "description": "The response envelope every FlowPayroll API answers with: a `message`, the\n`content`, and any `validationIssues`. `errors` and the top-level\n`metadata` are deprecated copies of `validationIssues` and\n`content.metadata`, and will be removed."
      },
      "PensionV2_ProviderSyncPayRunV2": {
        "required": [
          "frequency",
          "payrollConfigId",
          "period",
          "year"
        ],
        "type": "object",
        "properties": {
          "payrollConfigId": {
            "type": "string",
            "nullable": true
          },
          "year": {
            "type": "integer",
            "format": "int32"
          },
          "frequency": {
            "type": "string",
            "nullable": true
          },
          "period": {
            "type": "integer",
            "format": "int32"
          }
        },
        "additionalProperties": false,
        "description": "The pay run a provider submission was for."
      },
      "PensionV2_ProviderSyncRecordV2": {
        "required": [
          "createdBy",
          "createdDate",
          "operationType",
          "providerSlug",
          "schemeId",
          "status",
          "updatedBy",
          "updatedDate"
        ],
        "type": "object",
        "properties": {
          "payRun": {
            "$ref": "#/components/schemas/PensionV2_ProviderSyncPayRunV2"
          },
          "schemeId": {
            "type": "string",
            "nullable": true
          },
          "operationType": {
            "type": "string",
            "nullable": true
          },
          "operationId": {
            "type": "string",
            "nullable": true
          },
          "providerSlug": {
            "type": "string",
            "nullable": true
          },
          "status": {
            "$ref": "#/components/schemas/PensionV2_ProviderSyncStatusV2"
          },
          "providerReference": {
            "type": "string",
            "description": "The provider's own reference for what it created, once it has\none. Use it to reconcile against the provider's records.",
            "nullable": true
          },
          "errorToken": {
            "type": "string",
            "description": "Stable, provider-agnostic reason code the submission did not land.\nBranch on this, and use it as the i18n lookup key; treat an\nunrecognised value as a generic failure, because the list grows.",
            "nullable": true
          },
          "errorMessage": {
            "type": "string",
            "description": "Default English for errorToken, safe to show a user as-is.\nWording may change between releases; the token will not.",
            "nullable": true
          },
          "notResentToken": {
            "type": "string",
            "description": "Stable reason code saying that the last send did not reach the\nprovider because an identical submission was already there. Null\nwhenever something was actually sent.\n            \n\nNot a failure: `status` still describes the submission the\nprovider holds. Show it, or a repeated send looks like a dead\nbutton.",
            "nullable": true
          },
          "notResentMessage": {
            "type": "string",
            "description": "Default English for notResentToken, safe to show a user as-is.",
            "nullable": true
          },
          "issues": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PensionV2_ProviderSyncIssueV2"
            },
            "description": "What the provider itself said it would not accept, record by record.\nThe error token says the submission was refused; this says which\ndetails to change, so nothing has to be inferred from the file.\nCarries the first page; read issueCount for the total the provider\nreported, and the provider-sync issues endpoint for every one of them.",
            "nullable": true
          },
          "issueCount": {
            "type": "integer",
            "description": "How many issues the provider reported in total. Greater than the\nnumber in issues when the provider refused more records than this\nrecord carries.",
            "format": "int32",
            "nullable": true
          },
          "memberCount": {
            "type": "integer",
            "format": "int32"
          },
          "totalAmount": {
            "type": "number",
            "format": "double"
          },
          "createdBy": {
            "type": "string",
            "description": "Who started this submission, and when. Nothing is sent to a pension\nprovider on its own, so every record names the person who sent it;\na submission made before the platform recorded this reads \"System\".",
            "nullable": true
          },
          "createdDate": {
            "type": "string",
            "format": "date-time"
          },
          "updatedBy": {
            "type": "string",
            "description": "Who last changed it. \"System\" once the provider has answered, since\nthat is the provider's own reply rather than somebody's action.",
            "nullable": true
          },
          "updatedDate": {
            "type": "string",
            "description": "When the provider answered (UTC), on a settled submission — the\nprovider's own moment, not when this service recorded it, so it\nis safe to reconcile against the provider's records and does not\nmove with our queue timings.",
            "format": "date-time"
          }
        },
        "additionalProperties": false
      },
      "PensionV2_ProviderSyncRecordV2ApiResponse": {
        "allOf": [
          {
            "$ref": "#/components/schemas/PensionV2_ProviderSyncRecordV2ResponseBody"
          }
        ],
        "description": "Deprecated: renamed to `ProviderSyncRecordV2ResponseBody`, which has the same fields and more.",
        "deprecated": true
      },
      "PensionV2_ProviderSyncRecordV2Content": {
        "allOf": [
          {
            "$ref": "#/components/schemas/PensionV2_ProviderSyncRecordV2ContentResponse"
          }
        ],
        "description": "Deprecated: renamed to `ProviderSyncRecordV2ContentResponse`, which has the same fields and more.",
        "deprecated": true
      },
      "PensionV2_ProviderSyncRecordV2ContentResponse": {
        "type": "object",
        "properties": {
          "data": {
            "$ref": "#/components/schemas/PensionV2_ProviderSyncRecordV2"
          },
          "metadata": {
            "$ref": "#/components/schemas/PensionV2_ContentMetadataResponse"
          }
        },
        "additionalProperties": false
      },
      "PensionV2_ProviderSyncRecordV2ListApiResponse": {
        "allOf": [
          {
            "$ref": "#/components/schemas/PensionV2_ProviderSyncRecordV2ListResponseBody"
          }
        ],
        "description": "Deprecated: renamed to `ProviderSyncRecordV2ListResponseBody`, which has the same fields and more.",
        "deprecated": true
      },
      "PensionV2_ProviderSyncRecordV2ListContent": {
        "allOf": [
          {
            "$ref": "#/components/schemas/PensionV2_ProviderSyncRecordV2ListContentResponse"
          }
        ],
        "description": "Deprecated: renamed to `ProviderSyncRecordV2ListContentResponse`, which has the same fields and more.",
        "deprecated": true
      },
      "PensionV2_ProviderSyncRecordV2ListContentResponse": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PensionV2_ProviderSyncRecordV2"
            },
            "nullable": true
          },
          "metadata": {
            "$ref": "#/components/schemas/PensionV2_ContentMetadataResponse"
          }
        },
        "additionalProperties": false
      },
      "PensionV2_ProviderSyncRecordV2ListResponseBody": {
        "required": [
          "message"
        ],
        "type": "object",
        "properties": {
          "message": {
            "$ref": "#/components/schemas/PensionV2_MessageWithTokenResponse"
          },
          "content": {
            "$ref": "#/components/schemas/PensionV2_ProviderSyncRecordV2ListContentResponse"
          },
          "validationIssues": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PensionV2_ValidationIssue"
            },
            "nullable": true
          },
          "errors": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PensionV2_Error"
            },
            "description": "Deprecated: the same issues as `validationIssues` (`reasonText` is `reason`, `reasonId` is `reasonToken`, `reasonParameters` is `reasonTokenArguments`). Read `validationIssues`; this will be removed.",
            "nullable": true,
            "readOnly": true,
            "deprecated": true
          },
          "metadata": {
            "allOf": [
              {
                "$ref": "#/components/schemas/PensionV2_ContentMetadataResponse"
              }
            ],
            "description": "Deprecated: the same values as `content.metadata`. Read that; this will be removed.",
            "deprecated": true
          }
        },
        "additionalProperties": false,
        "description": "The response envelope every FlowPayroll API answers with: a `message`, the\n`content`, and any `validationIssues`. `errors` and the top-level\n`metadata` are deprecated copies of `validationIssues` and\n`content.metadata`, and will be removed."
      },
      "PensionV2_ProviderSyncRecordV2ResponseBody": {
        "required": [
          "message"
        ],
        "type": "object",
        "properties": {
          "message": {
            "$ref": "#/components/schemas/PensionV2_MessageWithTokenResponse"
          },
          "content": {
            "$ref": "#/components/schemas/PensionV2_ProviderSyncRecordV2ContentResponse"
          },
          "validationIssues": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PensionV2_ValidationIssue"
            },
            "nullable": true
          },
          "errors": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PensionV2_Error"
            },
            "description": "Deprecated: the same issues as `validationIssues` (`reasonText` is `reason`, `reasonId` is `reasonToken`, `reasonParameters` is `reasonTokenArguments`). Read `validationIssues`; this will be removed.",
            "nullable": true,
            "readOnly": true,
            "deprecated": true
          },
          "metadata": {
            "allOf": [
              {
                "$ref": "#/components/schemas/PensionV2_ContentMetadataResponse"
              }
            ],
            "description": "Deprecated: the same values as `content.metadata`. Read that; this will be removed.",
            "deprecated": true
          }
        },
        "additionalProperties": false,
        "description": "The response envelope every FlowPayroll API answers with: a `message`, the\n`content`, and any `validationIssues`. `errors` and the top-level\n`metadata` are deprecated copies of `validationIssues` and\n`content.metadata`, and will be removed."
      },
      "PensionV2_ProviderSyncStatusV2": {
        "enum": [
          "Pending",
          "AwaitingProvider",
          "Succeeded",
          "Failed",
          "NeedsAttention",
          "Cancelled",
          "SubmitFailed"
        ],
        "type": "string",
        "description": "Where a submission to a pension provider has got to."
      },
      "PensionV2_PutAdditionalVoluntaryContributionRequest": {
        "required": [
          "amount"
        ],
        "type": "object",
        "properties": {
          "amount": {
            "type": "number",
            "description": "The amount, in pounds, to add to the employee's pension for the\naddressed pay period only. Must be greater than 0; delete the top-up to\nremove it.",
            "format": "double"
          }
        },
        "additionalProperties": false
      },
      "PensionV2_PutAutoEnrolmentSettingsRequest": {
        "required": [
          "autoEnrolmentMode"
        ],
        "type": "object",
        "properties": {
          "autoEnrolmentMode": {
            "enum": [
              "None",
              "Manual",
              "Automatic"
            ],
            "type": "string",
            "nullable": true
          },
          "sendEnrolmentLetterOnAutoEnrolment": {
            "type": "boolean",
            "description": "Optional. When omitted/null the organisation's current value is left unchanged.\nTrue makes Flow email the enrolment letter as part of automatically\nenrolling somebody, which is the cohort that holds the statutory\nopt-out right and so the one whose letter date decides refunds.",
            "nullable": true
          },
          "automaticLetterTypes": {
            "type": "array",
            "items": {
              "enum": [
                "Enrolment",
                "ReEnrolment",
                "Postponement",
                "OptInInformation",
                "OptInConfirmation",
                "JoinConfirmation"
              ],
              "type": "string"
            },
            "description": "Optional. When omitted/null the organisation's current value is left unchanged.\nThe letters Flow sends by itself when the pay run that made them owed is finalised,\neach a letter type; an empty list means every letter is\nsent by hand. It is the default for letters that become owed from now on: a letter\nalready waiting keeps its own setting, changed with\n`PUT /employee-pension/letters/{letterType}/sending`.\n            \n\nWhen both are sent this wins over `sendEnrolmentLetterOnAutoEnrolment`, which\non its own switches the enrolment and re-enrolment letters together.",
            "nullable": true
          },
          "employerGivenLetterTypes": {
            "type": "array",
            "items": {
              "enum": [
                "Enrolment",
                "ReEnrolment",
                "Postponement",
                "OptInInformation",
                "OptInConfirmation",
                "JoinConfirmation"
              ],
              "type": "string"
            },
            "description": "Optional. When omitted/null the organisation's current value is left unchanged.\nThe letters the employer declares THEY give workers, by post, their provider or their own\nsystems, each a letter type; an empty list means none. Flow neither sends these by itself\nnor lists them as waiting, so a letter type named here is left out of\n`automaticLetterTypes` when both name it. It is a statement about their own compliance\nwith the information duty, so the caller is recorded against it; who and when are stamped\nby the service and are not accepted from the request.",
            "nullable": true
          },
          "reEnrolRecentOptOuts": {
            "type": "boolean",
            "description": "Optional. When omitted/null the organisation's current value is left unchanged.\nTrue re-enrols workers who opted out or ceased membership at their own\nrequest in the 12 months before the automatic re-enrolment date, which\nTPR DG11 para 30 leaves to the employer to decide. False (the default)\nexcludes them from that cycle; either way they are assessed again at the\nnext one.",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "PensionV2_PutContributionOverrideRequest": {
        "required": [
          "contributionOverride"
        ],
        "type": "object",
        "properties": {
          "contributionOverride": {
            "$ref": "#/components/schemas/PensionV2_ContributionOverrideValuesModel"
          },
          "acknowledgeBelowAutoEnrolmentMinimum": {
            "type": "boolean",
            "description": "Confirms the period is deliberately below the automatic enrolment\nminimum, which binds per pay reference period (at least 8% of\nqualifying earnings in total with at least 3% from the employer; fixed\namounts cannot meet it). Without it such an override is rejected."
          }
        },
        "additionalProperties": false
      },
      "PensionV2_PutLetterSendingRequest": {
        "required": [
          "employeeIds",
          "sendAutomatically"
        ],
        "type": "object",
        "properties": {
          "employeeIds": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Whose letter. Repeated ids are collapsed.",
            "nullable": true
          },
          "sendAutomatically": {
            "type": "boolean",
            "description": "True: Flow sends it when the worker's next pay run is finalised, unless it has been sent by\nthen. False: it waits for somebody to send it."
          }
        },
        "additionalProperties": false,
        "description": "How a letter still to be given goes out, for one worker or many: by itself when the worker's\nnext pay run is finalised, or when somebody sends it."
      },
      "PensionV2_PutPostponementSettingsRequest": {
        "type": "object",
        "properties": {
          "defaultPostponementStartDateDefinition": {
            "$ref": "#/components/schemas/PensionV2_PostponementValueModel"
          },
          "defaultPostponementEligibilityDateDefinition": {
            "$ref": "#/components/schemas/PensionV2_PostponementValueModel"
          }
        },
        "additionalProperties": false
      },
      "PensionV2_RecurringAdditionalVoluntaryContributionModel": {
        "required": [
          "contributionType",
          "value"
        ],
        "type": "object",
        "properties": {
          "contributionType": {
            "enum": [
              "Percentage",
              "FixedAmount"
            ],
            "type": "string",
            "description": "How the value is read: Percentage (of the group's contribution basis)\nor FixedAmount (per pay period).",
            "nullable": true
          },
          "value": {
            "type": "number",
            "description": "The percentage when contributionType is Percentage (at most 100), or the\nper-period amount when contributionType is FixedAmount.",
            "format": "double"
          }
        },
        "additionalProperties": false,
        "description": "Standing additional voluntary contribution the member pays every pay\nperiod on top of the scheme contribution."
      },
      "PensionV2_RefreshMemberDetailsRequestV2": {
        "required": [
          "employeeIds"
        ],
        "type": "object",
        "properties": {
          "employeeIds": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "The members to re-read, as the employee ids the provider's refusals\nname. Required: a pay run is never refreshed wholesale, because that\nwould re-read every employee on it to correct a handful.",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "PensionV2_RefreshMemberDetailsResponseV2": {
        "required": [
          "exportFilesRebuilt",
          "members",
          "refreshedCount"
        ],
        "type": "object",
        "properties": {
          "refreshedCount": {
            "type": "integer",
            "format": "int32"
          },
          "members": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PensionV2_RefreshedMemberV2"
            },
            "description": "Every member asked for, each saying whether it worked. A caller can\ntell somebody exactly who is now ready to send again and who is not.",
            "nullable": true
          },
          "exportFilesRebuilt": {
            "type": "boolean",
            "description": "Whether the pay run's export files were rebuilt from the corrected\ndetails. The file is rendered from the stored calculations, so a\nscheme that delivers by file rather than through a connection needs\nthis to be true before the download carries the fix. False means the\ndetails are stored but the file still shows the old values."
          }
        },
        "additionalProperties": false
      },
      "PensionV2_RefreshMemberDetailsResponseV2ApiResponse": {
        "allOf": [
          {
            "$ref": "#/components/schemas/PensionV2_RefreshMemberDetailsResponseV2ResponseBody"
          }
        ],
        "description": "Deprecated: renamed to `RefreshMemberDetailsResponseV2ResponseBody`, which has the same fields and more.",
        "deprecated": true
      },
      "PensionV2_RefreshMemberDetailsResponseV2Content": {
        "allOf": [
          {
            "$ref": "#/components/schemas/PensionV2_RefreshMemberDetailsResponseV2ContentResponse"
          }
        ],
        "description": "Deprecated: renamed to `RefreshMemberDetailsResponseV2ContentResponse`, which has the same fields and more.",
        "deprecated": true
      },
      "PensionV2_RefreshMemberDetailsResponseV2ContentResponse": {
        "type": "object",
        "properties": {
          "data": {
            "$ref": "#/components/schemas/PensionV2_RefreshMemberDetailsResponseV2"
          },
          "metadata": {
            "$ref": "#/components/schemas/PensionV2_ContentMetadataResponse"
          }
        },
        "additionalProperties": false
      },
      "PensionV2_RefreshMemberDetailsResponseV2ResponseBody": {
        "required": [
          "message"
        ],
        "type": "object",
        "properties": {
          "message": {
            "$ref": "#/components/schemas/PensionV2_MessageWithTokenResponse"
          },
          "content": {
            "$ref": "#/components/schemas/PensionV2_RefreshMemberDetailsResponseV2ContentResponse"
          },
          "validationIssues": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PensionV2_ValidationIssue"
            },
            "nullable": true
          },
          "errors": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PensionV2_Error"
            },
            "description": "Deprecated: the same issues as `validationIssues` (`reasonText` is `reason`, `reasonId` is `reasonToken`, `reasonParameters` is `reasonTokenArguments`). Read `validationIssues`; this will be removed.",
            "nullable": true,
            "readOnly": true,
            "deprecated": true
          },
          "metadata": {
            "allOf": [
              {
                "$ref": "#/components/schemas/PensionV2_ContentMetadataResponse"
              }
            ],
            "description": "Deprecated: the same values as `content.metadata`. Read that; this will be removed.",
            "deprecated": true
          }
        },
        "additionalProperties": false,
        "description": "The response envelope every FlowPayroll API answers with: a `message`, the\n`content`, and any `validationIssues`. `errors` and the top-level\n`metadata` are deprecated copies of `validationIssues` and\n`content.metadata`, and will be removed."
      },
      "PensionV2_RefreshedMemberV2": {
        "required": [
          "employeeId"
        ],
        "type": "object",
        "properties": {
          "employeeId": {
            "type": "string",
            "nullable": true
          },
          "reason": {
            "type": "string",
            "description": "Why this member could not be re-read. Null when they were.",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "PensionV2_RefundedPensionPeriodModel": {
        "required": [
          "amount",
          "employerAmount",
          "period",
          "taxYear"
        ],
        "type": "object",
        "properties": {
          "taxYear": {
            "type": "integer",
            "description": "The tax year the pay period belongs to (e.g. 2026 for 2026/27).",
            "format": "int32"
          },
          "period": {
            "type": "integer",
            "description": "The pay period number within the tax year.",
            "format": "int32"
          },
          "amount": {
            "type": "number",
            "description": "Member contributions refunded for this pay period, via the payslip.",
            "format": "double"
          },
          "employerAmount": {
            "type": "number",
            "description": "Employer contributions for this pay period, returned by the provider to the employer.",
            "format": "double"
          }
        },
        "additionalProperties": false,
        "description": "One settled pay period inside a refund."
      },
      "PensionV2_SchemeReconciliationV2": {
        "required": [
          "connected",
          "enrolledInFlow",
          "optOutsApplied",
          "optOutsReported",
          "optOutsUnmatched",
          "refundsReported",
          "refundsTotalAmount",
          "schemeId",
          "stoppedContributionsApplied",
          "stoppedContributionsReported",
          "stoppedContributionsUnmatched"
        ],
        "type": "object",
        "properties": {
          "schemeId": {
            "type": "string",
            "nullable": true
          },
          "connected": {
            "type": "boolean"
          },
          "providerSlug": {
            "type": "string",
            "nullable": true
          },
          "enrolledInFlow": {
            "type": "integer",
            "format": "int32"
          },
          "optOutsReported": {
            "type": "integer",
            "format": "int32"
          },
          "optOutsApplied": {
            "type": "integer",
            "format": "int32"
          },
          "optOutsUnmatched": {
            "type": "integer",
            "format": "int32"
          },
          "stoppedContributionsReported": {
            "type": "integer",
            "format": "int32"
          },
          "stoppedContributionsApplied": {
            "type": "integer",
            "format": "int32"
          },
          "stoppedContributionsUnmatched": {
            "type": "integer",
            "format": "int32"
          },
          "refundsReported": {
            "type": "integer",
            "format": "int32"
          },
          "refundsTotalAmount": {
            "type": "number",
            "description": "What the provider says it refunded, for the employer to\n            reconcile against what payroll did. The provider's own figure.",
            "format": "double"
          },
          "lastReturnReceivedDate": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "PensionV2_SchemeReconciliationV2ApiResponse": {
        "allOf": [
          {
            "$ref": "#/components/schemas/PensionV2_SchemeReconciliationV2ResponseBody"
          }
        ],
        "description": "Deprecated: renamed to `SchemeReconciliationV2ResponseBody`, which has the same fields and more.",
        "deprecated": true
      },
      "PensionV2_SchemeReconciliationV2Content": {
        "allOf": [
          {
            "$ref": "#/components/schemas/PensionV2_SchemeReconciliationV2ContentResponse"
          }
        ],
        "description": "Deprecated: renamed to `SchemeReconciliationV2ContentResponse`, which has the same fields and more.",
        "deprecated": true
      },
      "PensionV2_SchemeReconciliationV2ContentResponse": {
        "type": "object",
        "properties": {
          "data": {
            "$ref": "#/components/schemas/PensionV2_SchemeReconciliationV2"
          },
          "metadata": {
            "$ref": "#/components/schemas/PensionV2_ContentMetadataResponse"
          }
        },
        "additionalProperties": false
      },
      "PensionV2_SchemeReconciliationV2ResponseBody": {
        "required": [
          "message"
        ],
        "type": "object",
        "properties": {
          "message": {
            "$ref": "#/components/schemas/PensionV2_MessageWithTokenResponse"
          },
          "content": {
            "$ref": "#/components/schemas/PensionV2_SchemeReconciliationV2ContentResponse"
          },
          "validationIssues": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PensionV2_ValidationIssue"
            },
            "nullable": true
          },
          "errors": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PensionV2_Error"
            },
            "description": "Deprecated: the same issues as `validationIssues` (`reasonText` is `reason`, `reasonId` is `reasonToken`, `reasonParameters` is `reasonTokenArguments`). Read `validationIssues`; this will be removed.",
            "nullable": true,
            "readOnly": true,
            "deprecated": true
          },
          "metadata": {
            "allOf": [
              {
                "$ref": "#/components/schemas/PensionV2_ContentMetadataResponse"
              }
            ],
            "description": "Deprecated: the same values as `content.metadata`. Read that; this will be removed.",
            "deprecated": true
          }
        },
        "additionalProperties": false,
        "description": "The response envelope every FlowPayroll API answers with: a `message`, the\n`content`, and any `validationIssues`. `errors` and the top-level\n`metadata` are deprecated copies of `validationIssues` and\n`content.metadata`, and will be removed."
      },
      "PensionV2_SchemeSendOutcomeV2": {
        "required": [
          "schemeId",
          "schemeName",
          "status"
        ],
        "type": "object",
        "properties": {
          "schemeId": {
            "type": "string",
            "nullable": true
          },
          "schemeName": {
            "type": "string",
            "nullable": true
          },
          "status": {
            "$ref": "#/components/schemas/PensionV2_SchemeSendStatusV2"
          },
          "providerSlug": {
            "type": "string",
            "description": "The connected provider, or null when the scheme has no connection.",
            "nullable": true
          },
          "connectionId": {
            "type": "string",
            "nullable": true
          },
          "reasonToken": {
            "type": "string",
            "description": "Stable, provider-agnostic reason nothing was sent, or null when\nsomething was. Branch on this; use it as the i18n lookup key, and\ntreat an unrecognised value as a generic reason, because the list\ngrows.",
            "nullable": true
          },
          "reasonMessage": {
            "type": "string",
            "description": "Default English for reasonToken, safe to show a user as-is.\nWording may change between releases; the token will not.",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "description": "What a send did for one scheme in the pay run."
      },
      "PensionV2_SchemeSendStatusV2": {
        "enum": [
          "Submitted",
          "Skipped",
          "Blocked",
          "Failed"
        ],
        "type": "string",
        "description": "What a send did for one scheme."
      },
      "PensionV2_SendPensionLettersRequest": {
        "required": [
          "employeeIds"
        ],
        "type": "object",
        "properties": {
          "employeeIds": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Who to write to. Repeated ids are collapsed, so asking twice for the\nsame member still posts them one letter.",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "description": "Who to send a pension letter to.\n            \n\nWhich letter is in the path, not here: the letter type names a\nsub-collection of this resource (\"the enrolment letters\"), and a path\nsegment is how a collection is identified. The body carries only what is\nbeing created in it."
      },
      "PensionV2_SendToProviderResultV2": {
        "required": [
          "schemes",
          "submissions"
        ],
        "type": "object",
        "properties": {
          "schemes": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PensionV2_SchemeSendOutcomeV2"
            },
            "nullable": true
          },
          "submissions": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PensionV2_ProviderSyncRecordV2"
            },
            "nullable": true
          }
        },
        "additionalProperties": false,
        "description": "The answer to a send: what it decided for every scheme in the pay run,\nand the submissions the ledger now holds."
      },
      "PensionV2_SendToProviderResultV2ApiResponse": {
        "allOf": [
          {
            "$ref": "#/components/schemas/PensionV2_SendToProviderResultV2ResponseBody"
          }
        ],
        "description": "Deprecated: renamed to `SendToProviderResultV2ResponseBody`, which has the same fields and more.",
        "deprecated": true
      },
      "PensionV2_SendToProviderResultV2Content": {
        "allOf": [
          {
            "$ref": "#/components/schemas/PensionV2_SendToProviderResultV2ContentResponse"
          }
        ],
        "description": "Deprecated: renamed to `SendToProviderResultV2ContentResponse`, which has the same fields and more.",
        "deprecated": true
      },
      "PensionV2_SendToProviderResultV2ContentResponse": {
        "type": "object",
        "properties": {
          "data": {
            "$ref": "#/components/schemas/PensionV2_SendToProviderResultV2"
          },
          "metadata": {
            "$ref": "#/components/schemas/PensionV2_ContentMetadataResponse"
          }
        },
        "additionalProperties": false
      },
      "PensionV2_SendToProviderResultV2ResponseBody": {
        "required": [
          "message"
        ],
        "type": "object",
        "properties": {
          "message": {
            "$ref": "#/components/schemas/PensionV2_MessageWithTokenResponse"
          },
          "content": {
            "$ref": "#/components/schemas/PensionV2_SendToProviderResultV2ContentResponse"
          },
          "validationIssues": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PensionV2_ValidationIssue"
            },
            "nullable": true
          },
          "errors": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PensionV2_Error"
            },
            "description": "Deprecated: the same issues as `validationIssues` (`reasonText` is `reason`, `reasonId` is `reasonToken`, `reasonParameters` is `reasonTokenArguments`). Read `validationIssues`; this will be removed.",
            "nullable": true,
            "readOnly": true,
            "deprecated": true
          },
          "metadata": {
            "allOf": [
              {
                "$ref": "#/components/schemas/PensionV2_ContentMetadataResponse"
              }
            ],
            "description": "Deprecated: the same values as `content.metadata`. Read that; this will be removed.",
            "deprecated": true
          }
        },
        "additionalProperties": false,
        "description": "The response envelope every FlowPayroll API answers with: a `message`, the\n`content`, and any `validationIssues`. `errors` and the top-level\n`metadata` are deprecated copies of `validationIssues` and\n`content.metadata`, and will be removed."
      },
      "PensionV2_SendableSchemeV2": {
        "required": [
          "schemeId",
          "schemeName",
          "sendable"
        ],
        "type": "object",
        "properties": {
          "schemeId": {
            "type": "string",
            "nullable": true
          },
          "schemeName": {
            "type": "string",
            "nullable": true
          },
          "sendable": {
            "type": "boolean",
            "description": "True when a send would be attempted. False whenever it would not,\nwith reasonToken and reasonMessage saying why: the scheme delivers\nby export file, or its connection cannot be used yet."
          },
          "providerSlug": {
            "type": "string",
            "description": "The connected provider, or null when the scheme has no connection.",
            "nullable": true
          },
          "connectionId": {
            "type": "string",
            "nullable": true
          },
          "reasonToken": {
            "type": "string",
            "description": "Stable, provider-agnostic reason the scheme cannot be sent, or null\nwhen it can. `pension_scheme_not_connected` means it delivers\nby export file; `connection_not_callable` means its connection\nhas to be finished or repaired. Branch on this; use it as the i18n\nlookup key, and treat an unrecognised value as a generic reason,\nbecause the list grows.",
            "nullable": true
          },
          "reasonMessage": {
            "type": "string",
            "description": "Default English for reasonToken, safe to show a user as-is.",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "description": "A scheme in the pay run, and whether it can be sent to a pension\nprovider right now."
      },
      "PensionV2_SendableSchemeV2ListApiResponse": {
        "allOf": [
          {
            "$ref": "#/components/schemas/PensionV2_SendableSchemeV2ListResponseBody"
          }
        ],
        "description": "Deprecated: renamed to `SendableSchemeV2ListResponseBody`, which has the same fields and more.",
        "deprecated": true
      },
      "PensionV2_SendableSchemeV2ListContent": {
        "allOf": [
          {
            "$ref": "#/components/schemas/PensionV2_SendableSchemeV2ListContentResponse"
          }
        ],
        "description": "Deprecated: renamed to `SendableSchemeV2ListContentResponse`, which has the same fields and more.",
        "deprecated": true
      },
      "PensionV2_SendableSchemeV2ListContentResponse": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PensionV2_SendableSchemeV2"
            },
            "nullable": true
          },
          "metadata": {
            "$ref": "#/components/schemas/PensionV2_ContentMetadataResponse"
          }
        },
        "additionalProperties": false
      },
      "PensionV2_SendableSchemeV2ListResponseBody": {
        "required": [
          "message"
        ],
        "type": "object",
        "properties": {
          "message": {
            "$ref": "#/components/schemas/PensionV2_MessageWithTokenResponse"
          },
          "content": {
            "$ref": "#/components/schemas/PensionV2_SendableSchemeV2ListContentResponse"
          },
          "validationIssues": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PensionV2_ValidationIssue"
            },
            "nullable": true
          },
          "errors": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PensionV2_Error"
            },
            "description": "Deprecated: the same issues as `validationIssues` (`reasonText` is `reason`, `reasonId` is `reasonToken`, `reasonParameters` is `reasonTokenArguments`). Read `validationIssues`; this will be removed.",
            "nullable": true,
            "readOnly": true,
            "deprecated": true
          },
          "metadata": {
            "allOf": [
              {
                "$ref": "#/components/schemas/PensionV2_ContentMetadataResponse"
              }
            ],
            "description": "Deprecated: the same values as `content.metadata`. Read that; this will be removed.",
            "deprecated": true
          }
        },
        "additionalProperties": false,
        "description": "The response envelope every FlowPayroll API answers with: a `message`, the\n`content`, and any `validationIssues`. `errors` and the top-level\n`metadata` are deprecated copies of `validationIssues` and\n`content.metadata`, and will be removed."
      },
      "PensionV2_StringApiResponse": {
        "allOf": [
          {
            "$ref": "#/components/schemas/PensionV2_StringResponseBody"
          }
        ],
        "description": "Deprecated: renamed to `StringResponseBody`, which has the same fields and more.",
        "deprecated": true
      },
      "PensionV2_StringContent": {
        "allOf": [
          {
            "$ref": "#/components/schemas/PensionV2_StringContentResponse"
          }
        ],
        "description": "Deprecated: renamed to `StringContentResponse`, which has the same fields and more.",
        "deprecated": true
      },
      "PensionV2_StringContentResponse": {
        "type": "object",
        "properties": {
          "data": {
            "type": "string",
            "nullable": true
          },
          "metadata": {
            "$ref": "#/components/schemas/PensionV2_ContentMetadataResponse"
          }
        },
        "additionalProperties": false
      },
      "PensionV2_StringListApiResponse": {
        "allOf": [
          {
            "$ref": "#/components/schemas/PensionV2_StringListResponseBody"
          }
        ],
        "description": "Deprecated: renamed to `StringListResponseBody`, which has the same fields and more.",
        "deprecated": true
      },
      "PensionV2_StringListContent": {
        "allOf": [
          {
            "$ref": "#/components/schemas/PensionV2_StringListContentResponse"
          }
        ],
        "description": "Deprecated: renamed to `StringListContentResponse`, which has the same fields and more.",
        "deprecated": true
      },
      "PensionV2_StringListContentResponse": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "nullable": true
          },
          "metadata": {
            "$ref": "#/components/schemas/PensionV2_ContentMetadataResponse"
          }
        },
        "additionalProperties": false
      },
      "PensionV2_StringListResponseBody": {
        "required": [
          "message"
        ],
        "type": "object",
        "properties": {
          "message": {
            "$ref": "#/components/schemas/PensionV2_MessageWithTokenResponse"
          },
          "content": {
            "$ref": "#/components/schemas/PensionV2_StringListContentResponse"
          },
          "validationIssues": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PensionV2_ValidationIssue"
            },
            "nullable": true
          },
          "errors": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PensionV2_Error"
            },
            "description": "Deprecated: the same issues as `validationIssues` (`reasonText` is `reason`, `reasonId` is `reasonToken`, `reasonParameters` is `reasonTokenArguments`). Read `validationIssues`; this will be removed.",
            "nullable": true,
            "readOnly": true,
            "deprecated": true
          },
          "metadata": {
            "allOf": [
              {
                "$ref": "#/components/schemas/PensionV2_ContentMetadataResponse"
              }
            ],
            "description": "Deprecated: the same values as `content.metadata`. Read that; this will be removed.",
            "deprecated": true
          }
        },
        "additionalProperties": false,
        "description": "The response envelope every FlowPayroll API answers with: a `message`, the\n`content`, and any `validationIssues`. `errors` and the top-level\n`metadata` are deprecated copies of `validationIssues` and\n`content.metadata`, and will be removed."
      },
      "PensionV2_StringResponseBody": {
        "required": [
          "message"
        ],
        "type": "object",
        "properties": {
          "message": {
            "$ref": "#/components/schemas/PensionV2_MessageWithTokenResponse"
          },
          "content": {
            "$ref": "#/components/schemas/PensionV2_StringContentResponse"
          },
          "validationIssues": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PensionV2_ValidationIssue"
            },
            "nullable": true
          },
          "errors": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PensionV2_Error"
            },
            "description": "Deprecated: the same issues as `validationIssues` (`reasonText` is `reason`, `reasonId` is `reasonToken`, `reasonParameters` is `reasonTokenArguments`). Read `validationIssues`; this will be removed.",
            "nullable": true,
            "readOnly": true,
            "deprecated": true
          },
          "metadata": {
            "allOf": [
              {
                "$ref": "#/components/schemas/PensionV2_ContentMetadataResponse"
              }
            ],
            "description": "Deprecated: the same values as `content.metadata`. Read that; this will be removed.",
            "deprecated": true
          }
        },
        "additionalProperties": false,
        "description": "The response envelope every FlowPayroll API answers with: a `message`, the\n`content`, and any `validationIssues`. `errors` and the top-level\n`metadata` are deprecated copies of `validationIssues` and\n`content.metadata`, and will be removed."
      },
      "PensionV2_SubmitEmployeeAutoEnrolmentExemptionRequest": {
        "required": [
          "employeeId",
          "reason"
        ],
        "type": "object",
        "properties": {
          "employeeId": {
            "type": "string",
            "nullable": true
          },
          "reason": {
            "enum": [
              "Director",
              "OfficeHolder",
              "LlpMember",
              "TaxProtection",
              "CeasedMembershipWithinTwelveMonths",
              "WindingUpLumpSum",
              "NoticeOfTermination"
            ],
            "type": "string",
            "description": "One of The Pensions Regulator's exceptions to the employer duties.\nAnything outside the published values is refused with a 400 listing\nthe choices.",
            "nullable": true
          },
          "note": {
            "type": "string",
            "description": "Optional free-text evidence or context, e.g. which HMRC protection\ncertificate was seen.",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "description": "Sets (or replaces) an employee's auto-enrolment exemption. One exemption\nper employee: submitting again overwrites the reason and note."
      },
      "PensionV2_SubmitEmployeePensionAssociationRequest": {
        "required": [
          "employeeId",
          "pensionGroupId"
        ],
        "type": "object",
        "properties": {
          "employeeId": {
            "type": "string",
            "nullable": true
          },
          "pensionGroupId": {
            "type": "string",
            "nullable": true
          },
          "enrolmentDate": {
            "type": "string",
            "format": "date",
            "nullable": true
          },
          "recurringContributionOverride": {
            "$ref": "#/components/schemas/PensionV2_ContributionOverrideValuesModel"
          },
          "recurringAdditionalVoluntaryContribution": {
            "$ref": "#/components/schemas/PensionV2_RecurringAdditionalVoluntaryContributionModel"
          },
          "acknowledgeBelowAutoEnrolmentMinimum": {
            "type": "boolean",
            "description": "Confirms the contribution override is deliberately below the automatic\nenrolment minimum (8% total / 3% employer) or uses a fixed amount.\nWithout it such an override is rejected."
          },
          "effectiveFrom": {
            "type": "string",
            "description": "When this change takes effect (yyyy-MM-dd). A pay run uses whatever was in\nforce on its pay period end date, so pay runs whose pay period ends before\nthis date keep what they had. Without it, the change takes effect from the\nlatest pay run still open, so an earlier open pay run keeps what it had.",
            "format": "date",
            "nullable": true
          },
          "sendLetters": {
            "type": "boolean"
          },
          "enrolmentBasis": {
            "enum": [
              "Notice",
              "Contract",
              "Duty",
              "OptIn",
              "Join",
              "PreviousAutomaticEnrolment"
            ],
            "type": "string",
            "description": "Optional. What brought the employee into the pension. It decides the letter they are sent\nand whether they may opt out.\n`Duty`: the law requires you to put them in (the last pay run assessed them as an\neligible jobholder); automatic enrolment done by hand, with the right to opt out. Refused\nwhile their automatic enrolment is postponed, and once 12 months have passed since they left\nat their own request (until your next re-enrolment date).\n`Notice`: they asked in writing; their latest assessment decides whether it is an\nopt-in or a joining request. Refused when there is no current assessment (never assessed,\npostponed or exempt): send `OptIn` or `Join` instead. `Notice`,\n`OptIn` and `Join` are refused for an employee whose recorded exemption leaves no\nright to opt in or join: under notice of termination, a winding-up lump sum in the last 12\nmonths, a director without a contract of employment, or an office holder.\n`OptIn`: they asked in writing and earn more than the lower level of qualifying\nearnings for their pay period; they may opt out. Refused when the latest assessment says\notherwise.\n`Join`: they asked in writing and earn no more than that level; no right to opt out.\nRefused when the latest assessment says otherwise.\n`Contract`: you are enrolling them under their contract; no right to opt out. Refused\nfor an employee assessed as an eligible jobholder whose membership starts after that\nassessment's date: they are owed automatic enrolment, so send `Duty`.\n`PreviousAutomaticEnrolment`: they were enrolled automatically before this payroll\nassessed them (a member carried over from another payroll); they may opt out. Refused when\na pay run has assessed them on or before the enrolment date.\nSent on an existing membership it corrects how they joined. When omitted, a new membership\nis worked out from the assessment and an existing one keeps what is recorded.",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "PensionV2_SubmitEmployeePensionCalculationRequest": {
        "required": [
          "employeeAmount",
          "employeeId",
          "employerAmount",
          "externalReferenceId",
          "frequency",
          "nationalInsuranceNumber",
          "payrollConfigId",
          "pensionProviderId",
          "period",
          "periodEnd",
          "periodStart",
          "year"
        ],
        "type": "object",
        "properties": {
          "employeeId": {
            "type": "string",
            "nullable": true
          },
          "frequency": {
            "type": "string",
            "nullable": true
          },
          "year": {
            "type": "integer",
            "format": "int32"
          },
          "period": {
            "type": "integer",
            "format": "int32"
          },
          "payrollConfigId": {
            "type": "string",
            "nullable": true
          },
          "employeeAmount": {
            "type": "number",
            "format": "double"
          },
          "employerAmount": {
            "type": "number",
            "format": "double"
          },
          "periodStart": {
            "type": "string",
            "format": "date"
          },
          "periodEnd": {
            "type": "string",
            "format": "date"
          },
          "nationalInsuranceNumber": {
            "type": "string",
            "nullable": true
          },
          "externalReferenceId": {
            "type": "string",
            "nullable": true
          },
          "pensionProviderId": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "PensionV2_SubmitEmployeePostponementRequest": {
        "required": [
          "employeeId"
        ],
        "type": "object",
        "properties": {
          "employeeId": {
            "type": "string",
            "nullable": true
          },
          "startDateDefinition": {
            "$ref": "#/components/schemas/PensionV2_PostponementValueModel"
          },
          "eligibilityDateDefinition": {
            "$ref": "#/components/schemas/PensionV2_PostponementValueModel"
          }
        },
        "additionalProperties": false
      },
      "PensionV2_SubmitPensionGroupRequest": {
        "required": [
          "basis",
          "employeeFactor",
          "employerFactor",
          "name",
          "pensionSchemaId"
        ],
        "type": "object",
        "properties": {
          "pensionSchemaId": {
            "type": "string",
            "nullable": true
          },
          "name": {
            "type": "string",
            "nullable": true
          },
          "isDefault": {
            "type": "boolean"
          },
          "pensionType": {
            "enum": [
              "ReliefAtSource",
              "SalarySacrifice",
              "NetPayArrangement"
            ],
            "type": "string",
            "nullable": true
          },
          "isSalarySacrifice": {
            "type": "boolean",
            "description": "Deprecated: send `pensionType` instead. This is only consulted when `pensionType` is omitted, and cannot express `NetPayArrangement`.",
            "deprecated": true
          },
          "basis": {
            "enum": [
              "Pensionable",
              "QualifyingEarnings"
            ],
            "type": "string",
            "nullable": true
          },
          "employeeFactor": {
            "type": "number",
            "format": "float"
          },
          "employerFactor": {
            "type": "number",
            "format": "float"
          },
          "nationalInsuranceSavingsFactor": {
            "type": "number",
            "format": "float"
          },
          "contributionType": {
            "enum": [
              "Percentage",
              "FixedAmount"
            ],
            "type": "string",
            "nullable": true
          },
          "employeeFixedAmount": {
            "type": "number",
            "format": "double",
            "nullable": true
          },
          "employerFixedAmount": {
            "type": "number",
            "format": "double",
            "nullable": true
          },
          "externalReferenceId": {
            "type": "string",
            "nullable": true
          },
          "acknowledgeBelowAutoEnrolmentMinimum": {
            "type": "boolean",
            "description": "Confirms the group is deliberately below the automatic enrolment minimum\n(8% total / 3% employer) or uses fixed amounts, and will not be used for\nautomatic enrolment. Without it such a group is rejected."
          },
          "effectiveFrom": {
            "type": "string",
            "description": "When this change takes effect (yyyy-MM-dd). A pay run uses whatever was in\nforce on its pay period end date, so pay runs whose pay period ends before\nthis date keep what they had. Without it, the change takes effect from the\nlatest pay run still open, so an earlier open pay run keeps what it had.",
            "format": "date",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "PensionV2_SubmitPensionSchemeRequest": {
        "required": [
          "name",
          "pensionProviderId"
        ],
        "type": "object",
        "properties": {
          "pensionProviderId": {
            "type": "string",
            "nullable": true
          },
          "name": {
            "type": "string",
            "nullable": true
          },
          "paymentSource": {
            "type": "string",
            "nullable": true
          },
          "lastReEnrolmentDate": {
            "type": "string",
            "format": "date",
            "nullable": true
          },
          "dutyStartDate": {
            "type": "string",
            "format": "date",
            "nullable": true
          },
          "externalReferenceId": {
            "type": "string",
            "nullable": true
          },
          "contributionDueDateOffsetDays": {
            "type": "integer",
            "description": "How many days after an earnings period ends the contributions are due\nat this provider.\n            \n\nThe due date on a contribution schedule belongs to the provider,\nand it has to match what the provider holds or the submission is\nrefused. Once the provider is connected its own published schedule is\nused and this is ignored; set it when there is no connection, so the\nfile carries the agreed date rather than the date employees were\npaid.",
            "format": "int32",
            "nullable": true
          },
          "employeeIdentifierField": {
            "enum": [
              "NationalInsuranceNumber",
              "PayrollId",
              "EmployeeCode",
              "EmployeeId"
            ],
            "type": "string",
            "nullable": true
          },
          "optOutContactPoint": {
            "type": "string",
            "description": "Where this scheme's members get the form to leave the scheme (the opt-out notice), shown\nin every enrolment and re-enrolment letter (SI 2010/772 Schedule 2 para 10). A web address,\nphone number or both. Empty uses the provider's own route\n(`PensionProviderV2.optOutContactPoint`); when neither is set, letters that must state\nit are not sent. On an update, leaving it out keeps the stored value and an empty value\nclears it.",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "PensionV2_ValidationIssue": {
        "type": "object",
        "properties": {
          "field": {
            "type": "string",
            "nullable": true
          },
          "reason": {
            "type": "string",
            "nullable": true
          },
          "reasonToken": {
            "type": "string",
            "nullable": true
          },
          "reasonTokenArguments": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PensionV2_ValidationIssueArgument"
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "PensionV2_ValidationIssueArgument": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "nullable": true
          },
          "value": {
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Integrations_AccountingAccountResponse": {
        "type": "object",
        "properties": {
          "accountId": {
            "type": "string",
            "nullable": true
          },
          "code": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "type": {
            "type": "string"
          },
          "status": {
            "type": "string"
          },
          "description": {
            "type": "string",
            "nullable": true
          },
          "taxType": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Integrations_AccountingAccountResponseListContentResponse": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Integrations_AccountingAccountResponse"
            },
            "nullable": true
          },
          "metadata": {
            "$ref": "#/components/schemas/Integrations_ContentMetadataResponse"
          }
        },
        "additionalProperties": false
      },
      "Integrations_AccountingAccountResponseListResponseBody": {
        "type": "object",
        "properties": {
          "message": {
            "$ref": "#/components/schemas/Integrations_MessageWithTokenResponse"
          },
          "content": {
            "$ref": "#/components/schemas/Integrations_AccountingAccountResponseListContentResponse"
          },
          "validationIssues": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Integrations_ValidationIssue"
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Integrations_AccountingAddressPayload": {
        "type": "object",
        "properties": {
          "addressType": {
            "type": "string"
          },
          "addressLine1": {
            "type": "string",
            "nullable": true
          },
          "addressLine2": {
            "type": "string",
            "nullable": true
          },
          "city": {
            "type": "string",
            "nullable": true
          },
          "region": {
            "type": "string",
            "nullable": true
          },
          "postalCode": {
            "type": "string",
            "nullable": true
          },
          "country": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Integrations_AccountingAttachmentCountResponse": {
        "type": "object",
        "properties": {
          "externalId": {
            "type": "string"
          },
          "documentType": {
            "type": "string"
          },
          "count": {
            "type": "integer",
            "format": "int32"
          }
        },
        "additionalProperties": false
      },
      "Integrations_AccountingAttachmentCountResponseContentResponse": {
        "type": "object",
        "properties": {
          "data": {
            "$ref": "#/components/schemas/Integrations_AccountingAttachmentCountResponse"
          },
          "metadata": {
            "$ref": "#/components/schemas/Integrations_ContentMetadataResponse"
          }
        },
        "additionalProperties": false
      },
      "Integrations_AccountingAttachmentCountResponseResponseBody": {
        "type": "object",
        "properties": {
          "message": {
            "$ref": "#/components/schemas/Integrations_MessageWithTokenResponse"
          },
          "content": {
            "$ref": "#/components/schemas/Integrations_AccountingAttachmentCountResponseContentResponse"
          },
          "validationIssues": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Integrations_ValidationIssue"
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Integrations_AccountingContactPageResponse": {
        "type": "object",
        "properties": {
          "contacts": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Integrations_AccountingContactResponse"
            }
          },
          "hasMore": {
            "type": "boolean"
          }
        },
        "additionalProperties": false
      },
      "Integrations_AccountingContactPageResponseContentResponse": {
        "type": "object",
        "properties": {
          "data": {
            "$ref": "#/components/schemas/Integrations_AccountingContactPageResponse"
          },
          "metadata": {
            "$ref": "#/components/schemas/Integrations_ContentMetadataResponse"
          }
        },
        "additionalProperties": false
      },
      "Integrations_AccountingContactPageResponseResponseBody": {
        "type": "object",
        "properties": {
          "message": {
            "$ref": "#/components/schemas/Integrations_MessageWithTokenResponse"
          },
          "content": {
            "$ref": "#/components/schemas/Integrations_AccountingContactPageResponseContentResponse"
          },
          "validationIssues": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Integrations_ValidationIssue"
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Integrations_AccountingContactPersonPayload": {
        "type": "object",
        "properties": {
          "firstName": {
            "type": "string",
            "nullable": true
          },
          "lastName": {
            "type": "string",
            "nullable": true
          },
          "emailAddress": {
            "type": "string",
            "nullable": true
          },
          "includeInEmails": {
            "type": "boolean"
          }
        },
        "additionalProperties": false
      },
      "Integrations_AccountingContactResponse": {
        "type": "object",
        "properties": {
          "externalId": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "firstName": {
            "type": "string",
            "nullable": true
          },
          "lastName": {
            "type": "string",
            "nullable": true
          },
          "emailAddress": {
            "type": "string",
            "nullable": true
          },
          "taxNumber": {
            "type": "string",
            "nullable": true
          },
          "accountNumber": {
            "type": "string",
            "nullable": true
          },
          "companyNumber": {
            "type": "string",
            "nullable": true
          },
          "addresses": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Integrations_AccountingAddressPayload"
            },
            "nullable": true
          },
          "phones": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Integrations_AccountingPhonePayload"
            },
            "nullable": true
          },
          "contactPersons": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Integrations_AccountingContactPersonPayload"
            },
            "nullable": true
          },
          "paymentTerms": {
            "$ref": "#/components/schemas/Integrations_AccountingPaymentTermsPayload"
          }
        },
        "additionalProperties": false
      },
      "Integrations_AccountingDocumentPdfResponse": {
        "type": "object",
        "properties": {
          "externalId": {
            "type": "string"
          },
          "documentType": {
            "type": "string"
          },
          "contentType": {
            "type": "string"
          },
          "contentBase64": {
            "type": "string"
          }
        },
        "additionalProperties": false
      },
      "Integrations_AccountingDocumentPdfResponseContentResponse": {
        "type": "object",
        "properties": {
          "data": {
            "$ref": "#/components/schemas/Integrations_AccountingDocumentPdfResponse"
          },
          "metadata": {
            "$ref": "#/components/schemas/Integrations_ContentMetadataResponse"
          }
        },
        "additionalProperties": false
      },
      "Integrations_AccountingDocumentPdfResponseResponseBody": {
        "type": "object",
        "properties": {
          "message": {
            "$ref": "#/components/schemas/Integrations_MessageWithTokenResponse"
          },
          "content": {
            "$ref": "#/components/schemas/Integrations_AccountingDocumentPdfResponseContentResponse"
          },
          "validationIssues": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Integrations_ValidationIssue"
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Integrations_AccountingPaymentTermsPayload": {
        "type": "object",
        "properties": {
          "day": {
            "type": "integer",
            "format": "int32"
          },
          "basis": {
            "type": "string"
          }
        },
        "additionalProperties": false
      },
      "Integrations_AccountingPhonePayload": {
        "type": "object",
        "properties": {
          "phoneType": {
            "type": "string"
          },
          "number": {
            "type": "string",
            "nullable": true
          },
          "areaCode": {
            "type": "string",
            "nullable": true
          },
          "countryCode": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Integrations_AccountingTaxRateResponse": {
        "type": "object",
        "properties": {
          "code": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "status": {
            "type": "string",
            "nullable": true
          },
          "rate": {
            "type": "number",
            "format": "double",
            "nullable": true
          },
          "canApplyToRevenue": {
            "type": "boolean",
            "nullable": true
          },
          "canApplyToExpenses": {
            "type": "boolean",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Integrations_AccountingTaxRateResponseListContentResponse": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Integrations_AccountingTaxRateResponse"
            },
            "nullable": true
          },
          "metadata": {
            "$ref": "#/components/schemas/Integrations_ContentMetadataResponse"
          }
        },
        "additionalProperties": false
      },
      "Integrations_AccountingTaxRateResponseListResponseBody": {
        "type": "object",
        "properties": {
          "message": {
            "$ref": "#/components/schemas/Integrations_MessageWithTokenResponse"
          },
          "content": {
            "$ref": "#/components/schemas/Integrations_AccountingTaxRateResponseListContentResponse"
          },
          "validationIssues": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Integrations_ValidationIssue"
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Integrations_ApiErrorResponse": {
        "type": "object",
        "properties": {
          "message": {
            "$ref": "#/components/schemas/Integrations_MessageWithTokenResponse"
          },
          "validationIssues": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Integrations_ValidationIssue"
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Integrations_AuthoriseConnectionRequest": {
        "type": "object",
        "properties": {
          "redirectUri": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Integrations_AuthoriseConnectionResponse": {
        "type": "object",
        "properties": {
          "authorisationUrl": {
            "type": "string"
          },
          "state": {
            "type": "string"
          }
        },
        "additionalProperties": false
      },
      "Integrations_AuthoriseConnectionResponseContentResponse": {
        "type": "object",
        "properties": {
          "data": {
            "$ref": "#/components/schemas/Integrations_AuthoriseConnectionResponse"
          },
          "metadata": {
            "$ref": "#/components/schemas/Integrations_ContentMetadataResponse"
          }
        },
        "additionalProperties": false
      },
      "Integrations_AuthoriseConnectionResponseResponseBody": {
        "type": "object",
        "properties": {
          "message": {
            "$ref": "#/components/schemas/Integrations_MessageWithTokenResponse"
          },
          "content": {
            "$ref": "#/components/schemas/Integrations_AuthoriseConnectionResponseContentResponse"
          },
          "validationIssues": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Integrations_ValidationIssue"
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Integrations_BindingResponse": {
        "type": "object",
        "properties": {
          "consumer": {
            "type": "string"
          },
          "resourceType": {
            "type": "string"
          },
          "resourceId": {
            "type": "string"
          },
          "connectionId": {
            "type": "string"
          },
          "providerSlug": {
            "type": "string"
          },
          "createdBy": {
            "type": "string"
          },
          "createdDate": {
            "type": "string"
          }
        },
        "additionalProperties": false
      },
      "Integrations_BindingResponseContentResponse": {
        "type": "object",
        "properties": {
          "data": {
            "$ref": "#/components/schemas/Integrations_BindingResponse"
          },
          "metadata": {
            "$ref": "#/components/schemas/Integrations_ContentMetadataResponse"
          }
        },
        "additionalProperties": false
      },
      "Integrations_BindingResponseListContentResponse": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Integrations_BindingResponse"
            },
            "nullable": true
          },
          "metadata": {
            "$ref": "#/components/schemas/Integrations_ContentMetadataResponse"
          }
        },
        "additionalProperties": false
      },
      "Integrations_BindingResponseListResponseBody": {
        "type": "object",
        "properties": {
          "message": {
            "$ref": "#/components/schemas/Integrations_MessageWithTokenResponse"
          },
          "content": {
            "$ref": "#/components/schemas/Integrations_BindingResponseListContentResponse"
          },
          "validationIssues": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Integrations_ValidationIssue"
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Integrations_BindingResponseResponseBody": {
        "type": "object",
        "properties": {
          "message": {
            "$ref": "#/components/schemas/Integrations_MessageWithTokenResponse"
          },
          "content": {
            "$ref": "#/components/schemas/Integrations_BindingResponseContentResponse"
          },
          "validationIssues": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Integrations_ValidationIssue"
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Integrations_BooleanContentResponse": {
        "type": "object",
        "properties": {
          "data": {
            "type": "boolean"
          },
          "metadata": {
            "$ref": "#/components/schemas/Integrations_ContentMetadataResponse"
          }
        },
        "additionalProperties": false
      },
      "Integrations_BooleanResponseBody": {
        "type": "object",
        "properties": {
          "message": {
            "$ref": "#/components/schemas/Integrations_MessageWithTokenResponse"
          },
          "content": {
            "$ref": "#/components/schemas/Integrations_BooleanContentResponse"
          },
          "validationIssues": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Integrations_ValidationIssue"
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Integrations_ConnectionImportsResponse": {
        "type": "object",
        "properties": {
          "connectionId": {
            "type": "string"
          },
          "providerSlug": {
            "type": "string"
          },
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Integrations_ImportRequestItemResponse"
            }
          }
        },
        "additionalProperties": false
      },
      "Integrations_ConnectionImportsResponseContentResponse": {
        "type": "object",
        "properties": {
          "data": {
            "$ref": "#/components/schemas/Integrations_ConnectionImportsResponse"
          },
          "metadata": {
            "$ref": "#/components/schemas/Integrations_ContentMetadataResponse"
          }
        },
        "additionalProperties": false
      },
      "Integrations_ConnectionImportsResponseResponseBody": {
        "type": "object",
        "properties": {
          "message": {
            "$ref": "#/components/schemas/Integrations_MessageWithTokenResponse"
          },
          "content": {
            "$ref": "#/components/schemas/Integrations_ConnectionImportsResponseContentResponse"
          },
          "validationIssues": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Integrations_ValidationIssue"
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Integrations_ConnectionResponse": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "organisationId": {
            "type": "string"
          },
          "providerSlug": {
            "type": "string"
          },
          "displayName": {
            "type": "string"
          },
          "state": {
            "enum": [
              "None",
              "PendingAuth",
              "Authorised",
              "Callable",
              "Invalid",
              "Deauthorised"
            ],
            "type": "string"
          },
          "enabled": {
            "type": "boolean"
          },
          "externalTenantId": {
            "type": "string",
            "nullable": true
          },
          "externalTenantName": {
            "type": "string",
            "nullable": true
          },
          "externalEmployerReference": {
            "type": "string",
            "nullable": true
          },
          "tokenExpiresAt": {
            "type": "string",
            "nullable": true
          },
          "lastSuccessDate": {
            "type": "string",
            "nullable": true
          },
          "consecutiveFailures": {
            "type": "integer",
            "format": "int32"
          },
          "circuitOpenUntil": {
            "type": "string",
            "nullable": true
          },
          "boundResourceCount": {
            "type": "integer",
            "format": "int32"
          },
          "createdBy": {
            "type": "string"
          },
          "createdDate": {
            "type": "string"
          },
          "updatedBy": {
            "type": "string"
          },
          "updatedDate": {
            "type": "string"
          }
        },
        "additionalProperties": false
      },
      "Integrations_ConnectionResponseContentResponse": {
        "type": "object",
        "properties": {
          "data": {
            "$ref": "#/components/schemas/Integrations_ConnectionResponse"
          },
          "metadata": {
            "$ref": "#/components/schemas/Integrations_ContentMetadataResponse"
          }
        },
        "additionalProperties": false
      },
      "Integrations_ConnectionResponseListContentResponse": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Integrations_ConnectionResponse"
            },
            "nullable": true
          },
          "metadata": {
            "$ref": "#/components/schemas/Integrations_ContentMetadataResponse"
          }
        },
        "additionalProperties": false
      },
      "Integrations_ConnectionResponseListResponseBody": {
        "type": "object",
        "properties": {
          "message": {
            "$ref": "#/components/schemas/Integrations_MessageWithTokenResponse"
          },
          "content": {
            "$ref": "#/components/schemas/Integrations_ConnectionResponseListContentResponse"
          },
          "validationIssues": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Integrations_ValidationIssue"
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Integrations_ConnectionResponseResponseBody": {
        "type": "object",
        "properties": {
          "message": {
            "$ref": "#/components/schemas/Integrations_MessageWithTokenResponse"
          },
          "content": {
            "$ref": "#/components/schemas/Integrations_ConnectionResponseContentResponse"
          },
          "validationIssues": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Integrations_ValidationIssue"
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Integrations_ContentMetadataResponse": {
        "type": "object",
        "properties": {
          "dateFormat": {
            "type": "string"
          },
          "dateTimeFormat": {
            "type": "string"
          },
          "paginationToken": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Integrations_CreateConnectionRequest": {
        "required": [
          "providerSlug"
        ],
        "type": "object",
        "properties": {
          "providerSlug": {
            "minLength": 1,
            "type": "string"
          },
          "displayName": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Integrations_ExchangeAuthorisationCodeRequest": {
        "required": [
          "code",
          "state"
        ],
        "type": "object",
        "properties": {
          "code": {
            "minLength": 1,
            "type": "string"
          },
          "state": {
            "minLength": 1,
            "type": "string"
          }
        },
        "additionalProperties": false
      },
      "Integrations_ImportRequestItemResponse": {
        "type": "object",
        "properties": {
          "importType": {
            "type": "string"
          },
          "outcome": {
            "enum": [
              "None",
              "Fresh",
              "InFlight",
              "Requested",
              "Unavailable"
            ],
            "type": "string"
          },
          "operationId": {
            "type": "string",
            "nullable": true
          },
          "lastSuccessDate": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Integrations_ImportStateResponse": {
        "type": "object",
        "properties": {
          "connectionId": {
            "type": "string"
          },
          "providerSlug": {
            "type": "string"
          },
          "importType": {
            "type": "string"
          },
          "lastSuccessDate": {
            "type": "string",
            "nullable": true
          },
          "lastAttemptDate": {
            "type": "string",
            "nullable": true
          },
          "syncedThroughDate": {
            "type": "string",
            "nullable": true
          },
          "inFlightOperationId": {
            "type": "string",
            "nullable": true
          },
          "nextDueDate": {
            "type": "string"
          },
          "consecutiveFailures": {
            "type": "integer",
            "format": "int32"
          },
          "lastErrorToken": {
            "type": "string",
            "description": "Stable, provider-agnostic reason code. Branch on this rather than on the accompanying message, which is default English intended for display and may be reworded. Use the token as an i18n lookup key.\n\n- `provider_rate_limited`: The provider asked us to slow down. Sending carries on automatically in a few minutes.\n- `provider_authentication_failed`: The provider rejected the sign-in details. Re-enter them on the connection, then try again.\n- `provider_validation_failed`: The provider rejected the submission because some of the details did not pass its checks.\n- `submission_incomplete`: Nothing was sent: some details the provider needs are missing. Fix the ones listed, then send again.\n- `provider_unavailable`: The provider could not be reached. It is retried automatically.\n- `connection_not_callable`: This connection is not ready to use. Finish connecting it, then test it, before sending.\n- `connection_circuit_open`: Sending is paused after repeated failures from the provider, and starts again automatically in about ten minutes.\n- `provider_account_locked`: The provider has locked this account. Sign in to the provider directly to unlock it, then test the connection.\n- `provider_partial_failure`: The provider accepted some of the workers and rejected the rest.\n- `provider_capability_unsupported`: The connected provider does not support this kind of submission.\n- `provider_circuit_open`: The provider is not responding for anyone right now. Sending is paused and starts again automatically once it recovers.\n- `provider_result_overdue`: The provider accepted this but has not returned a result in two days. Check it with the provider, then retry or cancel.\n- `provider_call_failed`: The provider did not complete the request.\n\nTreat an unrecognised token as a generic failure: the list grows.",
            "nullable": true
          },
          "lastErrorMessage": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Integrations_ImportStateResponseListContentResponse": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Integrations_ImportStateResponse"
            },
            "nullable": true
          },
          "metadata": {
            "$ref": "#/components/schemas/Integrations_ContentMetadataResponse"
          }
        },
        "additionalProperties": false
      },
      "Integrations_ImportStateResponseListResponseBody": {
        "type": "object",
        "properties": {
          "message": {
            "$ref": "#/components/schemas/Integrations_MessageWithTokenResponse"
          },
          "content": {
            "$ref": "#/components/schemas/Integrations_ImportStateResponseListContentResponse"
          },
          "validationIssues": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Integrations_ValidationIssue"
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Integrations_MessageWithTokenResponse": {
        "type": "object",
        "properties": {
          "text": {
            "type": "string"
          },
          "token": {
            "type": "string"
          },
          "tokenArguments": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Integrations_ValidationIssueArgument"
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Integrations_ObjectContentResponse": {
        "type": "object",
        "properties": {
          "data": {
            "nullable": true
          },
          "metadata": {
            "$ref": "#/components/schemas/Integrations_ContentMetadataResponse"
          }
        },
        "additionalProperties": false
      },
      "Integrations_ObjectResponseBody": {
        "type": "object",
        "properties": {
          "message": {
            "$ref": "#/components/schemas/Integrations_MessageWithTokenResponse"
          },
          "content": {
            "$ref": "#/components/schemas/Integrations_ObjectContentResponse"
          },
          "validationIssues": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Integrations_ValidationIssue"
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Integrations_OperationResponse": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "organisationId": {
            "type": "string"
          },
          "connectionId": {
            "type": "string"
          },
          "providerSlug": {
            "type": "string"
          },
          "operationType": {
            "type": "string"
          },
          "status": {
            "enum": [
              "None",
              "Pending",
              "AwaitingProvider",
              "Succeeded",
              "Failed",
              "NeedsAttention",
              "Cancelled"
            ],
            "type": "string"
          },
          "attempts": {
            "type": "integer",
            "format": "int32"
          },
          "nextAttemptDate": {
            "type": "string",
            "description": "When we next TRY THE PROVIDER AGAIN, because we could not reach it. Distinct from `nextCheckDate`: that one is asking a provider that already has the submission whether it is done, this one is trying to hand it over at all.\n\nThe gaps widen deliberately — the first after 5 seconds, each wait about half again longer than the last, none longer than 30 minutes — because hammering a provider that is down achieves nothing. After `maxAttempts` the operation stops and waits for a person (status NeedsAttention), which is roughly 2.7 hours from the first failure. Read `attempts` with `maxAttempts` to show how much road is left rather than only when the next try is.",
            "nullable": true
          },
          "providerReference": {
            "type": "string",
            "nullable": true
          },
          "lastErrorToken": {
            "type": "string",
            "description": "Stable, provider-agnostic reason code. Branch on this rather than on the accompanying message, which is default English intended for display and may be reworded. Use the token as an i18n lookup key.\n\n- `provider_rate_limited`: The provider asked us to slow down. Sending carries on automatically in a few minutes.\n- `provider_authentication_failed`: The provider rejected the sign-in details. Re-enter them on the connection, then try again.\n- `provider_validation_failed`: The provider rejected the submission because some of the details did not pass its checks.\n- `submission_incomplete`: Nothing was sent: some details the provider needs are missing. Fix the ones listed, then send again.\n- `provider_unavailable`: The provider could not be reached. It is retried automatically.\n- `connection_not_callable`: This connection is not ready to use. Finish connecting it, then test it, before sending.\n- `connection_circuit_open`: Sending is paused after repeated failures from the provider, and starts again automatically in about ten minutes.\n- `provider_account_locked`: The provider has locked this account. Sign in to the provider directly to unlock it, then test the connection.\n- `provider_partial_failure`: The provider accepted some of the workers and rejected the rest.\n- `provider_capability_unsupported`: The connected provider does not support this kind of submission.\n- `provider_circuit_open`: The provider is not responding for anyone right now. Sending is paused and starts again automatically once it recovers.\n- `provider_result_overdue`: The provider accepted this but has not returned a result in two days. Check it with the provider, then retry or cancel.\n- `provider_call_failed`: The provider did not complete the request.\n\nTreat an unrecognised token as a generic failure: the list grows.",
            "nullable": true
          },
          "requestedByService": {
            "type": "string"
          },
          "completedDate": {
            "type": "string",
            "nullable": true
          },
          "createdDate": {
            "type": "string"
          },
          "updatedDate": {
            "type": "string"
          },
          "expectedReadyDate": {
            "type": "string",
            "description": "When the PROVIDER said it would be done, in its own words (NEST sends this as X-EXP-TAT). Null when it gave no estimate.\n\nShow it, but do not wait it out or count it as a deadline: providers pad heavily, and NEST has quoted three hours on work it finished in five minutes. Its purpose is to let somebody tell a slow provider from a stuck one.",
            "nullable": true
          },
          "nextCheckDate": {
            "type": "string",
            "description": "When WE next ask the provider for a result. Always set while the provider owes us one; null once it does not.\n\nThis is the moment the record can next change, so it is what a waiting screen should count down to. Checks start soon after the submission and step back as one genuinely takes longer: the first after 5 seconds, each wait about half again longer than the last, none longer than 5 minutes. Read this field each time rather than assuming a fixed interval. The ladder applies whether or not the provider gave an estimate; an estimate can only bring a check forward, never push it back.\n\nDeliberately distinct from `expectedReadyDate`: that one is the provider's claim about itself, this one is our schedule.",
            "nullable": true
          },
          "maxAttempts": {
            "type": "integer",
            "format": "int32"
          },
          "lastErrorMessage": {
            "type": "string",
            "nullable": true
          },
          "importType": {
            "type": "string",
            "nullable": true
          },
          "lane": {
            "enum": [
              "None",
              "Interactive",
              "Background"
            ],
            "type": "string"
          },
          "issues": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Integrations_ProviderIssueResponse"
            },
            "nullable": true
          },
          "issueCount": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Integrations_OperationResponseContentResponse": {
        "type": "object",
        "properties": {
          "data": {
            "$ref": "#/components/schemas/Integrations_OperationResponse"
          },
          "metadata": {
            "$ref": "#/components/schemas/Integrations_ContentMetadataResponse"
          }
        },
        "additionalProperties": false
      },
      "Integrations_OperationResponseListPage": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Integrations_OperationResponse"
            }
          },
          "nextPaginationToken": {
            "type": "string",
            "description": "Cursor for the next page, or null when the listing is complete. IMPORTANT: keep following this token while it is non-null, even when `items` comes back empty. An empty page does NOT mean the end of the list — a filtered query can evaluate a full page of non-matching rows and return none of them, with more matches behind the cursor. Stopping on an empty page silently skips those rows. Tokens are opaque: pass them back unmodified and do not store them long-term.",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Integrations_OperationResponseListPageContentResponse": {
        "type": "object",
        "properties": {
          "data": {
            "$ref": "#/components/schemas/Integrations_OperationResponseListPage"
          },
          "metadata": {
            "$ref": "#/components/schemas/Integrations_ContentMetadataResponse"
          }
        },
        "additionalProperties": false
      },
      "Integrations_OperationResponseListPageResponseBody": {
        "type": "object",
        "properties": {
          "message": {
            "$ref": "#/components/schemas/Integrations_MessageWithTokenResponse"
          },
          "content": {
            "$ref": "#/components/schemas/Integrations_OperationResponseListPageContentResponse"
          },
          "validationIssues": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Integrations_ValidationIssue"
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Integrations_OperationResponseResponseBody": {
        "type": "object",
        "properties": {
          "message": {
            "$ref": "#/components/schemas/Integrations_MessageWithTokenResponse"
          },
          "content": {
            "$ref": "#/components/schemas/Integrations_OperationResponseContentResponse"
          },
          "validationIssues": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Integrations_ValidationIssue"
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Integrations_PensionSetupGroupResponse": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string"
          },
          "frequency": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Integrations_PensionSetupPaymentSourceResponse": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string"
          },
          "mandateStatus": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Integrations_PensionSetupResponse": {
        "type": "object",
        "properties": {
          "status": {
            "type": "string"
          },
          "groups": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Integrations_PensionSetupGroupResponse"
            }
          },
          "paymentSources": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Integrations_PensionSetupPaymentSourceResponse"
            }
          },
          "retrievedAt": {
            "type": "string",
            "nullable": true
          },
          "expectedReadyDate": {
            "type": "string",
            "description": "When the PROVIDER said it would be done, in its own words (NEST sends this as X-EXP-TAT). Null when it gave no estimate.\n\nShow it, but do not wait it out or count it as a deadline: providers pad heavily, and NEST has quoted three hours on work it finished in five minutes. Its purpose is to let somebody tell a slow provider from a stuck one.",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Integrations_PensionSetupResponseContentResponse": {
        "type": "object",
        "properties": {
          "data": {
            "$ref": "#/components/schemas/Integrations_PensionSetupResponse"
          },
          "metadata": {
            "$ref": "#/components/schemas/Integrations_ContentMetadataResponse"
          }
        },
        "additionalProperties": false
      },
      "Integrations_PensionSetupResponseResponseBody": {
        "type": "object",
        "properties": {
          "message": {
            "$ref": "#/components/schemas/Integrations_MessageWithTokenResponse"
          },
          "content": {
            "$ref": "#/components/schemas/Integrations_PensionSetupResponseContentResponse"
          },
          "validationIssues": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Integrations_ValidationIssue"
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Integrations_ProviderIssueResponse": {
        "type": "object",
        "properties": {
          "reference": {
            "type": "string",
            "nullable": true
          },
          "code": {
            "type": "string",
            "nullable": true
          },
          "message": {
            "type": "string"
          },
          "noActionNeeded": {
            "type": "boolean"
          }
        },
        "additionalProperties": false
      },
      "Integrations_ProviderResponse": {
        "type": "object",
        "properties": {
          "slug": {
            "type": "string"
          },
          "displayName": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "category": {
            "enum": [
              "None",
              "Accounting",
              "Pension",
              "Payments",
              "Messaging"
            ],
            "type": "string"
          },
          "authMethod": {
            "enum": [
              "None",
              "OAuthAuthorisationCode",
              "BasicCredentials"
            ],
            "type": "string"
          },
          "catalogueStatus": {
            "enum": [
              "None",
              "Available",
              "Beta",
              "ComingSoon"
            ],
            "type": "string"
          },
          "capabilities": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "requiredCredentialFields": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "importTypes": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "rateLimitPerMinute": {
            "type": "integer",
            "format": "int32"
          },
          "rateLimitPerDay": {
            "type": "integer",
            "format": "int32"
          },
          "supportsDraftJournals": {
            "type": "boolean"
          },
          "maxAttachmentsPerDocument": {
            "type": "integer",
            "format": "int32"
          },
          "maxContactPersons": {
            "type": "integer",
            "format": "int32"
          }
        },
        "additionalProperties": false
      },
      "Integrations_ProviderResponseContentResponse": {
        "type": "object",
        "properties": {
          "data": {
            "$ref": "#/components/schemas/Integrations_ProviderResponse"
          },
          "metadata": {
            "$ref": "#/components/schemas/Integrations_ContentMetadataResponse"
          }
        },
        "additionalProperties": false
      },
      "Integrations_ProviderResponseListContentResponse": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Integrations_ProviderResponse"
            },
            "nullable": true
          },
          "metadata": {
            "$ref": "#/components/schemas/Integrations_ContentMetadataResponse"
          }
        },
        "additionalProperties": false
      },
      "Integrations_ProviderResponseListResponseBody": {
        "type": "object",
        "properties": {
          "message": {
            "$ref": "#/components/schemas/Integrations_MessageWithTokenResponse"
          },
          "content": {
            "$ref": "#/components/schemas/Integrations_ProviderResponseListContentResponse"
          },
          "validationIssues": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Integrations_ValidationIssue"
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Integrations_ProviderResponseResponseBody": {
        "type": "object",
        "properties": {
          "message": {
            "$ref": "#/components/schemas/Integrations_MessageWithTokenResponse"
          },
          "content": {
            "$ref": "#/components/schemas/Integrations_ProviderResponseContentResponse"
          },
          "validationIssues": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Integrations_ValidationIssue"
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Integrations_PutBindingRequest": {
        "required": [
          "connectionId"
        ],
        "type": "object",
        "properties": {
          "connectionId": {
            "minLength": 1,
            "type": "string"
          }
        },
        "additionalProperties": false
      },
      "Integrations_RequestConnectionImportsRequest": {
        "type": "object",
        "properties": {
          "types": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "nullable": true
          },
          "maxStalenessMinutes": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Integrations_SelectTenantRequest": {
        "required": [
          "tenantId"
        ],
        "type": "object",
        "properties": {
          "tenantId": {
            "minLength": 1,
            "type": "string"
          }
        },
        "additionalProperties": false
      },
      "Integrations_SetBasicCredentialsRequest": {
        "required": [
          "password",
          "username"
        ],
        "type": "object",
        "properties": {
          "username": {
            "minLength": 1,
            "type": "string"
          },
          "password": {
            "minLength": 1,
            "type": "string"
          },
          "employerReference": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Integrations_SyncSessionItemResponse": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string"
          },
          "status": {
            "enum": [
              "None",
              "Pending",
              "AwaitingProvider",
              "Succeeded",
              "Failed",
              "NeedsAttention",
              "Cancelled"
            ],
            "type": "string"
          },
          "itemCount": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "errorToken": {
            "type": "string",
            "description": "Stable, provider-agnostic reason code. Branch on this rather than on the accompanying message, which is default English intended for display and may be reworded. Use the token as an i18n lookup key.\n\n- `provider_rate_limited`: The provider asked us to slow down. Sending carries on automatically in a few minutes.\n- `provider_authentication_failed`: The provider rejected the sign-in details. Re-enter them on the connection, then try again.\n- `provider_validation_failed`: The provider rejected the submission because some of the details did not pass its checks.\n- `submission_incomplete`: Nothing was sent: some details the provider needs are missing. Fix the ones listed, then send again.\n- `provider_unavailable`: The provider could not be reached. It is retried automatically.\n- `connection_not_callable`: This connection is not ready to use. Finish connecting it, then test it, before sending.\n- `connection_circuit_open`: Sending is paused after repeated failures from the provider, and starts again automatically in about ten minutes.\n- `provider_account_locked`: The provider has locked this account. Sign in to the provider directly to unlock it, then test the connection.\n- `provider_partial_failure`: The provider accepted some of the workers and rejected the rest.\n- `provider_capability_unsupported`: The connected provider does not support this kind of submission.\n- `provider_circuit_open`: The provider is not responding for anyone right now. Sending is paused and starts again automatically once it recovers.\n- `provider_result_overdue`: The provider accepted this but has not returned a result in two days. Check it with the provider, then retry or cancel.\n- `provider_call_failed`: The provider did not complete the request.\n\nTreat an unrecognised token as a generic failure: the list grows.",
            "nullable": true
          },
          "errorMessage": {
            "type": "string",
            "nullable": true
          },
          "startedDate": {
            "type": "string",
            "nullable": true
          },
          "nextCheckDate": {
            "type": "string",
            "description": "When WE next ask the provider for a result. Always set while the provider owes us one; null once it does not.\n\nThis is the moment the record can next change, so it is what a waiting screen should count down to. Checks start soon after the submission and step back as one genuinely takes longer: the first after 5 seconds, each wait about half again longer than the last, none longer than 5 minutes. Read this field each time rather than assuming a fixed interval. The ladder applies whether or not the provider gave an estimate; an estimate can only bring a check forward, never push it back.\n\nDeliberately distinct from `expectedReadyDate`: that one is the provider's claim about itself, this one is our schedule.",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Integrations_SyncSessionResponse": {
        "type": "object",
        "properties": {
          "sessionId": {
            "type": "string"
          },
          "startedDate": {
            "type": "string"
          },
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Integrations_SyncSessionItemResponse"
            }
          }
        },
        "additionalProperties": false
      },
      "Integrations_SyncSessionResponseContentResponse": {
        "type": "object",
        "properties": {
          "data": {
            "$ref": "#/components/schemas/Integrations_SyncSessionResponse"
          },
          "metadata": {
            "$ref": "#/components/schemas/Integrations_ContentMetadataResponse"
          }
        },
        "additionalProperties": false
      },
      "Integrations_SyncSessionResponseResponseBody": {
        "type": "object",
        "properties": {
          "message": {
            "$ref": "#/components/schemas/Integrations_MessageWithTokenResponse"
          },
          "content": {
            "$ref": "#/components/schemas/Integrations_SyncSessionResponseContentResponse"
          },
          "validationIssues": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Integrations_ValidationIssue"
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Integrations_TenantResponse": {
        "type": "object",
        "properties": {
          "tenantId": {
            "type": "string"
          },
          "tenantName": {
            "type": "string"
          },
          "tenantType": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Integrations_TenantResponseListContentResponse": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Integrations_TenantResponse"
            },
            "nullable": true
          },
          "metadata": {
            "$ref": "#/components/schemas/Integrations_ContentMetadataResponse"
          }
        },
        "additionalProperties": false
      },
      "Integrations_TenantResponseListResponseBody": {
        "type": "object",
        "properties": {
          "message": {
            "$ref": "#/components/schemas/Integrations_MessageWithTokenResponse"
          },
          "content": {
            "$ref": "#/components/schemas/Integrations_TenantResponseListContentResponse"
          },
          "validationIssues": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Integrations_ValidationIssue"
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Integrations_TestConnectionResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "messageToken": {
            "type": "string",
            "description": "Stable, provider-agnostic reason code. Branch on this rather than on the accompanying message, which is default English intended for display and may be reworded. Use the token as an i18n lookup key.\n\n- `provider_rate_limited`: The provider asked us to slow down. Sending carries on automatically in a few minutes.\n- `provider_authentication_failed`: The provider rejected the sign-in details. Re-enter them on the connection, then try again.\n- `provider_validation_failed`: The provider rejected the submission because some of the details did not pass its checks.\n- `submission_incomplete`: Nothing was sent: some details the provider needs are missing. Fix the ones listed, then send again.\n- `provider_unavailable`: The provider could not be reached. It is retried automatically.\n- `connection_not_callable`: This connection is not ready to use. Finish connecting it, then test it, before sending.\n- `connection_circuit_open`: Sending is paused after repeated failures from the provider, and starts again automatically in about ten minutes.\n- `provider_account_locked`: The provider has locked this account. Sign in to the provider directly to unlock it, then test the connection.\n- `provider_partial_failure`: The provider accepted some of the workers and rejected the rest.\n- `provider_capability_unsupported`: The connected provider does not support this kind of submission.\n- `provider_circuit_open`: The provider is not responding for anyone right now. Sending is paused and starts again automatically once it recovers.\n- `provider_result_overdue`: The provider accepted this but has not returned a result in two days. Check it with the provider, then retry or cancel.\n- `provider_call_failed`: The provider did not complete the request.\n\nTreat an unrecognised token as a generic failure: the list grows.",
            "nullable": true
          },
          "message": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Integrations_TestConnectionResponseContentResponse": {
        "type": "object",
        "properties": {
          "data": {
            "$ref": "#/components/schemas/Integrations_TestConnectionResponse"
          },
          "metadata": {
            "$ref": "#/components/schemas/Integrations_ContentMetadataResponse"
          }
        },
        "additionalProperties": false
      },
      "Integrations_TestConnectionResponseResponseBody": {
        "type": "object",
        "properties": {
          "message": {
            "$ref": "#/components/schemas/Integrations_MessageWithTokenResponse"
          },
          "content": {
            "$ref": "#/components/schemas/Integrations_TestConnectionResponseContentResponse"
          },
          "validationIssues": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Integrations_ValidationIssue"
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Integrations_TrackingCategoryResponse": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "status": {
            "type": "string",
            "nullable": true
          },
          "options": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Integrations_TrackingOptionResponse"
            }
          }
        },
        "additionalProperties": false
      },
      "Integrations_TrackingCategoryResponseListContentResponse": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Integrations_TrackingCategoryResponse"
            },
            "nullable": true
          },
          "metadata": {
            "$ref": "#/components/schemas/Integrations_ContentMetadataResponse"
          }
        },
        "additionalProperties": false
      },
      "Integrations_TrackingCategoryResponseListResponseBody": {
        "type": "object",
        "properties": {
          "message": {
            "$ref": "#/components/schemas/Integrations_MessageWithTokenResponse"
          },
          "content": {
            "$ref": "#/components/schemas/Integrations_TrackingCategoryResponseListContentResponse"
          },
          "validationIssues": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Integrations_ValidationIssue"
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Integrations_TrackingOptionResponse": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "status": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Integrations_UpdateConnectionRequest": {
        "type": "object",
        "properties": {
          "displayName": {
            "type": "string",
            "nullable": true
          },
          "enabled": {
            "type": "boolean",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Integrations_ValidationIssue": {
        "type": "object",
        "properties": {
          "field": {
            "type": "string"
          },
          "reason": {
            "type": "string"
          },
          "reasonToken": {
            "type": "string"
          },
          "reasonTokenArguments": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Integrations_ValidationIssueArgument"
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Integrations_ValidationIssueArgument": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string"
          },
          "value": {
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Recurring_ApiErrorResponse": {
        "type": "object",
        "properties": {
          "message": {
            "$ref": "#/components/schemas/Recurring_MessageWithTokenResponse"
          },
          "validationIssues": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Recurring_ValidationIssue"
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Recurring_ContentMetadataResponse": {
        "type": "object",
        "properties": {
          "dateFormat": {
            "type": "string"
          },
          "dateTimeFormat": {
            "type": "string"
          },
          "paginationToken": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Recurring_ContentResponse_List_Int32": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "type": "integer",
              "format": "int32"
            },
            "nullable": true
          },
          "metadata": {
            "$ref": "#/components/schemas/Recurring_ContentMetadataResponse"
          }
        },
        "additionalProperties": false
      },
      "Recurring_ContentResponse_List_RecurringLineItemPeriodResponse": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Recurring_RecurringLineItemPeriodResponse"
            },
            "nullable": true
          },
          "metadata": {
            "$ref": "#/components/schemas/Recurring_ContentMetadataResponse"
          }
        },
        "additionalProperties": false
      },
      "Recurring_ContentResponse_List_RecurringLineItemResponse": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Recurring_RecurringLineItemResponse"
            },
            "nullable": true
          },
          "metadata": {
            "$ref": "#/components/schemas/Recurring_ContentMetadataResponse"
          }
        },
        "additionalProperties": false
      },
      "Recurring_ContentResponse_Object": {
        "type": "object",
        "properties": {
          "data": {},
          "metadata": {
            "$ref": "#/components/schemas/Recurring_ContentMetadataResponse"
          }
        },
        "additionalProperties": false
      },
      "Recurring_ContentResponse_RecurringLineItemPeriodResponse": {
        "type": "object",
        "properties": {
          "data": {
            "$ref": "#/components/schemas/Recurring_RecurringLineItemPeriodResponse"
          },
          "metadata": {
            "$ref": "#/components/schemas/Recurring_ContentMetadataResponse"
          }
        },
        "additionalProperties": false
      },
      "Recurring_ContentResponse_RecurringLineItemResponse": {
        "type": "object",
        "properties": {
          "data": {
            "$ref": "#/components/schemas/Recurring_RecurringLineItemResponse"
          },
          "metadata": {
            "$ref": "#/components/schemas/Recurring_ContentMetadataResponse"
          }
        },
        "additionalProperties": false
      },
      "Recurring_CreateRecurringLineItemRequest": {
        "type": "object",
        "properties": {
          "employeeId": {
            "type": "string"
          },
          "payElementId": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "mode": {
            "enum": [
              "DateRange",
              "Balance"
            ],
            "type": "string"
          },
          "startDate": {
            "type": "string",
            "format": "date"
          },
          "endDate": {
            "type": "string",
            "format": "date",
            "nullable": true
          },
          "amountPerPeriod": {
            "type": "number",
            "format": "double"
          },
          "balanceTarget": {
            "type": "number",
            "format": "double",
            "nullable": true
          },
          "openingBalance": {
            "type": "number",
            "format": "double",
            "nullable": true
          },
          "unitName": {
            "type": "string"
          },
          "unitType": {
            "type": "string",
            "nullable": true
          },
          "units": {
            "type": "number",
            "format": "double"
          },
          "payRate": {
            "type": "number",
            "format": "double"
          },
          "protectedEarnings": {
            "$ref": "#/components/schemas/Recurring_ProtectedEarnings"
          },
          "notes": {
            "type": "string",
            "nullable": true
          },
          "shortfallBehaviour": {
            "enum": [
              "Skip",
              "CarryForward"
            ],
            "type": "string",
            "nullable": true
          },
          "shortfallCarryCapMultiplier": {
            "type": "number",
            "format": "double",
            "nullable": true
          },
          "clientId": {
            "type": "string",
            "nullable": true
          },
          "poNumber": {
            "type": "string",
            "nullable": true
          },
          "chargeRate": {
            "type": "number",
            "format": "double",
            "nullable": true
          },
          "chargeUnits": {
            "type": "number",
            "format": "double",
            "nullable": true
          },
          "chargeDescription": {
            "type": "string",
            "nullable": true
          },
          "tags": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Recurring_TagDto"
            },
            "nullable": true
          },
          "paymentDetails": {
            "$ref": "#/components/schemas/Recurring_PaymentDetailsDto"
          }
        },
        "additionalProperties": false
      },
      "Recurring_EditPeriodRequest": {
        "type": "object",
        "properties": {
          "amount": {
            "type": "number",
            "format": "double"
          }
        },
        "additionalProperties": false
      },
      "Recurring_MessageWithTokenResponse": {
        "type": "object",
        "properties": {
          "text": {
            "type": "string"
          },
          "token": {
            "type": "string"
          },
          "tokenArguments": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Recurring_ValidationIssueArgument"
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Recurring_PaymentDetailsDto": {
        "type": "object",
        "properties": {
          "accountName": {
            "type": "string",
            "nullable": true
          },
          "accountNumber": {
            "type": "string",
            "nullable": true
          },
          "sortCode": {
            "type": "string",
            "nullable": true
          },
          "paymentReference": {
            "type": "string",
            "nullable": true
          },
          "paymentCategory": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Recurring_ProtectedEarnings": {
        "type": "object",
        "properties": {
          "setting": {
            "enum": [
              "None",
              "FixedAmount",
              "SixtyPercentOfNet",
              "CustomPercentage",
              "NoNegativeNet"
            ],
            "type": "string"
          },
          "amount": {
            "type": "number",
            "format": "double",
            "nullable": true
          },
          "percentage": {
            "type": "number",
            "format": "double",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Recurring_RecurringLineItemPeriodResponse": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "recurringLineItemId": {
            "type": "string"
          },
          "lineItemSequence": {
            "type": "integer",
            "format": "int32"
          },
          "payPeriodStartDate": {
            "type": "string",
            "format": "date"
          },
          "payPeriodEndDate": {
            "type": "string",
            "format": "date"
          },
          "taxYear": {
            "type": "integer",
            "format": "int32"
          },
          "taxYearPeriod": {
            "type": "integer",
            "format": "int32"
          },
          "payrollConfigId": {
            "type": "string"
          },
          "payFrequency": {
            "type": "string"
          },
          "originalValue": {
            "type": "number",
            "format": "double"
          },
          "actualDeductedAmount": {
            "type": "number",
            "format": "double"
          },
          "shortfallAmount": {
            "type": "number",
            "format": "double"
          },
          "balanceRemainingAfter": {
            "type": "number",
            "format": "double",
            "nullable": true
          },
          "paidAmount": {
            "type": "number",
            "format": "double"
          },
          "status": {
            "enum": [
              "Skipped",
              "Pending",
              "Paid",
              "PartiallyPaid"
            ],
            "type": "string"
          },
          "skipReasonCode": {
            "enum": [
              "SchedulePaused",
              "ScheduleStopped",
              "ScheduleChanged",
              "BeforeScheduleStartDate",
              "PastScheduleEndDate",
              "RemovedFromPayRunByUser",
              "InsufficientNetPay",
              "ProtectedEarningsLimit",
              "ManuallySkippedByUser",
              "ScheduleCompleted",
              "NothingToRecoverThisPeriod"
            ],
            "type": "string",
            "nullable": true
          },
          "skipReason": {
            "type": "string",
            "nullable": true
          },
          "neoPayrollLineItemId": {
            "type": "string",
            "nullable": true
          },
          "createdDate": {
            "type": "string"
          },
          "createdBy": {
            "type": "string"
          },
          "updatedDate": {
            "type": "string"
          },
          "updatedBy": {
            "type": "string"
          }
        },
        "additionalProperties": false
      },
      "Recurring_RecurringLineItemResponse": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "organisationId": {
            "type": "string"
          },
          "employeeId": {
            "type": "string"
          },
          "payElementId": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "mode": {
            "enum": [
              "DateRange",
              "Balance"
            ],
            "type": "string"
          },
          "status": {
            "enum": [
              "Cancelled",
              "Active",
              "Suspended",
              "Completed"
            ],
            "type": "string"
          },
          "startDate": {
            "type": "string",
            "format": "date"
          },
          "endDate": {
            "type": "string",
            "format": "date",
            "nullable": true
          },
          "amountPerPeriod": {
            "type": "number",
            "format": "double"
          },
          "balanceTarget": {
            "type": "number",
            "format": "double",
            "nullable": true
          },
          "openingBalance": {
            "type": "number",
            "format": "double",
            "nullable": true
          },
          "amountSettledToDate": {
            "type": "number",
            "format": "double",
            "nullable": true
          },
          "balanceRemaining": {
            "type": "number",
            "format": "double",
            "nullable": true
          },
          "unitName": {
            "type": "string"
          },
          "unitType": {
            "type": "string",
            "nullable": true
          },
          "units": {
            "type": "number",
            "format": "double"
          },
          "payRate": {
            "type": "number",
            "format": "double"
          },
          "protectedEarnings": {
            "$ref": "#/components/schemas/Recurring_ProtectedEarnings"
          },
          "notes": {
            "type": "string",
            "nullable": true
          },
          "createdDate": {
            "type": "string"
          },
          "createdBy": {
            "type": "string"
          },
          "updatedDate": {
            "type": "string"
          },
          "updatedBy": {
            "type": "string"
          },
          "shortfallBehaviour": {
            "enum": [
              "Skip",
              "CarryForward"
            ],
            "type": "string"
          },
          "shortfallCarryCapMultiplier": {
            "type": "number",
            "format": "double",
            "nullable": true
          },
          "accumulatedShortfall": {
            "type": "number",
            "format": "double"
          },
          "clientId": {
            "type": "string",
            "nullable": true
          },
          "poNumber": {
            "type": "string",
            "nullable": true
          },
          "chargeRate": {
            "type": "number",
            "format": "double",
            "nullable": true
          },
          "chargeUnits": {
            "type": "number",
            "format": "double",
            "nullable": true
          },
          "chargeDescription": {
            "type": "string",
            "nullable": true
          },
          "tags": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Recurring_TagDto"
            },
            "nullable": true
          },
          "paymentDetails": {
            "$ref": "#/components/schemas/Recurring_PaymentDetailsDto"
          }
        },
        "additionalProperties": false
      },
      "Recurring_ResponseBody_List_Int32": {
        "type": "object",
        "properties": {
          "message": {
            "$ref": "#/components/schemas/Recurring_MessageWithTokenResponse"
          },
          "content": {
            "$ref": "#/components/schemas/Recurring_ContentResponse_List_Int32"
          },
          "validationIssues": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Recurring_ValidationIssue"
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Recurring_ResponseBody_List_RecurringLineItemPeriodResponse": {
        "type": "object",
        "properties": {
          "message": {
            "$ref": "#/components/schemas/Recurring_MessageWithTokenResponse"
          },
          "content": {
            "$ref": "#/components/schemas/Recurring_ContentResponse_List_RecurringLineItemPeriodResponse"
          },
          "validationIssues": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Recurring_ValidationIssue"
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Recurring_ResponseBody_List_RecurringLineItemResponse": {
        "type": "object",
        "properties": {
          "message": {
            "$ref": "#/components/schemas/Recurring_MessageWithTokenResponse"
          },
          "content": {
            "$ref": "#/components/schemas/Recurring_ContentResponse_List_RecurringLineItemResponse"
          },
          "validationIssues": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Recurring_ValidationIssue"
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Recurring_ResponseBody_Object": {
        "type": "object",
        "properties": {
          "message": {
            "$ref": "#/components/schemas/Recurring_MessageWithTokenResponse"
          },
          "content": {
            "$ref": "#/components/schemas/Recurring_ContentResponse_Object"
          },
          "validationIssues": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Recurring_ValidationIssue"
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Recurring_ResponseBody_RecurringLineItemPeriodResponse": {
        "type": "object",
        "properties": {
          "message": {
            "$ref": "#/components/schemas/Recurring_MessageWithTokenResponse"
          },
          "content": {
            "$ref": "#/components/schemas/Recurring_ContentResponse_RecurringLineItemPeriodResponse"
          },
          "validationIssues": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Recurring_ValidationIssue"
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Recurring_ResponseBody_RecurringLineItemResponse": {
        "type": "object",
        "properties": {
          "message": {
            "$ref": "#/components/schemas/Recurring_MessageWithTokenResponse"
          },
          "content": {
            "$ref": "#/components/schemas/Recurring_ContentResponse_RecurringLineItemResponse"
          },
          "validationIssues": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Recurring_ValidationIssue"
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Recurring_TagDto": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string"
          },
          "group": {
            "type": "string"
          },
          "value": {
            "type": "string"
          }
        },
        "additionalProperties": false
      },
      "Recurring_UpdateRecurringLineItemRequest": {
        "type": "object",
        "properties": {
          "description": {
            "type": "string",
            "nullable": true
          },
          "startDate": {
            "type": "string",
            "format": "date",
            "nullable": true
          },
          "endDate": {
            "type": "string",
            "format": "date",
            "nullable": true
          },
          "amountPerPeriod": {
            "type": "number",
            "format": "double",
            "nullable": true
          },
          "payRate": {
            "type": "number",
            "format": "double",
            "nullable": true
          },
          "protectedEarnings": {
            "$ref": "#/components/schemas/Recurring_ProtectedEarnings"
          },
          "notes": {
            "type": "string",
            "nullable": true
          },
          "status": {
            "enum": [
              "Cancelled",
              "Active",
              "Suspended",
              "Completed"
            ],
            "type": "string",
            "nullable": true
          },
          "shortfallBehaviour": {
            "enum": [
              "Skip",
              "CarryForward"
            ],
            "type": "string",
            "nullable": true
          },
          "shortfallCarryCapMultiplier": {
            "type": "number",
            "format": "double",
            "nullable": true
          },
          "clientId": {
            "type": "string",
            "nullable": true
          },
          "poNumber": {
            "type": "string",
            "nullable": true
          },
          "chargeRate": {
            "type": "number",
            "format": "double",
            "nullable": true
          },
          "chargeUnits": {
            "type": "number",
            "format": "double",
            "nullable": true
          },
          "chargeDescription": {
            "type": "string",
            "nullable": true
          },
          "tags": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Recurring_TagDto"
            },
            "nullable": true
          },
          "paymentDetails": {
            "$ref": "#/components/schemas/Recurring_PaymentDetailsDto"
          },
          "payElementId": {
            "type": "string",
            "nullable": true
          },
          "unitName": {
            "type": "string",
            "nullable": true
          },
          "unitType": {
            "type": "string",
            "nullable": true
          },
          "units": {
            "type": "number",
            "format": "double",
            "nullable": true
          },
          "balanceTarget": {
            "type": "number",
            "format": "double",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Recurring_ValidationIssue": {
        "type": "object",
        "properties": {
          "field": {
            "type": "string"
          },
          "reason": {
            "type": "string"
          },
          "reasonToken": {
            "type": "string"
          },
          "reasonTokenArguments": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Recurring_ValidationIssueArgument"
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Recurring_ValidationIssueArgument": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string"
          },
          "value": {}
        },
        "additionalProperties": false
      },
      "HmrcDps_ARContent": {
        "type": "object",
        "properties": {
          "reminderType": {
            "type": "string"
          },
          "taxYear": {
            "type": "string"
          },
          "dueDate": {
            "type": "string",
            "format": "date-time"
          },
          "amountDue": {
            "type": "number",
            "format": "double"
          },
          "hmrcOffice": {
            "type": "string"
          },
          "agentName": {
            "type": "string",
            "nullable": true
          },
          "employerRef": {
            "type": "string",
            "nullable": true
          },
          "employerAddressLines": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "employerPostCode": {
            "type": "string",
            "nullable": true
          },
          "employerCountry": {
            "type": "string",
            "nullable": true
          },
          "aoRef": {
            "type": "string",
            "nullable": true
          },
          "hmrcOfficeNumber": {
            "type": "string",
            "nullable": true
          },
          "hmrcOfficeReference": {
            "type": "string",
            "nullable": true
          },
          "hmrcOfficeName": {
            "type": "string",
            "nullable": true
          },
          "hmrcOfficeAddressLines": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "hmrcTelephoneNumber": {
            "type": "string",
            "nullable": true
          },
          "hmrcTelephoneExtension": {
            "type": "string",
            "nullable": true
          },
          "hmrcTelephoneType": {
            "type": "string",
            "nullable": true
          },
          "hmrcTelephoneMobile": {
            "type": "string",
            "nullable": true
          },
          "hmrcTelephonePreferred": {
            "type": "string",
            "nullable": true
          },
          "agentId": {
            "type": "string",
            "nullable": true
          },
          "agentAddressLines": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "agentPostCode": {
            "type": "string",
            "nullable": true
          },
          "agentCountry": {
            "type": "string",
            "nullable": true
          },
          "liabilityTypes": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "actionRequired": {
            "type": "string",
            "nullable": true
          },
          "actionDescription": {
            "type": "string",
            "nullable": true
          },
          "actionDueDate": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "HmrcDps_AllPaginationStatesResponseDto": {
        "type": "object",
        "properties": {
          "organisationStartDate": {
            "type": "string",
            "format": "date",
            "nullable": true
          },
          "paginationStates": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/HmrcDps_PaginationStateDto"
            }
          },
          "summary": {
            "$ref": "#/components/schemas/HmrcDps_PaginationStatesSummaryDto"
          }
        },
        "additionalProperties": false
      },
      "HmrcDps_ApiErrorResponse": {
        "type": "object",
        "properties": {
          "message": {
            "$ref": "#/components/schemas/HmrcDps_MessageWithTokenResponse"
          },
          "validationIssues": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/HmrcDps_ValidationIssue"
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "HmrcDps_AppliedChangesSnapshot": {
        "type": "object",
        "properties": {
          "previousTaxCode": {
            "type": "string",
            "nullable": true
          },
          "previousIsWeek1Month1": {
            "type": "boolean",
            "nullable": true
          },
          "newValue": {
            "type": "string",
            "nullable": true
          },
          "changeType": {
            "type": "string",
            "nullable": true
          },
          "capturedAt": {
            "type": "string",
            "format": "date-time"
          }
        },
        "additionalProperties": false
      },
      "HmrcDps_AssignEmployeeRequest": {
        "required": [
          "assignedBy",
          "employeeId"
        ],
        "type": "object",
        "properties": {
          "employeeId": {
            "type": "string"
          },
          "assignedBy": {
            "type": "string"
          },
          "reason": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "HmrcDps_BulkApplyNotificationAsyncRequest": {
        "required": [
          "notificationIds"
        ],
        "type": "object",
        "properties": {
          "notificationIds": {
            "maxItems": 1000,
            "minItems": 1,
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        },
        "additionalProperties": false
      },
      "HmrcDps_BulkDismissNotificationAsyncRequest": {
        "required": [
          "notificationIds"
        ],
        "type": "object",
        "properties": {
          "notificationIds": {
            "maxItems": 1000,
            "minItems": 1,
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "reason": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "HmrcDps_BulkNotificationAsyncResponseDto": {
        "type": "object",
        "properties": {
          "jobId": {
            "type": "string"
          },
          "status": {
            "enum": [
              "Pending",
              "Running",
              "Completed",
              "Failed",
              "Cancelled"
            ],
            "type": "string"
          },
          "operationType": {
            "enum": [
              "RetrieveAll",
              "BulkApplyNotifications",
              "BulkDismissNotifications"
            ],
            "type": "string"
          },
          "totalNotifications": {
            "type": "integer",
            "format": "int32"
          },
          "createdDate": {
            "type": "string",
            "format": "date-time"
          },
          "estimatedCompletionDate": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "statusUrl": {
            "type": "string"
          },
          "executionArn": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "HmrcDps_CISContent": {
        "type": "object",
        "properties": {
          "messageText": {
            "type": "string"
          },
          "uniqueId": {
            "type": "string",
            "nullable": true
          },
          "defaultPeriodEnding": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "employerAccountsOfficeReference": {
            "type": "string",
            "nullable": true
          },
          "subcontractorInfo": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/HmrcDps_CisSubcontractorInfo"
            }
          },
          "actionRequired": {
            "type": "string",
            "nullable": true
          },
          "actionDescription": {
            "type": "string",
            "nullable": true
          },
          "actionDueDate": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "HmrcDps_CisSubcontractorInfo": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string"
          },
          "utr": {
            "type": "string"
          },
          "directCostOfMaterialsAmount": {
            "type": "number",
            "format": "double"
          },
          "totalPaymentsMadeAmount": {
            "type": "number",
            "format": "double"
          }
        },
        "additionalProperties": false
      },
      "HmrcDps_ContentMetadataResponse": {
        "type": "object",
        "properties": {
          "dateFormat": {
            "type": "string"
          },
          "dateTimeFormat": {
            "type": "string"
          },
          "paginationToken": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "HmrcDps_ContentResponse_AllPaginationStatesResponseDto": {
        "type": "object",
        "properties": {
          "data": {
            "$ref": "#/components/schemas/HmrcDps_AllPaginationStatesResponseDto"
          },
          "metadata": {
            "$ref": "#/components/schemas/HmrcDps_ContentMetadataResponse"
          }
        },
        "additionalProperties": false
      },
      "HmrcDps_ContentResponse_Boolean": {
        "type": "object",
        "properties": {
          "data": {
            "type": "boolean"
          },
          "metadata": {
            "$ref": "#/components/schemas/HmrcDps_ContentMetadataResponse"
          }
        },
        "additionalProperties": false
      },
      "HmrcDps_ContentResponse_BulkNotificationAsyncResponseDto": {
        "type": "object",
        "properties": {
          "data": {
            "$ref": "#/components/schemas/HmrcDps_BulkNotificationAsyncResponseDto"
          },
          "metadata": {
            "$ref": "#/components/schemas/HmrcDps_ContentMetadataResponse"
          }
        },
        "additionalProperties": false
      },
      "HmrcDps_ContentResponse_DpsApplyResultDto": {
        "type": "object",
        "properties": {
          "data": {
            "$ref": "#/components/schemas/HmrcDps_DpsApplyResultDto"
          },
          "metadata": {
            "$ref": "#/components/schemas/HmrcDps_ContentMetadataResponse"
          }
        },
        "additionalProperties": false
      },
      "HmrcDps_ContentResponse_DpsAsyncJobResponseDto": {
        "type": "object",
        "properties": {
          "data": {
            "$ref": "#/components/schemas/HmrcDps_DpsAsyncJobResponseDto"
          },
          "metadata": {
            "$ref": "#/components/schemas/HmrcDps_ContentMetadataResponse"
          }
        },
        "additionalProperties": false
      },
      "HmrcDps_ContentResponse_DpsAsyncJobStatusDto": {
        "type": "object",
        "properties": {
          "data": {
            "$ref": "#/components/schemas/HmrcDps_DpsAsyncJobStatusDto"
          },
          "metadata": {
            "$ref": "#/components/schemas/HmrcDps_ContentMetadataResponse"
          }
        },
        "additionalProperties": false
      },
      "HmrcDps_ContentResponse_DpsErrorDto": {
        "type": "object",
        "properties": {
          "data": {
            "$ref": "#/components/schemas/HmrcDps_DpsErrorDto"
          },
          "metadata": {
            "$ref": "#/components/schemas/HmrcDps_ContentMetadataResponse"
          }
        },
        "additionalProperties": false
      },
      "HmrcDps_ContentResponse_DpsNotificationDisplayDto": {
        "type": "object",
        "properties": {
          "data": {
            "$ref": "#/components/schemas/HmrcDps_DpsNotificationDisplayDto"
          },
          "metadata": {
            "$ref": "#/components/schemas/HmrcDps_ContentMetadataResponse"
          }
        },
        "additionalProperties": false
      },
      "HmrcDps_ContentResponse_DpsNotificationListDto": {
        "type": "object",
        "properties": {
          "data": {
            "$ref": "#/components/schemas/HmrcDps_DpsNotificationListDto"
          },
          "metadata": {
            "$ref": "#/components/schemas/HmrcDps_ContentMetadataResponse"
          }
        },
        "additionalProperties": false
      },
      "HmrcDps_ContentResponse_IEnumerable_DpsAsyncJobStatusDto": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/HmrcDps_DpsAsyncJobStatusDto"
            },
            "nullable": true
          },
          "metadata": {
            "$ref": "#/components/schemas/HmrcDps_ContentMetadataResponse"
          }
        },
        "additionalProperties": false
      },
      "HmrcDps_ContentResponse_InitializePaginationResponseDto": {
        "type": "object",
        "properties": {
          "data": {
            "$ref": "#/components/schemas/HmrcDps_InitializePaginationResponseDto"
          },
          "metadata": {
            "$ref": "#/components/schemas/HmrcDps_ContentMetadataResponse"
          }
        },
        "additionalProperties": false
      },
      "HmrcDps_ContentResponse_NotificationCountsResultDto": {
        "type": "object",
        "properties": {
          "data": {
            "$ref": "#/components/schemas/HmrcDps_NotificationCountsResultDto"
          },
          "metadata": {
            "$ref": "#/components/schemas/HmrcDps_ContentMetadataResponse"
          }
        },
        "additionalProperties": false
      },
      "HmrcDps_ContentResponse_RetryMatchingResultDto": {
        "type": "object",
        "properties": {
          "data": {
            "$ref": "#/components/schemas/HmrcDps_RetryMatchingResultDto"
          },
          "metadata": {
            "$ref": "#/components/schemas/HmrcDps_ContentMetadataResponse"
          }
        },
        "additionalProperties": false
      },
      "HmrcDps_DpsApplyResultDto": {
        "type": "object",
        "properties": {
          "notificationId": {
            "type": "string"
          },
          "success": {
            "type": "boolean"
          },
          "employeeId": {
            "type": "string",
            "nullable": true
          },
          "errorMessage": {
            "type": "string",
            "nullable": true
          },
          "changesApplied": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "HmrcDps_DpsAsyncJobResponseDto": {
        "type": "object",
        "properties": {
          "jobId": {
            "type": "string"
          },
          "status": {
            "enum": [
              "Pending",
              "Running",
              "Completed",
              "Failed",
              "Cancelled"
            ],
            "type": "string"
          },
          "jobType": {
            "enum": [
              "RetrieveAll",
              "BulkApplyNotifications",
              "BulkDismissNotifications"
            ],
            "type": "string"
          },
          "createdDate": {
            "type": "string",
            "format": "date-time"
          },
          "estimatedCompletionDate": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "statusUrl": {
            "type": "string"
          },
          "errorMessage": {
            "type": "string",
            "nullable": true
          },
          "executionArn": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "HmrcDps_DpsAsyncJobStatusDto": {
        "type": "object",
        "properties": {
          "jobId": {
            "type": "string"
          },
          "status": {
            "enum": [
              "Pending",
              "Running",
              "Completed",
              "Failed",
              "Cancelled"
            ],
            "type": "string"
          },
          "jobType": {
            "enum": [
              "RetrieveAll",
              "BulkApplyNotifications",
              "BulkDismissNotifications"
            ],
            "type": "string"
          },
          "progress": {
            "type": "integer",
            "format": "int32"
          },
          "results": {
            "type": "string",
            "nullable": true
          },
          "errorMessage": {
            "type": "string",
            "nullable": true
          },
          "createdDate": {
            "type": "string",
            "format": "date-time"
          },
          "updatedDate": {
            "type": "string",
            "format": "date-time"
          },
          "completedDate": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "createdBy": {
            "type": "string"
          }
        },
        "additionalProperties": false
      },
      "HmrcDps_DpsErrorDto": {
        "type": "object",
        "properties": {
          "error": {
            "type": "string"
          },
          "message": {
            "type": "string"
          },
          "details": {
            "type": "string",
            "nullable": true
          },
          "timestamp": {
            "type": "string",
            "format": "date-time"
          }
        },
        "additionalProperties": false
      },
      "HmrcDps_DpsNotificationDisplayDto": {
        "type": "object",
        "properties": {
          "notificationId": {
            "type": "string"
          },
          "dataType": {
            "enum": [
              "P6",
              "P9",
              "SL1",
              "SL2",
              "PGL1",
              "PGL2",
              "AR",
              "NOT",
              "RTI",
              "CIS",
              "P35",
              "CISINFO29",
              "All"
            ],
            "type": "string"
          },
          "formType": {
            "type": "string"
          },
          "status": {
            "enum": [
              "Due",
              "Applied",
              "Dismissed"
            ],
            "type": "string"
          },
          "issueDate": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "effectiveDate": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "createdDate": {
            "type": "string",
            "format": "date-time"
          },
          "appliedDate": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "dismissedDate": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "actionNeeded": {
            "type": "boolean"
          },
          "notificationEmployeeData": {
            "$ref": "#/components/schemas/HmrcDps_NotificationEmployeeData"
          },
          "matchedEmployeeId": {
            "type": "string",
            "nullable": true
          },
          "content": {
            "$ref": "#/components/schemas/HmrcDps_NotificationContent"
          },
          "rawXml": {
            "type": "string",
            "nullable": true
          },
          "createdBy": {
            "type": "string"
          },
          "appliedBy": {
            "type": "string",
            "nullable": true
          },
          "dismissedBy": {
            "type": "string",
            "nullable": true
          },
          "appliedChanges": {
            "$ref": "#/components/schemas/HmrcDps_AppliedChangesSnapshot"
          }
        },
        "additionalProperties": false
      },
      "HmrcDps_DpsNotificationListDto": {
        "type": "object",
        "properties": {
          "notifications": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/HmrcDps_DpsNotificationDisplayDto"
            }
          },
          "totalCount": {
            "type": "integer",
            "format": "int32"
          },
          "dueCount": {
            "type": "integer",
            "format": "int32"
          },
          "appliedCount": {
            "type": "integer",
            "format": "int32"
          },
          "dismissedCount": {
            "type": "integer",
            "format": "int32"
          },
          "paginationToken": {
            "type": "string",
            "nullable": true
          },
          "hasMorePages": {
            "type": "boolean"
          },
          "pageSize": {
            "type": "integer",
            "format": "int32"
          }
        },
        "additionalProperties": false
      },
      "HmrcDps_DpsNotificationStatusUpdateRequestDto": {
        "type": "object",
        "properties": {
          "status": {
            "type": "string"
          },
          "updatedBy": {
            "type": "string"
          }
        },
        "additionalProperties": false
      },
      "HmrcDps_DpsRetrieveAllRequestDto": {
        "type": "object",
        "additionalProperties": false
      },
      "HmrcDps_GenericContent": {
        "type": "object",
        "properties": {
          "messageText": {
            "type": "string"
          },
          "notificationType": {
            "type": "string"
          },
          "messageTypeId": {
            "type": "integer",
            "format": "int32"
          },
          "messageTypeTitle": {
            "type": "string"
          },
          "dutyType": {
            "type": "string"
          },
          "informationItems": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/HmrcDps_RtiInformationItem"
            }
          },
          "changeItems": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/HmrcDps_RtiChangeItem"
            }
          },
          "actionRequired": {
            "type": "string",
            "nullable": true
          },
          "actionDescription": {
            "type": "string",
            "nullable": true
          },
          "actionDueDate": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "HmrcDps_IncentiveContent": {
        "type": "object",
        "properties": {
          "incentiveType": {
            "type": "string"
          },
          "messageText": {
            "type": "string"
          },
          "incentiveAmount": {
            "type": "number",
            "format": "double",
            "nullable": true
          },
          "actionRequired": {
            "type": "string",
            "nullable": true
          },
          "actionDescription": {
            "type": "string",
            "nullable": true
          },
          "actionDueDate": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "HmrcDps_InitializePaginationRequestDto": {
        "type": "object",
        "properties": {
          "date": {
            "type": "string",
            "format": "date"
          },
          "overwriteExisting": {
            "type": "boolean"
          },
          "dataTypes": {
            "type": "array",
            "items": {
              "enum": [
                "P6",
                "P9",
                "SL1",
                "SL2",
                "PGL1",
                "PGL2",
                "AR",
                "NOT",
                "RTI",
                "CIS",
                "P35",
                "CISINFO29",
                "All"
              ],
              "type": "string"
            },
            "nullable": true
          },
          "service": {
            "enum": [
              "PAYE",
              "CIS",
              "All"
            ],
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "HmrcDps_InitializePaginationResponseDto": {
        "type": "object",
        "properties": {
          "date": {
            "type": "string",
            "format": "date"
          },
          "results": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/HmrcDps_PaginationInitializationResultDto"
            }
          },
          "summary": {
            "$ref": "#/components/schemas/HmrcDps_PaginationInitializationSummaryDto"
          }
        },
        "additionalProperties": false
      },
      "HmrcDps_MessageWithTokenResponse": {
        "type": "object",
        "properties": {
          "text": {
            "type": "string"
          },
          "token": {
            "type": "string"
          },
          "tokenArguments": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/HmrcDps_ValidationIssueArgument"
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "HmrcDps_NonFilingContent": {
        "type": "object",
        "properties": {
          "noticeType": {
            "type": "string"
          },
          "messageText": {
            "type": "string"
          },
          "periodEnding": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "actionRequired": {
            "type": "string",
            "nullable": true
          },
          "actionDescription": {
            "type": "string",
            "nullable": true
          },
          "actionDueDate": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "HmrcDps_NotificationContent": {
        "type": "object",
        "properties": {
          "effectiveDate": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "taxYearEnd": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "formType": {
            "type": "string",
            "nullable": true
          },
          "priority": {
            "type": "integer",
            "format": "int32"
          },
          "sequenceNumber": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "isEmployeeSpecific": {
            "type": "boolean"
          },
          "p6": {
            "$ref": "#/components/schemas/HmrcDps_P6Content"
          },
          "p9": {
            "$ref": "#/components/schemas/HmrcDps_P9Content"
          },
          "sL1": {
            "$ref": "#/components/schemas/HmrcDps_SL1Content"
          },
          "sL2": {
            "$ref": "#/components/schemas/HmrcDps_SL2Content"
          },
          "pgL1": {
            "$ref": "#/components/schemas/HmrcDps_PGL1Content"
          },
          "pgL2": {
            "$ref": "#/components/schemas/HmrcDps_PGL2Content"
          },
          "ar": {
            "$ref": "#/components/schemas/HmrcDps_ARContent"
          },
          "rti": {
            "$ref": "#/components/schemas/HmrcDps_RTIContent"
          },
          "p35": {
            "$ref": "#/components/schemas/HmrcDps_P35Content"
          },
          "p11Db": {
            "$ref": "#/components/schemas/HmrcDps_P11DbContent"
          },
          "cis": {
            "$ref": "#/components/schemas/HmrcDps_CISContent"
          },
          "incentive": {
            "$ref": "#/components/schemas/HmrcDps_IncentiveContent"
          },
          "penalty": {
            "$ref": "#/components/schemas/HmrcDps_PenaltyContent"
          },
          "nonFiling": {
            "$ref": "#/components/schemas/HmrcDps_NonFilingContent"
          },
          "generic": {
            "$ref": "#/components/schemas/HmrcDps_GenericContent"
          }
        },
        "additionalProperties": false
      },
      "HmrcDps_NotificationCountsResultDto": {
        "type": "object",
        "properties": {
          "readyToApply": {
            "type": "integer",
            "format": "int32"
          },
          "all": {
            "type": "integer",
            "format": "int32"
          },
          "unmatched": {
            "type": "integer",
            "format": "int32"
          },
          "applied": {
            "type": "integer",
            "format": "int32"
          },
          "dismissed": {
            "type": "integer",
            "format": "int32"
          },
          "generic": {
            "type": "integer",
            "format": "int32"
          }
        },
        "additionalProperties": false
      },
      "HmrcDps_NotificationEmployeeData": {
        "type": "object",
        "properties": {
          "nationalInsuranceNumber": {
            "type": "string",
            "nullable": true
          },
          "worksNumber": {
            "type": "string",
            "nullable": true
          },
          "name": {
            "type": "string",
            "nullable": true
          },
          "title": {
            "type": "string",
            "nullable": true
          },
          "forename": {
            "type": "string",
            "nullable": true
          },
          "surname": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "HmrcDps_P11DbContent": {
        "type": "object",
        "properties": {
          "notificationType": {
            "type": "string"
          },
          "messageText": {
            "type": "string"
          },
          "periodEnding": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "formType": {
            "type": "string",
            "nullable": true
          },
          "headerText": {
            "type": "string",
            "nullable": true
          },
          "taxYearEnd": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "employerRef": {
            "type": "string",
            "nullable": true
          },
          "employerAddressLines": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "employerPostCode": {
            "type": "string",
            "nullable": true
          },
          "employerCountry": {
            "type": "string",
            "nullable": true
          },
          "aoRef": {
            "type": "string",
            "nullable": true
          },
          "hmrcOfficeNumber": {
            "type": "string",
            "nullable": true
          },
          "hmrcOfficeReference": {
            "type": "string",
            "nullable": true
          },
          "hmrcOfficeName": {
            "type": "string",
            "nullable": true
          },
          "hmrcOfficeAddressLines": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "hmrcTelephoneNumber": {
            "type": "string",
            "nullable": true
          },
          "hmrcTelephoneExtension": {
            "type": "string",
            "nullable": true
          },
          "hmrcTelephoneType": {
            "type": "string",
            "nullable": true
          },
          "hmrcTelephoneMobile": {
            "type": "string",
            "nullable": true
          },
          "hmrcTelephonePreferred": {
            "type": "string",
            "nullable": true
          },
          "agentId": {
            "type": "string",
            "nullable": true
          },
          "agentName": {
            "type": "string",
            "nullable": true
          },
          "agentAddressLines": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "agentPostCode": {
            "type": "string",
            "nullable": true
          },
          "agentCountry": {
            "type": "string",
            "nullable": true
          },
          "actionRequired": {
            "type": "string",
            "nullable": true
          },
          "actionDescription": {
            "type": "string",
            "nullable": true
          },
          "actionDueDate": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "HmrcDps_P35Content": {
        "type": "object",
        "properties": {
          "notificationType": {
            "type": "string"
          },
          "messageText": {
            "type": "string"
          },
          "periodEnding": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "headerText": {
            "type": "string",
            "nullable": true
          },
          "employerRef": {
            "type": "string",
            "nullable": true
          },
          "employerAddressLines": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "employerPostCode": {
            "type": "string",
            "nullable": true
          },
          "employerCountry": {
            "type": "string",
            "nullable": true
          },
          "aoRef": {
            "type": "string",
            "nullable": true
          },
          "hmrcOfficeNumber": {
            "type": "string",
            "nullable": true
          },
          "hmrcOfficeReference": {
            "type": "string",
            "nullable": true
          },
          "hmrcOfficeName": {
            "type": "string",
            "nullable": true
          },
          "hmrcOfficeAddressLines": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "hmrcTelephoneNumber": {
            "type": "string",
            "nullable": true
          },
          "hmrcTelephoneExtension": {
            "type": "string",
            "nullable": true
          },
          "hmrcTelephoneType": {
            "type": "string",
            "nullable": true
          },
          "hmrcTelephoneMobile": {
            "type": "string",
            "nullable": true
          },
          "hmrcTelephonePreferred": {
            "type": "string",
            "nullable": true
          },
          "agentId": {
            "type": "string",
            "nullable": true
          },
          "agentName": {
            "type": "string",
            "nullable": true
          },
          "agentAddressLines": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "agentPostCode": {
            "type": "string",
            "nullable": true
          },
          "agentCountry": {
            "type": "string",
            "nullable": true
          },
          "actionRequired": {
            "type": "string",
            "nullable": true
          },
          "actionDescription": {
            "type": "string",
            "nullable": true
          },
          "actionDueDate": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "HmrcDps_P6Content": {
        "type": "object",
        "properties": {
          "employeeNationalInsuranceNumber": {
            "type": "string"
          },
          "worksNumber": {
            "type": "string",
            "nullable": true
          },
          "employeeName": {
            "type": "string"
          },
          "employeeTitle": {
            "type": "string",
            "nullable": true
          },
          "employeeInitials": {
            "type": "string",
            "nullable": true
          },
          "taxCode": {
            "type": "string"
          },
          "isWeek1Month1Basis": {
            "type": "boolean"
          },
          "taxRegime": {
            "type": "string"
          },
          "totalPreviousPay": {
            "type": "number",
            "format": "double",
            "nullable": true
          },
          "totalPreviousPayCurrency": {
            "type": "string",
            "nullable": true
          },
          "totalPreviousTax": {
            "type": "number",
            "format": "double",
            "nullable": true
          },
          "totalPreviousTaxCurrency": {
            "type": "string",
            "nullable": true
          },
          "actionRequired": {
            "type": "string",
            "nullable": true
          },
          "actionDescription": {
            "type": "string",
            "nullable": true
          },
          "actionDueDate": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "HmrcDps_P9Content": {
        "type": "object",
        "properties": {
          "employeeNationalInsuranceNumber": {
            "type": "string"
          },
          "worksNumber": {
            "type": "string",
            "nullable": true
          },
          "employeeName": {
            "type": "string"
          },
          "employeeTitle": {
            "type": "string",
            "nullable": true
          },
          "employeeInitials": {
            "type": "string",
            "nullable": true
          },
          "taxCode": {
            "type": "string"
          },
          "isWeek1Month1Basis": {
            "type": "boolean"
          },
          "taxRegime": {
            "type": "string"
          },
          "actionRequired": {
            "type": "string",
            "nullable": true
          },
          "actionDescription": {
            "type": "string",
            "nullable": true
          },
          "actionDueDate": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "HmrcDps_PGL1Content": {
        "type": "object",
        "properties": {
          "employeeNationalInsuranceNumber": {
            "type": "string"
          },
          "worksNumber": {
            "type": "string",
            "nullable": true
          },
          "employeeName": {
            "type": "string"
          },
          "employeeTitle": {
            "type": "string",
            "nullable": true
          },
          "employeeInitials": {
            "type": "string",
            "nullable": true
          },
          "loanType": {
            "type": "string"
          },
          "planType": {
            "type": "string"
          },
          "loanStartDate": {
            "type": "string",
            "format": "date-time"
          },
          "actionRequired": {
            "type": "string",
            "nullable": true
          },
          "actionDescription": {
            "type": "string",
            "nullable": true
          },
          "actionDueDate": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "HmrcDps_PGL2Content": {
        "type": "object",
        "properties": {
          "employeeNationalInsuranceNumber": {
            "type": "string"
          },
          "worksNumber": {
            "type": "string",
            "nullable": true
          },
          "employeeName": {
            "type": "string"
          },
          "employeeTitle": {
            "type": "string",
            "nullable": true
          },
          "employeeInitials": {
            "type": "string",
            "nullable": true
          },
          "loanType": {
            "type": "string"
          },
          "loanEndDate": {
            "type": "string",
            "format": "date-time"
          },
          "actionRequired": {
            "type": "string",
            "nullable": true
          },
          "actionDescription": {
            "type": "string",
            "nullable": true
          },
          "actionDueDate": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "HmrcDps_PaginationInitializationResultDto": {
        "type": "object",
        "properties": {
          "dataType": {
            "enum": [
              "P6",
              "P9",
              "SL1",
              "SL2",
              "PGL1",
              "PGL2",
              "AR",
              "NOT",
              "RTI",
              "CIS",
              "P35",
              "CISINFO29",
              "All"
            ],
            "type": "string"
          },
          "service": {
            "enum": [
              "PAYE",
              "CIS",
              "All"
            ],
            "type": "string"
          },
          "success": {
            "type": "boolean"
          },
          "skipped": {
            "type": "boolean"
          },
          "highWaterMark": {
            "type": "integer",
            "format": "int32"
          },
          "error": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "HmrcDps_PaginationInitializationSummaryDto": {
        "type": "object",
        "properties": {
          "totalProcessed": {
            "type": "integer",
            "format": "int32"
          },
          "successful": {
            "type": "integer",
            "format": "int32"
          },
          "skipped": {
            "type": "integer",
            "format": "int32"
          },
          "failed": {
            "type": "integer",
            "format": "int32"
          }
        },
        "additionalProperties": false
      },
      "HmrcDps_PaginationStateDto": {
        "type": "object",
        "properties": {
          "dataType": {
            "enum": [
              "P6",
              "P9",
              "SL1",
              "SL2",
              "PGL1",
              "PGL2",
              "AR",
              "NOT",
              "RTI",
              "CIS",
              "P35",
              "CISINFO29",
              "All"
            ],
            "type": "string"
          },
          "service": {
            "enum": [
              "PAYE",
              "CIS",
              "All"
            ],
            "type": "string"
          },
          "highWaterMark": {
            "type": "integer",
            "format": "int32"
          },
          "moreData": {
            "type": "boolean"
          },
          "lastRetrievedCount": {
            "type": "integer",
            "format": "int32"
          },
          "lastRetrievedAt": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "exists": {
            "type": "boolean"
          },
          "organisationStartDate": {
            "type": "string",
            "format": "date",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "HmrcDps_PaginationStatesSummaryDto": {
        "type": "object",
        "properties": {
          "totalDataTypes": {
            "type": "integer",
            "format": "int32"
          },
          "withPagination": {
            "type": "integer",
            "format": "int32"
          },
          "withoutPagination": {
            "type": "integer",
            "format": "int32"
          }
        },
        "additionalProperties": false
      },
      "HmrcDps_PenaltyContent": {
        "type": "object",
        "properties": {
          "penaltyType": {
            "type": "string"
          },
          "messageText": {
            "type": "string"
          },
          "periodEnding": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "dateOfReceipt": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "penaltyAmount": {
            "type": "number",
            "format": "double",
            "nullable": true
          },
          "actionRequired": {
            "type": "string",
            "nullable": true
          },
          "actionDescription": {
            "type": "string",
            "nullable": true
          },
          "actionDueDate": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "HmrcDps_RTIContent": {
        "type": "object",
        "properties": {
          "employeeNationalInsuranceNumber": {
            "type": "string"
          },
          "payrollId": {
            "type": "string",
            "nullable": true
          },
          "employeeName": {
            "type": "string"
          },
          "employeeTitle": {
            "type": "string",
            "nullable": true
          },
          "employeeInitials": {
            "type": "string",
            "nullable": true
          },
          "employeeSurname": {
            "type": "string",
            "nullable": true
          },
          "correlationId": {
            "type": "string"
          },
          "requiredAction": {
            "type": "string"
          },
          "correctNino": {
            "type": "string",
            "nullable": true
          },
          "providedNino": {
            "type": "string",
            "nullable": true
          },
          "isFromNinoVerificationRequest": {
            "type": "boolean"
          },
          "isFromFullPaymentSubmission": {
            "type": "boolean"
          },
          "actionRequired": {
            "type": "string",
            "nullable": true
          },
          "actionDescription": {
            "type": "string",
            "nullable": true
          },
          "actionDueDate": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "HmrcDps_ResponseBody_AllPaginationStatesResponseDto": {
        "type": "object",
        "properties": {
          "message": {
            "$ref": "#/components/schemas/HmrcDps_MessageWithTokenResponse"
          },
          "content": {
            "$ref": "#/components/schemas/HmrcDps_ContentResponse_AllPaginationStatesResponseDto"
          },
          "validationIssues": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/HmrcDps_ValidationIssue"
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "HmrcDps_ResponseBody_Boolean": {
        "type": "object",
        "properties": {
          "message": {
            "$ref": "#/components/schemas/HmrcDps_MessageWithTokenResponse"
          },
          "content": {
            "$ref": "#/components/schemas/HmrcDps_ContentResponse_Boolean"
          },
          "validationIssues": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/HmrcDps_ValidationIssue"
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "HmrcDps_ResponseBody_BulkNotificationAsyncResponseDto": {
        "type": "object",
        "properties": {
          "message": {
            "$ref": "#/components/schemas/HmrcDps_MessageWithTokenResponse"
          },
          "content": {
            "$ref": "#/components/schemas/HmrcDps_ContentResponse_BulkNotificationAsyncResponseDto"
          },
          "validationIssues": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/HmrcDps_ValidationIssue"
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "HmrcDps_ResponseBody_DpsApplyResultDto": {
        "type": "object",
        "properties": {
          "message": {
            "$ref": "#/components/schemas/HmrcDps_MessageWithTokenResponse"
          },
          "content": {
            "$ref": "#/components/schemas/HmrcDps_ContentResponse_DpsApplyResultDto"
          },
          "validationIssues": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/HmrcDps_ValidationIssue"
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "HmrcDps_ResponseBody_DpsAsyncJobResponseDto": {
        "type": "object",
        "properties": {
          "message": {
            "$ref": "#/components/schemas/HmrcDps_MessageWithTokenResponse"
          },
          "content": {
            "$ref": "#/components/schemas/HmrcDps_ContentResponse_DpsAsyncJobResponseDto"
          },
          "validationIssues": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/HmrcDps_ValidationIssue"
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "HmrcDps_ResponseBody_DpsAsyncJobStatusDto": {
        "type": "object",
        "properties": {
          "message": {
            "$ref": "#/components/schemas/HmrcDps_MessageWithTokenResponse"
          },
          "content": {
            "$ref": "#/components/schemas/HmrcDps_ContentResponse_DpsAsyncJobStatusDto"
          },
          "validationIssues": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/HmrcDps_ValidationIssue"
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "HmrcDps_ResponseBody_DpsErrorDto": {
        "type": "object",
        "properties": {
          "message": {
            "$ref": "#/components/schemas/HmrcDps_MessageWithTokenResponse"
          },
          "content": {
            "$ref": "#/components/schemas/HmrcDps_ContentResponse_DpsErrorDto"
          },
          "validationIssues": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/HmrcDps_ValidationIssue"
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "HmrcDps_ResponseBody_DpsNotificationDisplayDto": {
        "type": "object",
        "properties": {
          "message": {
            "$ref": "#/components/schemas/HmrcDps_MessageWithTokenResponse"
          },
          "content": {
            "$ref": "#/components/schemas/HmrcDps_ContentResponse_DpsNotificationDisplayDto"
          },
          "validationIssues": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/HmrcDps_ValidationIssue"
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "HmrcDps_ResponseBody_DpsNotificationListDto": {
        "type": "object",
        "properties": {
          "message": {
            "$ref": "#/components/schemas/HmrcDps_MessageWithTokenResponse"
          },
          "content": {
            "$ref": "#/components/schemas/HmrcDps_ContentResponse_DpsNotificationListDto"
          },
          "validationIssues": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/HmrcDps_ValidationIssue"
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "HmrcDps_ResponseBody_IEnumerable_DpsAsyncJobStatusDto": {
        "type": "object",
        "properties": {
          "message": {
            "$ref": "#/components/schemas/HmrcDps_MessageWithTokenResponse"
          },
          "content": {
            "$ref": "#/components/schemas/HmrcDps_ContentResponse_IEnumerable_DpsAsyncJobStatusDto"
          },
          "validationIssues": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/HmrcDps_ValidationIssue"
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "HmrcDps_ResponseBody_InitializePaginationResponseDto": {
        "type": "object",
        "properties": {
          "message": {
            "$ref": "#/components/schemas/HmrcDps_MessageWithTokenResponse"
          },
          "content": {
            "$ref": "#/components/schemas/HmrcDps_ContentResponse_InitializePaginationResponseDto"
          },
          "validationIssues": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/HmrcDps_ValidationIssue"
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "HmrcDps_ResponseBody_NotificationCountsResultDto": {
        "type": "object",
        "properties": {
          "message": {
            "$ref": "#/components/schemas/HmrcDps_MessageWithTokenResponse"
          },
          "content": {
            "$ref": "#/components/schemas/HmrcDps_ContentResponse_NotificationCountsResultDto"
          },
          "validationIssues": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/HmrcDps_ValidationIssue"
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "HmrcDps_ResponseBody_RetryMatchingResultDto": {
        "type": "object",
        "properties": {
          "message": {
            "$ref": "#/components/schemas/HmrcDps_MessageWithTokenResponse"
          },
          "content": {
            "$ref": "#/components/schemas/HmrcDps_ContentResponse_RetryMatchingResultDto"
          },
          "validationIssues": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/HmrcDps_ValidationIssue"
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "HmrcDps_RetryMatchingResultDto": {
        "type": "object",
        "properties": {
          "totalProcessed": {
            "type": "integer",
            "format": "int32"
          },
          "matchedCount": {
            "type": "integer",
            "format": "int32"
          },
          "failedCount": {
            "type": "integer",
            "format": "int32"
          },
          "errors": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        },
        "additionalProperties": false
      },
      "HmrcDps_RtiChangeItem": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "nullable": true
          },
          "displayName": {
            "type": "string"
          },
          "previousValue": {
            "type": "string",
            "nullable": true
          },
          "newValue": {
            "type": "string",
            "nullable": true
          },
          "sequence": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "previousValueType": {
            "type": "string",
            "nullable": true
          },
          "newValueType": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "HmrcDps_RtiInformationItem": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "nullable": true
          },
          "displayName": {
            "type": "string"
          },
          "value": {
            "type": "string"
          },
          "sequence": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "valueType": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "HmrcDps_SL1Content": {
        "type": "object",
        "properties": {
          "employeeNationalInsuranceNumber": {
            "type": "string"
          },
          "worksNumber": {
            "type": "string",
            "nullable": true
          },
          "employeeName": {
            "type": "string"
          },
          "employeeTitle": {
            "type": "string",
            "nullable": true
          },
          "employeeInitials": {
            "type": "string",
            "nullable": true
          },
          "loanType": {
            "type": "string"
          },
          "planType": {
            "type": "string"
          },
          "loanStartDate": {
            "type": "string",
            "format": "date-time"
          },
          "actionRequired": {
            "type": "string",
            "nullable": true
          },
          "actionDescription": {
            "type": "string",
            "nullable": true
          },
          "actionDueDate": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "HmrcDps_SL2Content": {
        "type": "object",
        "properties": {
          "employeeNationalInsuranceNumber": {
            "type": "string"
          },
          "worksNumber": {
            "type": "string",
            "nullable": true
          },
          "employeeName": {
            "type": "string"
          },
          "employeeTitle": {
            "type": "string",
            "nullable": true
          },
          "employeeInitials": {
            "type": "string",
            "nullable": true
          },
          "loanType": {
            "type": "string"
          },
          "loanEndDate": {
            "type": "string",
            "format": "date-time"
          },
          "actionRequired": {
            "type": "string",
            "nullable": true
          },
          "actionDescription": {
            "type": "string",
            "nullable": true
          },
          "actionDueDate": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "HmrcDps_ValidationIssue": {
        "type": "object",
        "properties": {
          "field": {
            "type": "string"
          },
          "reason": {
            "type": "string"
          },
          "reasonToken": {
            "type": "string"
          },
          "reasonTokenArguments": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/HmrcDps_ValidationIssueArgument"
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "HmrcDps_ValidationIssueArgument": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string"
          },
          "value": {}
        },
        "additionalProperties": false
      },
      "HmrcPForms_AddressDto": {
        "type": "object",
        "properties": {
          "line1": {
            "type": "string",
            "nullable": true
          },
          "line2": {
            "type": "string",
            "nullable": true
          },
          "city": {
            "type": "string",
            "nullable": true
          },
          "county": {
            "type": "string",
            "nullable": true
          },
          "postcode": {
            "type": "string",
            "nullable": true
          },
          "countryCode": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "HmrcPForms_ApiErrorResponse": {
        "type": "object",
        "properties": {
          "message": {
            "$ref": "#/components/schemas/HmrcPForms_MessageWithTokenResponse"
          },
          "validationIssues": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/HmrcPForms_ValidationIssue"
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "HmrcPForms_ContentMetadataResponse": {
        "type": "object",
        "properties": {
          "dateFormat": {
            "type": "string",
            "nullable": true
          },
          "dateTimeFormat": {
            "type": "string",
            "nullable": true
          },
          "paginationToken": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "HmrcPForms_EmployeeLeaverDetailsDto": {
        "type": "object",
        "properties": {
          "leavingDate": {
            "type": "string",
            "nullable": true
          },
          "reason": {
            "type": "string",
            "nullable": true
          },
          "issuedBy": {
            "type": "string",
            "nullable": true
          },
          "reportedToHmrc": {
            "type": "boolean"
          },
          "finalisedOnPayslip": {
            "type": "boolean"
          }
        },
        "additionalProperties": false
      },
      "HmrcPForms_EmployeeNameDto": {
        "type": "object",
        "properties": {
          "title": {
            "type": "string",
            "nullable": true
          },
          "firstName": {
            "type": "string",
            "nullable": true
          },
          "lastName": {
            "type": "string",
            "nullable": true
          },
          "initials": {
            "type": "string",
            "nullable": true
          },
          "middleName": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "HmrcPForms_Int32ListContentResponse": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "type": "integer",
              "format": "int32"
            },
            "nullable": true
          },
          "metadata": {
            "$ref": "#/components/schemas/HmrcPForms_ContentMetadataResponse"
          }
        },
        "additionalProperties": false
      },
      "HmrcPForms_Int32ListResponseBody": {
        "type": "object",
        "properties": {
          "message": {
            "$ref": "#/components/schemas/HmrcPForms_MessageWithTokenResponse"
          },
          "content": {
            "$ref": "#/components/schemas/HmrcPForms_Int32ListContentResponse"
          },
          "validationIssues": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/HmrcPForms_ValidationIssue"
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "HmrcPForms_MessageWithTokenResponse": {
        "type": "object",
        "properties": {
          "text": {
            "type": "string",
            "nullable": true
          },
          "token": {
            "type": "string",
            "nullable": true
          },
          "tokenArguments": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/HmrcPForms_ValidationIssueArgument"
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "HmrcPForms_ObjectContentResponse": {
        "type": "object",
        "properties": {
          "data": {},
          "metadata": {
            "$ref": "#/components/schemas/HmrcPForms_ContentMetadataResponse"
          }
        },
        "additionalProperties": false
      },
      "HmrcPForms_ObjectResponseBody": {
        "type": "object",
        "properties": {
          "message": {
            "$ref": "#/components/schemas/HmrcPForms_MessageWithTokenResponse"
          },
          "content": {
            "$ref": "#/components/schemas/HmrcPForms_ObjectContentResponse"
          },
          "validationIssues": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/HmrcPForms_ValidationIssue"
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "HmrcPForms_OrganisationNameDto": {
        "type": "object",
        "properties": {
          "legalName": {
            "type": "string",
            "nullable": true
          },
          "tradingName": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "HmrcPForms_P32ApprenticeshipLevy": {
        "type": "object",
        "properties": {
          "apprenticeshipLevy": {
            "type": "number",
            "format": "double"
          },
          "apprenticeshipLevyToDate": {
            "type": "number",
            "format": "double"
          },
          "apprenticeshipLevyDue": {
            "type": "number",
            "format": "double"
          }
        },
        "additionalProperties": false
      },
      "HmrcPForms_P32CarriedForward": {
        "type": "object",
        "properties": {
          "nationalInsuranceEmploymentAllowanceRemaining": {
            "type": "number",
            "format": "double"
          }
        },
        "additionalProperties": false
      },
      "HmrcPForms_P32Details": {
        "type": "object",
        "properties": {
          "taxPeriod": {
            "type": "string",
            "nullable": true
          },
          "taxMonthNumber": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "taxYearStart": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "taxYearLabel": {
            "type": "string",
            "nullable": true
          },
          "dateFrom": {
            "type": "string",
            "format": "date",
            "nullable": true
          },
          "dateTo": {
            "type": "string",
            "format": "date",
            "nullable": true
          },
          "paymentDueDate": {
            "type": "string",
            "format": "date",
            "nullable": true
          },
          "paymentDueDateNominal": {
            "type": "string",
            "format": "date",
            "nullable": true
          },
          "paymentDueDateShifted": {
            "type": "boolean"
          },
          "paymentDueDateBasis": {
            "enum": [
              "Electronic",
              "Postal"
            ],
            "type": "string"
          },
          "grossPay": {
            "type": "number",
            "format": "double",
            "nullable": true
          },
          "grossPayForNationalInsurance": {
            "type": "number",
            "format": "double",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "HmrcPForms_P32Explained": {
        "type": "object",
        "properties": {
          "totalTaxExplained": {
            "type": "string",
            "nullable": true
          },
          "totalNationalInsuranceExplained": {
            "type": "string",
            "nullable": true
          },
          "totalStatutoryPaymentsRecoveredExplained": {
            "type": "string",
            "nullable": true
          },
          "totalStatutoryPaymentsNationalInsuranceCompensationExplained": {
            "type": "string",
            "nullable": true
          },
          "totalStatutoryPaymentsExplained": {
            "type": "string",
            "nullable": true
          },
          "totalTaxDueExplained": {
            "type": "string",
            "nullable": true
          },
          "netNationalInsuranceDueExplained": {
            "type": "string",
            "nullable": true
          },
          "amountDueToHmrcExplained": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "HmrcPForms_P32Form": {
        "type": "object",
        "properties": {
          "details": {
            "$ref": "#/components/schemas/HmrcPForms_P32Details"
          },
          "incomeTax": {
            "$ref": "#/components/schemas/HmrcPForms_P32IncomeTax"
          },
          "nationalInsurance": {
            "$ref": "#/components/schemas/HmrcPForms_P32NationalInsurance"
          },
          "statutoryPaymentsRecovery": {
            "$ref": "#/components/schemas/HmrcPForms_P32StatutoryPaymentsRecovery"
          },
          "apprenticeshipLevy": {
            "$ref": "#/components/schemas/HmrcPForms_P32ApprenticeshipLevy"
          },
          "cisDeductionsThisPeriod": {
            "type": "number",
            "format": "double",
            "nullable": true
          },
          "totals": {
            "$ref": "#/components/schemas/HmrcPForms_P32Totals"
          },
          "carriedForward": {
            "$ref": "#/components/schemas/HmrcPForms_P32CarriedForward"
          },
          "explained": {
            "$ref": "#/components/schemas/HmrcPForms_P32Explained"
          }
        },
        "additionalProperties": false
      },
      "HmrcPForms_P32FormContentResponse": {
        "type": "object",
        "properties": {
          "data": {
            "$ref": "#/components/schemas/HmrcPForms_P32Form"
          },
          "metadata": {
            "$ref": "#/components/schemas/HmrcPForms_ContentMetadataResponse"
          }
        },
        "additionalProperties": false
      },
      "HmrcPForms_P32FormListContentResponse": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/HmrcPForms_P32Form"
            },
            "nullable": true
          },
          "metadata": {
            "$ref": "#/components/schemas/HmrcPForms_ContentMetadataResponse"
          }
        },
        "additionalProperties": false
      },
      "HmrcPForms_P32FormListResponseBody": {
        "type": "object",
        "properties": {
          "message": {
            "$ref": "#/components/schemas/HmrcPForms_MessageWithTokenResponse"
          },
          "content": {
            "$ref": "#/components/schemas/HmrcPForms_P32FormListContentResponse"
          },
          "validationIssues": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/HmrcPForms_ValidationIssue"
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "HmrcPForms_P32FormResponseBody": {
        "type": "object",
        "properties": {
          "message": {
            "$ref": "#/components/schemas/HmrcPForms_MessageWithTokenResponse"
          },
          "content": {
            "$ref": "#/components/schemas/HmrcPForms_P32FormContentResponse"
          },
          "validationIssues": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/HmrcPForms_ValidationIssue"
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "HmrcPForms_P32IncomeTax": {
        "type": "object",
        "properties": {
          "incomeTax": {
            "type": "number",
            "format": "double"
          },
          "studentLoan": {
            "type": "number",
            "format": "double"
          },
          "postgraduateLoan": {
            "type": "number",
            "format": "double"
          },
          "totalTax": {
            "type": "number",
            "format": "double"
          }
        },
        "additionalProperties": false
      },
      "HmrcPForms_P32NationalInsurance": {
        "type": "object",
        "properties": {
          "employeeContribution": {
            "type": "number",
            "format": "double"
          },
          "employerContribution": {
            "type": "number",
            "format": "double"
          },
          "employerClass1AContribution": {
            "type": "number",
            "format": "double"
          },
          "employmentAllowanceUsed": {
            "type": "number",
            "format": "double"
          },
          "totalContribution": {
            "type": "number",
            "format": "double"
          }
        },
        "additionalProperties": false
      },
      "HmrcPForms_P32StatutoryPaymentsRecovery": {
        "type": "object",
        "properties": {
          "maternityPayRecovered": {
            "type": "number",
            "format": "double"
          },
          "maternityPayNationalInsuranceCompensation": {
            "type": "number",
            "format": "double"
          },
          "paternityPayRecovered": {
            "type": "number",
            "format": "double"
          },
          "paternityPayNationalInsuranceCompensation": {
            "type": "number",
            "format": "double"
          },
          "adoptionPayRecovered": {
            "type": "number",
            "format": "double"
          },
          "adoptionPayNationalInsuranceCompensation": {
            "type": "number",
            "format": "double"
          },
          "sharedParentalPayRecovered": {
            "type": "number",
            "format": "double"
          },
          "sharedParentalPayNationalInsuranceCompensation": {
            "type": "number",
            "format": "double"
          },
          "parentalBereavementPayRecovered": {
            "type": "number",
            "format": "double"
          },
          "parentalBereavementPayNationalInsuranceCompensation": {
            "type": "number",
            "format": "double"
          },
          "neonatalCarePayRecovered": {
            "type": "number",
            "format": "double"
          },
          "neonatalCarePayNationalInsuranceCompensation": {
            "type": "number",
            "format": "double"
          },
          "totalForRecovered": {
            "type": "number",
            "format": "double"
          },
          "totalForNationalInsuranceCompensation": {
            "type": "number",
            "format": "double"
          },
          "totalRecovery": {
            "type": "number",
            "format": "double"
          }
        },
        "additionalProperties": false
      },
      "HmrcPForms_P32Totals": {
        "type": "object",
        "properties": {
          "totalTaxDue": {
            "type": "number",
            "format": "double"
          },
          "netNationalInsuranceDue": {
            "type": "number",
            "format": "double"
          },
          "amountDueToHmrc": {
            "type": "number",
            "format": "double"
          }
        },
        "additionalProperties": false
      },
      "HmrcPForms_P45EmployeeModel": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "nullable": true
          },
          "payrollId": {
            "type": "string",
            "nullable": true
          },
          "nationalInsuranceNumber": {
            "type": "string",
            "nullable": true
          },
          "department": {
            "type": "string",
            "nullable": true
          },
          "jobTitle": {
            "type": "string",
            "nullable": true
          },
          "email": {
            "type": "string",
            "nullable": true
          },
          "name": {
            "$ref": "#/components/schemas/HmrcPForms_EmployeeNameDto"
          },
          "hasStudentLoanDeductions": {
            "type": "boolean"
          },
          "hasPostGraduateLoanDeductions": {
            "type": "boolean"
          },
          "address": {
            "$ref": "#/components/schemas/HmrcPForms_AddressDto"
          },
          "birthGender": {
            "type": "string",
            "nullable": true
          },
          "birthDate": {
            "type": "string",
            "nullable": true
          },
          "employeeLeaverDetails": {
            "$ref": "#/components/schemas/HmrcPForms_EmployeeLeaverDetailsDto"
          }
        },
        "additionalProperties": false
      },
      "HmrcPForms_P45EmployerModel": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "nullable": true
          },
          "name": {
            "$ref": "#/components/schemas/HmrcPForms_OrganisationNameDto"
          },
          "taxReferenceNumbers": {
            "$ref": "#/components/schemas/HmrcPForms_TaxReferenceNumbersDto"
          },
          "address": {
            "$ref": "#/components/schemas/HmrcPForms_AddressDto"
          }
        },
        "additionalProperties": false
      },
      "HmrcPForms_P45Model": {
        "type": "object",
        "properties": {
          "organisationId": {
            "type": "string",
            "nullable": true
          },
          "employeeId": {
            "type": "string",
            "nullable": true
          },
          "taxYear": {
            "type": "integer",
            "format": "int32"
          },
          "status": {
            "type": "string",
            "nullable": true
          },
          "fileName": {
            "type": "string",
            "nullable": true
          },
          "contentType": {
            "type": "string",
            "nullable": true
          },
          "fileSize": {
            "type": "integer",
            "format": "int64"
          },
          "eTag": {
            "type": "string",
            "nullable": true
          },
          "versionId": {
            "type": "string",
            "nullable": true
          },
          "generationVersion": {
            "type": "integer",
            "format": "int32"
          },
          "payrollConfigId": {
            "type": "string",
            "nullable": true
          },
          "finalisedDate": {
            "type": "string",
            "nullable": true
          },
          "finalisedBy": {
            "type": "string",
            "nullable": true
          },
          "replacementCount": {
            "type": "integer",
            "format": "int32"
          },
          "employeeDetails": {
            "$ref": "#/components/schemas/HmrcPForms_P45EmployeeModel"
          },
          "employerDetails": {
            "$ref": "#/components/schemas/HmrcPForms_P45EmployerModel"
          },
          "taxDetails": {
            "$ref": "#/components/schemas/HmrcPForms_P45TaxModel"
          },
          "createdDate": {
            "type": "string",
            "nullable": true
          },
          "createdBy": {
            "type": "string",
            "nullable": true
          },
          "updatedDate": {
            "type": "string",
            "nullable": true
          },
          "updatedBy": {
            "type": "string",
            "nullable": true
          },
          "lastEmailedAt": {
            "type": "string",
            "nullable": true
          },
          "lastEmailedTo": {
            "type": "string",
            "nullable": true
          },
          "lastEmailedBy": {
            "type": "string",
            "nullable": true
          },
          "lastEmailedStatus": {
            "type": "string",
            "nullable": true
          },
          "lastEmailError": {
            "type": "string",
            "nullable": true
          },
          "lockCycle": {
            "type": "integer",
            "format": "int32"
          },
          "reissuedDate": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "HmrcPForms_P45ModelContentResponse": {
        "type": "object",
        "properties": {
          "data": {
            "$ref": "#/components/schemas/HmrcPForms_P45Model"
          },
          "metadata": {
            "$ref": "#/components/schemas/HmrcPForms_ContentMetadataResponse"
          }
        },
        "additionalProperties": false
      },
      "HmrcPForms_P45ModelListContentResponse": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/HmrcPForms_P45Model"
            },
            "nullable": true
          },
          "metadata": {
            "$ref": "#/components/schemas/HmrcPForms_ContentMetadataResponse"
          }
        },
        "additionalProperties": false
      },
      "HmrcPForms_P45ModelListResponseBody": {
        "type": "object",
        "properties": {
          "message": {
            "$ref": "#/components/schemas/HmrcPForms_MessageWithTokenResponse"
          },
          "content": {
            "$ref": "#/components/schemas/HmrcPForms_P45ModelListContentResponse"
          },
          "validationIssues": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/HmrcPForms_ValidationIssue"
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "HmrcPForms_P45ModelResponseBody": {
        "type": "object",
        "properties": {
          "message": {
            "$ref": "#/components/schemas/HmrcPForms_MessageWithTokenResponse"
          },
          "content": {
            "$ref": "#/components/schemas/HmrcPForms_P45ModelContentResponse"
          },
          "validationIssues": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/HmrcPForms_ValidationIssue"
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "HmrcPForms_P45TaxModel": {
        "type": "object",
        "properties": {
          "taxCodeAtLeavingDate": {
            "type": "string",
            "nullable": true
          },
          "taxCodeWeek1Month1": {
            "type": "boolean"
          },
          "totalPayToDate": {
            "type": "number",
            "format": "double"
          },
          "totalTaxToDate": {
            "type": "number",
            "format": "double"
          },
          "totalPayInThisEmployment": {
            "type": "number",
            "format": "double"
          },
          "totalTaxInThisEmployment": {
            "type": "number",
            "format": "double"
          },
          "weekNumber": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "monthNumber": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "HmrcPForms_P45VersionModel": {
        "type": "object",
        "properties": {
          "organisationId": {
            "type": "string",
            "nullable": true
          },
          "employeeId": {
            "type": "string",
            "nullable": true
          },
          "taxYear": {
            "type": "integer",
            "format": "int32"
          },
          "lockCycle": {
            "type": "integer",
            "format": "int32"
          },
          "fileName": {
            "type": "string",
            "nullable": true
          },
          "finalisedDate": {
            "type": "string",
            "nullable": true
          },
          "reissuedDate": {
            "type": "string",
            "nullable": true
          },
          "keptDate": {
            "type": "string",
            "nullable": true
          },
          "reopenedLockCycle": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "reopenedDate": {
            "type": "string",
            "nullable": true
          },
          "taxDetails": {
            "$ref": "#/components/schemas/HmrcPForms_P45TaxModel"
          },
          "lastEmailedAt": {
            "type": "string",
            "nullable": true
          },
          "lastEmailedTo": {
            "type": "string",
            "nullable": true
          },
          "lastEmailedStatus": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "HmrcPForms_P45VersionModelListContentResponse": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/HmrcPForms_P45VersionModel"
            },
            "nullable": true
          },
          "metadata": {
            "$ref": "#/components/schemas/HmrcPForms_ContentMetadataResponse"
          }
        },
        "additionalProperties": false
      },
      "HmrcPForms_P45VersionModelListResponseBody": {
        "type": "object",
        "properties": {
          "message": {
            "$ref": "#/components/schemas/HmrcPForms_MessageWithTokenResponse"
          },
          "content": {
            "$ref": "#/components/schemas/HmrcPForms_P45VersionModelListContentResponse"
          },
          "validationIssues": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/HmrcPForms_ValidationIssue"
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "HmrcPForms_P60Model": {
        "type": "object",
        "properties": {
          "organisationId": {
            "type": "string",
            "nullable": true
          },
          "employeeId": {
            "type": "string",
            "nullable": true
          },
          "taxYear": {
            "type": "integer",
            "format": "int32"
          },
          "status": {
            "type": "string",
            "nullable": true
          },
          "fileName": {
            "type": "string",
            "nullable": true
          },
          "contentType": {
            "type": "string",
            "nullable": true
          },
          "fileSize": {
            "type": "integer",
            "format": "int64"
          },
          "eTag": {
            "type": "string",
            "nullable": true
          },
          "versionId": {
            "type": "string",
            "nullable": true
          },
          "generationVersion": {
            "type": "integer",
            "format": "int32"
          },
          "payrollConfigId": {
            "type": "string",
            "nullable": true
          },
          "finalisedDate": {
            "type": "string",
            "nullable": true
          },
          "finalisedBy": {
            "type": "string",
            "nullable": true
          },
          "replacementCount": {
            "type": "integer",
            "format": "int32"
          },
          "createdDate": {
            "type": "string",
            "nullable": true
          },
          "createdBy": {
            "type": "string",
            "nullable": true
          },
          "updatedDate": {
            "type": "string",
            "nullable": true
          },
          "updatedBy": {
            "type": "string",
            "nullable": true
          },
          "lastEmailedAt": {
            "type": "string",
            "nullable": true
          },
          "lastEmailedTo": {
            "type": "string",
            "nullable": true
          },
          "lastEmailedBy": {
            "type": "string",
            "nullable": true
          },
          "lastEmailedStatus": {
            "type": "string",
            "nullable": true
          },
          "lastEmailError": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "HmrcPForms_P60ModelContentResponse": {
        "type": "object",
        "properties": {
          "data": {
            "$ref": "#/components/schemas/HmrcPForms_P60Model"
          },
          "metadata": {
            "$ref": "#/components/schemas/HmrcPForms_ContentMetadataResponse"
          }
        },
        "additionalProperties": false
      },
      "HmrcPForms_P60ModelListContentResponse": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/HmrcPForms_P60Model"
            },
            "nullable": true
          },
          "metadata": {
            "$ref": "#/components/schemas/HmrcPForms_ContentMetadataResponse"
          }
        },
        "additionalProperties": false
      },
      "HmrcPForms_P60ModelListResponseBody": {
        "type": "object",
        "properties": {
          "message": {
            "$ref": "#/components/schemas/HmrcPForms_MessageWithTokenResponse"
          },
          "content": {
            "$ref": "#/components/schemas/HmrcPForms_P60ModelListContentResponse"
          },
          "validationIssues": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/HmrcPForms_ValidationIssue"
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "HmrcPForms_P60ModelResponseBody": {
        "type": "object",
        "properties": {
          "message": {
            "$ref": "#/components/schemas/HmrcPForms_MessageWithTokenResponse"
          },
          "content": {
            "$ref": "#/components/schemas/HmrcPForms_P60ModelContentResponse"
          },
          "validationIssues": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/HmrcPForms_ValidationIssue"
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "HmrcPForms_PFormBulkSendJobModel": {
        "type": "object",
        "properties": {
          "jobId": {
            "type": "string",
            "nullable": true
          },
          "formType": {
            "type": "string",
            "nullable": true
          },
          "taxYear": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "status": {
            "type": "string",
            "nullable": true
          },
          "totalCount": {
            "type": "integer",
            "format": "int32"
          },
          "succeededCount": {
            "type": "integer",
            "format": "int32"
          },
          "failedCount": {
            "type": "integer",
            "format": "int32"
          },
          "failures": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/HmrcPForms_PFormSendFailureModel"
            },
            "nullable": true
          },
          "requestedEmployeeIds": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "nullable": true
          },
          "createdDate": {
            "type": "string",
            "nullable": true
          },
          "updatedDate": {
            "type": "string",
            "nullable": true
          },
          "startedDate": {
            "type": "string",
            "nullable": true
          },
          "completedDate": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "HmrcPForms_PFormBulkSendJobModelContentResponse": {
        "type": "object",
        "properties": {
          "data": {
            "$ref": "#/components/schemas/HmrcPForms_PFormBulkSendJobModel"
          },
          "metadata": {
            "$ref": "#/components/schemas/HmrcPForms_ContentMetadataResponse"
          }
        },
        "additionalProperties": false
      },
      "HmrcPForms_PFormBulkSendJobModelResponseBody": {
        "type": "object",
        "properties": {
          "message": {
            "$ref": "#/components/schemas/HmrcPForms_MessageWithTokenResponse"
          },
          "content": {
            "$ref": "#/components/schemas/HmrcPForms_PFormBulkSendJobModelContentResponse"
          },
          "validationIssues": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/HmrcPForms_ValidationIssue"
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "HmrcPForms_PFormSendFailureModel": {
        "type": "object",
        "properties": {
          "employeeId": {
            "type": "string",
            "nullable": true
          },
          "reason": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "HmrcPForms_PayeReferenceNumberDto": {
        "type": "object",
        "properties": {
          "officeNumber": {
            "type": "string",
            "nullable": true
          },
          "referenceNumber": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "HmrcPForms_SendP45NotificationRequest": {
        "type": "object",
        "properties": {
          "employeeIds": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "HmrcPForms_SendP45NotificationResponse": {
        "type": "object",
        "properties": {
          "jobId": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "HmrcPForms_SendP45NotificationResponseContentResponse": {
        "type": "object",
        "properties": {
          "data": {
            "$ref": "#/components/schemas/HmrcPForms_SendP45NotificationResponse"
          },
          "metadata": {
            "$ref": "#/components/schemas/HmrcPForms_ContentMetadataResponse"
          }
        },
        "additionalProperties": false
      },
      "HmrcPForms_SendP45NotificationResponseResponseBody": {
        "type": "object",
        "properties": {
          "message": {
            "$ref": "#/components/schemas/HmrcPForms_MessageWithTokenResponse"
          },
          "content": {
            "$ref": "#/components/schemas/HmrcPForms_SendP45NotificationResponseContentResponse"
          },
          "validationIssues": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/HmrcPForms_ValidationIssue"
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "HmrcPForms_SendP60NotificationRequest": {
        "type": "object",
        "properties": {
          "taxYear": {
            "type": "integer",
            "format": "int32"
          },
          "employeeIds": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "HmrcPForms_SendP60NotificationResponse": {
        "type": "object",
        "properties": {
          "jobId": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "HmrcPForms_SendP60NotificationResponseContentResponse": {
        "type": "object",
        "properties": {
          "data": {
            "$ref": "#/components/schemas/HmrcPForms_SendP60NotificationResponse"
          },
          "metadata": {
            "$ref": "#/components/schemas/HmrcPForms_ContentMetadataResponse"
          }
        },
        "additionalProperties": false
      },
      "HmrcPForms_SendP60NotificationResponseResponseBody": {
        "type": "object",
        "properties": {
          "message": {
            "$ref": "#/components/schemas/HmrcPForms_MessageWithTokenResponse"
          },
          "content": {
            "$ref": "#/components/schemas/HmrcPForms_SendP60NotificationResponseContentResponse"
          },
          "validationIssues": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/HmrcPForms_ValidationIssue"
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "HmrcPForms_TaxReferenceNumbersDto": {
        "type": "object",
        "properties": {
          "employerPayeReference": {
            "$ref": "#/components/schemas/HmrcPForms_PayeReferenceNumberDto"
          },
          "accountsOfficeReference": {
            "type": "string",
            "nullable": true
          },
          "selfAssessmentUniqueTaxpayerReference": {
            "type": "string",
            "nullable": true
          },
          "corporationTaxReferenceUniqueTaxpayerReference": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "HmrcPForms_ValidationIssue": {
        "type": "object",
        "properties": {
          "field": {
            "type": "string",
            "nullable": true
          },
          "reason": {
            "type": "string",
            "nullable": true
          },
          "reasonToken": {
            "type": "string",
            "nullable": true
          },
          "reasonTokenArguments": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/HmrcPForms_ValidationIssueArgument"
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "HmrcPForms_ValidationIssueArgument": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "nullable": true
          },
          "value": {}
        },
        "additionalProperties": false
      },
      "Billing_AccountCodeDto": {
        "type": "object",
        "properties": {
          "code": {
            "type": "string",
            "description": "Account code (e.g., \"200\", \"SALES\")."
          },
          "name": {
            "type": "string"
          },
          "type": {
            "enum": [
              "Revenue",
              "Expense",
              "Asset",
              "Liability",
              "Equity"
            ],
            "type": "string",
            "description": "Which side of the ledger an account sits on."
          },
          "status": {
            "enum": [
              "Active",
              "Archived"
            ],
            "type": "string",
            "description": "Status of an account code."
          },
          "taxType": {
            "type": "string",
            "description": "Default tax type for this account.",
            "nullable": true
          },
          "description": {
            "type": "string",
            "nullable": true
          },
          "organisationId": {
            "type": "string"
          },
          "isInUse": {
            "type": "boolean",
            "description": "True when this account code is referenced by credit notes or client finance settings; delete is not allowed (use archive instead)."
          },
          "providerId": {
            "type": "string",
            "description": "The accounting system's own id for this account. Without it a later edit asks for the code to be created again.",
            "nullable": true
          },
          "externalProvider": {
            "type": "string",
            "description": "Which accounting system holds it, as the integrations hub named it.",
            "nullable": true
          },
          "syncStatus": {
            "enum": [
              "NotSynced",
              "Synced",
              "SyncFailed",
              "Syncing",
              "NeedsAttention"
            ],
            "type": "string",
            "description": "Sync status with external provider.",
            "nullable": true
          },
          "lastSyncedAt": {
            "type": "string",
            "description": "When the accounting system last synced this (UTC, ISO 8601).\n            \n\nThe provider's own moment, not when this service recorded\nthe answer, so it is safe to reconcile against the provider's\nrecords and does not move with our internal queue timings. Null\nuntil a send has succeeded.",
            "nullable": true
          },
          "syncErrorMessage": {
            "type": "string",
            "description": "Last sync error message when sync failed.",
            "nullable": true
          },
          "createdDate": {
            "type": "string",
            "nullable": true
          },
          "createdBy": {
            "type": "string",
            "nullable": true
          },
          "updatedDate": {
            "type": "string",
            "nullable": true
          },
          "updatedBy": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "description": "One line of this organisation's chart of accounts."
      },
      "Billing_AccountCodeDtoContentResponse": {
        "type": "object",
        "properties": {
          "data": {
            "$ref": "#/components/schemas/Billing_AccountCodeDto"
          },
          "metadata": {
            "$ref": "#/components/schemas/Billing_ContentMetadataResponse"
          }
        },
        "additionalProperties": false
      },
      "Billing_AccountCodeDtoResponseBody": {
        "required": [
          "message"
        ],
        "type": "object",
        "properties": {
          "message": {
            "$ref": "#/components/schemas/Billing_MessageWithTokenResponse"
          },
          "content": {
            "$ref": "#/components/schemas/Billing_AccountCodeDtoContentResponse"
          },
          "validationIssues": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Billing_ValidationIssue"
            },
            "nullable": true
          },
          "errors": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Billing_Error"
            },
            "description": "Deprecated: the same issues as `validationIssues` (`reasonText` is `reason`, `reasonId` is `reasonToken`, `reasonParameters` is `reasonTokenArguments`). Read `validationIssues`; this will be removed.",
            "nullable": true,
            "readOnly": true,
            "deprecated": true
          },
          "metadata": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Billing_ContentMetadataResponse"
              }
            ],
            "description": "Deprecated: the same values as `content.metadata`. Read that; this will be removed.",
            "deprecated": true
          }
        },
        "additionalProperties": false,
        "description": "Billing's response envelope: the platform's (`message.text` + `message.token`,\n`content.data` + `content.metadata`, `validationIssues`) plus the fields billing\nsent before it (PRODLAUNCH-416). Those are deprecated, removed on 31 December 2026, and are\nprojections of their replacements so the two cannot disagree."
      },
      "Billing_AccountingSendRefusalDto": {
        "required": [
          "reasonMessage",
          "reasonToken"
        ],
        "type": "object",
        "properties": {
          "reasonToken": {
            "type": "string",
            "description": "Stable, destination-agnostic reason code. One of\n`document_not_found`, `accounting_not_linked`,\n`connection_not_callable`, `accounting_send_in_flight` or\n`accounting_document_not_sent`."
          },
          "reasonMessage": {
            "type": "string",
            "description": "Default English for `reasonToken`, safe to show a user as-is.\nWording may change between releases; the token will not."
          }
        },
        "additionalProperties": false,
        "description": "Why a document could not be sent to the accounting system."
      },
      "Billing_AccountingSendRefusalDtoContentResponse": {
        "type": "object",
        "properties": {
          "data": {
            "$ref": "#/components/schemas/Billing_AccountingSendRefusalDto"
          },
          "metadata": {
            "$ref": "#/components/schemas/Billing_ContentMetadataResponse"
          }
        },
        "additionalProperties": false
      },
      "Billing_AccountingSendRefusalDtoResponseBody": {
        "required": [
          "message"
        ],
        "type": "object",
        "properties": {
          "message": {
            "$ref": "#/components/schemas/Billing_MessageWithTokenResponse"
          },
          "content": {
            "$ref": "#/components/schemas/Billing_AccountingSendRefusalDtoContentResponse"
          },
          "validationIssues": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Billing_ValidationIssue"
            },
            "nullable": true
          },
          "errors": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Billing_Error"
            },
            "description": "Deprecated: the same issues as `validationIssues` (`reasonText` is `reason`, `reasonId` is `reasonToken`, `reasonParameters` is `reasonTokenArguments`). Read `validationIssues`; this will be removed.",
            "nullable": true,
            "readOnly": true,
            "deprecated": true
          },
          "metadata": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Billing_ContentMetadataResponse"
              }
            ],
            "description": "Deprecated: the same values as `content.metadata`. Read that; this will be removed.",
            "deprecated": true
          }
        },
        "additionalProperties": false,
        "description": "Billing's response envelope: the platform's (`message.text` + `message.token`,\n`content.data` + `content.metadata`, `validationIssues`) plus the fields billing\nsent before it (PRODLAUNCH-416). Those are deprecated, removed on 31 December 2026, and are\nprojections of their replacements so the two cannot disagree."
      },
      "Billing_AddDocumentAttachmentsRequestDto": {
        "type": "object",
        "properties": {
          "attachments": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Billing_CreateDocumentAttachmentRequestDto"
            }
          }
        },
        "additionalProperties": false,
        "description": "Request to add one or more attachments to a document (invoice or credit note). Returns where to upload each file."
      },
      "Billing_AddressDto": {
        "type": "object",
        "properties": {
          "line1": {
            "type": "string",
            "nullable": true
          },
          "line2": {
            "type": "string",
            "nullable": true
          },
          "city": {
            "type": "string",
            "nullable": true
          },
          "county": {
            "type": "string",
            "nullable": true
          },
          "postcode": {
            "type": "string",
            "nullable": true
          },
          "countryCode": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Billing_AllocateCreditRequest": {
        "type": "object",
        "properties": {
          "organisationId": {
            "type": "string"
          },
          "clientId": {
            "type": "string"
          },
          "creditNoteId": {
            "type": "string"
          },
          "invoiceId": {
            "type": "string"
          },
          "amount": {
            "type": "number",
            "format": "double"
          }
        },
        "additionalProperties": false,
        "description": "Request to allocate a credit note to an invoice."
      },
      "Billing_AllocationDto": {
        "type": "object",
        "properties": {
          "allocationId": {
            "type": "string"
          },
          "creditNoteId": {
            "type": "string"
          },
          "invoiceId": {
            "type": "string"
          },
          "amount": {
            "type": "number",
            "format": "double"
          },
          "date": {
            "type": "string"
          },
          "invoice": {
            "$ref": "#/components/schemas/Billing_AllocationInvoiceDto"
          }
        },
        "additionalProperties": false,
        "description": "Represents an allocation of a credit note to an invoice."
      },
      "Billing_AllocationDtoContentResponse": {
        "type": "object",
        "properties": {
          "data": {
            "$ref": "#/components/schemas/Billing_AllocationDto"
          },
          "metadata": {
            "$ref": "#/components/schemas/Billing_ContentMetadataResponse"
          }
        },
        "additionalProperties": false
      },
      "Billing_AllocationDtoResponseBody": {
        "required": [
          "message"
        ],
        "type": "object",
        "properties": {
          "message": {
            "$ref": "#/components/schemas/Billing_MessageWithTokenResponse"
          },
          "content": {
            "$ref": "#/components/schemas/Billing_AllocationDtoContentResponse"
          },
          "validationIssues": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Billing_ValidationIssue"
            },
            "nullable": true
          },
          "errors": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Billing_Error"
            },
            "description": "Deprecated: the same issues as `validationIssues` (`reasonText` is `reason`, `reasonId` is `reasonToken`, `reasonParameters` is `reasonTokenArguments`). Read `validationIssues`; this will be removed.",
            "nullable": true,
            "readOnly": true,
            "deprecated": true
          },
          "metadata": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Billing_ContentMetadataResponse"
              }
            ],
            "description": "Deprecated: the same values as `content.metadata`. Read that; this will be removed.",
            "deprecated": true
          }
        },
        "additionalProperties": false,
        "description": "Billing's response envelope: the platform's (`message.text` + `message.token`,\n`content.data` + `content.metadata`, `validationIssues`) plus the fields billing\nsent before it (PRODLAUNCH-416). Those are deprecated, removed on 31 December 2026, and are\nprojections of their replacements so the two cannot disagree."
      },
      "Billing_AllocationInvoiceDto": {
        "type": "object",
        "properties": {
          "invoiceId": {
            "type": "string"
          },
          "invoiceNumber": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "description": "Invoice details for allocation display."
      },
      "Billing_ApiResponse_AccountCodeDto": {
        "allOf": [
          {
            "$ref": "#/components/schemas/Billing_AccountCodeDtoResponseBody"
          }
        ],
        "description": "Deprecated: renamed to `AccountCodeDtoResponseBody`, which has the same fields and more.",
        "deprecated": true
      },
      "Billing_ApiResponse_AccountingSendRefusalDto": {
        "allOf": [
          {
            "$ref": "#/components/schemas/Billing_AccountingSendRefusalDtoResponseBody"
          }
        ],
        "description": "Deprecated: renamed to `AccountingSendRefusalDtoResponseBody`, which has the same fields and more.",
        "deprecated": true
      },
      "Billing_ApiResponse_AllocationDto": {
        "allOf": [
          {
            "$ref": "#/components/schemas/Billing_AllocationDtoResponseBody"
          }
        ],
        "description": "Deprecated: renamed to `AllocationDtoResponseBody`, which has the same fields and more.",
        "deprecated": true
      },
      "Billing_ApiResponse_AttachmentLimitsDto": {
        "allOf": [
          {
            "$ref": "#/components/schemas/Billing_AttachmentLimitsDtoResponseBody"
          }
        ],
        "description": "Deprecated: renamed to `AttachmentLimitsDtoResponseBody`, which has the same fields and more.",
        "deprecated": true
      },
      "Billing_ApiResponse_BulkInvoiceActionResponseDto": {
        "allOf": [
          {
            "$ref": "#/components/schemas/Billing_BulkInvoiceActionResponseDtoResponseBody"
          }
        ],
        "description": "Deprecated: renamed to `BulkInvoiceActionResponseDtoResponseBody`, which has the same fields and more.",
        "deprecated": true
      },
      "Billing_ApiResponse_ClientDto": {
        "allOf": [
          {
            "$ref": "#/components/schemas/Billing_ClientDtoResponseBody"
          }
        ],
        "description": "Deprecated: renamed to `ClientDtoResponseBody`, which has the same fields and more.",
        "deprecated": true
      },
      "Billing_ApiResponse_ClientFinanceSettingsDto": {
        "allOf": [
          {
            "$ref": "#/components/schemas/Billing_ClientFinanceSettingsDtoResponseBody"
          }
        ],
        "description": "Deprecated: renamed to `ClientFinanceSettingsDtoResponseBody`, which has the same fields and more.",
        "deprecated": true
      },
      "Billing_ApiResponse_CreditNoteDto": {
        "allOf": [
          {
            "$ref": "#/components/schemas/Billing_CreditNoteDtoResponseBody"
          }
        ],
        "description": "Deprecated: renamed to `CreditNoteDtoResponseBody`, which has the same fields and more.",
        "deprecated": true
      },
      "Billing_ApiResponse_DocumentTemplateDto": {
        "allOf": [
          {
            "$ref": "#/components/schemas/Billing_DocumentTemplateDtoResponseBody"
          }
        ],
        "description": "Deprecated: renamed to `DocumentTemplateDtoResponseBody`, which has the same fields and more.",
        "deprecated": true
      },
      "Billing_ApiResponse_ErrorContent": {
        "allOf": [
          {
            "$ref": "#/components/schemas/Billing_ObjectResponseBody"
          }
        ],
        "description": "Deprecated: renamed to `ObjectResponseBody`, which has the same fields and more.",
        "deprecated": true
      },
      "Billing_ApiResponse_IReadOnlyList_AccountCodeDto": {
        "allOf": [
          {
            "$ref": "#/components/schemas/Billing_IReadOnlyListAccountCodeDtoResponseBody"
          }
        ],
        "description": "Deprecated: renamed to `IReadOnlyListAccountCodeDtoResponseBody`, which has the same fields and more.",
        "deprecated": true
      },
      "Billing_ApiResponse_IReadOnlyList_CreditNoteDto": {
        "allOf": [
          {
            "$ref": "#/components/schemas/Billing_IReadOnlyListCreditNoteDtoResponseBody"
          }
        ],
        "description": "Deprecated: renamed to `IReadOnlyListCreditNoteDtoResponseBody`, which has the same fields and more.",
        "deprecated": true
      },
      "Billing_ApiResponse_IReadOnlyList_DocumentAttachmentUploadResponseDto": {
        "allOf": [
          {
            "$ref": "#/components/schemas/Billing_IReadOnlyListDocumentAttachmentUploadResponseDtoResponseBody"
          }
        ],
        "description": "Deprecated: renamed to `IReadOnlyListDocumentAttachmentUploadResponseDtoResponseBody`, which has the same fields and more.",
        "deprecated": true
      },
      "Billing_ApiResponse_IReadOnlyList_InvoiceReferenceFieldDto": {
        "allOf": [
          {
            "$ref": "#/components/schemas/Billing_IReadOnlyListInvoiceReferenceFieldDtoResponseBody"
          }
        ],
        "description": "Deprecated: renamed to `IReadOnlyListInvoiceReferenceFieldDtoResponseBody`, which has the same fields and more.",
        "deprecated": true
      },
      "Billing_ApiResponse_IReadOnlyList_LineItemDescriptionFieldDto": {
        "allOf": [
          {
            "$ref": "#/components/schemas/Billing_IReadOnlyListLineItemDescriptionFieldDtoResponseBody"
          }
        ],
        "description": "Deprecated: renamed to `IReadOnlyListLineItemDescriptionFieldDtoResponseBody`, which has the same fields and more.",
        "deprecated": true
      },
      "Billing_ApiResponse_IReadOnlyList_TaxRateDto": {
        "allOf": [
          {
            "$ref": "#/components/schemas/Billing_IReadOnlyListTaxRateDtoResponseBody"
          }
        ],
        "description": "Deprecated: renamed to `IReadOnlyListTaxRateDtoResponseBody`, which has the same fields and more.",
        "deprecated": true
      },
      "Billing_ApiResponse_ImportSummaryDto": {
        "allOf": [
          {
            "$ref": "#/components/schemas/Billing_ImportSummaryDtoResponseBody"
          }
        ],
        "description": "Deprecated: renamed to `ImportSummaryDtoResponseBody`, which has the same fields and more.",
        "deprecated": true
      },
      "Billing_ApiResponse_InvoiceDto": {
        "allOf": [
          {
            "$ref": "#/components/schemas/Billing_InvoiceDtoResponseBody"
          }
        ],
        "description": "Deprecated: renamed to `InvoiceDtoResponseBody`, which has the same fields and more.",
        "deprecated": true
      },
      "Billing_ApiResponse_ListClientsResponse": {
        "allOf": [
          {
            "$ref": "#/components/schemas/Billing_ListClientsResponseResponseBody"
          }
        ],
        "description": "Deprecated: renamed to `ListClientsResponseResponseBody`, which has the same fields and more.",
        "deprecated": true
      },
      "Billing_ApiResponse_ListCreditNoteLineItemsResponse": {
        "allOf": [
          {
            "$ref": "#/components/schemas/Billing_ListCreditNoteLineItemsResponseResponseBody"
          }
        ],
        "description": "Deprecated: renamed to `ListCreditNoteLineItemsResponseResponseBody`, which has the same fields and more.",
        "deprecated": true
      },
      "Billing_ApiResponse_ListCreditNotesByOrgResponse": {
        "allOf": [
          {
            "$ref": "#/components/schemas/Billing_ListCreditNotesByOrgResponseResponseBody"
          }
        ],
        "description": "Deprecated: renamed to `ListCreditNotesByOrgResponseResponseBody`, which has the same fields and more.",
        "deprecated": true
      },
      "Billing_ApiResponse_ListInvoiceLineItemsResponse": {
        "allOf": [
          {
            "$ref": "#/components/schemas/Billing_ListInvoiceLineItemsResponseResponseBody"
          }
        ],
        "description": "Deprecated: renamed to `ListInvoiceLineItemsResponseResponseBody`, which has the same fields and more.",
        "deprecated": true
      },
      "Billing_ApiResponse_ListInvoicesResponse": {
        "allOf": [
          {
            "$ref": "#/components/schemas/Billing_ListInvoicesResponseResponseBody"
          }
        ],
        "description": "Deprecated: renamed to `ListInvoicesResponseResponseBody`, which has the same fields and more.",
        "deprecated": true
      },
      "Billing_ApiResponse_Object": {
        "allOf": [
          {
            "$ref": "#/components/schemas/Billing_ObjectResponseBody"
          }
        ],
        "description": "Deprecated: renamed to `ObjectResponseBody`, which has the same fields and more.",
        "deprecated": true
      },
      "Billing_ApiResponse_OrganisationFinanceDefaultsDto": {
        "allOf": [
          {
            "$ref": "#/components/schemas/Billing_OrganisationFinanceDefaultsDtoResponseBody"
          }
        ],
        "description": "Deprecated: renamed to `OrganisationFinanceDefaultsDtoResponseBody`, which has the same fields and more.",
        "deprecated": true
      },
      "Billing_ApiResponse_OrganisationPayElementMappingsDto": {
        "allOf": [
          {
            "$ref": "#/components/schemas/Billing_OrganisationPayElementMappingsDtoResponseBody"
          }
        ],
        "description": "Deprecated: renamed to `OrganisationPayElementMappingsDtoResponseBody`, which has the same fields and more.",
        "deprecated": true
      },
      "Billing_ApiResponse_ProviderAccountsListResponse": {
        "allOf": [
          {
            "$ref": "#/components/schemas/Billing_ProviderAccountsListResponseResponseBody"
          }
        ],
        "description": "Deprecated: renamed to `ProviderAccountsListResponseResponseBody`, which has the same fields and more.",
        "deprecated": true
      },
      "Billing_ApiResponse_ProviderContactsListResponse": {
        "allOf": [
          {
            "$ref": "#/components/schemas/Billing_ProviderContactsListResponseResponseBody"
          }
        ],
        "description": "Deprecated: renamed to `ProviderContactsListResponseResponseBody`, which has the same fields and more.",
        "deprecated": true
      },
      "Billing_ApiResponse_ProviderTaxRatesListResponse": {
        "allOf": [
          {
            "$ref": "#/components/schemas/Billing_ProviderTaxRatesListResponseResponseBody"
          }
        ],
        "description": "Deprecated: renamed to `ProviderTaxRatesListResponseResponseBody`, which has the same fields and more.",
        "deprecated": true
      },
      "Billing_ApiResponse_RefreshLineItemMappingsResponse": {
        "allOf": [
          {
            "$ref": "#/components/schemas/Billing_RefreshLineItemMappingsResponseResponseBody"
          }
        ],
        "description": "Deprecated: renamed to `RefreshLineItemMappingsResponseResponseBody`, which has the same fields and more.",
        "deprecated": true
      },
      "Billing_ApiResponse_String": {
        "allOf": [
          {
            "$ref": "#/components/schemas/Billing_StringResponseBody"
          }
        ],
        "description": "Deprecated: renamed to `StringResponseBody`, which has the same fields and more.",
        "deprecated": true
      },
      "Billing_ApiResponse_TaxRateDto": {
        "allOf": [
          {
            "$ref": "#/components/schemas/Billing_TaxRateDtoResponseBody"
          }
        ],
        "description": "Deprecated: renamed to `TaxRateDtoResponseBody`, which has the same fields and more.",
        "deprecated": true
      },
      "Billing_AppliedCreditDto": {
        "type": "object",
        "properties": {
          "creditNoteId": {
            "type": "string"
          },
          "amountApplied": {
            "type": "number",
            "format": "double"
          },
          "appliedDate": {
            "type": "string"
          }
        },
        "additionalProperties": false,
        "description": "Represents a credit note applied to an invoice (for invoice summary / AppliedCredits list)."
      },
      "Billing_AttachmentLimitsDto": {
        "type": "object",
        "properties": {
          "connectedProvider": {
            "type": "string",
            "description": "What the connected accounting system is called, or null when none is.",
            "nullable": true
          },
          "maxPerInvoice": {
            "type": "integer",
            "description": "Files allowed on one invoice, or null when no limit is declared.",
            "format": "int32",
            "nullable": true
          },
          "maxPerCreditNote": {
            "type": "integer",
            "description": "Files allowed on one credit note, or null when no limit is declared.",
            "format": "int32",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "description": "How many files the connected accounting system will hold against one document.\nRead by the template screen so it can say so before somebody attaches more than that. Nulls mean nothing is connected, or no limit is declared."
      },
      "Billing_AttachmentLimitsDtoContentResponse": {
        "type": "object",
        "properties": {
          "data": {
            "$ref": "#/components/schemas/Billing_AttachmentLimitsDto"
          },
          "metadata": {
            "$ref": "#/components/schemas/Billing_ContentMetadataResponse"
          }
        },
        "additionalProperties": false
      },
      "Billing_AttachmentLimitsDtoResponseBody": {
        "required": [
          "message"
        ],
        "type": "object",
        "properties": {
          "message": {
            "$ref": "#/components/schemas/Billing_MessageWithTokenResponse"
          },
          "content": {
            "$ref": "#/components/schemas/Billing_AttachmentLimitsDtoContentResponse"
          },
          "validationIssues": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Billing_ValidationIssue"
            },
            "nullable": true
          },
          "errors": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Billing_Error"
            },
            "description": "Deprecated: the same issues as `validationIssues` (`reasonText` is `reason`, `reasonId` is `reasonToken`, `reasonParameters` is `reasonTokenArguments`). Read `validationIssues`; this will be removed.",
            "nullable": true,
            "readOnly": true,
            "deprecated": true
          },
          "metadata": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Billing_ContentMetadataResponse"
              }
            ],
            "description": "Deprecated: the same values as `content.metadata`. Read that; this will be removed.",
            "deprecated": true
          }
        },
        "additionalProperties": false,
        "description": "Billing's response envelope: the platform's (`message.text` + `message.token`,\n`content.data` + `content.metadata`, `validationIssues`) plus the fields billing\nsent before it (PRODLAUNCH-416). Those are deprecated, removed on 31 December 2026, and are\nprojections of their replacements so the two cannot disagree."
      },
      "Billing_AuthoriseRequest": {
        "type": "object",
        "additionalProperties": false,
        "description": "Request to authorise a credit note. UserId is taken from JWT (Claim)."
      },
      "Billing_BulkInvoiceActionErrorDto": {
        "type": "object",
        "properties": {
          "clientId": {
            "type": "string"
          },
          "invoiceId": {
            "type": "string"
          },
          "message": {
            "type": "string"
          }
        },
        "additionalProperties": false,
        "description": "Per-item error for bulk action (clientId, invoiceId, message)."
      },
      "Billing_BulkInvoiceActionItemDto": {
        "type": "object",
        "properties": {
          "clientId": {
            "type": "string"
          },
          "invoiceId": {
            "type": "string"
          }
        },
        "additionalProperties": false,
        "description": "Identifies a single invoice for bulk action (clientId + invoiceId)."
      },
      "Billing_BulkInvoiceActionRequestDto": {
        "type": "object",
        "properties": {
          "action": {
            "enum": [
              "Issue",
              "Email"
            ],
            "type": "string"
          },
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Billing_BulkInvoiceActionItemDto"
            }
          }
        },
        "additionalProperties": false,
        "description": "Request body for POST /invoices/bulk-action."
      },
      "Billing_BulkInvoiceActionResponseDto": {
        "type": "object",
        "properties": {
          "requestedCount": {
            "type": "integer",
            "format": "int32"
          },
          "successCount": {
            "type": "integer",
            "format": "int32"
          },
          "failedCount": {
            "type": "integer",
            "format": "int32"
          },
          "errors": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Billing_BulkInvoiceActionErrorDto"
            }
          }
        },
        "additionalProperties": false,
        "description": "Response for bulk invoice action (summary counts and optional per-item errors)."
      },
      "Billing_BulkInvoiceActionResponseDtoContentResponse": {
        "type": "object",
        "properties": {
          "data": {
            "$ref": "#/components/schemas/Billing_BulkInvoiceActionResponseDto"
          },
          "metadata": {
            "$ref": "#/components/schemas/Billing_ContentMetadataResponse"
          }
        },
        "additionalProperties": false
      },
      "Billing_BulkInvoiceActionResponseDtoResponseBody": {
        "required": [
          "message"
        ],
        "type": "object",
        "properties": {
          "message": {
            "$ref": "#/components/schemas/Billing_MessageWithTokenResponse"
          },
          "content": {
            "$ref": "#/components/schemas/Billing_BulkInvoiceActionResponseDtoContentResponse"
          },
          "validationIssues": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Billing_ValidationIssue"
            },
            "nullable": true
          },
          "errors": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Billing_Error"
            },
            "description": "Deprecated: the same issues as `validationIssues` (`reasonText` is `reason`, `reasonId` is `reasonToken`, `reasonParameters` is `reasonTokenArguments`). Read `validationIssues`; this will be removed.",
            "nullable": true,
            "readOnly": true,
            "deprecated": true
          },
          "metadata": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Billing_ContentMetadataResponse"
              }
            ],
            "description": "Deprecated: the same values as `content.metadata`. Read that; this will be removed.",
            "deprecated": true
          }
        },
        "additionalProperties": false,
        "description": "Billing's response envelope: the platform's (`message.text` + `message.token`,\n`content.data` + `content.metadata`, `validationIssues`) plus the fields billing\nsent before it (PRODLAUNCH-416). Those are deprecated, removed on 31 December 2026, and are\nprojections of their replacements so the two cannot disagree."
      },
      "Billing_ClientDto": {
        "allOf": [
          {
            "$ref": "#/components/schemas/Billing_UpdatableClientDto"
          },
          {
            "required": [
              "createdBy",
              "createdDate",
              "organisationId",
              "updatedBy",
              "updatedDate"
            ],
            "type": "object",
            "properties": {
              "organisationId": {
                "type": "string",
                "description": "Organisation ID"
              },
              "createdDate": {
                "type": "string",
                "description": "Created date"
              },
              "createdBy": {
                "type": "string",
                "description": "Created by"
              },
              "updatedDate": {
                "type": "string",
                "description": "Updated date"
              },
              "updatedBy": {
                "type": "string",
                "description": "Updated by"
              },
              "financeSettings": {
                "$ref": "#/components/schemas/Billing_ClientFinanceSettingsDto"
              }
            },
            "additionalProperties": false
          }
        ],
        "description": "Client DTO"
      },
      "Billing_ClientDtoContentResponse": {
        "type": "object",
        "properties": {
          "data": {
            "$ref": "#/components/schemas/Billing_ClientDto"
          },
          "metadata": {
            "$ref": "#/components/schemas/Billing_ContentMetadataResponse"
          }
        },
        "additionalProperties": false
      },
      "Billing_ClientDtoResponseBody": {
        "required": [
          "message"
        ],
        "type": "object",
        "properties": {
          "message": {
            "$ref": "#/components/schemas/Billing_MessageWithTokenResponse"
          },
          "content": {
            "$ref": "#/components/schemas/Billing_ClientDtoContentResponse"
          },
          "validationIssues": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Billing_ValidationIssue"
            },
            "nullable": true
          },
          "errors": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Billing_Error"
            },
            "description": "Deprecated: the same issues as `validationIssues` (`reasonText` is `reason`, `reasonId` is `reasonToken`, `reasonParameters` is `reasonTokenArguments`). Read `validationIssues`; this will be removed.",
            "nullable": true,
            "readOnly": true,
            "deprecated": true
          },
          "metadata": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Billing_ContentMetadataResponse"
              }
            ],
            "description": "Deprecated: the same values as `content.metadata`. Read that; this will be removed.",
            "deprecated": true
          }
        },
        "additionalProperties": false,
        "description": "Billing's response envelope: the platform's (`message.text` + `message.token`,\n`content.data` + `content.metadata`, `validationIssues`) plus the fields billing\nsent before it (PRODLAUNCH-416). Those are deprecated, removed on 31 December 2026, and are\nprojections of their replacements so the two cannot disagree."
      },
      "Billing_ClientFinanceSettingsDto": {
        "type": "object",
        "properties": {
          "defaultRevenueAccount": {
            "type": "string",
            "nullable": true
          },
          "defaultTaxRate": {
            "type": "string",
            "nullable": true
          },
          "payElementMappings": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Billing_PayElementMappingItemDto"
            }
          },
          "defaultDueDateDays": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "defaultDueDateType": {
            "enum": [
              "DaysAfterInvoiceDate",
              "DaysAfterInvoiceMonth",
              "OfCurrentMonth",
              "OfFollowingMonth"
            ],
            "type": "string",
            "nullable": true
          },
          "defaultCurrencyCode": {
            "type": "string",
            "description": "Default currency code for new invoices (e.g. GBP, USD). When null, fallback (GBP) is used.",
            "nullable": true
          },
          "defaultLineAmountTypes": {
            "type": "string",
            "description": "Default line amount type for new invoices (e.g. Exclusive, Inclusive). When null, fallback (Exclusive) is used.",
            "nullable": true
          },
          "invoiceTemplateOverride": {
            "$ref": "#/components/schemas/Billing_DocumentTemplateDto"
          },
          "creditNoteTemplateOverride": {
            "$ref": "#/components/schemas/Billing_DocumentTemplateDto"
          },
          "invoiceReferenceFormula": {
            "type": "string",
            "description": "Optional invoice reference formula with token placeholders (e.g. \"{payrollConfigName}{separator:space}{payDate}\").\nWhen null, the default behaviour (grouping key as reference) is used.",
            "nullable": true
          },
          "invoiceReferenceDateFormat": {
            "type": "string",
            "description": "Date format code applied when resolving date tokens in the invoice reference formula\n(e.g. DMY_SLASH, YMD_DASH, DMY_COMPACT, MDY_SLASH, DMY_DASH, DMY_DOT).\nDefaults to DMY_SLASH when null.",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "description": "Client-scoped finance settings (defaults and pay element mappings; tax/account data is organisation-level)."
      },
      "Billing_ClientFinanceSettingsDtoContentResponse": {
        "type": "object",
        "properties": {
          "data": {
            "$ref": "#/components/schemas/Billing_ClientFinanceSettingsDto"
          },
          "metadata": {
            "$ref": "#/components/schemas/Billing_ContentMetadataResponse"
          }
        },
        "additionalProperties": false
      },
      "Billing_ClientFinanceSettingsDtoResponseBody": {
        "required": [
          "message"
        ],
        "type": "object",
        "properties": {
          "message": {
            "$ref": "#/components/schemas/Billing_MessageWithTokenResponse"
          },
          "content": {
            "$ref": "#/components/schemas/Billing_ClientFinanceSettingsDtoContentResponse"
          },
          "validationIssues": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Billing_ValidationIssue"
            },
            "nullable": true
          },
          "errors": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Billing_Error"
            },
            "description": "Deprecated: the same issues as `validationIssues` (`reasonText` is `reason`, `reasonId` is `reasonToken`, `reasonParameters` is `reasonTokenArguments`). Read `validationIssues`; this will be removed.",
            "nullable": true,
            "readOnly": true,
            "deprecated": true
          },
          "metadata": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Billing_ContentMetadataResponse"
              }
            ],
            "description": "Deprecated: the same values as `content.metadata`. Read that; this will be removed.",
            "deprecated": true
          }
        },
        "additionalProperties": false,
        "description": "Billing's response envelope: the platform's (`message.text` + `message.token`,\n`content.data` + `content.metadata`, `validationIssues`) plus the fields billing\nsent before it (PRODLAUNCH-416). Those are deprecated, removed on 31 December 2026, and are\nprojections of their replacements so the two cannot disagree."
      },
      "Billing_ContentMetadataResponse": {
        "type": "object",
        "properties": {
          "dateFormat": {
            "type": "string"
          },
          "dateTimeFormat": {
            "type": "string"
          },
          "paginationToken": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Billing_Content_AccountCodeDto": {
        "allOf": [
          {
            "$ref": "#/components/schemas/Billing_AccountCodeDtoContentResponse"
          }
        ],
        "description": "Deprecated: renamed to `AccountCodeDtoContentResponse`, which has the same fields and more.",
        "deprecated": true
      },
      "Billing_Content_AccountingSendRefusalDto": {
        "allOf": [
          {
            "$ref": "#/components/schemas/Billing_AccountingSendRefusalDtoContentResponse"
          }
        ],
        "description": "Deprecated: renamed to `AccountingSendRefusalDtoContentResponse`, which has the same fields and more.",
        "deprecated": true
      },
      "Billing_Content_AllocationDto": {
        "allOf": [
          {
            "$ref": "#/components/schemas/Billing_AllocationDtoContentResponse"
          }
        ],
        "description": "Deprecated: renamed to `AllocationDtoContentResponse`, which has the same fields and more.",
        "deprecated": true
      },
      "Billing_Content_AttachmentLimitsDto": {
        "allOf": [
          {
            "$ref": "#/components/schemas/Billing_AttachmentLimitsDtoContentResponse"
          }
        ],
        "description": "Deprecated: renamed to `AttachmentLimitsDtoContentResponse`, which has the same fields and more.",
        "deprecated": true
      },
      "Billing_Content_BulkInvoiceActionResponseDto": {
        "allOf": [
          {
            "$ref": "#/components/schemas/Billing_BulkInvoiceActionResponseDtoContentResponse"
          }
        ],
        "description": "Deprecated: renamed to `BulkInvoiceActionResponseDtoContentResponse`, which has the same fields and more.",
        "deprecated": true
      },
      "Billing_Content_ClientDto": {
        "allOf": [
          {
            "$ref": "#/components/schemas/Billing_ClientDtoContentResponse"
          }
        ],
        "description": "Deprecated: renamed to `ClientDtoContentResponse`, which has the same fields and more.",
        "deprecated": true
      },
      "Billing_Content_ClientFinanceSettingsDto": {
        "allOf": [
          {
            "$ref": "#/components/schemas/Billing_ClientFinanceSettingsDtoContentResponse"
          }
        ],
        "description": "Deprecated: renamed to `ClientFinanceSettingsDtoContentResponse`, which has the same fields and more.",
        "deprecated": true
      },
      "Billing_Content_CreditNoteDto": {
        "allOf": [
          {
            "$ref": "#/components/schemas/Billing_CreditNoteDtoContentResponse"
          }
        ],
        "description": "Deprecated: renamed to `CreditNoteDtoContentResponse`, which has the same fields and more.",
        "deprecated": true
      },
      "Billing_Content_DocumentTemplateDto": {
        "allOf": [
          {
            "$ref": "#/components/schemas/Billing_DocumentTemplateDtoContentResponse"
          }
        ],
        "description": "Deprecated: renamed to `DocumentTemplateDtoContentResponse`, which has the same fields and more.",
        "deprecated": true
      },
      "Billing_Content_ErrorContent": {
        "allOf": [
          {
            "$ref": "#/components/schemas/Billing_ObjectContentResponse"
          }
        ],
        "description": "Deprecated: renamed to `ObjectContentResponse`, which has the same fields and more.",
        "deprecated": true
      },
      "Billing_Content_IReadOnlyList_AccountCodeDto": {
        "allOf": [
          {
            "$ref": "#/components/schemas/Billing_IReadOnlyListAccountCodeDtoContentResponse"
          }
        ],
        "description": "Deprecated: renamed to `IReadOnlyListAccountCodeDtoContentResponse`, which has the same fields and more.",
        "deprecated": true
      },
      "Billing_Content_IReadOnlyList_CreditNoteDto": {
        "allOf": [
          {
            "$ref": "#/components/schemas/Billing_IReadOnlyListCreditNoteDtoContentResponse"
          }
        ],
        "description": "Deprecated: renamed to `IReadOnlyListCreditNoteDtoContentResponse`, which has the same fields and more.",
        "deprecated": true
      },
      "Billing_Content_IReadOnlyList_DocumentAttachmentUploadResponseDto": {
        "allOf": [
          {
            "$ref": "#/components/schemas/Billing_IReadOnlyListDocumentAttachmentUploadResponseDtoContentResponse"
          }
        ],
        "description": "Deprecated: renamed to `IReadOnlyListDocumentAttachmentUploadResponseDtoContentResponse`, which has the same fields and more.",
        "deprecated": true
      },
      "Billing_Content_IReadOnlyList_InvoiceReferenceFieldDto": {
        "allOf": [
          {
            "$ref": "#/components/schemas/Billing_IReadOnlyListInvoiceReferenceFieldDtoContentResponse"
          }
        ],
        "description": "Deprecated: renamed to `IReadOnlyListInvoiceReferenceFieldDtoContentResponse`, which has the same fields and more.",
        "deprecated": true
      },
      "Billing_Content_IReadOnlyList_LineItemDescriptionFieldDto": {
        "allOf": [
          {
            "$ref": "#/components/schemas/Billing_IReadOnlyListLineItemDescriptionFieldDtoContentResponse"
          }
        ],
        "description": "Deprecated: renamed to `IReadOnlyListLineItemDescriptionFieldDtoContentResponse`, which has the same fields and more.",
        "deprecated": true
      },
      "Billing_Content_IReadOnlyList_TaxRateDto": {
        "allOf": [
          {
            "$ref": "#/components/schemas/Billing_IReadOnlyListTaxRateDtoContentResponse"
          }
        ],
        "description": "Deprecated: renamed to `IReadOnlyListTaxRateDtoContentResponse`, which has the same fields and more.",
        "deprecated": true
      },
      "Billing_Content_ImportSummaryDto": {
        "allOf": [
          {
            "$ref": "#/components/schemas/Billing_ImportSummaryDtoContentResponse"
          }
        ],
        "description": "Deprecated: renamed to `ImportSummaryDtoContentResponse`, which has the same fields and more.",
        "deprecated": true
      },
      "Billing_Content_InvoiceDto": {
        "allOf": [
          {
            "$ref": "#/components/schemas/Billing_InvoiceDtoContentResponse"
          }
        ],
        "description": "Deprecated: renamed to `InvoiceDtoContentResponse`, which has the same fields and more.",
        "deprecated": true
      },
      "Billing_Content_ListClientsResponse": {
        "allOf": [
          {
            "$ref": "#/components/schemas/Billing_ListClientsResponseContentResponse"
          }
        ],
        "description": "Deprecated: renamed to `ListClientsResponseContentResponse`, which has the same fields and more.",
        "deprecated": true
      },
      "Billing_Content_ListCreditNoteLineItemsResponse": {
        "allOf": [
          {
            "$ref": "#/components/schemas/Billing_ListCreditNoteLineItemsResponseContentResponse"
          }
        ],
        "description": "Deprecated: renamed to `ListCreditNoteLineItemsResponseContentResponse`, which has the same fields and more.",
        "deprecated": true
      },
      "Billing_Content_ListCreditNotesByOrgResponse": {
        "allOf": [
          {
            "$ref": "#/components/schemas/Billing_ListCreditNotesByOrgResponseContentResponse"
          }
        ],
        "description": "Deprecated: renamed to `ListCreditNotesByOrgResponseContentResponse`, which has the same fields and more.",
        "deprecated": true
      },
      "Billing_Content_ListInvoiceLineItemsResponse": {
        "allOf": [
          {
            "$ref": "#/components/schemas/Billing_ListInvoiceLineItemsResponseContentResponse"
          }
        ],
        "description": "Deprecated: renamed to `ListInvoiceLineItemsResponseContentResponse`, which has the same fields and more.",
        "deprecated": true
      },
      "Billing_Content_ListInvoicesResponse": {
        "allOf": [
          {
            "$ref": "#/components/schemas/Billing_ListInvoicesResponseContentResponse"
          }
        ],
        "description": "Deprecated: renamed to `ListInvoicesResponseContentResponse`, which has the same fields and more.",
        "deprecated": true
      },
      "Billing_Content_Object": {
        "allOf": [
          {
            "$ref": "#/components/schemas/Billing_ObjectContentResponse"
          }
        ],
        "description": "Deprecated: renamed to `ObjectContentResponse`, which has the same fields and more.",
        "deprecated": true
      },
      "Billing_Content_OrganisationFinanceDefaultsDto": {
        "allOf": [
          {
            "$ref": "#/components/schemas/Billing_OrganisationFinanceDefaultsDtoContentResponse"
          }
        ],
        "description": "Deprecated: renamed to `OrganisationFinanceDefaultsDtoContentResponse`, which has the same fields and more.",
        "deprecated": true
      },
      "Billing_Content_OrganisationPayElementMappingsDto": {
        "allOf": [
          {
            "$ref": "#/components/schemas/Billing_OrganisationPayElementMappingsDtoContentResponse"
          }
        ],
        "description": "Deprecated: renamed to `OrganisationPayElementMappingsDtoContentResponse`, which has the same fields and more.",
        "deprecated": true
      },
      "Billing_Content_ProviderAccountsListResponse": {
        "allOf": [
          {
            "$ref": "#/components/schemas/Billing_ProviderAccountsListResponseContentResponse"
          }
        ],
        "description": "Deprecated: renamed to `ProviderAccountsListResponseContentResponse`, which has the same fields and more.",
        "deprecated": true
      },
      "Billing_Content_ProviderContactsListResponse": {
        "allOf": [
          {
            "$ref": "#/components/schemas/Billing_ProviderContactsListResponseContentResponse"
          }
        ],
        "description": "Deprecated: renamed to `ProviderContactsListResponseContentResponse`, which has the same fields and more.",
        "deprecated": true
      },
      "Billing_Content_ProviderTaxRatesListResponse": {
        "allOf": [
          {
            "$ref": "#/components/schemas/Billing_ProviderTaxRatesListResponseContentResponse"
          }
        ],
        "description": "Deprecated: renamed to `ProviderTaxRatesListResponseContentResponse`, which has the same fields and more.",
        "deprecated": true
      },
      "Billing_Content_RefreshLineItemMappingsResponse": {
        "allOf": [
          {
            "$ref": "#/components/schemas/Billing_RefreshLineItemMappingsResponseContentResponse"
          }
        ],
        "description": "Deprecated: renamed to `RefreshLineItemMappingsResponseContentResponse`, which has the same fields and more.",
        "deprecated": true
      },
      "Billing_Content_String": {
        "allOf": [
          {
            "$ref": "#/components/schemas/Billing_StringContentResponse"
          }
        ],
        "description": "Deprecated: renamed to `StringContentResponse`, which has the same fields and more.",
        "deprecated": true
      },
      "Billing_Content_TaxRateDto": {
        "allOf": [
          {
            "$ref": "#/components/schemas/Billing_TaxRateDtoContentResponse"
          }
        ],
        "description": "Deprecated: renamed to `TaxRateDtoContentResponse`, which has the same fields and more.",
        "deprecated": true
      },
      "Billing_CreateAccountCodeRequest": {
        "type": "object",
        "properties": {
          "code": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "type": {
            "enum": [
              "Revenue",
              "Expense",
              "Asset",
              "Liability",
              "Equity"
            ],
            "type": "string",
            "description": "Which side of the ledger an account sits on."
          },
          "taxType": {
            "type": "string",
            "nullable": true
          },
          "description": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "description": "Request to create an account code."
      },
      "Billing_CreateCreditNoteRequest": {
        "type": "object",
        "properties": {
          "organisationId": {
            "type": "string"
          },
          "clientId": {
            "type": "string"
          },
          "type": {
            "enum": [
              "SalesCredit",
              "PurchaseCredit"
            ],
            "type": "string",
            "description": "Type of credit note, in plain words. Each accounting system's own spelling is its adapter's business."
          },
          "date": {
            "type": "string"
          },
          "lineAmountTypes": {
            "enum": [
              "Exclusive",
              "Inclusive",
              "NoTax"
            ],
            "type": "string",
            "description": "Whether line amounts are stated before tax, after tax, or with no tax."
          },
          "reference": {
            "type": "string",
            "nullable": true
          },
          "invoiceReference": {
            "type": "string",
            "nullable": true
          },
          "linkedInvoiceId": {
            "type": "string",
            "nullable": true
          },
          "groupingKey": {
            "type": "string",
            "nullable": true
          },
          "invoiceFormat": {
            "enum": [
              "None",
              "Date",
              "PayElementId",
              "PoNumber",
              "TagGroup",
              "PayrollConfigId"
            ],
            "type": "string",
            "nullable": true
          },
          "source": {
            "type": "string",
            "nullable": true
          },
          "currencyCode": {
            "type": "string"
          },
          "lineItems": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Billing_CreditNoteLineItemDto"
            }
          }
        },
        "additionalProperties": false,
        "description": "Request to create a credit note."
      },
      "Billing_CreateDocumentAttachmentRequestDto": {
        "type": "object",
        "properties": {
          "fileName": {
            "type": "string"
          },
          "contentType": {
            "type": "string"
          },
          "fileSize": {
            "type": "integer",
            "format": "int64"
          }
        },
        "additionalProperties": false,
        "description": "Metadata for a single attachment to create (invoice or credit note)."
      },
      "Billing_CreateTaxRateRequest": {
        "type": "object",
        "properties": {
          "taxType": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "effectiveRate": {
            "type": "number",
            "format": "double"
          },
          "canApplyToRevenue": {
            "type": "boolean"
          },
          "canApplyToExpenses": {
            "type": "boolean"
          }
        },
        "additionalProperties": false,
        "description": "Request to create a custom tax rate."
      },
      "Billing_CreditNoteDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "creditNoteNumber": {
            "type": "string",
            "nullable": true
          },
          "clientId": {
            "type": "string"
          },
          "organisationId": {
            "type": "string"
          },
          "type": {
            "enum": [
              "SalesCredit",
              "PurchaseCredit"
            ],
            "type": "string",
            "description": "Type of credit note, in plain words. Each accounting system's own spelling is its adapter's business."
          },
          "date": {
            "type": "string"
          },
          "status": {
            "enum": [
              "Draft",
              "Authorised",
              "Paid",
              "Voided"
            ],
            "type": "string",
            "description": "Status of a credit note, in plain words."
          },
          "lineAmountTypes": {
            "enum": [
              "Exclusive",
              "Inclusive",
              "NoTax"
            ],
            "type": "string",
            "description": "Whether line amounts are stated before tax, after tax, or with no tax."
          },
          "subTotal": {
            "type": "number",
            "format": "double"
          },
          "totalTax": {
            "type": "number",
            "format": "double"
          },
          "amount": {
            "type": "number",
            "format": "double"
          },
          "balanceDue": {
            "type": "number",
            "format": "double"
          },
          "reference": {
            "type": "string",
            "nullable": true
          },
          "invoiceReference": {
            "type": "string",
            "nullable": true
          },
          "linkedInvoiceId": {
            "type": "string",
            "nullable": true
          },
          "groupingKey": {
            "type": "string",
            "nullable": true
          },
          "invoiceFormat": {
            "enum": [
              "None",
              "Date",
              "PayElementId",
              "PoNumber",
              "TagGroup",
              "PayrollConfigId"
            ],
            "type": "string",
            "nullable": true
          },
          "source": {
            "type": "string",
            "nullable": true
          },
          "currencyCode": {
            "type": "string"
          },
          "currencyRate": {
            "type": "number",
            "format": "double"
          },
          "subtotalGroups": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Billing_SubtotalGroupDto"
            },
            "nullable": true
          },
          "attachments": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Billing_DocumentAttachmentDto"
            },
            "nullable": true
          },
          "linesWithoutAttachmentsCount": {
            "type": "integer",
            "format": "int32"
          },
          "linesWithoutPoNumberCount": {
            "type": "integer",
            "format": "int32"
          },
          "allocations": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Billing_AllocationDto"
            }
          },
          "externalId": {
            "type": "string",
            "nullable": true
          },
          "externalProvider": {
            "type": "string",
            "nullable": true
          },
          "lastSyncedAt": {
            "type": "string",
            "description": "When the accounting system last synced this (UTC, ISO 8601).\n            \n\nThe provider's own moment, not when this service recorded\nthe answer, so it is safe to reconcile against the provider's\nrecords and does not move with our internal queue timings. Null\nuntil a send has succeeded.",
            "nullable": true
          },
          "syncStatus": {
            "enum": [
              "NotSynced",
              "Synced",
              "SyncFailed",
              "Syncing",
              "NeedsAttention"
            ],
            "type": "string",
            "description": "How this credit note stands with the accounting system.\n            \n\n`NotSynced` — never offered to a provider.\n`Pending` — a push is already IN FLIGHT; starting another\ndoes nothing. `Synced` — the provider accepted it.\n`SyncFailed` — the provider refused it.\n<b>Careful:</b>`Pending` means the OPPOSITE here to\nwhat it means on an invoice, where it marks a document NOT yet\nwith the provider and free to send. The invoice's in-flight state\nis `Syncing`. Do not share a branch between the two."
          },
          "syncErrorMessage": {
            "type": "string",
            "description": "Last sync error message when sync failed.",
            "nullable": true
          },
          "syncErrorCode": {
            "type": "string",
            "description": "Machine-readable sync error code when sync failed (e.g. ACCOUNT_CODE_ARCHIVED).",
            "nullable": true
          },
          "externalProviderStatus": {
            "type": "string",
            "nullable": true
          },
          "emailSent": {
            "type": "boolean"
          },
          "emailSentAt": {
            "type": "string",
            "nullable": true
          },
          "emailSentBy": {
            "type": "string",
            "nullable": true
          },
          "createdDate": {
            "type": "string"
          },
          "createdBy": {
            "type": "string"
          },
          "updatedDate": {
            "type": "string",
            "nullable": true
          },
          "updatedBy": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "description": "Represents a credit note ."
      },
      "Billing_CreditNoteDtoContentResponse": {
        "type": "object",
        "properties": {
          "data": {
            "$ref": "#/components/schemas/Billing_CreditNoteDto"
          },
          "metadata": {
            "$ref": "#/components/schemas/Billing_ContentMetadataResponse"
          }
        },
        "additionalProperties": false
      },
      "Billing_CreditNoteDtoResponseBody": {
        "required": [
          "message"
        ],
        "type": "object",
        "properties": {
          "message": {
            "$ref": "#/components/schemas/Billing_MessageWithTokenResponse"
          },
          "content": {
            "$ref": "#/components/schemas/Billing_CreditNoteDtoContentResponse"
          },
          "validationIssues": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Billing_ValidationIssue"
            },
            "nullable": true
          },
          "errors": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Billing_Error"
            },
            "description": "Deprecated: the same issues as `validationIssues` (`reasonText` is `reason`, `reasonId` is `reasonToken`, `reasonParameters` is `reasonTokenArguments`). Read `validationIssues`; this will be removed.",
            "nullable": true,
            "readOnly": true,
            "deprecated": true
          },
          "metadata": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Billing_ContentMetadataResponse"
              }
            ],
            "description": "Deprecated: the same values as `content.metadata`. Read that; this will be removed.",
            "deprecated": true
          }
        },
        "additionalProperties": false,
        "description": "Billing's response envelope: the platform's (`message.text` + `message.token`,\n`content.data` + `content.metadata`, `validationIssues`) plus the fields billing\nsent before it (PRODLAUNCH-416). Those are deprecated, removed on 31 December 2026, and are\nprojections of their replacements so the two cannot disagree."
      },
      "Billing_CreditNoteLineItemDto": {
        "type": "object",
        "properties": {
          "lineItemId": {
            "type": "string"
          },
          "organisationId": {
            "type": "string",
            "description": "Set by store/service when writing to line partition. Not required in API request.",
            "nullable": true
          },
          "clientId": {
            "type": "string",
            "nullable": true
          },
          "creditNoteId": {
            "type": "string",
            "nullable": true
          },
          "employeeId": {
            "type": "string",
            "description": "Optional. Set when the line item originates from a negative payroll line (employee deduction).",
            "nullable": true
          },
          "employeeName": {
            "type": "string",
            "description": "Optional. Set when the line item originates from a negative payroll line (employee deduction).",
            "nullable": true
          },
          "payElementId": {
            "type": "string",
            "description": "Optional. Pay element id for grouping and composite sort key (e.g. from payroll).",
            "nullable": true
          },
          "payElementDescription": {
            "type": "string",
            "description": "Optional. Human-readable pay element description (e.g., \"Salary\", \"Overtime\").",
            "nullable": true
          },
          "description": {
            "type": "string"
          },
          "quantity": {
            "type": "number",
            "format": "double"
          },
          "unitAmount": {
            "type": "number",
            "format": "double"
          },
          "lineAmount": {
            "type": "number",
            "format": "double"
          },
          "taxAmount": {
            "type": "number",
            "format": "double"
          },
          "taxType": {
            "type": "string",
            "description": "Tax type code (e.g., \"OUTPUT2\", \"ZERORATEDOUTPUT\")."
          },
          "accountCode": {
            "type": "string",
            "description": "Account code (mandatory, e.g., \"200\", \"SALES\")."
          },
          "tracking": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Billing_TrackingCategoryDto"
            },
            "description": "Analysis dimensions for this line, in the words the template defines.",
            "nullable": true
          },
          "attachments": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Billing_InvoiceLineItemAttachmentDto"
            },
            "description": "Attachments for this line item. The S3 key is read when the document is sent, and the file goes to the accounting system with it.",
            "nullable": true
          },
          "poNumber": {
            "type": "string",
            "description": "Optional PO number from Neo Payroll line (pl.PoNumber). Used for linesWithoutPoNumberCount and line description formula.",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "description": "Represents a single credit note line item."
      },
      "Billing_DocumentAttachmentDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "fileName": {
            "type": "string"
          },
          "url": {
            "type": "string",
            "nullable": true
          },
          "description": {
            "type": "string",
            "nullable": true
          },
          "contentType": {
            "type": "string",
            "nullable": true
          },
          "fileSize": {
            "type": "integer",
            "format": "int64",
            "nullable": true
          },
          "uploadedDate": {
            "type": "string",
            "nullable": true
          },
          "uploadedBy": {
            "type": "string",
            "nullable": true
          },
          "downloadUrl": {
            "type": "string",
            "nullable": true
          },
          "downloadUrlExpiresAt": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "description": "Represents a document attachment (invoice or credit note). The stored file's key is kept in storage only, never in an API response; downloadUrl/downloadUrlExpiresAt are filled when returning from API."
      },
      "Billing_DocumentAttachmentUploadResponseDto": {
        "type": "object",
        "properties": {
          "attachmentId": {
            "type": "string",
            "description": "The attachment's id."
          },
          "fileName": {
            "type": "string",
            "description": "The file's name."
          },
          "uploadUrl": {
            "type": "string",
            "description": "The address to send the file to, valid for 15 minutes."
          },
          "expiresAt": {
            "type": "string",
            "description": "When the upload address stops working (ISO 8601)."
          },
          "method": {
            "type": "string",
            "description": "Always `PUT`."
          },
          "headers": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            },
            "description": "Headers the upload must carry, exactly as given."
          }
        },
        "additionalProperties": false,
        "description": "Where to send one new attachment: `PUT` the file's bytes, and nothing else, as the whole\nbody to `uploadUrl` with every one of `headers`, before `expiresAt`. The file must\nbe exactly the type and size given when the attachment was added."
      },
      "Billing_DocumentTemplateDto": {
        "type": "object",
        "properties": {
          "showSubsectionHeader": {
            "type": "boolean",
            "description": "When true, emit group header lines (e.g. \"--- Pay Element ---\") when client uses subtotal grouping."
          },
          "showSubtotalInSubsection": {
            "type": "boolean",
            "description": "When true (and showSubsectionHeader is true), emit a subtotal row after each group with amount and optionally VAT and quantity total."
          },
          "showSubtotalVatInSubsection": {
            "type": "boolean",
            "description": "When true, include VAT in each subsection subtotal row description."
          },
          "showQuantitySumInSubsection": {
            "type": "boolean",
            "description": "When true, include quantity total (sum of quantities/units in the group) in each subsection subtotal row description."
          },
          "showBottomSubtotals": {
            "type": "boolean",
            "description": "When true, emit a bottom block listing all group subtotals after the lines."
          },
          "showVatInBottomSubtotals": {
            "type": "boolean",
            "description": "When true, include VAT in each bottom subtotal line description."
          },
          "showQuantitySumInBottomSubtotals": {
            "type": "boolean",
            "description": "When true, include quantity total in each bottom subtotal line description."
          },
          "lineItemSortOrder": {
            "enum": [
              "None",
              "ByEmployee",
              "ByPayElementThenEmployee"
            ],
            "type": "string",
            "description": "Sort order for line items when subsection/grouping is not used (e.g. as stored, by employee A–Z, by pay element then employee)."
          },
          "lineDescriptionFormula": {
            "type": "string",
            "description": "Template string with placeholders (e.g. \"{description} - {employeeName} - {poNumber}\"). Use ids from GET /finance/line-item-description-fields in curly braces. When null, use line Description only.",
            "nullable": true
          },
          "lineDescriptionTagGroupId": {
            "type": "string",
            "description": "Optional tag group key when formula uses {tagValue}. Required when a placeholder with requiresTagGroup is used. Stored as a normalised key.",
            "nullable": true
          },
          "attachmentStrategy": {
            "enum": [
              "ExcessLost",
              "MergeOnIntegration"
            ],
            "type": "string",
            "description": "How to handle attachments when over provider limit (e.g. excess lost vs merge on integration)."
          },
          "includeAttachmentsWithOnlineInvoice": {
            "type": "boolean",
            "description": "When true, the customer can see the attached files on their own copy of the document rather than them being an internal record only."
          }
        },
        "additionalProperties": false,
        "description": "Document (invoice or credit note) template: grouping, sort order, line description formula, attachment strategy.\nSame shape for org default and per-client override. Grouping is driven by booleans (subsection header, subtotal row, VAT and quantity total in subsection and in bottom subtotals)."
      },
      "Billing_DocumentTemplateDtoContentResponse": {
        "type": "object",
        "properties": {
          "data": {
            "$ref": "#/components/schemas/Billing_DocumentTemplateDto"
          },
          "metadata": {
            "$ref": "#/components/schemas/Billing_ContentMetadataResponse"
          }
        },
        "additionalProperties": false
      },
      "Billing_DocumentTemplateDtoResponseBody": {
        "required": [
          "message"
        ],
        "type": "object",
        "properties": {
          "message": {
            "$ref": "#/components/schemas/Billing_MessageWithTokenResponse"
          },
          "content": {
            "$ref": "#/components/schemas/Billing_DocumentTemplateDtoContentResponse"
          },
          "validationIssues": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Billing_ValidationIssue"
            },
            "nullable": true
          },
          "errors": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Billing_Error"
            },
            "description": "Deprecated: the same issues as `validationIssues` (`reasonText` is `reason`, `reasonId` is `reasonToken`, `reasonParameters` is `reasonTokenArguments`). Read `validationIssues`; this will be removed.",
            "nullable": true,
            "readOnly": true,
            "deprecated": true
          },
          "metadata": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Billing_ContentMetadataResponse"
              }
            ],
            "description": "Deprecated: the same values as `content.metadata`. Read that; this will be removed.",
            "deprecated": true
          }
        },
        "additionalProperties": false,
        "description": "Billing's response envelope: the platform's (`message.text` + `message.token`,\n`content.data` + `content.metadata`, `validationIssues`) plus the fields billing\nsent before it (PRODLAUNCH-416). Those are deprecated, removed on 31 December 2026, and are\nprojections of their replacements so the two cannot disagree."
      },
      "Billing_Error": {
        "type": "object",
        "properties": {
          "field": {
            "type": "string",
            "nullable": true
          },
          "reasonText": {
            "type": "string",
            "nullable": true
          },
          "reasonId": {
            "type": "string",
            "nullable": true
          },
          "reasonParameters": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Billing_Pair"
            },
            "nullable": true
          }
        },
        "additionalProperties": false,
        "description": "Deprecated: an entry of the old `errors` list. Read `validationIssues` instead.",
        "deprecated": true
      },
      "Billing_ErrorContent": {
        "type": "object",
        "description": "Deprecated: error responses describe themselves in `validationIssues`.",
        "deprecated": true
      },
      "Billing_IReadOnlyListAccountCodeDtoContentResponse": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Billing_AccountCodeDto"
            },
            "nullable": true
          },
          "metadata": {
            "$ref": "#/components/schemas/Billing_ContentMetadataResponse"
          }
        },
        "additionalProperties": false
      },
      "Billing_IReadOnlyListAccountCodeDtoResponseBody": {
        "required": [
          "message"
        ],
        "type": "object",
        "properties": {
          "message": {
            "$ref": "#/components/schemas/Billing_MessageWithTokenResponse"
          },
          "content": {
            "$ref": "#/components/schemas/Billing_IReadOnlyListAccountCodeDtoContentResponse"
          },
          "validationIssues": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Billing_ValidationIssue"
            },
            "nullable": true
          },
          "errors": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Billing_Error"
            },
            "description": "Deprecated: the same issues as `validationIssues` (`reasonText` is `reason`, `reasonId` is `reasonToken`, `reasonParameters` is `reasonTokenArguments`). Read `validationIssues`; this will be removed.",
            "nullable": true,
            "readOnly": true,
            "deprecated": true
          },
          "metadata": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Billing_ContentMetadataResponse"
              }
            ],
            "description": "Deprecated: the same values as `content.metadata`. Read that; this will be removed.",
            "deprecated": true
          }
        },
        "additionalProperties": false,
        "description": "Billing's response envelope: the platform's (`message.text` + `message.token`,\n`content.data` + `content.metadata`, `validationIssues`) plus the fields billing\nsent before it (PRODLAUNCH-416). Those are deprecated, removed on 31 December 2026, and are\nprojections of their replacements so the two cannot disagree."
      },
      "Billing_IReadOnlyListCreditNoteDtoContentResponse": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Billing_CreditNoteDto"
            },
            "nullable": true
          },
          "metadata": {
            "$ref": "#/components/schemas/Billing_ContentMetadataResponse"
          }
        },
        "additionalProperties": false
      },
      "Billing_IReadOnlyListCreditNoteDtoResponseBody": {
        "required": [
          "message"
        ],
        "type": "object",
        "properties": {
          "message": {
            "$ref": "#/components/schemas/Billing_MessageWithTokenResponse"
          },
          "content": {
            "$ref": "#/components/schemas/Billing_IReadOnlyListCreditNoteDtoContentResponse"
          },
          "validationIssues": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Billing_ValidationIssue"
            },
            "nullable": true
          },
          "errors": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Billing_Error"
            },
            "description": "Deprecated: the same issues as `validationIssues` (`reasonText` is `reason`, `reasonId` is `reasonToken`, `reasonParameters` is `reasonTokenArguments`). Read `validationIssues`; this will be removed.",
            "nullable": true,
            "readOnly": true,
            "deprecated": true
          },
          "metadata": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Billing_ContentMetadataResponse"
              }
            ],
            "description": "Deprecated: the same values as `content.metadata`. Read that; this will be removed.",
            "deprecated": true
          }
        },
        "additionalProperties": false,
        "description": "Billing's response envelope: the platform's (`message.text` + `message.token`,\n`content.data` + `content.metadata`, `validationIssues`) plus the fields billing\nsent before it (PRODLAUNCH-416). Those are deprecated, removed on 31 December 2026, and are\nprojections of their replacements so the two cannot disagree."
      },
      "Billing_IReadOnlyListDocumentAttachmentUploadResponseDtoContentResponse": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Billing_DocumentAttachmentUploadResponseDto"
            },
            "nullable": true
          },
          "metadata": {
            "$ref": "#/components/schemas/Billing_ContentMetadataResponse"
          }
        },
        "additionalProperties": false
      },
      "Billing_IReadOnlyListDocumentAttachmentUploadResponseDtoResponseBody": {
        "required": [
          "message"
        ],
        "type": "object",
        "properties": {
          "message": {
            "$ref": "#/components/schemas/Billing_MessageWithTokenResponse"
          },
          "content": {
            "$ref": "#/components/schemas/Billing_IReadOnlyListDocumentAttachmentUploadResponseDtoContentResponse"
          },
          "validationIssues": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Billing_ValidationIssue"
            },
            "nullable": true
          },
          "errors": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Billing_Error"
            },
            "description": "Deprecated: the same issues as `validationIssues` (`reasonText` is `reason`, `reasonId` is `reasonToken`, `reasonParameters` is `reasonTokenArguments`). Read `validationIssues`; this will be removed.",
            "nullable": true,
            "readOnly": true,
            "deprecated": true
          },
          "metadata": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Billing_ContentMetadataResponse"
              }
            ],
            "description": "Deprecated: the same values as `content.metadata`. Read that; this will be removed.",
            "deprecated": true
          }
        },
        "additionalProperties": false,
        "description": "Billing's response envelope: the platform's (`message.text` + `message.token`,\n`content.data` + `content.metadata`, `validationIssues`) plus the fields billing\nsent before it (PRODLAUNCH-416). Those are deprecated, removed on 31 December 2026, and are\nprojections of their replacements so the two cannot disagree."
      },
      "Billing_IReadOnlyListInvoiceReferenceFieldDtoContentResponse": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Billing_InvoiceReferenceFieldDto"
            },
            "nullable": true
          },
          "metadata": {
            "$ref": "#/components/schemas/Billing_ContentMetadataResponse"
          }
        },
        "additionalProperties": false
      },
      "Billing_IReadOnlyListInvoiceReferenceFieldDtoResponseBody": {
        "required": [
          "message"
        ],
        "type": "object",
        "properties": {
          "message": {
            "$ref": "#/components/schemas/Billing_MessageWithTokenResponse"
          },
          "content": {
            "$ref": "#/components/schemas/Billing_IReadOnlyListInvoiceReferenceFieldDtoContentResponse"
          },
          "validationIssues": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Billing_ValidationIssue"
            },
            "nullable": true
          },
          "errors": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Billing_Error"
            },
            "description": "Deprecated: the same issues as `validationIssues` (`reasonText` is `reason`, `reasonId` is `reasonToken`, `reasonParameters` is `reasonTokenArguments`). Read `validationIssues`; this will be removed.",
            "nullable": true,
            "readOnly": true,
            "deprecated": true
          },
          "metadata": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Billing_ContentMetadataResponse"
              }
            ],
            "description": "Deprecated: the same values as `content.metadata`. Read that; this will be removed.",
            "deprecated": true
          }
        },
        "additionalProperties": false,
        "description": "Billing's response envelope: the platform's (`message.text` + `message.token`,\n`content.data` + `content.metadata`, `validationIssues`) plus the fields billing\nsent before it (PRODLAUNCH-416). Those are deprecated, removed on 31 December 2026, and are\nprojections of their replacements so the two cannot disagree."
      },
      "Billing_IReadOnlyListLineItemDescriptionFieldDtoContentResponse": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Billing_LineItemDescriptionFieldDto"
            },
            "nullable": true
          },
          "metadata": {
            "$ref": "#/components/schemas/Billing_ContentMetadataResponse"
          }
        },
        "additionalProperties": false
      },
      "Billing_IReadOnlyListLineItemDescriptionFieldDtoResponseBody": {
        "required": [
          "message"
        ],
        "type": "object",
        "properties": {
          "message": {
            "$ref": "#/components/schemas/Billing_MessageWithTokenResponse"
          },
          "content": {
            "$ref": "#/components/schemas/Billing_IReadOnlyListLineItemDescriptionFieldDtoContentResponse"
          },
          "validationIssues": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Billing_ValidationIssue"
            },
            "nullable": true
          },
          "errors": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Billing_Error"
            },
            "description": "Deprecated: the same issues as `validationIssues` (`reasonText` is `reason`, `reasonId` is `reasonToken`, `reasonParameters` is `reasonTokenArguments`). Read `validationIssues`; this will be removed.",
            "nullable": true,
            "readOnly": true,
            "deprecated": true
          },
          "metadata": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Billing_ContentMetadataResponse"
              }
            ],
            "description": "Deprecated: the same values as `content.metadata`. Read that; this will be removed.",
            "deprecated": true
          }
        },
        "additionalProperties": false,
        "description": "Billing's response envelope: the platform's (`message.text` + `message.token`,\n`content.data` + `content.metadata`, `validationIssues`) plus the fields billing\nsent before it (PRODLAUNCH-416). Those are deprecated, removed on 31 December 2026, and are\nprojections of their replacements so the two cannot disagree."
      },
      "Billing_IReadOnlyListTaxRateDtoContentResponse": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Billing_TaxRateDto"
            },
            "nullable": true
          },
          "metadata": {
            "$ref": "#/components/schemas/Billing_ContentMetadataResponse"
          }
        },
        "additionalProperties": false
      },
      "Billing_IReadOnlyListTaxRateDtoResponseBody": {
        "required": [
          "message"
        ],
        "type": "object",
        "properties": {
          "message": {
            "$ref": "#/components/schemas/Billing_MessageWithTokenResponse"
          },
          "content": {
            "$ref": "#/components/schemas/Billing_IReadOnlyListTaxRateDtoContentResponse"
          },
          "validationIssues": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Billing_ValidationIssue"
            },
            "nullable": true
          },
          "errors": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Billing_Error"
            },
            "description": "Deprecated: the same issues as `validationIssues` (`reasonText` is `reason`, `reasonId` is `reasonToken`, `reasonParameters` is `reasonTokenArguments`). Read `validationIssues`; this will be removed.",
            "nullable": true,
            "readOnly": true,
            "deprecated": true
          },
          "metadata": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Billing_ContentMetadataResponse"
              }
            ],
            "description": "Deprecated: the same values as `content.metadata`. Read that; this will be removed.",
            "deprecated": true
          }
        },
        "additionalProperties": false,
        "description": "Billing's response envelope: the platform's (`message.text` + `message.token`,\n`content.data` + `content.metadata`, `validationIssues`) plus the fields billing\nsent before it (PRODLAUNCH-416). Those are deprecated, removed on 31 December 2026, and are\nprojections of their replacements so the two cannot disagree."
      },
      "Billing_ImportAccountCodesFromProviderRequest": {
        "type": "object",
        "properties": {
          "codes": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        },
        "additionalProperties": false,
        "description": "Request body for importing only selected account codes from the provider."
      },
      "Billing_ImportContactsFromProviderRequest": {
        "type": "object",
        "properties": {
          "providerIds": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        },
        "additionalProperties": false,
        "description": "Request body for importing only selected contacts from the provider."
      },
      "Billing_ImportSummaryDto": {
        "type": "object",
        "properties": {
          "count": {
            "type": "integer",
            "format": "int32"
          }
        },
        "additionalProperties": false
      },
      "Billing_ImportSummaryDtoContentResponse": {
        "type": "object",
        "properties": {
          "data": {
            "$ref": "#/components/schemas/Billing_ImportSummaryDto"
          },
          "metadata": {
            "$ref": "#/components/schemas/Billing_ContentMetadataResponse"
          }
        },
        "additionalProperties": false
      },
      "Billing_ImportSummaryDtoResponseBody": {
        "required": [
          "message"
        ],
        "type": "object",
        "properties": {
          "message": {
            "$ref": "#/components/schemas/Billing_MessageWithTokenResponse"
          },
          "content": {
            "$ref": "#/components/schemas/Billing_ImportSummaryDtoContentResponse"
          },
          "validationIssues": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Billing_ValidationIssue"
            },
            "nullable": true
          },
          "errors": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Billing_Error"
            },
            "description": "Deprecated: the same issues as `validationIssues` (`reasonText` is `reason`, `reasonId` is `reasonToken`, `reasonParameters` is `reasonTokenArguments`). Read `validationIssues`; this will be removed.",
            "nullable": true,
            "readOnly": true,
            "deprecated": true
          },
          "metadata": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Billing_ContentMetadataResponse"
              }
            ],
            "description": "Deprecated: the same values as `content.metadata`. Read that; this will be removed.",
            "deprecated": true
          }
        },
        "additionalProperties": false,
        "description": "Billing's response envelope: the platform's (`message.text` + `message.token`,\n`content.data` + `content.metadata`, `validationIssues`) plus the fields billing\nsent before it (PRODLAUNCH-416). Those are deprecated, removed on 31 December 2026, and are\nprojections of their replacements so the two cannot disagree."
      },
      "Billing_ImportTaxRatesFromProviderRequest": {
        "type": "object",
        "properties": {
          "taxTypes": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        },
        "additionalProperties": false,
        "description": "Request body for importing only selected tax rates from the provider."
      },
      "Billing_InvoiceDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "ID"
          },
          "organisationId": {
            "type": "string",
            "description": "Organisation ID"
          },
          "clientId": {
            "type": "string",
            "description": "Client ID"
          },
          "amount": {
            "type": "number",
            "description": "Amount (subtotal: sum of line items).",
            "format": "double",
            "nullable": true
          },
          "lineAmountTypes": {
            "type": "string",
            "description": "Line amount type (Exclusive/Inclusive).",
            "nullable": true
          },
          "subTotal": {
            "type": "number",
            "description": "Subtotal (before tax).",
            "format": "double",
            "nullable": true
          },
          "totalTax": {
            "type": "number",
            "description": "Total tax amount.",
            "format": "double",
            "nullable": true
          },
          "totalCreditAmount": {
            "type": "number",
            "description": "Total credit amount applied to this invoice.",
            "format": "double",
            "nullable": true
          },
          "balanceDue": {
            "type": "number",
            "description": "Balance due (Amount - TotalCreditAmount). Updated atomically when credit notes are added.",
            "format": "double",
            "nullable": true
          },
          "currencyCode": {
            "type": "string",
            "description": "Currency code (e.g. GBP, USD). Required for allocation currency match with credit notes.",
            "nullable": true
          },
          "appliedCredits": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Billing_AppliedCreditDto"
            },
            "description": "List of credit notes applied to this invoice (for summary: \"Applied £X from Credit #CN-Y\").",
            "nullable": true
          },
          "status": {
            "enum": [
              "Draft",
              "Issued",
              "Paid",
              "Voided"
            ],
            "type": "string",
            "description": "Status"
          },
          "invoiceFormat": {
            "enum": [
              "None",
              "Date",
              "PayElementId",
              "PoNumber",
              "TagGroup",
              "PayrollConfigId"
            ],
            "type": "string",
            "description": "Invoice format"
          },
          "groupingKey": {
            "type": "string",
            "description": "Grouping key (semantic value: date string when Date, PO number when PoNumber, tag value when TagGroup, etc.)\nStored as the raw value for user display; the SK uniqueness key also factors TagGroup+TagName for TagGroup format."
          },
          "invoiceFormatTagGroup": {
            "type": "string",
            "description": "Tag group (e.g. \"System\") that produced GroupingKey when InvoiceFormat is TagGroup. Null otherwise.\nPersisted so the Draft SK can encode (group, name, value) and avoid cross-tag collisions.",
            "nullable": true
          },
          "invoiceFormatTagName": {
            "type": "string",
            "description": "Tag name (e.g. \"Invoice No\") that produced GroupingKey when InvoiceFormat is TagGroup. Null otherwise.",
            "nullable": true
          },
          "date": {
            "type": "string",
            "description": "Invoice date (semantic date; set when InvoiceFormat is Date). Used for date-range filtering.",
            "nullable": true
          },
          "dueDate": {
            "type": "string",
            "description": "Due date (YYYY-MM-DD). Required by some accounting systems.",
            "nullable": true
          },
          "invoiceNumber": {
            "type": "string",
            "description": "Invoice number (our or provider-assigned). Used for display and round-trip sync.",
            "nullable": true
          },
          "reference": {
            "type": "string",
            "description": "Reference (e.g. PO number). Optional for accounting providers.",
            "nullable": true
          },
          "invoiceType": {
            "enum": [
              "Sales",
              "Purchase"
            ],
            "type": "string",
            "description": "Invoice type (e.g. Sales, Purchase). Stored as int; default Sales when missing for backwards compatibility."
          },
          "attachments": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Billing_DocumentAttachmentDto"
            },
            "description": "Attachments",
            "nullable": true
          },
          "lineItemAttachmentCount": {
            "type": "integer",
            "description": "Count of line-item attachments (sum across all line items). Updated on invoice recalc. Used for HasAttachments and filtering.",
            "format": "int32"
          },
          "linesWithoutAttachmentsCount": {
            "type": "integer",
            "format": "int32"
          },
          "linesWithoutPoNumberCount": {
            "type": "integer",
            "format": "int32"
          },
          "lineItems": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Billing_InvoiceLineItemDto"
            },
            "description": "Line items",
            "nullable": true
          },
          "subtotalGroups": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Billing_SubtotalGroupDto"
            },
            "description": "Pre-calculated subtotal groups (by pay element or tag group when the client is configured for it). Used for the summary and for the sent document.",
            "nullable": true
          },
          "tags": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Billing_TagDto"
            },
            "description": "Tags (editable when invoice is open; same as client/contact tags).",
            "nullable": true
          },
          "externalId": {
            "type": "string",
            "description": "The accounting system's own id for this document.",
            "nullable": true
          },
          "externalProvider": {
            "type": "string",
            "description": "Which accounting system holds it, as the integrations hub named it.",
            "nullable": true
          },
          "lastSyncedAt": {
            "type": "string",
            "description": "When the accounting system last synced this (UTC, ISO 8601).\n            \n\nThe provider's own moment, not when this service recorded\nthe answer, so it is safe to reconcile against the provider's\nrecords and does not move with our internal queue timings. Null\nuntil a send has succeeded.",
            "nullable": true
          },
          "syncStatus": {
            "enum": [
              "NotSynced",
              "Synced",
              "SyncFailed",
              "Syncing",
              "NeedsAttention"
            ],
            "type": "string",
            "description": "How this invoice stands with the accounting system. Absent on an\ninvoice never offered to one.",
            "nullable": true
          },
          "syncErrorMessage": {
            "type": "string",
            "description": "Last sync error message when sync failed.",
            "nullable": true
          },
          "syncErrorCode": {
            "type": "string",
            "description": "Machine-readable sync error code when sync failed. Use with syncErrorMessage for user feedback.\nKnown codes: ACCOUNT_CODE_ARCHIVED, ACCOUNT_CODE_INVALID, ACCOUNT_TAX_MISMATCH (fix pay element mapping or re-import account codes, then sync again), TAX_RATE_INVALID, AUTH_FAILED, FORBIDDEN, PROVIDER_ERROR.",
            "nullable": true
          },
          "externalProviderStatus": {
            "type": "string",
            "nullable": true
          },
          "emailSent": {
            "type": "boolean"
          },
          "emailSentAt": {
            "type": "string",
            "nullable": true
          },
          "emailSentBy": {
            "type": "string",
            "nullable": true
          },
          "createdDate": {
            "type": "string"
          },
          "createdBy": {
            "type": "string",
            "description": "Created by"
          },
          "updatedDate": {
            "type": "string",
            "description": "Updated date"
          },
          "updatedBy": {
            "type": "string",
            "description": "Updated by"
          }
        },
        "additionalProperties": false,
        "description": "Represents an invoice DTO"
      },
      "Billing_InvoiceDtoContentResponse": {
        "type": "object",
        "properties": {
          "data": {
            "$ref": "#/components/schemas/Billing_InvoiceDto"
          },
          "metadata": {
            "$ref": "#/components/schemas/Billing_ContentMetadataResponse"
          }
        },
        "additionalProperties": false
      },
      "Billing_InvoiceDtoResponseBody": {
        "required": [
          "message"
        ],
        "type": "object",
        "properties": {
          "message": {
            "$ref": "#/components/schemas/Billing_MessageWithTokenResponse"
          },
          "content": {
            "$ref": "#/components/schemas/Billing_InvoiceDtoContentResponse"
          },
          "validationIssues": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Billing_ValidationIssue"
            },
            "nullable": true
          },
          "errors": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Billing_Error"
            },
            "description": "Deprecated: the same issues as `validationIssues` (`reasonText` is `reason`, `reasonId` is `reasonToken`, `reasonParameters` is `reasonTokenArguments`). Read `validationIssues`; this will be removed.",
            "nullable": true,
            "readOnly": true,
            "deprecated": true
          },
          "metadata": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Billing_ContentMetadataResponse"
              }
            ],
            "description": "Deprecated: the same values as `content.metadata`. Read that; this will be removed.",
            "deprecated": true
          }
        },
        "additionalProperties": false,
        "description": "Billing's response envelope: the platform's (`message.text` + `message.token`,\n`content.data` + `content.metadata`, `validationIssues`) plus the fields billing\nsent before it (PRODLAUNCH-416). Those are deprecated, removed on 31 December 2026, and are\nprojections of their replacements so the two cannot disagree."
      },
      "Billing_InvoiceLineItemAttachmentDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "lineItemId": {
            "type": "string"
          },
          "filename": {
            "type": "string"
          },
          "contentType": {
            "type": "string"
          },
          "fileSize": {
            "type": "integer",
            "format": "int64"
          },
          "uploadedDate": {
            "type": "string"
          },
          "uploadedBy": {
            "type": "string"
          },
          "source": {
            "type": "string",
            "nullable": true
          },
          "downloadUrl": {
            "type": "string",
            "nullable": true
          },
          "downloadUrlExpiresAt": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "description": "Attachment metadata for an invoice line item. The stored file's key is kept in storage only, never in an API response; downloadUrl/downloadUrlExpiresAt are filled when returning from API."
      },
      "Billing_InvoiceLineItemDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "invoiceId": {
            "type": "string"
          },
          "organisationId": {
            "type": "string",
            "nullable": true
          },
          "clientId": {
            "type": "string",
            "nullable": true
          },
          "employeeId": {
            "type": "string",
            "nullable": true
          },
          "employeeName": {
            "type": "string",
            "nullable": true
          },
          "description": {
            "type": "string"
          },
          "amount": {
            "type": "number",
            "format": "double"
          },
          "payElementId": {
            "type": "string",
            "nullable": true
          },
          "units": {
            "type": "number",
            "format": "double",
            "nullable": true
          },
          "chargeRate": {
            "type": "number",
            "format": "double",
            "nullable": true
          },
          "chargeUnits": {
            "type": "number",
            "format": "double",
            "nullable": true
          },
          "chargeValue": {
            "type": "number",
            "format": "double",
            "nullable": true
          },
          "date": {
            "type": "string",
            "nullable": true
          },
          "tags": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Billing_TagDto"
            },
            "nullable": true
          },
          "createdDate": {
            "type": "string",
            "nullable": true
          },
          "createdBy": {
            "type": "string",
            "nullable": true
          },
          "attachments": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Billing_InvoiceLineItemAttachmentDto"
            },
            "nullable": true
          },
          "payElementDescription": {
            "type": "string",
            "nullable": true
          },
          "accountCode": {
            "type": "string",
            "nullable": true
          },
          "taxType": {
            "type": "string",
            "nullable": true
          },
          "quantity": {
            "type": "number",
            "format": "double",
            "nullable": true
          },
          "unitAmount": {
            "type": "number",
            "format": "double",
            "nullable": true
          },
          "lineAmount": {
            "type": "number",
            "format": "double",
            "nullable": true
          },
          "taxAmount": {
            "type": "number",
            "format": "double",
            "nullable": true
          },
          "poNumber": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "description": "Represents a single invoice line item.\nAccountCode and TaxType are set from pay element mapping during payroll sync.\nQuantity, UnitAmount, LineAmount, TaxAmount support VAT calculation."
      },
      "Billing_InvoiceReferenceFieldDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Token id used in the formula (e.g. payrollConfigName, payDate)."
          },
          "label": {
            "type": "string",
            "description": "Display label for the UI (e.g. \"Payroll config name\", \"Pay date\")."
          }
        },
        "additionalProperties": false,
        "description": "Describes a token that can be used in the invoice reference formula (e.g. \"{payrollConfigName}\", \"{payDate}\")."
      },
      "Billing_LineItemDescriptionFieldDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Placeholder id used in the formula (e.g. chargeDescription, employeeName)."
          },
          "label": {
            "type": "string",
            "description": "Display label for the UI (e.g. \"Charge description\", \"Employee name\")."
          },
          "requiresTagGroup": {
            "type": "boolean",
            "description": "When true, the template must specify LineDescriptionTagGroupId when using this placeholder (e.g. tagValue)."
          }
        },
        "additionalProperties": false,
        "description": "Describes a placeholder that can be used in the line description formula (e.g. \"{chargeDescription}\", \"{employeeName}\")."
      },
      "Billing_ListClientsResponse": {
        "type": "object",
        "properties": {
          "clients": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Billing_ClientDto"
            }
          },
          "paginationToken": {
            "type": "string",
            "description": "Deprecated: the same value as `content.metadata.paginationToken`. Read that; this will be removed.",
            "nullable": true,
            "deprecated": true
          },
          "hasMorePages": {
            "type": "boolean",
            "description": "Deprecated: true exactly when `content.metadata.paginationToken` is present. Read that; this will be removed.",
            "deprecated": true
          },
          "pageSize": {
            "type": "integer",
            "description": "Deprecated: the `pageSize` you asked for. This will be removed.",
            "format": "int32",
            "deprecated": true
          }
        },
        "additionalProperties": false,
        "description": "Response to list clients"
      },
      "Billing_ListClientsResponseContentResponse": {
        "type": "object",
        "properties": {
          "data": {
            "$ref": "#/components/schemas/Billing_ListClientsResponse"
          },
          "metadata": {
            "$ref": "#/components/schemas/Billing_ContentMetadataResponse"
          }
        },
        "additionalProperties": false
      },
      "Billing_ListClientsResponseResponseBody": {
        "required": [
          "message"
        ],
        "type": "object",
        "properties": {
          "message": {
            "$ref": "#/components/schemas/Billing_MessageWithTokenResponse"
          },
          "content": {
            "$ref": "#/components/schemas/Billing_ListClientsResponseContentResponse"
          },
          "validationIssues": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Billing_ValidationIssue"
            },
            "nullable": true
          },
          "errors": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Billing_Error"
            },
            "description": "Deprecated: the same issues as `validationIssues` (`reasonText` is `reason`, `reasonId` is `reasonToken`, `reasonParameters` is `reasonTokenArguments`). Read `validationIssues`; this will be removed.",
            "nullable": true,
            "readOnly": true,
            "deprecated": true
          },
          "metadata": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Billing_ContentMetadataResponse"
              }
            ],
            "description": "Deprecated: the same values as `content.metadata`. Read that; this will be removed.",
            "deprecated": true
          }
        },
        "additionalProperties": false,
        "description": "Billing's response envelope: the platform's (`message.text` + `message.token`,\n`content.data` + `content.metadata`, `validationIssues`) plus the fields billing\nsent before it (PRODLAUNCH-416). Those are deprecated, removed on 31 December 2026, and are\nprojections of their replacements so the two cannot disagree."
      },
      "Billing_ListCreditNoteLineItemsResponse": {
        "type": "object",
        "properties": {
          "lineItems": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Billing_CreditNoteLineItemDto"
            }
          },
          "paginationToken": {
            "type": "string",
            "description": "Deprecated: the same value as `content.metadata.paginationToken`. Read that; this will be removed.",
            "nullable": true,
            "deprecated": true
          },
          "hasMorePages": {
            "type": "boolean",
            "description": "Deprecated: true exactly when `content.metadata.paginationToken` is present. Read that; this will be removed.",
            "deprecated": true
          },
          "pageSize": {
            "type": "integer",
            "description": "Deprecated: the `pageSize` you asked for. This will be removed.",
            "format": "int32",
            "deprecated": true
          }
        },
        "additionalProperties": false,
        "description": "Response for paginated credit note line items."
      },
      "Billing_ListCreditNoteLineItemsResponseContentResponse": {
        "type": "object",
        "properties": {
          "data": {
            "$ref": "#/components/schemas/Billing_ListCreditNoteLineItemsResponse"
          },
          "metadata": {
            "$ref": "#/components/schemas/Billing_ContentMetadataResponse"
          }
        },
        "additionalProperties": false
      },
      "Billing_ListCreditNoteLineItemsResponseResponseBody": {
        "required": [
          "message"
        ],
        "type": "object",
        "properties": {
          "message": {
            "$ref": "#/components/schemas/Billing_MessageWithTokenResponse"
          },
          "content": {
            "$ref": "#/components/schemas/Billing_ListCreditNoteLineItemsResponseContentResponse"
          },
          "validationIssues": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Billing_ValidationIssue"
            },
            "nullable": true
          },
          "errors": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Billing_Error"
            },
            "description": "Deprecated: the same issues as `validationIssues` (`reasonText` is `reason`, `reasonId` is `reasonToken`, `reasonParameters` is `reasonTokenArguments`). Read `validationIssues`; this will be removed.",
            "nullable": true,
            "readOnly": true,
            "deprecated": true
          },
          "metadata": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Billing_ContentMetadataResponse"
              }
            ],
            "description": "Deprecated: the same values as `content.metadata`. Read that; this will be removed.",
            "deprecated": true
          }
        },
        "additionalProperties": false,
        "description": "Billing's response envelope: the platform's (`message.text` + `message.token`,\n`content.data` + `content.metadata`, `validationIssues`) plus the fields billing\nsent before it (PRODLAUNCH-416). Those are deprecated, removed on 31 December 2026, and are\nprojections of their replacements so the two cannot disagree."
      },
      "Billing_ListCreditNotesByOrgResponse": {
        "type": "object",
        "properties": {
          "creditNotes": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Billing_CreditNoteDto"
            }
          },
          "paginationToken": {
            "type": "string",
            "description": "Deprecated: the same value as `content.metadata.paginationToken`. Read that; this will be removed.",
            "nullable": true,
            "deprecated": true
          },
          "hasMorePages": {
            "type": "boolean",
            "description": "Deprecated: true exactly when `content.metadata.paginationToken` is present. Read that; this will be removed.",
            "deprecated": true
          },
          "pageSize": {
            "type": "integer",
            "description": "Deprecated: the `pageSize` you asked for. This will be removed.",
            "format": "int32",
            "deprecated": true
          }
        },
        "additionalProperties": false,
        "description": "Response to list credit notes by organisation (paginated)."
      },
      "Billing_ListCreditNotesByOrgResponseContentResponse": {
        "type": "object",
        "properties": {
          "data": {
            "$ref": "#/components/schemas/Billing_ListCreditNotesByOrgResponse"
          },
          "metadata": {
            "$ref": "#/components/schemas/Billing_ContentMetadataResponse"
          }
        },
        "additionalProperties": false
      },
      "Billing_ListCreditNotesByOrgResponseResponseBody": {
        "required": [
          "message"
        ],
        "type": "object",
        "properties": {
          "message": {
            "$ref": "#/components/schemas/Billing_MessageWithTokenResponse"
          },
          "content": {
            "$ref": "#/components/schemas/Billing_ListCreditNotesByOrgResponseContentResponse"
          },
          "validationIssues": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Billing_ValidationIssue"
            },
            "nullable": true
          },
          "errors": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Billing_Error"
            },
            "description": "Deprecated: the same issues as `validationIssues` (`reasonText` is `reason`, `reasonId` is `reasonToken`, `reasonParameters` is `reasonTokenArguments`). Read `validationIssues`; this will be removed.",
            "nullable": true,
            "readOnly": true,
            "deprecated": true
          },
          "metadata": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Billing_ContentMetadataResponse"
              }
            ],
            "description": "Deprecated: the same values as `content.metadata`. Read that; this will be removed.",
            "deprecated": true
          }
        },
        "additionalProperties": false,
        "description": "Billing's response envelope: the platform's (`message.text` + `message.token`,\n`content.data` + `content.metadata`, `validationIssues`) plus the fields billing\nsent before it (PRODLAUNCH-416). Those are deprecated, removed on 31 December 2026, and are\nprojections of their replacements so the two cannot disagree."
      },
      "Billing_ListInvoiceLineItemsResponse": {
        "type": "object",
        "properties": {
          "lineItems": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Billing_InvoiceLineItemDto"
            }
          },
          "paginationToken": {
            "type": "string",
            "description": "Deprecated: the same value as `content.metadata.paginationToken`. Read that; this will be removed.",
            "nullable": true,
            "deprecated": true
          },
          "hasMorePages": {
            "type": "boolean",
            "description": "Deprecated: true exactly when `content.metadata.paginationToken` is present. Read that; this will be removed.",
            "deprecated": true
          },
          "pageSize": {
            "type": "integer",
            "description": "Deprecated: the `pageSize` you asked for. This will be removed.",
            "format": "int32",
            "deprecated": true
          }
        },
        "additionalProperties": false,
        "description": "Response for listing line items of an invoice (paginated)."
      },
      "Billing_ListInvoiceLineItemsResponseContentResponse": {
        "type": "object",
        "properties": {
          "data": {
            "$ref": "#/components/schemas/Billing_ListInvoiceLineItemsResponse"
          },
          "metadata": {
            "$ref": "#/components/schemas/Billing_ContentMetadataResponse"
          }
        },
        "additionalProperties": false
      },
      "Billing_ListInvoiceLineItemsResponseResponseBody": {
        "required": [
          "message"
        ],
        "type": "object",
        "properties": {
          "message": {
            "$ref": "#/components/schemas/Billing_MessageWithTokenResponse"
          },
          "content": {
            "$ref": "#/components/schemas/Billing_ListInvoiceLineItemsResponseContentResponse"
          },
          "validationIssues": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Billing_ValidationIssue"
            },
            "nullable": true
          },
          "errors": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Billing_Error"
            },
            "description": "Deprecated: the same issues as `validationIssues` (`reasonText` is `reason`, `reasonId` is `reasonToken`, `reasonParameters` is `reasonTokenArguments`). Read `validationIssues`; this will be removed.",
            "nullable": true,
            "readOnly": true,
            "deprecated": true
          },
          "metadata": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Billing_ContentMetadataResponse"
              }
            ],
            "description": "Deprecated: the same values as `content.metadata`. Read that; this will be removed.",
            "deprecated": true
          }
        },
        "additionalProperties": false,
        "description": "Billing's response envelope: the platform's (`message.text` + `message.token`,\n`content.data` + `content.metadata`, `validationIssues`) plus the fields billing\nsent before it (PRODLAUNCH-416). Those are deprecated, removed on 31 December 2026, and are\nprojections of their replacements so the two cannot disagree."
      },
      "Billing_ListInvoicesResponse": {
        "type": "object",
        "properties": {
          "invoices": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Billing_InvoiceDto"
            }
          },
          "paginationToken": {
            "type": "string",
            "description": "Deprecated: the same value as `content.metadata.paginationToken`. Read that; this will be removed.",
            "nullable": true,
            "deprecated": true
          },
          "hasMorePages": {
            "type": "boolean",
            "description": "Deprecated: true exactly when `content.metadata.paginationToken` is present. Read that; this will be removed.",
            "deprecated": true
          },
          "pageSize": {
            "type": "integer",
            "description": "Deprecated: the `pageSize` you asked for. This will be removed.",
            "format": "int32",
            "deprecated": true
          }
        },
        "additionalProperties": false,
        "description": "Response to list invoices"
      },
      "Billing_ListInvoicesResponseContentResponse": {
        "type": "object",
        "properties": {
          "data": {
            "$ref": "#/components/schemas/Billing_ListInvoicesResponse"
          },
          "metadata": {
            "$ref": "#/components/schemas/Billing_ContentMetadataResponse"
          }
        },
        "additionalProperties": false
      },
      "Billing_ListInvoicesResponseResponseBody": {
        "required": [
          "message"
        ],
        "type": "object",
        "properties": {
          "message": {
            "$ref": "#/components/schemas/Billing_MessageWithTokenResponse"
          },
          "content": {
            "$ref": "#/components/schemas/Billing_ListInvoicesResponseContentResponse"
          },
          "validationIssues": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Billing_ValidationIssue"
            },
            "nullable": true
          },
          "errors": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Billing_Error"
            },
            "description": "Deprecated: the same issues as `validationIssues` (`reasonText` is `reason`, `reasonId` is `reasonToken`, `reasonParameters` is `reasonTokenArguments`). Read `validationIssues`; this will be removed.",
            "nullable": true,
            "readOnly": true,
            "deprecated": true
          },
          "metadata": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Billing_ContentMetadataResponse"
              }
            ],
            "description": "Deprecated: the same values as `content.metadata`. Read that; this will be removed.",
            "deprecated": true
          }
        },
        "additionalProperties": false,
        "description": "Billing's response envelope: the platform's (`message.text` + `message.token`,\n`content.data` + `content.metadata`, `validationIssues`) plus the fields billing\nsent before it (PRODLAUNCH-416). Those are deprecated, removed on 31 December 2026, and are\nprojections of their replacements so the two cannot disagree."
      },
      "Billing_Message": {
        "allOf": [
          {
            "$ref": "#/components/schemas/Billing_MessageWithTokenResponse"
          }
        ],
        "description": "Deprecated: renamed to `MessageWithTokenResponse`, which has the same fields and more.",
        "deprecated": true
      },
      "Billing_MessageWithTokenResponse": {
        "required": [
          "token"
        ],
        "type": "object",
        "properties": {
          "text": {
            "type": "string"
          },
          "token": {
            "type": "string"
          },
          "tokenArguments": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Billing_ValidationIssueArgument"
            },
            "nullable": true
          },
          "textId": {
            "type": "string",
            "description": "Deprecated: read `token`; this will be removed.",
            "deprecated": true
          },
          "textParameters": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Billing_Pair"
            },
            "description": "Deprecated: read `tokenArguments`; this will be removed.",
            "nullable": true,
            "deprecated": true
          }
        },
        "additionalProperties": false,
        "description": "What happened, as English `text` and a stable snake_case `token` to translate from."
      },
      "Billing_Metadata": {
        "allOf": [
          {
            "$ref": "#/components/schemas/Billing_ContentMetadataResponse"
          }
        ],
        "description": "Deprecated: renamed to `ContentMetadataResponse`, which has the same fields and more.",
        "deprecated": true
      },
      "Billing_ObjectContentResponse": {
        "type": "object",
        "properties": {
          "data": {
            "nullable": true
          },
          "metadata": {
            "$ref": "#/components/schemas/Billing_ContentMetadataResponse"
          }
        },
        "additionalProperties": false
      },
      "Billing_ObjectResponseBody": {
        "required": [
          "message"
        ],
        "type": "object",
        "properties": {
          "message": {
            "$ref": "#/components/schemas/Billing_MessageWithTokenResponse"
          },
          "content": {
            "$ref": "#/components/schemas/Billing_ObjectContentResponse"
          },
          "validationIssues": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Billing_ValidationIssue"
            },
            "nullable": true
          },
          "errors": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Billing_Error"
            },
            "description": "Deprecated: the same issues as `validationIssues` (`reasonText` is `reason`, `reasonId` is `reasonToken`, `reasonParameters` is `reasonTokenArguments`). Read `validationIssues`; this will be removed.",
            "nullable": true,
            "readOnly": true,
            "deprecated": true
          },
          "metadata": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Billing_ContentMetadataResponse"
              }
            ],
            "description": "Deprecated: the same values as `content.metadata`. Read that; this will be removed.",
            "deprecated": true
          }
        },
        "additionalProperties": false,
        "description": "Billing's response envelope: the platform's (`message.text` + `message.token`,\n`content.data` + `content.metadata`, `validationIssues`) plus the fields billing\nsent before it (PRODLAUNCH-416). Those are deprecated, removed on 31 December 2026, and are\nprojections of their replacements so the two cannot disagree."
      },
      "Billing_OrganisationFinanceDefaultsDto": {
        "type": "object",
        "properties": {
          "defaultRevenueAccount": {
            "type": "string",
            "nullable": true
          },
          "defaultTaxRate": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Billing_OrganisationFinanceDefaultsDtoContentResponse": {
        "type": "object",
        "properties": {
          "data": {
            "$ref": "#/components/schemas/Billing_OrganisationFinanceDefaultsDto"
          },
          "metadata": {
            "$ref": "#/components/schemas/Billing_ContentMetadataResponse"
          }
        },
        "additionalProperties": false
      },
      "Billing_OrganisationFinanceDefaultsDtoResponseBody": {
        "required": [
          "message"
        ],
        "type": "object",
        "properties": {
          "message": {
            "$ref": "#/components/schemas/Billing_MessageWithTokenResponse"
          },
          "content": {
            "$ref": "#/components/schemas/Billing_OrganisationFinanceDefaultsDtoContentResponse"
          },
          "validationIssues": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Billing_ValidationIssue"
            },
            "nullable": true
          },
          "errors": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Billing_Error"
            },
            "description": "Deprecated: the same issues as `validationIssues` (`reasonText` is `reason`, `reasonId` is `reasonToken`, `reasonParameters` is `reasonTokenArguments`). Read `validationIssues`; this will be removed.",
            "nullable": true,
            "readOnly": true,
            "deprecated": true
          },
          "metadata": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Billing_ContentMetadataResponse"
              }
            ],
            "description": "Deprecated: the same values as `content.metadata`. Read that; this will be removed.",
            "deprecated": true
          }
        },
        "additionalProperties": false,
        "description": "Billing's response envelope: the platform's (`message.text` + `message.token`,\n`content.data` + `content.metadata`, `validationIssues`) plus the fields billing\nsent before it (PRODLAUNCH-416). Those are deprecated, removed on 31 December 2026, and are\nprojections of their replacements so the two cannot disagree."
      },
      "Billing_OrganisationPayElementMappingsDto": {
        "type": "object",
        "properties": {
          "payElementMappings": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Billing_PayElementMappingItemDto"
            }
          }
        },
        "additionalProperties": false
      },
      "Billing_OrganisationPayElementMappingsDtoContentResponse": {
        "type": "object",
        "properties": {
          "data": {
            "$ref": "#/components/schemas/Billing_OrganisationPayElementMappingsDto"
          },
          "metadata": {
            "$ref": "#/components/schemas/Billing_ContentMetadataResponse"
          }
        },
        "additionalProperties": false
      },
      "Billing_OrganisationPayElementMappingsDtoResponseBody": {
        "required": [
          "message"
        ],
        "type": "object",
        "properties": {
          "message": {
            "$ref": "#/components/schemas/Billing_MessageWithTokenResponse"
          },
          "content": {
            "$ref": "#/components/schemas/Billing_OrganisationPayElementMappingsDtoContentResponse"
          },
          "validationIssues": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Billing_ValidationIssue"
            },
            "nullable": true
          },
          "errors": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Billing_Error"
            },
            "description": "Deprecated: the same issues as `validationIssues` (`reasonText` is `reason`, `reasonId` is `reasonToken`, `reasonParameters` is `reasonTokenArguments`). Read `validationIssues`; this will be removed.",
            "nullable": true,
            "readOnly": true,
            "deprecated": true
          },
          "metadata": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Billing_ContentMetadataResponse"
              }
            ],
            "description": "Deprecated: the same values as `content.metadata`. Read that; this will be removed.",
            "deprecated": true
          }
        },
        "additionalProperties": false,
        "description": "Billing's response envelope: the platform's (`message.text` + `message.token`,\n`content.data` + `content.metadata`, `validationIssues`) plus the fields billing\nsent before it (PRODLAUNCH-416). Those are deprecated, removed on 31 December 2026, and are\nprojections of their replacements so the two cannot disagree."
      },
      "Billing_Pair": {
        "type": "object",
        "properties": {
          "key": {
            "type": "string",
            "nullable": true
          },
          "value": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "description": "Deprecated: a key and value of the old `textParameters` and `reasonParameters`.",
        "deprecated": true
      },
      "Billing_PayElementMappingItemDto": {
        "type": "object",
        "properties": {
          "payElementId": {
            "type": "string"
          },
          "accountCode": {
            "type": "string"
          },
          "taxType": {
            "type": "string"
          }
        },
        "additionalProperties": false,
        "description": "Maps a payroll pay element to a finance account code and tax type for automatic invoice line item assignment."
      },
      "Billing_ProviderAccountItemDto": {
        "type": "object",
        "properties": {
          "code": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "type": {
            "enum": [
              "Revenue",
              "Expense",
              "Asset",
              "Liability",
              "Equity"
            ],
            "type": "string",
            "description": "Which side of the ledger an account sits on."
          }
        },
        "additionalProperties": false,
        "description": "Read-only preview of an account from the accounting provider (for list/select UI)."
      },
      "Billing_ProviderAccountsListResponse": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Billing_ProviderAccountItemDto"
            }
          },
          "nextPageToken": {
            "type": "string",
            "description": "Deprecated: the same value as `content.metadata.paginationToken`. Read that; this will be removed.",
            "nullable": true,
            "deprecated": true
          },
          "connected": {
            "type": "boolean",
            "description": "Whether this organisation has a usable accounting connection. False\nmeans the empty list says nothing about what the accounting system\nholds, because it was never asked."
          },
          "notConnectedReason": {
            "$ref": "#/components/schemas/Billing_AccountingSendRefusalDto"
          }
        },
        "additionalProperties": false,
        "description": "Paginated list of provider accounts (for list endpoint)."
      },
      "Billing_ProviderAccountsListResponseContentResponse": {
        "type": "object",
        "properties": {
          "data": {
            "$ref": "#/components/schemas/Billing_ProviderAccountsListResponse"
          },
          "metadata": {
            "$ref": "#/components/schemas/Billing_ContentMetadataResponse"
          }
        },
        "additionalProperties": false
      },
      "Billing_ProviderAccountsListResponseResponseBody": {
        "required": [
          "message"
        ],
        "type": "object",
        "properties": {
          "message": {
            "$ref": "#/components/schemas/Billing_MessageWithTokenResponse"
          },
          "content": {
            "$ref": "#/components/schemas/Billing_ProviderAccountsListResponseContentResponse"
          },
          "validationIssues": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Billing_ValidationIssue"
            },
            "nullable": true
          },
          "errors": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Billing_Error"
            },
            "description": "Deprecated: the same issues as `validationIssues` (`reasonText` is `reason`, `reasonId` is `reasonToken`, `reasonParameters` is `reasonTokenArguments`). Read `validationIssues`; this will be removed.",
            "nullable": true,
            "readOnly": true,
            "deprecated": true
          },
          "metadata": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Billing_ContentMetadataResponse"
              }
            ],
            "description": "Deprecated: the same values as `content.metadata`. Read that; this will be removed.",
            "deprecated": true
          }
        },
        "additionalProperties": false,
        "description": "Billing's response envelope: the platform's (`message.text` + `message.token`,\n`content.data` + `content.metadata`, `validationIssues`) plus the fields billing\nsent before it (PRODLAUNCH-416). Those are deprecated, removed on 31 December 2026, and are\nprojections of their replacements so the two cannot disagree."
      },
      "Billing_ProviderContactItemDto": {
        "type": "object",
        "properties": {
          "providerId": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "emailAddress": {
            "type": "string",
            "nullable": true
          },
          "taxNumber": {
            "type": "string",
            "nullable": true
          },
          "companyNumber": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "description": "Read-only preview of a contact from the accounting provider (for list/select UI)."
      },
      "Billing_ProviderContactsListResponse": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Billing_ProviderContactItemDto"
            }
          },
          "nextPageToken": {
            "type": "string",
            "description": "Deprecated: the same value as `content.metadata.paginationToken`. Read that; this will be removed.",
            "nullable": true,
            "deprecated": true
          },
          "connected": {
            "type": "boolean",
            "description": "Whether this organisation has a usable accounting connection. False\nmeans the empty list says nothing about what the accounting system\nholds, because it was never asked."
          },
          "notConnectedReason": {
            "$ref": "#/components/schemas/Billing_AccountingSendRefusalDto"
          }
        },
        "additionalProperties": false,
        "description": "Paginated list of provider contacts (for list endpoint)."
      },
      "Billing_ProviderContactsListResponseContentResponse": {
        "type": "object",
        "properties": {
          "data": {
            "$ref": "#/components/schemas/Billing_ProviderContactsListResponse"
          },
          "metadata": {
            "$ref": "#/components/schemas/Billing_ContentMetadataResponse"
          }
        },
        "additionalProperties": false
      },
      "Billing_ProviderContactsListResponseResponseBody": {
        "required": [
          "message"
        ],
        "type": "object",
        "properties": {
          "message": {
            "$ref": "#/components/schemas/Billing_MessageWithTokenResponse"
          },
          "content": {
            "$ref": "#/components/schemas/Billing_ProviderContactsListResponseContentResponse"
          },
          "validationIssues": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Billing_ValidationIssue"
            },
            "nullable": true
          },
          "errors": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Billing_Error"
            },
            "description": "Deprecated: the same issues as `validationIssues` (`reasonText` is `reason`, `reasonId` is `reasonToken`, `reasonParameters` is `reasonTokenArguments`). Read `validationIssues`; this will be removed.",
            "nullable": true,
            "readOnly": true,
            "deprecated": true
          },
          "metadata": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Billing_ContentMetadataResponse"
              }
            ],
            "description": "Deprecated: the same values as `content.metadata`. Read that; this will be removed.",
            "deprecated": true
          }
        },
        "additionalProperties": false,
        "description": "Billing's response envelope: the platform's (`message.text` + `message.token`,\n`content.data` + `content.metadata`, `validationIssues`) plus the fields billing\nsent before it (PRODLAUNCH-416). Those are deprecated, removed on 31 December 2026, and are\nprojections of their replacements so the two cannot disagree."
      },
      "Billing_ProviderTaxRateItemDto": {
        "type": "object",
        "properties": {
          "taxType": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "effectiveRate": {
            "type": "number",
            "format": "double"
          }
        },
        "additionalProperties": false,
        "description": "Read-only preview of a tax rate from the accounting provider (for list/select UI)."
      },
      "Billing_ProviderTaxRatesListResponse": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Billing_ProviderTaxRateItemDto"
            }
          },
          "nextPageToken": {
            "type": "string",
            "description": "Deprecated: the same value as `content.metadata.paginationToken`. Read that; this will be removed.",
            "nullable": true,
            "deprecated": true
          },
          "connected": {
            "type": "boolean",
            "description": "Whether this organisation has a usable accounting connection. False\nmeans the empty list says nothing about what the accounting system\nholds, because it was never asked."
          },
          "notConnectedReason": {
            "$ref": "#/components/schemas/Billing_AccountingSendRefusalDto"
          }
        },
        "additionalProperties": false,
        "description": "Paginated list of provider tax rates (for list endpoint)."
      },
      "Billing_ProviderTaxRatesListResponseContentResponse": {
        "type": "object",
        "properties": {
          "data": {
            "$ref": "#/components/schemas/Billing_ProviderTaxRatesListResponse"
          },
          "metadata": {
            "$ref": "#/components/schemas/Billing_ContentMetadataResponse"
          }
        },
        "additionalProperties": false
      },
      "Billing_ProviderTaxRatesListResponseResponseBody": {
        "required": [
          "message"
        ],
        "type": "object",
        "properties": {
          "message": {
            "$ref": "#/components/schemas/Billing_MessageWithTokenResponse"
          },
          "content": {
            "$ref": "#/components/schemas/Billing_ProviderTaxRatesListResponseContentResponse"
          },
          "validationIssues": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Billing_ValidationIssue"
            },
            "nullable": true
          },
          "errors": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Billing_Error"
            },
            "description": "Deprecated: the same issues as `validationIssues` (`reasonText` is `reason`, `reasonId` is `reasonToken`, `reasonParameters` is `reasonTokenArguments`). Read `validationIssues`; this will be removed.",
            "nullable": true,
            "readOnly": true,
            "deprecated": true
          },
          "metadata": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Billing_ContentMetadataResponse"
              }
            ],
            "description": "Deprecated: the same values as `content.metadata`. Read that; this will be removed.",
            "deprecated": true
          }
        },
        "additionalProperties": false,
        "description": "Billing's response envelope: the platform's (`message.text` + `message.token`,\n`content.data` + `content.metadata`, `validationIssues`) plus the fields billing\nsent before it (PRODLAUNCH-416). Those are deprecated, removed on 31 December 2026, and are\nprojections of their replacements so the two cannot disagree."
      },
      "Billing_RefreshLineItemMappingsRequest": {
        "type": "object",
        "properties": {
          "accountCode": {
            "type": "string",
            "nullable": true
          },
          "taxType": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Billing_RefreshLineItemMappingsResponse": {
        "type": "object",
        "properties": {
          "refreshedLineCount": {
            "type": "integer",
            "format": "int32"
          },
          "invoice": {
            "$ref": "#/components/schemas/Billing_InvoiceDto"
          }
        },
        "additionalProperties": false
      },
      "Billing_RefreshLineItemMappingsResponseContentResponse": {
        "type": "object",
        "properties": {
          "data": {
            "$ref": "#/components/schemas/Billing_RefreshLineItemMappingsResponse"
          },
          "metadata": {
            "$ref": "#/components/schemas/Billing_ContentMetadataResponse"
          }
        },
        "additionalProperties": false
      },
      "Billing_RefreshLineItemMappingsResponseResponseBody": {
        "required": [
          "message"
        ],
        "type": "object",
        "properties": {
          "message": {
            "$ref": "#/components/schemas/Billing_MessageWithTokenResponse"
          },
          "content": {
            "$ref": "#/components/schemas/Billing_RefreshLineItemMappingsResponseContentResponse"
          },
          "validationIssues": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Billing_ValidationIssue"
            },
            "nullable": true
          },
          "errors": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Billing_Error"
            },
            "description": "Deprecated: the same issues as `validationIssues` (`reasonText` is `reason`, `reasonId` is `reasonToken`, `reasonParameters` is `reasonTokenArguments`). Read `validationIssues`; this will be removed.",
            "nullable": true,
            "readOnly": true,
            "deprecated": true
          },
          "metadata": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Billing_ContentMetadataResponse"
              }
            ],
            "description": "Deprecated: the same values as `content.metadata`. Read that; this will be removed.",
            "deprecated": true
          }
        },
        "additionalProperties": false,
        "description": "Billing's response envelope: the platform's (`message.text` + `message.token`,\n`content.data` + `content.metadata`, `validationIssues`) plus the fields billing\nsent before it (PRODLAUNCH-416). Those are deprecated, removed on 31 December 2026, and are\nprojections of their replacements so the two cannot disagree."
      },
      "Billing_StringContentResponse": {
        "type": "object",
        "properties": {
          "data": {
            "type": "string",
            "nullable": true
          },
          "metadata": {
            "$ref": "#/components/schemas/Billing_ContentMetadataResponse"
          }
        },
        "additionalProperties": false
      },
      "Billing_StringResponseBody": {
        "required": [
          "message"
        ],
        "type": "object",
        "properties": {
          "message": {
            "$ref": "#/components/schemas/Billing_MessageWithTokenResponse"
          },
          "content": {
            "$ref": "#/components/schemas/Billing_StringContentResponse"
          },
          "validationIssues": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Billing_ValidationIssue"
            },
            "nullable": true
          },
          "errors": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Billing_Error"
            },
            "description": "Deprecated: the same issues as `validationIssues` (`reasonText` is `reason`, `reasonId` is `reasonToken`, `reasonParameters` is `reasonTokenArguments`). Read `validationIssues`; this will be removed.",
            "nullable": true,
            "readOnly": true,
            "deprecated": true
          },
          "metadata": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Billing_ContentMetadataResponse"
              }
            ],
            "description": "Deprecated: the same values as `content.metadata`. Read that; this will be removed.",
            "deprecated": true
          }
        },
        "additionalProperties": false,
        "description": "Billing's response envelope: the platform's (`message.text` + `message.token`,\n`content.data` + `content.metadata`, `validationIssues`) plus the fields billing\nsent before it (PRODLAUNCH-416). Those are deprecated, removed on 31 December 2026, and are\nprojections of their replacements so the two cannot disagree."
      },
      "Billing_SubtotalGroupDto": {
        "type": "object",
        "properties": {
          "label": {
            "type": "string"
          },
          "amount": {
            "type": "number",
            "format": "double"
          },
          "taxAmount": {
            "type": "number",
            "format": "double"
          },
          "totalAmount": {
            "type": "number",
            "format": "double"
          },
          "sortOrder": {
            "type": "integer",
            "format": "int32"
          }
        },
        "additionalProperties": false,
        "description": "Pre-calculated subtotal group metadata, for summary display and for header and subtotal lines on a sent document."
      },
      "Billing_TagDto": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string"
          },
          "group": {
            "type": "string"
          },
          "value": {
            "type": "string"
          }
        },
        "additionalProperties": false
      },
      "Billing_TaxRateDto": {
        "type": "object",
        "properties": {
          "taxType": {
            "type": "string",
            "description": "Tax type code (unique, e.g., \"OUTPUT2\", \"ZERORATEDOUTPUT\")."
          },
          "name": {
            "type": "string"
          },
          "effectiveRate": {
            "type": "number",
            "format": "double"
          },
          "displayTaxRate": {
            "type": "number",
            "format": "double"
          },
          "status": {
            "enum": [
              "Active",
              "Archived"
            ],
            "type": "string",
            "description": "Status of an account code."
          },
          "canApplyToRevenue": {
            "type": "boolean"
          },
          "canApplyToExpenses": {
            "type": "boolean"
          },
          "organisationId": {
            "type": "string"
          },
          "isInUse": {
            "type": "boolean",
            "description": "True when this tax rate is referenced by credit notes or client finance settings; delete is not allowed (use archive instead)."
          },
          "providerId": {
            "type": "string",
            "description": "The accounting system's own id for this rate. Without it a later edit creates a second copy of the same rate rather than updating the first.",
            "nullable": true
          },
          "externalProvider": {
            "type": "string",
            "description": "Which accounting system holds it, as the integrations hub named it.",
            "nullable": true
          },
          "syncStatus": {
            "enum": [
              "NotSynced",
              "Synced",
              "SyncFailed",
              "Syncing",
              "NeedsAttention"
            ],
            "type": "string",
            "description": "Sync status with external provider.",
            "nullable": true
          },
          "lastSyncedAt": {
            "type": "string",
            "description": "When the accounting system last synced this (UTC, ISO 8601).\n            \n\nThe provider's own moment, not when this service recorded\nthe answer, so it is safe to reconcile against the provider's\nrecords and does not move with our internal queue timings. Null\nuntil a send has succeeded.",
            "nullable": true
          },
          "syncErrorMessage": {
            "type": "string",
            "description": "Last sync error message when sync failed.",
            "nullable": true
          },
          "createdDate": {
            "type": "string",
            "nullable": true
          },
          "createdBy": {
            "type": "string",
            "nullable": true
          },
          "updatedDate": {
            "type": "string",
            "nullable": true
          },
          "updatedBy": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "description": "A tax rate this organisation charges."
      },
      "Billing_TaxRateDtoContentResponse": {
        "type": "object",
        "properties": {
          "data": {
            "$ref": "#/components/schemas/Billing_TaxRateDto"
          },
          "metadata": {
            "$ref": "#/components/schemas/Billing_ContentMetadataResponse"
          }
        },
        "additionalProperties": false
      },
      "Billing_TaxRateDtoResponseBody": {
        "required": [
          "message"
        ],
        "type": "object",
        "properties": {
          "message": {
            "$ref": "#/components/schemas/Billing_MessageWithTokenResponse"
          },
          "content": {
            "$ref": "#/components/schemas/Billing_TaxRateDtoContentResponse"
          },
          "validationIssues": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Billing_ValidationIssue"
            },
            "nullable": true
          },
          "errors": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Billing_Error"
            },
            "description": "Deprecated: the same issues as `validationIssues` (`reasonText` is `reason`, `reasonId` is `reasonToken`, `reasonParameters` is `reasonTokenArguments`). Read `validationIssues`; this will be removed.",
            "nullable": true,
            "readOnly": true,
            "deprecated": true
          },
          "metadata": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Billing_ContentMetadataResponse"
              }
            ],
            "description": "Deprecated: the same values as `content.metadata`. Read that; this will be removed.",
            "deprecated": true
          }
        },
        "additionalProperties": false,
        "description": "Billing's response envelope: the platform's (`message.text` + `message.token`,\n`content.data` + `content.metadata`, `validationIssues`) plus the fields billing\nsent before it (PRODLAUNCH-416). Those are deprecated, removed on 31 December 2026, and are\nprojections of their replacements so the two cannot disagree."
      },
      "Billing_TrackingCategoryDto": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string"
          },
          "option": {
            "type": "string"
          },
          "trackingCategoryId": {
            "type": "string",
            "nullable": true
          },
          "trackingOptionId": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "description": "One analysis dimension on a line."
      },
      "Billing_UpdatableClientDto": {
        "required": [
          "typeDiscriminator"
        ],
        "type": "object",
        "properties": {
          "typeDiscriminator": {
            "type": "string"
          },
          "id": {
            "type": "string",
            "description": "ID. Assigned by billing when a client is created without one; on an update the\nclient in the route is the one changed, whatever this says."
          },
          "name": {
            "type": "string",
            "description": "Name. Validated in code (see ClientDtoValidator) rather than via the\n`required` modifier so a missing value surfaces a friendly validation\nmessage instead of a model-binding failure.",
            "nullable": true
          },
          "poRequirement": {
            "enum": [
              "None",
              "Warning",
              "Required"
            ],
            "type": "string",
            "description": "PO requirement"
          },
          "attachmentRequirement": {
            "enum": [
              "None",
              "Warning",
              "Required"
            ],
            "type": "string",
            "description": "Attachment requirement"
          },
          "invoiceFormat": {
            "enum": [
              "None",
              "Date",
              "PayElementId",
              "PoNumber",
              "TagGroup",
              "PayrollConfigId"
            ],
            "type": "string",
            "description": "Invoice format"
          },
          "invoiceFormatTagGroup": {
            "type": "string",
            "description": "Invoice format tag group (e.g. \"System\"). Paired with InvoiceFormatTagName to identify a tag uniquely.",
            "nullable": true
          },
          "invoiceFormatTagName": {
            "type": "string",
            "description": "Invoice format tag name (e.g. \"Invoice No\"). Required when InvoiceFormat is TagGroup; paired with InvoiceFormatTagGroup to identify a tag uniquely.",
            "nullable": true
          },
          "invoiceNumberFormat": {
            "enum": [
              "None",
              "TagLookup"
            ],
            "type": "string",
            "description": "Strategy for auto-populating Invoice Number at invoice-creation time.\nDefault None (nothing is auto-filled); TagLookup reads a tag value."
          },
          "invoiceNumberTagGroup": {
            "type": "string",
            "description": "Tag group to read when InvoiceNumberFormat is TagLookup (e.g. \"System\"). Case-insensitive.",
            "nullable": true
          },
          "invoiceNumberTagName": {
            "type": "string",
            "description": "Tag name to read when InvoiceNumberFormat is TagLookup (e.g. \"Invoice No\"). Case-insensitive.",
            "nullable": true
          },
          "subtotalGroupBy": {
            "enum": [
              "None",
              "PayElement",
              "TagGroup"
            ],
            "type": "string",
            "description": "Subtotal grouping for invoice line items (None, PayElement, TagGroup)."
          },
          "subtotalTagGroupName": {
            "type": "string",
            "description": "Tag group name used when SubtotalGroupBy is TagGroup. Required when SubtotalGroupBy is TagGroup.",
            "nullable": true
          },
          "rebatePercentage": {
            "type": "number",
            "description": "Rebate percentage",
            "format": "double",
            "nullable": true
          },
          "vatNumber": {
            "type": "string",
            "description": "VAT number",
            "nullable": true
          },
          "registrationNumber": {
            "type": "string",
            "description": "Registration number",
            "nullable": true
          },
          "contacts": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Billing_UpdatableContactDto"
            },
            "description": "Contacts",
            "nullable": true
          },
          "tags": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Billing_TagDto"
            },
            "description": "Tags",
            "nullable": true
          },
          "status": {
            "enum": [
              "Active",
              "Archived"
            ],
            "type": "string",
            "description": "Client status (Active or Archived). Default Active."
          },
          "defaultRevenueAccountCode": {
            "type": "string",
            "description": "Default revenue account code for Quick Credit (e.g. from Finance Settings).\nWhen set, Quick Credit uses this account; otherwise first active revenue account is used.\nOptional on Create when organisation finance defaults are configured; omitted values are auto-filled from org defaults.",
            "nullable": true
          },
          "defaultTaxType": {
            "type": "string",
            "description": "Default tax type for Quick Credit (e.g. from Finance Settings).\nWhen set, Quick Credit uses this tax; otherwise first active tax rate is used.\nOptional on Create when organisation finance defaults are configured; omitted values are auto-filled from org defaults.",
            "nullable": true
          },
          "providerId": {
            "type": "string",
            "description": "The accounting system's own id for this contact. Sending it back is what makes a re-send an update rather than a duplicate.",
            "nullable": true
          },
          "externalProvider": {
            "type": "string",
            "description": "Which accounting system holds it, as the integrations hub named it.",
            "nullable": true
          },
          "syncStatus": {
            "enum": [
              "NotSynced",
              "Synced",
              "SyncFailed",
              "Syncing",
              "NeedsAttention"
            ],
            "type": "string",
            "description": "Sync status with external accounting provider.",
            "nullable": true
          },
          "lastSyncedAt": {
            "type": "string",
            "description": "When the accounting system last synced this (UTC, ISO 8601).\n            \n\nThe provider's own moment, not when this service recorded\nthe answer, so it is safe to reconcile against the provider's\nrecords and does not move with our internal queue timings. Null\nuntil a send has succeeded.",
            "nullable": true
          },
          "syncErrorMessage": {
            "type": "string",
            "description": "Last sync error message when SyncStatus is Failed.",
            "nullable": true
          },
          "billingAddress": {
            "$ref": "#/components/schemas/Billing_AddressDto"
          },
          "physicalAddress": {
            "$ref": "#/components/schemas/Billing_AddressDto"
          }
        },
        "additionalProperties": false,
        "description": "Updatable client DTO",
        "discriminator": {
          "propertyName": "typeDiscriminator",
          "mapping": {
            "UpdatableClientDto": "#/components/schemas/Billing_UpdatableClientDto",
            "ClientDto": "#/components/schemas/Billing_ClientDto"
          }
        }
      },
      "Billing_UpdatableContactDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "ID",
            "nullable": true
          },
          "firstName": {
            "type": "string",
            "description": "First name. Validated in code (see ClientDtoValidator) rather than via the\n`required` modifier so a missing value surfaces a friendly per-field\nvalidation message instead of a model-binding failure.",
            "nullable": true
          },
          "lastName": {
            "type": "string",
            "description": "Last name. Validated in code (see ClientDtoValidator) — see note on FirstName.",
            "nullable": true
          },
          "email": {
            "type": "string",
            "description": "Email. Validated in code (see ClientDtoValidator) — see note on FirstName.",
            "nullable": true
          },
          "phone": {
            "type": "string",
            "description": "Phone",
            "nullable": true
          },
          "role": {
            "type": "string",
            "description": "Role",
            "nullable": true
          },
          "tags": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Billing_TagDto"
            },
            "description": "Tags",
            "nullable": true
          },
          "includeInEmails": {
            "type": "boolean",
            "description": "Whether to include this contact in invoice/credit note emails (e.g. when sending to accounting provider).\nWhether documents are emailed to this person; each accounting system maps it to its own equivalent."
          }
        },
        "additionalProperties": false,
        "description": "Updatable contact DTO"
      },
      "Billing_UpdatableInvoiceDto": {
        "type": "object",
        "properties": {
          "tags": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Billing_TagDto"
            },
            "description": "Tags (same as client/contact tags). When provided, replaces the invoice's tags.",
            "nullable": true
          },
          "dueDate": {
            "type": "string",
            "description": "Due date (YYYY-MM-DD). When provided, updates the invoice due date.",
            "nullable": true
          },
          "invoiceNumber": {
            "type": "string",
            "description": "Invoice number. When provided, updates the invoice number.",
            "nullable": true
          },
          "reference": {
            "type": "string",
            "description": "Reference (e.g. PO number). When provided, updates the invoice reference.",
            "nullable": true
          },
          "currencyCode": {
            "type": "string",
            "description": "Currency code (e.g. GBP, USD). When provided, updates the invoice currency.",
            "nullable": true
          },
          "lineAmountTypes": {
            "type": "string",
            "description": "Line amount type (e.g. Exclusive, Inclusive). When provided, updates the invoice line amount type.",
            "nullable": true
          },
          "invoiceType": {
            "enum": [
              "Sales",
              "Purchase"
            ],
            "type": "string",
            "description": "Invoice type (e.g. Sales, Purchase). When provided, updates the invoice type.",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "description": "Request DTO for updating an open invoice (e.g. tags, due date, reference). Only open invoices can be updated."
      },
      "Billing_UpdateCreditNoteRequest": {
        "type": "object",
        "properties": {
          "organisationId": {
            "type": "string"
          },
          "clientId": {
            "type": "string"
          },
          "creditNoteId": {
            "type": "string"
          },
          "date": {
            "type": "string",
            "nullable": true
          },
          "lineAmountTypes": {
            "enum": [
              "Exclusive",
              "Inclusive",
              "NoTax"
            ],
            "type": "string",
            "nullable": true
          },
          "reference": {
            "type": "string",
            "nullable": true
          },
          "invoiceReference": {
            "type": "string",
            "nullable": true
          },
          "linkedInvoiceId": {
            "type": "string",
            "nullable": true
          },
          "groupingKey": {
            "type": "string",
            "nullable": true
          },
          "lineItems": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Billing_CreditNoteLineItemDto"
            },
            "nullable": true
          }
        },
        "additionalProperties": false,
        "description": "Request to update a draft credit note."
      },
      "Billing_ValidationIssue": {
        "type": "object",
        "properties": {
          "field": {
            "type": "string"
          },
          "reason": {
            "type": "string"
          },
          "reasonToken": {
            "type": "string"
          },
          "reasonTokenArguments": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Billing_ValidationIssueArgument"
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Billing_ValidationIssueArgument": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string"
          },
          "value": {
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Billing_VoidRequest": {
        "type": "object",
        "additionalProperties": false,
        "description": "Request to void a credit note. UserId is taken from JWT (Claim)."
      },
      "Payment_AvailablePaymentConfigResponse": {
        "type": "object",
        "description": "A payment method and format an organisation can configure.",
        "required": [
          "method",
          "format",
          "supportedFileFormats",
          "fileLayouts"
        ],
        "properties": {
          "method": {
            "type": "string",
            "description": "Payment method.",
            "example": "BACS"
          },
          "format": {
            "type": "string",
            "description": "Payment format within the method.",
            "example": "Barclays"
          },
          "supportedFileFormats": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "File formats this method and format can be written as.",
            "example": [
              "txt",
              "csv"
            ]
          },
          "fileLayouts": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Payment_PaymentFileLayout"
            },
            "description": "This format's files as layouts, one per file format, for a Custom layout to start from. Empty when the format has none."
          }
        },
        "example": {
          "method": "BACS",
          "format": "Allica Bank",
          "supportedFileFormats": [
            "csv"
          ],
          "fileLayouts": [
            {
              "id": "allica-bank-csv",
              "name": "Allica Bank bulk payments (CSV)",
              "extension": "csv",
              "rowFormat": "Delimited",
              "delimiter": ",",
              "headingRow": true,
              "lineEnding": "Crlf",
              "encoding": "Utf8",
              "columns": [
                {
                  "field": "PayeeAccountNameAsEntered",
                  "heading": "Name"
                },
                {
                  "field": "Literal",
                  "literal": "Personal",
                  "heading": "Account Type"
                },
                {
                  "field": "Reference",
                  "heading": "Reference",
                  "trim": false
                },
                {
                  "field": "PayeeSortCode",
                  "sortCode": "Dashed",
                  "heading": "Sort Code"
                },
                {
                  "field": "PayeeAccountNumber",
                  "heading": "Account no"
                },
                {
                  "field": "Amount",
                  "amount": "Pounds",
                  "heading": "Amount"
                }
              ]
            }
          ]
        }
      },
      "Payment_BACSPaymentConfigRequest": {
        "type": "object",
        "description": "The BACS source bank account the payment files are written for.",
        "required": [
          "sortCode",
          "accountNumber"
        ],
        "properties": {
          "sortCode": {
            "type": "string",
            "description": "Sort code of the account the payments are made from: 6 digits, dashes allowed.",
            "example": "12-34-56"
          },
          "accountNumber": {
            "type": "string",
            "description": "Account number of the account the payments are made from: 8 digits.",
            "example": "12345678"
          },
          "serviceUserNumber": {
            "type": "string",
            "nullable": true,
            "description": "Your BACS service user number (SUN), when the format needs one.",
            "example": "SUN123"
          },
          "accountName": {
            "type": "string",
            "nullable": true,
            "description": "Originating account name for Bacs Standard 18 files. Populates field 9 (positions 47-64) in payment records. Max 18 characters. Optional.",
            "example": "ACME CORP LTD"
          }
        },
        "example": {
          "sortCode": "12-34-56",
          "accountNumber": "12345678",
          "serviceUserNumber": "SUN123",
          "accountName": "ACME CORP LTD"
        }
      },
      "Payment_BACSPaymentConfigResponse": {
        "type": "object",
        "description": "The BACS source bank account the payment files are written for.",
        "required": [
          "sortCode",
          "accountNumber"
        ],
        "properties": {
          "sortCode": {
            "type": "string",
            "description": "Sort code of the account the payments are made from.",
            "example": "12-34-56"
          },
          "accountNumber": {
            "type": "string",
            "description": "Account number of the account the payments are made from.",
            "example": "12345678"
          },
          "serviceUserNumber": {
            "type": "string",
            "nullable": true,
            "description": "Your BACS service user number (SUN), when the format needs one.",
            "example": "SUN123"
          },
          "accountName": {
            "type": "string",
            "nullable": true,
            "description": "Originating account name for Bacs Standard 18 files. Populates field 9 (positions 47-64) in payment records. Max 18 characters. Optional.",
            "example": "ACME CORP LTD"
          }
        },
        "example": {
          "sortCode": "12-34-56",
          "accountNumber": "12345678",
          "serviceUserNumber": "SUN123",
          "accountName": "ACME CORP LTD"
        }
      },
      "Payment_ContentMetadataResponse": {
        "type": "object",
        "description": "How to read the dates in the data, and the next page's token on a paged list.",
        "required": [
          "dateFormat",
          "dateTimeFormat"
        ],
        "properties": {
          "dateFormat": {
            "type": "string",
            "description": "The format of dates in the data."
          },
          "dateTimeFormat": {
            "type": "string",
            "description": "The format of timestamps in the data."
          },
          "paginationToken": {
            "type": "string",
            "nullable": true,
            "description": "The token for the next page, on a paged list that has one."
          }
        }
      },
      "Payment_CreatePaymentConfigRequest": {
        "type": "object",
        "description": "A pay schedule's payment configuration, as created.",
        "required": [
          "method",
          "format"
        ],
        "properties": {
          "method": {
            "type": "string",
            "description": "Payment method, as listed by `GET /available/config`.",
            "example": "BACS"
          },
          "format": {
            "type": "string",
            "description": "Payment format within the method, as listed by `GET /available/config`.",
            "example": "Barclays"
          },
          "fileFormat": {
            "type": "string",
            "nullable": true,
            "description": "Optional. txt when left out. Use csv only when listed in supportedFileFormats for this method and format.",
            "example": "csv",
            "default": "txt"
          },
          "reference": {
            "type": "string",
            "nullable": true,
            "description": "Single reference expression. Supports static text and tokens in any order: {payDate}, {payPeriodStart}, {payPeriodEnd}, {year}, {period}, {frequency}, {separator:space}, {separator:dash}, {separator:underscore}, {separator:slash}, {separator:custom:<value>}.",
            "example": "Payroll May 2024"
          },
          "referenceDateFormat": {
            "type": "string",
            "enum": [
              "DMY_COMPACT",
              "DMY_SLASH",
              "YMD_DASH",
              "MDY_SLASH",
              "DMY_DASH",
              "DMY_DOT",
              null
            ],
            "nullable": true,
            "description": "Date format applied to date tokens ({payDate}, {payPeriodStart}, {payPeriodEnd}). DMY_COMPACT (01022026), DMY_SLASH (01/02/2026), YMD_DASH (2026-02-01), MDY_SLASH (02/01/2026), DMY_DASH (01-02-2026), DMY_DOT (01.02.2026). When none is set, DMY_SLASH applies.",
            "example": "DMY_SLASH",
            "default": "DMY_SLASH"
          },
          "bacs": {
            "$ref": "#/components/schemas/Payment_BACSPaymentConfigRequest",
            "nullable": true,
            "description": "The BACS source bank account and service user number the files are written for."
          },
          "fileLayout": {
            "$ref": "#/components/schemas/Payment_PaymentFileLayout",
            "nullable": true,
            "description": "The file's layout, for the Custom format only, where it is required. Its extension is the file format."
          }
        },
        "example": {
          "method": "BACS",
          "format": "Barclays",
          "reference": "Salary{separator:space}{payDate}",
          "referenceDateFormat": "DMY_COMPACT",
          "bacs": {
            "sortCode": "12-34-56",
            "accountNumber": "12345678",
            "serviceUserNumber": "SUN123"
          }
        }
      },
      "Payment_FailedEmployeeResponse": {
        "type": "object",
        "description": "One affected employee under `failure.affectedEmployees`. Frontend renders these as anchors to each employee's profile.",
        "required": [
          "employeeId",
          "employeeName",
          "issues"
        ],
        "properties": {
          "employeeId": {
            "type": "string",
            "description": "The employee.",
            "example": "employee-001"
          },
          "employeeName": {
            "type": "string",
            "description": "The employee's name.",
            "example": "Jane Doe"
          },
          "issues": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Payment_ValidationIssue"
            },
            "description": "One ValidationIssue per failed field. Same shape used across the platform for 400-response `validationIssues`, so frontends can use a single i18n key lookup for both."
          }
        }
      },
      "Payment_MessageWithTokenResponse": {
        "type": "object",
        "description": "A message as text, and as a token with its arguments for translation.",
        "required": [
          "text",
          "token"
        ],
        "properties": {
          "text": {
            "type": "string",
            "description": "Default human-readable message."
          },
          "token": {
            "type": "string",
            "description": "Machine-readable message identifier (snake_case), for translation or your own wording."
          },
          "tokenArguments": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Payment_ValidationIssueArgument"
            },
            "nullable": true,
            "description": "Values the message refers to, by name."
          }
        }
      },
      "Payment_PaymentConfigResponse": {
        "type": "object",
        "description": "A pay schedule's payment configuration.",
        "required": [
          "method",
          "format",
          "fileFormat",
          "createdDate",
          "createdBy"
        ],
        "properties": {
          "method": {
            "type": "string",
            "description": "Payment method, as listed by `GET /available/config`.",
            "example": "BACS"
          },
          "format": {
            "type": "string",
            "description": "Payment format within the method, as listed by `GET /available/config`.",
            "example": "Barclays"
          },
          "fileFormat": {
            "type": "string",
            "description": "Always present. txt (fixed-width), or csv when supported for this method and format.",
            "example": "txt"
          },
          "reference": {
            "type": "string",
            "nullable": true,
            "description": "Single reference expression. Supports static text and tokens in any order: {payDate}, {payPeriodStart}, {payPeriodEnd}, {year}, {period}, {frequency}, {separator:space}, {separator:dash}, {separator:underscore}, {separator:slash}, {separator:custom:<value>}.",
            "example": "Payroll May 2024"
          },
          "referenceDateFormat": {
            "type": "string",
            "nullable": true,
            "description": "Date format applied to date tokens ({payDate}, {payPeriodStart}, {payPeriodEnd}). DMY_COMPACT (01022026), DMY_SLASH (01/02/2026), YMD_DASH (2026-02-01), MDY_SLASH (02/01/2026), DMY_DASH (01-02-2026), DMY_DOT (01.02.2026). When none is set, DMY_SLASH applies.",
            "example": "DMY_SLASH"
          },
          "payrollConfigId": {
            "type": "string",
            "nullable": true,
            "description": "The pay schedule (payroll configuration) the settings are for.",
            "example": "org-payroll-123"
          },
          "bacs": {
            "$ref": "#/components/schemas/Payment_BACSPaymentConfigResponse",
            "nullable": true,
            "description": "The BACS source bank account and service user number the files are written for."
          },
          "fileLayout": {
            "$ref": "#/components/schemas/Payment_PaymentFileLayout",
            "nullable": true,
            "description": "The file's layout, for the Custom format; null for every other format."
          },
          "createdDate": {
            "type": "string",
            "format": "date-time",
            "description": "When the configuration was created.",
            "example": "2024-05-01T12:00:00Z"
          },
          "createdBy": {
            "type": "string",
            "description": "Who created the configuration.",
            "example": "user-123"
          },
          "updatedDate": {
            "type": "string",
            "format": "date-time",
            "nullable": true,
            "description": "When the configuration was last changed.",
            "example": "2024-05-10T12:00:00Z"
          },
          "updatedBy": {
            "type": "string",
            "nullable": true,
            "description": "Who last changed the configuration.",
            "example": "user-456"
          }
        },
        "example": {
          "method": "BACS",
          "format": "Barclays",
          "fileFormat": "txt",
          "reference": "Payroll May 2024",
          "referenceDateFormat": "DMY_COMPACT",
          "payrollConfigId": "org-payroll-123",
          "bacs": {
            "sortCode": "12-34-56",
            "accountNumber": "12345678",
            "serviceUserNumber": "SUN123"
          },
          "createdDate": "2024-05-01T12:00:00Z",
          "createdBy": "user-123",
          "updatedDate": "2024-05-10T12:00:00Z",
          "updatedBy": "user-456"
        }
      },
      "Payment_PaymentFileArtefactResponse": {
        "type": "object",
        "description": "The file to download. Fetch `downloadUrl` directly, without the auth header; it stops working at `downloadUrlExpiresAt`.",
        "required": [
          "name",
          "size",
          "downloadUrl",
          "downloadUrlExpiresAt"
        ],
        "properties": {
          "name": {
            "type": "string",
            "description": "User-visible filename (basename only). The frontend uses this for the download attachment name.",
            "example": "Acme_Ltd_Payment File 2025 Weekly 25 - 20260515-215906.txt"
          },
          "size": {
            "type": "integer",
            "format": "int64",
            "description": "File size in bytes.",
            "example": 2279
          },
          "downloadUrl": {
            "type": "string",
            "format": "uri",
            "description": "Signed download link on the files address, valid for one hour from issue. The file downloads under `name`. Re-fetch this resource for a fresh link.",
            "example": "https://files.flowpayroll.ai/files/payment/signed-link"
          },
          "downloadUrlExpiresAt": {
            "type": "string",
            "format": "date-time",
            "description": "When `downloadUrl` stops working. Re-fetch the resource for a fresh link.",
            "example": "2026-05-15T22:59:06Z"
          }
        }
      },
      "Payment_PaymentFileCycleResponse": {
        "type": "object",
        "description": "One lock cycle's full payment file, as it was when that cycle was current, and the supplementary file produced beside it on a re-lock.",
        "required": [
          "lockCycle",
          "status",
          "format",
          "summary",
          "generatedDate",
          "createdBy",
          "superseded",
          "replacedFiles"
        ],
        "properties": {
          "lockCycle": {
            "type": "integer",
            "format": "int32",
            "description": "The lock cycle this entry is for: 1 for the first lock, n + 1 for each re-lock after an unlock.",
            "example": 1
          },
          "status": {
            "type": "string",
            "enum": [
              "GENERATED",
              "PARTIAL_SUCCESS",
              "SUBMITTED",
              "QUEUED",
              "FAILED",
              "RETRYING",
              "REBUILDING",
              "GENERATING",
              "UNKNOWN",
              "NOT_REQUIRED",
              "BLOCKED"
            ],
            "description": "As `status` on the payment file resource. A superseded cycle keeps the status it had; nothing records whether its file went to the bank.",
            "example": "GENERATED"
          },
          "trigger": {
            "type": "string",
            "enum": [
              "payroll_run_completed",
              "retry",
              "regeneration",
              "relock",
              "supplementary",
              "rebuild",
              "generate",
              null
            ],
            "nullable": true,
            "description": "What produced the file: payroll_run_completed, retry, regeneration, relock, supplementary or rebuild. Null on an entry written before triggers were recorded.",
            "example": "payroll_run_completed"
          },
          "format": {
            "$ref": "#/components/schemas/Payment_PaymentFileFormatResponse",
            "description": "Payment method and format the file was built for."
          },
          "summary": {
            "$ref": "#/components/schemas/Payment_PaymentFileSummaryResponse",
            "description": "Headline counts and totals of the cycle's file."
          },
          "file": {
            "$ref": "#/components/schemas/Payment_PaymentFileArtefactResponse",
            "nullable": true,
            "description": "The cycle's file with its own signed link, valid for one hour. Null when the cycle produced no file, or its file is no longer stored."
          },
          "failure": {
            "$ref": "#/components/schemas/Payment_PaymentFileFailureResponse",
            "nullable": true,
            "description": "The employees the cycle's file left out, as on the payment file resource; null when none."
          },
          "generatedDate": {
            "type": "string",
            "format": "date-time",
            "description": "When the cycle's file was generated.",
            "example": "2026-05-15T21:59:06+00:00"
          },
          "createdBy": {
            "type": "string",
            "description": "SYSTEM for the first file and a retried one, SYSTEM_REGEN when the file was produced again automatically, or the administrator who rebuilt it.",
            "example": "SYSTEM"
          },
          "supersedes": {
            "type": "integer",
            "format": "int32",
            "nullable": true,
            "description": "The cycle whose file this one replaced; null for a first issue."
          },
          "superseded": {
            "type": "boolean",
            "description": "True once a later cycle's file replaced this one.",
            "example": false
          },
          "supersededOnLockCycle": {
            "type": "integer",
            "format": "int32",
            "nullable": true,
            "description": "The cycle whose file replaced this one; null while it is the current file."
          },
          "supersededDate": {
            "type": "string",
            "format": "date-time",
            "nullable": true,
            "description": "When a later cycle's file replaced this one; null while it is the current file."
          },
          "unlock": {
            "$ref": "#/components/schemas/Payment_PaymentFileUnlockResponse",
            "nullable": true,
            "description": "The unlock that reopened this cycle; null while the cycle has not been unlocked."
          },
          "supplementary": {
            "$ref": "#/components/schemas/Payment_PaymentFileSupplementaryResponse",
            "nullable": true,
            "description": "The supplementary file produced beside this cycle's full file, for an administrator who\nhad already sent the earlier cycle's file to the bank (docs/evolution/0008). Null for\ncycle 1, and for any cycle whose re-lock found no earlier file in a ready status."
          },
          "replacedFiles": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Payment_PaymentFileReplacedResponse"
            },
            "description": "The files this cycle's file replaced, newest first, each with its own signed link: when an\nadministrator rebuilt it with the current payment settings (same payments, earlier bank or\nfile type), or retried it (a retry produces the file again for every employee, so a\nreplaced partial file that already went to the bank must not be followed by the new one).\nEmpty when the file was never rebuilt or retried."
          }
        }
      },
      "Payment_PaymentFileFailureResponse": {
        "type": "object",
        "description": "Employees that did not make it into the BACS file. Set on FAILED (the whole run is blocked), BLOCKED (a supplementary file whose every increase is blocked) and PARTIAL_SUCCESS (the file was generated for everyone else).",
        "required": [
          "summary"
        ],
        "properties": {
          "summary": {
            "$ref": "#/components/schemas/Payment_MessageWithTokenResponse",
            "description": "The i18n-ready message: its `token` is one of `paymentFileGenerationFailed`, `paymentFileBlockedByInvalidEmployeeData` (FAILED or BLOCKED with per-employee causes, with the `affectedCount` token argument) or `paymentFilePartiallyGenerated` (PARTIAL_SUCCESS, with `succeededCount` and `failedCount` token arguments)."
          },
          "affectedEmployees": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Payment_FailedEmployeeResponse"
            },
            "nullable": true,
            "description": "Per-employee failure detail when the failure can be attributed to specific employees. Null when the failure is org-wide (missing payment config, etc.)."
          }
        }
      },
      "Payment_PaymentFileFormatResponse": {
        "type": "object",
        "description": "Payment method/format combination this file was built for.",
        "required": [
          "paymentMethod",
          "paymentFormat"
        ],
        "properties": {
          "paymentMethod": {
            "type": "string",
            "description": "Payment method.",
            "example": "BACS"
          },
          "paymentFormat": {
            "type": "string",
            "description": "Payment format within the method.",
            "example": "Standard18"
          }
        }
      },
      "Payment_PaymentFileHistoryResponse": {
        "type": "object",
        "description": "Every issue of a pay run's payment file, one entry per lock cycle, newest first. A run that\nwas never unlocked has one entry. Nothing a lock produced is ever removed from this list: an\nunlock stamps the entry of the cycle it reopened, and the re-lock adds the next cycle's entry\nand marks the earlier one superseded.",
        "required": [
          "organisationId",
          "payrollConfigId",
          "year",
          "frequency",
          "period",
          "currentLockCycle",
          "cycles"
        ],
        "properties": {
          "organisationId": {
            "type": "string",
            "description": "The organisation the pay run belongs to.",
            "example": "01K1BKF2MJC2WPNP38V3VVQ94C"
          },
          "payrollConfigId": {
            "type": "string",
            "description": "The pay schedule (payroll configuration) the pay run belongs to.",
            "example": "01KMKX9ZBHS65ZWGV2266K0S8K"
          },
          "year": {
            "type": "integer",
            "format": "int32",
            "description": "The tax year of the pay run, by the year it starts.",
            "example": 2025
          },
          "frequency": {
            "type": "string",
            "description": "How often the pay schedule pays.",
            "example": "Weekly"
          },
          "period": {
            "type": "integer",
            "format": "int32",
            "description": "The pay period number within the tax year.",
            "example": 25
          },
          "currentLockCycle": {
            "type": "integer",
            "format": "int32",
            "description": "The cycle the current payment file resource is on.",
            "example": 2
          },
          "cycles": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Payment_PaymentFileCycleResponse"
            },
            "description": "One entry per lock cycle, newest first."
          }
        }
      },
      "Payment_PaymentFileLayout": {
        "type": "object",
        "description": "A bank payment file described as data: one row per payment, its columns in order, and how each value is written. Used by the Custom format, and listed for the formats that can start one.",
        "required": [
          "extension",
          "columns"
        ],
        "properties": {
          "id": {
            "type": "string",
            "nullable": true,
            "description": "The preset's stable identifier, for a client to remember which bank format a layout started from. Set on the layouts `GET /available/config` lists; null on a pay schedule's own layout, and ignored when sent.",
            "example": "barclays-csv"
          },
          "name": {
            "type": "string",
            "nullable": true,
            "description": "A name for the layout, shown in settings. At most 100 characters.",
            "example": "Our bank's bulk payments"
          },
          "extension": {
            "type": "string",
            "enum": [
              "csv",
              "txt"
            ],
            "description": "The file's extension: csv or txt. Independent of its content (a bank may want comma-separated values in a .txt file).",
            "example": "csv"
          },
          "rowFormat": {
            "type": "string",
            "enum": [
              "Delimited",
              "FixedWidth",
              null
            ],
            "nullable": true,
            "description": "Delimited (values separated by the delimiter) or FixedWidth (every column padded to its width). Delimited when left out.",
            "example": "Delimited"
          },
          "delimiter": {
            "type": "string",
            "nullable": true,
            "description": "The text between values in a Delimited layout, at most 5 characters. A comma when left out; null in a FixedWidth layout, and ignored there when sent.",
            "example": ","
          },
          "headingRow": {
            "type": "boolean",
            "nullable": true,
            "description": "When true the first row holds each column's heading. False when left out.",
            "example": false
          },
          "lineEnding": {
            "type": "string",
            "enum": [
              "Crlf",
              "Lf",
              null
            ],
            "nullable": true,
            "description": "How each row ends: Crlf (Windows) or Lf. Crlf when left out.",
            "example": "Crlf"
          },
          "encoding": {
            "type": "string",
            "enum": [
              "Utf8",
              "Utf8WithBom",
              null
            ],
            "nullable": true,
            "description": "Utf8, or Utf8WithBom when the bank needs a byte order mark. Utf8 when left out.",
            "example": "Utf8"
          },
          "columns": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Payment_PaymentFileLayoutColumn"
            },
            "description": "The columns of a payment row, in order: 1 to 100. Needs exactly one PayeeSortCode, PayeeAccountNumber and Amount column, and a payee name column."
          }
        },
        "example": {
          "id": null,
          "name": "Our bank's bulk payments",
          "extension": "csv",
          "rowFormat": "Delimited",
          "delimiter": ",",
          "headingRow": false,
          "lineEnding": "Crlf",
          "encoding": "Utf8",
          "columns": [
            {
              "field": "PayeeSortCode",
              "sortCode": "Dashed"
            },
            {
              "field": "PayeeAccountNumber",
              "accountNumber": "Digits"
            },
            {
              "field": "PayeeAccountNameAsEntered",
              "characterSet": "Bacs",
              "maxLength": 18
            },
            {
              "field": "Amount",
              "amount": "Pounds"
            },
            {
              "field": "Blank"
            },
            {
              "field": "Reference",
              "characterSet": "Bacs",
              "maxLength": 18
            }
          ]
        }
      },
      "Payment_PaymentFileLayoutColumn": {
        "type": "object",
        "description": "One column of a payment row: the value it holds and how it is written. Only the options that apply to its field are read.",
        "required": [
          "field"
        ],
        "properties": {
          "field": {
            "type": "string",
            "enum": [
              "PayeeSortCode",
              "PayeeAccountNumber",
              "PayeeAccountName",
              "PayeeAccountNameAsEntered",
              "Amount",
              "Reference",
              "PaymentDate",
              "EmployeeId",
              "Literal",
              "Blank"
            ],
            "description": "The value the column holds. New fields may be added; a client should show one it does not know by name rather than fail. PayeeAccountName is the name cleaned to upper-case Bacs characters; PayeeAccountNameAsEntered is the name as it was entered; Literal is fixed text; Blank is an empty column.",
            "example": "PayeeSortCode"
          },
          "heading": {
            "type": "string",
            "nullable": true,
            "description": "The column's heading, written in the heading row. At most 100 characters.",
            "example": "Sort code"
          },
          "literal": {
            "type": "string",
            "nullable": true,
            "description": "The text a Literal column writes on every row. At most 100 characters.",
            "example": "99"
          },
          "sortCode": {
            "type": "string",
            "enum": [
              "Digits",
              "Dashed",
              "Spaced",
              null
            ],
            "nullable": true,
            "description": "How a sort code is written: Digits (309154), Dashed (30-91-54) or Spaced (30 91 54). Digits when left out.",
            "example": "Dashed"
          },
          "accountNumber": {
            "type": "string",
            "enum": [
              "PaddedToEight",
              "Digits",
              null
            ],
            "nullable": true,
            "description": "How an account number is written: PaddedToEight (01335816) or Digits as entered (1335816). PaddedToEight when left out.",
            "example": "Digits"
          },
          "amount": {
            "type": "string",
            "enum": [
              "Pounds",
              "PoundsTrimmed",
              "Pence",
              null
            ],
            "nullable": true,
            "description": "How an amount is written: Pounds (100.50), PoundsTrimmed (100.5) or Pence (10050). Pounds when left out.",
            "example": "Pounds"
          },
          "dateFormat": {
            "type": "string",
            "enum": [
              "DMY_COMPACT",
              "DMY_SLASH",
              "YMD_DASH",
              "MDY_SLASH",
              "DMY_DASH",
              "DMY_DOT",
              null
            ],
            "nullable": true,
            "description": "How a PaymentDate column writes the date, as referenceDateFormat names it. DMY_SLASH when left out.",
            "example": "DMY_SLASH"
          },
          "case": {
            "type": "string",
            "enum": [
              "AsIs",
              "Upper",
              null
            ],
            "nullable": true,
            "description": "AsIs or Upper. AsIs when left out.",
            "example": "Upper"
          },
          "characterSet": {
            "type": "string",
            "enum": [
              "Any",
              "Bacs",
              null
            ],
            "nullable": true,
            "description": "Any keeps every character; Bacs removes accents and keeps only letters, digits, space and . - / &. Any when left out.",
            "example": "Bacs"
          },
          "trim": {
            "type": "boolean",
            "nullable": true,
            "description": "Whether spaces around the value are removed. True when left out.",
            "example": true
          },
          "maxLength": {
            "type": "integer",
            "format": "int32",
            "nullable": true,
            "description": "Text longer than this is cut: 1 to 1000. Never applied to a sort code, account number or amount.",
            "example": 18
          },
          "width": {
            "type": "integer",
            "format": "int32",
            "nullable": true,
            "description": "The value is padded to this many characters: 1 to 1000. Text is cut to it. A sort code, account number or amount column must be wide enough for every value it can hold (sort code 6, or 8 with separators; account number 8; amount 11), so no payment can overflow it. Needed on every column of a FixedWidth layout except a Literal.",
            "example": 18
          },
          "align": {
            "type": "string",
            "enum": [
              "Left",
              "Right",
              null
            ],
            "nullable": true,
            "description": "Left or Right, when the value is padded to its width. Left when left out.",
            "example": "Right"
          },
          "pad": {
            "type": "string",
            "nullable": true,
            "description": "The single character a value is padded with. A space when left out.",
            "example": "0"
          }
        },
        "example": {
          "field": "PayeeSortCode",
          "sortCode": "Dashed",
          "heading": "Sort code"
        }
      },
      "Payment_PaymentFileReplacedResponse": {
        "type": "object",
        "required": [
          "status",
          "format",
          "generatedDate",
          "replacedDate",
          "replacedBy"
        ],
        "properties": {
          "status": {
            "type": "string",
            "description": "The status the file had when it was replaced: GENERATED or PARTIAL_SUCCESS.",
            "example": "GENERATED"
          },
          "format": {
            "$ref": "#/components/schemas/Payment_PaymentFileFormatResponse",
            "description": "Payment method and format the replaced file was built for."
          },
          "file": {
            "$ref": "#/components/schemas/Payment_PaymentFileArtefactResponse",
            "nullable": true,
            "description": "The replaced file with its own signed link, valid for one hour. Null when it is no longer stored."
          },
          "generatedDate": {
            "type": "string",
            "format": "date-time",
            "description": "When the replaced file was generated.",
            "example": "2026-05-15T21:59:06+00:00"
          },
          "replacedDate": {
            "type": "string",
            "format": "date-time",
            "description": "When the administrator asked for the rebuild or retry that replaced it.",
            "example": "2026-05-16T09:12:40+00:00"
          },
          "replacedBy": {
            "type": "string",
            "description": "Who asked for the rebuild or retry.",
            "example": "USER#01K1BKF2MJC2WPNP38V3VVQ94D"
          }
        }
      },
      "Payment_PaymentFileResponse": {
        "type": "object",
        "description": "A generated BACS payment file for one pay run. Top-level fields are the resource identity (org/config/year/frequency/period),\nthe status, and audit columns. Format, summary counts, the downloadable file, and failure context are grouped\ninto nested objects. The `file` and `failure` blocks are independent: both may be present when status\nis PARTIAL_SUCCESS (file was generated for some employees, others need attention).",
        "required": [
          "organisationId",
          "payrollConfigId",
          "year",
          "frequency",
          "period",
          "status",
          "format",
          "summary",
          "createdDate",
          "createdBy",
          "lockCycle",
          "kind"
        ],
        "properties": {
          "organisationId": {
            "type": "string",
            "description": "The organisation the pay run belongs to.",
            "example": "01K1BKF2MJC2WPNP38V3VVQ94C"
          },
          "payrollConfigId": {
            "type": "string",
            "description": "The pay schedule (payroll configuration) the pay run belongs to.",
            "example": "01KMKX9ZBHS65ZWGV2266K0S8K"
          },
          "year": {
            "type": "integer",
            "format": "int32",
            "description": "The tax year of the pay run, by the year it starts.",
            "example": 2025
          },
          "frequency": {
            "type": "string",
            "description": "How often the pay schedule pays.",
            "example": "Weekly"
          },
          "period": {
            "type": "integer",
            "format": "int32",
            "description": "The pay period number within the tax year.",
            "example": 25
          },
          "status": {
            "type": "string",
            "enum": [
              "GENERATED",
              "PARTIAL_SUCCESS",
              "SUBMITTED",
              "QUEUED",
              "FAILED",
              "RETRYING",
              "REBUILDING",
              "GENERATING",
              "UNKNOWN",
              "NOT_REQUIRED",
              "BLOCKED"
            ],
            "description": "Outcome state of the payment file. GENERATED: file produced for every employee. PARTIAL_SUCCESS: file produced for some, `failure.affectedEmployees` lists the rest. FAILED: no file produced. RETRYING: admin triggered a retry, processing in progress. SUBMITTED and QUEUED: the payments went to a provider instead of a file. UNKNOWN: the outcome was not recognised.",
            "example": "GENERATED"
          },
          "format": {
            "$ref": "#/components/schemas/Payment_PaymentFileFormatResponse",
            "description": "Payment method and format the file was built for."
          },
          "summary": {
            "$ref": "#/components/schemas/Payment_PaymentFileSummaryResponse",
            "description": "Headline counts and totals."
          },
          "file": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Payment_PaymentFileArtefactResponse"
              }
            ],
            "nullable": true,
            "description": "The downloadable BACS file. Non-null when status is GENERATED, SUBMITTED, or PARTIAL_SUCCESS; null when no file exists (FAILED/RETRYING)."
          },
          "failure": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Payment_PaymentFileFailureResponse"
              }
            ],
            "nullable": true,
            "description": "Affected employees that need attention. Non-null when status is FAILED (every employee blocking the file) or PARTIAL_SUCCESS (employees not included in the generated file). Co-exists with `file` when status is PARTIAL_SUCCESS."
          },
          "externalReference": {
            "type": "string",
            "nullable": true,
            "description": "Reserved for payments sent to a provider rather than written to a file: the provider's own reference. Always null today, as only BACS files are generated."
          },
          "createdDate": {
            "type": "string",
            "format": "date-time",
            "description": "When the file was generated.",
            "example": "2026-05-15T21:59:06+00:00"
          },
          "createdBy": {
            "type": "string",
            "description": "SYSTEM for the first file, SYSTEM_REGEN when the file was produced again automatically.",
            "example": "SYSTEM"
          },
          "usesCurrentSettings": {
            "type": "boolean",
            "nullable": true,
            "description": "Whether the file was built with the pay schedule's payment settings as they are now. False after the bank, the\nfile type, the reference or the originating account changed: rebuild the file to get it with the new settings.\nNull when there is no generated file, or the pay schedule has no payment settings.",
            "example": true
          },
          "lockCycle": {
            "type": "integer",
            "format": "int32",
            "description": "The lock cycle this file was produced for: 1 for a run locked once, n + 1 after the run\nwas unlocked from cycle n and locked again. Every cycle's file is listed by the history\nresource (PaymentFileHistoryResponse)."
          },
          "kind": {
            "type": "string",
            "enum": [
              "FULL",
              "SUPPLEMENTARY"
            ],
            "description": "FULL, or SUPPLEMENTARY for the increases since the earlier lock cycle's file\n(docs/evolution/0008). The current file is always the full one; the supplementary file\nof a cycle is on the history, beside it."
          },
          "supplementaryOfLockCycle": {
            "type": "integer",
            "format": "int32",
            "nullable": true,
            "description": "The lock cycle whose file this supplementary file tops up; null for a full file."
          },
          "paidLeaverEmployeeIds": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "nullable": true,
            "description": "Employees paid by this supplementary file who have left. Their bank details should be\nconfirmed before the file is uploaded. Null when there are none, and on a full file."
          }
        },
        "example": {
          "organisationId": "01K1BKF2MJC2WPNP38V3VVQ94C",
          "payrollConfigId": "01KMKX9ZBHS65ZWGV2266K0S8K",
          "year": 2025,
          "frequency": "Weekly",
          "period": 25,
          "status": "GENERATED",
          "format": {
            "paymentMethod": "BACS",
            "paymentFormat": "Standard18"
          },
          "summary": {
            "totalRecords": 15,
            "employeeCount": 8,
            "totalAmount": 6268.12
          },
          "file": {
            "name": "Acme_Ltd_Payment File 2025 Weekly 25 - 20260515-215906.txt",
            "size": 2279,
            "downloadUrl": "https://files.flowpayroll.ai/files/payment/signed-link",
            "downloadUrlExpiresAt": "2026-05-15T22:59:06Z"
          },
          "failure": null,
          "externalReference": null,
          "createdDate": "2026-05-15T21:59:06+00:00",
          "createdBy": "SYSTEM",
          "usesCurrentSettings": true,
          "lockCycle": 1,
          "kind": "FULL",
          "supplementaryOfLockCycle": null,
          "paidLeaverEmployeeIds": null
        }
      },
      "Payment_PaymentFileSummaryResponse": {
        "type": "object",
        "description": "Headline counts/totals so the UI can show 'paid N people' / 'M payment lines' without parsing the file.",
        "required": [
          "totalRecords",
          "employeeCount",
          "totalAmount"
        ],
        "properties": {
          "totalRecords": {
            "type": "integer",
            "format": "int32",
            "description": "Number of payment lines in the file. A multi-account employee contributes one line per destination account, so this is >= employeeCount.",
            "example": 15
          },
          "employeeCount": {
            "type": "integer",
            "format": "int32",
            "description": "Distinct count of employees represented in the file. Operators see this as 'employees paid'.",
            "example": 8
          },
          "totalAmount": {
            "type": "number",
            "format": "decimal",
            "description": "Sum of every payment line in the file, in GBP.",
            "example": 6268.12
          }
        }
      },
      "Payment_PaymentFileSupplementaryResponse": {
        "type": "object",
        "description": "A cycle's supplementary payment file: the increases since the earlier cycle's file, one line per employee whose\nnet pay went up on the re-lock, to upload as a separate batch when that file has already gone to the bank (if it\nhas not, upload the cycle's full file instead and ignore this one). The overpayments are every decrease the\nre-lock found, information only: the service cannot know whether the earlier file was sent, so it never deducts\nthem from a later payslip. The administrator recovers them by hand.",
        "required": [
          "status",
          "totalRecords",
          "totalAmount",
          "supplementaryOfLockCycle",
          "paidLeaverEmployeeIds",
          "overpayments",
          "replacedFiles"
        ],
        "properties": {
          "status": {
            "type": "string",
            "enum": [
              "GENERATED",
              "PARTIAL_SUCCESS",
              "SUBMITTED",
              "QUEUED",
              "FAILED",
              "RETRYING",
              "REBUILDING",
              "GENERATING",
              "UNKNOWN",
              "NOT_REQUIRED",
              "BLOCKED"
            ],
            "description": "GENERATED: a file of every increase. PARTIAL_SUCCESS: a file of the increases that passed BACS validation. FAILED: no file could be produced; retry the payment file. BLOCKED: net pay went up, but every employee it went up for is missing something the bank needs (listed under failure); fix them, then retry the payment file. NOT_REQUIRED: no employee's net pay increased, so there is no file; the overpayments, if any, are still listed.",
            "example": "GENERATED"
          },
          "file": {
            "$ref": "#/components/schemas/Payment_PaymentFileArtefactResponse",
            "nullable": true,
            "description": "The supplementary file with its own signed link, valid for one hour. Null when there is none (NOT_REQUIRED, FAILED, BLOCKED), or its file is no longer stored."
          },
          "failure": {
            "$ref": "#/components/schemas/Payment_PaymentFileFailureResponse",
            "nullable": true,
            "description": "Why the supplementary file is FAILED or BLOCKED, or which employees a PARTIAL_SUCCESS file left out, as on the payment file resource; null when none."
          },
          "totalRecords": {
            "type": "integer",
            "format": "int32",
            "description": "Payment lines in the file, one per increased line.",
            "example": 1
          },
          "totalAmount": {
            "type": "number",
            "format": "decimal",
            "description": "The sum of the increases, in GBP.",
            "example": 420
          },
          "supplementaryOfLockCycle": {
            "type": "integer",
            "format": "int32",
            "description": "The lock cycle whose file this one tops up.",
            "example": 1
          },
          "paidLeaverEmployeeIds": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Employees paid by the file who have left: confirm their bank details before uploading it. Empty when none."
          },
          "overpayments": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Payment_PaymentOverpaymentResponse"
            },
            "description": "Every employee whose lines went down against the earlier cycle's file, one entry per employee per reason. Empty when none."
          },
          "replacedFiles": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Payment_PaymentFileReplacedResponse"
            },
            "description": "The supplementary files a rebuild or retry of this cycle replaced, newest first, each with its own signed link. Empty when never rebuilt or retried."
          }
        }
      },
      "Payment_PaymentFileUnlockResponse": {
        "type": "object",
        "description": "The unlock stamped on a cycle's payment file.",
        "required": [
          "scope"
        ],
        "properties": {
          "unlockedDate": {
            "type": "string",
            "format": "date-time",
            "nullable": true,
            "description": "When the pay run was unlocked.",
            "example": "2026-10-26T10:15:00+00:00"
          },
          "reason": {
            "type": "string",
            "nullable": true,
            "description": "The reason given for the unlock, as the person who unlocked it wrote it.",
            "example": "Overtime missed"
          },
          "scope": {
            "type": "string",
            "enum": [
              "Full",
              "Employees"
            ],
            "description": "Full, or Employees when only the listed employees were reopened.",
            "example": "Full"
          },
          "employeeIds": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "nullable": true,
            "description": "The reopened employees of a partial unlock; null for a full one."
          }
        }
      },
      "Payment_PaymentOverpaymentResponse": {
        "type": "object",
        "description": "Money the earlier cycle's file paid that the re-lock no longer owes. Information only: the\nservice never deducts it from a later payslip, because it cannot know whether the earlier\nfile was ever sent to the bank.",
        "required": [
          "employeeId",
          "employeeName",
          "amount",
          "reason"
        ],
        "properties": {
          "employeeId": {
            "type": "string",
            "description": "The employee whose lines went down.",
            "example": "employee-001"
          },
          "employeeName": {
            "type": "string",
            "description": "The employee's name.",
            "example": "Jane Doe"
          },
          "amount": {
            "type": "number",
            "format": "decimal",
            "description": "The overpaid amount in GBP, always positive.",
            "example": 180
          },
          "reason": {
            "type": "string",
            "enum": [
              "employee",
              "leaver",
              "third_party"
            ],
            "description": "employee: the employee's own net pay went down. leaver: as employee, for someone who has left and has no next pay run. third_party: a line paid to a third party (a court order payee, a deduction) went down; the payee, not the employee, was overpaid.",
            "example": "employee"
          }
        }
      },
      "Payment_ResponseBody": {
        "type": "object",
        "description": "The envelope every answer is written in.",
        "required": [
          "message"
        ],
        "properties": {
          "message": {
            "$ref": "#/components/schemas/Payment_MessageWithTokenResponse",
            "description": "What happened, as text and as a token for translation."
          },
          "content": {
            "type": "object",
            "required": [
              "metadata"
            ],
            "properties": {
              "data": {
                "type": "object",
                "nullable": true,
                "description": "The data the operation answers with."
              },
              "metadata": {
                "$ref": "#/components/schemas/Payment_ContentMetadataResponse",
                "description": "How to read the dates in the data."
              }
            },
            "nullable": true,
            "description": "The answer's data and how to read it. Left out when there is none."
          },
          "validationIssues": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Payment_ValidationIssue"
            },
            "nullable": true,
            "description": "One entry per field the request got wrong. Left out when there are none."
          }
        }
      },
      "Payment_UpdatePaymentConfigRequest": {
        "type": "object",
        "description": "A pay schedule's payment configuration, as replaced.",
        "required": [
          "method",
          "format"
        ],
        "properties": {
          "method": {
            "type": "string",
            "description": "Payment method, as listed by `GET /available/config`.",
            "example": "BACS"
          },
          "format": {
            "type": "string",
            "description": "Payment format within the method, as listed by `GET /available/config`.",
            "example": "Barclays"
          },
          "fileFormat": {
            "type": "string",
            "nullable": true,
            "description": "Optional. Leave out to keep the current value. When set, txt, or csv when it is listed in supportedFileFormats for this method and format.",
            "example": "csv"
          },
          "reference": {
            "type": "string",
            "nullable": true,
            "description": "Single reference expression. Supports static text and tokens in any order: {payDate}, {payPeriodStart}, {payPeriodEnd}, {year}, {period}, {frequency}, {separator:space}, {separator:dash}, {separator:underscore}, {separator:slash}, {separator:custom:<value>}. Leave out to keep the current value.",
            "example": "Payroll May 2024"
          },
          "referenceDateFormat": {
            "type": "string",
            "enum": [
              "DMY_COMPACT",
              "DMY_SLASH",
              "YMD_DASH",
              "MDY_SLASH",
              "DMY_DASH",
              "DMY_DOT",
              null
            ],
            "nullable": true,
            "description": "Date format applied to date tokens ({payDate}, {payPeriodStart}, {payPeriodEnd}). DMY_COMPACT (01022026), DMY_SLASH (01/02/2026), YMD_DASH (2026-02-01), MDY_SLASH (02/01/2026), DMY_DASH (01-02-2026), DMY_DOT (01.02.2026). When none is set, DMY_SLASH applies. Leave out to keep the current value.",
            "example": "DMY_SLASH"
          },
          "bacs": {
            "$ref": "#/components/schemas/Payment_BACSPaymentConfigRequest",
            "nullable": true,
            "description": "The BACS source bank account and service user number the files are written for. Replaces the stored one; leaving it out clears it."
          },
          "fileLayout": {
            "$ref": "#/components/schemas/Payment_PaymentFileLayout",
            "nullable": true,
            "description": "The file's layout, for the Custom format only. Leave out to keep the stored one; needed when changing to Custom. Its extension is the file format."
          }
        },
        "example": {
          "method": "BACS",
          "format": "Barclays",
          "reference": "Salary{separator:space}{payDate}{separator:dash}{period}",
          "referenceDateFormat": "DMY_COMPACT",
          "bacs": {
            "sortCode": "12-34-56",
            "accountNumber": "87654321",
            "serviceUserNumber": "SUN123"
          }
        }
      },
      "Payment_ValidationIssue": {
        "type": "object",
        "description": "Field validation item. `reasonToken` is a stable snake_case key for i18n or custom client messages; `reason` is the default English text from the API.",
        "required": [
          "field",
          "reason",
          "reasonToken"
        ],
        "properties": {
          "field": {
            "type": "string",
            "description": "Dot-path of the field (e.g. name.firstName, address.line1)."
          },
          "reason": {
            "type": "string",
            "description": "Default human-readable message."
          },
          "reasonToken": {
            "type": "string",
            "description": "Machine-readable error identifier (snake_case)."
          },
          "reasonTokenArguments": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Payment_ValidationIssueArgument"
            },
            "nullable": true,
            "description": "Values the reason refers to, by name."
          }
        }
      },
      "Payment_ValidationIssueArgument": {
        "type": "object",
        "description": "A named value a message refers to.",
        "required": [
          "name"
        ],
        "properties": {
          "name": {
            "type": "string",
            "description": "The argument's name."
          },
          "value": {
            "oneOf": [
              {
                "type": "string"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "array",
                "items": {
                  "type": "string"
                }
              }
            ],
            "nullable": true,
            "description": "The argument's value: text, a number, true or false, or a list of text."
          }
        }
      },
      "Journal_ApiErrorResponse": {
        "type": "object",
        "properties": {
          "message": {
            "$ref": "#/components/schemas/Journal_MessageWithTokenResponse"
          },
          "validationIssues": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Journal_ValidationIssue"
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Journal_CloneJournalTemplateRequest": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string"
          }
        },
        "additionalProperties": false
      },
      "Journal_ContentMetadataResponse": {
        "type": "object",
        "properties": {
          "dateFormat": {
            "type": "string"
          },
          "dateTimeFormat": {
            "type": "string"
          },
          "paginationToken": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Journal_ControlAccountMappingResponse": {
        "type": "object",
        "properties": {
          "organisationId": {
            "type": "string"
          },
          "templateId": {
            "type": "string"
          },
          "account": {
            "enum": [
              "None",
              "Paye",
              "EeNi",
              "ErNi",
              "ErNiClass1A",
              "EePensionTotal",
              "EePensionNetPayArrangement",
              "EePensionReliefAtSource",
              "EePensionSalarySacrifice",
              "ErPension",
              "StudentLoan",
              "PostgraduateLoan",
              "NetPay",
              "StatutoryRecoverySmp",
              "StatutoryRecoverySpp",
              "StatutoryRecoveryShpp",
              "StatutoryRecoverySap",
              "StatutoryRecoverySpbp",
              "StatutoryRecoverySncp",
              "StatutoryRecoveryCompensation",
              "ApprenticeshipLevy",
              "EmploymentAllowance",
              "CourtOrderAdminFee",
              "ApprenticeshipLevyAllowance"
            ],
            "type": "string"
          },
          "accountCode": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "taxCode": {
            "type": "string"
          },
          "groupAs": {
            "type": "string",
            "nullable": true
          },
          "createdBy": {
            "type": "string"
          },
          "createdDate": {
            "type": "string"
          },
          "updatedBy": {
            "type": "string"
          },
          "updatedDate": {
            "type": "string"
          },
          "creditAccountCode": {
            "type": "string",
            "nullable": true
          },
          "creditGroupAs": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Journal_ControlAccountMappingResponseContentResponse": {
        "type": "object",
        "properties": {
          "data": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Journal_ControlAccountMappingResponse"
              }
            ],
            "nullable": true
          },
          "metadata": {
            "$ref": "#/components/schemas/Journal_ContentMetadataResponse"
          }
        },
        "additionalProperties": false
      },
      "Journal_ControlAccountMappingResponseListContentResponse": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Journal_ControlAccountMappingResponse"
            },
            "nullable": true
          },
          "metadata": {
            "$ref": "#/components/schemas/Journal_ContentMetadataResponse"
          }
        },
        "additionalProperties": false
      },
      "Journal_ControlAccountMappingResponseListResponseBody": {
        "type": "object",
        "properties": {
          "message": {
            "$ref": "#/components/schemas/Journal_MessageWithTokenResponse"
          },
          "content": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Journal_ControlAccountMappingResponseListContentResponse"
              }
            ],
            "nullable": true
          },
          "validationIssues": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Journal_ValidationIssue"
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Journal_ControlAccountMappingResponseResponseBody": {
        "type": "object",
        "properties": {
          "message": {
            "$ref": "#/components/schemas/Journal_MessageWithTokenResponse"
          },
          "content": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Journal_ControlAccountMappingResponseContentResponse"
              }
            ],
            "nullable": true
          },
          "validationIssues": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Journal_ValidationIssue"
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Journal_CreateJournalTemplateRequest": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string"
          },
          "description": {
            "type": "string",
            "nullable": true
          },
          "linkedPayrollConfigIds": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "nullable": true
          },
          "isDefault": {
            "type": "boolean"
          },
          "swapTracking1And2": {
            "type": "boolean"
          },
          "narrationTemplate": {
            "type": "string",
            "nullable": true
          },
          "fallbackSplitValue": {
            "type": "string",
            "nullable": true
          },
          "starter": {
            "type": "string",
            "nullable": true
          },
          "mergeMatchingNominals": {
            "type": "boolean",
            "nullable": true
          },
          "pdfOptionsOverride": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Journal_JournalPdfOptions"
              }
            ],
            "nullable": true
          },
          "csvOptionsOverride": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Journal_JournalCsvOptions"
              }
            ],
            "nullable": true
          },
          "csvPresetKey": {
            "type": "string",
            "nullable": true
          },
          "pdfPresetKey": {
            "type": "string",
            "nullable": true
          },
          "groupByEmployee": {
            "type": "boolean",
            "nullable": true
          },
          "employerCostAllocation": {
            "enum": [
              "FullSplit",
              "Home"
            ],
            "type": "string",
            "nullable": true
          },
          "postJournalsAsFinal": {
            "type": "boolean",
            "nullable": true
          },
          "accountCodeSeparator": {
            "type": "string",
            "nullable": true
          },
          "unmappedPayElementAccountCode": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Journal_CreateSplitDimensionRequest": {
        "type": "object",
        "properties": {
          "source": {
            "enum": [
              "None",
              "Department",
              "TagGroup",
              "NiCategoryLetter",
              "StudentLoanPlan",
              "DirectorStatus",
              "LineDescription"
            ],
            "type": "string"
          },
          "tagGroupKey": {
            "type": "string",
            "nullable": true
          },
          "tagName": {
            "type": "string",
            "nullable": true
          },
          "displayName": {
            "type": "string"
          },
          "accountCodePlacement": {
            "enum": [
              "None",
              "Suffix",
              "Prefix",
              "Whole"
            ],
            "type": "string"
          },
          "fallbackTagGroupKey": {
            "type": "string",
            "nullable": true
          },
          "fallbackTagName": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Journal_CreateSplitDimensionRow": {
        "type": "object",
        "properties": {
          "sequence": {
            "type": "integer",
            "format": "int32"
          },
          "source": {
            "type": "string"
          },
          "tagGroupKey": {
            "type": "string",
            "nullable": true
          },
          "tagName": {
            "type": "string",
            "nullable": true
          },
          "displayName": {
            "type": "string"
          },
          "accountCodePlacement": {
            "type": "string",
            "nullable": true
          },
          "fallbackTagGroupKey": {
            "type": "string",
            "nullable": true
          },
          "fallbackTagName": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Journal_ImportJournalTemplateMappingsRequest": {
        "type": "object",
        "properties": {
          "payElementMappings": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Journal_PutPayElementMappingRow"
            },
            "nullable": true
          },
          "controlAccountMappings": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Journal_PutControlAccountMappingRow"
            },
            "nullable": true
          },
          "splitDimensions": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Journal_CreateSplitDimensionRow"
            },
            "nullable": true
          },
          "splitValueMappings": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Journal_PutSplitValueMappingRow"
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Journal_ImportJournalTemplateMappingsResponse": {
        "type": "object",
        "properties": {
          "payElementMappingsWritten": {
            "type": "integer",
            "format": "int32"
          },
          "controlAccountMappingsWritten": {
            "type": "integer",
            "format": "int32"
          },
          "splitDimensionsWritten": {
            "type": "integer",
            "format": "int32"
          },
          "splitValueMappingsWritten": {
            "type": "integer",
            "format": "int32"
          },
          "errors": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Journal_ImportRowError"
            }
          }
        },
        "additionalProperties": false
      },
      "Journal_ImportJournalTemplateMappingsResponseContentResponse": {
        "type": "object",
        "properties": {
          "data": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Journal_ImportJournalTemplateMappingsResponse"
              }
            ],
            "nullable": true
          },
          "metadata": {
            "$ref": "#/components/schemas/Journal_ContentMetadataResponse"
          }
        },
        "additionalProperties": false
      },
      "Journal_ImportJournalTemplateMappingsResponseResponseBody": {
        "type": "object",
        "properties": {
          "message": {
            "$ref": "#/components/schemas/Journal_MessageWithTokenResponse"
          },
          "content": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Journal_ImportJournalTemplateMappingsResponseContentResponse"
              }
            ],
            "nullable": true
          },
          "validationIssues": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Journal_ValidationIssue"
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Journal_ImportJournalTemplateRequest": {
        "type": "object",
        "properties": {
          "package": {
            "$ref": "#/components/schemas/Journal_JournalTemplatePackage"
          },
          "name": {
            "type": "string",
            "nullable": true
          },
          "linkedPayrollConfigIds": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "nullable": true
          },
          "isDefault": {
            "type": "boolean"
          }
        },
        "additionalProperties": false
      },
      "Journal_ImportRowError": {
        "type": "object",
        "properties": {
          "section": {
            "type": "string"
          },
          "rowIndex": {
            "type": "integer",
            "format": "int32"
          },
          "reason": {
            "type": "string"
          },
          "reasonToken": {
            "type": "string"
          }
        },
        "additionalProperties": false
      },
      "Journal_JournalAccountCodeSeparator": {
        "type": "object",
        "properties": {
          "value": {
            "type": "string"
          },
          "label": {
            "type": "string"
          },
          "example": {
            "type": "string"
          }
        },
        "additionalProperties": false
      },
      "Journal_JournalAccountCodeSeparatorListContentResponse": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Journal_JournalAccountCodeSeparator"
            },
            "nullable": true
          },
          "metadata": {
            "$ref": "#/components/schemas/Journal_ContentMetadataResponse"
          }
        },
        "additionalProperties": false
      },
      "Journal_JournalAccountCodeSeparatorListResponseBody": {
        "type": "object",
        "properties": {
          "message": {
            "$ref": "#/components/schemas/Journal_MessageWithTokenResponse"
          },
          "content": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Journal_JournalAccountCodeSeparatorListContentResponse"
              }
            ],
            "nullable": true
          },
          "validationIssues": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Journal_ValidationIssue"
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Journal_JournalAuditResponse": {
        "type": "object",
        "properties": {
          "auditId": {
            "type": "string"
          },
          "action": {
            "type": "string"
          },
          "details": {
            "type": "string",
            "nullable": true
          },
          "createdBy": {
            "type": "string"
          },
          "createdDate": {
            "type": "string"
          }
        },
        "additionalProperties": false
      },
      "Journal_JournalAuditResponseListContentResponse": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Journal_JournalAuditResponse"
            },
            "nullable": true
          },
          "metadata": {
            "$ref": "#/components/schemas/Journal_ContentMetadataResponse"
          }
        },
        "additionalProperties": false
      },
      "Journal_JournalAuditResponseListResponseBody": {
        "type": "object",
        "properties": {
          "message": {
            "$ref": "#/components/schemas/Journal_MessageWithTokenResponse"
          },
          "content": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Journal_JournalAuditResponseListContentResponse"
              }
            ],
            "nullable": true
          },
          "validationIssues": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Journal_ValidationIssue"
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Journal_JournalCsvOptions": {
        "type": "object",
        "properties": {
          "dateFormat": {
            "type": "string"
          },
          "signedAmount": {
            "type": "boolean"
          },
          "columns": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "includeTotalsRow": {
            "type": "boolean"
          },
          "referenceFormat": {
            "type": "string",
            "nullable": true
          },
          "columnHeaders": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            },
            "nullable": true
          },
          "trackingTransfersAccountCode": {
            "type": "string",
            "nullable": true
          },
          "accountNames": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            },
            "nullable": true
          },
          "splitValues": {
            "enum": [
              "Columns",
              "Description"
            ],
            "type": "string"
          },
          "xeroDepartmentInDescription": {
            "type": "boolean"
          },
          "unsplitLabel": {
            "type": "string"
          }
        },
        "additionalProperties": false
      },
      "Journal_JournalDateFormatPreset": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "label": {
            "type": "string"
          },
          "dotNetFormat": {
            "type": "string"
          },
          "sampleRendering": {
            "type": "string"
          }
        },
        "additionalProperties": false
      },
      "Journal_JournalDateFormatPresetListContentResponse": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Journal_JournalDateFormatPreset"
            },
            "nullable": true
          },
          "metadata": {
            "$ref": "#/components/schemas/Journal_ContentMetadataResponse"
          }
        },
        "additionalProperties": false
      },
      "Journal_JournalDateFormatPresetListResponseBody": {
        "type": "object",
        "properties": {
          "message": {
            "$ref": "#/components/schemas/Journal_MessageWithTokenResponse"
          },
          "content": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Journal_JournalDateFormatPresetListContentResponse"
              }
            ],
            "nullable": true
          },
          "validationIssues": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Journal_ValidationIssue"
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Journal_JournalDepartmentSummaryRow": {
        "type": "object",
        "properties": {
          "label": {
            "type": "string"
          },
          "debit": {
            "type": "number",
            "format": "double"
          },
          "credit": {
            "type": "number",
            "format": "double"
          }
        },
        "additionalProperties": false
      },
      "Journal_JournalDetailResponse": {
        "type": "object",
        "properties": {
          "journal": {
            "$ref": "#/components/schemas/Journal_JournalResponse"
          },
          "lines": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Journal_JournalLineResponse"
            },
            "description": "The journal's lines; empty when the caller asked to omit them."
          },
          "reconciliation": {
            "$ref": "#/components/schemas/Journal_ReconciliationResponse"
          },
          "unassignedLineCount": {
            "type": "integer",
            "description": "Lines posted to the template default because the employee carries no split tag.",
            "format": "int32"
          },
          "unassignedEmployeeIds": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Employees behind the unassigned lines.",
            "nullable": true
          },
          "unmappedValueLineCount": {
            "type": "integer",
            "description": "Lines that ARE tagged but whose split value has no account mapping in\nthe template — distinct from `unassignedLineCount` (no tag at all). The\nfix differs: add an account mapping vs tag the employee.",
            "format": "int32"
          },
          "unmappedValueEmployeeIds": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Employees behind the unmapped-value lines.",
            "nullable": true
          },
          "unmappedAccountLineCount": {
            "type": "integer",
            "description": "Pay items on a payslip with no account mapping AND no catch-all account,\nso they were left out — the usual cause of an off-balance journal.",
            "format": "int32"
          },
          "unmappedAccountEmployeeIds": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Employees behind the unmapped-account pay items.",
            "nullable": true
          },
          "unmappedAccountPayItems": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Names of the pay items left out for lack of an account mapping.",
            "nullable": true
          },
          "unmappedAccountAmount": {
            "type": "number",
            "description": "Total amount left out for lack of an account mapping.",
            "format": "double"
          },
          "unmappedControlAccountLineCount": {
            "type": "integer",
            "description": "Statutory / employer control accounts (PAYE, NI, student/postgraduate loan,\npension, employer NI/pension, levy…) that carried an amount but had no\ntemplate mapping, so nothing posted. Credit-only ones unbalance the journal\nby their amount; the fix is to add a control-account mapping in the template.",
            "format": "int32"
          },
          "unmappedControlAccountEmployeeIds": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Employees behind the unmapped control-account amounts.",
            "nullable": true
          },
          "unbalancedEmployees": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Journal_JournalUnbalancedEmployeeResponse"
            },
            "description": "Who is responsible for a journal that doesn't balance. Every employee's own\nlines net to zero under double entry, so these are the ones that don't —\nwith the amount each is out by. Without this, \"the journal is out by £250\"\nmeans reading every line of a 6,000-payslip run by hand.",
            "nullable": true
          },
          "unbalancedAmount": {
            "type": "number",
            "description": "Amount the journal is out by (debits minus credits).",
            "format": "double"
          },
          "unmappedControlAccountNames": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Names of the control accounts with no template mapping.",
            "nullable": true
          },
          "unmappedControlAccountAmount": {
            "type": "number",
            "description": "Total amount not posted for lack of a control-account mapping.",
            "format": "double"
          },
          "employees": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Journal_JournalEmployeeResponse"
            },
            "description": "The employees this response actually references — the warning chips plus\nany line still attributed to one person. NOT the pay run's roster: it\nlegitimately changes when the line set changes (merging collapses\nattribution, employer-level lines belong to no one), so do not assert\nagainst its contents.",
            "nullable": true
          },
          "summary": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Journal_JournalSummaryResponse"
              }
            ],
            "nullable": true
          },
          "postingNarration": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Journal_JournalDetailResponseContentResponse": {
        "type": "object",
        "properties": {
          "data": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Journal_JournalDetailResponse"
              }
            ],
            "nullable": true
          },
          "metadata": {
            "$ref": "#/components/schemas/Journal_ContentMetadataResponse"
          }
        },
        "additionalProperties": false
      },
      "Journal_JournalDetailResponseResponseBody": {
        "type": "object",
        "properties": {
          "message": {
            "$ref": "#/components/schemas/Journal_MessageWithTokenResponse"
          },
          "content": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Journal_JournalDetailResponseContentResponse"
              }
            ],
            "nullable": true
          },
          "validationIssues": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Journal_ValidationIssue"
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Journal_JournalDownloadResponse": {
        "type": "object",
        "properties": {
          "format": {
            "type": "string"
          },
          "fileName": {
            "type": "string"
          },
          "url": {
            "type": "string"
          },
          "expiresAt": {
            "type": "string"
          }
        },
        "additionalProperties": false
      },
      "Journal_JournalDownloadResponseContentResponse": {
        "type": "object",
        "properties": {
          "data": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Journal_JournalDownloadResponse"
              }
            ],
            "nullable": true
          },
          "metadata": {
            "$ref": "#/components/schemas/Journal_ContentMetadataResponse"
          }
        },
        "additionalProperties": false
      },
      "Journal_JournalDownloadResponseResponseBody": {
        "type": "object",
        "properties": {
          "message": {
            "$ref": "#/components/schemas/Journal_MessageWithTokenResponse"
          },
          "content": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Journal_JournalDownloadResponseContentResponse"
              }
            ],
            "nullable": true
          },
          "validationIssues": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Journal_ValidationIssue"
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Journal_JournalEmployeeResponse": {
        "type": "object",
        "properties": {
          "employeeId": {
            "type": "string"
          },
          "name": {
            "type": "string",
            "nullable": true
          },
          "payrollId": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "description": "Resolved identity for an employee the journal references: the stable\nemployee id, the display name, and the payroll reference. Employer-level\nlines (e.g. the Employment Allowance pair) carry no employee at all."
      },
      "Journal_JournalExportFormat": {
        "type": "object",
        "properties": {
          "key": {
            "type": "string"
          },
          "label": {
            "type": "string"
          },
          "contentType": {
            "type": "string"
          },
          "isCsv": {
            "type": "boolean"
          }
        },
        "additionalProperties": false
      },
      "Journal_JournalExportFormatListContentResponse": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Journal_JournalExportFormat"
            },
            "nullable": true
          },
          "metadata": {
            "$ref": "#/components/schemas/Journal_ContentMetadataResponse"
          }
        },
        "additionalProperties": false
      },
      "Journal_JournalExportFormatListResponseBody": {
        "type": "object",
        "properties": {
          "message": {
            "$ref": "#/components/schemas/Journal_MessageWithTokenResponse"
          },
          "content": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Journal_JournalExportFormatListContentResponse"
              }
            ],
            "nullable": true
          },
          "validationIssues": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Journal_ValidationIssue"
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Journal_JournalLineDimensionResponse": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string"
          },
          "value": {
            "type": "string"
          }
        },
        "additionalProperties": false
      },
      "Journal_JournalLineResponse": {
        "type": "object",
        "properties": {
          "lineSequence": {
            "type": "integer",
            "format": "int32"
          },
          "lineSource": {
            "enum": [
              "PayElement",
              "ControlAccount",
              "Apportioned"
            ],
            "type": "string"
          },
          "accountCode": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "debit": {
            "type": "number",
            "format": "double"
          },
          "credit": {
            "type": "number",
            "format": "double"
          },
          "narration": {
            "type": "string"
          },
          "employeeAttribution": {
            "type": "string",
            "nullable": true
          },
          "dimensions": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Journal_JournalLineDimensionResponse"
            }
          },
          "groupLabel": {
            "type": "string",
            "nullable": true
          },
          "fellBackToDefault": {
            "type": "boolean"
          },
          "taxCode": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Journal_JournalLineResponseListContentResponse": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Journal_JournalLineResponse"
            },
            "nullable": true
          },
          "metadata": {
            "$ref": "#/components/schemas/Journal_ContentMetadataResponse"
          }
        },
        "additionalProperties": false
      },
      "Journal_JournalLineResponseListResponseBody": {
        "type": "object",
        "properties": {
          "message": {
            "$ref": "#/components/schemas/Journal_MessageWithTokenResponse"
          },
          "content": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Journal_JournalLineResponseListContentResponse"
              }
            ],
            "nullable": true
          },
          "validationIssues": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Journal_ValidationIssue"
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Journal_JournalNarrationToken": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "label": {
            "type": "string"
          },
          "sampleValue": {
            "type": "string"
          }
        },
        "additionalProperties": false
      },
      "Journal_JournalNarrationTokenListContentResponse": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Journal_JournalNarrationToken"
            },
            "nullable": true
          },
          "metadata": {
            "$ref": "#/components/schemas/Journal_ContentMetadataResponse"
          }
        },
        "additionalProperties": false
      },
      "Journal_JournalNarrationTokenListResponseBody": {
        "type": "object",
        "properties": {
          "message": {
            "$ref": "#/components/schemas/Journal_MessageWithTokenResponse"
          },
          "content": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Journal_JournalNarrationTokenListContentResponse"
              }
            ],
            "nullable": true
          },
          "validationIssues": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Journal_ValidationIssue"
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Journal_JournalNominalSummaryRow": {
        "type": "object",
        "properties": {
          "accountCode": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "debit": {
            "type": "number",
            "format": "double"
          },
          "credit": {
            "type": "number",
            "format": "double"
          }
        },
        "additionalProperties": false
      },
      "Journal_JournalPdfOptions": {
        "type": "object",
        "properties": {
          "orientation": {
            "type": "string"
          },
          "brandingTitle": {
            "type": "string"
          },
          "dateFormat": {
            "type": "string"
          },
          "narrationTemplate": {
            "type": "string"
          },
          "columns": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "includeTotalsRow": {
            "type": "boolean"
          },
          "referenceFormat": {
            "type": "string",
            "nullable": true
          },
          "columnHeaders": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            },
            "nullable": true
          },
          "grouped": {
            "type": "boolean"
          },
          "trackingTransfersAccountCode": {
            "type": "string",
            "nullable": true
          },
          "accountNames": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Journal_JournalPostingListResponse": {
        "type": "object",
        "properties": {
          "postings": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Journal_JournalPostingResponse"
            }
          }
        },
        "additionalProperties": false
      },
      "Journal_JournalPostingListResponseContentResponse": {
        "type": "object",
        "properties": {
          "data": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Journal_JournalPostingListResponse"
              }
            ],
            "nullable": true
          },
          "metadata": {
            "$ref": "#/components/schemas/Journal_ContentMetadataResponse"
          }
        },
        "additionalProperties": false
      },
      "Journal_JournalPostingListResponseResponseBody": {
        "type": "object",
        "properties": {
          "message": {
            "$ref": "#/components/schemas/Journal_MessageWithTokenResponse"
          },
          "content": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Journal_JournalPostingListResponseContentResponse"
              }
            ],
            "nullable": true
          },
          "validationIssues": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Journal_ValidationIssue"
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Journal_JournalPostingResponse": {
        "type": "object",
        "properties": {
          "attempt": {
            "type": "integer",
            "description": "Which send this was, from 1.",
            "format": "int32"
          },
          "status": {
            "enum": [
              "Sending",
              "Sent",
              "Failed",
              "NeedsAttention"
            ],
            "type": "string",
            "description": "Where this attempt has got to. The values are on the enum; Sent,\nFailed and NeedsAttention are terminal, so a client polling this\nresource should stop on any of them. Poll no faster than every 5\nseconds — a send typically settles within a few seconds of leaving,\nand the same states are pushed live over the websocket."
          },
          "providerName": {
            "type": "string"
          },
          "providerReference": {
            "type": "string",
            "description": "The accounting system's own reference for the entry it created, once\nit has one. Present on a Sent attempt; use it to reconcile against\nthe entry in the accounting system.",
            "nullable": true
          },
          "errorToken": {
            "type": "string",
            "description": "Stable, provider-neutral reason it did not land, for a client to turn\ninto its own sentence. Never a raw message from the accounting\nsystem, and safe to branch on: the vocabulary is shared across every\nprovider, so handling it does not tie a client to one of them.",
            "nullable": true
          },
          "createdBy": {
            "type": "string",
            "description": "Who pressed send."
          },
          "createdDate": {
            "type": "string",
            "description": "When the send was started (UTC)."
          },
          "updatedDate": {
            "type": "string",
            "description": "When the accounting system answered (UTC), on a settled attempt —\nthe provider's own moment, not when this service recorded it, so the\nfigure is safe to reconcile against the provider's records and does\nnot move with our queue timings. Equals `createdDate` while the\nattempt is still Sending."
          }
        },
        "additionalProperties": false,
        "description": "One attempt at sending a journal to the accounting system it is\nlinked to."
      },
      "Journal_JournalPostingResponseContentResponse": {
        "type": "object",
        "properties": {
          "data": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Journal_JournalPostingResponse"
              }
            ],
            "nullable": true
          },
          "metadata": {
            "$ref": "#/components/schemas/Journal_ContentMetadataResponse"
          }
        },
        "additionalProperties": false
      },
      "Journal_JournalPostingResponseResponseBody": {
        "type": "object",
        "properties": {
          "message": {
            "$ref": "#/components/schemas/Journal_MessageWithTokenResponse"
          },
          "content": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Journal_JournalPostingResponseContentResponse"
              }
            ],
            "nullable": true
          },
          "validationIssues": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Journal_ValidationIssue"
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Journal_JournalPreset": {
        "type": "object",
        "properties": {
          "key": {
            "type": "string"
          },
          "label": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "csvOptions": {
            "$ref": "#/components/schemas/Journal_JournalCsvOptions"
          },
          "pdfOptions": {
            "$ref": "#/components/schemas/Journal_JournalPdfOptions"
          }
        },
        "additionalProperties": false
      },
      "Journal_JournalPresetListContentResponse": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Journal_JournalPreset"
            },
            "nullable": true
          },
          "metadata": {
            "$ref": "#/components/schemas/Journal_ContentMetadataResponse"
          }
        },
        "additionalProperties": false
      },
      "Journal_JournalPresetListResponseBody": {
        "type": "object",
        "properties": {
          "message": {
            "$ref": "#/components/schemas/Journal_MessageWithTokenResponse"
          },
          "content": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Journal_JournalPresetListContentResponse"
              }
            ],
            "nullable": true
          },
          "validationIssues": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Journal_ValidationIssue"
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Journal_JournalReissueProgressResponse": {
        "type": "object",
        "properties": {
          "journalId": {
            "type": "string"
          },
          "version": {
            "type": "integer",
            "format": "int32"
          },
          "status": {
            "type": "string"
          },
          "completed": {
            "type": "integer",
            "format": "int32"
          },
          "expected": {
            "type": "integer",
            "format": "int32"
          },
          "isFinalised": {
            "type": "boolean"
          },
          "balanced": {
            "type": "boolean"
          },
          "updatedDate": {
            "type": "string"
          },
          "stalled": {
            "type": "boolean"
          }
        },
        "additionalProperties": false
      },
      "Journal_JournalReissueProgressResponseContentResponse": {
        "type": "object",
        "properties": {
          "data": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Journal_JournalReissueProgressResponse"
              }
            ],
            "nullable": true
          },
          "metadata": {
            "$ref": "#/components/schemas/Journal_ContentMetadataResponse"
          }
        },
        "additionalProperties": false
      },
      "Journal_JournalReissueProgressResponseResponseBody": {
        "type": "object",
        "properties": {
          "message": {
            "$ref": "#/components/schemas/Journal_MessageWithTokenResponse"
          },
          "content": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Journal_JournalReissueProgressResponseContentResponse"
              }
            ],
            "nullable": true
          },
          "validationIssues": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Journal_ValidationIssue"
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Journal_JournalResponse": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Journal identifier."
          },
          "organisationId": {
            "type": "string",
            "description": "Organisation the journal belongs to."
          },
          "payrollConfigId": {
            "type": "string",
            "description": "Payroll configuration (pay schedule) of the pay run."
          },
          "taxYear": {
            "type": "integer",
            "description": "Tax year of the pay run.",
            "format": "int32"
          },
          "taxPeriod": {
            "type": "integer",
            "description": "Tax period of the pay run within the tax year.",
            "format": "int32"
          },
          "payDate": {
            "type": "string",
            "description": "Pay date of the pay run."
          },
          "frequency": {
            "type": "string",
            "description": "Pay frequency of the payroll configuration."
          },
          "version": {
            "type": "integer",
            "description": "Version of the journal within its pay run; a reissue creates a new version.",
            "format": "int32"
          },
          "templateId": {
            "type": "string",
            "description": "Journal template the lines were generated from."
          },
          "sumDebit": {
            "type": "number",
            "description": "Stored running total of the journal's debit lines. On a settled journal it\nequals the sum of the lines (and `reconciliation.sumDebit`); while a\npay run is still calculating, prefer `reconciliation`, which is\ncomputed from the very lines in the same response.",
            "format": "double"
          },
          "sumCredit": {
            "type": "number",
            "description": "Stored running total of the journal's credit lines. See `sumDebit`.",
            "format": "double"
          },
          "isBalanced": {
            "type": "boolean",
            "description": "Whether the journal's debits equal its credits."
          },
          "isFinalised": {
            "type": "boolean",
            "description": "Whether the journal is a finalised, immutable snapshot."
          },
          "failureReason": {
            "type": "string",
            "description": "Why generation failed, when it did; null otherwise.",
            "nullable": true
          },
          "createdBy": {
            "type": "string",
            "description": "Who created this journal version."
          },
          "createdDate": {
            "type": "string",
            "description": "When this journal version was created (UTC)."
          },
          "updatedBy": {
            "type": "string",
            "description": "Who last updated the journal."
          },
          "updatedDate": {
            "type": "string",
            "description": "When the journal was last updated (UTC)."
          },
          "settled": {
            "type": "boolean",
            "description": "Whether this journal has incorporated every payslip change the pay run\ncurrently reports. False means the figures are still moving: read again\nrather than assert against them. A finalised journal is always settled —\nit is an immutable snapshot. On the organisation-wide list the run is not\nconsulted, so this reports finalisation only; use the single-journal or\npay-run endpoints for the live answer."
          },
          "incorporatedPayslipVersion": {
            "type": "string",
            "description": "The pay-run payslip token this journal has fully incorporated. Compare\nsuccessive reads to see progress. Empty on a journal that predates the\ntoken, where `settled` falls back to the previous behaviour."
          }
        },
        "additionalProperties": false
      },
      "Journal_JournalResponseContentResponse": {
        "type": "object",
        "properties": {
          "data": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Journal_JournalResponse"
              }
            ],
            "nullable": true
          },
          "metadata": {
            "$ref": "#/components/schemas/Journal_ContentMetadataResponse"
          }
        },
        "additionalProperties": false
      },
      "Journal_JournalResponseListContentResponse": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Journal_JournalResponse"
            },
            "nullable": true
          },
          "metadata": {
            "$ref": "#/components/schemas/Journal_ContentMetadataResponse"
          }
        },
        "additionalProperties": false
      },
      "Journal_JournalResponseListResponseBody": {
        "type": "object",
        "properties": {
          "message": {
            "$ref": "#/components/schemas/Journal_MessageWithTokenResponse"
          },
          "content": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Journal_JournalResponseListContentResponse"
              }
            ],
            "nullable": true
          },
          "validationIssues": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Journal_ValidationIssue"
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Journal_JournalResponseResponseBody": {
        "type": "object",
        "properties": {
          "message": {
            "$ref": "#/components/schemas/Journal_MessageWithTokenResponse"
          },
          "content": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Journal_JournalResponseContentResponse"
              }
            ],
            "nullable": true
          },
          "validationIssues": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Journal_ValidationIssue"
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Journal_JournalSummaryResponse": {
        "type": "object",
        "properties": {
          "byNominal": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Journal_JournalNominalSummaryRow"
            }
          },
          "byDepartment": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Journal_JournalDepartmentSummaryRow"
            }
          },
          "issueLineCount": {
            "type": "integer",
            "format": "int32"
          },
          "totalLineCount": {
            "type": "integer",
            "format": "int32"
          }
        },
        "additionalProperties": false
      },
      "Journal_JournalTemplateAuditChange": {
        "type": "object",
        "properties": {
          "field": {
            "type": "string"
          },
          "from": {
            "type": "string",
            "nullable": true
          },
          "to": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Journal_JournalTemplateAuditResponse": {
        "type": "object",
        "properties": {
          "auditId": {
            "type": "string"
          },
          "action": {
            "type": "string"
          },
          "subject": {
            "type": "string",
            "nullable": true
          },
          "changes": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Journal_JournalTemplateAuditChange"
            }
          },
          "createdBy": {
            "type": "string"
          },
          "createdDate": {
            "type": "string"
          }
        },
        "additionalProperties": false
      },
      "Journal_JournalTemplateAuditResponseListContentResponse": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Journal_JournalTemplateAuditResponse"
            },
            "nullable": true
          },
          "metadata": {
            "$ref": "#/components/schemas/Journal_ContentMetadataResponse"
          }
        },
        "additionalProperties": false
      },
      "Journal_JournalTemplateAuditResponseListResponseBody": {
        "type": "object",
        "properties": {
          "message": {
            "$ref": "#/components/schemas/Journal_MessageWithTokenResponse"
          },
          "content": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Journal_JournalTemplateAuditResponseListContentResponse"
              }
            ],
            "nullable": true
          },
          "validationIssues": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Journal_ValidationIssue"
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Journal_JournalTemplatePackage": {
        "type": "object",
        "properties": {
          "formatVersion": {
            "type": "integer",
            "format": "int32"
          },
          "exportedFromOrganisationId": {
            "type": "string",
            "nullable": true
          },
          "exportedAt": {
            "type": "string",
            "nullable": true
          },
          "template": {
            "$ref": "#/components/schemas/Journal_JournalTemplatePackageHeader"
          },
          "payElementMappings": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Journal_PutPayElementMappingRow"
            }
          },
          "controlAccountMappings": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Journal_PutControlAccountMappingRow"
            }
          },
          "splitDimensions": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Journal_CreateSplitDimensionRow"
            }
          },
          "splitValueMappings": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Journal_PutSplitValueMappingRow"
            }
          }
        },
        "additionalProperties": false
      },
      "Journal_JournalTemplatePackageContentResponse": {
        "type": "object",
        "properties": {
          "data": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Journal_JournalTemplatePackage"
              }
            ],
            "nullable": true
          },
          "metadata": {
            "$ref": "#/components/schemas/Journal_ContentMetadataResponse"
          }
        },
        "additionalProperties": false
      },
      "Journal_JournalTemplatePackageHeader": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string"
          },
          "description": {
            "type": "string",
            "nullable": true
          },
          "mergeMatchingNominals": {
            "type": "boolean"
          },
          "swapTracking1And2": {
            "type": "boolean"
          },
          "narrationTemplate": {
            "type": "string",
            "nullable": true
          },
          "fallbackSplitValue": {
            "type": "string",
            "nullable": true
          },
          "accountCodeSeparator": {
            "type": "string",
            "nullable": true
          },
          "unmappedPayElementAccountCode": {
            "type": "string",
            "nullable": true
          },
          "groupByEmployee": {
            "type": "boolean"
          },
          "employerCostAllocation": {
            "enum": [
              "FullSplit",
              "Home"
            ],
            "type": "string"
          },
          "pdfOptionsOverride": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Journal_JournalPdfOptions"
              }
            ],
            "nullable": true
          },
          "csvOptionsOverride": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Journal_JournalCsvOptions"
              }
            ],
            "nullable": true
          },
          "csvPresetKey": {
            "type": "string",
            "nullable": true
          },
          "pdfPresetKey": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Journal_JournalTemplatePackageResponseBody": {
        "type": "object",
        "properties": {
          "message": {
            "$ref": "#/components/schemas/Journal_MessageWithTokenResponse"
          },
          "content": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Journal_JournalTemplatePackageContentResponse"
              }
            ],
            "nullable": true
          },
          "validationIssues": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Journal_ValidationIssue"
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Journal_JournalTemplateResponse": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "organisationId": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "description": {
            "type": "string",
            "nullable": true
          },
          "linkedPayrollConfigIds": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "isDefault": {
            "type": "boolean"
          },
          "mergeMatchingNominals": {
            "type": "boolean"
          },
          "swapTracking1And2": {
            "type": "boolean"
          },
          "narrationTemplate": {
            "type": "string",
            "nullable": true
          },
          "fallbackSplitValue": {
            "type": "string",
            "nullable": true
          },
          "createdBy": {
            "type": "string"
          },
          "createdDate": {
            "type": "string"
          },
          "updatedBy": {
            "type": "string"
          },
          "updatedDate": {
            "type": "string"
          },
          "pdfOptionsOverride": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Journal_JournalPdfOptions"
              }
            ],
            "nullable": true
          },
          "csvOptionsOverride": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Journal_JournalCsvOptions"
              }
            ],
            "nullable": true
          },
          "resolvedCsvOptions": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Journal_JournalCsvOptions"
              }
            ],
            "nullable": true
          },
          "resolvedPdfOptions": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Journal_JournalPdfOptions"
              }
            ],
            "nullable": true
          },
          "csvPresetKey": {
            "type": "string",
            "nullable": true
          },
          "pdfPresetKey": {
            "type": "string",
            "nullable": true
          },
          "groupByEmployee": {
            "type": "boolean"
          },
          "employerCostAllocation": {
            "enum": [
              "FullSplit",
              "Home"
            ],
            "type": "string"
          },
          "postJournalsAsFinal": {
            "type": "boolean"
          },
          "accountCodeSeparator": {
            "type": "string",
            "nullable": true
          },
          "unmappedPayElementAccountCode": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Journal_JournalTemplateResponseContentResponse": {
        "type": "object",
        "properties": {
          "data": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Journal_JournalTemplateResponse"
              }
            ],
            "nullable": true
          },
          "metadata": {
            "$ref": "#/components/schemas/Journal_ContentMetadataResponse"
          }
        },
        "additionalProperties": false
      },
      "Journal_JournalTemplateResponseListContentResponse": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Journal_JournalTemplateResponse"
            },
            "nullable": true
          },
          "metadata": {
            "$ref": "#/components/schemas/Journal_ContentMetadataResponse"
          }
        },
        "additionalProperties": false
      },
      "Journal_JournalTemplateResponseListResponseBody": {
        "type": "object",
        "properties": {
          "message": {
            "$ref": "#/components/schemas/Journal_MessageWithTokenResponse"
          },
          "content": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Journal_JournalTemplateResponseListContentResponse"
              }
            ],
            "nullable": true
          },
          "validationIssues": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Journal_ValidationIssue"
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Journal_JournalTemplateResponseResponseBody": {
        "type": "object",
        "properties": {
          "message": {
            "$ref": "#/components/schemas/Journal_MessageWithTokenResponse"
          },
          "content": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Journal_JournalTemplateResponseContentResponse"
              }
            ],
            "nullable": true
          },
          "validationIssues": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Journal_ValidationIssue"
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Journal_JournalUnbalancedEmployeeResponse": {
        "type": "object",
        "properties": {
          "employeeId": {
            "type": "string"
          },
          "name": {
            "type": "string",
            "nullable": true
          },
          "payrollId": {
            "type": "string",
            "nullable": true
          },
          "netImbalance": {
            "type": "number",
            "format": "double"
          }
        },
        "additionalProperties": false
      },
      "Journal_MessageWithTokenResponse": {
        "type": "object",
        "properties": {
          "text": {
            "type": "string"
          },
          "token": {
            "type": "string"
          },
          "tokenArguments": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Journal_ValidationIssueArgument"
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Journal_NominalImbalanceResponse": {
        "type": "object",
        "properties": {
          "accountCode": {
            "type": "string"
          },
          "sumDebit": {
            "type": "number",
            "format": "double"
          },
          "sumCredit": {
            "type": "number",
            "format": "double"
          },
          "imbalance": {
            "type": "number",
            "format": "double"
          }
        },
        "additionalProperties": false
      },
      "Journal_ObjectContentResponse": {
        "type": "object",
        "properties": {
          "data": {
            "nullable": true
          },
          "metadata": {
            "$ref": "#/components/schemas/Journal_ContentMetadataResponse"
          }
        },
        "additionalProperties": false
      },
      "Journal_ObjectResponseBody": {
        "type": "object",
        "properties": {
          "message": {
            "$ref": "#/components/schemas/Journal_MessageWithTokenResponse"
          },
          "content": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Journal_ObjectContentResponse"
              }
            ],
            "nullable": true
          },
          "validationIssues": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Journal_ValidationIssue"
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Journal_OrgJournalSettingsResponse": {
        "type": "object",
        "properties": {
          "organisationId": {
            "type": "string"
          },
          "pdfOptions": {
            "$ref": "#/components/schemas/Journal_JournalPdfOptions"
          },
          "csvOptions": {
            "$ref": "#/components/schemas/Journal_JournalCsvOptions"
          },
          "createdBy": {
            "type": "string"
          },
          "createdDate": {
            "type": "string"
          },
          "updatedBy": {
            "type": "string"
          },
          "updatedDate": {
            "type": "string"
          },
          "csvPresetKey": {
            "type": "string",
            "nullable": true
          },
          "pdfPresetKey": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Journal_OrgJournalSettingsResponseContentResponse": {
        "type": "object",
        "properties": {
          "data": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Journal_OrgJournalSettingsResponse"
              }
            ],
            "nullable": true
          },
          "metadata": {
            "$ref": "#/components/schemas/Journal_ContentMetadataResponse"
          }
        },
        "additionalProperties": false
      },
      "Journal_OrgJournalSettingsResponseResponseBody": {
        "type": "object",
        "properties": {
          "message": {
            "$ref": "#/components/schemas/Journal_MessageWithTokenResponse"
          },
          "content": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Journal_OrgJournalSettingsResponseContentResponse"
              }
            ],
            "nullable": true
          },
          "validationIssues": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Journal_ValidationIssue"
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Journal_PayElementMappingResponse": {
        "type": "object",
        "properties": {
          "organisationId": {
            "type": "string"
          },
          "templateId": {
            "type": "string"
          },
          "payElementId": {
            "type": "string"
          },
          "accountCode": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "taxCode": {
            "type": "string"
          },
          "groupAs": {
            "type": "string",
            "nullable": true
          },
          "createdBy": {
            "type": "string"
          },
          "createdDate": {
            "type": "string"
          },
          "updatedBy": {
            "type": "string"
          },
          "updatedDate": {
            "type": "string"
          },
          "excludeFromSplit": {
            "type": "boolean"
          }
        },
        "additionalProperties": false
      },
      "Journal_PayElementMappingResponseContentResponse": {
        "type": "object",
        "properties": {
          "data": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Journal_PayElementMappingResponse"
              }
            ],
            "nullable": true
          },
          "metadata": {
            "$ref": "#/components/schemas/Journal_ContentMetadataResponse"
          }
        },
        "additionalProperties": false
      },
      "Journal_PayElementMappingResponseListContentResponse": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Journal_PayElementMappingResponse"
            },
            "nullable": true
          },
          "metadata": {
            "$ref": "#/components/schemas/Journal_ContentMetadataResponse"
          }
        },
        "additionalProperties": false
      },
      "Journal_PayElementMappingResponseListResponseBody": {
        "type": "object",
        "properties": {
          "message": {
            "$ref": "#/components/schemas/Journal_MessageWithTokenResponse"
          },
          "content": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Journal_PayElementMappingResponseListContentResponse"
              }
            ],
            "nullable": true
          },
          "validationIssues": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Journal_ValidationIssue"
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Journal_PayElementMappingResponseResponseBody": {
        "type": "object",
        "properties": {
          "message": {
            "$ref": "#/components/schemas/Journal_MessageWithTokenResponse"
          },
          "content": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Journal_PayElementMappingResponseContentResponse"
              }
            ],
            "nullable": true
          },
          "validationIssues": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Journal_ValidationIssue"
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Journal_PutControlAccountMappingRequest": {
        "type": "object",
        "properties": {
          "accountCode": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "taxCode": {
            "type": "string",
            "nullable": true
          },
          "groupAs": {
            "type": "string",
            "nullable": true
          },
          "creditAccountCode": {
            "type": "string",
            "nullable": true
          },
          "creditGroupAs": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Journal_PutControlAccountMappingRow": {
        "type": "object",
        "properties": {
          "account": {
            "type": "string"
          },
          "accountCode": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "taxCode": {
            "type": "string",
            "nullable": true
          },
          "groupAs": {
            "type": "string",
            "nullable": true
          },
          "creditAccountCode": {
            "type": "string",
            "nullable": true
          },
          "creditGroupAs": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Journal_PutPayElementMappingRequest": {
        "type": "object",
        "properties": {
          "accountCode": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "taxCode": {
            "type": "string",
            "nullable": true
          },
          "groupAs": {
            "type": "string",
            "nullable": true
          },
          "excludeFromSplit": {
            "type": "boolean"
          }
        },
        "additionalProperties": false
      },
      "Journal_PutPayElementMappingRow": {
        "type": "object",
        "properties": {
          "payElementId": {
            "type": "string"
          },
          "accountCode": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "taxCode": {
            "type": "string",
            "nullable": true
          },
          "groupAs": {
            "type": "string",
            "nullable": true
          },
          "excludeFromSplit": {
            "type": "boolean"
          }
        },
        "additionalProperties": false
      },
      "Journal_PutSplitValueMappingRequest": {
        "type": "object",
        "properties": {
          "displayName": {
            "type": "string"
          },
          "accountSegment": {
            "type": "string"
          },
          "employerCostsAccountSegment": {
            "type": "string",
            "nullable": true
          },
          "deductionAccountSegment": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Journal_PutSplitValueMappingRow": {
        "type": "object",
        "properties": {
          "dimensionSequence": {
            "type": "integer",
            "format": "int32"
          },
          "splitValueKey": {
            "type": "string"
          },
          "displayName": {
            "type": "string"
          },
          "accountSegment": {
            "type": "string"
          },
          "employerCostsAccountSegment": {
            "type": "string",
            "nullable": true
          },
          "deductionAccountSegment": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Journal_RebuildJournalRequest": {
        "type": "object",
        "properties": {
          "payrollConfigId": {
            "type": "string",
            "nullable": true
          },
          "taxYear": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "taxPeriod": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Journal_RebuildJournalResponse": {
        "type": "object",
        "properties": {
          "journalId": {
            "type": "string",
            "nullable": true
          },
          "payslipsProcessed": {
            "type": "integer",
            "format": "int32"
          },
          "linesEmittedTotal": {
            "type": "integer",
            "format": "int32"
          },
          "balanced": {
            "type": "boolean"
          },
          "sumDebit": {
            "type": "number",
            "format": "double"
          },
          "sumCredit": {
            "type": "number",
            "format": "double"
          }
        },
        "additionalProperties": false
      },
      "Journal_RebuildJournalResponseContentResponse": {
        "type": "object",
        "properties": {
          "data": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Journal_RebuildJournalResponse"
              }
            ],
            "nullable": true
          },
          "metadata": {
            "$ref": "#/components/schemas/Journal_ContentMetadataResponse"
          }
        },
        "additionalProperties": false
      },
      "Journal_RebuildJournalResponseResponseBody": {
        "type": "object",
        "properties": {
          "message": {
            "$ref": "#/components/schemas/Journal_MessageWithTokenResponse"
          },
          "content": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Journal_RebuildJournalResponseContentResponse"
              }
            ],
            "nullable": true
          },
          "validationIssues": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Journal_ValidationIssue"
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Journal_ReconciliationResponse": {
        "type": "object",
        "properties": {
          "sumDebit": {
            "type": "number",
            "description": "Sum of the returned lines' debits.",
            "format": "double"
          },
          "sumCredit": {
            "type": "number",
            "description": "Sum of the returned lines' credits.",
            "format": "double"
          },
          "imbalance": {
            "type": "number",
            "description": "SumDebit minus SumCredit; zero on a balanced journal.",
            "format": "double"
          },
          "isBalanced": {
            "type": "boolean",
            "description": "True when the imbalance is exactly zero."
          },
          "imbalancePerNominal": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Journal_NominalImbalanceResponse"
            },
            "description": "Only the nominal codes whose debits and credits do not net off — empty on\na balanced journal."
          }
        },
        "additionalProperties": false,
        "description": "Totals computed while serving this request from the very lines in the same\nresponse — never a stored figure, so they can never disagree with the\nlines. Assert against these; on a settled journal they also equal the\njournal's stored `sumDebit`/`sumCredit`."
      },
      "Journal_ReissueJournalRequest": {
        "type": "object",
        "properties": {
          "payrollConfigId": {
            "type": "string",
            "nullable": true
          },
          "taxYear": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "taxPeriod": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Journal_ReissueJournalResponse": {
        "type": "object",
        "properties": {
          "journalId": {
            "type": "string",
            "nullable": true
          },
          "version": {
            "type": "integer",
            "format": "int32"
          },
          "status": {
            "type": "string"
          }
        },
        "additionalProperties": false
      },
      "Journal_ReissueJournalResponseContentResponse": {
        "type": "object",
        "properties": {
          "data": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Journal_ReissueJournalResponse"
              }
            ],
            "nullable": true
          },
          "metadata": {
            "$ref": "#/components/schemas/Journal_ContentMetadataResponse"
          }
        },
        "additionalProperties": false
      },
      "Journal_ReissueJournalResponseResponseBody": {
        "type": "object",
        "properties": {
          "message": {
            "$ref": "#/components/schemas/Journal_MessageWithTokenResponse"
          },
          "content": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Journal_ReissueJournalResponseContentResponse"
              }
            ],
            "nullable": true
          },
          "validationIssues": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Journal_ValidationIssue"
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Journal_SplitDimensionResponse": {
        "type": "object",
        "properties": {
          "organisationId": {
            "type": "string"
          },
          "templateId": {
            "type": "string"
          },
          "sequence": {
            "type": "integer",
            "format": "int32"
          },
          "source": {
            "enum": [
              "None",
              "Department",
              "TagGroup",
              "NiCategoryLetter",
              "StudentLoanPlan",
              "DirectorStatus",
              "LineDescription"
            ],
            "type": "string"
          },
          "tagGroupKey": {
            "type": "string",
            "nullable": true
          },
          "tagName": {
            "type": "string",
            "nullable": true
          },
          "displayName": {
            "type": "string"
          },
          "accountCodePlacement": {
            "enum": [
              "None",
              "Suffix",
              "Prefix",
              "Whole"
            ],
            "type": "string"
          },
          "createdBy": {
            "type": "string"
          },
          "createdDate": {
            "type": "string"
          },
          "updatedBy": {
            "type": "string"
          },
          "updatedDate": {
            "type": "string"
          },
          "fallbackTagGroupKey": {
            "type": "string",
            "nullable": true
          },
          "fallbackTagName": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Journal_SplitDimensionResponseContentResponse": {
        "type": "object",
        "properties": {
          "data": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Journal_SplitDimensionResponse"
              }
            ],
            "nullable": true
          },
          "metadata": {
            "$ref": "#/components/schemas/Journal_ContentMetadataResponse"
          }
        },
        "additionalProperties": false
      },
      "Journal_SplitDimensionResponseListContentResponse": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Journal_SplitDimensionResponse"
            },
            "nullable": true
          },
          "metadata": {
            "$ref": "#/components/schemas/Journal_ContentMetadataResponse"
          }
        },
        "additionalProperties": false
      },
      "Journal_SplitDimensionResponseListResponseBody": {
        "type": "object",
        "properties": {
          "message": {
            "$ref": "#/components/schemas/Journal_MessageWithTokenResponse"
          },
          "content": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Journal_SplitDimensionResponseListContentResponse"
              }
            ],
            "nullable": true
          },
          "validationIssues": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Journal_ValidationIssue"
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Journal_SplitDimensionResponseResponseBody": {
        "type": "object",
        "properties": {
          "message": {
            "$ref": "#/components/schemas/Journal_MessageWithTokenResponse"
          },
          "content": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Journal_SplitDimensionResponseContentResponse"
              }
            ],
            "nullable": true
          },
          "validationIssues": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Journal_ValidationIssue"
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Journal_SplitSourceMetadata": {
        "type": "object",
        "properties": {
          "source": {
            "enum": [
              "None",
              "Department",
              "TagGroup",
              "NiCategoryLetter",
              "StudentLoanPlan",
              "DirectorStatus",
              "LineDescription"
            ],
            "type": "string"
          },
          "label": {
            "type": "string"
          },
          "values": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Journal_SplitSourceValue"
            }
          }
        },
        "additionalProperties": false
      },
      "Journal_SplitSourceMetadataListContentResponse": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Journal_SplitSourceMetadata"
            },
            "nullable": true
          },
          "metadata": {
            "$ref": "#/components/schemas/Journal_ContentMetadataResponse"
          }
        },
        "additionalProperties": false
      },
      "Journal_SplitSourceMetadataListResponseBody": {
        "type": "object",
        "properties": {
          "message": {
            "$ref": "#/components/schemas/Journal_MessageWithTokenResponse"
          },
          "content": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Journal_SplitSourceMetadataListContentResponse"
              }
            ],
            "nullable": true
          },
          "validationIssues": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Journal_ValidationIssue"
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Journal_SplitSourceValue": {
        "type": "object",
        "properties": {
          "key": {
            "type": "string"
          },
          "label": {
            "type": "string"
          }
        },
        "additionalProperties": false
      },
      "Journal_SplitValueMappingResponse": {
        "type": "object",
        "properties": {
          "organisationId": {
            "type": "string"
          },
          "templateId": {
            "type": "string"
          },
          "dimensionSequence": {
            "type": "integer",
            "format": "int32"
          },
          "splitValueKey": {
            "type": "string"
          },
          "displayName": {
            "type": "string"
          },
          "accountSegment": {
            "type": "string"
          },
          "createdBy": {
            "type": "string"
          },
          "createdDate": {
            "type": "string"
          },
          "updatedBy": {
            "type": "string"
          },
          "updatedDate": {
            "type": "string"
          },
          "employerCostsAccountSegment": {
            "type": "string"
          },
          "deductionAccountSegment": {
            "type": "string"
          }
        },
        "additionalProperties": false
      },
      "Journal_SplitValueMappingResponseContentResponse": {
        "type": "object",
        "properties": {
          "data": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Journal_SplitValueMappingResponse"
              }
            ],
            "nullable": true
          },
          "metadata": {
            "$ref": "#/components/schemas/Journal_ContentMetadataResponse"
          }
        },
        "additionalProperties": false
      },
      "Journal_SplitValueMappingResponseListContentResponse": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Journal_SplitValueMappingResponse"
            },
            "nullable": true
          },
          "metadata": {
            "$ref": "#/components/schemas/Journal_ContentMetadataResponse"
          }
        },
        "additionalProperties": false
      },
      "Journal_SplitValueMappingResponseListResponseBody": {
        "type": "object",
        "properties": {
          "message": {
            "$ref": "#/components/schemas/Journal_MessageWithTokenResponse"
          },
          "content": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Journal_SplitValueMappingResponseListContentResponse"
              }
            ],
            "nullable": true
          },
          "validationIssues": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Journal_ValidationIssue"
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Journal_SplitValueMappingResponseResponseBody": {
        "type": "object",
        "properties": {
          "message": {
            "$ref": "#/components/schemas/Journal_MessageWithTokenResponse"
          },
          "content": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Journal_SplitValueMappingResponseContentResponse"
              }
            ],
            "nullable": true
          },
          "validationIssues": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Journal_ValidationIssue"
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Journal_UpdateJournalTemplateRequest": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "nullable": true
          },
          "description": {
            "type": "string",
            "nullable": true
          },
          "linkedPayrollConfigIds": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "nullable": true
          },
          "isDefault": {
            "type": "boolean",
            "nullable": true
          },
          "mergeMatchingNominals": {
            "type": "boolean",
            "nullable": true
          },
          "swapTracking1And2": {
            "type": "boolean",
            "nullable": true
          },
          "narrationTemplate": {
            "type": "string",
            "nullable": true
          },
          "fallbackSplitValue": {
            "type": "string",
            "nullable": true
          },
          "pdfOptionsOverride": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Journal_JournalPdfOptions"
              }
            ],
            "nullable": true
          },
          "csvOptionsOverride": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Journal_JournalCsvOptions"
              }
            ],
            "nullable": true
          },
          "csvPresetKey": {
            "type": "string",
            "nullable": true
          },
          "pdfPresetKey": {
            "type": "string",
            "nullable": true
          },
          "groupByEmployee": {
            "type": "boolean",
            "nullable": true
          },
          "employerCostAllocation": {
            "enum": [
              "FullSplit",
              "Home"
            ],
            "type": "string",
            "nullable": true
          },
          "postJournalsAsFinal": {
            "type": "boolean",
            "nullable": true
          },
          "accountCodeSeparator": {
            "type": "string",
            "nullable": true
          },
          "unmappedPayElementAccountCode": {
            "type": "string",
            "nullable": true
          },
          "replaceExportOptions": {
            "type": "boolean",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Journal_UpdateSplitDimensionRequest": {
        "type": "object",
        "properties": {
          "source": {
            "enum": [
              "None",
              "Department",
              "TagGroup",
              "NiCategoryLetter",
              "StudentLoanPlan",
              "DirectorStatus",
              "LineDescription"
            ],
            "type": "string",
            "nullable": true
          },
          "tagGroupKey": {
            "type": "string",
            "nullable": true
          },
          "tagName": {
            "type": "string",
            "nullable": true
          },
          "displayName": {
            "type": "string",
            "nullable": true
          },
          "accountCodePlacement": {
            "enum": [
              "None",
              "Suffix",
              "Prefix",
              "Whole"
            ],
            "type": "string",
            "nullable": true
          },
          "fallbackTagGroupKey": {
            "type": "string",
            "nullable": true
          },
          "fallbackTagName": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Journal_UpsertOrgJournalSettingsRequest": {
        "type": "object",
        "properties": {
          "pdfOptions": {
            "$ref": "#/components/schemas/Journal_JournalPdfOptions"
          },
          "csvOptions": {
            "$ref": "#/components/schemas/Journal_JournalCsvOptions"
          },
          "csvPresetKey": {
            "type": "string",
            "nullable": true
          },
          "pdfPresetKey": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Journal_ValidationIssue": {
        "type": "object",
        "properties": {
          "field": {
            "type": "string"
          },
          "reason": {
            "type": "string"
          },
          "reasonToken": {
            "type": "string"
          },
          "reasonTokenArguments": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Journal_ValidationIssueArgument"
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Journal_ValidationIssueArgument": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string"
          },
          "value": {
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Report_ApiErrorResponse": {
        "required": [
          "message"
        ],
        "type": "object",
        "properties": {
          "message": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Report_MessageWithTokenResponse"
              }
            ]
          },
          "validationIssues": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Report_ValidationIssue"
            },
            "nullable": true
          }
        }
      },
      "Report_Column": {
        "required": [
          "name",
          "type"
        ],
        "type": "object",
        "properties": {
          "name": {
            "type": "string"
          },
          "type": {
            "type": "string"
          }
        }
      },
      "Report_ComparedPayRun": {
        "required": [
          "period",
          "year"
        ],
        "type": "object",
        "properties": {
          "year": {
            "type": "integer",
            "format": "int32"
          },
          "period": {
            "type": "integer",
            "format": "int32"
          }
        },
        "description": "The pay run of the same pay schedule a comparison report compared with (evolution 0056)."
      },
      "Report_CreateExportRequest": {
        "type": "object",
        "properties": {
          "definitionId": {
            "type": "string",
            "nullable": true
          },
          "definition": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Report_ReportDefinition"
              }
            ],
            "description": "The report-definition document: one contract drives sync runs, exports, saved definitions and schedules. select holds 1 to 50 entries.",
            "nullable": true
          },
          "format": {
            "enum": [
              "CSV",
              "JSONL"
            ],
            "type": "string",
            "default": "CSV"
          }
        },
        "description": "Exactly one of definitionId (saved) or definition (inline)."
      },
      "Report_CreateScheduleRequest": {
        "required": [
          "cron",
          "delivery"
        ],
        "type": "object",
        "properties": {
          "cron": {
            "type": "string",
            "description": "5-field cron expression"
          },
          "delivery": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Report_Delivery"
              }
            ]
          },
          "timezone": {
            "type": "string",
            "default": "Europe/London"
          },
          "format": {
            "enum": [
              "CSV",
              "JSONL"
            ],
            "type": "string",
            "default": "CSV"
          }
        }
      },
      "Report_Dataset": {
        "required": [
          "description",
          "fields",
          "name"
        ],
        "type": "object",
        "properties": {
          "name": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "fields": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Report_DatasetField"
            }
          },
          "runsOnPayRun": {
            "type": "boolean",
            "description": "A report on it can run on a pay run or its pay schedule (runsOn)",
            "default": false
          },
          "comparesEmployees": {
            "type": "boolean",
            "description": "A comparison report on it may list employees one by one; on any other it groups",
            "default": false
          }
        }
      },
      "Report_DatasetField": {
        "required": [
          "aggregatable",
          "filterable",
          "groupable",
          "name",
          "sensitive",
          "type"
        ],
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "description": "Field name; dotted names (employee.department) reach related entities"
          },
          "type": {
            "type": "string",
            "description": "string | integer | decimal | date | timestamp | boolean | tags (array of group:name:value strings; filter with contains/isNull only)"
          },
          "filterable": {
            "type": "boolean"
          },
          "groupable": {
            "type": "boolean"
          },
          "aggregatable": {
            "type": "array",
            "items": {
              "enum": [
                "sum",
                "avg",
                "min",
                "max",
                "count"
              ],
              "type": "string"
            },
            "description": "Aggregations this field supports"
          },
          "sensitive": {
            "type": "boolean",
            "description": "Access is recorded in the run audit trail"
          },
          "payRunKey": {
            "type": "boolean",
            "description": "The pay run itself (tax year, pay schedule, year, period, frequency): a report that runs on a pay run takes it from where it is opened and cannot filter on it",
            "default": false
          }
        }
      },
      "Report_DatasetListResponse": {
        "required": [
          "datasets"
        ],
        "type": "object",
        "properties": {
          "datasets": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Report_DatasetSummary"
            }
          }
        }
      },
      "Report_DatasetSummary": {
        "required": [
          "description",
          "name"
        ],
        "type": "object",
        "properties": {
          "name": {
            "type": "string"
          },
          "description": {
            "type": "string"
          }
        }
      },
      "Report_DefinitionListResponse": {
        "required": [
          "definitions"
        ],
        "type": "object",
        "properties": {
          "definitions": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Report_DefinitionResponse"
            }
          }
        }
      },
      "Report_DefinitionResponse": {
        "required": [
          "createdAt",
          "definition",
          "definitionId",
          "name",
          "updatedAt"
        ],
        "type": "object",
        "properties": {
          "definitionId": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "description": {
            "type": "string",
            "nullable": true
          },
          "definition": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Report_ReportDefinition"
              }
            ],
            "description": "The report-definition document: one contract drives sync runs, exports, saved definitions and schedules. select holds 1 to 50 entries."
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time"
          },
          "builtIn": {
            "type": "boolean",
            "description": "A report the platform provides: read-only; duplicate it to make your own.",
            "default": false
          },
          "version": {
            "type": "integer",
            "description": "A built-in report's version; null for the organisation's own.",
            "format": "int32",
            "nullable": true
          }
        }
      },
      "Report_Delivery": {
        "type": "object",
        "properties": {
          "webhookUrl": {
            "type": "string",
            "description": "Deprecated as input: subscribe a Webhooks API endpoint to report_export.completed instead, which is signed, retried for three days and links to the run rather than carrying a download link. Until 30 December 2026 a schedule with a webhookUrl still receives the legacy X-Flow-Signature POST; after that the field is ignored on input and no longer returned",
            "nullable": true,
            "deprecated": true
          },
          "emails": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Primary (To) recipients of the report-ready email",
            "nullable": true
          },
          "cc": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Cc recipients of the report-ready email",
            "nullable": true
          },
          "bcc": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Bcc recipients of the report-ready email",
            "nullable": true
          }
        }
      },
      "Report_ExportResponse": {
        "required": [
          "exportId",
          "requestedAt",
          "status"
        ],
        "type": "object",
        "properties": {
          "exportId": {
            "type": "string"
          },
          "status": {
            "enum": [
              "QUEUED",
              "RUNNING",
              "COMPLETED",
              "FAILED"
            ],
            "type": "string"
          },
          "format": {
            "type": "string",
            "nullable": true
          },
          "rowCount": {
            "type": "integer",
            "format": "int64",
            "nullable": true
          },
          "downloadUrl": {
            "type": "string",
            "description": "Signed download link, 12-hour expiry; refetch this resource to re-issue",
            "nullable": true
          },
          "expiresAt": {
            "type": "string",
            "description": "When the download link stops working",
            "format": "date-time",
            "nullable": true
          },
          "error": {
            "type": "string",
            "nullable": true
          },
          "requestedAt": {
            "type": "string",
            "format": "date-time"
          },
          "completedAt": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "requestedBy": {
            "type": "string",
            "description": "Who started it: the principal id it was recorded with (`USER#…`, `M2M#…`)",
            "nullable": true
          },
          "downloadUnavailable": {
            "type": "string",
            "description": "Why this caller gets no download link although the file is there",
            "nullable": true
          }
        }
      },
      "Report_FilterNode": {
        "type": "object",
        "properties": {
          "and": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Report_FilterNode"
            },
            "nullable": true
          },
          "or": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Report_FilterNode"
            },
            "nullable": true
          },
          "not": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Report_FilterNode"
              }
            ],
            "description": "Filter tree node: exactly one of and/or/not (branch, nesting depth at most 3) or field+op (leaf). value must match the field's type as GET /datasets/{name} lists it.",
            "nullable": true
          },
          "field": {
            "type": "string",
            "nullable": true
          },
          "op": {
            "enum": [
              "eq",
              "neq",
              "in",
              "gt",
              "gte",
              "lt",
              "lte",
              "between",
              "contains",
              "isNull",
              "inPeriod"
            ],
            "type": "string",
            "nullable": true
          },
          "value": {
            "description": "Scalar, or array for in/between; omitted for isNull; a relative-period token (@currentWeek, @currentMonth, @currentTaxYear) for inPeriod on a date field",
            "nullable": true
          }
        },
        "description": "Filter tree node: exactly one of and/or/not (branch, nesting depth at most 3) or field+op (leaf). value must match the field's type as GET /datasets/{name} lists it."
      },
      "Report_MessageWithTokenResponse": {
        "required": [
          "text",
          "token"
        ],
        "type": "object",
        "properties": {
          "text": {
            "type": "string"
          },
          "token": {
            "type": "string"
          },
          "tokenArguments": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Report_ValidationIssueArgument"
            },
            "nullable": true
          }
        }
      },
      "Report_OrderBy": {
        "required": [
          "field"
        ],
        "type": "object",
        "properties": {
          "field": {
            "type": "string",
            "description": "A selected field or aggregation alias"
          },
          "direction": {
            "enum": [
              "asc",
              "desc"
            ],
            "type": "string",
            "default": "asc"
          }
        }
      },
      "Report_PayRunAlertDetail": {
        "required": [
          "code",
          "employees",
          "severity"
        ],
        "type": "object",
        "properties": {
          "code": {
            "type": "string",
            "description": "The alert, as NeoPayroll's API names it (e.g. NationalMinimumWageBreach)."
          },
          "severity": {
            "type": "string",
            "description": "Info, Warning or Error."
          },
          "employees": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Report_PayslipAlertEmployee"
            },
            "description": "Each employee whose payslip carries it, in name order."
          }
        },
        "description": "One alert code and severity on the pay run."
      },
      "Report_PayRunAlertDetails": {
        "required": [
          "groups"
        ],
        "type": "object",
        "properties": {
          "groups": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Report_PayRunAlertDetail"
            },
            "description": "One per alert code and severity, by code then severity."
          }
        },
        "description": "A pay run's payslip alerts, each code and severity with the employees it is on."
      },
      "Report_PayRunAlertGroup": {
        "required": [
          "code",
          "payslips",
          "severity"
        ],
        "type": "object",
        "properties": {
          "code": {
            "type": "string",
            "description": "The alert, e.g. MissingBankAccount."
          },
          "severity": {
            "type": "string",
            "description": "Info, Warning or Error."
          },
          "payslips": {
            "type": "integer",
            "description": "How many of the run's payslips carry it at that severity.",
            "format": "int32"
          }
        },
        "description": "The payslips of the run carrying one alert at one severity."
      },
      "Report_PayRunBalances": {
        "required": [
          "apprenticeshipLevyAllowance",
          "employmentAllowance"
        ],
        "type": "object",
        "properties": {
          "employmentAllowance": {
            "type": "number",
            "description": "Employment allowance claimed against the run's employer National Insurance.",
            "format": "double"
          },
          "apprenticeshipLevyAllowance": {
            "type": "number",
            "description": "Apprenticeship levy allowance used by the run.",
            "format": "double"
          }
        },
        "description": "The run's own balances, recorded when it completes."
      },
      "Report_PayRunPayslipIdentities": {
        "required": [
          "items"
        ],
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Report_PayslipIdentity"
            },
            "description": "One per payslip, in name order."
          }
        },
        "description": "Who each payslip on a pay run is for, by every identifier a file of lines may name them by."
      },
      "Report_PayRunPayslipMatch": {
        "required": [
          "employeeId"
        ],
        "type": "object",
        "properties": {
          "employeeId": {
            "type": "string",
            "description": "The employee, as NeoPayroll identifies them."
          },
          "firstName": {
            "type": "string",
            "description": "First name as on the payslip.",
            "nullable": true
          },
          "lastName": {
            "type": "string",
            "description": "Last name as on the payslip.",
            "nullable": true
          }
        },
        "description": "Who a matching payslip is for."
      },
      "Report_PayRunPayslipMatches": {
        "required": [
          "items",
          "matching"
        ],
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Report_PayRunPayslipMatch"
            },
            "description": "Who each payslip is for, in name order."
          },
          "matching": {
            "type": "integer",
            "description": "How many match.",
            "format": "int32"
          }
        },
        "description": "Every payslip of a pay run that matches a search and filters, for an action on all of them."
      },
      "Report_PayRunPayslipPage": {
        "required": [
          "items",
          "matching"
        ],
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Report_PayRunPayslipRow"
            },
            "description": "The payslips on this page."
          },
          "nextCursor": {
            "type": "string",
            "description": "Send as `after` for the next page; null on the last page.",
            "nullable": true
          },
          "matching": {
            "type": "integer",
            "description": "How many of the run's payslips match the search and filters.",
            "format": "int32"
          }
        },
        "description": "A page of a pay run's payslips, in the order asked, with how many match in all."
      },
      "Report_PayRunPayslipRow": {
        "required": [
          "alerts",
          "employeeId",
          "gross",
          "isLeaver",
          "isPaymentAfterLeaving",
          "lockCycle",
          "net",
          "status"
        ],
        "type": "object",
        "properties": {
          "employeeId": {
            "type": "string",
            "description": "The employee, as NeoPayroll identifies them; open the payslip with it."
          },
          "firstName": {
            "type": "string",
            "description": "First name as on the payslip.",
            "nullable": true
          },
          "lastName": {
            "type": "string",
            "description": "Last name as on the payslip.",
            "nullable": true
          },
          "payrollId": {
            "type": "string",
            "description": "Payroll ID as on the payslip.",
            "nullable": true
          },
          "status": {
            "type": "string",
            "description": "PREVIEW, FINAL or REOPENED."
          },
          "lockCycle": {
            "type": "integer",
            "description": "The lock cycle the payslip is on.",
            "format": "int32"
          },
          "gross": {
            "type": "number",
            "description": "Gross pay.",
            "format": "double"
          },
          "net": {
            "type": "number",
            "description": "Net pay.",
            "format": "double"
          },
          "isEmpty": {
            "type": "boolean",
            "description": "No figures at all, as NeoPayroll judges them; null where the payslip has none.",
            "nullable": true
          },
          "isLeaver": {
            "type": "boolean",
            "description": "The employee has a leaving date."
          },
          "isPaymentAfterLeaving": {
            "type": "boolean",
            "description": "The payslip pays the employee after their leaving date."
          },
          "alerts": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Report_PayslipAlertBadge"
            },
            "description": "The payslip's alerts, one per code and severity."
          },
          "lastEmailedAt": {
            "type": "string",
            "description": "When the payslip was last emailed.",
            "format": "date-time",
            "nullable": true
          },
          "lastEmailedStatus": {
            "type": "string",
            "description": "Sent or Failed; null while never emailed.",
            "nullable": true
          },
          "lastEmailedTo": {
            "type": "string",
            "description": "Who it was emailed to.",
            "nullable": true
          },
          "lastEmailedBy": {
            "type": "string",
            "description": "Who sent it.",
            "nullable": true
          },
          "lastEmailError": {
            "type": "string",
            "description": "Why the last email failed, as the notification service words it.",
            "nullable": true
          },
          "updatedDate": {
            "type": "string",
            "description": "The payslip's last change; send it back as consistentWithUpdatedDate after a save.",
            "format": "date-time",
            "nullable": true
          }
        },
        "description": "One payslip as the pay run's lists show it."
      },
      "Report_PayRunPayslipSummary": {
        "required": [
          "alerts",
          "counts",
          "frequency",
          "nationalMinimumWageShortfall",
          "payrollConfigId",
          "period",
          "totals",
          "year"
        ],
        "type": "object",
        "properties": {
          "payrollConfigId": {
            "type": "string",
            "description": "The pay schedule."
          },
          "year": {
            "type": "integer",
            "description": "The tax year the run starts in, e.g. 2026 for 2026-27.",
            "format": "int32"
          },
          "period": {
            "type": "integer",
            "description": "The period within the tax year.",
            "format": "int32"
          },
          "frequency": {
            "type": "string",
            "description": "The pay frequency, e.g. MONTHLY."
          },
          "counts": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Report_PayRunSummaryCounts"
              }
            ],
            "description": "How many payslips, by what they are."
          },
          "totals": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Report_PayRunSummaryTotals"
              }
            ],
            "description": "Every figure, summed over the run's payslips."
          },
          "alerts": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Report_PayRunAlertGroup"
            },
            "description": "The payslips carrying each alert, one entry per alert code and severity."
          },
          "nationalMinimumWageShortfall": {
            "type": "number",
            "description": "The minimum wage shortfall across the run's breaches, unrounded: (required rate - rate paid) x hours for each.",
            "format": "double"
          },
          "balances": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Report_PayRunBalances"
              }
            ],
            "description": "The run's own balances, which no payslip carries; null until the run has completed and they are recorded.",
            "nullable": true
          },
          "asOf": {
            "type": "string",
            "description": "The latest payslip change the figures include; null for a run with no payslips.",
            "format": "date-time",
            "nullable": true
          }
        },
        "description": "One pay run's figures, counts and alerts, as its payslips stand in the read model: the sum of every payslip, kept as each payslip is written, so it answers in one lookup however many employees the run pays."
      },
      "Report_PayRunReportPage": {
        "required": [
          "columns",
          "rows",
          "statusScope"
        ],
        "type": "object",
        "properties": {
          "columns": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Report_Column"
            },
            "description": "The report's columns, in the order of each row's values"
          },
          "rows": {
            "type": "array",
            "items": {
              "type": "array",
              "items": {}
            },
            "description": "At most limit rows, each one value per column"
          },
          "nextCursor": {
            "type": "string",
            "description": "Pass as after for the next page; null on the last page",
            "nullable": true
          },
          "totals": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Report_PayRunReportTotals"
              }
            ],
            "description": "On the first page only (no after): every row of the run counted and its money summed",
            "nullable": true
          },
          "statusScope": {
            "type": "string",
            "description": "Which payslip statuses the report read: ALL unless it filters status itself"
          },
          "comparedWith": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Report_ComparedPayRun"
              }
            ],
            "description": "For a comparison report, the pay run it compared with; null when there was none before",
            "nullable": true
          }
        },
        "description": "One page of a report over one pay run, in the report's own order (evolution 0055)."
      },
      "Report_PayRunReportPayslips": {
        "required": [
          "items"
        ],
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {},
            "description": "Each payslip as NeoPayroll's API answers it, cut to what the reports read: employee details, employer name, the period's figures and the lines. In name order."
          },
          "nextCursor": {
            "type": "string",
            "description": "Send as `after` for the next page; null on the last page.",
            "nullable": true
          }
        },
        "description": "A page of a pay run's payslips as the wizard's reports read them."
      },
      "Report_PayRunReportSettings": {
        "required": [
          "definitionIds",
          "definitions",
          "isDefault"
        ],
        "type": "object",
        "properties": {
          "definitionIds": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Built-in and saved report definitions, in the order shown."
          },
          "isDefault": {
            "type": "boolean",
            "description": "Nothing has been chosen: every built-in report, in their order."
          },
          "definitions": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Report_DefinitionResponse"
            },
            "description": "The reports shown, in the order shown: what the Reports step draws, so it needs no list of every report (which asks `report:read`). A report that no longer exists is left out."
          }
        },
        "description": "The reports the pay run's Reports step shows, in order, for everyone in the organisation."
      },
      "Report_PayRunReportTotals": {
        "required": [
          "rowCount",
          "values"
        ],
        "type": "object",
        "properties": {
          "rowCount": {
            "type": "integer",
            "description": "Every row the report has for the pay run",
            "format": "int64"
          },
          "values": {
            "type": "array",
            "items": {},
            "description": "One per column: the sum of a money column (a plain amount or a sum), null for any other"
          }
        }
      },
      "Report_PayRunSummaryCounts": {
        "required": [
          "emailFailed",
          "emailed",
          "empty",
          "final",
          "leavers",
          "paymentsAfterLeaving",
          "payslips",
          "preview",
          "reopened",
          "withAlerts"
        ],
        "type": "object",
        "properties": {
          "payslips": {
            "type": "integer",
            "description": "Every payslip on the run.",
            "format": "int32"
          },
          "final": {
            "type": "integer",
            "description": "Payslips issued by the run's lock.",
            "format": "int32"
          },
          "reopened": {
            "type": "integer",
            "description": "Issued payslips whose run was unlocked to correct them.",
            "format": "int32"
          },
          "preview": {
            "type": "integer",
            "description": "Payslips not yet issued.",
            "format": "int32"
          },
          "empty": {
            "type": "integer",
            "description": "Payslips with no figures at all, as NeoPayroll judges them: hidden by \"Hide £0 payslips\".",
            "format": "int32"
          },
          "leavers": {
            "type": "integer",
            "description": "Payslips of employees with a leaving date.",
            "format": "int32"
          },
          "paymentsAfterLeaving": {
            "type": "integer",
            "description": "Payslips paying an employee after their leaving date.",
            "format": "int32"
          },
          "emailed": {
            "type": "integer",
            "description": "Payslips emailed as they now stand: the version emailed is the current one and the send did not fail.",
            "format": "int32"
          },
          "emailFailed": {
            "type": "integer",
            "description": "Payslips whose last email failed.",
            "format": "int32"
          },
          "withAlerts": {
            "type": "integer",
            "description": "Payslips carrying at least one alert.",
            "format": "int32"
          }
        },
        "description": "How many of the run's payslips are of each kind."
      },
      "Report_PayRunSummaryTotals": {
        "required": [
          "apprenticeshipLevy",
          "employeeNi",
          "employeePension",
          "employerClass1ANi",
          "employerNi",
          "employerPension",
          "employerPensionRefundsByType",
          "gross",
          "grossForEmployerClass1ANi",
          "grossForEmployerNi",
          "grossNi",
          "grossPensionable",
          "grossTaxable",
          "net",
          "netDeductions",
          "pensionByType",
          "pensionRefundsByType",
          "postgraduateLoan",
          "statutory",
          "statutoryRecovery",
          "studentLoan",
          "tax",
          "totalEmployerCost",
          "totalPayable"
        ],
        "type": "object",
        "properties": {
          "gross": {
            "type": "number",
            "description": "Gross pay.",
            "format": "double"
          },
          "grossTaxable": {
            "type": "number",
            "description": "Gross pay for tax.",
            "format": "double"
          },
          "grossNi": {
            "type": "number",
            "description": "Gross pay for National Insurance.",
            "format": "double"
          },
          "grossPensionable": {
            "type": "number",
            "description": "Pensionable pay.",
            "format": "double"
          },
          "grossForEmployerNi": {
            "type": "number",
            "description": "Gross pay for employer National Insurance.",
            "format": "double"
          },
          "grossForEmployerClass1ANi": {
            "type": "number",
            "description": "Gross pay for employer Class 1A National Insurance.",
            "format": "double"
          },
          "tax": {
            "type": "number",
            "description": "PAYE.",
            "format": "double"
          },
          "employeeNi": {
            "type": "number",
            "description": "Employee National Insurance.",
            "format": "double"
          },
          "employerNi": {
            "type": "number",
            "description": "Employer National Insurance.",
            "format": "double"
          },
          "employerClass1ANi": {
            "type": "number",
            "description": "Employer Class 1A National Insurance.",
            "format": "double"
          },
          "employeePension": {
            "type": "number",
            "description": "Employee pension contributions.",
            "format": "double"
          },
          "employerPension": {
            "type": "number",
            "description": "Employer pension contributions.",
            "format": "double"
          },
          "studentLoan": {
            "type": "number",
            "description": "Student loan deductions.",
            "format": "double"
          },
          "postgraduateLoan": {
            "type": "number",
            "description": "Postgraduate loan deductions.",
            "format": "double"
          },
          "net": {
            "type": "number",
            "description": "Net pay.",
            "format": "double"
          },
          "netDeductions": {
            "type": "number",
            "description": "Deductions from net pay.",
            "format": "double"
          },
          "totalPayable": {
            "type": "number",
            "description": "Pay due to employees.",
            "format": "double"
          },
          "totalEmployerCost": {
            "type": "number",
            "description": "The employer's cost.",
            "format": "double"
          },
          "apprenticeshipLevy": {
            "type": "number",
            "description": "Apprenticeship levy.",
            "format": "double"
          },
          "statutory": {
            "type": "object",
            "additionalProperties": {
              "type": "number",
              "format": "double"
            },
            "description": "Statutory pay by type, e.g. StatutorySickPay."
          },
          "statutoryRecovery": {
            "type": "object",
            "additionalProperties": {
              "type": "object",
              "additionalProperties": {
                "type": "number",
                "format": "double"
              }
            },
            "description": "What can be recovered of each type of statutory pay, figure by figure."
          },
          "pensionByType": {
            "type": "object",
            "additionalProperties": {
              "type": "number",
              "format": "double"
            },
            "description": "Pension contributions by type, e.g. ReliefAtSource."
          },
          "pensionRefundsByType": {
            "type": "object",
            "additionalProperties": {
              "type": "number",
              "format": "double"
            },
            "description": "Employee pension refunds by type."
          },
          "employerPensionRefundsByType": {
            "type": "object",
            "additionalProperties": {
              "type": "number",
              "format": "double"
            },
            "description": "Employer pension refunds by type."
          }
        },
        "description": "Every figure summed over the run's payslips, unrounded beyond the pennies each payslip holds."
      },
      "Report_PayslipAlertBadge": {
        "required": [
          "code",
          "severity"
        ],
        "type": "object",
        "properties": {
          "code": {
            "type": "string",
            "description": "The alert, e.g. MissingBankAccount."
          },
          "severity": {
            "type": "string",
            "description": "Info, Warning or Error."
          }
        },
        "description": "One alert on a payslip."
      },
      "Report_PayslipAlertEmployee": {
        "required": [
          "employeeId"
        ],
        "type": "object",
        "properties": {
          "employeeId": {
            "type": "string",
            "description": "The employee, as NeoPayroll identifies them."
          },
          "firstName": {
            "type": "string",
            "description": "First name as on the payslip.",
            "nullable": true
          },
          "lastName": {
            "type": "string",
            "description": "Last name as on the payslip.",
            "nullable": true
          },
          "context": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            },
            "description": "The alert's details as NeoPayroll's payslip answers them (e.g. the minimum wage shortfall).",
            "nullable": true
          }
        },
        "description": "An employee whose payslip carries an alert, with the alert's own details."
      },
      "Report_PayslipIdentity": {
        "required": [
          "employeeId"
        ],
        "type": "object",
        "properties": {
          "employeeId": {
            "type": "string",
            "description": "The employee, as NeoPayroll identifies them."
          },
          "firstName": {
            "type": "string",
            "description": "First name as on the payslip.",
            "nullable": true
          },
          "lastName": {
            "type": "string",
            "description": "Last name as on the payslip.",
            "nullable": true
          },
          "email": {
            "type": "string",
            "description": "Email as on the payslip.",
            "nullable": true
          },
          "employeeCode": {
            "type": "string",
            "description": "Employee code as on the payslip.",
            "nullable": true
          },
          "payrollId": {
            "type": "string",
            "description": "Payroll ID as on the payslip.",
            "nullable": true
          },
          "nationalInsuranceNumber": {
            "type": "string",
            "description": "NI number as on the payslip.",
            "nullable": true
          }
        },
        "description": "An employee on the pay run as the payslip names them. An identifier the caller may not read is null: email and employee code need employee details, payroll ID and NI number payroll details."
      },
      "Report_ReportDefinition": {
        "required": [
          "dataset",
          "select"
        ],
        "type": "object",
        "properties": {
          "dataset": {
            "type": "string",
            "description": "A dataset name from GET /datasets"
          },
          "select": {
            "maxItems": 50,
            "minItems": 1,
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Report_SelectEntry"
            }
          },
          "filters": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Report_FilterNode"
              }
            ],
            "description": "Filter tree node: exactly one of and/or/not (branch, nesting depth at most 3) or field+op (leaf). value must match the field's type as GET /datasets/{name} lists it.",
            "nullable": true
          },
          "groupBy": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Required iff any select entry aggregates; every plain select entry must appear here, referenced by field name or alias",
            "nullable": true
          },
          "orderBy": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Report_OrderBy"
            },
            "nullable": true
          },
          "limit": {
            "type": "integer",
            "description": "Clamped to 10,000 (sync) / 5,000,000 (export)",
            "format": "int32",
            "nullable": true
          },
          "runsOn": {
            "enum": [
              "payRun",
              "paySchedule"
            ],
            "type": "string",
            "description": "payRun: the report runs on the pay run it is opened from, its keys never a filter; paySchedule: on that pay run's pay schedule over its tax year and the one before. Left out: whatever its filters say.",
            "nullable": true
          }
        },
        "description": "The report-definition document: one contract drives sync runs, exports, saved definitions and schedules. select holds 1 to 50 entries."
      },
      "Report_RunListResponse": {
        "required": [
          "runs"
        ],
        "type": "object",
        "properties": {
          "runs": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Report_RunSummary"
            }
          }
        }
      },
      "Report_RunReportResponse": {
        "required": [
          "columns",
          "executionMs",
          "rowCount",
          "rows",
          "runId",
          "statusScope",
          "truncated"
        ],
        "type": "object",
        "properties": {
          "runId": {
            "type": "string"
          },
          "columns": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Report_Column"
            }
          },
          "rows": {
            "type": "array",
            "items": {
              "type": "array",
              "items": {}
            }
          },
          "rowCount": {
            "type": "integer",
            "format": "int32"
          },
          "truncated": {
            "type": "boolean",
            "description": "true → the sync row cap was hit; use an export"
          },
          "statusScope": {
            "type": "string",
            "description": "Which payslip statuses applied: FINAL (implicit default) | PREVIEW | REOPENED | ALL"
          },
          "executionMs": {
            "type": "integer",
            "format": "int64"
          },
          "comparedWith": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Report_ComparedPayRun"
              }
            ],
            "description": "For a comparison report run on a pay run, the pay run it compared with",
            "nullable": true
          }
        }
      },
      "Report_RunSummary": {
        "required": [
          "mode",
          "requestedAt",
          "runId",
          "status"
        ],
        "type": "object",
        "properties": {
          "runId": {
            "type": "string"
          },
          "definitionId": {
            "type": "string",
            "nullable": true
          },
          "mode": {
            "type": "string",
            "description": "SYNC | EXPORT | SCHEDULED"
          },
          "format": {
            "type": "string",
            "nullable": true
          },
          "status": {
            "type": "string"
          },
          "rowCount": {
            "type": "integer",
            "format": "int64",
            "nullable": true
          },
          "requestedBy": {
            "type": "string",
            "nullable": true
          },
          "requestedAt": {
            "type": "string",
            "format": "date-time"
          },
          "completedAt": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "error": {
            "type": "string",
            "nullable": true
          }
        }
      },
      "Report_SaveDefinitionRequest": {
        "required": [
          "definition",
          "name"
        ],
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "description": "Unique per organisation"
          },
          "definition": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Report_ReportDefinition"
              }
            ],
            "description": "The report-definition document: one contract drives sync runs, exports, saved definitions and schedules. select holds 1 to 50 entries."
          },
          "description": {
            "type": "string",
            "nullable": true
          }
        }
      },
      "Report_SavePayRunReportSettings": {
        "required": [
          "definitionIds"
        ],
        "type": "object",
        "properties": {
          "definitionIds": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Built-in and saved report definitions kept by pay run, at most 30."
          }
        },
        "description": "Choose the reports the pay run's Reports step shows, in order."
      },
      "Report_ScheduleListResponse": {
        "required": [
          "schedules"
        ],
        "type": "object",
        "properties": {
          "schedules": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Report_ScheduleResponse"
            }
          }
        }
      },
      "Report_ScheduleResponse": {
        "required": [
          "cron",
          "definitionId",
          "delivery",
          "enabled",
          "format",
          "nextDueAt",
          "scheduleId",
          "timezone"
        ],
        "type": "object",
        "properties": {
          "scheduleId": {
            "type": "string"
          },
          "definitionId": {
            "type": "string"
          },
          "cron": {
            "type": "string"
          },
          "timezone": {
            "type": "string"
          },
          "format": {
            "type": "string"
          },
          "delivery": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Report_Delivery"
              }
            ]
          },
          "enabled": {
            "type": "boolean"
          },
          "nextDueAt": {
            "type": "string",
            "format": "date-time"
          },
          "lastRunId": {
            "type": "string",
            "description": "The run this schedule last started; null until it has fired once",
            "nullable": true
          },
          "lastDeliveryAt": {
            "type": "string",
            "description": "When the last report was last sent to the recipients",
            "format": "date-time",
            "nullable": true
          },
          "lastDeliveryStatus": {
            "enum": [
              "DELIVERED",
              "FAILED"
            ],
            "type": "string",
            "description": "DELIVERED or FAILED; null until the schedule has fired once",
            "nullable": true
          },
          "lastDeliveryError": {
            "type": "string",
            "description": "Why the last report did not reach its recipients",
            "nullable": true
          },
          "consecutiveDeliveryFailures": {
            "type": "integer",
            "description": "Failures in a row; back to 0 on the first success",
            "format": "int32",
            "default": 0
          },
          "webhookSecret": {
            "type": "string",
            "description": "Deprecated with webhookUrl: returned exactly once, on creation, to verify the legacy X-Flow-Signature header. Endpoints created through the Webhooks API carry their own signing secrets",
            "nullable": true,
            "deprecated": true
          }
        }
      },
      "Report_SelectEntry": {
        "type": "object",
        "properties": {
          "field": {
            "type": "string",
            "nullable": true
          },
          "aggregate": {
            "enum": [
              "sum",
              "avg",
              "min",
              "max",
              "count"
            ],
            "type": "string",
            "nullable": true
          },
          "as": {
            "type": "string",
            "description": "Output column alias (required for aggregations and tag-value extractions)",
            "nullable": true
          },
          "distinct": {
            "type": "boolean",
            "default": false
          },
          "tagName": {
            "type": "string",
            "description": "Extract this tag's value from a tags field as a text column; groupable via its alias",
            "nullable": true
          },
          "tagGroup": {
            "type": "string",
            "description": "Restrict tagName extraction to one tag group; omitted matches any group",
            "nullable": true
          },
          "run": {
            "enum": [
              "current",
              "compared",
              "difference",
              "changePercent"
            ],
            "type": "string",
            "description": "In a report that runs on a pay run: current (this pay run), compared (the pay run it is compared with), difference (this minus compared) or changePercent (the difference as a percentage of compared; 100 when compared is 0 and this is not). Left out: this pay run's value, or the compared one's when the row is only there.",
            "nullable": true
          }
        },
        "description": "One select entry: a plain field ({\"field\": ...}), an aggregation ({\"aggregate\": \"sum\", \"field\": ..., \"as\": ...}), or a tag-value extraction ({\"field\": <tags field>, \"tagName\": ..., \"tagGroup\": ..., \"as\": ...} — \"as\" is required, tagGroup omitted matches any group). count needs no field; count with a field supports \"distinct\": true."
      },
      "Report_ServiceError": {
        "required": [
          "error",
          "message"
        ],
        "type": "object",
        "properties": {
          "error": {
            "type": "string"
          },
          "message": {
            "type": "string"
          }
        }
      },
      "Report_ValidationErrorDetail": {
        "required": [
          "message",
          "path"
        ],
        "type": "object",
        "properties": {
          "path": {
            "type": "string",
            "description": "JSON pointer into the offending request"
          },
          "message": {
            "type": "string"
          }
        }
      },
      "Report_ValidationErrorResponse": {
        "required": [
          "error",
          "errors"
        ],
        "type": "object",
        "properties": {
          "error": {
            "type": "string"
          },
          "errors": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Report_ValidationErrorDetail"
            }
          }
        }
      },
      "Report_ValidationIssue": {
        "required": [
          "field",
          "reason",
          "reasonToken"
        ],
        "type": "object",
        "properties": {
          "field": {
            "type": "string"
          },
          "reason": {
            "type": "string"
          },
          "reasonToken": {
            "type": "string"
          },
          "reasonTokenArguments": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Report_ValidationIssueArgument"
            },
            "nullable": true
          }
        }
      },
      "Report_ValidationIssueArgument": {
        "required": [
          "name"
        ],
        "type": "object",
        "properties": {
          "name": {
            "type": "string"
          },
          "value": {
            "nullable": true
          }
        }
      },
      "Webhooks_AddressDto": {
        "type": "object",
        "properties": {
          "line1": {
            "type": "string",
            "nullable": true
          },
          "line2": {
            "type": "string",
            "nullable": true
          },
          "city": {
            "type": "string",
            "nullable": true
          },
          "county": {
            "type": "string",
            "nullable": true
          },
          "postcode": {
            "type": "string",
            "nullable": true
          },
          "countryCode": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Webhooks_AlertContactsChangeRequest": {
        "type": "object",
        "properties": {
          "emails": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        },
        "additionalProperties": false
      },
      "Webhooks_AlertContactsResponse": {
        "type": "object",
        "properties": {
          "scope": {
            "enum": [
              "Organisation",
              "Customer"
            ],
            "type": "string"
          },
          "ownerId": {
            "type": "string"
          },
          "emails": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "effective": {
            "$ref": "#/components/schemas/Webhooks_EffectiveAlertContactsResponse"
          }
        },
        "additionalProperties": false
      },
      "Webhooks_AlertContactsResponseContentResponse": {
        "type": "object",
        "properties": {
          "data": {
            "$ref": "#/components/schemas/Webhooks_AlertContactsResponse"
          },
          "metadata": {
            "$ref": "#/components/schemas/Webhooks_ContentMetadataResponse"
          }
        },
        "additionalProperties": false
      },
      "Webhooks_AlertContactsResponseResponseBody": {
        "type": "object",
        "properties": {
          "message": {
            "$ref": "#/components/schemas/Webhooks_MessageWithTokenResponse"
          },
          "content": {
            "$ref": "#/components/schemas/Webhooks_AlertContactsResponseContentResponse"
          },
          "validationIssues": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Webhooks_ValidationIssue"
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Webhooks_ApiErrorResponse": {
        "type": "object",
        "properties": {
          "message": {
            "$ref": "#/components/schemas/Webhooks_MessageWithTokenResponse"
          },
          "validationIssues": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Webhooks_ValidationIssue"
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Webhooks_AttachmentResponseDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "lineItemId": {
            "type": "string"
          },
          "filename": {
            "type": "string"
          },
          "contentType": {
            "type": "string"
          },
          "fileSize": {
            "type": "integer",
            "format": "int64"
          },
          "uploadedDate": {
            "type": "string",
            "format": "date-time"
          },
          "uploadedBy": {
            "type": "string"
          },
          "downloadUrl": {
            "type": "string",
            "format": "uri"
          },
          "downloadUrlExpiresAt": {
            "type": "string",
            "format": "date-time"
          },
          "s3Key": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Webhooks_AttachmentUploadResponseDto": {
        "type": "object",
        "properties": {
          "attachmentId": {
            "type": "string"
          },
          "filename": {
            "type": "string"
          },
          "uploadUrl": {
            "type": "string",
            "format": "uri"
          },
          "expiresAt": {
            "type": "string",
            "format": "date-time"
          },
          "method": {
            "type": "string"
          },
          "headers": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            }
          }
        },
        "additionalProperties": false
      },
      "Webhooks_BACSPaymentConfigResponse": {
        "required": [
          "accountNumber",
          "sortCode"
        ],
        "type": "object",
        "properties": {
          "sortCode": {
            "type": "string"
          },
          "accountNumber": {
            "type": "string"
          },
          "serviceUserNumber": {
            "type": "string",
            "nullable": true
          },
          "accountName": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Webhooks_BankAccountDto": {
        "required": [
          "accountNumber",
          "sortCode"
        ],
        "type": "object",
        "properties": {
          "accountNumber": {
            "minLength": 1,
            "type": "string"
          },
          "sortCode": {
            "minLength": 1,
            "type": "string"
          },
          "accountHolderName": {
            "type": "string"
          },
          "isPrimaryPayrollAccount": {
            "type": "boolean"
          },
          "allocationPercentage": {
            "type": "integer",
            "format": "int32"
          }
        },
        "additionalProperties": false
      },
      "Webhooks_BaseValuesDto": {
        "type": "object",
        "properties": {
          "gross": {
            "type": "number",
            "format": "double"
          },
          "grossTaxable": {
            "type": "number",
            "format": "double"
          },
          "grossNi": {
            "type": "number",
            "format": "double"
          },
          "grossForEmployerNi": {
            "type": "number",
            "format": "double"
          },
          "grossForEmployerClass1ANi": {
            "type": "number",
            "format": "double"
          },
          "grossPensionable": {
            "type": "number",
            "format": "double"
          },
          "grossForCourtOrders": {
            "type": "number",
            "format": "double"
          },
          "tax": {
            "type": "number",
            "format": "double"
          },
          "ni": {
            "type": "number",
            "format": "double"
          },
          "pension": {
            "type": "number",
            "format": "double"
          },
          "employerNi": {
            "type": "number",
            "format": "double"
          },
          "employerClass1ANI": {
            "type": "number",
            "format": "double"
          },
          "employerPension": {
            "type": "number",
            "format": "double"
          },
          "studentLoan": {
            "type": "number",
            "format": "double"
          },
          "postgraduateLoan": {
            "type": "number",
            "format": "double"
          },
          "net": {
            "type": "number",
            "format": "double"
          },
          "netDeductions": {
            "type": "number",
            "format": "double"
          },
          "totalPayable": {
            "type": "number",
            "format": "double"
          },
          "totalEmployerCost": {
            "type": "number",
            "format": "double"
          },
          "niBand": {
            "type": "object",
            "additionalProperties": {
              "$ref": "#/components/schemas/Webhooks_NiCalculationResultDto"
            },
            "nullable": true
          },
          "statutory": {
            "type": "object",
            "additionalProperties": {
              "type": "number",
              "format": "double"
            },
            "nullable": true
          },
          "pensionContributionsByType": {
            "type": "object",
            "additionalProperties": {
              "type": "number",
              "format": "double"
            },
            "nullable": true
          },
          "qualifyingEarningsForPension": {
            "type": "number",
            "format": "double"
          },
          "apprenticeshipLevy": {
            "type": "number",
            "format": "double"
          },
          "employmentAllowance": {
            "type": "number",
            "format": "double"
          },
          "apprenticeshipLevyAllowance": {
            "type": "number",
            "format": "double"
          },
          "statutoryRecovery": {
            "type": "object",
            "additionalProperties": {
              "$ref": "#/components/schemas/Webhooks_StatutoryPaymentsReclaimDto"
            },
            "nullable": true
          },
          "isEmpty": {
            "type": "boolean",
            "nullable": true
          },
          "pensionRefundsByType": {
            "type": "object",
            "additionalProperties": {
              "type": "number",
              "format": "double"
            },
            "nullable": true
          },
          "employerPensionRefundsByType": {
            "type": "object",
            "additionalProperties": {
              "type": "number",
              "format": "double"
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Webhooks_BillingClientEvent": {
        "required": [
          "clientId",
          "eventType",
          "occurredAt",
          "organisationId",
          "status"
        ],
        "type": "object",
        "properties": {
          "eventType": {
            "type": "string"
          },
          "organisationId": {
            "type": "string"
          },
          "clientId": {
            "type": "string"
          },
          "name": {
            "type": "string",
            "nullable": true
          },
          "status": {
            "type": "string"
          },
          "vatNumber": {
            "type": "string",
            "nullable": true
          },
          "registrationNumber": {
            "type": "string",
            "nullable": true
          },
          "contacts": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Webhooks_UpdatableContactDto"
            },
            "nullable": true
          },
          "billingAddress": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/Webhooks_AddressDto"
              },
              {
                "nullable": true
              }
            ]
          },
          "physicalAddress": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/Webhooks_AddressDto"
              },
              {
                "nullable": true
              }
            ]
          },
          "occurredAt": {
            "type": "string"
          },
          "resourceUrl": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Webhooks_BillingClientEventWebhookEventEnvelope": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "type": {
            "type": "string"
          },
          "timestamp": {
            "type": "string"
          },
          "apiVersion": {
            "type": "string"
          },
          "organisationId": {
            "type": "string"
          },
          "customerId": {
            "type": "string"
          },
          "livemode": {
            "type": "boolean"
          },
          "data": {
            "$ref": "#/components/schemas/Webhooks_BillingClientEvent"
          },
          "metadata": {
            "$ref": "#/components/schemas/Webhooks_WebhookEventMetadata"
          }
        },
        "additionalProperties": false
      },
      "Webhooks_ConnectionStateChangedEvent": {
        "type": "object",
        "properties": {
          "eventType": {
            "type": "string"
          },
          "organisationId": {
            "type": "string"
          },
          "connectionId": {
            "type": "string"
          },
          "providerSlug": {
            "type": "string"
          },
          "displayName": {
            "type": "string",
            "nullable": true
          },
          "state": {
            "enum": [
              "None",
              "PendingAuth",
              "Authorised",
              "Callable",
              "Invalid",
              "Deauthorised"
            ],
            "type": "string"
          },
          "previousState": {
            "enum": [
              "None",
              "PendingAuth",
              "Authorised",
              "Callable",
              "Invalid",
              "Deauthorised"
            ],
            "type": "string"
          },
          "occurredAt": {
            "type": "string"
          },
          "resourceUrl": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Webhooks_ConnectionStateChangedEventWebhookEventEnvelope": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "type": {
            "type": "string"
          },
          "timestamp": {
            "type": "string"
          },
          "apiVersion": {
            "type": "string"
          },
          "organisationId": {
            "type": "string"
          },
          "customerId": {
            "type": "string"
          },
          "livemode": {
            "type": "boolean"
          },
          "data": {
            "$ref": "#/components/schemas/Webhooks_ConnectionStateChangedEvent"
          },
          "metadata": {
            "$ref": "#/components/schemas/Webhooks_WebhookEventMetadata"
          }
        },
        "additionalProperties": false
      },
      "Webhooks_ContactDetailsDto": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string"
          },
          "email": {
            "type": "string"
          },
          "phone": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Webhooks_ContentMetadataResponse": {
        "type": "object",
        "properties": {
          "dateFormat": {
            "type": "string"
          },
          "dateTimeFormat": {
            "type": "string"
          },
          "paginationToken": {
            "type": "string",
            "description": "Cursor for the next page, present only when more results follow and null on the last page. Pass it back unmodified to continue; it is opaque and short-lived, so do not store it.",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Webhooks_CourtOrderDeductionDetails": {
        "required": [
          "lineItemStatus",
          "payPeriodEndDate"
        ],
        "type": "object",
        "properties": {
          "payPeriodEndDate": {
            "type": "string"
          },
          "lineItemSequence": {
            "type": "integer",
            "format": "int32"
          },
          "amount": {
            "type": "number",
            "format": "double"
          },
          "expectedAmount": {
            "type": "number",
            "format": "double"
          },
          "wasReducedByProtectedEarnings": {
            "type": "boolean"
          },
          "lineItemStatus": {
            "type": "string"
          },
          "skipReason": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Webhooks_CourtOrderEligibilitySectionDto": {
        "type": "object",
        "properties": {
          "cmsDeo": {
            "type": "boolean"
          },
          "dea": {
            "type": "boolean"
          },
          "aeoPriority": {
            "type": "boolean"
          },
          "aeoNonPriority": {
            "type": "boolean"
          },
          "ctaeo": {
            "type": "boolean"
          },
          "ea": {
            "type": "boolean"
          },
          "mcaeo": {
            "type": "boolean"
          },
          "cma": {
            "type": "boolean"
          },
          "cao": {
            "type": "boolean"
          },
          "niFinesAeo": {
            "type": "boolean"
          },
          "niEjoAeo": {
            "type": "boolean"
          }
        },
        "additionalProperties": false
      },
      "Webhooks_CourtOrderEvent": {
        "required": [
          "courtOrderId",
          "employeeId",
          "eventType",
          "issuingAuthority",
          "occurredAt",
          "orderType",
          "organisationId",
          "reference",
          "startDate",
          "status"
        ],
        "type": "object",
        "properties": {
          "eventType": {
            "type": "string"
          },
          "organisationId": {
            "type": "string"
          },
          "employeeId": {
            "type": "string"
          },
          "courtOrderId": {
            "type": "string"
          },
          "orderType": {
            "type": "string"
          },
          "reference": {
            "type": "string"
          },
          "issuingAuthority": {
            "type": "string"
          },
          "status": {
            "type": "string"
          },
          "previousStatus": {
            "type": "string",
            "nullable": true
          },
          "startDate": {
            "type": "string"
          },
          "endDate": {
            "type": "string",
            "nullable": true
          },
          "totalAmountOwed": {
            "type": "number",
            "format": "double",
            "nullable": true
          },
          "amountRepaidToDate": {
            "type": "number",
            "format": "double",
            "nullable": true
          },
          "remainingBalance": {
            "type": "number",
            "format": "double",
            "nullable": true
          },
          "reason": {
            "type": "string",
            "nullable": true
          },
          "deduction": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/Webhooks_CourtOrderDeductionDetails"
              },
              {
                "nullable": true
              }
            ]
          },
          "occurredAt": {
            "type": "string"
          },
          "resourceUrl": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Webhooks_CourtOrderEventWebhookEventEnvelope": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "type": {
            "type": "string"
          },
          "timestamp": {
            "type": "string"
          },
          "apiVersion": {
            "type": "string"
          },
          "organisationId": {
            "type": "string"
          },
          "customerId": {
            "type": "string"
          },
          "livemode": {
            "type": "boolean"
          },
          "data": {
            "$ref": "#/components/schemas/Webhooks_CourtOrderEvent"
          },
          "metadata": {
            "$ref": "#/components/schemas/Webhooks_WebhookEventMetadata"
          }
        },
        "additionalProperties": false
      },
      "Webhooks_CourtOrderMetadataSectionDto": {
        "type": "object",
        "properties": {
          "protectedEarningsSetting": {
            "type": "string",
            "nullable": true
          },
          "protectedEarningsAmount": {
            "type": "number",
            "format": "double",
            "nullable": true
          },
          "shortfallCarryForward": {
            "type": "number",
            "format": "double",
            "nullable": true
          },
          "rateType": {
            "type": "string",
            "nullable": true
          },
          "adminFeeApplied": {
            "type": "boolean",
            "nullable": true
          },
          "tableType": {
            "type": "string",
            "nullable": true
          },
          "remittanceReference": {
            "type": "string",
            "nullable": true
          },
          "remittanceDeadline": {
            "type": "string",
            "nullable": true
          },
          "jurisdiction": {
            "type": "string",
            "nullable": true
          },
          "aeoCategory": {
            "type": "string",
            "nullable": true
          },
          "instructionAmount": {
            "type": "number",
            "format": "double",
            "nullable": true
          },
          "orderDate": {
            "type": "string",
            "format": "date",
            "nullable": true
          },
          "dailyRate": {
            "type": "number",
            "format": "double",
            "nullable": true
          },
          "ordinaryDebtAmount": {
            "type": "number",
            "format": "double",
            "nullable": true
          },
          "maintenanceDailyRate": {
            "type": "number",
            "format": "double",
            "nullable": true
          },
          "agreedHigherRatePercentage": {
            "type": "number",
            "format": "double",
            "nullable": true
          },
          "normalDeductionRate": {
            "type": "number",
            "format": "double",
            "nullable": true
          },
          "protectedEarningsRate": {
            "type": "number",
            "format": "double",
            "nullable": true
          },
          "ratePeriod": {
            "type": "string",
            "nullable": true
          },
          "lastDeductedPayDate": {
            "type": "string",
            "format": "date",
            "nullable": true
          },
          "startDate": {
            "type": "string",
            "format": "date",
            "nullable": true
          },
          "lastPayDate": {
            "type": "string",
            "format": "date",
            "nullable": true
          },
          "firstPayDate": {
            "type": "string",
            "format": "date",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Webhooks_CreateEndpointRequest": {
        "required": [
          "eventTypes",
          "url"
        ],
        "type": "object",
        "properties": {
          "url": {
            "type": "string"
          },
          "description": {
            "type": "string",
            "nullable": true
          },
          "eventTypes": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "payloadStyle": {
            "enum": [
              "Minimal",
              "Full",
              null
            ],
            "type": "string",
            "nullable": true
          },
          "ordering": {
            "enum": [
              "Unordered",
              "Fifo",
              null
            ],
            "type": "string",
            "nullable": true
          },
          "rateLimitPerSecond": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "organisationIds": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "nullable": true
          },
          "excludedOrganisationIds": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "nullable": true
          },
          "customHeaders": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            },
            "nullable": true
          },
          "alertContacts": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Webhooks_CreateReplayRequest": {
        "required": [
          "endDate",
          "startDate"
        ],
        "type": "object",
        "properties": {
          "endpointIds": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "nullable": true
          },
          "eventTypes": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "nullable": true
          },
          "statuses": {
            "type": "array",
            "items": {
              "enum": [
                "Pending",
                "Succeeded",
                "Failed",
                "Skipped"
              ],
              "type": "string"
            },
            "nullable": true
          },
          "includeNeverSent": {
            "type": "boolean",
            "nullable": true
          },
          "startDate": {
            "type": "string"
          },
          "endDate": {
            "type": "string"
          },
          "maxDeliveries": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Webhooks_CreatedEndpointResponse": {
        "type": "object",
        "properties": {
          "endpoint": {
            "$ref": "#/components/schemas/Webhooks_EndpointResponse"
          },
          "signingSecret": {
            "type": "string"
          },
          "publicKey": {
            "type": "string"
          }
        },
        "additionalProperties": false
      },
      "Webhooks_CreatedEndpointResponseContentResponse": {
        "type": "object",
        "properties": {
          "data": {
            "$ref": "#/components/schemas/Webhooks_CreatedEndpointResponse"
          },
          "metadata": {
            "$ref": "#/components/schemas/Webhooks_ContentMetadataResponse"
          }
        },
        "additionalProperties": false
      },
      "Webhooks_CreatedEndpointResponseResponseBody": {
        "type": "object",
        "properties": {
          "message": {
            "$ref": "#/components/schemas/Webhooks_MessageWithTokenResponse"
          },
          "content": {
            "$ref": "#/components/schemas/Webhooks_CreatedEndpointResponseContentResponse"
          },
          "validationIssues": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Webhooks_ValidationIssue"
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Webhooks_CreatedSigningSecretResponse": {
        "type": "object",
        "properties": {
          "secret": {
            "$ref": "#/components/schemas/Webhooks_SigningSecretResponse"
          },
          "signingSecret": {
            "type": "string"
          }
        },
        "additionalProperties": false
      },
      "Webhooks_CreatedSigningSecretResponseContentResponse": {
        "type": "object",
        "properties": {
          "data": {
            "$ref": "#/components/schemas/Webhooks_CreatedSigningSecretResponse"
          },
          "metadata": {
            "$ref": "#/components/schemas/Webhooks_ContentMetadataResponse"
          }
        },
        "additionalProperties": false
      },
      "Webhooks_CreatedSigningSecretResponseResponseBody": {
        "type": "object",
        "properties": {
          "message": {
            "$ref": "#/components/schemas/Webhooks_MessageWithTokenResponse"
          },
          "content": {
            "$ref": "#/components/schemas/Webhooks_CreatedSigningSecretResponseContentResponse"
          },
          "validationIssues": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Webhooks_ValidationIssue"
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Webhooks_CreditNoteAllocationDetail": {
        "required": [
          "allocationId",
          "invoiceId"
        ],
        "type": "object",
        "properties": {
          "allocationId": {
            "type": "string"
          },
          "invoiceId": {
            "type": "string"
          },
          "amount": {
            "type": "number",
            "format": "double"
          },
          "allocatedAt": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Webhooks_CreditNoteEvent": {
        "required": [
          "clientId",
          "creditNoteId",
          "currencyCode",
          "eventType",
          "occurredAt",
          "organisationId",
          "status",
          "type"
        ],
        "type": "object",
        "properties": {
          "eventType": {
            "type": "string"
          },
          "organisationId": {
            "type": "string"
          },
          "clientId": {
            "type": "string"
          },
          "creditNoteId": {
            "type": "string"
          },
          "creditNoteNumber": {
            "type": "string",
            "nullable": true
          },
          "reference": {
            "type": "string",
            "nullable": true
          },
          "status": {
            "type": "string"
          },
          "type": {
            "type": "string"
          },
          "date": {
            "type": "string",
            "nullable": true
          },
          "linkedInvoiceId": {
            "type": "string",
            "nullable": true
          },
          "currencyCode": {
            "type": "string"
          },
          "subTotal": {
            "type": "number",
            "format": "double"
          },
          "totalTax": {
            "type": "number",
            "format": "double"
          },
          "amount": {
            "type": "number",
            "format": "double"
          },
          "remainingCredit": {
            "type": "number",
            "format": "double"
          },
          "allocation": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/Webhooks_CreditNoteAllocationDetail"
              },
              {
                "nullable": true
              }
            ]
          },
          "occurredAt": {
            "type": "string"
          },
          "resourceUrl": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Webhooks_CreditNoteEventWebhookEventEnvelope": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "type": {
            "type": "string"
          },
          "timestamp": {
            "type": "string"
          },
          "apiVersion": {
            "type": "string"
          },
          "organisationId": {
            "type": "string"
          },
          "customerId": {
            "type": "string"
          },
          "livemode": {
            "type": "boolean"
          },
          "data": {
            "$ref": "#/components/schemas/Webhooks_CreditNoteEvent"
          },
          "metadata": {
            "$ref": "#/components/schemas/Webhooks_WebhookEventMetadata"
          }
        },
        "additionalProperties": false
      },
      "Webhooks_DeliveryAttemptResponse": {
        "required": [
          "attemptNumber",
          "attemptedDate",
          "durationMilliseconds",
          "requestHeaders",
          "requestId",
          "responseBodyTruncated",
          "responseHeaders"
        ],
        "type": "object",
        "properties": {
          "attemptNumber": {
            "type": "integer",
            "format": "int32"
          },
          "attemptedDate": {
            "type": "string"
          },
          "durationMilliseconds": {
            "type": "integer",
            "format": "int64"
          },
          "statusCode": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "errorToken": {
            "type": "string",
            "nullable": true
          },
          "requestHeaders": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            }
          },
          "responseHeaders": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            }
          },
          "responseBody": {
            "type": "string",
            "nullable": true
          },
          "responseBodyTruncated": {
            "type": "boolean"
          },
          "retryAfterHonoured": {
            "type": "boolean"
          },
          "retryAfterClamped": {
            "type": "boolean"
          },
          "requestId": {
            "type": "string"
          }
        },
        "additionalProperties": false
      },
      "Webhooks_DeliveryAttemptResponseListContentResponse": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Webhooks_DeliveryAttemptResponse"
            },
            "nullable": true
          },
          "metadata": {
            "$ref": "#/components/schemas/Webhooks_ContentMetadataResponse"
          }
        },
        "additionalProperties": false
      },
      "Webhooks_DeliveryAttemptResponseListResponseBody": {
        "type": "object",
        "properties": {
          "message": {
            "$ref": "#/components/schemas/Webhooks_MessageWithTokenResponse"
          },
          "content": {
            "$ref": "#/components/schemas/Webhooks_DeliveryAttemptResponseListContentResponse"
          },
          "validationIssues": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Webhooks_ValidationIssue"
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Webhooks_DeliveryDetailResponse": {
        "type": "object",
        "properties": {
          "delivery": {
            "$ref": "#/components/schemas/Webhooks_DeliveryResponse"
          },
          "attempts": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Webhooks_DeliveryAttemptResponse"
            }
          }
        },
        "additionalProperties": false
      },
      "Webhooks_DeliveryDetailResponseContentResponse": {
        "type": "object",
        "properties": {
          "data": {
            "$ref": "#/components/schemas/Webhooks_DeliveryDetailResponse"
          },
          "metadata": {
            "$ref": "#/components/schemas/Webhooks_ContentMetadataResponse"
          }
        },
        "additionalProperties": false
      },
      "Webhooks_DeliveryDetailResponseResponseBody": {
        "type": "object",
        "properties": {
          "message": {
            "$ref": "#/components/schemas/Webhooks_MessageWithTokenResponse"
          },
          "content": {
            "$ref": "#/components/schemas/Webhooks_DeliveryDetailResponseContentResponse"
          },
          "validationIssues": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Webhooks_ValidationIssue"
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Webhooks_DeliveryResponse": {
        "required": [
          "attemptCount",
          "createdDate",
          "deliveryId",
          "endpointId",
          "eventId",
          "eventType",
          "organisationId",
          "payloadDowngraded",
          "status"
        ],
        "type": "object",
        "properties": {
          "deliveryId": {
            "type": "string"
          },
          "eventId": {
            "type": "string"
          },
          "eventType": {
            "type": "string"
          },
          "endpointId": {
            "type": "string"
          },
          "organisationId": {
            "type": "string"
          },
          "status": {
            "enum": [
              "Pending",
              "Succeeded",
              "Failed",
              "Skipped"
            ],
            "type": "string"
          },
          "attemptCount": {
            "type": "integer",
            "format": "int32"
          },
          "lastStatusCode": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "lastErrorToken": {
            "type": "string",
            "nullable": true
          },
          "nextAttemptDate": {
            "type": "string",
            "nullable": true
          },
          "replayOfDeliveryId": {
            "type": "string",
            "nullable": true
          },
          "payloadDowngraded": {
            "type": "boolean"
          },
          "createdDate": {
            "type": "string"
          },
          "completedDate": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Webhooks_DeliveryResponseContentResponse": {
        "type": "object",
        "properties": {
          "data": {
            "$ref": "#/components/schemas/Webhooks_DeliveryResponse"
          },
          "metadata": {
            "$ref": "#/components/schemas/Webhooks_ContentMetadataResponse"
          }
        },
        "additionalProperties": false
      },
      "Webhooks_DeliveryResponseListContentResponse": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Webhooks_DeliveryResponse"
            },
            "nullable": true
          },
          "metadata": {
            "$ref": "#/components/schemas/Webhooks_ContentMetadataResponse"
          }
        },
        "additionalProperties": false
      },
      "Webhooks_DeliveryResponseListResponseBody": {
        "type": "object",
        "properties": {
          "message": {
            "$ref": "#/components/schemas/Webhooks_MessageWithTokenResponse"
          },
          "content": {
            "$ref": "#/components/schemas/Webhooks_DeliveryResponseListContentResponse"
          },
          "validationIssues": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Webhooks_ValidationIssue"
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Webhooks_DeliveryResponseResponseBody": {
        "type": "object",
        "properties": {
          "message": {
            "$ref": "#/components/schemas/Webhooks_MessageWithTokenResponse"
          },
          "content": {
            "$ref": "#/components/schemas/Webhooks_DeliveryResponseContentResponse"
          },
          "validationIssues": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Webhooks_ValidationIssue"
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Webhooks_DurationDto": {
        "type": "object",
        "properties": {
          "value": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "unit": {
            "enum": [
              "Week",
              null
            ],
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Webhooks_EffectiveAlertContactsResponse": {
        "type": "object",
        "properties": {
          "emails": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "source": {
            "enum": [
              "Default",
              "Account",
              "Organisation",
              "Endpoint"
            ],
            "type": "string"
          }
        },
        "additionalProperties": false
      },
      "Webhooks_EligibilityDto": {
        "type": "object",
        "properties": {
          "courtOrders": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/Webhooks_CourtOrderEligibilitySectionDto"
              },
              {
                "nullable": true
              }
            ]
          }
        },
        "additionalProperties": false
      },
      "Webhooks_EmailStatusEvent": {
        "required": [
          "context",
          "eventType",
          "organisationId",
          "recipient",
          "sentAt",
          "sentBy",
          "status"
        ],
        "type": "object",
        "properties": {
          "eventType": {
            "type": "string"
          },
          "organisationId": {
            "type": "string"
          },
          "recipient": {
            "type": "string"
          },
          "status": {
            "enum": [
              "Sent",
              "Failed",
              "Delivered",
              "Bounced",
              "Complained"
            ],
            "type": "string"
          },
          "sentAt": {
            "type": "string"
          },
          "sentBy": {
            "type": "string"
          },
          "errorMessage": {
            "type": "string",
            "nullable": true
          },
          "context": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            }
          },
          "emailId": {
            "type": "string",
            "nullable": true
          },
          "occurredAt": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Webhooks_EmailStatusEventWebhookEventEnvelope": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "type": {
            "type": "string"
          },
          "timestamp": {
            "type": "string"
          },
          "apiVersion": {
            "type": "string"
          },
          "organisationId": {
            "type": "string"
          },
          "customerId": {
            "type": "string"
          },
          "livemode": {
            "type": "boolean"
          },
          "data": {
            "$ref": "#/components/schemas/Webhooks_EmailStatusEvent"
          },
          "metadata": {
            "$ref": "#/components/schemas/Webhooks_WebhookEventMetadata"
          }
        },
        "additionalProperties": false
      },
      "Webhooks_EmployeeChangedEvent": {
        "type": "object",
        "properties": {
          "eventType": {
            "type": "string"
          },
          "organisationId": {
            "type": "string"
          },
          "employeeId": {
            "type": "string"
          },
          "payrollId": {
            "type": "string",
            "nullable": true
          },
          "payrollConfigId": {
            "type": "string",
            "nullable": true
          },
          "occurredAt": {
            "type": "string"
          },
          "resourceUrl": {
            "type": "string",
            "nullable": true
          },
          "change": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/Webhooks_EmployeeFieldChange"
              },
              {
                "nullable": true
              }
            ]
          }
        },
        "additionalProperties": false
      },
      "Webhooks_EmployeeChangedEventWebhookEventEnvelope": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "type": {
            "type": "string"
          },
          "timestamp": {
            "type": "string"
          },
          "apiVersion": {
            "type": "string"
          },
          "organisationId": {
            "type": "string"
          },
          "customerId": {
            "type": "string"
          },
          "livemode": {
            "type": "boolean"
          },
          "data": {
            "$ref": "#/components/schemas/Webhooks_EmployeeChangedEvent"
          },
          "metadata": {
            "$ref": "#/components/schemas/Webhooks_WebhookEventMetadata"
          }
        },
        "additionalProperties": false
      },
      "Webhooks_EmployeeDirectorDetailsDto": {
        "type": "object",
        "properties": {
          "directorsNICType": {
            "enum": [
              "Annual",
              "Alternative"
            ],
            "type": "string"
          },
          "appointmentDate": {
            "type": "string"
          },
          "endDate": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Webhooks_EmployeeFieldChange": {
        "type": "object",
        "properties": {
          "field": {
            "type": "string"
          },
          "previousValue": {
            "type": "string",
            "nullable": true
          },
          "currentValue": {
            "type": "string",
            "nullable": true
          },
          "effectiveFrom": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Webhooks_EmployeeLeaverDetailsDto": {
        "type": "object",
        "properties": {
          "leavingDate": {
            "type": "string"
          },
          "reason": {
            "type": "string",
            "nullable": true
          },
          "issuedBy": {
            "type": "string",
            "nullable": true
          },
          "reportedToHmrc": {
            "type": "boolean"
          },
          "finalisedOnPayslip": {
            "type": "boolean"
          }
        },
        "additionalProperties": false
      },
      "Webhooks_EmployeeNameDto": {
        "required": [
          "firstName",
          "lastName"
        ],
        "type": "object",
        "properties": {
          "title": {
            "type": "string",
            "nullable": true
          },
          "firstName": {
            "minLength": 1,
            "type": "string"
          },
          "lastName": {
            "minLength": 1,
            "type": "string"
          },
          "initials": {
            "type": "string",
            "nullable": true
          },
          "middleName": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Webhooks_EmployeePostgraduateLoanDetailsDto": {
        "type": "object",
        "properties": {
          "loanType": {
            "enum": [
              "PostgraduateLoan",
              null
            ],
            "type": "string",
            "nullable": true
          },
          "startDate": {
            "type": "string",
            "nullable": true
          },
          "endDate": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Webhooks_EmployeeSecondedDetailsDto": {
        "type": "object",
        "properties": {
          "stayStatus": {
            "enum": [
              "Stay183DaysOrMore",
              "StayLessThan183Days",
              "InOutUK",
              null
            ],
            "type": "string",
            "nullable": true
          },
          "eEACitizen": {
            "type": "boolean"
          },
          "ePM6": {
            "type": "boolean"
          }
        },
        "additionalProperties": false
      },
      "Webhooks_EmployeeStarterDetailsDto": {
        "required": [
          "startDate",
          "starterDeclaration"
        ],
        "type": "object",
        "properties": {
          "startDate": {
            "minLength": 1,
            "type": "string"
          },
          "starterDeclaration": {
            "enum": [
              "ThisIsMyFirstJobSince6thApril",
              "ThisIsMyOnlyJob",
              "IHaveAnotherJobOrPension",
              "None"
            ],
            "type": "string"
          },
          "secondedDetails": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/Webhooks_EmployeeSecondedDetailsDto"
              },
              {
                "nullable": true
              }
            ]
          },
          "alreadySentToHmrcFps": {
            "type": "boolean"
          }
        },
        "additionalProperties": false
      },
      "Webhooks_EmployeeStudentDetailsDto": {
        "type": "object",
        "properties": {
          "studentLoanDetails": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/Webhooks_EmployeeStudentLoanDetailsDto"
              },
              {
                "nullable": true
              }
            ]
          },
          "postgraduateLoanDetails": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/Webhooks_EmployeePostgraduateLoanDetailsDto"
              },
              {
                "nullable": true
              }
            ]
          }
        },
        "additionalProperties": false
      },
      "Webhooks_EmployeeStudentLoanDetailsDto": {
        "type": "object",
        "properties": {
          "loanType": {
            "enum": [
              "Plan1",
              "Plan2",
              "Plan4",
              "Plan5",
              null
            ],
            "type": "string",
            "nullable": true
          },
          "startDate": {
            "type": "string",
            "nullable": true
          },
          "endDate": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Webhooks_EmployeeTaxCodeDto": {
        "type": "object",
        "properties": {
          "code": {
            "type": "string"
          },
          "effectiveDate": {
            "type": "string",
            "nullable": true
          },
          "reason": {
            "type": "string"
          },
          "issuedBy": {
            "type": "string"
          },
          "week1Month1": {
            "type": "boolean"
          }
        },
        "additionalProperties": false
      },
      "Webhooks_EmployeeWorkplaceDetailsDto": {
        "type": "object",
        "properties": {
          "workplacePostcode": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Webhooks_EndpointAlertContactsResponse": {
        "type": "object",
        "properties": {
          "emails": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "effective": {
            "$ref": "#/components/schemas/Webhooks_EffectiveAlertContactsResponse"
          }
        },
        "additionalProperties": false
      },
      "Webhooks_EndpointAlertContactsResponseContentResponse": {
        "type": "object",
        "properties": {
          "data": {
            "$ref": "#/components/schemas/Webhooks_EndpointAlertContactsResponse"
          },
          "metadata": {
            "$ref": "#/components/schemas/Webhooks_ContentMetadataResponse"
          }
        },
        "additionalProperties": false
      },
      "Webhooks_EndpointAlertContactsResponseResponseBody": {
        "type": "object",
        "properties": {
          "message": {
            "$ref": "#/components/schemas/Webhooks_MessageWithTokenResponse"
          },
          "content": {
            "$ref": "#/components/schemas/Webhooks_EndpointAlertContactsResponseContentResponse"
          },
          "validationIssues": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Webhooks_ValidationIssue"
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Webhooks_EndpointEventTypesResponse": {
        "type": "object",
        "properties": {
          "eventTypes": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        },
        "additionalProperties": false
      },
      "Webhooks_EndpointEventTypesResponseContentResponse": {
        "type": "object",
        "properties": {
          "data": {
            "$ref": "#/components/schemas/Webhooks_EndpointEventTypesResponse"
          },
          "metadata": {
            "$ref": "#/components/schemas/Webhooks_ContentMetadataResponse"
          }
        },
        "additionalProperties": false
      },
      "Webhooks_EndpointEventTypesResponseResponseBody": {
        "type": "object",
        "properties": {
          "message": {
            "$ref": "#/components/schemas/Webhooks_MessageWithTokenResponse"
          },
          "content": {
            "$ref": "#/components/schemas/Webhooks_EndpointEventTypesResponseContentResponse"
          },
          "validationIssues": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Webhooks_ValidationIssue"
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Webhooks_EndpointExcludedOrganisationsResponse": {
        "type": "object",
        "properties": {
          "organisationIds": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        },
        "additionalProperties": false
      },
      "Webhooks_EndpointExcludedOrganisationsResponseContentResponse": {
        "type": "object",
        "properties": {
          "data": {
            "$ref": "#/components/schemas/Webhooks_EndpointExcludedOrganisationsResponse"
          },
          "metadata": {
            "$ref": "#/components/schemas/Webhooks_ContentMetadataResponse"
          }
        },
        "additionalProperties": false
      },
      "Webhooks_EndpointExcludedOrganisationsResponseResponseBody": {
        "type": "object",
        "properties": {
          "message": {
            "$ref": "#/components/schemas/Webhooks_MessageWithTokenResponse"
          },
          "content": {
            "$ref": "#/components/schemas/Webhooks_EndpointExcludedOrganisationsResponseContentResponse"
          },
          "validationIssues": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Webhooks_ValidationIssue"
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Webhooks_EndpointOrganisationsResponse": {
        "type": "object",
        "properties": {
          "organisationIds": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        },
        "additionalProperties": false
      },
      "Webhooks_EndpointOrganisationsResponseContentResponse": {
        "type": "object",
        "properties": {
          "data": {
            "$ref": "#/components/schemas/Webhooks_EndpointOrganisationsResponse"
          },
          "metadata": {
            "$ref": "#/components/schemas/Webhooks_ContentMetadataResponse"
          }
        },
        "additionalProperties": false
      },
      "Webhooks_EndpointOrganisationsResponseResponseBody": {
        "type": "object",
        "properties": {
          "message": {
            "$ref": "#/components/schemas/Webhooks_MessageWithTokenResponse"
          },
          "content": {
            "$ref": "#/components/schemas/Webhooks_EndpointOrganisationsResponseContentResponse"
          },
          "validationIssues": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Webhooks_ValidationIssue"
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Webhooks_EndpointResponse": {
        "required": [
          "alertContacts",
          "apiVersion",
          "createdDate",
          "customHeaderNames",
          "destinationType",
          "endpointId",
          "eventTypes",
          "excludedOrganisationIds",
          "ordering",
          "organisationIds",
          "ownerId",
          "payloadStyle",
          "scope",
          "status",
          "updatedDate",
          "url"
        ],
        "type": "object",
        "properties": {
          "endpointId": {
            "type": "string"
          },
          "scope": {
            "enum": [
              "Organisation",
              "Customer"
            ],
            "type": "string"
          },
          "ownerId": {
            "type": "string"
          },
          "url": {
            "type": "string"
          },
          "description": {
            "type": "string",
            "nullable": true
          },
          "status": {
            "enum": [
              "Paused",
              "Active",
              "DisabledBySystem"
            ],
            "type": "string"
          },
          "statusReason": {
            "type": "string",
            "nullable": true
          },
          "destinationType": {
            "enum": [
              "Https"
            ],
            "type": "string"
          },
          "apiVersion": {
            "type": "string"
          },
          "payloadStyle": {
            "enum": [
              "Minimal",
              "Full"
            ],
            "type": "string"
          },
          "ordering": {
            "enum": [
              "Unordered",
              "Fifo"
            ],
            "type": "string"
          },
          "rateLimitPerSecond": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "eventTypes": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "organisationIds": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "excludedOrganisationIds": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "customHeaderNames": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "alertContacts": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "createdDate": {
            "type": "string"
          },
          "updatedDate": {
            "type": "string"
          }
        },
        "additionalProperties": false
      },
      "Webhooks_EndpointResponseContentResponse": {
        "type": "object",
        "properties": {
          "data": {
            "$ref": "#/components/schemas/Webhooks_EndpointResponse"
          },
          "metadata": {
            "$ref": "#/components/schemas/Webhooks_ContentMetadataResponse"
          }
        },
        "additionalProperties": false
      },
      "Webhooks_EndpointResponseListContentResponse": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Webhooks_EndpointResponse"
            },
            "nullable": true
          },
          "metadata": {
            "$ref": "#/components/schemas/Webhooks_ContentMetadataResponse"
          }
        },
        "additionalProperties": false
      },
      "Webhooks_EndpointResponseListResponseBody": {
        "type": "object",
        "properties": {
          "message": {
            "$ref": "#/components/schemas/Webhooks_MessageWithTokenResponse"
          },
          "content": {
            "$ref": "#/components/schemas/Webhooks_EndpointResponseListContentResponse"
          },
          "validationIssues": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Webhooks_ValidationIssue"
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Webhooks_EndpointResponseResponseBody": {
        "type": "object",
        "properties": {
          "message": {
            "$ref": "#/components/schemas/Webhooks_MessageWithTokenResponse"
          },
          "content": {
            "$ref": "#/components/schemas/Webhooks_EndpointResponseContentResponse"
          },
          "validationIssues": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Webhooks_ValidationIssue"
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Webhooks_EventTypesChangeRequest": {
        "type": "object",
        "properties": {
          "eventTypes": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        },
        "additionalProperties": false
      },
      "Webhooks_HmrcNoticeEvent": {
        "required": [
          "eventType",
          "noticeId",
          "noticeType",
          "occurredAt",
          "organisationId",
          "status"
        ],
        "type": "object",
        "properties": {
          "eventType": {
            "type": "string"
          },
          "organisationId": {
            "type": "string"
          },
          "employeeId": {
            "type": "string",
            "nullable": true
          },
          "noticeId": {
            "type": "string"
          },
          "noticeType": {
            "type": "string"
          },
          "status": {
            "type": "string"
          },
          "issueDate": {
            "type": "string",
            "nullable": true
          },
          "effectiveDate": {
            "type": "string",
            "nullable": true
          },
          "taxYearEnd": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "taxCode": {
            "type": "string",
            "nullable": true
          },
          "isWeek1Month1Basis": {
            "type": "boolean",
            "nullable": true
          },
          "loanPlanType": {
            "type": "string",
            "nullable": true
          },
          "reason": {
            "type": "string",
            "nullable": true
          },
          "occurredAt": {
            "type": "string"
          },
          "resourceUrl": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Webhooks_HmrcNoticeEventWebhookEventEnvelope": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "type": {
            "type": "string"
          },
          "timestamp": {
            "type": "string"
          },
          "apiVersion": {
            "type": "string"
          },
          "organisationId": {
            "type": "string"
          },
          "customerId": {
            "type": "string"
          },
          "livemode": {
            "type": "boolean"
          },
          "data": {
            "$ref": "#/components/schemas/Webhooks_HmrcNoticeEvent"
          },
          "metadata": {
            "$ref": "#/components/schemas/Webhooks_WebhookEventMetadata"
          }
        },
        "additionalProperties": false
      },
      "Webhooks_HmrcNoticeJobEvent": {
        "required": [
          "eventType",
          "jobId",
          "jobType",
          "occurredAt",
          "organisationId",
          "status"
        ],
        "type": "object",
        "properties": {
          "eventType": {
            "type": "string"
          },
          "organisationId": {
            "type": "string"
          },
          "jobId": {
            "type": "string"
          },
          "jobType": {
            "type": "string"
          },
          "status": {
            "type": "string"
          },
          "startedAt": {
            "type": "string",
            "nullable": true
          },
          "occurredAt": {
            "type": "string"
          },
          "resourceUrl": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Webhooks_HmrcNoticeJobEventWebhookEventEnvelope": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "type": {
            "type": "string"
          },
          "timestamp": {
            "type": "string"
          },
          "apiVersion": {
            "type": "string"
          },
          "organisationId": {
            "type": "string"
          },
          "customerId": {
            "type": "string"
          },
          "livemode": {
            "type": "boolean"
          },
          "data": {
            "$ref": "#/components/schemas/Webhooks_HmrcNoticeJobEvent"
          },
          "metadata": {
            "$ref": "#/components/schemas/Webhooks_WebhookEventMetadata"
          }
        },
        "additionalProperties": false
      },
      "Webhooks_HolidayAccrualEvent": {
        "required": [
          "date",
          "employeeId",
          "eventType",
          "occurredAt",
          "organisationId"
        ],
        "type": "object",
        "properties": {
          "eventType": {
            "type": "string"
          },
          "organisationId": {
            "type": "string"
          },
          "employeeId": {
            "type": "string"
          },
          "payrollConfigId": {
            "type": "string",
            "nullable": true
          },
          "date": {
            "type": "string"
          },
          "description": {
            "type": "string",
            "nullable": true
          },
          "hours": {
            "type": "number",
            "format": "double"
          },
          "baseHours": {
            "type": "number",
            "format": "double"
          },
          "baseValue": {
            "type": "number",
            "format": "double"
          },
          "averageRate": {
            "type": "number",
            "format": "double"
          },
          "accrualRatePercentage": {
            "type": "number",
            "format": "double"
          },
          "weeksCount": {
            "type": "number",
            "format": "double"
          },
          "payPeriod": {
            "type": "integer",
            "format": "int32"
          },
          "frequency": {
            "type": "string",
            "nullable": true
          },
          "occurredAt": {
            "type": "string"
          },
          "resourceUrl": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Webhooks_HolidayAccrualEventWebhookEventEnvelope": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "type": {
            "type": "string"
          },
          "timestamp": {
            "type": "string"
          },
          "apiVersion": {
            "type": "string"
          },
          "organisationId": {
            "type": "string"
          },
          "customerId": {
            "type": "string"
          },
          "livemode": {
            "type": "boolean"
          },
          "data": {
            "$ref": "#/components/schemas/Webhooks_HolidayAccrualEvent"
          },
          "metadata": {
            "$ref": "#/components/schemas/Webhooks_WebhookEventMetadata"
          }
        },
        "additionalProperties": false
      },
      "Webhooks_HolidayConfigurationEvent": {
        "required": [
          "eventType",
          "occurredAt",
          "organisationId"
        ],
        "type": "object",
        "properties": {
          "eventType": {
            "type": "string"
          },
          "organisationId": {
            "type": "string"
          },
          "employeeId": {
            "type": "string",
            "nullable": true
          },
          "configId": {
            "type": "string",
            "nullable": true
          },
          "accrualType": {
            "type": "string",
            "nullable": true
          },
          "allowanceDays": {
            "type": "number",
            "format": "double",
            "nullable": true
          },
          "accrualRatePercentage": {
            "type": "number",
            "format": "double",
            "nullable": true
          },
          "accrualResetMonth": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "accrualResetDay": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "occurredAt": {
            "type": "string"
          },
          "resourceUrl": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Webhooks_HolidayConfigurationEventWebhookEventEnvelope": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "type": {
            "type": "string"
          },
          "timestamp": {
            "type": "string"
          },
          "apiVersion": {
            "type": "string"
          },
          "organisationId": {
            "type": "string"
          },
          "customerId": {
            "type": "string"
          },
          "livemode": {
            "type": "boolean"
          },
          "data": {
            "$ref": "#/components/schemas/Webhooks_HolidayConfigurationEvent"
          },
          "metadata": {
            "$ref": "#/components/schemas/Webhooks_WebhookEventMetadata"
          }
        },
        "additionalProperties": false
      },
      "Webhooks_HolidayLeaveEvent": {
        "required": [
          "accrualType",
          "date",
          "employeeId",
          "eventType",
          "leaveId",
          "occurredAt",
          "organisationId"
        ],
        "type": "object",
        "properties": {
          "eventType": {
            "type": "string"
          },
          "organisationId": {
            "type": "string"
          },
          "employeeId": {
            "type": "string"
          },
          "leaveId": {
            "type": "string"
          },
          "date": {
            "type": "string"
          },
          "description": {
            "type": "string",
            "nullable": true
          },
          "hours": {
            "type": "number",
            "format": "double",
            "nullable": true
          },
          "rate": {
            "type": "number",
            "format": "double",
            "nullable": true
          },
          "value": {
            "type": "number",
            "format": "double",
            "nullable": true
          },
          "lineItemId": {
            "type": "string",
            "nullable": true
          },
          "accrualType": {
            "type": "string"
          },
          "occurredAt": {
            "type": "string"
          },
          "resourceUrl": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Webhooks_HolidayLeaveEventWebhookEventEnvelope": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "type": {
            "type": "string"
          },
          "timestamp": {
            "type": "string"
          },
          "apiVersion": {
            "type": "string"
          },
          "organisationId": {
            "type": "string"
          },
          "customerId": {
            "type": "string"
          },
          "livemode": {
            "type": "boolean"
          },
          "data": {
            "$ref": "#/components/schemas/Webhooks_HolidayLeaveEvent"
          },
          "metadata": {
            "$ref": "#/components/schemas/Webhooks_WebhookEventMetadata"
          }
        },
        "additionalProperties": false
      },
      "Webhooks_HolidayOpeningBalanceEvent": {
        "required": [
          "employeeId",
          "eventType",
          "occurredAt",
          "organisationId"
        ],
        "type": "object",
        "properties": {
          "eventType": {
            "type": "string"
          },
          "organisationId": {
            "type": "string"
          },
          "employeeId": {
            "type": "string"
          },
          "openingBalanceHours": {
            "type": "number",
            "format": "double",
            "nullable": true
          },
          "openingBalanceAverageRate": {
            "type": "number",
            "format": "double",
            "nullable": true
          },
          "openingBalanceNumberOfWeeks": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "openingBalanceBaseHours": {
            "type": "number",
            "format": "double",
            "nullable": true
          },
          "openingBalanceBaseGross": {
            "type": "number",
            "format": "double",
            "nullable": true
          },
          "occurredAt": {
            "type": "string"
          },
          "resourceUrl": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Webhooks_HolidayOpeningBalanceEventWebhookEventEnvelope": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "type": {
            "type": "string"
          },
          "timestamp": {
            "type": "string"
          },
          "apiVersion": {
            "type": "string"
          },
          "organisationId": {
            "type": "string"
          },
          "customerId": {
            "type": "string"
          },
          "livemode": {
            "type": "boolean"
          },
          "data": {
            "$ref": "#/components/schemas/Webhooks_HolidayOpeningBalanceEvent"
          },
          "metadata": {
            "$ref": "#/components/schemas/Webhooks_WebhookEventMetadata"
          }
        },
        "additionalProperties": false
      },
      "Webhooks_HolidayRolledUpPayEvent": {
        "required": [
          "date",
          "employeeId",
          "eventType",
          "lineItemId",
          "occurredAt",
          "organisationId",
          "transactionId"
        ],
        "type": "object",
        "properties": {
          "eventType": {
            "type": "string"
          },
          "organisationId": {
            "type": "string"
          },
          "employeeId": {
            "type": "string"
          },
          "payrollConfigId": {
            "type": "string",
            "nullable": true
          },
          "transactionId": {
            "type": "string"
          },
          "date": {
            "type": "string"
          },
          "description": {
            "type": "string",
            "nullable": true
          },
          "hours": {
            "type": "number",
            "format": "double"
          },
          "rate": {
            "type": "number",
            "format": "double"
          },
          "value": {
            "type": "number",
            "format": "double"
          },
          "baseHours": {
            "type": "number",
            "format": "double"
          },
          "baseValue": {
            "type": "number",
            "format": "double"
          },
          "lineItemId": {
            "type": "string"
          },
          "payPeriod": {
            "type": "integer",
            "format": "int32"
          },
          "frequency": {
            "type": "string",
            "nullable": true
          },
          "occurredAt": {
            "type": "string"
          },
          "resourceUrl": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Webhooks_HolidayRolledUpPayEventWebhookEventEnvelope": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "type": {
            "type": "string"
          },
          "timestamp": {
            "type": "string"
          },
          "apiVersion": {
            "type": "string"
          },
          "organisationId": {
            "type": "string"
          },
          "customerId": {
            "type": "string"
          },
          "livemode": {
            "type": "boolean"
          },
          "data": {
            "$ref": "#/components/schemas/Webhooks_HolidayRolledUpPayEvent"
          },
          "metadata": {
            "$ref": "#/components/schemas/Webhooks_WebhookEventMetadata"
          }
        },
        "additionalProperties": false
      },
      "Webhooks_InvoiceEvent": {
        "required": [
          "clientId",
          "eventType",
          "invoiceId",
          "occurredAt",
          "organisationId",
          "status"
        ],
        "type": "object",
        "properties": {
          "eventType": {
            "type": "string"
          },
          "organisationId": {
            "type": "string"
          },
          "clientId": {
            "type": "string"
          },
          "invoiceId": {
            "type": "string"
          },
          "invoiceNumber": {
            "type": "string",
            "nullable": true
          },
          "reference": {
            "type": "string",
            "nullable": true
          },
          "status": {
            "type": "string"
          },
          "date": {
            "type": "string",
            "nullable": true
          },
          "dueDate": {
            "type": "string",
            "nullable": true
          },
          "currencyCode": {
            "type": "string",
            "nullable": true
          },
          "subTotal": {
            "type": "number",
            "format": "double",
            "nullable": true
          },
          "totalTax": {
            "type": "number",
            "format": "double",
            "nullable": true
          },
          "amount": {
            "type": "number",
            "format": "double",
            "nullable": true
          },
          "totalCreditAmount": {
            "type": "number",
            "format": "double",
            "nullable": true
          },
          "balanceDue": {
            "type": "number",
            "format": "double",
            "nullable": true
          },
          "emailSentAt": {
            "type": "string",
            "nullable": true
          },
          "occurredAt": {
            "type": "string"
          },
          "resourceUrl": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Webhooks_InvoiceEventWebhookEventEnvelope": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "type": {
            "type": "string"
          },
          "timestamp": {
            "type": "string"
          },
          "apiVersion": {
            "type": "string"
          },
          "organisationId": {
            "type": "string"
          },
          "customerId": {
            "type": "string"
          },
          "livemode": {
            "type": "boolean"
          },
          "data": {
            "$ref": "#/components/schemas/Webhooks_InvoiceEvent"
          },
          "metadata": {
            "$ref": "#/components/schemas/Webhooks_WebhookEventMetadata"
          }
        },
        "additionalProperties": false
      },
      "Webhooks_JournalEvent": {
        "required": [
          "eventType",
          "journalId",
          "occurredAt",
          "organisationId",
          "payrollConfigId"
        ],
        "type": "object",
        "properties": {
          "eventType": {
            "type": "string"
          },
          "organisationId": {
            "type": "string"
          },
          "journalId": {
            "type": "string"
          },
          "payrollConfigId": {
            "type": "string"
          },
          "taxYear": {
            "type": "integer",
            "format": "int32"
          },
          "taxPeriod": {
            "type": "integer",
            "format": "int32"
          },
          "payDate": {
            "type": "string",
            "nullable": true
          },
          "version": {
            "type": "integer",
            "format": "int32"
          },
          "sumDebit": {
            "type": "number",
            "format": "double",
            "nullable": true
          },
          "sumCredit": {
            "type": "number",
            "format": "double",
            "nullable": true
          },
          "isBalanced": {
            "type": "boolean",
            "nullable": true
          },
          "replacesJournalId": {
            "type": "string",
            "nullable": true
          },
          "replacesVersion": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "reason": {
            "type": "string",
            "nullable": true
          },
          "occurredAt": {
            "type": "string"
          },
          "resourceUrl": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Webhooks_JournalEventWebhookEventEnvelope": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "type": {
            "type": "string"
          },
          "timestamp": {
            "type": "string"
          },
          "apiVersion": {
            "type": "string"
          },
          "organisationId": {
            "type": "string"
          },
          "customerId": {
            "type": "string"
          },
          "livemode": {
            "type": "boolean"
          },
          "data": {
            "$ref": "#/components/schemas/Webhooks_JournalEvent"
          },
          "metadata": {
            "$ref": "#/components/schemas/Webhooks_WebhookEventMetadata"
          }
        },
        "additionalProperties": false
      },
      "Webhooks_JournalPostingEvent": {
        "required": [
          "eventType",
          "journalId",
          "occurredAt",
          "organisationId",
          "payrollConfigId"
        ],
        "type": "object",
        "properties": {
          "eventType": {
            "type": "string"
          },
          "organisationId": {
            "type": "string"
          },
          "journalId": {
            "type": "string"
          },
          "payrollConfigId": {
            "type": "string"
          },
          "taxYear": {
            "type": "integer",
            "format": "int32"
          },
          "taxPeriod": {
            "type": "integer",
            "format": "int32"
          },
          "version": {
            "type": "integer",
            "format": "int32"
          },
          "attempt": {
            "type": "integer",
            "format": "int32"
          },
          "status": {
            "enum": [
              "Sending",
              "Sent",
              "Failed",
              "NeedsAttention"
            ],
            "type": "string"
          },
          "providerReference": {
            "type": "string",
            "nullable": true
          },
          "errorToken": {
            "type": "string",
            "nullable": true
          },
          "occurredAt": {
            "type": "string"
          },
          "resourceUrl": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Webhooks_JournalPostingEventWebhookEventEnvelope": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "type": {
            "type": "string"
          },
          "timestamp": {
            "type": "string"
          },
          "apiVersion": {
            "type": "string"
          },
          "organisationId": {
            "type": "string"
          },
          "customerId": {
            "type": "string"
          },
          "livemode": {
            "type": "boolean"
          },
          "data": {
            "$ref": "#/components/schemas/Webhooks_JournalPostingEvent"
          },
          "metadata": {
            "$ref": "#/components/schemas/Webhooks_WebhookEventMetadata"
          }
        },
        "additionalProperties": false
      },
      "Webhooks_LineItemMetadataDto": {
        "type": "object",
        "properties": {
          "courtOrders": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/Webhooks_CourtOrderMetadataSectionDto"
              },
              {
                "nullable": true
              }
            ]
          },
          "recurringLineItem": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/Webhooks_RecurringLineItemMetadataSectionDto"
              },
              {
                "nullable": true
              }
            ]
          },
          "pensions": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/Webhooks_PensionMetadataSectionDto"
              },
              {
                "nullable": true
              }
            ]
          }
        },
        "additionalProperties": false
      },
      "Webhooks_MessageWithTokenResponse": {
        "type": "object",
        "properties": {
          "text": {
            "type": "string"
          },
          "token": {
            "type": "string"
          },
          "tokenArguments": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Webhooks_ValidationIssueArgument"
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Webhooks_NiBandResultDto": {
        "type": "object",
        "properties": {
          "grossInBand": {
            "type": "number",
            "format": "double"
          },
          "employeeNiForBand": {
            "type": "number",
            "format": "double"
          },
          "employerNiForBand": {
            "type": "number",
            "format": "double"
          }
        },
        "additionalProperties": false
      },
      "Webhooks_NiCalculationResultDto": {
        "type": "object",
        "properties": {
          "employeeNi": {
            "type": "number",
            "format": "double"
          },
          "employerNi": {
            "type": "number",
            "format": "double"
          },
          "totalNi": {
            "type": "number",
            "format": "double"
          },
          "grossForEmployeeNi": {
            "type": "number",
            "format": "double"
          },
          "grossForEmployerNi": {
            "type": "number",
            "format": "double"
          },
          "bandResults": {
            "type": "object",
            "additionalProperties": {
              "$ref": "#/components/schemas/Webhooks_NiBandResultDto"
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Webhooks_ObjectContentResponse": {
        "type": "object",
        "properties": {
          "data": {},
          "metadata": {
            "$ref": "#/components/schemas/Webhooks_ContentMetadataResponse"
          }
        },
        "additionalProperties": false
      },
      "Webhooks_ObjectResponseBody": {
        "type": "object",
        "properties": {
          "message": {
            "$ref": "#/components/schemas/Webhooks_MessageWithTokenResponse"
          },
          "content": {
            "$ref": "#/components/schemas/Webhooks_ObjectContentResponse"
          },
          "validationIssues": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Webhooks_ValidationIssue"
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Webhooks_OrganisationInformationDto": {
        "required": [
          "businessType",
          "companyContactDetails",
          "companyRegistrationNumber",
          "correspondenceAddress",
          "createdBy",
          "createdDate",
          "name",
          "organisationId",
          "organisationType",
          "primaryContactDetails",
          "registredOfficeAddress",
          "updatedBy",
          "updatedDate"
        ],
        "type": "object",
        "properties": {
          "name": {
            "$ref": "#/components/schemas/Webhooks_OrganisationNameDto"
          },
          "organisationType": {
            "enum": [
              "Parent",
              "Subsidiary",
              "Independent",
              "Franchise",
              "Branch"
            ],
            "type": "string"
          },
          "companyRegistrationNumber": {
            "type": "string"
          },
          "businessType": {
            "enum": [
              "LimitedCompany",
              "LimitedLiabilityPartnership",
              "SoleTrader",
              "Partnership",
              "Charity",
              "PublicSector"
            ],
            "type": "string"
          },
          "registredOfficeAddress": {
            "$ref": "#/components/schemas/Webhooks_AddressDto"
          },
          "correspondenceAddress": {
            "$ref": "#/components/schemas/Webhooks_AddressDto"
          },
          "companyContactDetails": {
            "$ref": "#/components/schemas/Webhooks_ContactDetailsDto"
          },
          "primaryContactDetails": {
            "$ref": "#/components/schemas/Webhooks_ContactDetailsDto"
          },
          "organisationId": {
            "type": "string"
          },
          "createdBy": {
            "type": "string"
          },
          "createdDate": {
            "type": "string",
            "format": "date-time"
          },
          "updatedBy": {
            "type": "string"
          },
          "updatedDate": {
            "type": "string",
            "format": "date-time"
          }
        },
        "additionalProperties": false
      },
      "Webhooks_OrganisationNameDto": {
        "type": "object",
        "properties": {
          "legalName": {
            "type": "string"
          },
          "tradingName": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Webhooks_OrganisationsChangeRequest": {
        "type": "object",
        "properties": {
          "organisationIds": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        },
        "additionalProperties": false
      },
      "Webhooks_PFormBulkSendJobEvent": {
        "required": [
          "eventType",
          "failedCount",
          "failureCountsByReason",
          "failures",
          "failuresTruncated",
          "jobId",
          "jobUrl",
          "organisationId",
          "pFormType",
          "succeededCount",
          "totalCount"
        ],
        "type": "object",
        "properties": {
          "eventType": {
            "type": "string"
          },
          "jobId": {
            "type": "string"
          },
          "organisationId": {
            "type": "string"
          },
          "pFormType": {
            "enum": [
              "P60",
              "P45"
            ],
            "type": "string"
          },
          "taxYear": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "totalCount": {
            "type": "integer",
            "format": "int32"
          },
          "succeededCount": {
            "type": "integer",
            "format": "int32"
          },
          "failedCount": {
            "type": "integer",
            "format": "int32"
          },
          "startedAt": {
            "type": "string",
            "nullable": true
          },
          "completedAt": {
            "type": "string",
            "nullable": true
          },
          "failures": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Webhooks_PFormBulkSendJobFailure"
            }
          },
          "failuresTruncated": {
            "type": "boolean"
          },
          "failureCountsByReason": {
            "type": "object",
            "additionalProperties": {
              "type": "integer",
              "format": "int32"
            }
          },
          "jobUrl": {
            "type": "string"
          }
        },
        "additionalProperties": false
      },
      "Webhooks_PFormBulkSendJobEventWebhookEventEnvelope": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "type": {
            "type": "string"
          },
          "timestamp": {
            "type": "string"
          },
          "apiVersion": {
            "type": "string"
          },
          "organisationId": {
            "type": "string"
          },
          "customerId": {
            "type": "string"
          },
          "livemode": {
            "type": "boolean"
          },
          "data": {
            "$ref": "#/components/schemas/Webhooks_PFormBulkSendJobEvent"
          },
          "metadata": {
            "$ref": "#/components/schemas/Webhooks_WebhookEventMetadata"
          }
        },
        "additionalProperties": false
      },
      "Webhooks_PFormBulkSendJobFailure": {
        "required": [
          "employeeId",
          "reason"
        ],
        "type": "object",
        "properties": {
          "employeeId": {
            "type": "string"
          },
          "reason": {
            "type": "string"
          }
        },
        "additionalProperties": false
      },
      "Webhooks_PFormIssuedEvent": {
        "required": [
          "documentUrl",
          "employeeId",
          "eventType",
          "formId",
          "issuedAt",
          "organisationId",
          "pFormType",
          "taxYear"
        ],
        "type": "object",
        "properties": {
          "eventType": {
            "type": "string"
          },
          "formId": {
            "type": "string"
          },
          "organisationId": {
            "type": "string"
          },
          "employeeId": {
            "type": "string"
          },
          "taxYear": {
            "type": "integer",
            "format": "int32"
          },
          "pFormType": {
            "enum": [
              "P60",
              "P45"
            ],
            "type": "string"
          },
          "issuedAt": {
            "type": "string"
          },
          "documentUrl": {
            "type": "string"
          },
          "replacementCount": {
            "type": "integer",
            "format": "int32"
          }
        },
        "additionalProperties": false
      },
      "Webhooks_PFormIssuedEventWebhookEventEnvelope": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "type": {
            "type": "string"
          },
          "timestamp": {
            "type": "string"
          },
          "apiVersion": {
            "type": "string"
          },
          "organisationId": {
            "type": "string"
          },
          "customerId": {
            "type": "string"
          },
          "livemode": {
            "type": "boolean"
          },
          "data": {
            "$ref": "#/components/schemas/Webhooks_PFormIssuedEvent"
          },
          "metadata": {
            "$ref": "#/components/schemas/Webhooks_WebhookEventMetadata"
          }
        },
        "additionalProperties": false
      },
      "Webhooks_PFormRevokedEvent": {
        "required": [
          "employeeId",
          "eventType",
          "formId",
          "organisationId",
          "pFormType",
          "reason",
          "revokedAt",
          "taxYear"
        ],
        "type": "object",
        "properties": {
          "eventType": {
            "type": "string"
          },
          "formId": {
            "type": "string"
          },
          "organisationId": {
            "type": "string"
          },
          "employeeId": {
            "type": "string"
          },
          "taxYear": {
            "type": "integer",
            "format": "int32"
          },
          "pFormType": {
            "enum": [
              "P60",
              "P45"
            ],
            "type": "string"
          },
          "reason": {
            "enum": [
              "LeaverCancelled",
              "NotEntitled"
            ],
            "type": "string"
          },
          "revokedAt": {
            "type": "string"
          }
        },
        "additionalProperties": false
      },
      "Webhooks_PFormRevokedEventWebhookEventEnvelope": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "type": {
            "type": "string"
          },
          "timestamp": {
            "type": "string"
          },
          "apiVersion": {
            "type": "string"
          },
          "organisationId": {
            "type": "string"
          },
          "customerId": {
            "type": "string"
          },
          "livemode": {
            "type": "boolean"
          },
          "data": {
            "$ref": "#/components/schemas/Webhooks_PFormRevokedEvent"
          },
          "metadata": {
            "$ref": "#/components/schemas/Webhooks_WebhookEventMetadata"
          }
        },
        "additionalProperties": false
      },
      "Webhooks_PayeReferenceNumberDto": {
        "required": [
          "officeNumber",
          "referenceNumber"
        ],
        "type": "object",
        "properties": {
          "officeNumber": {
            "minLength": 1,
            "type": "string"
          },
          "referenceNumber": {
            "minLength": 1,
            "type": "string"
          }
        },
        "additionalProperties": false
      },
      "Webhooks_PaymentConfigResponse": {
        "required": [
          "fileFormat",
          "format",
          "method"
        ],
        "type": "object",
        "properties": {
          "method": {
            "type": "string"
          },
          "format": {
            "type": "string"
          },
          "fileFormat": {
            "type": "string"
          },
          "reference": {
            "type": "string",
            "nullable": true
          },
          "referenceDateFormat": {
            "type": "string",
            "nullable": true
          },
          "payrollConfigId": {
            "type": "string",
            "nullable": true
          },
          "bacs": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/Webhooks_BACSPaymentConfigResponse"
              },
              {
                "nullable": true
              }
            ]
          },
          "fileLayout": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/Webhooks_PaymentFileLayout"
              },
              {
                "nullable": true
              }
            ]
          },
          "createdDate": {
            "type": "string",
            "format": "date-time"
          },
          "createdBy": {
            "type": "string"
          },
          "updatedDate": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "updatedBy": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Webhooks_PaymentDetailsDto": {
        "type": "object",
        "properties": {
          "accountName": {
            "type": "string",
            "nullable": true
          },
          "accountNumber": {
            "type": "string",
            "nullable": true
          },
          "sortCode": {
            "type": "string",
            "nullable": true
          },
          "paymentReference": {
            "type": "string",
            "nullable": true
          },
          "paymentCategory": {
            "enum": [
              "CourtOrders",
              null
            ],
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Webhooks_PaymentFileEvent": {
        "required": [
          "eventType",
          "frequency",
          "occurredAt",
          "organisationId",
          "payrollConfigId",
          "period",
          "status",
          "trigger",
          "year"
        ],
        "type": "object",
        "properties": {
          "eventType": {
            "type": "string"
          },
          "organisationId": {
            "type": "string"
          },
          "payrollConfigId": {
            "type": "string"
          },
          "year": {
            "type": "integer",
            "format": "int32"
          },
          "frequency": {
            "type": "string"
          },
          "period": {
            "type": "integer",
            "format": "int32"
          },
          "status": {
            "type": "string"
          },
          "trigger": {
            "type": "string"
          },
          "paymentMethod": {
            "type": "string",
            "nullable": true
          },
          "paymentFormat": {
            "type": "string",
            "nullable": true
          },
          "fileName": {
            "type": "string",
            "nullable": true
          },
          "employeeCount": {
            "type": "integer",
            "format": "int32"
          },
          "totalRecords": {
            "type": "integer",
            "format": "int32"
          },
          "totalAmount": {
            "type": "number",
            "format": "double"
          },
          "paymentDate": {
            "type": "string",
            "nullable": true
          },
          "failedEmployeeIds": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "nullable": true
          },
          "error": {
            "type": "string",
            "nullable": true
          },
          "occurredAt": {
            "type": "string"
          },
          "resourceUrl": {
            "type": "string",
            "nullable": true
          },
          "kind": {
            "type": "string",
            "nullable": true
          },
          "supplementaryOfLockCycle": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Webhooks_PaymentFileEventWebhookEventEnvelope": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "type": {
            "type": "string"
          },
          "timestamp": {
            "type": "string"
          },
          "apiVersion": {
            "type": "string"
          },
          "organisationId": {
            "type": "string"
          },
          "customerId": {
            "type": "string"
          },
          "livemode": {
            "type": "boolean"
          },
          "data": {
            "$ref": "#/components/schemas/Webhooks_PaymentFileEvent"
          },
          "metadata": {
            "$ref": "#/components/schemas/Webhooks_WebhookEventMetadata"
          }
        },
        "additionalProperties": false
      },
      "Webhooks_PaymentFileLayout": {
        "required": [
          "columns",
          "extension"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "nullable": true
          },
          "name": {
            "type": "string",
            "nullable": true
          },
          "extension": {
            "type": "string"
          },
          "rowFormat": {
            "type": "string",
            "nullable": true
          },
          "delimiter": {
            "type": "string",
            "nullable": true
          },
          "headingRow": {
            "type": "boolean",
            "nullable": true
          },
          "lineEnding": {
            "type": "string",
            "nullable": true
          },
          "encoding": {
            "type": "string",
            "nullable": true
          },
          "columns": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Webhooks_PaymentFileLayoutColumn"
            }
          }
        },
        "additionalProperties": false
      },
      "Webhooks_PaymentFileLayoutColumn": {
        "required": [
          "field"
        ],
        "type": "object",
        "properties": {
          "field": {
            "type": "string"
          },
          "heading": {
            "type": "string",
            "nullable": true
          },
          "literal": {
            "type": "string",
            "nullable": true
          },
          "sortCode": {
            "type": "string",
            "nullable": true
          },
          "accountNumber": {
            "type": "string",
            "nullable": true
          },
          "amount": {
            "type": "string",
            "nullable": true
          },
          "dateFormat": {
            "type": "string",
            "nullable": true
          },
          "case": {
            "type": "string",
            "nullable": true
          },
          "characterSet": {
            "type": "string",
            "nullable": true
          },
          "trim": {
            "type": "boolean",
            "nullable": true
          },
          "maxLength": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "width": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "align": {
            "type": "string",
            "nullable": true
          },
          "pad": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Webhooks_PaymentSettingsEvent": {
        "required": [
          "eventType",
          "occurredAt",
          "organisationId",
          "payrollConfigId",
          "settings"
        ],
        "type": "object",
        "properties": {
          "eventType": {
            "type": "string"
          },
          "organisationId": {
            "type": "string"
          },
          "payrollConfigId": {
            "type": "string"
          },
          "settings": {
            "$ref": "#/components/schemas/Webhooks_PaymentConfigResponse"
          },
          "previousSettings": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/Webhooks_PaymentConfigResponse"
              },
              {
                "nullable": true
              }
            ]
          },
          "changedFields": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "nullable": true
          },
          "changedBy": {
            "type": "string",
            "nullable": true
          },
          "occurredAt": {
            "type": "string"
          },
          "resourceUrl": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Webhooks_PaymentSettingsEventWebhookEventEnvelope": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "type": {
            "type": "string"
          },
          "timestamp": {
            "type": "string"
          },
          "apiVersion": {
            "type": "string"
          },
          "organisationId": {
            "type": "string"
          },
          "customerId": {
            "type": "string"
          },
          "livemode": {
            "type": "boolean"
          },
          "data": {
            "$ref": "#/components/schemas/Webhooks_PaymentSettingsEvent"
          },
          "metadata": {
            "$ref": "#/components/schemas/Webhooks_WebhookEventMetadata"
          }
        },
        "additionalProperties": false
      },
      "Webhooks_PayrollLineEventNotificationDto": {
        "type": "object",
        "properties": {
          "organisationId": {
            "type": "string"
          },
          "clientId": {
            "type": "string",
            "nullable": true
          },
          "employeeId": {
            "type": "string"
          },
          "payrollLineId": {
            "type": "string"
          },
          "eventType": {
            "type": "string"
          },
          "eventDate": {
            "type": "string"
          },
          "payrollLine": {
            "$ref": "#/components/schemas/Webhooks_PayrollLineResponseDto"
          },
          "previousClientId": {
            "type": "string",
            "nullable": true
          },
          "previousInvoiceId": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Webhooks_PayrollLineEventNotificationDtoWebhookEventEnvelope": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "type": {
            "type": "string"
          },
          "timestamp": {
            "type": "string"
          },
          "apiVersion": {
            "type": "string"
          },
          "organisationId": {
            "type": "string"
          },
          "customerId": {
            "type": "string"
          },
          "livemode": {
            "type": "boolean"
          },
          "data": {
            "$ref": "#/components/schemas/Webhooks_PayrollLineEventNotificationDto"
          },
          "metadata": {
            "$ref": "#/components/schemas/Webhooks_WebhookEventMetadata"
          }
        },
        "additionalProperties": false
      },
      "Webhooks_PayrollLineResponseDto": {
        "required": [
          "createdBy",
          "createdDate",
          "updatedBy",
          "updatedDate"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "clientId": {
            "type": "string",
            "nullable": true
          },
          "employeeId": {
            "type": "string"
          },
          "date": {
            "type": "string",
            "nullable": true
          },
          "payrollDate": {
            "type": "string",
            "nullable": true
          },
          "description": {
            "type": "string"
          },
          "unitName": {
            "enum": [
              "Hour",
              "Day",
              "Week",
              "Month",
              "Year",
              "Fixed",
              "Informational",
              "Percentage"
            ],
            "type": "string"
          },
          "units": {
            "type": "number",
            "format": "double"
          },
          "payRate": {
            "type": "number",
            "format": "double"
          },
          "chargeRate": {
            "type": "number",
            "format": "double",
            "nullable": true
          },
          "chargeUnits": {
            "type": "number",
            "format": "double",
            "nullable": true
          },
          "chargeDescription": {
            "type": "string",
            "nullable": true
          },
          "payElementId": {
            "type": "string",
            "nullable": true
          },
          "taxType": {
            "enum": [
              "Taxable",
              "NonTaxable"
            ],
            "type": "string"
          },
          "niType": {
            "enum": [
              "Niable",
              "NonNiable",
              "EmployerOnly"
            ],
            "type": "string"
          },
          "payType": {
            "enum": [
              "Payable",
              "Deductible",
              "Informational"
            ],
            "type": "string"
          },
          "isPensionable": {
            "type": "boolean"
          },
          "tags": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Webhooks_TagDto"
            },
            "nullable": true
          },
          "statutoryType": {
            "enum": [
              "None",
              "StatutorySickPay",
              "StatutoryMaternityPay",
              "StatutoryPaternityPay",
              "StatutoryAdoptionPay",
              "SharedParentalPay",
              "StatutoryParentalBereavementPay",
              "StatutorySharedParentalPay",
              "StatutoryNeoNatalCarePay",
              "StatutoryParentalBereavementPayNorthernIreland"
            ],
            "type": "string"
          },
          "createdDate": {
            "minLength": 1,
            "type": "string"
          },
          "createdBy": {
            "minLength": 1,
            "type": "string"
          },
          "updatedDate": {
            "minLength": 1,
            "type": "string"
          },
          "updatedBy": {
            "minLength": 1,
            "type": "string"
          },
          "poNumber": {
            "type": "string",
            "nullable": true
          },
          "originalValue": {
            "type": "number",
            "format": "double",
            "nullable": true
          },
          "canEdit": {
            "type": "boolean"
          },
          "unitType": {
            "enum": [
              "Amount",
              "Percentage",
              null
            ],
            "type": "string",
            "nullable": true
          },
          "lineItemMetadata": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/Webhooks_LineItemMetadataDto"
              },
              {
                "nullable": true
              }
            ]
          },
          "eligibility": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/Webhooks_EligibilityDto"
              },
              {
                "nullable": true
              }
            ]
          },
          "paymentDetails": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/Webhooks_PaymentDetailsDto"
              },
              {
                "nullable": true
              }
            ]
          },
          "attachmentUploadUrls": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Webhooks_AttachmentUploadResponseDto"
            },
            "nullable": true
          },
          "attachments": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Webhooks_AttachmentResponseDto"
            },
            "nullable": true
          },
          "invoiceId": {
            "type": "string",
            "nullable": true
          },
          "creditNoteId": {
            "type": "string",
            "nullable": true
          },
          "billingStatus": {
            "enum": [
              "None",
              "Accrued",
              "Invoiced"
            ],
            "type": "string"
          },
          "paymentAfterLeavingPattern": {
            "enum": [
              "Irregular",
              "Regular",
              null
            ],
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Webhooks_PayrollRunCompletedNotification": {
        "type": "object",
        "properties": {
          "payrollRunEntryBaseData": {
            "$ref": "#/components/schemas/Webhooks_PayrollRunEntryBaseData"
          },
          "successCount": {
            "type": "integer",
            "format": "int32"
          },
          "failedCount": {
            "type": "integer",
            "format": "int32"
          },
          "totalCount": {
            "type": "integer",
            "format": "int32"
          },
          "completedDate": {
            "type": "string"
          },
          "lockCycle": {
            "type": "integer",
            "format": "int32"
          },
          "isRelock": {
            "type": "boolean",
            "readOnly": true
          }
        },
        "additionalProperties": false
      },
      "Webhooks_PayrollRunCompletedNotificationWebhookEventEnvelope": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "type": {
            "type": "string"
          },
          "timestamp": {
            "type": "string"
          },
          "apiVersion": {
            "type": "string"
          },
          "organisationId": {
            "type": "string"
          },
          "customerId": {
            "type": "string"
          },
          "livemode": {
            "type": "boolean"
          },
          "data": {
            "$ref": "#/components/schemas/Webhooks_PayrollRunCompletedNotification"
          },
          "metadata": {
            "$ref": "#/components/schemas/Webhooks_WebhookEventMetadata"
          }
        },
        "additionalProperties": false
      },
      "Webhooks_PayrollRunCreatedNotification": {
        "type": "object",
        "properties": {
          "payrollRunEntryBaseData": {
            "$ref": "#/components/schemas/Webhooks_PayrollRunEntryBaseData"
          }
        },
        "additionalProperties": false
      },
      "Webhooks_PayrollRunCreatedNotificationWebhookEventEnvelope": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "type": {
            "type": "string"
          },
          "timestamp": {
            "type": "string"
          },
          "apiVersion": {
            "type": "string"
          },
          "organisationId": {
            "type": "string"
          },
          "customerId": {
            "type": "string"
          },
          "livemode": {
            "type": "boolean"
          },
          "data": {
            "$ref": "#/components/schemas/Webhooks_PayrollRunCreatedNotification"
          },
          "metadata": {
            "$ref": "#/components/schemas/Webhooks_WebhookEventMetadata"
          }
        },
        "additionalProperties": false
      },
      "Webhooks_PayrollRunEntryBaseData": {
        "type": "object",
        "properties": {
          "organisationId": {
            "type": "string"
          },
          "organisationName": {
            "$ref": "#/components/schemas/Webhooks_OrganisationNameDto"
          },
          "payFrequency": {
            "type": "string"
          },
          "year": {
            "type": "integer",
            "format": "int32"
          },
          "period": {
            "type": "string"
          },
          "payrollConfigId": {
            "type": "string"
          },
          "periodStart": {
            "type": "string"
          },
          "periodEnd": {
            "type": "string"
          },
          "payPeriodStart": {
            "type": "string"
          },
          "payPeriodEnd": {
            "type": "string"
          },
          "paymentDate": {
            "type": "string"
          }
        },
        "additionalProperties": false
      },
      "Webhooks_PayrollRunLockedNotification": {
        "type": "object",
        "properties": {
          "payrollRunEntryBaseData": {
            "$ref": "#/components/schemas/Webhooks_PayrollRunEntryBaseData"
          },
          "lockCycle": {
            "type": "integer",
            "format": "int32"
          },
          "isRelock": {
            "type": "boolean",
            "readOnly": true
          }
        },
        "additionalProperties": false
      },
      "Webhooks_PayrollRunLockedNotificationWebhookEventEnvelope": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "type": {
            "type": "string"
          },
          "timestamp": {
            "type": "string"
          },
          "apiVersion": {
            "type": "string"
          },
          "organisationId": {
            "type": "string"
          },
          "customerId": {
            "type": "string"
          },
          "livemode": {
            "type": "boolean"
          },
          "data": {
            "$ref": "#/components/schemas/Webhooks_PayrollRunLockedNotification"
          },
          "metadata": {
            "$ref": "#/components/schemas/Webhooks_WebhookEventMetadata"
          }
        },
        "additionalProperties": false
      },
      "Webhooks_PayrollRunUnlockedNotification": {
        "type": "object",
        "properties": {
          "payrollRunEntryBaseData": {
            "$ref": "#/components/schemas/Webhooks_PayrollRunEntryBaseData"
          },
          "lockCycle": {
            "type": "integer",
            "format": "int32"
          },
          "scope": {
            "type": "string"
          },
          "employeeIds": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "reason": {
            "type": "string"
          },
          "unlockedBy": {
            "type": "string"
          },
          "unlockedDate": {
            "type": "string"
          },
          "widensCycle": {
            "type": "boolean"
          }
        },
        "additionalProperties": false
      },
      "Webhooks_PayrollRunUnlockedNotificationWebhookEventEnvelope": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "type": {
            "type": "string"
          },
          "timestamp": {
            "type": "string"
          },
          "apiVersion": {
            "type": "string"
          },
          "organisationId": {
            "type": "string"
          },
          "customerId": {
            "type": "string"
          },
          "livemode": {
            "type": "boolean"
          },
          "data": {
            "$ref": "#/components/schemas/Webhooks_PayrollRunUnlockedNotification"
          },
          "metadata": {
            "$ref": "#/components/schemas/Webhooks_WebhookEventMetadata"
          }
        },
        "additionalProperties": false
      },
      "Webhooks_PayslipAlertDto": {
        "required": [
          "code",
          "severity"
        ],
        "type": "object",
        "properties": {
          "code": {
            "enum": [
              "MissingBankAccount",
              "NationalMinimumWageBreach",
              "NiCategoryChanged",
              "LeaverOnThisPayRun",
              "PaymentAfterLeaving",
              "CourtOrderNoTableForPayFrequency",
              "EmergencyTaxCode"
            ],
            "type": "string"
          },
          "severity": {
            "enum": [
              "Info",
              "Warning",
              "Error"
            ],
            "type": "string"
          },
          "context": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Webhooks_PayslipDeletedNotificationDto": {
        "type": "object",
        "properties": {
          "organisationId": {
            "type": "string"
          },
          "employeeId": {
            "type": "string"
          },
          "payrollConfigId": {
            "type": "string"
          },
          "year": {
            "type": "integer",
            "format": "int32"
          },
          "period": {
            "type": "integer",
            "format": "int32"
          },
          "frequency": {
            "type": "string"
          }
        },
        "additionalProperties": false
      },
      "Webhooks_PayslipDeletedNotificationDtoWebhookEventEnvelope": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "type": {
            "type": "string"
          },
          "timestamp": {
            "type": "string"
          },
          "apiVersion": {
            "type": "string"
          },
          "organisationId": {
            "type": "string"
          },
          "customerId": {
            "type": "string"
          },
          "livemode": {
            "type": "boolean"
          },
          "data": {
            "$ref": "#/components/schemas/Webhooks_PayslipDeletedNotificationDto"
          },
          "metadata": {
            "$ref": "#/components/schemas/Webhooks_WebhookEventMetadata"
          }
        },
        "additionalProperties": false
      },
      "Webhooks_PayslipDto": {
        "type": "object",
        "properties": {
          "employeeDetails": {
            "$ref": "#/components/schemas/Webhooks_PayslipEmployeeDetailsDto"
          },
          "employerDetails": {
            "$ref": "#/components/schemas/Webhooks_PayslipEmployerDetailsDto"
          },
          "year": {
            "type": "integer",
            "format": "int32"
          },
          "period": {
            "type": "integer",
            "format": "int32"
          },
          "payrollConfigId": {
            "type": "string"
          },
          "frequency": {
            "enum": [
              "Annual",
              "Monthly",
              "FourWeekly",
              "Fortnightly",
              "Weekly",
              "Daily",
              "Quarterly",
              "BiAnnually"
            ],
            "type": "string"
          },
          "summaryItems": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Webhooks_PayslipSummaryItemDto"
            }
          },
          "forPeriod": {
            "$ref": "#/components/schemas/Webhooks_BaseValuesDto"
          },
          "yearToDate": {
            "$ref": "#/components/schemas/Webhooks_BaseValuesDto"
          },
          "forEmployment": {
            "$ref": "#/components/schemas/Webhooks_BaseValuesDto"
          },
          "createdDate": {
            "type": "string"
          },
          "createdBy": {
            "type": "string"
          },
          "updatedDate": {
            "type": "string"
          },
          "updatedBy": {
            "type": "string"
          },
          "status": {
            "enum": [
              "Preview",
              "Final",
              "Reopened"
            ],
            "type": "string"
          },
          "payslipMetadata": {
            "$ref": "#/components/schemas/Webhooks_PayslipMetadataDto"
          },
          "paymentDate": {
            "type": "string",
            "nullable": true
          },
          "payPeriodStartDate": {
            "type": "string"
          },
          "payPeriodEndDate": {
            "type": "string"
          },
          "lateReason": {
            "enum": [
              "NotionalPaymentToExpartByThirdPartyOrOverseasEmployer",
              "NotionalPaymentEmploymentRelatedSecurity",
              "NotionalPaymentOther",
              "PaymentSubjectToClass1NicButP11dP9dForTax",
              "MicroEmployerUsingTemporaryOnOrBeforeRelaxation",
              "NoRequirementToMaintainADeductionsWorkingSheetOrImpossibleToReportWorkDoneOnTheDay",
              "ReasonableExcuse",
              "CorrectionToEarlierSubmission",
              null
            ],
            "type": "string",
            "nullable": true
          },
          "alerts": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Webhooks_PayslipAlertDto"
            },
            "nullable": true
          },
          "lastEmailedAt": {
            "type": "string",
            "nullable": true
          },
          "lastEmailedTo": {
            "type": "string",
            "nullable": true
          },
          "lastEmailedBy": {
            "type": "string",
            "nullable": true
          },
          "lastEmailedStatus": {
            "enum": [
              "Sent",
              "Failed",
              null
            ],
            "type": "string",
            "nullable": true
          },
          "lastEmailError": {
            "type": "string",
            "nullable": true
          },
          "versionId": {
            "type": "string",
            "nullable": true
          },
          "lockCycle": {
            "type": "integer",
            "format": "int32"
          }
        },
        "additionalProperties": false
      },
      "Webhooks_PayslipEmployeeDetailsDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "$ref": "#/components/schemas/Webhooks_EmployeeNameDto"
          },
          "email": {
            "type": "string"
          },
          "secondaryEmail": {
            "type": "string",
            "nullable": true
          },
          "address": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/Webhooks_AddressDto"
              },
              {
                "nullable": true
              }
            ]
          },
          "birthDate": {
            "type": "string"
          },
          "birthGender": {
            "enum": [
              "Male",
              "Female"
            ],
            "type": "string"
          },
          "payrollId": {
            "type": "string",
            "nullable": true
          },
          "employeeCode": {
            "type": "string",
            "nullable": true
          },
          "hoursWorkedCategory": {
            "enum": [
              "UpTo16Hours",
              "From16To24Hours",
              "From24To30Hours",
              "Above30Hours",
              "Other"
            ],
            "type": "string"
          },
          "taxCode": {
            "$ref": "#/components/schemas/Webhooks_EmployeeTaxCodeDto"
          },
          "nationalInsuranceCategory": {
            "type": "string"
          },
          "nationalInsuranceNumber": {
            "type": "string"
          },
          "passportNumber": {
            "type": "string",
            "nullable": true
          },
          "starterDetails": {
            "$ref": "#/components/schemas/Webhooks_EmployeeStarterDetailsDto"
          },
          "studentDetails": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/Webhooks_EmployeeStudentDetailsDto"
              },
              {
                "nullable": true
              }
            ]
          },
          "directorDetails": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/Webhooks_EmployeeDirectorDetailsDto"
              },
              {
                "nullable": true
              }
            ]
          },
          "leaverDetails": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/Webhooks_EmployeeLeaverDetailsDto"
              },
              {
                "nullable": true
              }
            ]
          },
          "workplaceDetails": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/Webhooks_EmployeeWorkplaceDetailsDto"
              },
              {
                "nullable": true
              }
            ]
          },
          "bankAccounts": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Webhooks_BankAccountDto"
            },
            "nullable": true
          },
          "department": {
            "type": "string",
            "nullable": true
          },
          "jobTitle": {
            "type": "string",
            "nullable": true
          },
          "pensionDetails": {
            "oneOf": [
              {
                "deprecated": true,
                "$ref": "#/components/schemas/Webhooks_PensionEmployeeConfigDto"
              },
              {
                "nullable": true
              }
            ]
          },
          "tags": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Webhooks_TagDto"
            },
            "nullable": true
          },
          "isPaymentAfterLeaving": {
            "type": "boolean"
          }
        },
        "additionalProperties": false
      },
      "Webhooks_PayslipEmployerDetailsDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "organisationInformation": {
            "$ref": "#/components/schemas/Webhooks_OrganisationInformationDto"
          },
          "taxReferenceNumbers": {
            "$ref": "#/components/schemas/Webhooks_TaxReferenceNumbersDto"
          }
        },
        "additionalProperties": false
      },
      "Webhooks_PayslipMetadataDto": {
        "type": "object",
        "properties": {
          "notes": {
            "type": "string",
            "nullable": true
          },
          "paymentDateOverwrite": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Webhooks_PayslipNotificationDto": {
        "type": "object",
        "properties": {
          "organisationId": {
            "type": "string"
          },
          "payrollConfigId": {
            "type": "string"
          },
          "recipientDetails": {
            "$ref": "#/components/schemas/Webhooks_RecipientDetailsDto"
          },
          "payslip": {
            "$ref": "#/components/schemas/Webhooks_PayslipDto"
          },
          "triggeredBy": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Webhooks_PayslipNotificationDtoWebhookEventEnvelope": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "type": {
            "type": "string"
          },
          "timestamp": {
            "type": "string"
          },
          "apiVersion": {
            "type": "string"
          },
          "organisationId": {
            "type": "string"
          },
          "customerId": {
            "type": "string"
          },
          "livemode": {
            "type": "boolean"
          },
          "data": {
            "$ref": "#/components/schemas/Webhooks_PayslipNotificationDto"
          },
          "metadata": {
            "$ref": "#/components/schemas/Webhooks_WebhookEventMetadata"
          }
        },
        "additionalProperties": false
      },
      "Webhooks_PayslipSummaryItemCalculationFlagsDto": {
        "required": [
          "accrueHoliday",
          "isClass1ANiable",
          "isPensionable",
          "niType",
          "payType"
        ],
        "type": "object",
        "properties": {
          "niType": {
            "enum": [
              "Niable",
              "NonNiable",
              "EmployerOnly"
            ],
            "type": "string"
          },
          "payType": {
            "enum": [
              "Payable",
              "Deductible",
              "Informational"
            ],
            "type": "string"
          },
          "isPensionable": {
            "type": "boolean"
          },
          "accrueHoliday": {
            "type": "boolean"
          },
          "isClass1ANiable": {
            "type": "boolean"
          },
          "subjectToNmwCheck": {
            "type": "boolean"
          },
          "taxType": {
            "enum": [
              "Taxable",
              "NonTaxable",
              null
            ],
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Webhooks_PayslipSummaryItemDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "amount": {
            "type": "number",
            "format": "double"
          },
          "type": {
            "enum": [
              "Employee",
              "Employer"
            ],
            "type": "string"
          },
          "category": {
            "enum": [
              "Earning",
              "Deduction",
              "Informational"
            ],
            "type": "string"
          },
          "payRate": {
            "type": "number",
            "format": "double"
          },
          "payElementId": {
            "type": "string"
          },
          "unitName": {
            "enum": [
              "Hour",
              "Day",
              "Week",
              "Month",
              "Year",
              "Fixed",
              "Informational",
              "Percentage"
            ],
            "type": "string"
          },
          "units": {
            "type": "number",
            "format": "double"
          },
          "chargeRate": {
            "type": "number",
            "format": "double",
            "nullable": true
          },
          "chargeUnits": {
            "type": "number",
            "format": "double",
            "nullable": true
          },
          "chargeValue": {
            "type": "number",
            "format": "double",
            "nullable": true
          },
          "chargeDescription": {
            "type": "string",
            "nullable": true
          },
          "date": {
            "type": "string"
          },
          "isNetDeduction": {
            "type": "boolean"
          },
          "tags": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Webhooks_TagDto"
            },
            "nullable": true
          },
          "unitType": {
            "enum": [
              "Amount",
              "Percentage",
              null
            ],
            "type": "string",
            "nullable": true
          },
          "originalValue": {
            "type": "number",
            "format": "double",
            "nullable": true
          },
          "lineItemSequence": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "courtOrderId": {
            "type": "string",
            "nullable": true
          },
          "courtOrderType": {
            "enum": [
              "None",
              "CmsDeo",
              "AeoPriority",
              "AeoNonPriority",
              "Dea",
              "Ctaeo",
              "Ea",
              "Mcaeo",
              "Cma",
              "Cao",
              "NiFinesAeo",
              "NiEjoAeo",
              null
            ],
            "type": "string",
            "nullable": true
          },
          "canEdit": {
            "type": "boolean"
          },
          "eligibility": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/Webhooks_EligibilityDto"
              },
              {
                "nullable": true
              }
            ]
          },
          "paymentDetails": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/Webhooks_PaymentDetailsDto"
              },
              {
                "nullable": true
              }
            ]
          },
          "attachments": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Webhooks_AttachmentResponseDto"
            },
            "nullable": true
          },
          "poNumber": {
            "type": "string",
            "nullable": true
          },
          "clientId": {
            "type": "string",
            "nullable": true
          },
          "invoiceId": {
            "type": "string",
            "nullable": true
          },
          "billingStatus": {
            "enum": [
              "None",
              "Accrued",
              "Invoiced"
            ],
            "type": "string"
          },
          "calculationFlags": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/Webhooks_PayslipSummaryItemCalculationFlagsDto"
              },
              {
                "nullable": true
              }
            ]
          },
          "wasReducedByProtectedEarnings": {
            "type": "boolean"
          },
          "tax": {
            "type": "number",
            "format": "double",
            "nullable": true
          },
          "employeeNi": {
            "type": "number",
            "format": "double",
            "nullable": true
          },
          "employeePension": {
            "type": "number",
            "format": "double",
            "nullable": true
          },
          "studentLoan": {
            "type": "number",
            "format": "double",
            "nullable": true
          },
          "postgraduateLoan": {
            "type": "number",
            "format": "double",
            "nullable": true
          },
          "employerNi": {
            "type": "number",
            "format": "double",
            "nullable": true
          },
          "employerClass1ANi": {
            "type": "number",
            "format": "double",
            "nullable": true
          },
          "employerPension": {
            "type": "number",
            "format": "double",
            "nullable": true
          },
          "apprenticeshipLevy": {
            "type": "number",
            "format": "double",
            "nullable": true
          },
          "employmentAllowance": {
            "type": "number",
            "format": "double",
            "nullable": true
          },
          "apprenticeshipLevyAllowance": {
            "type": "number",
            "format": "double",
            "nullable": true
          },
          "pensionSacrificeAmount": {
            "type": "number",
            "format": "double",
            "nullable": true
          },
          "pensionEmployerContribution": {
            "type": "number",
            "format": "double",
            "nullable": true
          },
          "pensionLineType": {
            "type": "string",
            "nullable": true
          },
          "ordinaryDebtDeducted": {
            "type": "number",
            "format": "double",
            "nullable": true
          },
          "pensionMetadata": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/Webhooks_PensionMetadataSectionDto"
              },
              {
                "nullable": true
              }
            ]
          }
        },
        "additionalProperties": false
      },
      "Webhooks_PensionEmployeeConfigDto": {
        "type": "object",
        "properties": {
          "employeeId": {
            "type": "string"
          },
          "pensionGroupId": {
            "type": "string"
          },
          "employeePensionRate": {
            "type": "number",
            "format": "double"
          },
          "employerPensionRate": {
            "type": "number",
            "format": "double"
          },
          "pensionType": {
            "enum": [
              "NetPayArrangement",
              "ReliefAtSource",
              "SalarySacrifice"
            ],
            "type": "string"
          },
          "nationalInsuranceSavingFactor": {
            "type": "number",
            "format": "double"
          },
          "isQualifyingEarnings": {
            "type": "boolean"
          }
        },
        "additionalProperties": false
      },
      "Webhooks_PensionMemberEvent": {
        "required": [
          "employeeId",
          "eventType",
          "occurredAt",
          "organisationId"
        ],
        "type": "object",
        "properties": {
          "eventType": {
            "type": "string"
          },
          "organisationId": {
            "type": "string"
          },
          "employeeId": {
            "type": "string"
          },
          "pensionGroupId": {
            "type": "string",
            "nullable": true
          },
          "previousPensionGroupId": {
            "type": "string",
            "nullable": true
          },
          "enrolmentRoute": {
            "type": "string",
            "nullable": true
          },
          "enrolmentDate": {
            "type": "string",
            "nullable": true
          },
          "reEnrolmentDate": {
            "type": "string",
            "nullable": true
          },
          "assessmentCategory": {
            "type": "string",
            "nullable": true
          },
          "assessmentDate": {
            "type": "string",
            "nullable": true
          },
          "payrollConfigId": {
            "type": "string",
            "nullable": true
          },
          "taxYear": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "frequency": {
            "type": "string",
            "nullable": true
          },
          "payPeriod": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "postponementType": {
            "type": "string",
            "nullable": true
          },
          "postponementEndDate": {
            "type": "string",
            "nullable": true
          },
          "membershipEndDate": {
            "type": "string",
            "nullable": true
          },
          "endReason": {
            "type": "string",
            "nullable": true
          },
          "refundProcessedThroughPayroll": {
            "type": "boolean",
            "nullable": true
          },
          "noPayrollRefundReason": {
            "type": "string",
            "nullable": true
          },
          "withinOptOutPeriod": {
            "type": "boolean",
            "nullable": true
          },
          "letterSentAt": {
            "type": "string",
            "nullable": true
          },
          "enrolmentInformationGivenDate": {
            "type": "string",
            "nullable": true
          },
          "postponementNoticeGivenDate": {
            "type": "string",
            "nullable": true
          },
          "optInInformationGivenDate": {
            "type": "string",
            "nullable": true
          },
          "exemptionReason": {
            "type": "string",
            "nullable": true
          },
          "occurredAt": {
            "type": "string"
          },
          "resourceUrl": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Webhooks_PensionMemberEventWebhookEventEnvelope": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "type": {
            "type": "string"
          },
          "timestamp": {
            "type": "string"
          },
          "apiVersion": {
            "type": "string"
          },
          "organisationId": {
            "type": "string"
          },
          "customerId": {
            "type": "string"
          },
          "livemode": {
            "type": "boolean"
          },
          "data": {
            "$ref": "#/components/schemas/Webhooks_PensionMemberEvent"
          },
          "metadata": {
            "$ref": "#/components/schemas/Webhooks_WebhookEventMetadata"
          }
        },
        "additionalProperties": false
      },
      "Webhooks_PensionMetadataSectionDto": {
        "type": "object",
        "properties": {
          "pensionGroupId": {
            "type": "string",
            "nullable": true
          },
          "contributionSource": {
            "type": "string",
            "nullable": true
          },
          "basis": {
            "type": "string",
            "nullable": true
          },
          "employerContributionType": {
            "type": "string",
            "nullable": true
          },
          "employerContributionValue": {
            "type": "number",
            "format": "double",
            "nullable": true
          },
          "nationalInsuranceSavingsFactor": {
            "type": "number",
            "format": "double",
            "nullable": true
          },
          "employerRefundAmount": {
            "type": "number",
            "format": "double",
            "nullable": true
          },
          "reliefAtSourceApplied": {
            "type": "boolean",
            "nullable": true
          },
          "reliefAtSourceWithheldReason": {
            "type": "string",
            "nullable": true
          },
          "pensionType": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Webhooks_PensionProviderSubmissionEvent": {
        "required": [
          "eventType",
          "frequency",
          "occurredAt",
          "organisationId",
          "payPeriod",
          "payrollConfigId",
          "providerSlug",
          "schemeId",
          "status",
          "submissionType",
          "taxYear"
        ],
        "type": "object",
        "properties": {
          "eventType": {
            "type": "string"
          },
          "organisationId": {
            "type": "string"
          },
          "schemeId": {
            "type": "string"
          },
          "payrollConfigId": {
            "type": "string"
          },
          "taxYear": {
            "type": "integer",
            "format": "int32"
          },
          "frequency": {
            "type": "string"
          },
          "payPeriod": {
            "type": "integer",
            "format": "int32"
          },
          "submissionType": {
            "type": "string"
          },
          "status": {
            "type": "string"
          },
          "providerSlug": {
            "type": "string"
          },
          "memberCount": {
            "type": "integer",
            "format": "int32"
          },
          "totalAmount": {
            "type": "number",
            "format": "double"
          },
          "providerReference": {
            "type": "string",
            "nullable": true
          },
          "reason": {
            "type": "string",
            "nullable": true
          },
          "occurredAt": {
            "type": "string"
          },
          "resourceUrl": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Webhooks_PensionProviderSubmissionEventWebhookEventEnvelope": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "type": {
            "type": "string"
          },
          "timestamp": {
            "type": "string"
          },
          "apiVersion": {
            "type": "string"
          },
          "organisationId": {
            "type": "string"
          },
          "customerId": {
            "type": "string"
          },
          "livemode": {
            "type": "boolean"
          },
          "data": {
            "$ref": "#/components/schemas/Webhooks_PensionProviderSubmissionEvent"
          },
          "metadata": {
            "$ref": "#/components/schemas/Webhooks_WebhookEventMetadata"
          }
        },
        "additionalProperties": false
      },
      "Webhooks_RecipientDetailsDto": {
        "type": "object",
        "properties": {
          "email": {
            "type": "string"
          },
          "phone": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Webhooks_RecurringLineItemEvent": {
        "required": [
          "description",
          "employeeId",
          "eventType",
          "mode",
          "occurredAt",
          "organisationId",
          "payElementId",
          "recurringLineItemId",
          "startDate",
          "status"
        ],
        "type": "object",
        "properties": {
          "eventType": {
            "type": "string"
          },
          "organisationId": {
            "type": "string"
          },
          "employeeId": {
            "type": "string"
          },
          "recurringLineItemId": {
            "type": "string"
          },
          "payElementId": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "mode": {
            "type": "string"
          },
          "status": {
            "type": "string"
          },
          "startDate": {
            "type": "string"
          },
          "endDate": {
            "type": "string",
            "nullable": true
          },
          "amountPerPeriod": {
            "type": "number",
            "format": "double"
          },
          "balanceTarget": {
            "type": "number",
            "format": "double",
            "nullable": true
          },
          "amountSettledToDate": {
            "type": "number",
            "format": "double",
            "nullable": true
          },
          "balanceRemaining": {
            "type": "number",
            "format": "double",
            "nullable": true
          },
          "reason": {
            "type": "string",
            "nullable": true
          },
          "occurredAt": {
            "type": "string"
          },
          "resourceUrl": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Webhooks_RecurringLineItemEventWebhookEventEnvelope": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "type": {
            "type": "string"
          },
          "timestamp": {
            "type": "string"
          },
          "apiVersion": {
            "type": "string"
          },
          "organisationId": {
            "type": "string"
          },
          "customerId": {
            "type": "string"
          },
          "livemode": {
            "type": "boolean"
          },
          "data": {
            "$ref": "#/components/schemas/Webhooks_RecurringLineItemEvent"
          },
          "metadata": {
            "$ref": "#/components/schemas/Webhooks_WebhookEventMetadata"
          }
        },
        "additionalProperties": false
      },
      "Webhooks_RecurringLineItemMetadataSectionDto": {
        "type": "object",
        "properties": {
          "recurringLineItemId": {
            "type": "string",
            "nullable": true
          },
          "protectedEarningsSetting": {
            "type": "string",
            "nullable": true
          },
          "protectedEarningsAmount": {
            "type": "number",
            "format": "double",
            "nullable": true
          },
          "protectedEarningsPercentage": {
            "type": "number",
            "format": "double",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Webhooks_RecurringLineItemPeriodEvent": {
        "required": [
          "employeeId",
          "eventType",
          "occurredAt",
          "organisationId",
          "payFrequency",
          "payPeriodEndDate",
          "payPeriodStartDate",
          "payrollConfigId",
          "periodId",
          "recurringLineItemId",
          "status"
        ],
        "type": "object",
        "properties": {
          "eventType": {
            "type": "string"
          },
          "organisationId": {
            "type": "string"
          },
          "employeeId": {
            "type": "string"
          },
          "recurringLineItemId": {
            "type": "string"
          },
          "periodId": {
            "type": "string"
          },
          "payrollConfigId": {
            "type": "string"
          },
          "taxYear": {
            "type": "integer",
            "format": "int32"
          },
          "taxYearPeriod": {
            "type": "integer",
            "format": "int32"
          },
          "payPeriodStartDate": {
            "type": "string"
          },
          "payPeriodEndDate": {
            "type": "string"
          },
          "payFrequency": {
            "type": "string"
          },
          "status": {
            "type": "string"
          },
          "originalValue": {
            "type": "number",
            "format": "double"
          },
          "actualDeductedAmount": {
            "type": "number",
            "format": "double"
          },
          "shortfallAmount": {
            "type": "number",
            "format": "double"
          },
          "balanceRemainingAfter": {
            "type": "number",
            "format": "double",
            "nullable": true
          },
          "reason": {
            "type": "string",
            "nullable": true
          },
          "occurredAt": {
            "type": "string"
          },
          "resourceUrl": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Webhooks_RecurringLineItemPeriodEventWebhookEventEnvelope": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "type": {
            "type": "string"
          },
          "timestamp": {
            "type": "string"
          },
          "apiVersion": {
            "type": "string"
          },
          "organisationId": {
            "type": "string"
          },
          "customerId": {
            "type": "string"
          },
          "livemode": {
            "type": "boolean"
          },
          "data": {
            "$ref": "#/components/schemas/Webhooks_RecurringLineItemPeriodEvent"
          },
          "metadata": {
            "$ref": "#/components/schemas/Webhooks_WebhookEventMetadata"
          }
        },
        "additionalProperties": false
      },
      "Webhooks_ReplayJobResponse": {
        "required": [
          "createdDate",
          "ownerId",
          "replayId",
          "replayed",
          "request",
          "scope",
          "status"
        ],
        "type": "object",
        "properties": {
          "replayId": {
            "type": "string"
          },
          "status": {
            "enum": [
              "Queued",
              "Running",
              "Completed",
              "Cancelled"
            ],
            "type": "string"
          },
          "scope": {
            "enum": [
              "Organisation",
              "Customer"
            ],
            "type": "string"
          },
          "ownerId": {
            "type": "string"
          },
          "request": {
            "$ref": "#/components/schemas/Webhooks_CreateReplayRequest"
          },
          "replayed": {
            "type": "integer",
            "format": "int32"
          },
          "createdDate": {
            "type": "string"
          },
          "finishedDate": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Webhooks_ReplayJobResponseContentResponse": {
        "type": "object",
        "properties": {
          "data": {
            "$ref": "#/components/schemas/Webhooks_ReplayJobResponse"
          },
          "metadata": {
            "$ref": "#/components/schemas/Webhooks_ContentMetadataResponse"
          }
        },
        "additionalProperties": false
      },
      "Webhooks_ReplayJobResponseListContentResponse": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Webhooks_ReplayJobResponse"
            },
            "nullable": true
          },
          "metadata": {
            "$ref": "#/components/schemas/Webhooks_ContentMetadataResponse"
          }
        },
        "additionalProperties": false
      },
      "Webhooks_ReplayJobResponseListResponseBody": {
        "type": "object",
        "properties": {
          "message": {
            "$ref": "#/components/schemas/Webhooks_MessageWithTokenResponse"
          },
          "content": {
            "$ref": "#/components/schemas/Webhooks_ReplayJobResponseListContentResponse"
          },
          "validationIssues": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Webhooks_ValidationIssue"
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Webhooks_ReplayJobResponseResponseBody": {
        "type": "object",
        "properties": {
          "message": {
            "$ref": "#/components/schemas/Webhooks_MessageWithTokenResponse"
          },
          "content": {
            "$ref": "#/components/schemas/Webhooks_ReplayJobResponseContentResponse"
          },
          "validationIssues": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Webhooks_ValidationIssue"
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Webhooks_ReportExportEvent": {
        "required": [
          "eventType",
          "format",
          "mode",
          "occurredAt",
          "organisationId",
          "runId",
          "status"
        ],
        "type": "object",
        "properties": {
          "eventType": {
            "type": "string"
          },
          "organisationId": {
            "type": "string"
          },
          "runId": {
            "type": "string"
          },
          "mode": {
            "type": "string"
          },
          "definitionId": {
            "type": "string",
            "nullable": true
          },
          "scheduleId": {
            "type": "string",
            "nullable": true
          },
          "format": {
            "type": "string"
          },
          "status": {
            "type": "string"
          },
          "rowCount": {
            "type": "integer",
            "format": "int64",
            "nullable": true
          },
          "error": {
            "type": "string",
            "nullable": true
          },
          "occurredAt": {
            "type": "string"
          },
          "resourceUrl": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Webhooks_ReportExportEventWebhookEventEnvelope": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "type": {
            "type": "string"
          },
          "timestamp": {
            "type": "string"
          },
          "apiVersion": {
            "type": "string"
          },
          "organisationId": {
            "type": "string"
          },
          "customerId": {
            "type": "string"
          },
          "livemode": {
            "type": "boolean"
          },
          "data": {
            "$ref": "#/components/schemas/Webhooks_ReportExportEvent"
          },
          "metadata": {
            "$ref": "#/components/schemas/Webhooks_WebhookEventMetadata"
          }
        },
        "additionalProperties": false
      },
      "Webhooks_RtiSubmissionError": {
        "type": "object",
        "properties": {
          "code": {
            "type": "string",
            "nullable": true
          },
          "message": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Webhooks_RtiSubmissionEvent": {
        "type": "object",
        "properties": {
          "eventType": {
            "type": "string"
          },
          "organisationId": {
            "type": "string"
          },
          "payrollConfigId": {
            "type": "string",
            "nullable": true
          },
          "taxYear": {
            "type": "integer",
            "format": "int32"
          },
          "period": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "submissionId": {
            "type": "string",
            "nullable": true
          },
          "correlationId": {
            "type": "string",
            "nullable": true
          },
          "occurredAt": {
            "type": "string"
          },
          "errors": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Webhooks_RtiSubmissionError"
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Webhooks_RtiSubmissionEventWebhookEventEnvelope": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "type": {
            "type": "string"
          },
          "timestamp": {
            "type": "string"
          },
          "apiVersion": {
            "type": "string"
          },
          "organisationId": {
            "type": "string"
          },
          "customerId": {
            "type": "string"
          },
          "livemode": {
            "type": "boolean"
          },
          "data": {
            "$ref": "#/components/schemas/Webhooks_RtiSubmissionEvent"
          },
          "metadata": {
            "$ref": "#/components/schemas/Webhooks_WebhookEventMetadata"
          }
        },
        "additionalProperties": false
      },
      "Webhooks_SalaryConfigurationEvent": {
        "required": [
          "eventType",
          "occurredAt",
          "organisationId"
        ],
        "type": "object",
        "properties": {
          "eventType": {
            "type": "string"
          },
          "organisationId": {
            "type": "string"
          },
          "employeeId": {
            "type": "string",
            "nullable": true
          },
          "calculationMethod": {
            "enum": [
              "CalendarDays",
              "WorkingDays",
              null
            ],
            "type": "string",
            "nullable": true
          },
          "enabled": {
            "type": "boolean",
            "nullable": true
          },
          "occurredAt": {
            "type": "string"
          },
          "resourceUrl": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Webhooks_SalaryConfigurationEventWebhookEventEnvelope": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "type": {
            "type": "string"
          },
          "timestamp": {
            "type": "string"
          },
          "apiVersion": {
            "type": "string"
          },
          "organisationId": {
            "type": "string"
          },
          "customerId": {
            "type": "string"
          },
          "livemode": {
            "type": "boolean"
          },
          "data": {
            "$ref": "#/components/schemas/Webhooks_SalaryConfigurationEvent"
          },
          "metadata": {
            "$ref": "#/components/schemas/Webhooks_WebhookEventMetadata"
          }
        },
        "additionalProperties": false
      },
      "Webhooks_SalaryStatutoryLeavePolicyEvent": {
        "required": [
          "eventType",
          "occurredAt",
          "organisationId"
        ],
        "type": "object",
        "properties": {
          "eventType": {
            "type": "string"
          },
          "organisationId": {
            "type": "string"
          },
          "employeeId": {
            "type": "string",
            "nullable": true
          },
          "policies": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/Webhooks_StatutoryLeavePolicyDocument"
              },
              {
                "nullable": true
              }
            ]
          },
          "occurredAt": {
            "type": "string"
          },
          "resourceUrl": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Webhooks_SalaryStatutoryLeavePolicyEventWebhookEventEnvelope": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "type": {
            "type": "string"
          },
          "timestamp": {
            "type": "string"
          },
          "apiVersion": {
            "type": "string"
          },
          "organisationId": {
            "type": "string"
          },
          "customerId": {
            "type": "string"
          },
          "livemode": {
            "type": "boolean"
          },
          "data": {
            "$ref": "#/components/schemas/Webhooks_SalaryStatutoryLeavePolicyEvent"
          },
          "metadata": {
            "$ref": "#/components/schemas/Webhooks_WebhookEventMetadata"
          }
        },
        "additionalProperties": false
      },
      "Webhooks_SigningSecretResponse": {
        "required": [
          "createdDate",
          "publicKey",
          "secretId",
          "status"
        ],
        "type": "object",
        "properties": {
          "secretId": {
            "type": "string"
          },
          "status": {
            "enum": [
              "Revoked",
              "Active",
              "Expiring"
            ],
            "type": "string"
          },
          "createdDate": {
            "type": "string"
          },
          "expiresDate": {
            "type": "string",
            "nullable": true
          },
          "publicKey": {
            "type": "string"
          }
        },
        "additionalProperties": false
      },
      "Webhooks_SigningSecretResponseContentResponse": {
        "type": "object",
        "properties": {
          "data": {
            "$ref": "#/components/schemas/Webhooks_SigningSecretResponse"
          },
          "metadata": {
            "$ref": "#/components/schemas/Webhooks_ContentMetadataResponse"
          }
        },
        "additionalProperties": false
      },
      "Webhooks_SigningSecretResponseListContentResponse": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Webhooks_SigningSecretResponse"
            },
            "nullable": true
          },
          "metadata": {
            "$ref": "#/components/schemas/Webhooks_ContentMetadataResponse"
          }
        },
        "additionalProperties": false
      },
      "Webhooks_SigningSecretResponseListResponseBody": {
        "type": "object",
        "properties": {
          "message": {
            "$ref": "#/components/schemas/Webhooks_MessageWithTokenResponse"
          },
          "content": {
            "$ref": "#/components/schemas/Webhooks_SigningSecretResponseListContentResponse"
          },
          "validationIssues": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Webhooks_ValidationIssue"
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Webhooks_SigningSecretResponseResponseBody": {
        "type": "object",
        "properties": {
          "message": {
            "$ref": "#/components/schemas/Webhooks_MessageWithTokenResponse"
          },
          "content": {
            "$ref": "#/components/schemas/Webhooks_SigningSecretResponseContentResponse"
          },
          "validationIssues": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Webhooks_ValidationIssue"
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Webhooks_StatutoryLeavePolicyDocument": {
        "type": "object",
        "properties": {
          "sickness": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/Webhooks_StatutoryLeavePolicyDto"
              },
              {
                "nullable": true
              }
            ]
          },
          "familyLeave": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/Webhooks_StatutoryLeavePolicyDto"
              },
              {
                "nullable": true
              }
            ]
          },
          "byType": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/Webhooks_StatutoryLeaveTypePolicies"
              },
              {
                "nullable": true
              }
            ]
          }
        },
        "additionalProperties": false
      },
      "Webhooks_StatutoryLeavePolicyDto": {
        "type": "object",
        "properties": {
          "salaryTreatment": {
            "enum": [
              "DeductAbsentDays",
              "FullPay",
              null
            ],
            "type": "string",
            "nullable": true
          },
          "topUp": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/Webhooks_StatutoryLeaveTopUpDto"
              },
              {
                "nullable": true
              }
            ]
          }
        },
        "additionalProperties": false
      },
      "Webhooks_StatutoryLeaveTopUpDto": {
        "type": "object",
        "properties": {
          "tiers": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Webhooks_StatutoryLeaveTopUpTierDto"
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Webhooks_StatutoryLeaveTopUpTierDto": {
        "type": "object",
        "properties": {
          "duration": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/Webhooks_DurationDto"
              },
              {
                "nullable": true
              }
            ]
          },
          "percentOfSalary": {
            "type": "number",
            "format": "double",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Webhooks_StatutoryLeaveTypePolicies": {
        "type": "object",
        "properties": {
          "StatutoryMaternityPay": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/Webhooks_StatutoryLeavePolicyDto"
              },
              {
                "nullable": true
              }
            ]
          },
          "StatutoryPaternityPay": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/Webhooks_StatutoryLeavePolicyDto"
              },
              {
                "nullable": true
              }
            ]
          },
          "StatutoryAdoptionPay": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/Webhooks_StatutoryLeavePolicyDto"
              },
              {
                "nullable": true
              }
            ]
          },
          "StatutorySharedParentalPay": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/Webhooks_StatutoryLeavePolicyDto"
              },
              {
                "nullable": true
              }
            ]
          },
          "StatutoryParentalBereavementPay": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/Webhooks_StatutoryLeavePolicyDto"
              },
              {
                "nullable": true
              }
            ]
          },
          "StatutoryNeoNatalCarePay": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/Webhooks_StatutoryLeavePolicyDto"
              },
              {
                "nullable": true
              }
            ]
          }
        },
        "additionalProperties": false
      },
      "Webhooks_StatutoryPayEvent": {
        "required": [
          "employeeId",
          "endDate",
          "eventType",
          "occurredAt",
          "organisationId",
          "payType",
          "startDate",
          "status",
          "statutoryPayId"
        ],
        "type": "object",
        "properties": {
          "eventType": {
            "type": "string"
          },
          "organisationId": {
            "type": "string"
          },
          "employeeId": {
            "type": "string"
          },
          "statutoryPayId": {
            "type": "string"
          },
          "payType": {
            "type": "string"
          },
          "status": {
            "type": "string"
          },
          "startDate": {
            "type": "string"
          },
          "endDate": {
            "type": "string"
          },
          "totalAmount": {
            "type": "number",
            "format": "double"
          },
          "paidWeeksCount": {
            "type": "integer",
            "format": "int32"
          },
          "averageWeeklyEarnings": {
            "type": "number",
            "format": "double"
          },
          "reason": {
            "type": "string",
            "nullable": true
          },
          "source": {
            "type": "string",
            "nullable": true
          },
          "occurredAt": {
            "type": "string"
          },
          "resourceUrl": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Webhooks_StatutoryPayEventWebhookEventEnvelope": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "type": {
            "type": "string"
          },
          "timestamp": {
            "type": "string"
          },
          "apiVersion": {
            "type": "string"
          },
          "organisationId": {
            "type": "string"
          },
          "customerId": {
            "type": "string"
          },
          "livemode": {
            "type": "boolean"
          },
          "data": {
            "$ref": "#/components/schemas/Webhooks_StatutoryPayEvent"
          },
          "metadata": {
            "$ref": "#/components/schemas/Webhooks_WebhookEventMetadata"
          }
        },
        "additionalProperties": false
      },
      "Webhooks_StatutoryPaymentsReclaimDto": {
        "type": "object",
        "properties": {
          "reclaimed": {
            "type": "number",
            "format": "double"
          },
          "nicCompensationRecovered": {
            "type": "number",
            "format": "double"
          }
        },
        "additionalProperties": false
      },
      "Webhooks_TagDto": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string"
          },
          "group": {
            "type": "string"
          },
          "value": {
            "type": "string"
          }
        },
        "additionalProperties": false
      },
      "Webhooks_TaxReferenceNumbersDto": {
        "required": [
          "accountsOfficeReference",
          "employerPayeReference"
        ],
        "type": "object",
        "properties": {
          "employerPayeReference": {
            "$ref": "#/components/schemas/Webhooks_PayeReferenceNumberDto"
          },
          "accountsOfficeReference": {
            "minLength": 1,
            "type": "string"
          },
          "selfAssessmentUniqueTaxpayerReference": {
            "type": "string",
            "nullable": true
          },
          "corporationTaxReferenceUniqueTaxpayerReference": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Webhooks_TestDeliveryResponse": {
        "required": [
          "deliveryId",
          "durationMilliseconds",
          "succeeded"
        ],
        "type": "object",
        "properties": {
          "deliveryId": {
            "type": "string"
          },
          "succeeded": {
            "type": "boolean"
          },
          "statusCode": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "durationMilliseconds": {
            "type": "integer",
            "format": "int64"
          },
          "errorToken": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Webhooks_TestDeliveryResponseContentResponse": {
        "type": "object",
        "properties": {
          "data": {
            "$ref": "#/components/schemas/Webhooks_TestDeliveryResponse"
          },
          "metadata": {
            "$ref": "#/components/schemas/Webhooks_ContentMetadataResponse"
          }
        },
        "additionalProperties": false
      },
      "Webhooks_TestDeliveryResponseResponseBody": {
        "type": "object",
        "properties": {
          "message": {
            "$ref": "#/components/schemas/Webhooks_MessageWithTokenResponse"
          },
          "content": {
            "$ref": "#/components/schemas/Webhooks_TestDeliveryResponseContentResponse"
          },
          "validationIssues": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Webhooks_ValidationIssue"
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Webhooks_UpdatableContactDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "nullable": true
          },
          "firstName": {
            "type": "string",
            "nullable": true
          },
          "lastName": {
            "type": "string",
            "nullable": true
          },
          "email": {
            "type": "string",
            "nullable": true
          },
          "phone": {
            "type": "string",
            "nullable": true
          },
          "role": {
            "type": "string",
            "nullable": true
          },
          "tags": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Webhooks_TagDto"
            },
            "nullable": true
          },
          "includeInEmails": {
            "type": "boolean"
          }
        },
        "additionalProperties": false
      },
      "Webhooks_UpdateEndpointRequest": {
        "type": "object",
        "properties": {
          "url": {
            "type": "string"
          },
          "description": {
            "type": "string",
            "nullable": true
          },
          "status": {
            "enum": [
              "Paused",
              "Active",
              "DisabledBySystem",
              null
            ],
            "type": "string"
          },
          "payloadStyle": {
            "enum": [
              "Minimal",
              "Full",
              null
            ],
            "type": "string"
          },
          "eventTypes": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "organisationIds": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "nullable": true
          },
          "excludedOrganisationIds": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "nullable": true
          },
          "rateLimitPerSecond": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "customHeaders": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            },
            "nullable": true
          },
          "alertContacts": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Webhooks_UpdateReplayRequest": {
        "required": [
          "status"
        ],
        "type": "object",
        "properties": {
          "status": {
            "enum": [
              "Queued",
              "Running",
              "Completed",
              "Cancelled"
            ],
            "type": "string"
          }
        },
        "additionalProperties": false
      },
      "Webhooks_ValidationIssue": {
        "type": "object",
        "properties": {
          "field": {
            "type": "string"
          },
          "reason": {
            "type": "string"
          },
          "reasonToken": {
            "type": "string"
          },
          "reasonTokenArguments": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Webhooks_ValidationIssueArgument"
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Webhooks_ValidationIssueArgument": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string"
          },
          "value": {}
        },
        "additionalProperties": false
      },
      "Webhooks_WebhookEventDescriptor": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string"
          },
          "family": {
            "enum": [
              "PayRun",
              "Payslip",
              "Leaver",
              "PForms",
              "CourtOrders",
              "StatutoryPay",
              "Holiday",
              "Journal",
              "Pension",
              "EmailDelivery",
              "Operational",
              "Employee",
              "Rti",
              "LineItem",
              "Report",
              "RecurringLineItems",
              "HmrcNotices",
              "Salary",
              "Integrations",
              "Billing",
              "Payment"
            ],
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "status": {
            "enum": [
              "Planned",
              "Available",
              "Deprecated"
            ],
            "type": "string"
          },
          "sinceApiVersion": {
            "type": "string"
          },
          "subscribable": {
            "type": "boolean"
          }
        },
        "additionalProperties": false
      },
      "Webhooks_WebhookEventDescriptorListContentResponse": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Webhooks_WebhookEventDescriptor"
            },
            "nullable": true
          },
          "metadata": {
            "$ref": "#/components/schemas/Webhooks_ContentMetadataResponse"
          }
        },
        "additionalProperties": false
      },
      "Webhooks_WebhookEventDescriptorListResponseBody": {
        "type": "object",
        "properties": {
          "message": {
            "$ref": "#/components/schemas/Webhooks_MessageWithTokenResponse"
          },
          "content": {
            "$ref": "#/components/schemas/Webhooks_WebhookEventDescriptorListContentResponse"
          },
          "validationIssues": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Webhooks_ValidationIssue"
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Webhooks_WebhookEventMetadata": {
        "type": "object",
        "properties": {
          "resourceUrl": {
            "type": "string",
            "nullable": true
          },
          "correlationId": {
            "type": "string",
            "nullable": true
          },
          "documentUrl": {
            "type": "string",
            "nullable": true
          },
          "payloadStyle": {
            "enum": [
              "Minimal",
              "Full"
            ],
            "type": "string"
          },
          "payloadDowngraded": {
            "type": "boolean"
          },
          "dateFormat": {
            "type": "string"
          },
          "dateTimeFormat": {
            "type": "string"
          }
        },
        "additionalProperties": false
      },
      "Webhooks_WebhookEventRecordResponse": {
        "required": [
          "envelope",
          "eventId",
          "eventType",
          "organisationId",
          "timestamp"
        ],
        "type": "object",
        "properties": {
          "eventId": {
            "type": "string"
          },
          "eventType": {
            "type": "string"
          },
          "organisationId": {
            "type": "string"
          },
          "timestamp": {
            "type": "string"
          },
          "envelope": {}
        },
        "additionalProperties": false
      },
      "Webhooks_WebhookEventRecordResponseContentResponse": {
        "type": "object",
        "properties": {
          "data": {
            "$ref": "#/components/schemas/Webhooks_WebhookEventRecordResponse"
          },
          "metadata": {
            "$ref": "#/components/schemas/Webhooks_ContentMetadataResponse"
          }
        },
        "additionalProperties": false
      },
      "Webhooks_WebhookEventRecordResponseListContentResponse": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Webhooks_WebhookEventRecordResponse"
            },
            "nullable": true
          },
          "metadata": {
            "$ref": "#/components/schemas/Webhooks_ContentMetadataResponse"
          }
        },
        "additionalProperties": false
      },
      "Webhooks_WebhookEventRecordResponseListResponseBody": {
        "type": "object",
        "properties": {
          "message": {
            "$ref": "#/components/schemas/Webhooks_MessageWithTokenResponse"
          },
          "content": {
            "$ref": "#/components/schemas/Webhooks_WebhookEventRecordResponseListContentResponse"
          },
          "validationIssues": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Webhooks_ValidationIssue"
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Webhooks_WebhookEventRecordResponseResponseBody": {
        "type": "object",
        "properties": {
          "message": {
            "$ref": "#/components/schemas/Webhooks_MessageWithTokenResponse"
          },
          "content": {
            "$ref": "#/components/schemas/Webhooks_WebhookEventRecordResponseContentResponse"
          },
          "validationIssues": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Webhooks_ValidationIssue"
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Webhooks_WebhookOperationalPayload": {
        "required": [
          "endpointId",
          "endpointUrl",
          "failingSince",
          "organisationId"
        ],
        "type": "object",
        "properties": {
          "endpointId": {
            "type": "string"
          },
          "endpointUrl": {
            "type": "string"
          },
          "endpointDescription": {
            "type": "string",
            "nullable": true
          },
          "organisationId": {
            "type": "string"
          },
          "customerId": {
            "type": "string",
            "nullable": true
          },
          "failingSince": {
            "type": "string"
          },
          "lastStatusCode": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "lastErrorToken": {
            "type": "string",
            "nullable": true
          },
          "statusReason": {
            "type": "string",
            "nullable": true
          },
          "disabledAt": {
            "type": "string",
            "nullable": true
          },
          "deliveryId": {
            "type": "string",
            "nullable": true
          },
          "eventId": {
            "type": "string",
            "nullable": true
          },
          "eventType": {
            "type": "string",
            "nullable": true
          },
          "attemptCount": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Webhooks_WebhookOperationalPayloadWebhookEventEnvelope": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "type": {
            "type": "string"
          },
          "timestamp": {
            "type": "string"
          },
          "apiVersion": {
            "type": "string"
          },
          "organisationId": {
            "type": "string"
          },
          "customerId": {
            "type": "string"
          },
          "livemode": {
            "type": "boolean"
          },
          "data": {
            "$ref": "#/components/schemas/Webhooks_WebhookOperationalPayload"
          },
          "metadata": {
            "$ref": "#/components/schemas/Webhooks_WebhookEventMetadata"
          }
        },
        "additionalProperties": false
      },
      "Webhooks_YearEndFinalisedNotification": {
        "type": "object",
        "properties": {
          "organisationId": {
            "type": "string"
          },
          "payrollConfigId": {
            "type": "string"
          },
          "taxYear": {
            "type": "integer",
            "format": "int32"
          }
        },
        "additionalProperties": false
      },
      "Webhooks_YearEndFinalisedNotificationWebhookEventEnvelope": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "type": {
            "type": "string"
          },
          "timestamp": {
            "type": "string"
          },
          "apiVersion": {
            "type": "string"
          },
          "organisationId": {
            "type": "string"
          },
          "customerId": {
            "type": "string"
          },
          "livemode": {
            "type": "boolean"
          },
          "data": {
            "$ref": "#/components/schemas/Webhooks_YearEndFinalisedNotification"
          },
          "metadata": {
            "$ref": "#/components/schemas/Webhooks_WebhookEventMetadata"
          }
        },
        "additionalProperties": false
      }
    },
    "parameters": {
      "Pay_Request-Id": {
        "name": "Request-Id",
        "in": "header",
        "required": false,
        "description": "Optional. Your id for this request: it is carried into every log line about it, so quote it when you contact support.",
        "schema": {
          "type": "string"
        }
      },
      "Payment_Request-Id": {
        "name": "Request-Id",
        "in": "header",
        "required": false,
        "description": "Optional. Your id for this request: it is carried into every log line about it, so quote it when you contact support.",
        "schema": {
          "type": "string"
        }
      }
    }
  }
}
