> ## 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 cliente

> Actualiza un cliente y devuelve los datos persistidos.



## OpenAPI

````yaml /api-reference/openapi.json put /api/v1/customers/{customer_id}
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/customers/{customer_id}:
    put:
      tags:
        - API
      summary: Actualizar cliente
      description: Actualiza un cliente y devuelve los datos persistidos.
      operationId: updateApiCustomer
      parameters:
        - name: customer_id
          in: path
          description: ID del cliente
          required: true
          schema:
            type: string
            format: uuid
        - name: X-Request-Id
          in: header
          description: >-
            ID opcional de la solicitud para trazabilidad. Si se omite, el
            servidor genera uno.
          required: false
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ApiCustomerUpdateRequest'
      responses:
        '200':
          description: Cliente actualizado exitosamente
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiCustomerUpdateResponse'
        '400':
          description: Solicitud inválida
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorEnvelope'
              examples:
                default:
                  summary: INVALID_REQUEST
                  value:
                    request_id: req_customer_update_1
                    error:
                      code: INVALID_REQUEST
                      message: Invalid request for updating customers
                      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_customer_update_1
                    error:
                      code: AUTHENTICATION_REQUIRED
                      message: API key is required in the Authorization header
                      retryable: false
                      type: invalid_request_error
                      details: []
        '403':
          description: Scopes insuficientes
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorEnvelope'
              examples:
                default:
                  summary: FORBIDDEN
                  value:
                    request_id: req_customer_update_1
                    error:
                      code: FORBIDDEN
                      message: Your API key does not have permission for this operation
                      retryable: false
                      type: invalid_request_error
                      details: []
        '404':
          description: Cliente o recurso relacionado inexistente
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorEnvelope'
              examples:
                default:
                  summary: NOT_FOUND
                  value:
                    request_id: req_customer_update_1
                    error:
                      code: NOT_FOUND
                      message: Customer not found
                      retryable: false
                      type: invalid_request_error
                      details: []
        '409':
          description: Conflicto de negocio
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorEnvelope'
              examples:
                default:
                  summary: CONFLICT
                  value:
                    request_id: req_customer_update_1
                    error:
                      code: CONFLICT
                      message: A customer with this document number already exists
                      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 del servidor
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorEnvelope'
              examples:
                default:
                  summary: INTERNAL_ERROR
                  value:
                    request_id: req_customer_update_1
                    error:
                      code: INTERNAL_ERROR
                      message: Could not update the customer
                      retryable: false
                      type: invalid_request_error
                      details: []
      x-codeSamples:
        - lang: typescript
          label: La Pyme SDK
          source: |
            import { Lapyme } from "lapyme";

            const lapyme = new Lapyme({
              bearerAuth: process.env["LAPYME_API_KEY"] ?? "",
            });

            const customer = await lapyme.customers.updateCustomer({
              customerId: "9c692e8b-0f9a-4f7c-8b99-061a2eb188ae",
              body: {
                email: "administracion@acme.com.ar",
              },
            });
components:
  schemas:
    ApiCustomerUpdateRequest:
      type: object
      properties:
        name:
          type: string
        company_name:
          anyOf:
            - type: string
            - type: 'null'
        description:
          anyOf:
            - type: string
            - type: 'null'
        email:
          anyOf:
            - type: string
              format: email
            - type: 'null'
        phone:
          anyOf:
            - type: string
            - type: 'null'
        tax_id:
          description: Documento sin guiones, o "0" cuando tax_id_type es "Otro"
          anyOf:
            - type: string
            - type: 'null'
        tax_id_type:
          description: '"Otro" requiere tax_id="0" y categoría efectiva Consumidor Final'
          anyOf:
            - $ref: '#/components/schemas/ApiSharedEnumcb6fc950ce'
            - type: 'null'
        tax_category:
          anyOf:
            - $ref: '#/components/schemas/ApiSharedEnumbb2864ecea'
            - type: 'null'
        country:
          anyOf:
            - type: string
            - type: 'null'
        province:
          anyOf:
            - type: string
            - type: 'null'
        city:
          anyOf:
            - type: string
            - type: 'null'
        address:
          anyOf:
            - type: string
            - type: 'null'
        apartment:
          anyOf:
            - type: string
            - type: 'null'
        postal_code:
          anyOf:
            - type: string
            - type: 'null'
        delivery_carrier:
          anyOf:
            - type: string
            - type: 'null'
        delivery_address:
          anyOf:
            - type: string
            - type: 'null'
        assigned_salesperson_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
        default_price_list_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
        payment_term_id:
          anyOf:
            - $ref: '#/components/schemas/ApiSharedEnumd34af90520'
            - type: 'null'
        payment_term_days:
          anyOf:
            - type: integer
              minimum: 0
              maximum: 365
              description: >-
                Cantidad de días hasta el vencimiento. Usá 0 para Contado. Se
                prefiere sobre paymentTermId.
            - type: 'null'
        is_active:
          type: boolean
      additionalProperties: false
    ApiCustomerUpdateResponse:
      type: object
      properties:
        request_id:
          type: string
        data:
          type: object
          properties:
            customer:
              $ref: '#/components/schemas/ApiSharedObject70cd0320c7'
          required:
            - customer
          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
    ApiSharedEnumcb6fc950ce:
      type: string
      enum:
        - CUIL/CUIT
        - DNI
        - Otro
    ApiSharedEnumbb2864ecea:
      type: string
      enum:
        - registered_vat_taxpayer
        - final_consumer
        - monotributo_taxpayer
        - vat_exempt
        - vat_not_applicable
    ApiSharedEnumd34af90520:
      type: string
      enum:
        - days_7
        - days_15
        - days_30
        - days_45
        - days_60
        - days_90
        - days_30_60
        - days_30_60_90
    ApiSharedObject70cd0320c7:
      type: object
      properties:
        object:
          type: string
          const: customer
        id:
          type: string
          format: uuid
        name:
          type: string
        company_name:
          anyOf:
            - type: string
            - type: 'null'
        description:
          anyOf:
            - type: string
            - type: 'null'
        email:
          anyOf:
            - type: string
            - type: 'null'
        phone:
          anyOf:
            - type: string
            - type: 'null'
        address:
          anyOf:
            - type: string
            - type: 'null'
        apartment:
          anyOf:
            - type: string
            - type: 'null'
        city:
          anyOf:
            - type: string
            - type: 'null'
        delivery_carrier:
          anyOf:
            - type: string
            - type: 'null'
        delivery_address:
          anyOf:
            - type: string
            - type: 'null'
        tax_id:
          anyOf:
            - type: string
            - type: 'null'
        tax_id_type:
          anyOf:
            - type: string
            - type: 'null'
        tax_category:
          anyOf:
            - type: string
            - type: 'null'
        contact_type:
          anyOf:
            - type: string
            - type: 'null'
        default_price_list_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
        payment_term_id:
          anyOf:
            - type: string
            - type: 'null'
        payment_term_days:
          anyOf:
            - type: integer
              minimum: 0
              maximum: 365
              description: >-
                Cantidad de días hasta el vencimiento. Usá 0 para Contado. Se
                prefiere sobre paymentTermId.
            - type: 'null'
        province_id:
          anyOf:
            - type: string
            - type: 'null'
        is_active:
          anyOf:
            - type: boolean
            - type: 'null'
        created_at:
          type: string
          format: date-time
        updated_at:
          type: string
          format: date-time
        tags:
          type: array
          items:
            $ref: '#/components/schemas/ApiSharedObject8a94344083'
        country:
          anyOf:
            - type: string
            - type: 'null'
        postal_code:
          anyOf:
            - type: string
            - type: 'null'
        assigned_salesperson_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
        default_ganancias_regimen:
          anyOf:
            - type: string
            - type: 'null'
        assigned_salesperson:
          anyOf:
            - $ref: '#/components/schemas/ApiSharedObjectb0fb960111'
            - type: 'null'
        default_price_list:
          anyOf:
            - $ref: '#/components/schemas/ApiSharedObject8aeeceaf0f'
            - type: 'null'
        sales_overview:
          $ref: '#/components/schemas/ApiSharedObject01ba6d4b36'
      required:
        - object
        - id
        - name
        - company_name
        - description
        - email
        - phone
        - address
        - apartment
        - city
        - delivery_carrier
        - delivery_address
        - tax_id
        - tax_id_type
        - tax_category
        - contact_type
        - default_price_list_id
        - payment_term_id
        - payment_term_days
        - province_id
        - is_active
        - created_at
        - updated_at
        - tags
        - country
        - postal_code
        - assigned_salesperson_id
        - default_ganancias_regimen
        - assigned_salesperson
        - default_price_list
        - sales_overview
      additionalProperties: false
    ApiSharedObjectc671832641:
      type: object
      properties:
        code:
          type: string
        message:
          type: string
        field:
          type: string
      required:
        - code
        - message
      additionalProperties: false
    ApiSharedObject8a94344083:
      type: object
      properties:
        object:
          type: string
          const: tag
        id:
          type: string
          format: uuid
        scope:
          $ref: '#/components/schemas/ApiSharedEnum09f8155a9a'
        name:
          type: string
        slug:
          type: string
        color:
          anyOf:
            - $ref: '#/components/schemas/ApiSharedEnum599647cb76'
            - type: 'null'
        description:
          anyOf:
            - type: string
            - type: 'null'
        archived_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
        created_at:
          type: string
          format: date-time
        updated_at:
          type: string
          format: date-time
      required:
        - object
        - id
        - scope
        - name
        - slug
        - color
        - description
        - archived_at
        - created_at
        - updated_at
      additionalProperties: false
    ApiSharedObjectb0fb960111:
      type: object
      properties:
        id:
          type: string
          format: uuid
        full_name:
          anyOf:
            - type: string
            - type: 'null'
      required:
        - id
        - full_name
      additionalProperties: false
    ApiSharedObject8aeeceaf0f:
      type: object
      properties:
        id:
          type: string
          format: uuid
        name:
          type: string
      required:
        - id
        - name
      additionalProperties: false
    ApiSharedObject01ba6d4b36:
      type: object
      properties:
        pending_balance:
          type: number
        sales_count:
          type: integer
          minimum: 0
        total_sales:
          type: number
        recent_sales:
          type: array
          items:
            $ref: '#/components/schemas/ApiSharedObject56326f33c2'
      required:
        - pending_balance
        - sales_count
        - total_sales
        - recent_sales
      additionalProperties: false
    ApiSharedEnum09f8155a9a:
      type: string
      enum:
        - customer
        - supplier
        - product
        - sale
        - purchase
        - purchase_order
        - transfer
    ApiSharedEnum599647cb76:
      type: string
      enum:
        - slate
        - red
        - orange
        - amber
        - yellow
        - lime
        - green
        - teal
        - cyan
        - blue
        - indigo
        - violet
        - pink
    ApiSharedObject56326f33c2:
      type: object
      properties:
        id:
          type: string
          format: uuid
        voucher_type:
          type: string
        invoice_status:
          type: string
        invoice_date:
          type: string
        currency:
          anyOf:
            - type: string
            - type: 'null'
        total:
          type: number
        formatted_invoice_number:
          anyOf:
            - type: string
            - type: 'null'
        original_sale_id:
          anyOf:
            - type: string
            - type: 'null'
        created_at:
          type: string
          format: date-time
      required:
        - id
        - voucher_type
        - invoice_status
        - invoice_date
        - currency
        - total
        - formatted_invoice_number
        - original_sale_id
        - created_at
      additionalProperties: false
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: API Key
      description: Incluí tu API key en el header Authorization con el prefijo Bearer.

````