openapi: 3.1.0
info:
  title: PetExpert Claim API
  version: v3
  summary: Look up insured animals, submit vet invoices as claims and incidents, and read settlement results.
  description: |
    Every method is a `POST` with a JSON body; send the
    `Ocp-Apim-Subscription-Key` header and the clinic's `userName` / `password`. Check
    `resultCode` in the body (`100` = success).

    Pick your market from the Country / API / Environment controls. Czech Republic uses **v3**;
    Belgium, Slovakia and Poland currently use **v2**. The request bodies are the same, so only
    the base URL changes.

    In each request schema, fields marked **required** must be sent. Missing or empty required
    fields return `resultCode` `400`. See [Getting started — Required fields](getting-started.html#required-fields).

    [Getting started](getting-started.html) · [Claim workflow](claim-workflow.html) ·
    [Code lists](reference.html) · [FAQ](faq.html) · [Legacy migration](legacy-migration.html)
  contact:
    name: PetExpert integration support
    email: <SUPPORT_EMAIL>
  license:
    name: Proprietary - for PetExpert integration partners
    url: https://www.petexpert.cz
servers:
  - url: https://api.petexpert.eu/cz-claim-test/v3
    description: Czech Republic — TEST (cz-claim-test/v3)
  - url: https://api.petexpert.eu/cz-claim/v3
    description: Czech Republic — PRODUCTION (cz-claim/v3)
  - url: https://api.petexpert.eu/sk-claim-test/v2
    description: Slovakia — TEST (sk-claim-test/v2)
  - url: https://api.petexpert.eu/sk-claim-prod/v2
    description: Slovakia — PRODUCTION (sk-claim-prod/v2)
  - url: https://api.petexpert.eu/pl-claim-test/v2
    description: Poland — TEST (pl-claim-test/v2)
  - url: https://api.petexpert.eu/pl-claim-prod/v2
    description: Poland — PRODUCTION (pl-claim-prod/v2)
  - url: https://api.petexpert.eu/be-claim-test/v2
    description: Belgium — TEST (be-claim-test/v2)
security:
  - SubscriptionKey: []
  - SubscriptionKeyQuery: []
tags:
  - name: Connection and account
    description: Check connectivity and the clinic credentials.
  - name: Policy lookup
    description: Policy status, insured animal and remaining limit.
  - name: Claims and incidents
    description: Submit invoices. A claim is one illness or accident; each incident is one visit / invoice within it.
  - name: Settlement and status
    description: Read the settlement result of incidents and change their state.
paths:
  /TestConnection:
    post:
      operationId: TestConnection
      summary: Test the connection
      description: Checks that the gateway, subscription key and backend are reachable. No request body or clinic credentials are needed.
      tags: [Connection and account]
      responses:
        '200':
          description: Backend reachable.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TestConnectionResponse'
              examples:
                success:
                  summary: Success
                  value:
                    resultCode: 100
                    resultText: OK
                    env: cz-base-test
                    script: claim_v1
                    trace: 3f2b9c1e8a7d4b6f9e0a1c2d3e4f5a6b
        '401':
          $ref: '#/components/responses/Unauthorized'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '500':
          $ref: '#/components/responses/ServerError'
  /GetAccount:
    post:
      operationId: GetAccount
      summary: Get clinic account details
      description: |
        Verifies the clinic credentials and returns the clinic record held by PetExpert.

        `partnerID` is the clinic's PetExpert provider code. You never need to send it in
        `AddNewClaim` or `AddNewIncident`, because the server derives it from the login. It is
        required as `partnerId` in `GetIncidentList`.

        **Possible `resultCode` values:** `100`, `400` (missing credentials), `410` (wrong credentials).
      tags: [Connection and account]
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ClinicRequest'
            examples:
              default:
                $ref: '#/components/examples/ReqClinicOnly'
      responses:
        '200':
          description: Business result. Check `resultCode`.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetAccountResponse'
              examples:
                success:
                  summary: 100 - Success
                  value:
                    resultCode: 100
                    resultText: OK
                    partnerID: VET00123
                    facilityAddress: Hlavni 12
                    facilityCity: Praha
                    facilityName: Veterinarni klinika Example
                    facilityZIP: '11000'
                    orgName: Example Vet s.r.o.
                    telephone: '+420 600 000 000'
                    email: clinic@example.com
                    trace: 3f2b9c1e8a7d4b6f9e0a1c2d3e4f5a6b
                missingData:
                  $ref: '#/components/examples/Err400'
                authFailed:
                  $ref: '#/components/examples/Err410'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '500':
          $ref: '#/components/responses/ServerError'
  /GetActivePolicy:
    post:
      operationId: GetActivePolicy
      summary: Get policy and insured animal details
      description: |
        Returns the policy, the insured animal, the vet benefit and the remaining limit
        (`balance`). Call it before `AddNewClaim` to confirm `status` is `Active`.

        * `policyNumber` must be exactly 10 characters.
        * `status` and `benefitStatus` are localized labels: `Active`, `Waiting for activation` or `Inactive` (English values shown).
        * `balance` is the remaining limit of the active vet benefit, rounded to a whole number, in the market currency.
        * Customer first name, address, e-mail and phone are masked (`Hidden (GDPR)` in English).
        * `dateQualifying` is the activation date plus 3 days. Treatment before this date is normally not covered.
        * `animalDob` is omitted when the date of birth is unknown.

        **Possible `resultCode` values:** `100`, `400`, `410`, `420` (policy not found).
      tags: [Policy lookup]
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PolicyNumberRequest'
            examples:
              default:
                $ref: '#/components/examples/ReqPolicyNumber'
      responses:
        '200':
          description: Business result. Check `resultCode`.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetActivePolicyResponse'
              examples:
                active:
                  summary: 100 - Active policy (CZ, CZK)
                  value:
                    resultCode: 100
                    resultText: OK
                    partnerID: VET00123
                    policyNumber: '1234250115'
                    productName: Premium (pes)
                    dateActivated: '2025-01-15'
                    dateExpiring: ''
                    dateQualifying: '2025-01-18'
                    dateCreated: '2025-01-10'
                    dateRenew: '2026-01-15'
                    status: Active
                    animalName: Rex
                    chipNumber: '203098100123456'
                    animalBreed: Labrador retriever
                    animalDob: '2021-05-04'
                    animalType: Dog
                    animalSex: Male
                    balance: 72500
                    benefitName: Veterinary costs
                    benefitCode: PBVET07
                    benefitStatus: Active
                    providerName: Veterinarni klinika Example
                    policyNote: null
                    customerFName: Hidden (GDPR)
                    customerLName: Novak
                    customerAddress: Hidden (GDPR)
                    customerCity: Praha
                    customerZip: '11000'
                    customerEmail: Hidden (GDPR)
                    customerPhone: Hidden (GDPR)
                    customerId: C0012345
                    trace: 3f2b9c1e8a7d4b6f9e0a1c2d3e4f5a6b
                waiting:
                  summary: 100 - Waiting for activation (SK, EUR)
                  value:
                    resultCode: 100
                    resultText: OK
                    partnerID: VET00456
                    policyNumber: '5678251002'
                    productName: Basic (macka)
                    dateActivated: '1970-01-01'
                    dateExpiring: ''
                    dateQualifying: ''
                    dateCreated: '2025-10-02'
                    dateRenew: '1970-01-01'
                    status: Waiting for activation
                    animalName: Micka
                    chipNumber: '703098100654321'
                    animalBreed: Europska kratkosrsta
                    animalType: Cat
                    animalSex: Female
                    balance: 0
                    benefitName: ''
                    benefitCode: ''
                    benefitStatus: ''
                    providerName: ''
                    policyNote: null
                    customerFName: Hidden (GDPR)
                    customerLName: Kovacova
                    customerAddress: Hidden (GDPR)
                    customerCity: Bratislava
                    customerZip: '81101'
                    customerEmail: Hidden (GDPR)
                    customerPhone: Hidden (GDPR)
                    customerId: C0098765
                    trace: 7c1d2e3f4a5b6c7d8e9f0a1b2c3d4e5f
                missingData:
                  $ref: '#/components/examples/Err400'
                authFailed:
                  $ref: '#/components/examples/Err410'
                notFound:
                  $ref: '#/components/examples/Err420'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '500':
          $ref: '#/components/responses/ServerError'
  /GetCurrentBalance:
    post:
      operationId: GetCurrentBalance
      summary: Get the remaining limit of a policy
      description: |
        Returns the remaining limit of the active vet benefit of an active policy, rounded to a
        whole number, in the market currency.

        `currentBalance` is `0` when the policy does not exist, is not active, or has no active
        vet benefit. The call still returns `resultCode` `100` in that case, so use
        `GetActivePolicy` if you need to tell these situations apart.

        **Possible `resultCode` values:** `100`, `400`, `410`.
      tags: [Policy lookup]
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PolicyNumberRequest'
            examples:
              default:
                $ref: '#/components/examples/ReqPolicyNumber'
      responses:
        '200':
          description: Business result. Check `resultCode`.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetCurrentBalanceResponse'
              examples:
                success:
                  summary: 100 - Success
                  value:
                    resultCode: 100
                    resultText: OK
                    partnerID: VET00123
                    currentBalance: 72500
                    trace: 3f2b9c1e8a7d4b6f9e0a1c2d3e4f5a6b
                missingData:
                  $ref: '#/components/examples/Err400'
                authFailed:
                  $ref: '#/components/examples/Err410'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '500':
          $ref: '#/components/responses/ServerError'
  /GetPolicyByPolicyID:
    post:
      operationId: GetPolicyByPolicyID
      summary: Look up a policy number by policy ID
      description: |
        Translates PetExpert's internal policy ID (a GUID, for example from a QR code or link
        generated by PetExpert) into the policy number. No clinic credentials are needed.

        When nothing is found, both fields are empty strings and no `resultCode` is returned.

        **Possible `resultCode` values:** none on success, `400` when `policyId` is missing.
      tags: [Policy lookup]
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/GetPolicyByPolicyIDRequest'
            examples:
              default:
                summary: Lookup by policy ID
                value:
                  swName: ExampleVetSoftware
                  swVersion: 4.2.0
                  lang: en
                  policyId: 6f1c2a3b-4d5e-4f60-8a7b-9c0d1e2f3a4b
      responses:
        '200':
          description: Lookup result.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetPolicyByPolicyIDResponse'
              examples:
                found:
                  summary: Found
                  value:
                    policyNumber: '1234250115'
                    customerPhone: '+420 600 000 001'
                    trace: 3f2b9c1e8a7d4b6f9e0a1c2d3e4f5a6b
                notFound:
                  summary: Not found
                  value:
                    policyNumber: ''
                    customerPhone: ''
                    trace: 3f2b9c1e8a7d4b6f9e0a1c2d3e4f5a6b
                missingData:
                  $ref: '#/components/examples/Err400'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '500':
          $ref: '#/components/responses/ServerError'
  /GetPolicyByChipNr:
    post:
      operationId: GetPolicyByChipNr
      summary: Look up a policy number by microchip number
      description: |
        Returns the policy number of the animal with this microchip number. Use it when the
        customer does not have the policy number at hand, then call `GetActivePolicy` with the
        result. No clinic credentials are needed.

        The chip number must match exactly as stored on the policy (no spaces). If more than one
        policy exists for the chip, one of them is returned.

        **Possible `resultCode` values:** `100` (found), `420` (not found, or `chipNr` has 3
        characters or fewer).
      tags: [Policy lookup]
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/GetPolicyByChipNrRequest'
            examples:
              default:
                summary: Lookup by chip number
                value:
                  swName: ExampleVetSoftware
                  swVersion: 4.2.0
                  lang: en
                  chipNr: '203098100123456'
      responses:
        '200':
          description: Lookup result.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetPolicyByChipNrResponse'
              examples:
                found:
                  summary: Found
                  value:
                    resultCode: 100
                    resultText: OK
                    policyNumber: '1234250115'
                    trace: 3f2b9c1e8a7d4b6f9e0a1c2d3e4f5a6b
                notFound:
                  summary: Not found
                  value:
                    resultCode: 420
                    resultText: Object fitting search criteria was not found in the system.
                    policyNumber: ''
                    trace: 3f2b9c1e8a7d4b6f9e0a1c2d3e4f5a6b
        '401':
          $ref: '#/components/responses/Unauthorized'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '500':
          $ref: '#/components/responses/ServerError'
  /GetOpenClaims:
    post:
      operationId: GetOpenClaims
      summary: List open claims for a policy
      description: |
        Lists claims of a policy that are still open. Use it to decide whether a new invoice
        belongs to an existing claim (`AddNewIncident`) or needs a new one (`AddNewClaim`), and
        to check for an existing claim before retrying a failed `AddNewClaim`.

        `claims` is omitted when `openClaimCount` is `0`.

        **Possible `resultCode` values:** `100`, `400`, `410`.
      tags: [Claims and incidents]
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PolicyNumberRequest'
            examples:
              default:
                $ref: '#/components/examples/ReqPolicyNumber'
      responses:
        '200':
          description: Business result. Check `resultCode`.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetOpenClaimsResponse'
              examples:
                oneOpen:
                  summary: 100 - One open claim
                  value:
                    resultCode: 100
                    resultText: OK
                    partnerID: VET00123
                    openClaimCount: 1
                    claims:
                      - claimName: Gastroenteritis
                        claimNumber: CL9025123456
                        dateCreated: '2025-10-20'
                        reportedBy: Veterinarni klinika Example
                    trace: 3f2b9c1e8a7d4b6f9e0a1c2d3e4f5a6b
                noneOpen:
                  summary: 100 - No open claims
                  value:
                    resultCode: 100
                    resultText: OK
                    partnerID: VET00123
                    openClaimCount: 0
                    trace: 3f2b9c1e8a7d4b6f9e0a1c2d3e4f5a6b
                missingData:
                  $ref: '#/components/examples/Err400'
                authFailed:
                  $ref: '#/components/examples/Err410'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '500':
          $ref: '#/components/responses/ServerError'
  /GetClaim:
    post:
      operationId: GetClaim
      summary: Get claim details
      description: |
        Returns the header of one claim. `claimDescription` is returned with quotes and
        backslashes escaped. `openedBy` is always `null`.

        **Possible `resultCode` values:** `100`, `400`, `410`, `420` (claim not found).
      tags: [Claims and incidents]
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/GetClaimRequest'
            examples:
              default:
                summary: Get claim
                value:
                  userName: <CLINIC_LOGIN>
                  password: <CLINIC_PASSWORD>
                  swName: ExampleVetSoftware
                  swVersion: 4.2.0
                  lang: en
                  claimNr: CL9025123456
      responses:
        '200':
          description: Business result. Check `resultCode`.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetClaimResponse'
              examples:
                success:
                  summary: 100 - Success
                  value:
                    resultCode: 100
                    resultText: OK
                    partnerID: VET00123
                    claim:
                      claimNr: CL9025123456
                      claimName: Gastroenteritis
                      claimDescription: Vomiting and diarrhoea since 18.10., dehydrated.
                      dateCreated: '2025-10-20'
                      openedBy: null
                    trace: 3f2b9c1e8a7d4b6f9e0a1c2d3e4f5a6b
                missingData:
                  $ref: '#/components/examples/Err400'
                authFailed:
                  $ref: '#/components/examples/Err410'
                notFound:
                  $ref: '#/components/examples/Err420'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '500':
          $ref: '#/components/responses/ServerError'
  /AddNewClaim:
    post:
      operationId: AddNewClaim
      summary: Submit an invoice as a new claim
      description: |
        Creates a claim, its first incident and the incident's cost items, then triggers
        automatic settlement and returns the settlement result.

        ### Synchronous mode (default, `async` omitted or `false`)
        The server creates all records, waits about 5 seconds for automatic settlement and then
        returns the settlement. Expect 8-20 seconds per call; set your HTTP client timeout to at
        least **120 seconds** (the server's own limit).

        ### Asynchronous mode (`async: true`)
        The server reserves the claim and incident numbers and replies immediately with
        `statusCode` `999`, `covered` `0` and `async: true`. Processing continues in the
        background. Poll `GetIncidentStatus` with the returned `incidentNumber` (for example
        every 10-30 seconds) until `statusCode` is no longer `999` or `856900000`.

        ### Reading the result
        * `claimed` is the sum of all item `amount` values.
        * `covered` is the amount PetExpert will pay. It is forced to `0` unless `statusCode`
          is `856900001` (Confirmed) or `856900003` (Paid). Book it as an insurance payment
          only in those two states.
        * `statusCode` `856900000` (Processing) means the incident went to manual review. Poll
          `GetIncidentStatus` later.

        ### Important behaviour
        * **No duplicate detection.** Every call creates a new claim and incident, even for an
          identical invoice. Before retrying after a timeout or a `999` result, call
          `GetOpenClaims` (and `GetIncidentList`) to check whether the claim was created.
        * `partnerID` is taken from the clinic login. Do not send it.
        * The policy status itself is not checked here. The call fails with `420` only when
          the policy number is unknown or the policy has no active vet benefit. Check
          `GetActivePolicy` first.
        * A `420` "benefit does not exist or is not active" error is returned **after** the
          claim header was created, so an empty claim can remain. Contact PetExpert to remove
          it if needed.
        * `claimName` values that match `CSOB` followed by a space or dash and 10 letters or
          digits are reserved for a partner voucher programme. Do not use them.
        * `preauthorization: true` creates a simulated incident (a cost estimate). It is
          settled like a real one but not paid until you call `ConfirmIncident`.
        * The server stamps incident start and first clinical signs with the date of
          submission (UTC). `clinicalSignsFrom` and `visitDate` are accepted but not stored.
          `visitDate` is used only to build a default incident name.

        **Possible `resultCode` values:** `100`, `400`, `410`, `420`, `510`, `999`.
      tags: [Claims and incidents]
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AddNewClaimRequest'
            examples:
              illnessCZK:
                summary: Illness, synchronous (CZ, CZK)
                value:
                  userName: <CLINIC_LOGIN>
                  password: <CLINIC_PASSWORD>
                  swName: ExampleVetSoftware
                  swVersion: 4.2.0
                  lang: cz
                  policyNumber: '1234250115'
                  claimName: Gastroenteritis
                  causeType: 1
                  description: Vomiting and diarrhoea since 18.10., dehydrated. Invoice 2025-000123.
                  async: false
                  incident:
                    medicalReport: Clinical exam, blood panel, IV fluids 500 ml, antiemetic injection. Re-check in 3 days.
                    clinicalSignsFrom: '2025-10-18'
                    visitDate: '2025-10-20'
                    preauthorization: false
                    externalid: INV-2025-000123
                    items:
                      - name: Clinical examination
                        code: EXAM01
                        type: 2
                        quantity: 1
                        unitPrice: 650
                        amount: 650
                      - name: Blood panel (biochemistry)
                        code: LAB12
                        type: 3
                        quantity: 1
                        unitPrice: 1200
                        amount: 1200
                      - name: Maropitant inj. 10 mg/ml
                        code: MED0457
                        type: 4
                        quantity: 2
                        unitPrice: 185.5
                        amount: 371
                      - name: IV infusion set
                        code: MAT0021
                        type: 1
                        quantity: 1
                        unitPrice: 240
                        amount: 240
              accidentEUR:
                summary: Accident, asynchronous (SK, EUR)
                value:
                  userName: <CLINIC_LOGIN>
                  password: <CLINIC_PASSWORD>
                  swName: ExampleVetSoftware
                  swVersion: 4.2.0
                  lang: sk
                  policyNumber: '5678251002'
                  claimName: Cut paw pad, left front
                  causeType: 2
                  description: Laceration of the left front paw pad after a walk. Invoice 2025-004512.
                  async: true
                  incident:
                    medicalReport: Wound cleaned and sutured under sedation, bandage, antibiotics for 7 days.
                    clinicalSignsFrom: '2025-10-21'
                    visitDate: '2025-10-21'
                    externalid: INV-2025-004512
                    items:
                      - name: Sedation
                        code: SED01
                        type: 2
                        quantity: 1
                        unitPrice: 35.0
                        amount: 35.0
                      - name: Wound suture
                        code: SUR04
                        type: 2
                        quantity: 1
                        unitPrice: 48.9
                        amount: 48.9
                      - name: Amoxicillin/clavulanic acid 250 mg tbl.
                        code: MED1102
                        type: 4
                        quantity: 14
                        unitPrice: 0.85
                        amount: 11.9
                      - name: Bandage material
                        code: MAT0100
                        type: 1
                        quantity: 1
                        unitPrice: 6.5
                        amount: 6.5
                        itemNote: Includes protective boot
              estimate:
                summary: Simulated incident / cost estimate (preauthorization)
                value:
                  userName: <CLINIC_LOGIN>
                  password: <CLINIC_PASSWORD>
                  swName: ExampleVetSoftware
                  swVersion: 4.2.0
                  lang: en
                  policyNumber: '1234250115'
                  claimName: Cruciate ligament surgery (estimate)
                  causeType: 2
                  description: Planned TPLO surgery, right hind leg.
                  incident:
                    medicalReport: Cranial drawer positive, X-ray confirms rupture of the cranial cruciate ligament.
                    clinicalSignsFrom: '2025-10-01'
                    preauthorization: true
                    items:
                      - name: TPLO surgery
                        code: SUR20
                        type: 2
                        quantity: 1
                        amount: 28000
                      - name: Implant plate
                        code: MAT0900
                        type: 1
                        quantity: 1
                        amount: 9500
              withExcludedItem:
                summary: Item flagged as not insured (exclude)
                value:
                  userName: <CLINIC_LOGIN>
                  password: <CLINIC_PASSWORD>
                  swName: ExampleVetSoftware
                  swVersion: 4.2.0
                  lang: en
                  policyNumber: '1234250115'
                  claimName: Otitis externa
                  causeType: 1
                  description: Ear infection, right ear.
                  incident:
                    clinicalSignsFrom: '2025-10-19'
                    items:
                      - name: Clinical examination
                        code: EXAM01
                        type: 2
                        quantity: 1
                        amount: 650
                      - name: Ear drops 15 ml
                        code: MED0300
                        type: 4
                        quantity: 1
                        amount: 420
                      - name: Dog food, sensitive 2 kg
                        code: FOOD011
                        type: 5
                        quantity: 1
                        amount: 590
                        exclude: true
                        itemNote: Not covered - food
      responses:
        '200':
          description: Business result. Check `resultCode`, then `statusCode` and `covered`.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AddNewClaimResponse'
              examples:
                confirmedCZK:
                  $ref: '#/components/examples/SettlementConfirmedCZK'
                confirmedEUR:
                  $ref: '#/components/examples/SettlementConfirmedEUR'
                processing:
                  $ref: '#/components/examples/SettlementProcessing'
                rejected:
                  $ref: '#/components/examples/SettlementRejected'
                asyncAccepted:
                  $ref: '#/components/examples/AsyncAccepted'
                missingData:
                  $ref: '#/components/examples/Err400'
                authFailed:
                  $ref: '#/components/examples/Err410'
                policyNotFound:
                  $ref: '#/components/examples/Err420Policy'
                benefitNotActive:
                  $ref: '#/components/examples/Err420Benefit'
                incidentCreateFailed:
                  $ref: '#/components/examples/Err510Incident'
                costItemCreateFailed:
                  $ref: '#/components/examples/Err510CostItem'
                settlementUnavailable:
                  $ref: '#/components/examples/Err999Settlement'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '500':
          $ref: '#/components/responses/ServerError'
  /AddNewIncident:
    post:
      operationId: AddNewIncident
      summary: Add an invoice to an existing claim
      description: |
        Adds a new incident (a follow-up visit or invoice) with cost items to an existing claim,
        triggers settlement and returns the result. The policy is taken from the claim.

        Timing, asynchronous mode, result handling and the absence of duplicate detection are
        the same as for `AddNewClaim`.

        Mandatory: `userName`, `password`, `claimNumber` (exactly 12 characters),
        `incident.clinicalSignsFrom` (present and not `null`; an empty string is accepted) and at
        least one item in `incident.items`. Otherwise the call returns `400`.

        `incidentName` defaults to `visitDate` formatted in the market's date format
        (for example `20.10.2025`) when omitted.

        **Possible `resultCode` values:** `100`, `400`, `410`, `420` (claim not found or no
        active benefit), `510`, `999`.
      tags: [Claims and incidents]
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AddNewIncidentRequest'
            examples:
              followUp:
                summary: Follow-up visit (CZ, CZK)
                value:
                  userName: <CLINIC_LOGIN>
                  password: <CLINIC_PASSWORD>
                  swName: ExampleVetSoftware
                  swVersion: 4.2.0
                  lang: cz
                  claimNumber: CL9025123456
                  async: false
                  incident:
                    incidentName: Re-check 23.10.2025
                    medicalReport: Re-check, condition improved, medication continued for 5 days.
                    clinicalSignsFrom: '2025-10-18'
                    visitDate: '2025-10-23'
                    preauthorization: false
                    externalid: INV-2025-000187
                    items:
                      - name: Follow-up examination
                        code: EXAM02
                        type: 2
                        quantity: 1
                        unitPrice: 450
                        amount: 450
                      - name: Probiotic paste 15 ml
                        code: MED0612
                        type: 4
                        quantity: 1
                        unitPrice: 310
                        amount: 310
              minimal:
                summary: Minimal valid request
                value:
                  userName: <CLINIC_LOGIN>
                  password: <CLINIC_PASSWORD>
                  claimNumber: CL9025123456
                  incident:
                    clinicalSignsFrom: ''
                    items:
                      - name: Follow-up examination
                        code: EXAM02
                        type: 2
                        amount: 450
      responses:
        '200':
          description: Business result. Check `resultCode`, then `statusCode` and `covered`.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AddNewIncidentResponse'
              examples:
                confirmedCZK:
                  $ref: '#/components/examples/SettlementConfirmedCZK'
                processing:
                  $ref: '#/components/examples/SettlementProcessing'
                asyncAccepted:
                  $ref: '#/components/examples/AsyncAccepted'
                missingData:
                  $ref: '#/components/examples/Err400'
                authFailed:
                  $ref: '#/components/examples/Err410'
                claimNotFound:
                  $ref: '#/components/examples/Err420Claim'
                benefitNotActive:
                  $ref: '#/components/examples/Err420Benefit'
                incidentCreateFailed:
                  $ref: '#/components/examples/Err510Incident'
                settlementUnavailable:
                  $ref: '#/components/examples/Err999Settlement'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '500':
          $ref: '#/components/responses/ServerError'
  /GetIncidentStatus:
    post:
      operationId: GetIncidentStatus
      summary: Get the settlement result of an incident
      description: |
        Returns the current settlement of an incident: the same structure as the
        `AddNewClaim` / `AddNewIncident` result. Use it to poll asynchronous submissions and
        incidents that went to manual review.

        While an asynchronous submission is still being created, the response has
        `statusCode` `856900000` (Processing), empty `sid` and `claimNumber`, and `created` `""`.
        If it stays like that for more than an hour, contact PetExpert support with the `trace`
        of the original submission.

        **Possible `resultCode` values:** `100`, `400`, `410`, `420` (incident not found).
      tags: [Settlement and status]
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/IncidentNumberRequest'
            examples:
              default:
                $ref: '#/components/examples/ReqIncidentNumber'
      responses:
        '200':
          description: Business result. Check `resultCode`, then `statusCode` and `covered`.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetIncidentStatusResponse'
              examples:
                confirmedCZK:
                  $ref: '#/components/examples/SettlementConfirmedCZK'
                confirmedEUR:
                  $ref: '#/components/examples/SettlementConfirmedEUR'
                paid:
                  $ref: '#/components/examples/SettlementPaid'
                processing:
                  $ref: '#/components/examples/SettlementProcessing'
                asyncInProgress:
                  summary: 100 - Asynchronous submission still being created
                  value:
                    sid: ''
                    claimed: 0
                    statusCode: 856900000
                    status: Processing
                    covered: 0
                    currency: CZK
                    preauthorization: false
                    incidentNumber: IN9512345678
                    claimNumber: ''
                    claimUrl: ''
                    paymentHold: false
                    directPay: true
                    created: ''
                    resultCode: 100
                    resultText: OK
                    partnerID: VET00123
                    trace: 3f2b9c1e8a7d4b6f9e0a1c2d3e4f5a6b
                rejected:
                  $ref: '#/components/examples/SettlementRejected'
                missingData:
                  $ref: '#/components/examples/Err400'
                authFailed:
                  $ref: '#/components/examples/Err410'
                notFound:
                  summary: 420 - Incident not found
                  value:
                    resultCode: 420
                    resultText: Object fitting search criteria was not found in the system. Settlement
                    partnerID: VET00123
                    trace: 3f2b9c1e8a7d4b6f9e0a1c2d3e4f5a6b
        '401':
          $ref: '#/components/responses/Unauthorized'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '500':
          $ref: '#/components/responses/ServerError'
  /GetIncidentDetail:
    post:
      operationId: GetIncidentDetail
      summary: Get incident details
      description: |
        Returns the stored details of an incident, including its status labels and the medical
        report. Labels (`incidentCause`, `incidentStatus`, `incidentState`, `documentType`) are
        localized display values and should not be used for program logic; use
        `incidentStatusCode` and `settlementStatusCode` instead.

        * `lastIncident` - whether this incident closes the claim. Always `false` for incidents created through the API.
        * `separateSettlement` - whether the incident is settled on its own. `true` for incidents created through the API, because the API triggers settlement immediately.
        * `incidentDetail` - the medical report, including any text appended by `UpdateDayreport`. Quotes and backslashes are escaped.
        * `incidentStart` and `clinicalSignsFrom` - the date the incident was submitted.

        **Possible `resultCode` values:** `100`, `400`, `410`, `420`.
      tags: [Settlement and status]
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/IncidentNumberRequest'
            examples:
              default:
                $ref: '#/components/examples/ReqIncidentNumber'
      responses:
        '200':
          description: Business result. Check `resultCode`.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetIncidentDetailResponse'
              examples:
                success:
                  summary: 100 - Success
                  value:
                    incidentId: 0b8e7f2a-1c3d-4e5f-9a6b-7c8d9e0f1a2b
                    incidentNr: IN9512345678
                    policyBenefit: PBVET07
                    claimNumber: CL9025123456
                    partnerName: Veterinarni klinika Example
                    incidentStart: '2025-10-20'
                    incidentEnd: null
                    incidentCause: Illness
                    clinicalSignsFrom: '2025-10-20'
                    lastIncident: false
                    incidentStatus: Settled
                    incidentState: Active
                    documentType: VetNet
                    separateSettlement: true
                    dateCreated: '2025-10-20'
                    incidentStatusCode: 2
                    settlementStatusCode: 856900001
                    incidentDetail: Clinical exam, blood panel, IV fluids 500 ml, antiemetic injection. Re-check in 3 days.
                    settlementId: 5a4b3c2d-1e0f-4a9b-8c7d-6e5f4a3b2c1d
                    resultCode: 100
                    resultText: OK
                    trace: 3f2b9c1e8a7d4b6f9e0a1c2d3e4f5a6b
                missingData:
                  $ref: '#/components/examples/Err400'
                authFailed:
                  $ref: '#/components/examples/Err410'
                notFound:
                  $ref: '#/components/examples/Err420'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '500':
          $ref: '#/components/responses/ServerError'
  /GetIncidentList:
    post:
      operationId: GetIncidentList
      summary: List incidents
      description: |
        Lists incidents with their claimed amounts and status labels.

        * `partnerId` must be sent and must not be empty or `0`. Use the `partnerID` returned by `GetAccount`.
        * `incidentStatusCode` and `settlementStatusCode` are localized labels here (for example `Settled`, `Confirmed`), not numeric codes. `settlementStatusCode` is `0` when there is no settlement yet.
        * `blockedAmount` is currently always returned as `0`. Use `GetIncidentStatus` (`covered`) for the payable amount of an incident.
        * `incidents` is omitted when `incidentCount` is `0`.

        **Possible `resultCode` values:** `100`, `400`, `410`.
      tags: [Settlement and status]
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/GetIncidentListRequest'
            examples:
              default:
                summary: List incidents
                value:
                  userName: <CLINIC_LOGIN>
                  password: <CLINIC_PASSWORD>
                  swName: ExampleVetSoftware
                  swVersion: 4.2.0
                  lang: en
                  partnerId: VET00123
      responses:
        '200':
          description: Business result. Check `resultCode`.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetIncidentListResponse'
              examples:
                success:
                  summary: 100 - Two incidents
                  value:
                    resultCode: 100
                    resultText: OK
                    partnerID: VET00123
                    incidentCount: 2
                    incidents:
                      - incidentNr: IN9512345678
                        claimNr: CL9025123456
                        dateCreated: '2025-10-20'
                        claimedAmount: 2461
                        blockedAmount: 0
                        incidentStatusCode: Settled
                        settlementStatusCode: Confirmed
                      - incidentNr: IN9587654321
                        claimNr: CL9025123456
                        dateCreated: '2025-10-23'
                        claimedAmount: 760
                        blockedAmount: 0
                        incidentStatusCode: New
                        settlementStatusCode: 0
                    trace: 3f2b9c1e8a7d4b6f9e0a1c2d3e4f5a6b
                empty:
                  summary: 100 - No incidents
                  value:
                    resultCode: 100
                    resultText: OK
                    partnerID: VET00123
                    incidentCount: 0
                    trace: 3f2b9c1e8a7d4b6f9e0a1c2d3e4f5a6b
                missingData:
                  $ref: '#/components/examples/Err400'
                authFailed:
                  $ref: '#/components/examples/Err410'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '500':
          $ref: '#/components/responses/ServerError'
  /ConfirmIncident:
    post:
      operationId: ConfirmIncident
      summary: Confirm a simulated incident
      description: |
        Turns a simulated incident (submitted with `incident.preauthorization: true`) into a
        real one so that it can be paid.

        `holdPayment` (optional) sets or clears a payment hold on the incident's settlement.
        Use `true` when the treatment has not happened yet or the invoice is not final. A
        failure to change the hold does not change the result of the call.

        **Possible `resultCode` values:** `100`, `400`, `410`, `420` (incident not found or not updated).
      tags: [Settlement and status]
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ConfirmIncidentRequest'
            examples:
              confirm:
                summary: Confirm and release for payment
                value:
                  userName: <CLINIC_LOGIN>
                  password: <CLINIC_PASSWORD>
                  swName: ExampleVetSoftware
                  swVersion: 4.2.0
                  lang: en
                  incidentNumber: IN9512345678
                  holdPayment: false
              confirmHold:
                summary: Confirm but keep payment on hold
                value:
                  userName: <CLINIC_LOGIN>
                  password: <CLINIC_PASSWORD>
                  incidentNumber: IN9512345678
                  holdPayment: true
      responses:
        '200':
          description: Business result. Check `resultCode`.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SimpleResponse'
              examples:
                success:
                  $ref: '#/components/examples/SimpleSuccess'
                missingData:
                  $ref: '#/components/examples/Err400'
                authFailed:
                  $ref: '#/components/examples/Err410'
                notFound:
                  $ref: '#/components/examples/Err420'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '500':
          $ref: '#/components/responses/ServerError'
  /CancelIncident:
    post:
      operationId: CancelIncident
      summary: Cancel an incident
      description: |
        Cancels an incident, for example when the invoice was cancelled or submitted by mistake.

        Cancellation is allowed only while the settlement is `1` (New), `856900000`
        (Processing) or `856900001` (Confirmed). This covers both real and simulated incidents.
        It is refused with `420` when:
        * the settlement is `856900003` (Paid), `856900002` / `856900004` (Cancelled/Rejected) or `2` (Inactive), or
        * the incident has no settlement yet (for example an asynchronous submission still being processed), or
        * the incident does not exist.

        Once an incident is paid, corrections must be agreed with PetExpert outside the API.

        If the backend update fails, the response body contains only `trace`. Treat that as a
        failure and retry later.

        **Possible `resultCode` values:** `100`, `400`, `410`, `420`, or a trace-only body.
      tags: [Settlement and status]
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/IncidentNumberRequest'
            examples:
              default:
                $ref: '#/components/examples/ReqIncidentNumber'
      responses:
        '200':
          description: Business result. Check `resultCode`.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CancelIncidentResponse'
              examples:
                success:
                  $ref: '#/components/examples/SimpleSuccess'
                notAllowed:
                  summary: 420 - Already paid, rejected, inactive or not found
                  value:
                    resultCode: 420
                    resultText: Object fitting search criteria was not found in the system.
                    partnerID: VET00123
                    trace: 3f2b9c1e8a7d4b6f9e0a1c2d3e4f5a6b
                updateFailed:
                  $ref: '#/components/examples/TraceOnly'
                missingData:
                  $ref: '#/components/examples/Err400'
                authFailed:
                  $ref: '#/components/examples/Err410'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '500':
          $ref: '#/components/responses/ServerError'
  /UpdateDayreport:
    post:
      operationId: UpdateDayreport
      summary: Append text to an incident's medical report
      description: |
        Appends text to the medical report of an incident, for example a daily report during
        hospitalisation. The server adds the prefix `[Adding on d.m.yyyy]` in front of the new
        text. Existing text is kept.

        If the backend update fails, the response body contains only `trace`.

        **Possible `resultCode` values:** `100`, `400`, `410`, `420`, or a trace-only body.
      tags: [Settlement and status]
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateDayreportRequest'
            examples:
              default:
                summary: Daily report
                value:
                  userName: <CLINIC_LOGIN>
                  password: <CLINIC_PASSWORD>
                  swName: ExampleVetSoftware
                  swVersion: 4.2.0
                  lang: en
                  incidentNumber: IN9512345678
                  dayReport: Day 2 of hospitalisation, eating small amounts, IV fluids stopped.
      responses:
        '200':
          description: Business result. Check `resultCode`.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UpdateDayreportResponse'
              examples:
                success:
                  $ref: '#/components/examples/SimpleSuccess'
                notFound:
                  $ref: '#/components/examples/Err420'
                updateFailed:
                  $ref: '#/components/examples/TraceOnly'
                missingData:
                  $ref: '#/components/examples/Err400'
                authFailed:
                  $ref: '#/components/examples/Err410'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '500':
          $ref: '#/components/responses/ServerError'
components:
  securitySchemes:
    SubscriptionKey:
      type: apiKey
      in: header
      name: Ocp-Apim-Subscription-Key
      description: |
        Subscription key for the Claim API, issued by PetExpert per integrating software and
        environment. Test key: `<TEST_SUBSCRIPTION_KEY>`. Production keys are issued during
        onboarding (see Getting started).
    SubscriptionKeyQuery:
      type: apiKey
      in: query
      name: subscription-key
      description: |
        The same subscription key passed as a query parameter instead of the header. Prefer the
        header: query strings tend to end up in logs.
  responses:
    Unauthorized:
      description: |
        Missing or invalid subscription key (returned by the API gateway, not by the business
        logic). Wrong clinic credentials return HTTP 200 with `resultCode` `410` instead.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/GatewayError'
          example:
            statusCode: 401
            message: Access denied due to missing subscription key. Make sure to include subscription key when making requests to an API.
    TooManyRequests:
      description: |
        Rate limit exceeded at the gateway. Limits: `<RATE_LIMITS>` (to be confirmed by
        PetExpert). Wait for the number of seconds in the `Retry-After` header before retrying.
      headers:
        Retry-After:
          schema:
            type: integer
          description: Seconds to wait before retrying.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/GatewayError'
          example:
            statusCode: 429
            message: Rate limit is exceeded. Try again in 10 seconds.
    ServerError:
      description: Unexpected server or gateway error. Retry later; for claim submissions check `GetOpenClaims` first to avoid duplicates.
  examples:
    ReqClinicOnly:
      summary: Clinic credentials only
      value:
        userName: <CLINIC_LOGIN>
        password: <CLINIC_PASSWORD>
        swName: ExampleVetSoftware
        swVersion: 4.2.0
        lang: en
    ReqPolicyNumber:
      summary: Policy number
      value:
        userName: <CLINIC_LOGIN>
        password: <CLINIC_PASSWORD>
        swName: ExampleVetSoftware
        swVersion: 4.2.0
        lang: en
        policyNumber: '1234250115'
    ReqIncidentNumber:
      summary: Incident number
      value:
        userName: <CLINIC_LOGIN>
        password: <CLINIC_PASSWORD>
        swName: ExampleVetSoftware
        swVersion: 4.2.0
        lang: en
        incidentNumber: IN9512345678
    SimpleSuccess:
      summary: 100 - Success
      value:
        resultCode: 100
        resultText: OK
        partnerID: VET00123
        trace: 3f2b9c1e8a7d4b6f9e0a1c2d3e4f5a6b
    TraceOnly:
      summary: Update failed (trace only)
      value:
        trace: 3f2b9c1e8a7d4b6f9e0a1c2d3e4f5a6b
    Err400:
      summary: 400 - Missing or invalid mandatory data
      value:
        resultCode: 400
        resultText: Missing mandatory data for processing request or data in incorrect format.
        trace: 3f2b9c1e8a7d4b6f9e0a1c2d3e4f5a6b
    Err410:
      summary: 410 - Clinic authentication failed
      value:
        resultCode: 410
        resultText: User authentication failed.
        trace: 3f2b9c1e8a7d4b6f9e0a1c2d3e4f5a6b
    Err420:
      summary: 420 - Not found
      value:
        resultCode: 420
        resultText: Object fitting search criteria was not found in the system.
        trace: 3f2b9c1e8a7d4b6f9e0a1c2d3e4f5a6b
    Err420Policy:
      summary: 420 - Policy not found
      value:
        resultCode: 420
        resultText: Object fitting search criteria was not found in the system. [Policy does not exist or is not active.]
        trace: 3f2b9c1e8a7d4b6f9e0a1c2d3e4f5a6b
    Err420Benefit:
      summary: 420 - No active vet benefit
      value:
        resultCode: 420
        resultText: Object fitting search criteria was not found in the system. [Policy benefit does not exist or is not active.]
        trace: 3f2b9c1e8a7d4b6f9e0a1c2d3e4f5a6b
    Err420Claim:
      summary: 420 - Claim not found
      value:
        resultCode: 420
        resultText: Object fitting search criteria was not found in the system.[Claim]
        trace: 3f2b9c1e8a7d4b6f9e0a1c2d3e4f5a6b
    Err510Incident:
      summary: 510 - Claim or incident could not be created
      value:
        resultCode: 510
        resultText: Object could not be created in the system. [Incident create issue.]
        trace: 3f2b9c1e8a7d4b6f9e0a1c2d3e4f5a6b
    Err510CostItem:
      summary: 510 - Cost items could not be created
      value:
        resultCode: 510
        resultText: Object could not be created in the system. [Cost item create issue.]
        trace: 3f2b9c1e8a7d4b6f9e0a1c2d3e4f5a6b
    Err999Settlement:
      summary: 999 - Records created but settlement could not be read
      description: The claim and incident were probably created. Check `GetOpenClaims` before resubmitting.
      value:
        sid: null
        claimed: null
        statusCode: null
        status: null
        covered: 0
        preauthorization: false
        incidentNumber: null
        claimNumber: null
        resultCode: 999
        resultText: System encountered unknown problem. Please contact helpdesk.
        partnerID: VET00123
        trace: 3f2b9c1e8a7d4b6f9e0a1c2d3e4f5a6b
    SettlementConfirmedCZK:
      summary: 100 - Confirmed, covered amount returned (CZK)
      value:
        sid: 5a4b3c2d-1e0f-4a9b-8c7d-6e5f4a3b2c1d
        claimed: 2461
        statusCode: 856900001
        status: Confirmed
        covered: 2214.9
        currency: CZK
        preauthorization: false
        incidentNumber: IN9512345678
        claimNumber: CL9025123456
        claimUrl: https://test.petexpert.cz/claim.php?id=9265311223446586
        paymentHold: false
        directPay: true
        created: '2025-10-20'
        resultCode: 100
        resultText: OK
        partnerID: VET00123
        trace: 3f2b9c1e8a7d4b6f9e0a1c2d3e4f5a6b
    SettlementConfirmedEUR:
      summary: 100 - Confirmed, covered amount returned (EUR)
      value:
        sid: 9d8c7b6a-5f4e-4d3c-8b2a-1f0e9d8c7b6a
        claimed: 102.3
        statusCode: 856900001
        status: Confirmed
        covered: 92.07
        currency: EUR
        preauthorization: false
        incidentNumber: IN9576543210
        claimNumber: CL9025654321
        claimUrl: https://test.petexpert.sk/claim.php?id=9265361524436281
        paymentHold: false
        directPay: true
        created: '2025-10-21'
        resultCode: 100
        resultText: OK
        partnerID: VET00456
        trace: 7c1d2e3f4a5b6c7d8e9f0a1b2c3d4e5f
    SettlementPaid:
      summary: 100 - Paid
      value:
        sid: 5a4b3c2d-1e0f-4a9b-8c7d-6e5f4a3b2c1d
        claimed: 2461
        statusCode: 856900003
        status: Paid
        covered: 2214.9
        currency: CZK
        preauthorization: false
        incidentNumber: IN9512345678
        claimNumber: CL9025123456
        claimUrl: https://test.petexpert.cz/claim.php?id=9265311223446586
        paymentHold: false
        directPay: true
        created: '2025-10-20'
        resultCode: 100
        resultText: OK
        partnerID: VET00123
        trace: 3f2b9c1e8a7d4b6f9e0a1c2d3e4f5a6b
    SettlementProcessing:
      summary: 100 - Processing (manual review, covered is 0)
      value:
        sid: 5a4b3c2d-1e0f-4a9b-8c7d-6e5f4a3b2c1d
        claimed: 2461
        statusCode: 856900000
        status: Processing
        covered: 0
        currency: CZK
        preauthorization: false
        incidentNumber: IN9512345678
        claimNumber: CL9025123456
        claimUrl: https://test.petexpert.cz/claim.php?id=9265311223446586
        paymentHold: false
        directPay: true
        created: '2025-10-20'
        resultCode: 100
        resultText: OK
        partnerID: VET00123
        trace: 3f2b9c1e8a7d4b6f9e0a1c2d3e4f5a6b
    SettlementRejected:
      summary: 100 - Rejected (covered is 0)
      value:
        sid: 5a4b3c2d-1e0f-4a9b-8c7d-6e5f4a3b2c1d
        claimed: 590
        statusCode: 856900002
        status: Canceled/Rejected
        covered: 0
        currency: CZK
        preauthorization: false
        incidentNumber: IN9512345679
        claimNumber: CL9025123457
        claimUrl: https://test.petexpert.cz/claim.php?id=9265311223446587
        paymentHold: false
        directPay: true
        created: '2025-10-20'
        resultCode: 100
        resultText: OK
        partnerID: VET00123
        trace: 3f2b9c1e8a7d4b6f9e0a1c2d3e4f5a6b
    AsyncAccepted:
      summary: 100 - Asynchronous acknowledgement (poll GetIncidentStatus)
      value:
        sid: null
        claimed: 102.3
        statusCode: 999
        status: null
        covered: 0
        currency: EUR
        preauthorization: false
        incidentNumber: IN9576543210
        claimNumber: CL9025654321
        claimUrl: https://test.petexpert.sk/claim.php?id=9265361524436281
        paymentHold: null
        directPay: null
        created: '2025-10-21'
        postprocess: true
        async: true
        resultCode: 100
        partnerID: VET00456
        trace: 7c1d2e3f4a5b6c7d8e9f0a1b2c3d4e5f
  schemas:
    Lang:
      type: string
      enum: [cz, sk, pl, en, jp]
      description: Language of `resultText` and status labels. Defaults to the market language. Unknown values fall back to the default.
      example: en
    Trace:
      type: string
      pattern: '^[0-9a-f]{32}$'
      description: Request trace ID. Quote it when contacting PetExpert support.
      example: 3f2b9c1e8a7d4b6f9e0a1c2d3e4f5a6b
    PartnerID:
      type: [string, 'null']
      description: PetExpert provider code of the authenticated clinic (same value as `GetAccount.partnerID`).
      example: VET00123
    PolicyNumber:
      type: string
      minLength: 10
      maxLength: 10
      pattern: '^[0-9]{10}$'
      description: 10-digit PetExpert policy number, as printed on the policy document.
      example: '1234250115'
    ClaimNumber:
      type: string
      minLength: 12
      maxLength: 12
      pattern: '^CL[0-9]{10}$'
      description: 12-character claim number returned by `AddNewClaim`, for example `CL9025123456`.
      example: CL9025123456
    IncidentNumber:
      type: string
      minLength: 12
      maxLength: 12
      pattern: '^IN[0-9]{10}$'
      description: 12-character incident number returned by `AddNewClaim` / `AddNewIncident`, for example `IN9512345678`.
      example: IN9512345678
    ResultCode:
      type: integer
      enum: [100, 400, 410, 420, 510, 520, 999]
      description: |
        Business result code, returned with HTTP 200.

        | Code | Meaning | What to do |
        |---|---|---|
        | `100` | Success | Continue. |
        | `400` | Mandatory data missing or in the wrong format | Fix the request. Do not retry unchanged. |
        | `410` | Clinic authentication failed | Ask the clinic to update its PetExpert login in your software. |
        | `420` | Object not found or not in an allowed state (policy, benefit, claim, incident, settlement) | Show `resultText` to the user. |
        | `510` | Record could not be created | Check `GetOpenClaims` for a partially created claim, then retry or contact support. |
        | `520` | Record could not be updated | Retry later or contact support. |
        | `999` | Unknown error, or the settlement could not be read after creation | Check `GetOpenClaims` / `GetIncidentStatus` before resubmitting. |
    SettlementStatusCode:
      type: integer
      enum: [1, 856900000, 856900001, 856900002, 856900003, 856900004, 2, 999]
      description: |
        Settlement status.

        | Code | Label (en) | Meaning | `covered` | Can cancel |
        |---|---|---|---|---|
        | `1` | New | Settlement created, not yet evaluated | as calculated | yes |
        | `856900000` | Processing | Under manual review by PetExpert | forced to `0` | yes |
        | `856900001` | Confirmed | Approved; `covered` will be paid | payable amount | yes |
        | `856900003` | Paid | Payment sent | paid amount | no |
        | `856900002` | Canceled/Rejected | Not covered | forced to `0` | no |
        | `856900004` | Canceled/Rejected | Cancelled | forced to `0` | no |
        | `2` | Inactive | Settlement deactivated | forced to `0` | no |
        | `999` | (none) | Asynchronous submission accepted; result not available yet | `0` | no |

        Book `covered` as an insurance payment only for `856900001` and `856900003`.
    CauseType:
      type: integer
      enum: [1, 2]
      description: |
        Cause of the claim.

        | Value | Meaning |
        |---|---|
        | `1` | Illness |
        | `2` | Accident / injury |

        Any value other than `1` is treated as accident / injury.
      example: 1
    ItemType:
      type: integer
      enum: [1, 2, 3, 4, 5, 6, 7]
      description: |
        Cost item category.

        | Value | Meaning | Examples |
        |---|---|---|
        | `1` | Material | Bandages, implants, consumables |
        | `2` | Treatment | Examination, surgery, anaesthesia, hospitalisation |
        | `3` | Other services | Laboratory, imaging, external services |
        | `4` | Medication | Drugs, vaccines, injections |
        | `5` | Food | Diet and food (usually not covered) |
        | `6` | Administration | Fees, reports, certificates |
        | `7` | Other | Anything else |
      example: 2
    ClientInfo:
      type: object
      required: [swName, swVersion, lang]
      properties:
        swName:
          type: string
          minLength: 1
          description: "**Required.** Name of the calling software. Used for support and statistics."
          example: ExampleVetSoftware
        swVersion:
          type: string
          minLength: 1
          description: "**Required.** Version of the calling software."
          example: 4.2.0
        lang:
          $ref: '#/components/schemas/Lang'
    ClinicCredentials:
      type: object
      required: [userName, password]
      properties:
        userName:
          type: string
          minLength: 1
          description: "**Required** on clinic methods. Clinic login issued by PetExpert. Store it per clinic in your software."
          example: <CLINIC_LOGIN>
        password:
          type: string
          format: password
          writeOnly: true
          minLength: 1
          description: "**Required** on clinic methods. Clinic password issued by PetExpert."
          example: <CLINIC_PASSWORD>
    ClinicRequest:
      allOf:
        - $ref: '#/components/schemas/ClinicCredentials'
        - $ref: '#/components/schemas/ClientInfo'
    PolicyNumberRequest:
      allOf:
        - $ref: '#/components/schemas/ClinicRequest'
        - type: object
          required: [policyNumber]
          properties:
            policyNumber:
              $ref: '#/components/schemas/PolicyNumber'
    IncidentNumberRequest:
      allOf:
        - $ref: '#/components/schemas/ClinicRequest'
        - type: object
          required: [incidentNumber]
          properties:
            incidentNumber:
              $ref: '#/components/schemas/IncidentNumber'
    GetClaimRequest:
      allOf:
        - $ref: '#/components/schemas/ClinicRequest'
        - type: object
          required: [claimNr]
          properties:
            claimNr:
              $ref: '#/components/schemas/ClaimNumber'
    GetIncidentListRequest:
      allOf:
        - $ref: '#/components/schemas/ClinicRequest'
        - type: object
          required: [partnerId]
          properties:
            partnerId:
              type: string
              minLength: 1
              not:
                const: '0'
              description: The clinic's `partnerID` from `GetAccount`. Must not be empty or `0`.
              example: VET00123
    GetPolicyByPolicyIDRequest:
      allOf:
        - $ref: '#/components/schemas/ClientInfo'
        - type: object
          required: [policyId]
          properties:
            policyId:
              type: string
              format: uuid
              description: PetExpert internal policy ID (GUID).
              example: 6f1c2a3b-4d5e-4f60-8a7b-9c0d1e2f3a4b
    GetPolicyByChipNrRequest:
      allOf:
        - $ref: '#/components/schemas/ClientInfo'
        - type: object
          required: [chipNr]
          properties:
            chipNr:
              type: string
              minLength: 4
              description: Microchip number exactly as stored on the policy (usually 15 digits, no spaces).
              example: '203098100123456'
    ConfirmIncidentRequest:
      allOf:
        - $ref: '#/components/schemas/IncidentNumberRequest'
        - type: object
          properties:
            holdPayment:
              type: boolean
              description: '`true` puts the settlement on payment hold, `false` releases it. Omit to leave the hold unchanged.'
              example: false
    UpdateDayreportRequest:
      allOf:
        - $ref: '#/components/schemas/IncidentNumberRequest'
        - type: object
          required: [dayReport]
          properties:
            dayReport:
              type: string
              description: Text to append to the medical report. Keep the total report under 10,000 characters.
              example: Day 2 of hospitalisation, eating small amounts, IV fluids stopped.
    CostItem:
      type: object
      required: [name, code, type, amount]
      properties:
        name:
          type: string
          minLength: 1
          maxLength: 200
          description: |
            **Required.** Item description as printed on the invoice (legacy name `itemName`). The
            API does not truncate this field; the storage limit is `<ITEM_NAME_MAX_LENGTH>` (to be
            confirmed by PetExpert). 200 characters is a safe maximum.
          example: Clinical examination
        code:
          type: string
          maxLength: 100
          description: |
            **Required** (may be empty or `NCD`). Your internal item / price-list code (legacy name
            `itemCode`). Storage limit `<ITEM_CODE_MAX_LENGTH>` (to be confirmed).
          example: EXAM01
        type:
          $ref: '#/components/schemas/ItemType'
        amount:
          type: number
          description: |
            **Required.** **Line total** for this item (quantity x unit price, after discounts) in
            the market currency, as a JSON number with a dot decimal separator (legacy name
            `itemAmount`). Whether amounts must include VAT: `<VAT_RULE>` (to be confirmed by
            PetExpert; send the amount the customer is invoiced). The sum of all `amount` values is
            returned as `claimed`.
          example: 650
        quantity:
          type: integer
          minimum: 1
          description: Number of units. Must be a JSON integer; decimals or strings are ignored. Informational only.
          example: 1
        unitPrice:
          type: number
          description: Price per unit, informational only. `amount` is what is settled.
          example: 650
        exclude:
          type: boolean
          default: false
          description: '`true` marks the item as known not to be insured (for example food or cosmetic items). It is stored but not settled.'
        itemNote:
          type: string
          maxLength: 2000
          description: Free-text note for the item. Storage limit `<ITEM_NOTE_MAX_LENGTH>` (to be confirmed).
        mdb:
          type: string
          description: Optional external medication/database reference (for example a national drug code).
    CostItemWithTax:
      allOf:
        - $ref: '#/components/schemas/CostItem'
        - type: object
          properties:
            basePrice:
              type: number
              description: Accepted for compatibility but **not stored**.
            taxAmount:
              type: number
              description: Accepted for compatibility but **not stored**.
            taxRatePct:
              type: number
              description: Accepted for compatibility but **not stored**.
    AddNewClaimRequest:
      allOf:
        - $ref: '#/components/schemas/ClinicRequest'
        - type: object
          required: [policyNumber, claimName, causeType, description, incident]
          properties:
            policyNumber:
              $ref: '#/components/schemas/PolicyNumber'
            claimName:
              type: string
              minLength: 1
              maxLength: 200
              description: |
                Short name of the insured event, for example the diagnosis. Truncated to 200
                characters. Also used as the name of the first incident.
              example: Gastroenteritis
            causeType:
              $ref: '#/components/schemas/CauseType'
            description:
              type: string
              maxLength: 10000
              description: Description of the event and history (legacy name `detail` / `causeDescription`). Truncated to 10,000 characters.
              example: Vomiting and diarrhoea since 18.10., dehydrated.
            async:
              type: boolean
              default: false
              description: '`true` returns an immediate acknowledgement (`statusCode` `999`) and processes in the background.'
            incident:
              $ref: '#/components/schemas/NewClaimIncident'
            preauthorization:
              type: boolean
              description: Echoed in the asynchronous acknowledgement only. Use `incident.preauthorization` to create a simulated incident.
    NewClaimIncident:
      type: object
      required: [items]
      properties:
        medicalReport:
          type: string
          maxLength: 10000
          default: ''
          description: Medical report / anamnesis for this visit (legacy name `incidentDetail`). Truncated to 10,000 characters.
          example: Clinical exam, blood panel, IV fluids 500 ml, antiemetic injection.
        comment:
          description: Used as `medicalReport` when `medicalReport` is empty. Objects and arrays are stored as JSON text.
          type: [string, object, array]
        clinicalSignsFrom:
          type: string
          format: date
          description: |
            Date of the first clinical signs, `yyyy-MM-dd`. An empty string is accepted. Currently
            accepted but not stored; the server records the submission date.
          example: '2025-10-18'
        visitDate:
          type: string
          format: date
          description: Date of the visit, `yyyy-MM-dd`. Defaults to today. Used only to build a default incident name.
          example: '2025-10-20'
        preauthorization:
          type: boolean
          default: false
          description: '`true` creates a simulated incident (cost estimate) that is not paid until `ConfirmIncident`.'
        externalid:
          type: string
          maxLength: 100
          description: Your invoice or visit ID (legacy name `xBankingSS`). Accepted but **not stored** and not used for duplicate detection.
          example: INV-2025-000123
        items:
          type: array
          minItems: 1
          description: Invoice lines.
          items:
            $ref: '#/components/schemas/CostItem'
    AddNewIncidentRequest:
      allOf:
        - $ref: '#/components/schemas/ClinicRequest'
        - type: object
          required: [claimNumber, incident]
          properties:
            claimNumber:
              $ref: '#/components/schemas/ClaimNumber'
            async:
              type: boolean
              default: false
              description: '`true` returns an immediate acknowledgement (`statusCode` `999`) and processes in the background.'
            incident:
              type: object
              required: [items, clinicalSignsFrom]
              properties:
                incidentName:
                  type: string
                  maxLength: 200
                  description: Name of the visit. Truncated to 200 characters. Defaults to `visitDate` in the market date format.
                  example: Re-check 23.10.2025
                medicalReport:
                  type: string
                  maxLength: 10000
                  default: ''
                  description: Medical report for this visit. Truncated to 10,000 characters.
                clinicalSignsFrom:
                  type: string
                  description: Mandatory key. `yyyy-MM-dd` or an empty string; `null` is rejected with `400`. Currently not stored.
                  example: '2025-10-18'
                visitDate:
                  type: string
                  format: date
                  description: Date of the visit, `yyyy-MM-dd`. Defaults to today.
                  example: '2025-10-23'
                preauthorization:
                  type: boolean
                  default: false
                  description: '`true` creates a simulated incident.'
                payToMember:
                  type: boolean
                  description: Accepted for compatibility; not used.
                isPrimaryInsurance:
                  type: boolean
                  description: Accepted for compatibility; not used.
                externalid:
                  type: [string, 'null']
                  description: Your invoice or visit ID. Accepted but not stored.
                items:
                  type: array
                  minItems: 1
                  items:
                    $ref: '#/components/schemas/CostItemWithTax'
    ApplicationError:
      type: object
      required: [resultCode, resultText]
      properties:
        resultCode:
          $ref: '#/components/schemas/ResultCode'
        resultText:
          type: string
          description: Localized error text, sometimes with a detail in brackets.
        partnerID:
          $ref: '#/components/schemas/PartnerID'
        trace:
          $ref: '#/components/schemas/Trace'
    TraceOnlyResponse:
      type: object
      required: [trace]
      additionalProperties: false
      properties:
        trace:
          $ref: '#/components/schemas/Trace'
      description: Returned when a backend update failed unexpectedly. Treat as failure.
    GatewayError:
      type: object
      properties:
        statusCode:
          type: integer
        message:
          type: string
    TestConnectionResponse:
      type: object
      required: [resultCode, resultText, env, script]
      properties:
        resultCode:
          type: integer
          const: 100
        resultText:
          type: string
        env:
          type: string
          description: Backend environment name.
        script:
          type: string
        trace:
          $ref: '#/components/schemas/Trace'
    GetAccountSuccess:
      type: object
      required: [resultCode, resultText, partnerID]
      properties:
        resultCode:
          type: integer
          const: 100
        resultText:
          type: string
        partnerID:
          $ref: '#/components/schemas/PartnerID'
        facilityAddress:
          type: [string, 'null']
        facilityCity:
          type: [string, 'null']
        facilityName:
          type: [string, 'null']
        facilityZIP:
          type: [string, 'null']
        orgName:
          type: [string, 'null']
        telephone:
          type: [string, 'null']
        email:
          type: [string, 'null']
        trace:
          $ref: '#/components/schemas/Trace'
    GetAccountResponse:
      anyOf:
        - $ref: '#/components/schemas/GetAccountSuccess'
        - $ref: '#/components/schemas/ApplicationError'
    GetActivePolicySuccess:
      type: object
      required: [resultCode, resultText, policyNumber, status, balance]
      properties:
        resultCode:
          type: integer
          const: 100
        resultText:
          type: string
        partnerID:
          $ref: '#/components/schemas/PartnerID'
        policyNumber:
          type: string
        productName:
          type: [string, 'null']
          description: Insurance product name.
        dateActivated:
          type: string
          description: Activation date `yyyy-MM-dd`. `1970-01-01` when the policy has never been activated.
        dateExpiring:
          type: string
          description: Cancellation date `yyyy-MM-dd`, or `""` when none is set.
        dateQualifying:
          type: string
          description: Activation date + 3 days `yyyy-MM-dd`, or `""` when not activated.
        dateCreated:
          type: string
        dateRenew:
          type: string
        status:
          type: string
          description: 'Localized policy status: `Active`, `Waiting for activation` or `Inactive` (en).'
        animalName:
          type: string
        chipNumber:
          type: string
        animalBreed:
          type: string
        animalDob:
          type: string
          format: date
          description: Omitted when unknown.
        animalType:
          type: string
          description: 'Localized: `Dog` or `Cat` (en).'
        animalSex:
          type: string
          description: 'Localized: `Female`, `Male` or `""` (en).'
        balance:
          type: number
          description: Remaining limit of the vet benefit, rounded, in the market currency.
        benefitName:
          type: string
        benefitCode:
          type: string
          description: Benefit code, for example `PBVET07`.
        benefitStatus:
          type: string
        providerName:
          type: string
          description: Clinic or partner that sold the policy, if any.
        policyNote:
          type: [string, 'null']
          description: Public note on the policy (for example exclusions). Show it to the vet.
        customerFName:
          type: string
          description: Masked for GDPR.
        customerLName:
          type: [string, 'null']
        customerAddress:
          type: string
          description: Masked for GDPR.
        customerCity:
          type: [string, 'null']
        customerZip:
          type: [string, 'null']
        customerEmail:
          type: string
          description: Masked for GDPR.
        customerPhone:
          type: string
          description: Masked for GDPR.
        customerId:
          type: [string, 'null']
        trace:
          $ref: '#/components/schemas/Trace'
    GetActivePolicyResponse:
      anyOf:
        - $ref: '#/components/schemas/GetActivePolicySuccess'
        - $ref: '#/components/schemas/ApplicationError'
    GetCurrentBalanceSuccess:
      type: object
      required: [resultCode, resultText, currentBalance]
      properties:
        resultCode:
          type: integer
          const: 100
        resultText:
          type: string
        partnerID:
          $ref: '#/components/schemas/PartnerID'
        currentBalance:
          type: number
          description: Remaining limit, rounded, in the market currency. `0` if not found or inactive.
        trace:
          $ref: '#/components/schemas/Trace'
    GetCurrentBalanceResponse:
      anyOf:
        - $ref: '#/components/schemas/GetCurrentBalanceSuccess'
        - $ref: '#/components/schemas/ApplicationError'
    GetPolicyByPolicyIDResponse:
      anyOf:
        - type: object
          required: [policyNumber, customerPhone]
          properties:
            policyNumber:
              type: string
              description: Policy number, or `""` when not found.
            customerPhone:
              type: [string, 'null']
              description: Policy holder phone, or `""` when not found.
            trace:
              $ref: '#/components/schemas/Trace'
        - $ref: '#/components/schemas/ApplicationError'
    GetPolicyByChipNrResponse:
      type: object
      required: [resultCode, resultText, policyNumber]
      properties:
        resultCode:
          type: integer
          enum: [100, 420]
        resultText:
          type: string
        policyNumber:
          type: string
          description: Policy number, or `""` when not found.
        trace:
          $ref: '#/components/schemas/Trace'
    GetOpenClaimsSuccess:
      type: object
      required: [resultCode, resultText, openClaimCount]
      properties:
        resultCode:
          type: integer
          const: 100
        resultText:
          type: string
        partnerID:
          $ref: '#/components/schemas/PartnerID'
        openClaimCount:
          type: integer
        claims:
          type: array
          description: Omitted when `openClaimCount` is 0.
          items:
            type: object
            properties:
              claimName:
                type: [string, 'null']
              claimNumber:
                type: [string, 'null']
              dateCreated:
                type: string
                format: date
              reportedBy:
                type: [string, 'null']
                description: Name of the clinic that opened the claim.
        trace:
          $ref: '#/components/schemas/Trace'
    GetOpenClaimsResponse:
      anyOf:
        - $ref: '#/components/schemas/GetOpenClaimsSuccess'
        - $ref: '#/components/schemas/ApplicationError'
    GetClaimSuccess:
      type: object
      required: [resultCode, resultText, claim]
      properties:
        resultCode:
          type: integer
          const: 100
        resultText:
          type: string
        partnerID:
          $ref: '#/components/schemas/PartnerID'
        claim:
          type: object
          properties:
            claimNr:
              type: [string, 'null']
            claimName:
              type: [string, 'null']
            claimDescription:
              type: [string, 'null']
            dateCreated:
              type: string
              format: date
            openedBy:
              type: 'null'
        trace:
          $ref: '#/components/schemas/Trace'
    GetClaimResponse:
      anyOf:
        - $ref: '#/components/schemas/GetClaimSuccess'
        - $ref: '#/components/schemas/ApplicationError'
    Settlement:
      type: object
      description: Settlement result of one incident.
      required: [resultCode, statusCode, covered]
      properties:
        resultCode:
          type: integer
          const: 100
        resultText:
          type: string
        partnerID:
          $ref: '#/components/schemas/PartnerID'
        sid:
          type: [string, 'null']
          description: Settlement ID (GUID).
        incidentNumber:
          type: [string, 'null']
          description: Incident number. Store it; it is the key for all follow-up calls.
        claimNumber:
          type: [string, 'null']
          description: Claim number. Store it; use it for `AddNewIncident`.
        currency:
          type: [string, 'null']
          description: Market currency (`CZK`, `EUR`, `PLN`).
        claimed:
          type: [number, 'null']
          description: Sum of submitted item amounts.
        covered:
          type: [number, 'null']
          description: |
            Amount PetExpert pays (legacy name `blockedAmount`). Forced to `0` for Processing,
            Rejected, Cancelled and Inactive; for New (`1`) it may hold a provisional amount. Book it
            only for `statusCode` `856900001` (Confirmed) and `856900003` (Paid). The customer pays
            `claimed - covered`.
        statusCode:
          oneOf:
            - $ref: '#/components/schemas/SettlementStatusCode'
            - type: 'null'
        status:
          type: [string, 'null']
          description: Localized label of `statusCode`.
        preauthorization:
          type: [boolean, 'null']
          description: '`true` for a simulated incident that still needs `ConfirmIncident`.'
        claimUrl:
          type: string
          description: Link to the claim page for the policy holder.
        paymentHold:
          type: [boolean, 'null']
          description: '`true` when payment is on hold.'
        directPay:
          type: [boolean, 'null']
          description: '`true` when PetExpert pays the clinic directly; `false` when it pays the policy holder.'
        created:
          type: string
          description: Incident creation date `yyyy-MM-dd`.
        async:
          type: boolean
          description: Present (`true`) only in asynchronous acknowledgements.
        postprocess:
          type: boolean
          description: Present (`true`) only in asynchronous acknowledgements.
        trace:
          $ref: '#/components/schemas/Trace'
    SettlementUnavailable:
      type: object
      description: Records were probably created but the settlement could not be read. `resultCode` is 999.
      required: [resultCode, resultText]
      properties:
        resultCode:
          type: integer
          const: 999
        resultText:
          type: string
        partnerID:
          $ref: '#/components/schemas/PartnerID'
        sid:
          type: 'null'
        claimed:
          type: 'null'
        statusCode:
          type: 'null'
        status:
          type: 'null'
        covered:
          type: integer
          const: 0
        preauthorization:
          type: [boolean, 'null']
        incidentNumber:
          type: 'null'
        claimNumber:
          type: 'null'
        trace:
          $ref: '#/components/schemas/Trace'
    AddNewClaimResponse:
      anyOf:
        - $ref: '#/components/schemas/Settlement'
        - $ref: '#/components/schemas/SettlementUnavailable'
        - $ref: '#/components/schemas/ApplicationError'
    AddNewIncidentResponse:
      anyOf:
        - $ref: '#/components/schemas/Settlement'
        - $ref: '#/components/schemas/SettlementUnavailable'
        - $ref: '#/components/schemas/ApplicationError'
    GetIncidentStatusResponse:
      anyOf:
        - $ref: '#/components/schemas/Settlement'
        - $ref: '#/components/schemas/ApplicationError'
    GetIncidentDetailSuccess:
      type: object
      required: [resultCode, resultText, incidentNr]
      properties:
        resultCode:
          type: integer
          const: 100
        resultText:
          type: string
        incidentId:
          type: [string, 'null']
        incidentNr:
          type: [string, 'null']
        policyBenefit:
          type: [string, 'null']
          description: Benefit code, for example `PBVET07`.
        claimNumber:
          type: [string, 'null']
        partnerName:
          type: [string, 'null']
          description: Clinic that submitted the incident.
        incidentCause:
          type: [string, 'null']
          description: Localized label of the incident reason (response only).
        incidentStatus:
          type: [string, 'null']
          description: Localized incident status label (for example `New`, `Settled`).
        incidentState:
          type: [string, 'null']
          description: Localized state label (`Active` / `Inactive`). Cancelled incidents are inactive.
        documentType:
          type: [string, 'null']
          description: Localized document type label. Incidents created through the API have the type `VetNet`.
        lastIncident:
          type: [boolean, 'null']
        separateSettlement:
          type: [boolean, 'null']
        incidentStatusCode:
          type: [integer, 'null']
        settlementStatusCode:
          oneOf:
            - $ref: '#/components/schemas/SettlementStatusCode'
            - type: 'null'
        incidentDetail:
          type: [string, 'null']
        settlementId:
          type: string
          description: Settlement ID, or `""` when no settlement exists yet.
        dateCreated:
          type: string
          format: date
        incidentStart:
          type: [string, 'null']
          format: date
        incidentEnd:
          type: [string, 'null']
          format: date
        clinicalSignsFrom:
          type: [string, 'null']
          format: date
        trace:
          $ref: '#/components/schemas/Trace'
    GetIncidentDetailResponse:
      anyOf:
        - $ref: '#/components/schemas/GetIncidentDetailSuccess'
        - $ref: '#/components/schemas/ApplicationError'
    GetIncidentListSuccess:
      type: object
      required: [resultCode, resultText, incidentCount]
      properties:
        resultCode:
          type: integer
          const: 100
        resultText:
          type: string
        partnerID:
          $ref: '#/components/schemas/PartnerID'
        incidentCount:
          type: integer
        incidents:
          type: array
          description: Omitted when `incidentCount` is 0.
          items:
            type: object
            properties:
              incidentNr:
                type: [string, 'null']
              claimNr:
                type: [string, 'null']
              dateCreated:
                type: string
                format: date
              claimedAmount:
                type: [number, 'null']
              blockedAmount:
                type: number
                description: Currently always `0`. Use `GetIncidentStatus`.
              incidentStatusCode:
                type: [string, 'null']
                description: Localized incident status label.
              settlementStatusCode:
                type: [string, integer, 'null']
                description: Localized settlement status label, or `0` when no settlement exists.
        trace:
          $ref: '#/components/schemas/Trace'
    GetIncidentListResponse:
      anyOf:
        - $ref: '#/components/schemas/GetIncidentListSuccess'
        - $ref: '#/components/schemas/ApplicationError'
    SimpleSuccess:
      type: object
      required: [resultCode, resultText]
      properties:
        resultCode:
          type: integer
          const: 100
        resultText:
          type: string
        partnerID:
          $ref: '#/components/schemas/PartnerID'
        trace:
          $ref: '#/components/schemas/Trace'
    SimpleResponse:
      anyOf:
        - $ref: '#/components/schemas/SimpleSuccess'
        - $ref: '#/components/schemas/ApplicationError'
    CancelIncidentResponse:
      anyOf:
        - $ref: '#/components/schemas/SimpleSuccess'
        - $ref: '#/components/schemas/ApplicationError'
        - $ref: '#/components/schemas/TraceOnlyResponse'
    UpdateDayreportResponse:
      anyOf:
        - $ref: '#/components/schemas/SimpleSuccess'
        - $ref: '#/components/schemas/ApplicationError'
        - $ref: '#/components/schemas/TraceOnlyResponse'
