openapi: 3.0.3
info:
  title: Orders API
  description: >-
    List available products, place orders, view order history, and retrieve
    ordered products.
  termsOfService: https://www.landata.online/terms-conditions-information-products/
  contact:
    email: legal@servictoria.com.au
  version: 1.11.1
externalDocs:
  description: Find out more about these services
  url: https://www.landata.online/help/
servers:
  - url: https://api.servictoria.io/ddp
    description: Production environment
  - url: https://test.api.servictoria.io/ddp
    description: Test environment
paths:
  /orders/v1/products:
    get:
      summary: GET products
      description: >
        Get the list of certificate products available for order on a specified
        title, by providing a volume & folio number or encrypted title ID
        created by discovery APIs.

        The response will include important details about each product like the
        pricing, description, pre-requisites, responsible authority, turnaround
        time and more.
      operationId: getProducts
      tags:
        - Product Listing
      security:
        - oauthClientCredentials:
            - orders:write
      parameters:
        - name: titleId
          in: query
          description: >
            Title identifier, this can be either a volume/folio (eg:
            '10940/843') or an encrypted titleId as

            returned by operations on this API (eg:
            'qp0gjuieZ5VzbNKtT/eZvqPryobRkEYxMA==' - this example is valid

            for the TEST environment only).

            The returned product listing will include products related to the
            requested titleId.

            A maximum of one of titleId, propertyPfi, or documentId is required.
          required: false
          schema:
            type: string
          example: 10940/843
        - name: propertyPfi
          in: query
          description: >
            Unique identifier for a property.

            The returned product listing will include products related to the
            requested propertyPfi.

            A maximum of one of titleId, propertyPfi, or documentId is required.
          required: false
          schema:
            type: string
            pattern: ^[0-9]{1,20}$
          example: '208045633'
        - name: documentId
          in: query
          description: >
            Unique identifier for a document.

            The returned product listing will include products related to the
            requested documentId.

            A maximum of one of titleId, propertyPfi, or documentId is required.
          required: false
          schema:
            type: string
            pattern: ^[A-Za-z0-9/]*$
          example: AR122019D
        - name: customer-id
          in: header
          description: Identifier of the customer this request is on behalf of.
          required: false
          schema:
            type: string
            minLength: 1
            maxLength: 40
        - name: x-correlation-id
          in: header
          description: >-
            Optional unique UUID which can assist with tracing / debugging
            requests.
          required: false
          schema:
            type: string
            format: uuid
          example: 824993ab-7366-4faa-963d-c456dec227a5
      responses:
        '200':
          description: Successful Operation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetProductsResponse'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Unauthorised
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
  /orders/v1/extra-data/owners-corporation-managers:
    get:
      summary: GET owners corporation managers
      description: >
        List extra data owners corporation (OC)) managers.

        This is a reference dataset for the list of all OC managers in Victoria,
        to be used when required to choose one as customer provided extra data
        in product orders. This list is maintained by SERV, new owners
        corporation managers are added regularly.
      operationId: getOwnersCorporationManagers
      tags:
        - Extra Data
      security:
        - oauthClientCredentials:
            - orders:read
      parameters:
        - name: x-correlation-id
          in: header
          description: >-
            Optional unique UUID which can assist with tracing / debugging
            requests.
          required: false
          schema:
            type: string
            format: uuid
          example: 824993ab-7366-4faa-963d-c456dec227a5
      responses:
        '200':
          description: Successful Operation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetOwnersCorporationManagersResponse'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Unauthorised
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
  /orders/v1/extra-data/municipalities:
    get:
      summary: GET municipalities
      description: >
        List extra data municipalities.

        This is a reference dataset for the list of all OC managers in Victoria,
        to be used when required to choose one as customer provided extra data
        in product orders.
      operationId: getMunicipalities
      tags:
        - Extra Data
      security:
        - oauthClientCredentials:
            - orders:read
      parameters:
        - name: x-correlation-id
          in: header
          description: >-
            Optional unique UUID which can assist with tracing / debugging
            requests.
          required: false
          schema:
            type: string
            format: uuid
          example: 824993ab-7366-4faa-963d-c456dec227a5
      responses:
        '200':
          description: Successful Operation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetMunicipalitiesResponse'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Unauthorised
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
  /orders/v1:
    post:
      summary: POST orders
      description: >
        Submit an order for Landata information products when ready for
        confirming the purchase.

        Provide the list of products intended for purchase, along with customer
        account details, pre-requisites or extra data required and a title
        identifier.
      operationId: postOrder
      tags:
        - Orders
      security:
        - oauthClientCredentials:
            - orders:write
      parameters:
        - name: customer-id
          in: header
          description: Identifier of the customer this request is on behalf of.
          required: false
          schema:
            type: string
            minLength: 1
            maxLength: 40
        - name: customer-reference
          in: header
          description: >-
            Optional description to identify a transaction, used for billing
            purposes. Note that we'll be providing a separate order ID once the
            order has been submitted.
          required: false
          schema:
            type: string
            maxLength: 40
            pattern: ^[0-9a-zA-Z-_&(),.@ ]+$
        - name: x-correlation-id
          in: header
          description: >-
            Optional unique UUID which can assist with tracing / debugging
            requests.
          required: false
          schema:
            type: string
            format: uuid
          example: 824993ab-7366-4faa-963d-c456dec227a5
        - name: idempotency-key
          in: header
          description: >
            Unique UUID used to prevent duplicate order submissions.

            This allows requests to be retried after a network failure without
            accidentally submitting two orders.

            If you receive a network error or timeout, you should resend the
            request with the same idempotency-key.

            If you resend a request with the same value for the idempotency-key,
            you will receive the original response.

            If the server is still processing the original POST, you will
            receive 429 Too Many Requests.

            Idempotency keys expire after 24 hours.
          required: false
          schema:
            type: string
            format: uuid
          example: cc4d91e3-17af-4d11-b333-eb449e62ff07
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PostOrderRequest'
        required: true
      responses:
        '200':
          description: Successful Operation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PostOrderResponse'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Unauthorised
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '429':
          description: Too Many Requests
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
    get:
      summary: GET orders
      description: >
        Get a paginated list of past orders. This will provide a history of
        orders made by a specified customer along with full captured details of
        each order and the summary of included items.
      operationId: getOrders
      tags:
        - Orders
      security:
        - oauthClientCredentials:
            - orders:read
      parameters:
        - name: pageNumber
          in: query
          description: Page number starting at 1.
          required: false
          schema:
            type: integer
            default: 1
            minimum: 1
        - name: customer-id
          in: header
          description: Identifier of the customer this request is on behalf of.
          required: false
          schema:
            type: string
            minLength: 1
            maxLength: 40
        - name: x-correlation-id
          in: header
          description: >-
            Optional unique UUID which can assist with tracing / debugging
            requests.
          required: false
          schema:
            type: string
            format: uuid
          example: 824993ab-7366-4faa-963d-c456dec227a5
      responses:
        '200':
          description: Successful Operation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetOrdersResponse'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Unauthorised
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
  /orders/v1/{orderId}:
    get:
      summary: GET order
      description: >
        Get details of an order.

        This will provide details of a specified order using the order ID along
        with full captured details of each order and the summary of included
        items.
      operationId: getOrder
      tags:
        - Orders
      security:
        - oauthClientCredentials:
            - orders:read
      parameters:
        - name: orderId
          in: path
          description: >-
            Unique number to identify an order. This order Identifier is
            provided in the response when initially submitting an order.
          required: true
          schema:
            type: string
            pattern: ^[A-Za-z0-9]*$
        - name: customer-id
          in: header
          description: Identifier of the customer this request is on behalf of.
          required: false
          schema:
            type: string
            minLength: 1
            maxLength: 40
        - name: x-correlation-id
          in: header
          description: >-
            Optional unique UUID which can assist with tracing / debugging
            requests.
          required: false
          schema:
            type: string
            format: uuid
          example: 824993ab-7366-4faa-963d-c456dec227a5
      responses:
        '200':
          description: Successful Operation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Order'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Unauthorised
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
  /orders/v1/{orderId}/item/{orderItemNumber}:
    get:
      summary: GET order item
      description: >
        Get details of an ordered item. Item refers to a product purchased as
        part of an order.

        Provide the order number along with Order item number to recieve its
        details including the information product itself in the available
        format/s.
      operationId: getOrderItem
      tags:
        - Orders
      security:
        - oauthClientCredentials:
            - orders:read
      parameters:
        - name: orderId
          in: path
          description: Unique number to identify an order.
          required: true
          schema:
            type: string
            pattern: ^[A-Za-z0-9]*$
        - name: orderItemNumber
          in: path
          description: Item number the product appears within the order.
          required: true
          schema:
            type: integer
        - name: customer-id
          in: header
          description: Identifier of the customer this request is on behalf of.
          required: false
          schema:
            type: string
            minLength: 1
            maxLength: 40
        - name: x-correlation-id
          in: header
          description: >-
            Optional unique UUID which can assist with tracing / debugging
            requests.
          required: false
          schema:
            type: string
            format: uuid
          example: 824993ab-7366-4faa-963d-c456dec227a5
      responses:
        '200':
          description: Successful Operation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetOrderItemResponse'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Unauthorised
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
  /orders/v1/titles/decrypt:
    post:
      summary: POST decrypt titles
      description: >
        API which accepts a list of encrypted titleIds and returns a list of
        decrypted titleIds (aka Volume/Folios).
      operationId: decryptTitleId
      tags:
        - Orders
      security:
        - oauthClientCredentials:
            - orders:write
      parameters:
        - name: customer-id
          in: header
          description: Identifier of the customer this request is on behalf of.
          required: false
          schema:
            type: string
            minLength: 1
            maxLength: 40
        - name: customer-reference
          in: header
          description: >-
            Optional description to identify a transaction, used for billing
            purposes. Note that we'll be providing a separate order ID once the
            order has been submitted.
          required: false
          schema:
            type: string
            maxLength: 40
            pattern: ^[0-9a-zA-Z-_&(),.@ ]+$
        - name: x-correlation-id
          in: header
          description: >-
            Optional unique UUID which can assist with tracing / debugging
            requests.
          required: false
          schema:
            type: string
            format: uuid
          example: 824993ab-7366-4faa-963d-c456dec227a5
        - name: idempotency-key
          in: header
          description: >
            Unique UUID used to prevent duplicate order submissions.

            This allows requests to be retried after a network failure without
            accidentally submitting two orders.

            If you receive a network error or timeout, you should resend the
            request with the same idempotency-key.

            If you resend a request with the same value for the idempotency-key,
            you will receive the original response.

            If the server is still processing the original POST, you will
            receive 429 Too Many Requests.

            Idempotency keys expire after 24 hours.
          required: false
          schema:
            type: string
            format: uuid
          example: cc4d91e3-17af-4d11-b333-eb449e62ff07
      requestBody:
        description: Object containing an array of encrypted titleIds
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DecryptTitleIdsRequest'
      responses:
        '200':
          description: Successful Operation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DecryptTitleIdsResponse'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Unauthorised
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '429':
          description: Too Many Requests
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
components:
  schemas:
    ErrorResponse:
      type: object
      properties:
        errorType:
          type: string
          description: Stable error code that can be used to decide how to hand an error.
          example: UNAUTHORIZED
        errorMessage:
          type: string
          description: Invalid Authorization token.
    ProductBase:
      type: object
      properties:
        productCode:
          type: string
          description: >
            Each product type offered has a unique productCode. The productCode
            together with productIds will uniquely

            specify a specific instance of a product that can be ordered.
          example: RegisterSearchStatement
        productIds:
          type: object
          description: >
            To place an order for a product these productIds need to be provided
            together with the productCode which

            uniquely specifies an instance of a product that can be ordered.

            Each product type can have different productIds. A couple of
            examples:
              - for productCode RegisterSearchStatement the productIds will include a titleId, eg: { "titleId": "10940/843" }
              - for productCode VicRoads productIds will include two fields, eg: { "propertyPfi": "5365126", "authorityId": 431 }
          additionalProperties: true
          example:
            titleId: 10940/843
        productName:
          type: string
          description: Name of the product, suitable for display to customers.
          example: Register Search Statement (Copy of Title)
        productDescription:
          type: string
          description: Text that appears under the product to describe it in more detail.
          example: >-
            PDF version of the copy of the Title, lists the current registered
            proprietors, any encumbrances, caveats or notices that apply to the
            land, but does not include a sketch of the plan.
        productInformation:
          type: object
          description: >
            For some products additional product specific information is made
            available that may be useful in assisting

            users to understand if this is the product they wish to purchase.
          additionalProperties: true
          example:
            documentType: MORTGAGE
        productAvailability:
          type: string
          enum:
            - AVAILABLE
            - UNAVAILABLE
          description: >
            Indicate whether a product is available for purchase.

            Some products such as destroyed instruments are listed but are
            UNAVAILABLE and cannot be purchased.
        authorityName:
          type: string
          description: Name of Authority who is responsible for the information product
          example: Victorian Land Title Registry
        price:
          type: integer
          description: >-
            The price (in cents) for this product (including gst). For example
            891 refers to $8.91 Australian dollars and includes the GST in tht
            total.
          example: 891
        gst:
          type: integer
          description: The gst amount (in cents) for this product.
          example: 89
        turnaroundTime:
          type: integer
          description: >-
            How soon the product will be ready for delivery. This integer must
            be connected with the turnaroundTimeUnit to fully understand the
            time.
          example: 5
        turnaroundTimeUnit:
          type: string
          enum:
            - DAY
            - MIN
            - SEC
          description: Unit of measure for turnaround time.
        customerWarning:
          type: string
          description: >-
            Any warning content attached to the product. These must be shown to
            the customer and accepted before making a purchase.
          example: >-
            Please note that Commemorative Title Certificate is a decorative
            memento that celebrates property ownership and makes pride of
            ownership tangible. This cannot be used for any legal purpose.
        extraData:
          type: array
          items:
            $ref: '#/components/schemas/SupportedExtraData'
          description: >
            Some products support (or require) extra data to be provided when
            they are ordered.

            What extra data is supported varies depending on the product. The
            elements in this array indicate which extra data types this product
            supports.
          example:
            - key: vendors
            - key: meterRead
      required:
        - productCode
        - productIds
        - productName
        - productAvailability
        - authorityName
        - price
        - gst
        - turnaroundTime
        - turnaroundTimeUnit
    SupportedExtraData:
      type: object
      properties:
        key:
          type: string
          description: Key of the extra data type supported by a product.
          example: postalAddress
    Product:
      type: object
      allOf:
        - $ref: '#/components/schemas/ProductBase'
        - type: object
          properties:
            prerequisites:
              type: array
              items:
                $ref: '#/components/schemas/Prerequisite'
    Prerequisite:
      type: object
      allOf:
        - $ref: '#/components/schemas/ProductBase'
        - type: object
          properties:
            previousOrder:
              type: object
              properties:
                orderId:
                  type: string
                  pattern: ^[A-Za-z0-9]*$
                  description: >
                    If the product was previously ordered. Previous order must
                    be made under the same account and within

                    the last 120 days for them to be accepted as a
                    pre-requisite. If there is more than one order that can
                    satisfy the pre-requisite only the latest

                    order will be shown.
                orderItemNumber:
                  type: integer
                  description: Identifier for the item previously ordered.
                orderDate:
                  type: string
                  description: Date and time the item was ordered.
                  format: date-time
                  example: '2023-07-14T00:00:00.000000+11:00'
              required:
                - orderId
                - orderItemNumber
                - orderDate
    GetProductsResponse:
      type: object
      properties:
        products:
          items:
            $ref: '#/components/schemas/Product'
          type: array
      required:
        - products
    GetOwnersCorporationManagersResponse:
      properties:
        managers:
          items:
            $ref: '#/components/schemas/OwnersCorporationManager'
          type: array
      type: object
    OwnersCorporationManager:
      type: object
      properties:
        name:
          type: string
          description: Owners corporation manager name.
        id:
          type: integer
          description: Owners corporation manager id.
        supportedDeliverySpeeds:
          type: array
          description: Delivery options and prices offered by the Owners corporation.
          items:
            $ref: '#/components/schemas/SupportedDeliverySpeeds'
    SupportedDeliverySpeeds:
      type: object
      properties:
        deliverySpeed:
          type: string
          description: >-
            Indicate how the owners corporation product is to be delivered, e.g.
            via standard delivery or express. If manual input, delivery option
            can only be STANDARD
          enum:
            - STANDARD
            - EXPRESS
            - PRIORITY
        price:
          type: integer
          description: >-
            The price (in cents) for this product (including gst). For example
            891 refers to $8.91 Australian dollars and includes the GST in tht
            total.
          example: 891
        gst:
          type: integer
          description: The gst amount (in cents) for this product.
          example: 89
        turnaroundTime:
          type: integer
          description: >-
            How soon the product will be ready for delivery. This integer must
            be connected with the turnaroundTimeUnit to fully understand the
            time.
          example: 5
        turnaroundTimeUnit:
          type: string
          enum:
            - DAY
            - MIN
            - SEC
          description: Unit of measure for turnaround time.
        extraData:
          type: array
          items:
            $ref: '#/components/schemas/SupportedExtraData'
          description: >
            Some products support (or require) extra data to be provided when
            they are ordered.

            What extra data is supported varies depending on the product. The
            elements in this array indicate which extra data types this product
            supports.
          example:
            - key: vendors
            - key: ownersCorpManagerData
            - key: deliverySpeed
    Municipality:
      type: object
      properties:
        name:
          type: string
          description: Municipality name.
    GetMunicipalitiesResponse:
      type: object
      properties:
        municipalities:
          type: array
          items:
            $ref: '#/components/schemas/Municipality'
    PostOrderRequest:
      type: object
      properties:
        products:
          type: array
          minItems: 1
          maxItems: 50
          items:
            $ref: '#/components/schemas/OrderProduct'
        deliveryPreference:
          type: string
          description: >-
            Indicate how product is delivered to customers. If 'EMAIL' is
            selected, then product will be emailed to recipient. If 'NONE' then
            product will not be delivered and must be retrieved via API.
          enum:
            - NONE
            - EMAIL
        email:
          type: string
          format: email
          description: >-
            Email address where the products will be delivered to. Required if
            deliveryPreference is EMAIL or if alerting products are ordered.
          maxLength: 200
        contactName:
          type: string
          description: Contact person for the order.
          maxLength: 130
          pattern: ^[0-9a-zA-Z\x{00C0}-\x{017E}#\-+_&(),.@{}:$?!;'"\/|%*=\\ ]+$
        contactNumber:
          type: string
          description: Phone number of the contact person.
          maxLength: 20
          pattern: ^[0-9()\-\+ ]+$
        alternateAddress:
          $ref: '#/components/schemas/AlternateAddress'
      required:
        - products
        - deliveryPreference
    Fee:
      type: object
      properties:
        type:
          type: string
          description: >-
            Description of what the fee/charge is for. Fees such as land index
            search surcharge will be listed here.
        amount:
          type: integer
          description: The fee amount (in cents) for this product (including gst).
          example: 891
        gst:
          type: integer
          description: The gst fee amount (in cents) for this product.
          example: 89
        feeDetails:
          type: object
          additionalProperties: true
      required:
        - type
        - amount
        - gst
    OrderItem:
      type: object
      properties:
        orderItemNumber:
          type: integer
          description: Identifier for the item previously ordered.
        productCode:
          type: string
          description: >
            Each product type offered has a unique productCode. The productCode
            together with productIds will uniquely

            specify a specific instance of a product that can be ordered.
          example: RegisterSearchStatement
        productIds:
          type: object
          description: >
            To place an order for a product these productIds need to be provided
            together with the productCode which

            uniquely specifies an instance of a product that can be ordered.

            Each product type can have different productIds. A couple of
            examples:
              - for productCode RegisterSearchStatement the productIds will include a titleId, eg: { "titleId": "10940/843" }
              - for productCode VicRoads productIds will include two fields, eg: { "propertyPfi": "5365126", "authorityId": 431 }
          additionalProperties: true
          example:
            titleId: 10940/843
        productName:
          type: string
          description: Name of the product, suitable for display to customers.
          example: Register Search Statement (Copy of Title)
        productInformation:
          type: object
          description: >
            For some products additional product specific information is
            provided to users such as decrypted product id, product type and
            more
          additionalProperties: true
          example:
            documentType: MORTGAGE
        authorityName:
          type: string
          description: Name of Authority who is responsible for the information product.
          example: Victorian Land Title Registry
        price:
          type: integer
          description: The amount (in cents) charged for this product (including gst).
          example: 891
        gst:
          type: integer
          description: The gst amount (in cents) charged for this product.
          example: 89
      required:
        - orderItemNumber
        - productCode
        - productIds
        - price
        - gst
    PrerequisiteProduct:
      type: object
      properties:
        productCode:
          type: string
          description: >
            Each product type offered has a unique productCode. The productCode
            together with productIds will uniquely

            specify a specific instance of a product that can be ordered.
          example: RegisterSearchStatement
        productIds:
          type: object
          description: >
            To place an order for a product these productIds need to be provided
            together with the productCode which

            uniquely specifies an instance of a product that can be ordered.

            Each product type can have different productIds. A couple of
            examples:
              - for productCode RegisterSearchStatement the productIds will include a titleId, eg: { "titleId": "10940/843" }
              - for productCode VicRoads productIds will include two fields, eg: { "propertyPfi": "5365126", "authorityId": 431 }
          additionalProperties: true
          example:
            titleId: 10940/843
      required:
        - productCode
        - productIds
    PrerequisiteOrder:
      type: object
      properties:
        orderId:
          type: string
          description: >
            If the product was previously ordered. Previous order must be made
            under the same account and within

            the last 120 days. If there is more than one order that can satisfy
            the pre-requisite only the latest

            order will be shown.
        orderItemNumber:
          type: integer
          description: Identifier for the item previously ordered.
      required:
        - orderId
        - orderItemNumber
      additionalProperties: false
    PrerequisiteSecurityNumber:
      type: object
      properties:
        securityNumber:
          type: string
          description: >
            A security number may be provided for satisfying title
            prerequisites. The security number must be

            associated to a previous order within the last 120 days.
      required:
        - securityNumber
      additionalProperties: false
    OrderProduct:
      type: object
      properties:
        productCode:
          type: string
          description: >
            Each product type offered has a unique productCode. The productCode
            together with productIds will uniquely

            specify a specific instance of a product that can be ordered.
          example: RegisterSearchStatement
        productIds:
          type: object
          description: >
            To place an order for a product, these productIds need to be
            provided together with the productCode which

            uniquely specifies an instance of a product that can be ordered.

            Each product type can have different productIds. A couple of
            examples:
              - for productCode RegisterSearchStatement the productIds will include a titleId, eg: { "titleId": "10940/843" }
              - for productCode VicRoads productIds will include two fields, eg: { "propertyPfi": "5365126", "authorityId": 431 }
          additionalProperties: true
          example:
            titleId: 10940/843
        isWarningAcknowledged:
          type: boolean
          description: >-
            Customers are allowed to proceed only if they have accepted the
            warning messages. Warning messages are supplied in GET products.
        extraData:
          $ref: '#/components/schemas/ExtraData'
          description: >
            Some products support (or require) extra data to be provided when
            they are ordered.

            What extra data is supported varies depending on the product.

            Refer to '#/components/schemas/ExtraData' for the definition of
            these extra data.
          additionalProperties: true
        prerequisites:
          type: array
          items:
            oneOf:
              - $ref: '#/components/schemas/PrerequisiteProduct'
              - $ref: '#/components/schemas/PrerequisiteOrder'
              - $ref: '#/components/schemas/PrerequisiteSecurityNumber'
      required:
        - productCode
        - productIds
    PostOrderResponse:
      type: object
      properties:
        orderId:
          type: string
          description: Unique number to identify an order.
          example: '10219435'
        totalPrice:
          type: integer
          description: The total price (in cents) for this order (including gst).
          example: 891
        totalGst:
          type: integer
          description: The total gst amount (in cents) for this order.
          example: 89
        fees:
          type: array
          items:
            $ref: '#/components/schemas/Fee'
          description: Any additional charges such as land index search surcharge.
        itemsOrdered:
          type: array
          items:
            $ref: '#/components/schemas/OrderItem'
      required:
        - orderId
        - totalPrice
        - totalGst
        - itemsOrdered
    GetOrdersResponse:
      type: object
      properties:
        pagination:
          $ref: '#/components/schemas/Pagination'
        orders:
          type: array
          items:
            $ref: '#/components/schemas/Order'
      required:
        - orders
    GetOrderResponse:
      $ref: '#/components/schemas/Order'
    Pagination:
      type: object
      properties:
        totalRecords:
          type: integer
          description: Total number of records (across all pages).
        nextPage:
          type: integer
          description: Number for the next page.
          example: 2
      required:
        - totalRecords
    Order:
      type: object
      properties:
        orderId:
          type: string
          description: Unique number to identify an order.
          example: '10219435'
        orderDate:
          type: string
          description: Date and time the item was ordered.
          format: date-time
          example: '2023-07-14T00:00:00.000000+11:00'
        totalPrice:
          type: integer
          description: The amount (in cents) charged for this product (including gst).
          example: 891
        totalGst:
          type: integer
          description: The gst amount (in cents) charged for this product.
          example: 89
        fees:
          type: array
          items:
            $ref: '#/components/schemas/Fee'
          description: Any additional charges such as land index search surcharge.
        deliveryPreference:
          type: string
          description: >-
            Indicate how product is delivered to customers. If 'EMAIL' is
            selected, then product will be emailed to recipient. If 'NONE' then
            product will not be delivered and must be retrieved via API.
          enum:
            - NONE
            - EMAIL
        email:
          type: string
          description: Email address where the product will be delivered to.
        contactName:
          type: string
          description: Contact person for the order.
        contactNumber:
          type: string
          description: Phone number of the contact.
        customerReference:
          type: string
          description: >-
            Any description customer entered during ordering process to identify
            a transaction.
        products:
          type: array
          items:
            $ref: '#/components/schemas/OrderSummaryProduct'
      required:
        - orderId
        - orderDate
        - totalPrice
        - totalGst
        - products
        - deliveryPreference
    OrderSummaryProduct:
      type: object
      properties:
        orderItemNumber:
          type: integer
          description: Identifier for the item previously ordered.
        productCode:
          type: string
          description: >
            Each product type offered has a unique productCode. The productCode
            together with productIds will uniquely

            specify a specific instance of a product that can be ordered.
          example: RegisterSearchStatement
        productIds:
          type: object
          description: >
            To place an order for a product these productIds need to be provided
            together with the productCode which

            uniquely specifies an instance of a product that can be ordered.

            Each product type can have different productIds. A couple of
            examples:
              - for productCode RegisterSearchStatement the productIds will include a titleId, eg: { "titleId": "10940/843" }
              - for productCode VicRoads productIds will include two fields, eg: { "propertyPfi": "5365126", "authorityId": 431 }
          additionalProperties: true
          example:
            titleId: 10940/843
        productName:
          type: string
          description: Name of the product, suitable for display to customers.
          example: Register Search Statement (Copy of Title)
        productInformation:
          type: object
          description: >
            For some products additional product specific information is
            provided to users such as decrypted product id, product type and
            more
          additionalProperties: true
          example:
            titleId: AB123456C
        authorityName:
          type: string
          description: Name of authority who is responsible for the information product.
          example: Victorian Land Title Registry
        productStatus:
          $ref: '#/components/schemas/ProductStatus'
        price:
          type: integer
          description: The amount (in cents) charged for this product (including gst).
          example: 891
        gst:
          type: integer
          description: The gst amount (in cents) charged for this product.
          example: 89
        extraData:
          type: object
          additionalProperties: true
        prerequisites:
          description: Prerequisites specified for the product
          type: array
          items:
            oneOf:
              - $ref: '#/components/schemas/PrerequisiteProduct'
              - $ref: '#/components/schemas/PrerequisiteOrder'
              - $ref: '#/components/schemas/PrerequisiteSecurityNumber'
          example:
            - productCode: RegisterSearchStatement
              productIds:
                titleId: 12345/678
      required:
        - orderItemNumber
        - productCode
        - productIds
        - productName
        - productStatus
        - authorityName
        - price
        - gst
    GetOrderItemResponse:
      type: object
      properties:
        orderId:
          type: string
          description: Unique number to identify an order.
          example: '10219435'
        orderItemNumber:
          type: integer
          description: Item number within the order.
          minimum: 1
          example: 1
        productName:
          type: string
          description: Name of the product, suitable for display to customers.
          example: Register Search Statement (Copy of Title)
        productCode:
          type: string
          description: >
            Each product type offered has a unique productCode. The productCode
            together with productIds will uniquely

            specify a specific instance of a product that can be ordered.
          example: RegisterSearchStatement
        productStatus:
          $ref: '#/components/schemas/ProductStatus'
        customerReference:
          type: string
          description: >-
            Any description customer entered during ordering process to identify
            a transaction.
        resourceText:
          type: string
          description: >-
            Content of the ordered item in text format. Relevant for text based
            information products.
        resourceJson:
          type: string
          description: >-
            Content of the ordered item in json format. Relevant for JSON based
            information products
        resourceLocation:
          type: string
          description: >-
            Pre-signed URL to retrieve the item. Relevant for products available
            as PDFs.
        resourceExpiry:
          type: string
          description: Date and time the item/product link expires.
          format: date-time
          example: '2024-11-07T04:43:46.564302+11:00'
        resourceFileType:
          type: string
        resourceFileSize:
          type: integer
          description: File size in kByte.
          example: 1897
      required:
        - orderId
        - orderItemNumber
        - productName
        - productCode
        - productStatus
    ProductStatus:
      type: string
      description: >
        Product processing status of the ordered product.

        The possible options are COMPLETE (successfully fulfilled), PROCESSING
        (Product is still being fulfilled), EXTERNAL_PROCESSING (certificate is
        with the external responsible authority), FAILED (there was an error
        causing fulfilment to not complete) or CANCELLED (product ordered was
        manually cancelled).
      enum:
        - COMPLETE
        - PROCESSING
        - EXTERNAL_PROCESSING
        - FAILED
        - CANCELLED
      example: COMPLETE
    ProductIds:
      description: >
        To place an order for a product, productIds need to be provided together
        with a productCode to

        uniquely specify an instance of a product that can be ordered.
      oneOf:
        - $ref: '#/components/schemas/TitleProductIds'
        - $ref: '#/components/schemas/DocumentProductIds'
        - $ref: '#/components/schemas/OwnersCorporationDocumentProductIds'
        - $ref: '#/components/schemas/PropertyProductIds'
        - $ref: '#/components/schemas/OwnersCorporationDocumentPropertyProductIds'
        - $ref: '#/components/schemas/EmptyProductIds'
    TitleProductIds:
      type: object
      properties:
        titleId:
          type: string
          description: >
            Title identifier, this can be either a volume/folio (eg:
            '10940/843') or an encrypted titleId (eg:

            'qp0gjuieZ5VzbNKtT/eZvqPryobRkEYxMA==' - this example is valid for
            the TEST environment only).

            The encrypted titleId's value is not guaranteed to remain stable
            over time.

            Customers should avoid relying on its persistence or consistency
            across API calls or over extended periods.
      required:
        - titleId
      example:
        titleId: 10940/843
    DocumentProductIds:
      type: object
      properties:
        documentId:
          type: string
          description: Document identifier for a plan or instrument.
      required:
        - documentId
      example:
        documentId: PS515587S
    OwnersCorporationDocumentProductIds:
      type: object
      properties:
        documentId:
          type: string
          description: Plan document identifier.
        ownersCorporationNumber:
          type: string
          description: The owners corporation number that applies to a plan.
          maxLength: 10
      required:
        - documentId
        - ownersCorporationNumber
      example:
        documentId: PS515587S
        ownersCorporationNumber: '1'
    PropertyProductIds:
      type: object
      properties:
        propertyPfi:
          type: string
          description: Unique identifier for a property.
        authorityId:
          type: integer
          description: Unique identifier for the relevant authority.
      required:
        - propertyPfi
        - authorityId
      example:
        propertyPfi: '208045633'
        authorityId: 431
    OwnersCorporationDocumentPropertyProductIds:
      type: object
      properties:
        propertyPfi:
          type: string
          description: Unique identifier for a property.
        documentId:
          type: string
          description: Plan document identifier.
        ownersCorporationNumber:
          type: string
          description: The owners corporation number that applies to a plan.
          maxLength: 10
      required:
        - propertyPfi
        - documentId
      example:
        propertyPfi: '208045633'
        documentId: PS515587S
        ownersCorporationNumber: '1'
    EmptyProductIds:
      type: object
      additionalProperties: false
      example: {}
    ExtraData:
      type: object
      properties:
        settlementDate:
          type: string
          description: Settlement date
          format: date
          example: yyyy-mm-dd
        meterReadDate:
          type: string
          description: Special meter read date
          format: date
          example: yyyy-mm-dd
        waterShareId:
          type: string
          description: >-
            Water share id. The format must be 'WEE or LTE' followed by a number
            containing 1 to 6 digits
          example: WEE123456
        landUseApplicationReason:
          type: string
          description: Reason for purchasing the product
          enum:
            - VENDOR
            - PURCHASER
            - MORTGAGEE
        postalAddress:
          $ref: '#/components/schemas/PostalAddress'
        vendors:
          type: array
          minItems: 1
          maxItems: 5
          items:
            $ref: '#/components/schemas/Vendor'
        purchasers:
          type: array
          minItems: 1
          maxItems: 5
          items:
            $ref: '#/components/schemas/Purchaser'
        ratesRequestDate:
          type: string
          description: Rates Settlement Statement request date
          format: date
          example: yyyy-mm-dd
        salePrice:
          type: integer
          description: The sale price (in dollars)
        ownersCorpManagerData:
          $ref: '#/components/schemas/OwnersCorpManagerData'
        wisNumber:
          type: integer
          maximum: 99999999
          description: Water Information Statement number
        deliverySpeed:
          type: string
          description: >-
            The delivery process used for section 151 products. The value
            determines the time it takes to deliver the product.
          enum:
            - STANDARD
            - EXPRESS
            - PRIORITY
        parcel:
          type: string
          description: Standard Parcel Identifier (SPI)
          pattern: ^[A-Z0-9~\\\\]+$
          example: 1\\PS508629
        emailFormat:
          type: string
          description: >-
            The email format used for Property Transaction Alert products. The
            value determines the email's content type to deliver the product.
          enum:
            - TEXT
            - XML
    PostalAddress:
      required:
        - recipientName
        - contactNumber
        - email
        - streetAddress
        - suburb
        - state
        - postcode
      type: object
      properties:
        recipientName:
          type: string
          description: Recipient's name
          minLength: 1
          maxLength: 120
        companyName:
          type: string
          description: Company's name
          minLength: 1
          maxLength: 120
        contactNumber:
          type: string
          description: Contact Number
          minLength: 1
          maxLength: 20
        email:
          type: string
          description: Email for tracking the mail
          minLength: 1
          maxLength: 200
        streetAddress:
          type: string
          description: Street address for the postal address
          minLength: 1
          maxLength: 200
        suburb:
          type: string
          description: Suburb for the postal address
          minLength: 1
          maxLength: 60
        state:
          type: string
          description: State for the postal address
          enum:
            - VIC
            - NSW
            - QLD
            - WA
            - SA
            - TAS
            - NT
            - ACT
        postcode:
          type: integer
          description: Postcode for the postal address. Must be within Australia
          minimum: 1000
          maximum: 9999
    Vendor:
      required:
        - vendorType
      type: object
      properties:
        vendorType:
          type: string
          enum:
            - INDIVIDUAL
            - ORGANISATION
        firstName:
          type: string
          minLength: 1
          description: >-
            First name of the proprietor or vendor. If you provide more than 15
            characters, only the first 15 characters are used.
        middleName:
          type: string
          minLength: 1
          description: >-
            Middle name of the proprietor or vendor. If you provide more than 15
            characters, only the first 15 characters are used.
        lastName:
          type: string
          minLength: 1
          description: >-
            Last name of the proprietor or vendor. If you provide more than 40
            characters, only the first 40 characters are used.
        companyName:
          type: string
          minLength: 1
          description: >-
            Company name of the proprietor or vendor. If you provide more than
            120 characters, only the first 120 characters are used.
    Purchaser:
      required:
        - purchaserType
      type: object
      properties:
        purchaserType:
          type: string
          enum:
            - INDIVIDUAL
            - ORGANISATION
        firstName:
          type: string
          minLength: 1
          description: >-
            First name of the proprietor or vendor. If you provide more than 15
            characters, only the first 15 characters are used.
        middleName:
          type: string
          minLength: 1
          description: >-
            Middle name of the proprietor or vendor. If you provide more than 15
            characters, only the first 15 characters are used.
        lastName:
          type: string
          minLength: 1
          description: >-
            Last name of the proprietor or vendor. If you provide more than 40
            characters, only the first 40 characters are used.
        companyName:
          type: string
          minLength: 1
          description: >-
            Company name of the proprietor or vendor. If you provide more than
            120 characters, only the first 120 characters are used.
    OwnersCorpManagerData:
      type: object
      properties:
        managerId:
          type: integer
          description: >-
            Unique identifier for the owners corporation manager. Applicable
            when using predetermined OC list
        managerName:
          type: string
          minLength: 1
          maxLength: 60
          description: Owners corporation manager name. Used for manual input.
        address:
          type: string
          minLength: 1
          maxLength: 120
          description: Owners corporation manager's address. Used for manual input.
        phone:
          type: string
          minLength: 1
          maxLength: 20
          description: Owners corporation manager's contact number. Used for manual input.
    DecryptTitleIdsRequest:
      type: object
      required:
        - titleIds
      properties:
        titleIds:
          type: array
          items:
            type: string
          minItems: 1
          maxItems: 10
      example:
        titleIds:
          - qp0gjuieZ5VzbNKtT/eZvqPryobRkEYxMA==
          - 5JhN+47g1efe+q3uMjyaMiRQ6ySj0844Hg==
    DecryptTitleIdsResponse:
      type: object
      required:
        - titleIds
      properties:
        titleIds:
          type: object
          additionalProperties:
            type: string
      example:
        titleIds:
          qp0gjuieZ5VzbNKtT/eZvqPryobRkEYxMA==: 10940/843
          5JhN+47g1efe+q3uMjyaMiRQ6ySj0844Hg==: 11000/100
    AlternateAddress:
      type: object
      required:
        - streetNumber
        - streetName
        - streetType
        - suburbOrTownOrLocality
        - postcode
      properties:
        unitOrFlatNumber:
          type: string
          minLength: 1
          maxLength: 10
          description: >-
            The unit or flat number of the address. Include any prefixes and
            suffixes e.g. 5B. Include the range using hyphen if required e.g.
            1B-1C.
          example: G10A
          pattern: >-
            ^([A-Za-z]{1,2})?\d{1,6}([A-Za-z]{1,2})?(?:-([A-Za-z]{1,2})?\d{1,6}([A-Za-z]{1,2})?)?$
        streetNumber:
          type: string
          minLength: 1
          maxLength: 10
          description: >-
            The street number, include any prefixes and suffixies of the street
            number e.g. 2A. Inclde the range using hyphen if required e.g.
            11-13.
          example: 23-25
          pattern: >-
            ^([A-Za-z]{1,2})?\d{1,6}([A-Za-z]{1,2})?(?:-([A-Za-z]{1,2})?\d{1,6}([A-Za-z]{1,2})?)?$
        streetName:
          type: string
          minLength: 1
          maxLength: 50
          description: The name of the street.
          example: Flinders
        streetType:
          type: string
          minLength: 1
          maxLength: 20
          description: >-
            The street type of the address e.g. Street, Road, Avenue, Court,
            Crescent
          example: Road
        suburbOrTownOrLocality:
          type: string
          minLength: 1
          maxLength: 40
          description: The suburb/town/locality of the address.
          example: Brunswick East
        postcode:
          type: integer
          description: Postcode of the address. Must be within Australia.
          minimum: 1000
          maximum: 9999
  securitySchemes:
    oauthClientCredentials:
      type: oauth2
      description: |
        OAuth 2.0 Client Credentials authentication.

        Token URLs by environment:
        - **Production**: https://auth.servictoria.com.au/oauth/token
        - **UAT/Test**: https://stg.auth.servictoria.com.au/oauth/token
      flows:
        clientCredentials:
          tokenUrl: https://auth.servictoria.com.au/oauth/token
          scopes:
            orders:write: Permission to list products and to submit an order.
            orders:read: |
              Permission to retrieve order history and results.
              Also allows querying reference extra data endpoints.
