swagger: '2.0'
info:
  title: ACC Claims API-V3
  description: '<p>Welcome to the API design for Claims at ACC. This API specification has been created to socialise API design with the sector and seek feedback for further refinement. Unplanned API routes have also been specified at a high level, to identify appetite for additional features. this API also focus on RealTime Number Allocation-V3 . The ACC Claims API design principals are based on government standards and guidelines https://www.ict.govt.nz/guidance-and-resources/standards-compliance/api-standard-and-guidelines</p>'
  termsOfService: 'https://developer.acc.co.nz/terms-conditions'
  license:
    name: Apache 2.0
    url: 'http://www.apache.org/licenses/LICENSE-2.0.html'
  version: 2.0.0
schemes:
  - https
host: apiservicesnpe.acc.co.nz
securityDefinitions:
  apiKeyHeader:
    type: apiKey
    name: apiKey
    in: header
security:
  - apiKeyHeader: []
basePath: /api/v2
paths:
  /claims/claimNumber:
    get:
      tags:
        - Claims
      summary: Provides a new Claim Number.
      description: Provides a Claim Number to be used for claim submission. Claim Number is valid for use for 60 days only.
      operationId: claimNumberAllocation
      parameters:
        - name: ACC-CorrelationId
          in: header
          description: ACC-CorrelationId
          required: false
          type: string
        - name: vendorId
          in: query
          description: vendorId
          required: true
          type: string
        - name: providerId
          in: query
          description: providerId
          required: true
          type: string
      responses:
        '200':
          description: Success
          schema:
           $ref: '#/definitions/RealTimeNumberAllocationResponse'
        '400':
          description: 'Bad Request: invalid data'
          schema:
            $ref: '#/definitions/ApiException'
        '401':
          description: 'Unauthorized: authentication error'
          schema:
            $ref: '#/definitions/ApiException'
        '403':
          description: 'Forbidden: authorization error'
          schema:
            $ref: '#/definitions/ApiException'
        '404':
          description: Not Found
          schema:
            $ref: '#/definitions/ApiException'
        '500':
          description: Internal Server Error
          schema:
            $ref: '#/definitions/ApiException'
definitions:
  ApiError:
    type: object
    properties:
      field:
        type: string
      message:
        type: string
  ApiException:
      type: object
      properties:
        errors:
          type: array
          items:
            $ref: '#/definitions/ApiError'
  RealTimeNumberAllocationResponse:
    type: object
    required:
      - allocatedDateTime
      - allocatedProviderId
      - allocatedVendorId
      - claimNumber
      - formSubmissionId
      - formType
      - id
      - lastUpdatedDateTime
      - status
      - usedProviderId
      - usedVendorId
    properties:
        claimNumber:
          type: string
          example: AA00003
        formType:
          type: string
          example: ACC45
        status:
          type: string
          example: Allocated
        allocatedVendorId:
          type: string
          example: J99966
        allocatedProviderId:
          type: string
          example: J99966
        allocatedDateTime:
          type: string
          example: '2020-12-03T00:27:56.487Z'
        lastUpdatedDateTime:
          type: string
          example: '2020-12-03T00:27:56.487Z'
        usedVendorId:
          type: string
          example: ZZYGSU
        usedProviderId:
          type: string
          example: AA8082
        formSubmissionId:
          type: integer
          example: 3001
    description: The entire payload for fetching
  