---
title: "Replace NLIS device"
url: "https://stg.developer.mla.com.au/apis/device-public-staging/versions/51bbd5df-9d52-4e96-8fab-3c0fd2f54a36/operations/replaceDevice"
---

> Full API specification: https://stg.developer.mla.com.au/apis/device-public-staging/versions/51bbd5df-9d52-4e96-8fab-3c0fd2f54a36.md

# Replace NLIS device

`PUT` `/public/device/v1/replace`

Operation ID: `replaceDevice`

This API allows the invoker to replace a single/list of old NLIS device(s) with new NLIS device(s). The route takes a single/list of device(s) as an input and returns a receipt ID with a list of successfully replaced device(s).

## Header parameters

- `correlationId` (string, required) - UUID used to track the API call from the invoker's perspective. Sender is required to include the correlationId in the request to use it as a tracker for asynchronous responses.

## Request body

Content types: `application/json`

## Responses

- `200`
- `404`
- `422`

## OpenAPI definition

```yaml
openapi: 3.1.0
info:
  title: Device Public
  version: v1.0.0
servers:
  - url: https://6dc8806175.gateways.konggateway.com
paths:
  /public/device/v1/replace:
    put:
      summary: Replace NLIS device
      deprecated: false
      description: This API allows the invoker to replace a single/list of old NLIS
        device(s) with new NLIS device(s). The route takes a single/list of
        device(s) as an input and returns a receipt ID with a list of
        successfully replaced device(s).
      operationId: replaceDevice
      tags:
        - Device
      parameters:
        - name: correlationId
          in: header
          description: UUID used to track the API call from the invoker's perspective.
            Sender is required to include the correlationId in the request to
            use it as a tracker for asynchronous responses.
          required: true
          example: ""
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              type: array
              items:
                type: object
                properties:
                  oldDevice:
                    oneOf:
                      - type: object
                        properties:
                          rfid:
                            type: string
                            description: |
                              The RFID is 16 character number
                            minLength: 15
                            maxLength: 16
                        required:
                          - rfid
                      - type: object
                        properties:
                          nlisId:
                            type: string
                            description: "The NLISID is 16 character alphanumeric value. "
                            minLength: 16
                            maxLength: 16
                        required:
                          - nlisId
                  newDevice:
                    oneOf:
                      - type: object
                        properties:
                          rfid:
                            type: string
                            description: |
                              The RFID is 16 character number
                            minLength: 15
                            maxLength: 16
                        required:
                          - rfid
                      - type: object
                        properties:
                          nlisId:
                            type: string
                            description: |
                              The NLISID is 16 character alphanumeric value.
                            minLength: 16
                            maxLength: 16
                        required:
                          - nlisId
                  replacementDate:
                    type: string
                    description: Confirms the date on which the NLIS Device was replaced
                  replacementReason:
                    type: string
                    description: Allows users to capture more details as to the cause of the device
                      being lost or damaged
                required:
                  - oldDevice
                  - newDevice
                  - replacementDate
            example:
              - oldDevice:
                  rfid: 982 123489467678
                newDevice:
                  nlisId: 3MGJE153XBJ00612
                replacementDate: 01-01-2025
                replacementReason: Missing device.
      responses:
        "200":
          description: ""
          content:
            application/json:
              schema:
                type: object
                properties:
                  receiptId:
                    type: string
                  replacedDevices:
                    type: array
                    items:
                      oneOf:
                        - type: object
                          properties:
                            rfid:
                              type: string
                              description: |
                                The RFID is 16 character number
                          required:
                            - rfid
                        - type: object
                          properties:
                            nlisId:
                              type: string
                              description: |
                                The NLISID is 16 character alphanumeric value.
                          required:
                            - nlisId
                required:
                  - receiptId
                  - replacedDevices
              example:
                receiptId: i345iutyrowtyegt43wh
                replacedDevices:
                  - nlisId: 3MGJE153XBJ00612
          headers:
            correlationId:
              example: ""
              required: true
              description: UUID used to track the API call from the invoker's perspective.
                Sender is required to include the correlationId in the request
                to use it as a tracker for asynchronous responses.
              schema:
                type: string
        "404":
          description: ""
          content:
            application/json:
              schema:
                type: object
                properties: {}
          headers: {}
        "422":
          description: ""
          content:
            application/json:
              schema:
                title: ""
                type: object
                properties:
                  error:
                    type: string
                  details:
                    items:
                      $ref: "#/components/schemas/ValidationError"
                    type: array
                    title: Detail
                required:
                  - error
                  - details
          headers: {}
      security: []
security: []
components:
  schemas:
    ValidationError:
      properties:
        field:
          type: string
          title: Message
        message:
          type: string
          title: Error Type
      type: object
      required:
        - field
        - message
      title: ValidationError
```
