swagger: '2.0'
info:
  x-ibm-name: ndis-referencedata
  title: NDIS ReferenceData
  version: 3.0.0
  description: Digital Partners can retrieve information needed to familiarise themselves with the entity and their attributes' information, required to communicate with NDIA's system
  contact:
    name: NDIA Support Team
    email: api.support@ndis.gov.au
schemes:
  - https
host: api.ndis.gov.au
basePath: /sharedservices/ndis-api/ndis/3.0/reference-data
consumes:
  - application/json
produces:
  - application/json
security:
  - clientIdHeader: []
securityDefinitions:
  clientIdHeader:
    type: apiKey
    in: header
    name: X-IBM-Client-Id
    description: 'apiKey provided during registration. Max Length(64). example: aa111aa-11a1-1a11-111a-1a1a11aa111a'
x-ibm-configuration:
  testable: true
  enforced: true
  cors:
    enabled: true
  phase: realized
  type: rest
  servers:
    - url: https://api.ndis.gov.au/sharedservices/ndis-api/ndis/3.0/reference-data
      description: ''
      type:
        - production
        - development
    - url: https://api.ndis.gov.au/sharedservices/ndis-api/ndis/3.0/reference-data
      description: ''
      type:
        - production
        - development
paths:
  /:
    get:
      responses:
        '200':
          description: 200 OK
          schema:
            $ref: '#/definitions/reference_data_list_response'
        '400':
          description: 'Bad Request: A validation resulted in the request being rejected.'
          schema:
            $ref: '#/definitions/http_error'
        '401':
          description: 'Unauthorised: No authentication credentials provided or authentication has failed.'
          schema:
            $ref: '#/definitions/http_error'
        '404':
          description: The URI path or the requested record was not found.
          schema:
            $ref: '#/definitions/http_error'
        '500':
          description: 'Internal Server Error: An internal error has occurred and the server is unable to respond.'
          schema:
            $ref: '#/definitions/http_error'
      summary: Request the entire list of reference data
      description: |-
        This operation allows the Digital Partners to retrieve the entire list of reference fields along with their usage description. It is important to familiarise yourself with the various reference data fields as these reference fields either form a part of the response body or are required to be supplied by the Digital Partners as part of the request data for other NDIS API Products, like Budget, Service Bookings etc.

        For example: 
         1. Key "reject_reason_code" is displayed in the response body of the Payments API, and used to indicate the business rule validation that failed for a Rejected Payment Request. 
         2. Key of "user_status_code" is a mandatory request data field required as part of the PATCH/{quotation} operation and is used to indicate the status of the quotation request.
    parameters:
      - $ref: '#/parameters/authorization'
  /{attribute_name}:
    get:
      responses:
        '200':
          description: 200 OK
          schema:
            $ref: '#/definitions/reference_data_list_response'
        '400':
          description: 'Bad Request: A validation resulted in the request being rejected.'
          schema:
            $ref: '#/definitions/http_error'
        '401':
          description: 'Unauthorised: No authentication credentials provided or authentication has failed.'
          schema:
            $ref: '#/definitions/http_error'
        '404':
          description: The URI path or the requested record was not found.
          schema:
            $ref: '#/definitions/http_error'
        '500':
          description: 'Internal Server Error: An internal error has occurred and the server is unable to respond.'
          schema:
            $ref: '#/definitions/http_error'
      summary: Request a specific reference data
      description: |-
        This operation will retrieve all attribute values and their keys, associated to the reference data (entity name) supplied in the path string. In order to get a successful response, the correct reference data key must be supplied in the path string. Use the NDIS Reference Data API - GET/ operation to retrieve the complete reference data list.

        For example: 
         1. By supplying reject_reason_code in the path string, all the associated reject reason code values along with their descriptions will be displayed. For instance, "C01" is one of the reject_reason_code, which indicates that the payment request was rejected because a corresponding Service Booking does not exist.
         2. By supplying user_status_code in the path string, all the associated statuses pertaining to a quotation request along with their description will be displayed.  For instance, "RESR" is one of the user_status_code, which indicates that the quote has been responded to by the Provider and must be supplied by the Provider as part of the PATCH/ {quotation_id} operation.
         3. To retrieve a list of all product category item codes and their description, supply product_category_item in the path string
      parameters:
        - $ref: '#/parameters/attribute_name'
    parameters:
      - $ref: '#/parameters/authorization'
  /{attribute_name}/{subattribute_name}:
    get:
      responses:
        '200':
          description: 'Success: The request was successful'
          schema:
            $ref: '#/definitions/reference_data_list_response'
        '400':
          description: 'Bad Request: A validation resulted in the request being rejected.'
          schema:
            $ref: '#/definitions/http_error'
        '401':
          description: 'Unauthorised: No authentication credentials provided or authentication has failed.'
          schema:
            $ref: '#/definitions/http_error'
        '404':
          description: The URI path or the requested record was not found.
          schema:
            $ref: '#/definitions/http_error'
        '500':
          description: 'Internal Server Error: An internal error has occurred and the server is unable to respond.'
          schema:
            $ref: '#/definitions/http_error'
      tags:
        - GET
      operationId: get_reference_data
      parameters:
        - $ref: '#/parameters/attribute_name'
        - $ref: '#/parameters/subattribute_name'
      summary: Request a specific reference data with sub reference data
      description: |-
        This operation will retrieve the value(s) for the supplied attribute, in relation to the sub attribute, supplied in the path string. 

        Usage Instructions:
         1. By supplying unit_of_measure as the attribute and a specific product_category_item as the sub-attribute, the unit of measure for the supplied product category item will be displayed.<br></br> Calling the endpoint /reference-data/unit_of_measure/15_045_0128_1_3, will display "Hour" as the unit of measure, applicable to the product_category_item of 15_045_0128_1_3.<br></br>
         2. By supplying product_category_item as the attribute and a specific product_category as the sub-attribute, all product category items associated to the product category will be displayed.<br></br> Calling the endpoint /reference-data/product_category_item/CB_CHOICE_CONTROL, will display the four product category items, specific to  CB Choice and Control. The product category item code and description will both be displayed.<br></br>
         3. By supplying status as the attribute and a specific process_type as the sub-attribute, all the statuses associated with the lifecycle of the supplied process type will be displayed.<br></br> Calling the endpoint /reference-data/status/ZSAG, will display the statuses that a Standard Service Booking may follow during its lifecycle.
    parameters:
      - $ref: '#/parameters/authorization'
parameters:
  authorization:
    name: authorization
    type: string
    required: true
    in: header
    description: Bearer token
    x-example: valid Authorizaton Token
  subattribute_name:
    name: subattribute_name
    type: string
    required: true
    in: path
    description: 'Name of the subattribute name along with attribute name like unit_of_measure/<[product_category_item]>, status/<[process_type]>, product_category_item/<[product_category]>, process_type/<[quotations,service-bookings,upload-file]>.<br></br> eg: unit_of_measure/14_031_0127_8_3, status/ZICO, product_category_item/CB_CHOICE_CONTROL, process_type/quotations'
    x-example: product_category_item
  attribute_name:
    name: attribute_name
    type: string
    required: true
    in: path
    description: 'Name of the Reference Data attribute - eg: claim_status, booking_type, cancellation_reason, claim_reason, claim_type, content_type, event_id, frequency, process_type, product_category, product_category_item, product_type, quote_type, reject_reason_code, rejection_reason, staff_rejection_reason, states, status, tax_code, terms_of_quote, unit_of_measure, user_status_code, virtual_status, item_type, exemption_reason'
    x-example: claim_status
definitions:
  reference_data_list_response:
    description: Response for Geting a reference_data
    properties:
      success:
        type: boolean
        example: true
      result:
        $ref: '#/definitions/reference_data_list'
      errors:
        $ref: '#/definitions/errors'
    additionalProperties: false
    required:
      - success
  reference_data_list:
    type: array
    items:
      $ref: '#/definitions/reference_data_list_item'
  reference_data_list_item:
    properties:
      key:
        type: string
        description: Entity name or key of the requested entity attribute
        example: claim_status
      value:
        type: string
        description: Entity usage description or value of the requested attribute
        example: Claim Status used in Payments API
    additionalProperties: false
  errors:
    description: A set of errors
    type: array
    items:
      type: string
      example: error
  http_error:
    description: A single HTTP response
    properties:
      http_code:
        type: string
        example: 400
        description: HTTP status code
      http_message:
        type: string
        example: Bad Request
        description: HTTP Message
      more_information:
        type: string
        example: One or more required API parameters are missing.
        description: Additional information
    additionalProperties: false
tags: []
