---
title: "Updates Product Barcode by Product id and Product Barcode id."
url: "https://developer.retailexpress.com.au/apis/retail-express-api-21-v2/versions/210b509a-613e-44ac-a87b-ef6c22c23a2c/operations/put-products-id-barcodes-barcode_id"
---

> Full API specification: https://developer.retailexpress.com.au/apis/retail-express-api-21-v2/versions/210b509a-613e-44ac-a87b-ef6c22c23a2c.md

# Updates Product Barcode by Product id and Product Barcode id.

`PUT` `/products/{id}/barcodes/{barcode_id}`

Operation ID: `put-products-id-barcodes-barcode_id`

Sample request: PUT /products/2/barcodes/1 { "barcode": "BARCODENAME1", "enabled": true }

## Path parameters

- `id` (integer, int32, required) - Product id
- `barcode_id` (integer, int32, required) - Product Barcode id

## Header parameters

- `x-api-key` (string, required) - Api subscription key
- `Cache-Control` (string, optional)
- `Authorization` (string, required) - Bearer token for authorization (e.g., Bearer <token>)

## Request body

Content types: `application/json`

## Responses

- `200` - Product Barcode was updated
- `400` - Bad request
- `401` - Unauthorized
- `403` - Forbidden
- `404` - Not Found

## OpenAPI definition

```yaml
openapi: 3.0.1
info:
  title: Retail Express API
  version: v2.1
servers:
  - url: https://api.retailexpress.com.au/v2.1
paths:
  /products/{id}/barcodes/{barcode_id}:
    put:
      tags:
        - products
      summary: Updates Product Barcode by Product id and Product Barcode id.
      description: "Sample request:\r

        \            \r

        \    PUT /products/2/barcodes/1\r

        \     {\r

        \        \"barcode\": \"BARCODENAME1\", \r

        \        \"enabled\": true\r

        \     }"
      operationId: put-products-id-barcodes-barcode_id
      parameters:
        - name: id
          in: path
          description: Product id
          required: true
          schema:
            type: integer
            description: Product id
            format: int32
        - name: barcode_id
          in: path
          description: Product Barcode id
          required: true
          schema:
            type: integer
            description: Product Barcode id
            format: int32
        - name: x-api-key
          in: header
          description: Api subscription key
          required: true
          schema:
            type: string
        - name: Cache-Control
          in: header
          required: false
          schema:
            type: string
            default: no-cache
        - name: Authorization
          in: header
          required: true
          description: Bearer token for authorization (e.g., Bearer <token>)
          schema:
            type: string
      requestBody:
        description: Product Barcode model
        content:
          application/json:
            schema:
              title: EmptyExample
              type: object
              additionalProperties: false
      responses:
        "200":
          description: Product Barcode was updated
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ProductBarcode"
              example:
                id: 0
                barcode: string
                enabled: true
                product_id: 0
                created_on: string
                modified_on: string
        "400":
          description: Bad request
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ProblemDetails"
              example:
                type: string
                title: string
                status: 0
                detail: string
                instance: string
        "401":
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ProblemDetails"
              example:
                type: string
                title: string
                status: 0
                detail: string
                instance: string
        "403":
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ProblemDetails"
              example:
                type: string
                title: string
                status: 0
                detail: string
                instance: string
        "404":
          description: Not Found
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ProblemDetails"
              example:
                type: string
                title: string
                status: 0
                detail: string
                instance: string
security: []
components:
  schemas:
    ProductBarcode:
      title: ""
      required:
        - barcode
      type: object
      properties:
        id:
          type: integer
          description: Product Barcode id.
          format: int32
          nullable: true
        barcode:
          maxLength: 50
          minLength: 0
          pattern: ^[A-Za-z\d/-]*$
          type: string
          description: Product Barcode name.
        enabled:
          type: boolean
          description: Product Barcode enabled.
        product_id:
          type: integer
          description: Product id
          format: int32
        created_on:
          type: string
          description: Date of creation of Product Barcode
          format: date-time
        modified_on:
          type: string
          description: Date of last modification of Product Barcode
          format: date-time
      additionalProperties: false
      description: Product Barcode model
    ProblemDetails:
      title: ""
      type: object
      properties:
        type:
          type: string
          nullable: true
        title:
          type: string
          nullable: true
        status:
          type: integer
          format: int32
          nullable: true
        detail:
          type: string
          nullable: true
        instance:
          type: string
          nullable: true
      additionalProperties: {}
```
