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

# Actualizar campos personalizados de un producto

> Actualiza solo las claves enviadas. Un string asigna el valor y null lo elimina. Los valores pertenecen al grupo y se comparten entre variantes. Requiere plan Max o Enterprise.



## OpenAPI

````yaml /api-reference/openapi.json patch /api/v1/products/{product_id}/metafields
openapi: 3.1.0
info:
  title: La Pyme API
  description: >-
    Resources and workflows for purchases, sales, inventory, contacts, products,
    reports, and settings.
  version: 1.0.0
  contact:
    name: La Pyme Support
    email: hola@lapyme.com.ar
  license:
    name: Proprietary
    url: https://lapyme.com.ar/terminos
servers:
  - url: https://api.lapyme.com.ar
    description: Servidor de producción
security:
  - bearerAuth: []
tags:
  - name: API
    description: Public API operations for La Pyme integrations.
paths:
  /api/v1/products/{product_id}/metafields:
    patch:
      tags:
        - API
      summary: Actualizar campos personalizados de un producto
      description: >-
        Actualiza solo las claves enviadas. Un string asigna el valor y null lo
        elimina. Los valores pertenecen al grupo y se comparten entre variantes.
        Requiere plan Max o Enterprise.
      operationId: patchApiProductMetafields
      parameters:
        - name: product_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ApiProductMetafieldPatchRequest'
      responses:
        '200':
          description: Campos actualizados exitosamente
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiProductUpdateResponse'
        '400':
          description: Solicitud o valor inválido
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorEnvelope'
              examples:
                default:
                  summary: INVALID_REQUEST
                  value:
                    request_id: req_product_metafields_patch_1
                    error:
                      code: INVALID_REQUEST
                      message: Invalid product metafield request
                      retryable: false
                      type: invalid_request_error
                      details: []
        '401':
          description: API key faltante o inválida
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorEnvelope'
              examples:
                default:
                  summary: AUTHENTICATION_REQUIRED
                  value:
                    request_id: req_product_metafields_patch_1
                    error:
                      code: AUTHENTICATION_REQUIRED
                      message: Authentication required
                      retryable: false
                      type: invalid_request_error
                      details: []
        '403':
          description: Scope insuficiente o plan no habilitado
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorEnvelope'
              examples:
                default:
                  summary: FORBIDDEN
                  value:
                    request_id: req_product_metafields_patch_1
                    error:
                      code: FORBIDDEN
                      message: Product custom fields require Max or Enterprise
                      retryable: false
                      type: invalid_request_error
                      details: []
        '404':
          description: Producto no encontrado
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorEnvelope'
              examples:
                default:
                  summary: NOT_FOUND
                  value:
                    request_id: req_product_metafields_patch_1
                    error:
                      code: NOT_FOUND
                      message: Product not found
                      retryable: false
                      type: invalid_request_error
                      details: []
        '429':
          description: Límite de solicitudes excedido para la organización
          headers:
            Retry-After:
              description: Segundos a esperar antes de volver a intentar la solicitud.
              schema:
                type: string
                example: '30'
            X-RateLimit-Limit:
              description: Límite de la ventana activa.
              schema:
                type: string
                example: '5000'
            X-RateLimit-Remaining:
              description: Solicitudes restantes en la ventana activa.
              schema:
                type: string
                example: '0'
            X-RateLimit-Reset:
              description: Segundos restantes hasta el reset de la ventana activa.
              schema:
                type: string
                example: '30'
            RateLimit-Limit:
              description: Límite de la ventana activa en formato estándar.
              schema:
                type: string
                example: '5000'
            RateLimit-Remaining:
              description: Solicitudes restantes en la ventana activa en formato estándar.
              schema:
                type: string
                example: '0'
            RateLimit-Reset:
              description: >-
                Segundos hasta el reset de la ventana activa en formato
                estándar.
              schema:
                type: string
                example: '30'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorEnvelope'
              examples:
                default:
                  summary: RATE_LIMITED
                  value:
                    request_id: req_rate_limit_1
                    error:
                      type: rate_limit_error
                      code: RATE_LIMITED
                      message: >-
                        The organization request limit was reached. Try again
                        later.
                      retryable: true
                      details: []
        '500':
          description: Error interno
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorEnvelope'
              examples:
                default:
                  summary: INTERNAL_ERROR
                  value:
                    request_id: req_product_metafields_patch_1
                    error:
                      code: INTERNAL_ERROR
                      message: Could not update product metafields
                      retryable: false
                      type: invalid_request_error
                      details: []
components:
  schemas:
    ApiProductMetafieldPatchRequest:
      type: object
      properties:
        entries:
          minItems: 1
          maxItems: 100
          type: array
          items:
            type: object
            properties:
              key:
                type: string
              value:
                anyOf:
                  - type: string
                  - type: 'null'
            required:
              - key
              - value
            additionalProperties: false
      required:
        - entries
      additionalProperties: false
    ApiProductUpdateResponse:
      type: object
      properties:
        request_id:
          type: string
        data:
          type: object
          properties:
            product:
              $ref: '#/components/schemas/ApiSharedObjectc99e480838'
          required:
            - product
          additionalProperties: false
        warnings:
          type: array
          items: {}
      required:
        - request_id
        - data
        - warnings
      additionalProperties: false
    ApiErrorEnvelope:
      type: object
      properties:
        request_id:
          type: string
        error:
          type: object
          properties:
            type:
              type: string
              enum:
                - api_error
                - authentication_error
                - authorization_error
                - business_error
                - external_dependency_error
                - idempotency_error
                - invalid_request_error
                - rate_limit_error
            code:
              type: string
            message:
              type: string
            retryable:
              type: boolean
            details:
              type: array
              items:
                $ref: '#/components/schemas/ApiSharedObjectc671832641'
          required:
            - type
            - code
            - message
            - retryable
            - details
          additionalProperties: false
      required:
        - request_id
        - error
      additionalProperties: false
    ApiSharedObjectc99e480838:
      type: object
      properties:
        id:
          type: string
          format: uuid
        name:
          type: string
        description:
          anyOf:
            - type: string
            - type: 'null'
        category:
          anyOf:
            - $ref: '#/components/schemas/ApiSharedObject8aeeceaf0f'
            - type: 'null'
        sku:
          type: string
        barcode:
          anyOf:
            - type: string
            - type: 'null'
        currency:
          type: string
        cost:
          type: number
        price:
          type: number
        tax_rate:
          $ref: '#/components/schemas/ApiSharedObjectee5eae48b0'
        default_supplier:
          anyOf:
            - $ref: '#/components/schemas/ApiSharedObject8aeeceaf0f'
            - type: 'null'
        product_type:
          $ref: '#/components/schemas/ApiSharedEnumff49232140'
        is_active:
          type: boolean
        organization_slug:
          type: string
        created_at:
          type: string
          format: date-time
        updated_at:
          type: string
          format: date-time
        effective_price:
          type: number
        price_source:
          $ref: '#/components/schemas/ApiSharedEnumfe93f70a59'
        applied_price_list:
          $ref: '#/components/schemas/ApiSharedObjectfc277c542a'
        object:
          type: string
          const: product
        variant_group_id:
          type: string
          format: uuid
        variant_options:
          anyOf:
            - type: object
              additionalProperties:
                type: string
            - type: 'null'
        is_exempt:
          type: boolean
        metafields:
          type: array
          items:
            $ref: '#/components/schemas/ApiSharedObject0347948139'
        stock_summary:
          $ref: '#/components/schemas/ApiSharedObjecta9f7340006'
      required:
        - id
        - name
        - description
        - category
        - sku
        - barcode
        - currency
        - cost
        - price
        - tax_rate
        - default_supplier
        - product_type
        - is_active
        - organization_slug
        - created_at
        - updated_at
        - object
        - variant_group_id
        - variant_options
        - is_exempt
        - metafields
        - stock_summary
      additionalProperties: false
    ApiSharedObjectc671832641:
      type: object
      properties:
        code:
          type: string
        message:
          type: string
        field:
          type: string
      required:
        - code
        - message
      additionalProperties: false
    ApiSharedObject8aeeceaf0f:
      type: object
      properties:
        id:
          type: string
          format: uuid
        name:
          type: string
      required:
        - id
        - name
      additionalProperties: false
    ApiSharedObjectee5eae48b0:
      type: object
      properties:
        id:
          type: number
        value:
          type: number
      required:
        - id
        - value
      additionalProperties: false
    ApiSharedEnumff49232140:
      type: string
      enum:
        - product
        - service
        - combo
        - kit
    ApiSharedEnumfe93f70a59:
      type: string
      enum:
        - automatic
        - manual_override
        - manual_fallback
        - base
    ApiSharedObjectfc277c542a:
      type: object
      properties:
        id:
          type: string
          format: uuid
        name:
          type: string
        is_automatic:
          type: boolean
        automatic_pricing_mode:
          $ref: '#/components/schemas/ApiSharedEnum3c5633618c'
        adjustment_percentage:
          anyOf:
            - type: number
            - type: 'null'
        tax_inclusive:
          type: boolean
      required:
        - id
        - name
        - is_automatic
        - automatic_pricing_mode
        - adjustment_percentage
        - tax_inclusive
      additionalProperties: false
    ApiSharedObject0347948139:
      type: object
      properties:
        key:
          type: string
        value:
          type: string
      required:
        - key
        - value
      additionalProperties: false
    ApiSharedObjecta9f7340006:
      type: object
      properties:
        total_quantity:
          type: number
        warehouse_count:
          type: integer
          minimum: 0
        by_warehouse:
          type: array
          items:
            $ref: '#/components/schemas/ApiSharedObjectf20bf16616'
      required:
        - total_quantity
        - warehouse_count
        - by_warehouse
      additionalProperties: false
    ApiSharedEnum3c5633618c:
      type: string
      enum:
        - base_price_adjustment
        - cost_markup
    ApiSharedObjectf20bf16616:
      type: object
      properties:
        warehouse_id:
          type: string
          format: uuid
        warehouse_name:
          type: string
        quantity:
          type: number
        on_hand:
          type: number
        reserved_quantity:
          type: number
        incoming_quantity:
          type: number
      required:
        - warehouse_id
        - warehouse_name
        - quantity
        - on_hand
        - reserved_quantity
        - incoming_quantity
      additionalProperties: false
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: API Key
      description: Incluí tu API key en el header Authorization con el prefijo Bearer.

````