openapi: 3.0.0
info:
  description: ESERVICES HOME INSURANCE API documentation
  version: 4.3.5.0
  title: 'API PROD'
  contact:
    name: Digital courtage cardif
  license:
    name: rpc.it@cardif.fr
servers:
  - url: https://cservices.dco.cardif.api.bnpparibas/homeinsurance
security:
  - oauth: []
tags:
  - name: Homeinsurance
    description: Home insurance
paths:
  /v1/fr/renters/pricing:
    post:
      operationId: RentersController_getPriceOffers
      summary: ''
      description: Creates a price estimation for given parameters
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ApiPricingRequest'
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiPricingResponse'
      tags:
        - Homeinsurance
  /v1/fr/home/pricing:
    post:
      operationId: HomeController_getPriceOffers
      summary: ''
      description: Creates a price estimation for given parameters
      parameters: [ ]
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ApiPricingRequest'
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiPricingResponse'
      tags:
        - Homeinsurance
  /v1/fr/renters/pricing/quote:
    post:
      operationId: RentersController_createQuoteFromPriceOffer
      summary: ''
      description: Returns a url for a requested quote by previous price offer
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ApiPriceOfferQuoteCreateRequest'
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiPriceOfferQuoteCreateSuccessResponse'
      tags:
        - Homeinsurance
  /v1/fr/home/pricing/finalize:
    post:
      operationId: HomeController_createQuoteFromPriceOffer
      summary: ''
      description: Returns a url for a requested quote by previous price offer
      parameters: [ ]
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ApiPriceOfferQuoteCreateRequest'
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiPriceOfferQuoteCreateSuccessResponse'
      tags:
        - Homeinsurance
components:
  securitySchemes:
    oauth:
      type: oauth2
      flows:
        clientCredentials:
          tokenUrl: https://cservices.dco.cardif.api.bnpparibas/authentication/v1/accesstoken?grant_type=client_credentials
          scopes: {}
  schemas:
    ApiUserInfoDto:
      type: object
      properties:
        dateOfBirth:
          type: string
          example: '1981-11-29'
        pastReportedClaimsCount:
          type: number
          example: 1
        livesWithRoommates:
          type: boolean
          example: false
        livesWithRelatives:
          type: boolean
          example: false
          default: false
        livesWithPartner:
          type: boolean
          example: false
        livesWithKids:
          type: boolean
          example: true
      required:
        - dateOfBirth
        - pastReportedClaimsCount
        - livesWithRoommates
        - livesWithRelatives
        - livesWithPartner
        - livesWithKids
    ResidenceDwellingType:
      type: string
      enum:
        - apartment
        - house
    ResidenceFloorLevel:
      type: string
      enum:
        - bottom
        - middle
        - top
    ApiAddressInfoDto:
      type: object
      properties:
        streetNumber:
          type: string
          example: '3'
        apartment:
          type: string
          example: 7a
        streetName:
          type: string
          example: Avenue Montaigne
        city:
          type: string
          example: Paris
        state:
          type: string
          example: IDF
        postalCode:
          type: string
          example: '12345'
      required:
        - streetNumber
        - apartment
        - streetName
        - city
        - state
        - postalCode
    ApiResidenceInfoDto:
      type: object
      properties:
        areaInSquareMeters:
          type: number
          example: 50
        currentlyInsured:
          type: boolean
          example: false
          default: false
        burglarAlarmInstalled:
          type: boolean
          example: true
        securityCameraInstalled:
          type: boolean
          example: true
          default: false
        dwellingType:
          example: apartment
          $ref: '#/components/schemas/ResidenceDwellingType'
        floorLevel:
          example: middle
          $ref: '#/components/schemas/ResidenceFloorLevel'
        addressInfo:
          $ref: '#/components/schemas/ApiAddressInfoDto'
      required:
        - areaInSquareMeters
        - currentlyInsured
        - burglarAlarmInstalled
        - securityCameraInstalled
        - dwellingType
        - floorLevel
        - addressInfo
    ApiCoverageInfoDto:
      type: object
      properties:
        startDate:
          type: string
          example: '1981-11-29'
        personalPropertySum:
          type: number
          example: 10000
      required:
        - startDate
        - personalPropertySum
    ApiAdditionalInfoDto:
      type: object
      properties:
        residenceCurrentlyInsured:
          type: boolean
          example: true
          default: false
        userProfession:
          type: string
          example: student
      required:
        - residenceCurrentlyInsured
    ApiPricingRequest:
      type: object
      properties:
        userInfo:
          $ref: '#/components/schemas/ApiUserInfoDto'
        residenceInfo:
          $ref: '#/components/schemas/ApiResidenceInfoDto'
        coverageInfo:
          $ref: '#/components/schemas/ApiCoverageInfoDto'
        additionalInfo:
          $ref: '#/components/schemas/ApiAdditionalInfoDto'
      required:
        - userInfo
        - residenceInfo
        - coverageInfo
        - additionalInfo
    Currency:
      type: string
      enum:
        - EUR
        - USD
    PricingComponentsDto:
      type: object
      properties:
        theftIncluded:
          type: boolean
          example: true
        glassIncluded:
          type: boolean
          example: false
        personalPropertySum:
          type: number
          example: 10000
        personalLiabilitySum:
          type: number
          example: 10000
        baseDeductibleSum:
          type: number
          example: 10000
        lossOfUseSum:
          type: number
          example: 10000
      required:
        - theftIncluded
        - glassIncluded
        - personalPropertySum
        - personalLiabilitySum
        - baseDeductibleSum
        - lossOfUseSum
    ApiPriceOfferResponse:
      type: object
      properties:
        id:
          type: string
          example: LHEPO123456
        packageCode:
          type: string
          example: Standard
        annualPremium:
          type: number
          example: 120
        currency:
          example: EUR
          $ref: '#/components/schemas/Currency'
        pricingComponents:
          $ref: '#/components/schemas/PricingComponentsDto'
      required:
        - id
        - packageCode
        - annualPremium
        - currency
        - pricingComponents
    ApiPriceOfferQuoteData:
      type: object
      properties:
        priceOffers:
          type: array
          items:
            $ref: '#/components/schemas/ApiPriceOfferResponse'
      required:
        - priceOffers
    ApiPricingResponse:
      type: object
      properties:
        status:
          type: string
        data:
          $ref: '#/components/schemas/ApiPriceOfferQuoteData'
      required:
        - status
        - data
    Gender:
      type: string
      enum:
        - male
        - female
    UserInfoDto:
      type: object
      properties:
        email:
          type: string
          example: first.last@test.com
        firstName:
          type: string
          example: John
        lastName:
          type: string
          example: Doe
        phoneNumber:
          type: string
          example: '+33507527777'
        gender:
          example: female
          $ref: '#/components/schemas/Gender'
      required:
        - email
        - firstName
        - lastName
        - phoneNumber
        - gender
    ApiPriceOfferQuoteCreateRequest:
      type: object
      properties:
        priceOfferId:
          type: string
          example: LHEPO123456
        userInfo:
          $ref: '#/components/schemas/UserInfoDto'
      required:
        - priceOfferId
        - userInfo
    ApiPriceOfferQuoteCreateSuccessResponse:
      type: object
      properties:
        status:
          type: string
        data:
          $ref: '#/components/schemas/ApiPriceOfferQuoteData'
      required:
        - status
        - data
    FrApiPriceOfferUpdateRequest:
      type: object
      properties:
        priceOfferId:
          type: string
          example: LPO123456
        userInfo:
          $ref: '#/components/schemas/FrUser'
      required:
        - priceOfferId
        - userInfo
    ApiPriceOfferQuoteResponse:
      type: object
      properties:
        quoteUrl:
          type: string
          example: https://lemonade.com/LQ12345
      required:
        - quoteUrl
    FrUser:
      type: object
      properties:
        email:
          type: string
          example: first.last@test.com
        firstName:
          type: string
          example: John
        lastName:
          type: string
          example: Doe
        phoneNumber:
          type: string
          example: '+33507527777'
        gender:
          example: female
          $ref: '#/components/schemas/Gender'
        countryOfBirth:
          type: string
          example: France
        cityOfBirth:
          type: string
          example: Paris
        termsOfServiceApproved:
          type: boolean
          example: false
        marketingTermsApproved:
          type: boolean
          example: false
      required:
        - email
        - firstName
        - lastName
        - phoneNumber
        - gender
