openapi: 3.0.0
info:
  title: CascoApi
  description: CascoApi documentation
  contact:
    email: api.support@lifeishard.ro
  license:
    name: Apache 2.0
    url: https://www.apache.org/licenses/LICENSE-2.0.html
  version: '1.0'
servers:
  - url: https://casco.api.lifeishard.ro
    description: Production server
  - url: https://casco-qa.api.lifeishard.ro
    description: Development server
paths:
  /nomenclature/country:
    get:
      tags:
        - Nomenclature
      summary: List of countries
      operationId: 932f578cda8bfa334022b303905f8b5f
      parameters:
        - $ref: '#/components/parameters/HeaderToken'
      responses:
        '200':
          description: List of countries
          content:
            application/json:
              schema:
                properties:
                  data:
                    type: array
                    items:
                      properties:
                        id:
                          type: string
                          example: '1'
                        name:
                          type: string
                          example: GRECIA
                        iso2:
                          type: string
                          example: GR
                        iso3:
                          type: integer
                          example: GRC
                      type: object
                type: object
        '401':
          $ref: '#/components/responses/Response401Unauthorized'
        '404':
          $ref: '#/components/responses/Response404NotFound'
        '422':
          $ref: '#/components/responses/Response422InputValidation'
        '500':
          $ref: '#/components/responses/Response500ServerError'
  /nomenclature/county:
    get:
      tags:
        - Nomenclature
      summary: List of counties
      operationId: 22c15f2c1e8e20cd4bfb2505cf06b275
      parameters:
        - $ref: '#/components/parameters/HeaderToken'
      responses:
        '200':
          description: List of counties
          content:
            application/json:
              schema:
                properties:
                  data:
                    type: array
                    items:
                      properties:
                        county_code:
                          type: string
                          example: CJ
                        name:
                          type: string
                          example: CLUJ
                        siruta:
                          type: integer
                          example: '127'
                      type: object
                type: object
        '401':
          $ref: '#/components/responses/Response401Unauthorized'
        '404':
          $ref: '#/components/responses/Response404NotFound'
        '422':
          $ref: '#/components/responses/Response422InputValidation'
        '500':
          $ref: '#/components/responses/Response500ServerError'
  /nomenclature/locality/{county_code}:
    get:
      tags:
        - Nomenclature
      summary: List of localities filtered by county code
      operationId: d93dcacadd2907931d086d38bc5066ea
      parameters:
        - $ref: '#/components/parameters/HeaderToken'
        - name: county_code
          in: path
          description: County code
          required: true
          schema:
            type: integer
      responses:
        '200':
          description: List of localities
          content:
            application/json:
              schema:
                properties:
                  error:
                    type: boolean
                    example: 'false'
                  status:
                    type: number
                    example: '200'
                  data:
                    type: array
                    items:
                      properties:
                        nume:
                          type: string
                          example: CLUJ-NAPOCA
                        cod_judet:
                          type: string
                          example: CJ
                        cod_siruta:
                          type: integer
                          example: '54984'
                      type: object
                type: object
        '401':
          $ref: '#/components/responses/Response401Unauthorized'
        '404':
          $ref: '#/components/responses/Response404NotFound'
        '422':
          $ref: '#/components/responses/Response422InputValidation'
        '500':
          $ref: '#/components/responses/Response500ServerError'
  /nomenclature/vehile/make:
    get:
      tags:
        - Nomenclature
      summary: List of vehicle makes
      operationId: 03a4f029532d32ca60c54f722351d0c4
      parameters:
        - $ref: '#/components/parameters/HeaderToken'
      responses:
        '200':
          description: List of vehicle makes
          content:
            application/json:
              schema:
                properties:
                  data:
                    type: array
                    items:
                      properties:
                        name:
                          type: string
                          example: alfa-romeo
                      type: object
                type: object
        '401':
          $ref: '#/components/responses/Response401Unauthorized'
        '404':
          $ref: '#/components/responses/Response404NotFound'
        '422':
          $ref: '#/components/responses/Response422InputValidation'
        '500':
          $ref: '#/components/responses/Response500ServerError'
  /nomenclature/vehicle/model/{make}:
    get:
      tags:
        - Nomenclature
      summary: List of vehicle models filtered by vehicle make
      operationId: 364e489d029095e59db54d1265758de5
      parameters:
        - $ref: '#/components/parameters/HeaderToken'
        - name: make
          in: path
          description: Vehicle make name
          required: true
          schema:
            type: string
      responses:
        '200':
          description: List of vehicle models
          content:
            application/json:
              schema:
                properties:
                  data:
                    type: array
                    items:
                      properties:
                        name:
                          type: string
                          example: '750'
                      type: object
                type: object
        '401':
          $ref: '#/components/responses/Response401Unauthorized'
        '404':
          $ref: '#/components/responses/Response404NotFound'
        '422':
          $ref: '#/components/responses/Response422InputValidation'
        '500':
          $ref: '#/components/responses/Response500ServerError'
  /offer:
    post:
      tags:
        - Products
      summary: Get a quote
      description: >-
        A quote is obtained from the insurer for the product specified in the
        request.
      operationId: getOffer
      parameters:
        - $ref: '#/components/parameters/HeaderToken'
      requestBody:
        description: JSON format body
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ApiQuotationRequest'
      responses:
        '200':
          description: Offer response
          content:
            application/json:
              schema:
                properties:
                  data:
                    $ref: '#/components/schemas/QuotationResponseData'
                type: object
        '400':
          $ref: '#/components/responses/Response400BadRequest'
        '401':
          $ref: '#/components/responses/Response401Unauthorized'
        '403':
          $ref: '#/components/responses/Response403Forbidden'
        '404':
          $ref: '#/components/responses/Response404NotFound'
        '422':
          $ref: '#/components/responses/Response422InputValidation'
        '500':
          $ref: '#/components/responses/Response500ServerError'
  /offer/{id}:
    get:
      tags:
        - Products
      summary: Download offer
      description: Download offer in PDF format
      operationId: getOfferPdf
      parameters:
        - $ref: '#/components/parameters/HeaderToken'
        - name: id
          in: path
          description: Offer identification number
          required: true
          schema:
            type: integer
      responses:
        '200':
          description: Offer PDF file
          content:
            application/json:
              schema:
                properties:
                  data:
                    $ref: '#/components/schemas/FileResponseData'
                type: object
        '400':
          $ref: '#/components/responses/Response400BadRequest'
        '401':
          $ref: '#/components/responses/Response401Unauthorized'
        '403':
          $ref: '#/components/responses/Response403Forbidden'
        '404':
          $ref: '#/components/responses/Response404NotFound'
        '422':
          $ref: '#/components/responses/Response422InputValidation'
        '500':
          $ref: '#/components/responses/Response500ServerError'
  /policy:
    get:
      tags:
        - Products
      summary: Download policy
      description: Download policy in PDF format
      operationId: getPolicyPdf
      parameters:
        - $ref: '#/components/parameters/HeaderToken'
        - name: series
          in: query
          description: Policy identification series
          required: true
          schema:
            type: string
        - name: number
          in: query
          description: Policy identification number
          required: true
          schema:
            type: integer
      responses:
        '200':
          description: Policy PDF file
          content:
            application/json:
              schema:
                properties:
                  data:
                    $ref: '#/components/schemas/FileResponseData'
                type: object
        '400':
          $ref: '#/components/responses/Response400BadRequest'
        '401':
          $ref: '#/components/responses/Response401Unauthorized'
        '403':
          $ref: '#/components/responses/Response403Forbidden'
        '404':
          $ref: '#/components/responses/Response404NotFound'
        '422':
          $ref: '#/components/responses/Response422InputValidation'
        '500':
          $ref: '#/components/responses/Response500ServerError'
    post:
      tags:
        - Products
      summary: Transform the offer into a policy.
      description: The offer is transformed into a policy based on the offer identifier.
      operationId: getPolicy
      parameters:
        - $ref: '#/components/parameters/HeaderToken'
      requestBody:
        description: JSON formatted body
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PolicyRequestData'
      responses:
        '200':
          description: Response
          content:
            application/json:
              schema:
                properties:
                  data:
                    $ref: '#/components/schemas/PolicyResponseData'
                type: object
        '400':
          $ref: '#/components/responses/Response400BadRequest'
        '401':
          $ref: '#/components/responses/Response401Unauthorized'
        '403':
          $ref: '#/components/responses/Response403Forbidden'
        '404':
          $ref: '#/components/responses/Response404NotFound'
        '422':
          $ref: '#/components/responses/Response422InputValidation'
        '500':
          $ref: '#/components/responses/Response500ServerError'
  /vehicle/identification:
    post:
      tags:
        - Helper
      summary: Identify a vehicles identification code based on it's mechanical data.
      description: Identify a vehicles identification code based on it's mechanical data.
      operationId: identifyVehicle
      parameters:
        - $ref: '#/components/parameters/HeaderToken'
      requestBody:
        description: JSON format body
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/VehicleMechanicalData'
      responses:
        '200':
          description: Vehicle identifications response
          content:
            application/json:
              schema:
                properties:
                  data:
                    properties:
                      INSURER_NAME:
                        type: array
                        items:
                          $ref: '#/components/schemas/VehicleIdentifierData'
                    type: object
                type: object
        '400':
          $ref: '#/components/responses/Response400BadRequest'
        '401':
          $ref: '#/components/responses/Response401Unauthorized'
        '404':
          $ref: '#/components/responses/Response404NotFound'
        '422':
          $ref: '#/components/responses/Response422InputValidation'
        '500':
          $ref: '#/components/responses/Response500ServerError'
  /auth:
    post:
      tags:
        - Authentication
      summary: Authenticate
      description: Authenticate an account by account/password
      operationId: authPost
      parameters:
        - name: account
          in: query
          description: Account
          required: true
          schema:
            type: string
        - name: password
          in: query
          description: Password
          required: true
          schema:
            type: string
      responses:
        '200':
          $ref: '#/components/responses/ApiCoreLibAuthResponse200'
    delete:
      tags:
        - Authentication
      summary: Deautenticate
      description: Deautenticate an existing and valid auth token
      operationId: authDelete
      responses:
        '202':
          description: Deleted
    patch:
      tags:
        - Authentication
      summary: Renew token
      description: Renew an authentication token
      operationId: authPatch
      parameters:
        - name: Token
          in: header
          description: >-
            The Refresh token received from the `POST /auth` or `PATCH /auth`
            endpoint's response field name `refresh_token`.
          required: true
          schema:
            type: string
            example: Refresh [refresh_token]
          example: Refresh [refresh_token]
      responses:
        '200':
          $ref: '#/components/responses/ApiCoreLibAuthResponse200'
components:
  schemas:
    ApiPolicyRequest:
      type: object
    ApiQuotationRequest:
      $ref: '#/components/schemas/QuotationRequestData'
    AdditionalData:
      description: Additional data for the request
      properties:
        rafCode:
          description: 'RAF code. <br><strong>🔴 Available parameter for: generali</strong>'
          type: string
          example: RAF012345
        filterPackages:
          description: >-
            Display only one package matching the selected
            coverages.<br><strong>🔴 Available parameter for: allianz</strong>
            <br><strong>Default: false</strong>
          type: boolean
          example: 'false'
        motor:
          description: Motor-related data
          properties:
            contractType:
              $ref: '#/components/schemas/ContractTypeEnum'
            leasingContractNumber:
              description: >-
                Leasing contract number. <br><strong>🔴 Available parameter for:
                groupama</strong>
              type: string
              example: RX123456
          type: object
        vehicle:
          description: Vehicle related data
          properties:
            user:
              description: User-related data
              properties:
                bonusMalusClass:
                  $ref: '#/components/schemas/BonusMalusClassEnum'
                bonusMalusClaims:
                  description: >-
                    Bonus/malus claims. <br><strong>🔴 Available parameter for:
                    generali</strong>
                  type: integer
                  example: '2'
                noYoungDrivers:
                  description: >-
                    Indicates if there are no young drivers. <br><strong>🔴
                    Available parameter for: generali</strong>
                    <br><strong>Default: true</strong>
                  type: boolean
                  example: 'false'
              type: object
            isAtv:
              description: >-
                Indicates if the vehicle is an ATV. <br><strong>🔴 Available
                parameter for: generali</strong> <br><strong>Default:
                false</strong>
              type: boolean
              example: 'false'
            equipmentDescription:
              description: >-
                Additional equipment description, which will be covered.
                <br><strong>🔴 Available parameter for: generali,
                eazy_insure</strong>
              type: string
              example: External lighting, Tow bar
            equipmentValue:
              description: >-
                Additional equipment acquisition value. <br><strong>🔴 Available
                parameter for: eazy_insure</strong>
              type: number
              example: '7000'
            acquisitionDate:
              description: >-
                Date of acquisition of the vehicle. <br><strong>🔴 Available
                parameter for: generali</strong>
              type: string
              format: date
              example: '2023-01-01'
            isFirstOwner:
              description: >-
                Indicates if the vehicle is the first owner. <br><strong>🔴
                Available parameter for: generali</strong> <br><strong>Default:
                false</strong>
              type: boolean
              example: 'false'
            stolenVehicle:
              description: >-
                Indicates if the vehicle is stolen. <br><strong>🔴 Available
                parameter for: eazy_insure</strong>
              type: number
              example: 'false'
            hasConstructionChanges:
              description: >-
                Indicates if the vehicle has construction changes.
                <br><strong>🔴 Available parameter for: eazy_insure</strong>
              type: number
              example: 'false'
            wheelOnTheRightSide:
              description: >-
                Indicates if the vehicle has the wheel on the right side.
                <br><strong>🔴 Available parameter for: eazy_insure</strong>
              type: number
              example: 'false'
          type: object
        specialAccordCashOnHand:
          description: >-
            Indicates if there is a special accord for cash on hands.
            <br><strong>🔴 Available parameter for: generali,
            eazy_insure</strong> <br><strong>Default: false</strong>
          type: boolean
          example: 'false'
        partnerNetworkRepairAgreement:
          description: >-
            Indicates if there is a partner network repair agreement.
            <br><strong>🔴 Available parameter for: generali,
            eazy_insure</strong> <br><strong>Default: false</strong>
          type: boolean
          example: 'false'
        coversMinorChildren:
          description: >-
            Indicates if the policy covers minor children. <br><strong>🔴
            Available parameter for: generali, eazy_insure</strong>
            <br><strong>Default: false</strong>
          type: boolean
          example: 'false'
        personAccidentsPlan:
          description: >-
            The plan for the person accidents. <br><strong>🔴 Available
            parameter for: eazy_insure</strong>
          type: number
          enum:
            - SAFE
            - SAFE_PLUS
          example: SAFE
      type: object
    AddressData:
      description: Data object representing an address
      required:
        - county
        - city
        - cityCode
        - street
      properties:
        country:
          description: |-
            Country code (default: RO)
             * <br>Accepts any `iso2` code from nomenclature `/nomenclature/country`
          type: string
          example: RO
        county:
          description: |-
            County code
             * <br>Accepts any `code` from nomenclature `/nomenclature/county`
          type: string
          example: Cluj
        city:
          description: |-
            City name
             * <br>Accepts any `name` from nomenclature `/nomenclature/locality/{county}`
          type: string
          example: Cluj-Napoca
        cityCode:
          description: |-
            City code
             * <br>Accepts any `siruta` from nomenclature `/nomenclature/locality/{county}
          type: string
          example: 12345
        street:
          description: Street name
          type: string
          example: Eroilor
        houseNumber:
          description: House number
          type: string
          example: '10'
        building:
          description: Building name or number
          type: string
          example: A
        staircase:
          description: Staircase number
          type: string
          example: '1'
        apartment:
          description: Apartment number
          type: string
          example: '12'
        floor:
          description: Floor number
          type: string
          example: '3'
        postcode:
          description: Postal code
          type: string
          example: '400001'
      type: object
    CoverageBaseData:
      description: Data object representing coverage details
      properties:
        code:
          $ref: '#/components/schemas/CoverageCodeEnum'
        insuredSum:
          description: The insured sum for the coverage
          type: number
          format: float
          example: 10000.5
      type: object
    CoverageData:
      description: Data object representing coverage details
      type: object
      allOf:
        - properties:
            isIncluded:
              description: Indicates if the coverage is included
              type: boolean
              example: true
          type: object
        - $ref: '#/components/schemas/CoverageBaseData'
    CoverageResponseData:
      description: Data object representing coverage details
      properties:
        code:
          $ref: '#/components/schemas/CoverageCodeEnum'
        notes:
          description: Additional notes or comments related to the coverage
          type: string
          example: Coverage insured sum is covered in the main insurance sum.
      type: object
    DeductibleData:
      description: Data object representing deductible details
      properties:
        partialDamage:
          description: 'Deductible amount for partial damage. <strong>Default: 0</strong>'
          type: integer
          example: 500
        totalDamage:
          description: 'Deductible percent for total damage. <strong>Default: 0</strong>'
          type: integer
          example: 20
      type: object
    FileData:
      title: File Data
      description: Represents a file with its type, name, and content.
      properties:
        type:
          $ref: '#/components/schemas/DocumentTypeEnum'
        mimeType:
          description: The type of the file.
          type: string
          example: application/pdf
        name:
          description: The name of the file.
          type: string
          example: document.pdf
        content:
          description: The base64-encoded content of the file.
          type: string
          example: JVBERi0xLjQKJcfs...
      type: object
    FileResponseData:
      title: File Response Data
      description: Represents a response containing an array of files.
      properties:
        files:
          description: An array of file data.
          type: array
          items:
            $ref: '#/components/schemas/FileData'
      type: object
    DriverData:
      description: Data object representing a driver
      required:
        - firstName
        - lastName
        - taxId
        - identification
      properties:
        firstName:
          description: Driver's first name
          type: string
          example: John
        lastName:
          description: Driver's last name
          type: string
          example: Doe
        taxId:
          description: Driver's tax identification number
          type: string
          example: '123456789'
        identification:
          description: Identification details
          required:
            - idNumber
          properties:
            idNumber:
              description: Driver's identification number
              type: string
              example: CJ123456
          type: object
        mobileNumber:
          description: Driver's mobile phone number
          type: string
          example: '0745666111'
      type: object
    ExchangeRateData:
      title: Exchange Rate Data
      description: Represents exchange rate information for a specific currency
      properties:
        currency:
          $ref: '#/components/schemas/CurrencyEnum'
        amount:
          description: The amount in the specified currency
          type: number
          format: float
          example: 100.5
        exchangeRate:
          description: The exchange rate for the specified currency
          type: number
          format: float
          example: 1.12
      type: object
    InstallmentData:
      title: Installment Data
      description: Represents an installment with its details
      properties:
        id:
          title: ID
          description: The unique identifier of the installment
          format: number
          example: 1
        amount:
          title: Amount
          description: The amount of the installment
          format: float
          example: 123.45
        dueDate:
          title: Due Date
          description: The due date of the installment
          format: date
          example: '2025-12-12'
      type: object
    MotorProductData:
      description: Data object representing motor product details
      required:
        - startDate
      properties:
        startDate:
          description: Start date of the motor product
          type: string
          format: date
          example: '2023-01-01'
        termTime:
          description: Term time in months
          type: integer
          example: 12
        installmentCount:
          description: Number of installments
          type: integer
          example: 1
        currency:
          $ref: '#/components/schemas/CurrencyEnum'
        renewPolicy:
          $ref: '#/components/schemas/RenewPolicyData'
        mentions:
          description: Any additional mentions or notes
          type: string
          example: Additional mentions or notes
        withoutTax:
          description: >-
            Indicates if the motor product is without tax. <strong>Default:
            false</strong>
          type: boolean
          example: 'false'
        deductibles:
          $ref: '#/components/schemas/DeductibleData'
      type: object
    PaymentData:
      description: Data object representing a payment
      required:
        - method
        - currency
        - amount
        - date
        - documentNumber
      properties:
        method:
          $ref: '#/components/schemas/PaymentMethodEnum'
        currency:
          $ref: '#/components/schemas/CurrencyEnum'
        amount:
          description: Amount of the payment
          type: number
          format: float
          example: 100.5
        date:
          description: Date of the payment
          type: string
          format: date
          example: '2023-10-01'
        documentNumber:
          description: Document number associated with the payment
          type: string
          example: INV-12345
      type: object
    PersonData:
      description: Data object representing a person
      required:
        - isLegalEntity
        - taxId
        - address
      properties:
        isLegalEntity:
          description: Indicates if the person is a legal entity
          type: boolean
          example: 'false'
        businessName:
          description: Business name of the legal entity (if the person is a legal entity)
          type: string
          example: TechCorp
        companyRegistryNumber:
          description: Company registry number (if the person is a legal entity)
          type: string
          example: '12345678'
        caenCode:
          description: CAEN code of the business (if the person is a legal entity)
          type: integer
          example: 6201
        lastName:
          description: >-
            Last name of the person<br> Required if `businessName` is not
            present
          type: string
          example: Doe
        firstName:
          description: >-
            First name of the person<br> Required if `businessName` is not
            present
          type: string
          example: John
        isForeignPerson:
          description: Indicates if the person is a foreigner
          type: boolean
          example: false
        taxId:
          description: Tax identification number (CNP/CUI)
          type: string
          example: RO123456789
        nationality:
          description: |-
            Nationality of the person
             * <br>Required if `isForeignPerson` is `true`
             *     <br>Accepts any `iso2` code from nomenclature `/nomenclature/country`
          type: string
          example: RO
        citizenship:
          description: |-
            Citizenship of the person
             *  <br>Required if `isForeignPerson` is `true`
             *      <br>Accepts any `iso2` code from nomenclature `/nomenclature/country`
          type: string
          example: RO
        gender:
          $ref: '#/components/schemas/GenderEnum'
        birthdate:
          description: |-
            Birthdate of the person
             *   <br>Required if `isForeignPerson` is `true`
          type: string
          format: date
          example: '1990-01-01'
        email:
          description: Email address of the person
          type: string
          example: john.doe@example.com
        mobileNumber:
          description: Mobile phone number of the person
          type: string
          example: '0712345678'
        drivingLicense:
          description: Driving license details
          required:
            - issueDate
          properties:
            issueDate:
              description: Issue date of the driving license
              type: string
              format: date
              example: '2010-05-15'
          type: object
        identification:
          $ref: '#/components/schemas/PersonIdentificationData'
        address:
          $ref: '#/components/schemas/AddressData'
        hasDisability:
          description: Indicates if the person has a disability
          type: boolean
          example: false
        isRetired:
          description: Indicates if the person is retired
          type: boolean
          example: false
        residency:
          $ref: '#/components/schemas/ResidencyEnum'
        politicalExposure:
          $ref: '#/components/schemas/PoliticalExposureEnum'
      type: object
    PersonIdentificationData:
      description: Data object representing a person's identification details
      required:
        - type
        - idNumber
      properties:
        idType:
          $ref: '#/components/schemas/IdentificationTypeEnum'
        idNumber:
          description: Identification number
          type: string
          example: AB123456
        issueAuthority:
          description: Authority that issued the identification
          type: string
          example: Police Department
        issueDate:
          description: Date the identification was issued
          type: string
          format: date
          example: '2023-01-01'
      type: object
    PremiumPaymentData:
      description: Data object representing the premium payment
      properties:
        currency:
          $ref: '#/components/schemas/CurrencyEnum'
        amount:
          description: Amount of the payment
          type: number
          format: float
          example: 100.5
      type: object
    ProductData:
      description: Data object representing a product
      required:
        - motor
        - coverages
        - policyholder
        - vehicle
      properties:
        name:
          $ref: '#/components/schemas/ProductEnum'
        motor:
          $ref: '#/components/schemas/MotorProductData'
        coverages:
          description: List of coverages associated with the product
          type: array
          items:
            $ref: '#/components/schemas/CoverageData'
        policyholder:
          $ref: '#/components/schemas/PersonData'
        vehicle:
          $ref: '#/components/schemas/VehicleData'
        additionalData:
          $ref: '#/components/schemas/AdditionalData'
      type: object
    ProviderData:
      description: Data object representing a provider
      required:
        - organization
        - account
      properties:
        organization:
          description: Organization details
          required:
            - businessName
          properties:
            businessName:
              $ref: '#/components/schemas/ProviderCompanyEnum'
          type: object
        authentication:
          description: Authentication account details
          required:
            - account
            - password
            - code
          properties:
            account:
              description: Authentication account name
              type: string
              example: user123
            password:
              description: Authentication password
              type: string
              example: securePassword123
            code:
              description: Authentication code
              type: string
              example: AUTH456
          type: object
      type: object
    QuotationOfferData:
      title: Quotation Offer Data
      description: Represents a quotation offer with its details
      properties:
        offerId:
          description: Internal ID of the quotation offer
          type: integer
          format: number
          example: 123
        providerOfferCode:
          description: Provider's offer code
          type: string
          example: ABC123
        premiumAmount:
          description: Premium amount
          type: number
          format: float
          example: 1000.5
        currency:
          $ref: '#/components/schemas/CurrencyEnum'
        exchangeRate:
          $ref: '#/components/schemas/ExchangeRateData'
        payment:
          $ref: '#/components/schemas/PremiumPaymentData'
        startDate:
          description: Start date of the offer validity
          type: string
          format: date
          example: '2025-01-01'
        endDate:
          description: End date of the offer validity
          type: string
          format: date
          example: '2025-12-31'
        installments:
          description: List of installments
          type: array
          items:
            $ref: '#/components/schemas/InstallmentData'
        coverages:
          description: List of coverages
          type: array
          items:
            $ref: '#/components/schemas/CoverageResponseData'
        offerExpiryDate:
          description: Offer expiry date
          type: string
          format: date
          example: '2025-12-31'
        notes:
          description: Additional notes for the offer
          type: string
          example: Special conditions apply
        pid:
          description: Url for Product Identification Document
          type: string
          example: https://link.to/pid
        toc:
          description: Url for Terms and conditions
          type: string
          example: https://link.to/toc
      type: object
    QuotationRequestData:
      description: Data object representing a quotation request
      required:
        - provider
        - product
      properties:
        provider:
          $ref: '#/components/schemas/ProviderData'
        product:
          $ref: '#/components/schemas/ProductData'
      type: object
    QuotationResponseData:
      title: Quotation Response Data
      description: Represents the response data for a quotation
      properties:
        provider:
          properties:
            organization:
              properties:
                businessName:
                  $ref: '#/components/schemas/ProviderCompanyEnum'
              type: object
          type: object
        product:
          properties:
            name:
              $ref: '#/components/schemas/ProductEnum'
          type: object
        offers:
          type: array
          items:
            $ref: '#/components/schemas/QuotationOfferData'
      type: object
    RenewPolicyData:
      description: Data object representing policy renewal details
      required:
        - series
        - number
      properties:
        series:
          description: Policy series
          type: string
          example: AB
        number:
          description: Policy number
          type: integer
          example: 123456
      type: object
    PolicyDetailsData:
      title: Policy Details Data
      description: Represents the details of a policy
      properties:
        provider:
          properties:
            organization:
              properties:
                businessName:
                  $ref: '#/components/schemas/ProviderCompanyEnum'
              type: object
          type: object
        product:
          properties:
            name:
              $ref: '#/components/schemas/ProductEnum'
          type: object
        policyId:
          description: Internal ID of the issued policy
          type: integer
          format: number
          example: 123
        providerPolicyCode:
          description: The provider's policy code
          type: string
          example: POLICY123
        series:
          description: The series of the policy
          type: string
          example: A
        number:
          description: The number of the policy
          type: string
          example: '123456'
        payment:
          $ref: '#/components/schemas/PaymentData'
        startDate:
          description: The start date of the policy
          type: string
          format: date
          example: '2025-01-01'
        endDate:
          description: The end date of the policy
          type: string
          format: date
          example: '2025-12-31'
        premiumAmount:
          description: The premium amount of the policy
          type: number
          format: float
          example: 1000.5
        currency:
          $ref: '#/components/schemas/CurrencyEnum'
        installments:
          description: List of installments
          type: array
          items:
            $ref: '#/components/schemas/InstallmentData'
        coverages:
          description: List of coverages
          type: array
          items:
            $ref: '#/components/schemas/CoverageResponseData'
        notes:
          description: Additional notes about the policy
          type: string
          example: Policy notes
      type: object
    PolicyRequestData:
      title: Policy Request Data
      description: Represents the data required to create a policy request
      required:
        - offerId
        - payment
      properties:
        offerId:
          description: The unique identifier of the offer
          type: number
          example: 12345
        payment:
          $ref: '#/components/schemas/PaymentData'
      type: object
    PolicyResponseData:
      title: Policy Response Data
      description: Represents the response data for a policy
      properties:
        policies:
          type: array
          items:
            $ref: '#/components/schemas/PolicyDetailsData'
      type: object
    VehicleData:
      description: Data object representing a vehicle information
      required:
        - vin
        - registrationType
        - usageType
        - color
        - totalWeight
      type: object
      allOf:
        - $ref: '#/components/schemas/VehicleMechanicalData'
        - properties:
            user:
              $ref: '#/components/schemas/PersonData'
            identifier:
              description: >-
                Identifier of the vehicle unique for the specific brand and
                model
              type: string
              example: F9bcVXsC3Zu7PDagZcLfCw==
            licensePlate:
              description: License plate of the vehicle
              type: string
              example: B123XYZ
            registrationType:
              $ref: '#/components/schemas/RegistrationTypeEnum'
            firstRegistration:
              description: Date of the vehicle's first registration
              type: string
              format: date
              example: '2015-06-01'
            usageType:
              $ref: '#/components/schemas/UsageTypeEnum'
            identification:
              description: Identification details of the vehicle
              properties:
                idNumber:
                  description: Identification number
                  type: string
                  example: AB123456
              type: object
            keyNumber:
              description: Number of keys of the vehicle
              type: integer
              example: 3
            ptiExpiryDate:
              description: Vehicle's periodic technical inspection (ITP) expiration date
              type: string
              format: date
              example: '2025-05-12'
            vignetteExpiryDate:
              description: Vehicle's vignette (rovinieta) expiration date
              type: string
              format: date
              example: '2025-06-11'
            hasMobilityModifications:
              description: |-
                Indicates if the vehicle has mobility modifications
                 * (the vehicle has been modified for use by people with locomotor disabilities). <strong>Default: false</strong>
              type: boolean
              example: false
            isLeased:
              description: >-
                Indicates if the vehicle is leased. <strong>Default:
                false</strong>
              type: boolean
              example: false
            isNew:
              description: 'Indicates if the vehicle is new. <strong>Default: false</strong>'
              type: boolean
              example: false
            isOwnerTransfer:
              description: >-
                Indicates if the vehicle is a transfer of ownership.
                <strong>Default: false</strong>
                 * Value is taken into account if the `product.vehicle.registrationType` is `temporaryRegistered` or `temporaryRecorded`, otherwise it is set `false` by default.
              type: boolean
              example: false
          type: object
    VehicleIdentifierData:
      properties:
        identifier:
          description: Unique vehicle identifier
          type: string
          example: F9bcVXsC3Zu7PDagZcLfCw==
        modelName:
          description: Vehicle model name
          type: string
          example: Civic 1.5 VTEC Turbo CVT Prestige
        productionStartDate:
          description: Production start date in YYYY-MM format
          type: string
          example: 2017-03
        productionEndDate:
          description: Production end date in YYYY-MM format
          type: string
          example: 2021-01
        marketValue:
          description: Market value of the vehicle
          type: number
          format: number
          example: 26500
        additionalData:
          description: |-
            Additional vehicle data (capacity, power, etc.).
             * <b>Content varries based on insurer</b>
          type: object
          nullable: true
      type: object
    VehicleMechanicalData:
      description: Data object representing a vehicle mechanical information
      required:
        - vehicleType
        - brand
        - model
        - yearOfConstruction
      properties:
        vin:
          description: Vehicle Identification Number (VIN)
          type: string
          example: 1HGCM82633A123456
        motorSeries:
          description: Vehicle motor series (if applicable)
          type: string
          example: e2007
        vehicleType:
          $ref: '#/components/schemas/VehicleTypeEnum'
        brand:
          description: Brand of the vehicle
          type: string
          example: Toyota
        model:
          description: Model of the vehicle
          type: string
          example: Corolla
        yearOfConstruction:
          description: |-
            Year the vehicle was constructed
             * <br> Max. [current year] + 1
          type: integer
          example: 2020
        engineDisplacement:
          description: |-
            Engine displacement in cubic centimeters
             * <br> Not required for electric vehicles or trailers
          type: integer
          example: 1800
        enginePower:
          description: |-
            Engine power (kW)
             * <br> Not required for trailers
          type: integer
          example: 140
        totalWeight:
          description: Total weight of the vehicle in kilograms
          type: integer
          example: 1500
        seats:
          description: |-
            Number of seats in the vehicle
             * <br> Not required for trailers
          type: integer
          example: 5
        fuelType:
          $ref: '#/components/schemas/FuelTypeEnum'
        currentMileage:
          description: Current mileage of the vehicle in kilometers
          type: integer
          example: 120000
        color:
          $ref: '#/components/schemas/ColorEnum'
        marketValue:
          description: Market value of the vehicle
          type: number
          format: float
          example: '100000.00'
      type: object
    Offer: {}
    Policy: {}
    ContractTypeEnum:
      description: >-
        The type of contract. <br><strong>🔴 Required parameter for: generali,
        groupama</strong>
      type: string
      enum:
        - financial
        - operational
        - credit
      example: financial
    CurrencyEnum:
      description: Enum representing currency types
      type: string
      enum:
        - RON
        - EUR
      example: RON
    DocumentTypeEnum:
      description: Enum representing document types
      type: string
      enum:
        - offer
        - additional-document
        - policy
        - terms-and-conditions
        - annexes
      example: offer
    PaymentMethodEnum:
      description: Enum representing payment methods
      type: string
      enum:
        - pos
        - receipt
        - broker receipt
        - payment order
        - broker payment order
      example: pos
    CoverageCodeEnum:
      description: Enum representing coverage codes
      type: string
      enum:
        - vehicleDamage
        - vehicleEquipment
        - moto
        - motoSeasons
        - motoEquipment
        - engineWaterAspiration
        - wheelsTires
        - roadAssistance
        - roadAssistancePremium
        - personAccidents
        - offroad
        - exchangeCar
        - windowElements
        - cargo
        - international
        - workingMachine
        - gpsSystem
        - otherDriver
        - theft
        - vandalism
        - naturalHazards
        - naturalDisasters
        - collision
        - deathClause
        - permanentDisabilityClause
        - surgicalInterventionClause
        - totalLoss
        - impactWithPersonsOrObjects
        - fallingObjects
        - fireExplosion
        - liabilityRegress
      example: vehicle
    GenderEnum:
      description: Enum representing genders
      type: string
      enum:
        - m
        - f
      example: m
    IdentificationTypeEnum:
      description: Enum representing identification types
      type: string
      enum:
        - CI
        - PASSPORT
      example: CI
    PoliticalExposureEnum:
      description: Enum representing political exposure statuses
      type: string
      enum:
        - 'no'
        - 'yes'
        - person with a public management function
      example: 'no'
    ResidencyEnum:
      description: Enum representing residency statuses
      type: string
      enum:
        - resident in Romania
        - resident outside Romania but within the EC
        - resident outside the EC
      example: resident in Romania
    ProductEnum:
      description: Enum representing product types
      type: string
      enum:
        - casco
      example: casco
    ProviderCompanyEnum:
      description: Enum representing provider companies
      type: string
      enum:
        - generali
        - groupama
        - eazy_insure
        - grawe
        - allianz
      example: groupama
    BonusMalusClassEnum:
      description: >-
        Bonus/malus class. <br><strong>🔴 Available parameter for:
        generali</strong> <br><strong>Default: B0</strong>
      type: string
      enum:
        - B0
        - B1
        - B2
        - B3
        - B4
        - B5
        - B6
        - B7
        - B8
        - M1
        - M2
        - M3
        - M4
        - M5
        - M6
        - M7
        - M8
      example: B0
    ColorEnum:
      description: Enum representing colors for vehicles
      type: string
      enum:
        - white
        - blue
        - yellow
        - gray
        - brown
        - black
        - orange
        - red
        - green
        - purple
      example: white
    FuelTypeEnum:
      description: Enum representing fuel types for vehicles
      type: string
      enum:
        - petrol
        - diesel
        - electric
        - hybrid
        - lpg
        - none
      example: petrol
    RegistrationTypeEnum:
      description: Enum representing registration types for vehicles
      type: string
      enum:
        - registered
        - recorded
        - temporaryRegistered
        - temporaryRecorded
      example: registered
    UsageTypeEnum:
      description: Enum representing usage types for vehicles
      type: string
      enum:
        - personal
        - passengerTransportation
        - taxi
        - carRental
        - drivingSchool
        - security
        - courier
        - cargoTransportation
        - distribution
      example: personal
    VehicleTypeEnum:
      description: Enum representing vehicle types
      type: string
      enum:
        - M1
        - M1G
        - M2
        - M2G
        - M3
        - M3G
        - N1
        - N1G
        - N2
        - N2G
        - N3
        - N3G
        - O1
        - O2
        - O3
        - O4
        - L1e
        - L2e
        - L3e
        - L4e
        - L5e
        - L6e
        - L7e
        - T
        - C
        - R
        - S
      example: M1
    PersonAccidentsPlanEnum:
      description: Enum representing person accidents plan
      type: string
      enum:
        - SAFE
        - SAFE_PLUS
      example: SAFE
  responses:
    Response204NoContent:
      description: No content
    Response400BadRequest:
      description: Bad request
      content:
        application/json:
          schema:
            properties:
              correlation_id:
                type: string
                example: 0091aade-62a9-4474-a443-dc7c96d83c1d
              message:
                type: string
                example: Not Found
            type: object
    Response401Unauthorized:
      description: NO_TOKEN
      content:
        application/json:
          schema:
            properties:
              correlation_id:
                type: string
                example: 0091aade-62a9-4474-a443-dc7c96d83c1d
              message:
                type: string
                example: No token
              code:
                type: string
                example: NO_TOKEN
            type: object
    Response404NotFound:
      description: Not Found
      content:
        application/json:
          schema:
            properties:
              correlation_id:
                type: string
                example: 0091aade-62a9-4474-a443-dc7c96d83c1d
              message:
                type: string
                example: Not Found
            type: object
    Response409Conflict:
      description: Conflict
      content:
        application/json:
          schema:
            properties:
              correlation_id:
                type: string
                example: 0091aade-62a9-4474-a443-dc7c96d83c1d
              message:
                type: string
                example: Conflict
            type: object
    Response410Expired:
      description: Expired request
      content:
        application/json:
          schema:
            properties:
              correlation_id:
                type: string
                example: 0091aade-62a9-4474-a443-dc7c96d83c1d
              message:
                type: string
                example: Expired request
            type: object
    Response422InputValidation:
      description: Validation errors
      content:
        application/json:
          schema:
            properties:
              correlation_id:
                type: string
                example: 0091aade-62a9-4474-a443-dc7c96d83c1d
              errors:
                properties:
                  fieldName:
                    type: array
                    items:
                      type: string
                    example:
                      - Validation error
                type: object
            type: object
    Response500ServerError:
      description: Application / server errors
      content:
        application/json:
          schema:
            properties:
              correlation_id:
                type: string
                example: 0091aade-62a9-4474-a443-dc7c96d83c1d
              message:
                type: string
                example: Undefined array key 'xy'
            type: object
    ApiCoreLibAuthResponse200:
      description: Auth result
      content:
        application/json:
          schema:
            properties:
              error:
                type: boolean
                example: 'false'
              status:
                type: number
                example: '200'
              data:
                properties:
                  token:
                    description: >-
                      The JSON Web Token (JWT) to be used as the `Token` header
                      value in all subsequent API requests.
                    example: '---JWT Token---'
                  expires_at:
                    description: >-
                      The expiration date and time of the JWT token, in ISO 8601
                      format.
                    example: '2021-09-03 19:41:27'
                  refresh_token:
                    description: A token used to refresh the JWT token when it expires.
                    type: string
                    example: '---Refresh Token---'
                type: object
            type: object
    Response403Forbidden:
      description: |-
        One of the following values will be returned in the `code` property:
         *  `INVALID_TOKEN`: The provided token is invalid
         *  `TOKEN_DEACTIVATED`: The token has been deactivated
         *  `TOKEN_EXPIRED`: The token has expired
         *  `NO_PERMISSION`: The account does not have permission
      content:
        application/json:
          schema:
            properties:
              correlation_id:
                type: string
                example: 0091aade-62a9-4474-a443-dc7c96d83c1d
              message:
                type: string
                example: Token expired
              code:
                type: string
                example: TOKEN_EXPIRED
            type: object
  parameters:
    HeaderToken:
      name: Token
      in: header
      description: >-
        The JWT token received from the `POST /auth` endpoint's response field
        name `token`. This should be included in the header as `Token: <JWT
        Token>`.
      required: true
      schema:
        type: string
        format: jwt
tags:
  - name: Authentication
    description: ''
  - name: Products
    description: ''
  - name: Nomenclature
    description: Nomenclature
  - name: Helper
    description: Helper
