> ## Documentation Index
> Fetch the complete documentation index at: https://docs.loopreturns.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Update Product

> Update a product.



## OpenAPI

````yaml put /products/{id}
openapi: 3.1.0
info:
  title: Products API
  version: v1
  description: >-
    The Products API allows managing your shop's products within the Loop
    Platform.


    ### Resource identifier format


    Resource identifiers (the `id` field and related global-identifier fields)
    are returned as JSON

    integers by default. To receive them as strings instead, send the

    `X-Loop-Global-Identifier-Type: string` request header.
  contact:
    name: Loop Returns
    url: https://loopreturns.com/
servers:
  - url: https://api.loopreturns.com/api/v1
security: []
tags:
  - name: Products
  - name: Product Variants
paths:
  /products/{id}:
    parameters:
      - schema:
          type: integer
        name: id
        in: path
        required: true
        description: The product's unique identifier.
    put:
      tags:
        - Products
      summary: Update Product
      description: Update a product.
      operationId: update-product
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateProductRequest'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  product:
                    $ref: '#/components/schemas/ProductResponse'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
      security:
        - write: []
components:
  schemas:
    UpdateProductRequest:
      title: UpdateProductRequest
      type: object
      properties:
        name:
          type: string
          maxLength: 255
        source:
          type:
            - string
            - 'null'
          maxLength: 255
        external_id:
          type:
            - string
            - 'null'
          maxLength: 100
          examples:
            - 564400c7-7a6b-4f29-b6a5-7bb580b2992c
          description: >-
            The provided `external_id` must be unique. If a non-unique
            `external_id` is provided, the API will respond with an error.
        sales_channel:
          type: string
          maxLength: 255
          description: >-
            If a channel with this name is not already associated with the shop,
            it will be used to create a new channel.
        sku:
          type:
            - string
            - 'null'
          examples:
            - SHOES-US44-M-Brwn
          maxLength: 255
        weight_grams:
          type:
            - integer
            - 'null'
          description: The weight of the product in grams.
          examples:
            - 440
        barcode:
          type:
            - string
            - 'null'
          maxLength: 255
          description: The barcode of the product.
          examples:
            - 712345000019
        description:
          maxLength: 65000
          type:
            - string
            - 'null'
        type:
          type:
            - string
            - 'null'
          maxLength: 255
        vendor:
          type:
            - string
            - 'null'
          maxLength: 255
        price:
          anyOf:
            - $ref: '#/components/schemas/MoneySet'
            - type: 'null'
          description: >-
            The price of the product in minor units, such as cents, with its
            corresponding currency.
        created_at:
          type:
            - string
            - 'null'
          format: date-time
          examples:
            - '2023-04-25T13:25:00-05:00'
        updated_at:
          type:
            - string
            - 'null'
          examples:
            - '2023-04-25T13:45:00-05:00'
          format: date-time
          description: The value must be equal to or greater than `created_at`.
        options:
          type:
            - array
            - 'null'
          description: The provided array will overwrite the existing set of options.
          items:
            $ref: '#/components/schemas/ProductOption'
        images:
          type:
            - array
            - 'null'
          description: The provided array will overwrite the existing set of images.
          items:
            type: string
            format: uri
            examples:
              - https://example.com/example.jpg
            minLength: 1
        tags:
          type:
            - array
            - 'null'
          description: The provided array will overwrite the existing set of tags.
          items:
            type: string
            minLength: 1
            maxLength: 255
            examples:
              - shoes
        is_gift_card:
          type:
            - boolean
            - 'null'
          description: Whether the product is a gift card.
          examples:
            - false
      required:
        - sales_channel
    ProductResponse:
      title: ProductResponse
      type: object
      properties:
        id:
          type: integer
          format: int64
          minimum: 1
          examples:
            - 810772
          readOnly: true
          description: The unique integer identifier for the product, created by Loop.
        external_id:
          type:
            - string
            - 'null'
          examples:
            - 564400c7-7a6b-4f29-b6a5-7bb580b2992c
          description: The identifier used by an external source to identify the product.
        sales_channel:
          type: string
          description: The name of the channel.
        sku:
          type:
            - string
            - 'null'
          examples:
            - SHOES-US44-M-Brwn
          description: The SKU of the product.
        name:
          type: string
          description: The name of the product.
          examples:
            - Classic Brown Dress Shoes
        weight_grams:
          type:
            - integer
            - 'null'
          format: int32
          examples:
            - 440
          description: The weight of the product in grams.
        barcode:
          type:
            - string
            - 'null'
          examples:
            - 712345000019
          description: The barcode of the product.
        description:
          maxLength: 65000
          type:
            - string
            - 'null'
          description: The description of the product.
        type:
          type:
            - string
            - 'null'
          examples:
            - shoes
          description: >-
            The "type" of the product. This is a single value used to classify
            and group similar products.
        vendor:
          type:
            - string
            - 'null'
          examples:
            - Internal
          description: The manufacturer or seller of the product.
        price:
          anyOf:
            - $ref: '#/components/schemas/MoneySet'
            - type: 'null'
          description: >-
            The price of the product in minor units, such as cents, with its
            corresponding currency.
        created_at:
          type:
            - string
            - 'null'
          format: date-time
          examples:
            - '2023-04-25T13:25:00-05:00'
          description: The date and time at which the product was created.
        updated_at:
          type:
            - string
            - 'null'
          examples:
            - '2023-04-25T13:45:00-05:00'
          format: date-time
          description: >-
            The date and time at which the product was updated. The value must
            be equal to or greater than `created_at`.
        collections:
          type:
            - array
            - 'null'
          items:
            $ref: '#/components/schemas/Collection'
          description: >-
            A grouping of products which can be used to organize a merchant's
            shop.
        options:
          type:
            - array
            - 'null'
          items:
            $ref: '#/components/schemas/ProductOption'
          description: >-
            An array of optional features or characteristics of the product that
            can be selected by the customer.
        images:
          type:
            - array
            - 'null'
          items:
            type: string
            format: uri
            examples:
              - https://example.com/example.jpg
          description: An array of links to images of the product.
        tags:
          type:
            - array
            - 'null'
          items:
            type: string
            examples:
              - shoes
          description: An array of tags used to classify and group products.
        source:
          type:
            - string
            - 'null'
          examples:
            - Shopify
          description: The ecommerce platform from which the product is available.
        default_variant_id:
          type:
            - integer
            - 'null'
          format: int64
          examples:
            - 810773
          description: >-
            The global identifier (created by Loop) of the product's default
            variant. Present only when the product has no explicit variants;
            null otherwise.
    MoneySet:
      type: object
      examples:
        - amount: 50000
          currency_code: USD
        - amount: 25000
        - amount: 1500
          currency_code: EUR
      properties:
        amount:
          type: integer
          format: int32
          examples:
            - 25000
        currency_code:
          type: string
          default: USD
          examples:
            - EUR
      required:
        - amount
        - currency_code
    ProductOption:
      title: ProductOption
      type: object
      properties:
        position:
          type: integer
          format: int32
          examples:
            - 1
        values:
          type: array
          items:
            type: string
            examples:
              - red
              - green
              - blue
        name:
          type: string
          examples:
            - Colors
      required:
        - position
        - values
        - name
    Collection:
      title: Collection
      type: object
      properties:
        id:
          type: integer
          format: int64
          examples:
            - 891009
          minimum: 1
          readOnly: true
        external_id:
          type:
            - string
            - 'null'
          examples:
            - 62291d16-9b61-4fbb-b868-21c2d32dc155
        name:
          type: string
  responses:
    Unauthorized:
      description: >-
        Example response if request submitted without a valid API Key in
        X-Authorization.
      content:
        application/json:
          schema:
            type: object
            required:
              - errors
            properties:
              errors:
                type: string
                examples:
                  - Unauthorized.
      headers:
        X-Loop-Request-ID:
          schema:
            type: string
            examples:
              - 5a748e7c-5fcc-4fb0-a777-6a4d28e60d4c
            format: uuid
          description: UUID to aid in debugging API issues
    NotFound:
      description: The requested entity could not be found.
      content:
        application/json:
          schema:
            type: object
            required:
              - message
            properties:
              message:
                type: string
                examples:
                  - Resource not found.
      headers:
        X-Loop-Request-ID:
          schema:
            type: string
          description: UUID to aid in debugging API issues
  securitySchemes:
    write:
      name: X-Authorization
      type: apiKey
      in: header
      description: 'API Scope: "Product (write)"'

````