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

# Update a customer

> Update an existing customer in the store. Requires the WRITE_CUSTOMERS scope.

Updates an existing customer; at least one field must be supplied and any new email must stay unique within the store. The id may be the customer record id or the underlying user id. The store is bound to your app token server-side — never send a shop id.


## OpenAPI

````yaml PUT /customers/{id}
openapi: 3.1.0
info:
  title: Salesive Apps API — Customers & Categories
  version: 1.0.0
  description: >-
    Read and manage the store's customers and product categories from an
    installed third-party app. Every endpoint authenticates with an
    installed-app access token (prefix `app_`) and requires a specific OAuth
    scope. The target store is bound to the token server-side from the
    installation — never send a shop id.
servers:
  - url: https://api.salesive.com/api/v1
    description: Production
security:
  - AppToken: []
paths:
  /customers/{id}:
    put:
      tags:
        - Customers
      summary: Update a customer
      description: >-
        Updates an existing customer in the store. At least one field must be
        supplied. If the email is changed it must remain unique within the
        store. The id may be the customer record id or the underlying user id.
        Returns 404 if the customer is not in this store. The store is bound to
        the app token server-side from the installation — never send a shop id.
        Requires the `WRITE_CUSTOMERS` scope.
      operationId: updateCustomer
      parameters:
        - $ref: '#/components/parameters/CustomerId'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CustomerUpdate'
            example:
              phone: '+2348099998888'
              active: false
      responses:
        '200':
          description: The updated customer.
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/EnvelopeBase'
                  - type: object
                    properties:
                      data:
                        $ref: '#/components/schemas/Customer'
              example:
                status: 200
                success: true
                message: Customer updated successfully
                data:
                  _id: 665a1f2c9b1e4a0012ab34cd
                  user:
                    _id: 6650aa11bb22cc33dd44ee55
                    name: Ada Obi
                    email: ada@example.com
                    avatar: https://cdn.example.com/u/ada.png
                  shop: 664f0e2a1c2b3d4e5f6a7b8c
                  name: Ada Obi
                  phone: '+2348099998888'
                  email: ada@example.com
                  lastActive: '2026-06-27T14:05:00.000Z'
                  online: false
                  active: false
                  createdAt: '2026-05-01T09:00:00.000Z'
                  updatedAt: '2026-06-28T08:10:00.000Z'
                  avatar: https://cdn.example.com/u/ada.png
                  id: 665a1f2c9b1e4a0012ab34cd
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/CustomerNotFound'
components:
  parameters:
    CustomerId:
      name: id
      in: path
      required: true
      description: The customer record id, or the underlying user id of the customer.
      schema:
        type: string
  schemas:
    CustomerUpdate:
      type: object
      description: >-
        Fields accepted when updating a customer. At least one field must be
        supplied.
      minProperties: 1
      properties:
        name:
          type: string
          description: Updated customer name.
        email:
          type: string
          format: email
          description: >-
            Updated email address. Must be a valid email and unique within the
            store.
        phone:
          type:
            - string
            - 'null'
          description: Updated phone number. May be null.
        user:
          type:
            - string
            - 'null'
          description: ObjectId of a linked platform user. May be null.
        active:
          type: boolean
          description: Whether the customer is active.
    EnvelopeBase:
      type: object
      description: >-
        Standard Salesive response envelope. The operation-specific payload is
        carried in `data`.
      required:
        - status
        - success
        - message
      properties:
        status:
          type: integer
          description: HTTP status code, echoed in the body.
        success:
          type: boolean
          description: Whether the request succeeded.
        message:
          type: string
          description: Human-readable result message.
    Customer:
      type: object
      description: A store-scoped customer record.
      properties:
        _id:
          type: string
        id:
          type: string
          description: Virtual alias of `_id`.
        user:
          oneOf:
            - $ref: '#/components/schemas/UserProfile'
            - type: 'null'
          description: >-
            Linked platform user, or null when the customer is not linked to a
            user.
        shop:
          type: string
          description: The store id (bound server-side).
        name:
          type: string
        phone:
          type:
            - string
            - 'null'
        email:
          type: string
        lastActive:
          type: string
          format: date-time
        online:
          type: boolean
        active:
          type: boolean
        avatar:
          type:
            - string
            - 'null'
        createdAt:
          type: string
          format: date-time
        updatedAt:
          type: string
          format: date-time
    UserProfile:
      type: object
      description: The platform user linked to the customer, when one exists.
      properties:
        _id:
          type: string
        name:
          type: string
        email:
          type: string
        avatar:
          type:
            - string
            - 'null'
    Envelope:
      allOf:
        - $ref: '#/components/schemas/EnvelopeBase'
        - type: object
          properties:
            data:
              description: Operation-specific payload (object, array, or null).
  responses:
    Unauthorized:
      description: Missing or invalid app access token.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Envelope'
          example:
            status: 401
            success: false
            message: Authentication required
            data: null
    Forbidden:
      description: The app token is missing the OAuth scope required for this operation.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Envelope'
          example:
            status: 403
            success: false
            message: Insufficient scope
            data: null
    CustomerNotFound:
      description: The customer does not exist or is not in the installation's store.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Envelope'
          example:
            status: 404
            success: false
            message: Customer not found
            data: null
  securitySchemes:
    AppToken:
      type: http
      scheme: bearer
      description: >-
        Installed-app access token (prefix app_), issued by the OAuth install
        flow. The store is bound to the token server-side — never send a shop
        id.

````