openapi: 3.0.4
info:
  title: Producer Search
  version: v1
paths:
  /producersearch/v1/agents/search:
    post:
      tags:
        - ProducerSearch
      requestBody:
        content:
          application/xml:
            schema:
              $ref: '#/components/schemas/AgentProfileSearchRequestDto'
          application/json:
            schema:
              $ref: '#/components/schemas/AgentProfileSearchRequestDto'
      responses:
        '200':
          description: OK
          content:
            application/xml:
              schema:
                $ref: '#/components/schemas/AgentProfileSearchResponseDto'
            application/json:
              schema:
                $ref: '#/components/schemas/AgentProfileSearchResponseDto'
        '400':
          description: Bad Request
        '401':
          description: Unauthorized
        '403':
          description: Forbidden
        '500':
          description: Internal Server Error
  /producersearch/v1/agencies/search:
    post:
      tags:
        - ProducerSearch
      requestBody:
        content:
          application/xml:
            schema:
              $ref: '#/components/schemas/AgencyProfileSearchRequestDto'
          application/json:
            schema:
              $ref: '#/components/schemas/AgencyProfileSearchRequestDto'
      responses:
        '200':
          description: OK
          content:
            application/xml:
              schema:
                $ref: '#/components/schemas/AgencyProfileSearchResponseDto'
            application/json:
              schema:
                $ref: '#/components/schemas/AgencyProfileSearchResponseDto'
        '400':
          description: Bad Request
        '401':
          description: Unauthorized
        '403':
          description: Forbidden
        '500':
          description: Internal Server Error
components:
  schemas:
    Address:
      type: object
      properties:
        AddressLine1:
          type: string
          nullable: true
        AddressLine2:
          type: string
          nullable: true
        AddressType:
          type: string
          nullable: true
        City:
          type: string
          nullable: true
        Country:
          type: string
          nullable: true
        State:
          type: string
          nullable: true
        Zip:
          type: string
          nullable: true
      additionalProperties: false
    AgencyProfileSearchRequestDto:
      required:
        - AllProfiles
      type: object
      properties:
        AgencyName:
          maxLength: 80
          type: string
          nullable: true
        AllProfiles:
          minLength: 1
          type: string
        IdentifierType:
          type: string
          nullable: true
        IdentifierValue:
          type: string
          nullable: true
        RequesterIdentifierType:
          type: string
          nullable: true
        RequesterIdentifierValue:
          type: string
          nullable: true
      additionalProperties: false
    AgencyProfileSearchResponseDto:
      type: object
      properties:
        AccountId:
          type: integer
          format: int64
        AgencyProfiles:
          type: array
          items:
            $ref: '#/components/schemas/AgencyProfileSearchResult'
          nullable: true
        IdentifierType:
          type: string
          nullable: true
        IdentifierValue:
          type: string
          nullable: true
      additionalProperties: false
    AgencyProfileSearchResult:
      type: object
      properties:
        Address:
          $ref: '#/components/schemas/Address'
        AgencyName:
          type: string
          nullable: true
        Crd:
          type: string
          nullable: true
        Fein:
          type: string
          nullable: true
        Npn:
          type: string
          nullable: true
        ProfileKey:
          type: string
          nullable: true
        ProfileStatus:
          type: string
          nullable: true
      additionalProperties: false
    AgentProfileSearchRequestDto:
      required:
        - AllProfiles
      type: object
      properties:
        AffiliatedAgencyFein:
          maxLength: 11
          pattern: ((\(\d{9}\)|\d{2}[\-]?\d{7}))
          type: string
          nullable: true
        AllProfiles:
          minLength: 1
          type: string
        FirstName:
          maxLength: 80
          type: string
          nullable: true
        IdentifierType:
          type: string
          nullable: true
        IdentifierValue:
          type: string
          nullable: true
        LastName:
          maxLength: 80
          type: string
          nullable: true
        RequesterIdentifierType:
          type: string
          nullable: true
        RequesterIdentifierValue:
          type: string
          nullable: true
      additionalProperties: false
    AgentProfileSearchResponseDto:
      type: object
      properties:
        AccountId:
          type: integer
          format: int64
        AgentProfiles:
          type: array
          items:
            $ref: '#/components/schemas/AgentProfileSearchResult'
          nullable: true
        IdentifierType:
          type: string
          nullable: true
        IdentifierValue:
          type: string
          nullable: true
      additionalProperties: false
    AgentProfileSearchResult:
      type: object
      properties:
        Crd:
          type: string
          nullable: true
        FirstName:
          type: string
          nullable: true
        LastName:
          type: string
          nullable: true
        MiddleName:
          type: string
          nullable: true
        Npn:
          type: string
          nullable: true
        ProfileKey:
          type: string
          nullable: true
        ProfileStatus:
          type: string
          nullable: true
        Suffix:
          type: string
          nullable: true
      additionalProperties: false
