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

# Get a customer

> Retrieve a single customer enriched with cart, wishlist, recent orders and order stats. Requires the READ_CUSTOMERS scope.

Returns one customer with their populated user profile, current cart, wishlist, up to 5 recent orders and aggregate order stats. 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 GET /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}:
    get:
      tags:
        - Customers
      summary: Get a customer
      description: >-
        Returns a single customer enriched with their populated user profile,
        current cart, wishlist, up to 5 most recent orders and aggregate order
        stats (total orders, total spent, last order date). 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
        `READ_CUSTOMERS` scope.
      operationId: getCustomer
      parameters:
        - $ref: '#/components/parameters/CustomerId'
      responses:
        '200':
          description: >-
            The requested customer, enriched with cart, wishlist, recent orders
            and stats.
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/EnvelopeBase'
                  - type: object
                    properties:
                      data:
                        $ref: '#/components/schemas/CustomerDetail'
              example:
                status: 200
                success: true
                message: Customer retrieved
                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: '+2348012345678'
                  email: ada@example.com
                  lastActive: '2026-06-27T14:05:00.000Z'
                  online: false
                  active: true
                  createdAt: '2026-05-01T09:00:00.000Z'
                  updatedAt: '2026-06-27T14:05:00.000Z'
                  avatar: https://cdn.example.com/u/ada.png
                  cart:
                    _id: 6661aa22bb33cc44dd55ee66
                    items:
                      - product: 6659ddee0011223344556677
                        quantity: 2
                    totalPrice: 15000
                    createdAt: '2026-06-20T10:00:00.000Z'
                    updatedAt: '2026-06-27T13:00:00.000Z'
                  wishlist:
                    _id: 6662bb33cc44dd55ee66ff77
                    items:
                      - product:
                          _id: 6659ddee0011223344556677
                          name: Wireless Earbuds
                          image: https://cdn.example.com/p/earbuds.png
                          price: 7500
                  recentOrders:
                    - _id: 6663cc44dd55ee66ff7700aa
                      orderId: ORD-10421
                      status: delivered
                      subtotal: 15000
                      shippingCost: 1500
                      discount: 0
                      items:
                        - product: 6659ddee0011223344556677
                          quantity: 2
                      createdAt: '2026-06-25T11:30:00.000Z'
                  stats:
                    totalOrders: 6
                    totalSpent: 98500
                    lastOrderDate: '2026-06-25T11:30:00.000Z'
        '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:
    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.
    CustomerDetail:
      allOf:
        - $ref: '#/components/schemas/Customer'
        - type: object
          description: >-
            A customer enriched with cart, wishlist, recent orders and aggregate
            stats.
          properties:
            cart:
              type:
                - object
                - 'null'
              description: The customer's current cart.
              properties:
                _id:
                  type: string
                items:
                  type: array
                  items:
                    type: object
                    properties:
                      product:
                        type: string
                        description: Product id.
                      quantity:
                        type: integer
                totalPrice:
                  type: number
                createdAt:
                  type: string
                  format: date-time
                updatedAt:
                  type: string
                  format: date-time
            wishlist:
              type:
                - object
                - 'null'
              description: The customer's wishlist with populated products.
              properties:
                _id:
                  type: string
                items:
                  type: array
                  items:
                    type: object
                    properties:
                      product:
                        type: object
                        properties:
                          _id:
                            type: string
                          name:
                            type: string
                          image:
                            type:
                              - string
                              - 'null'
                          price:
                            type: number
            recentOrders:
              type: array
              description: Up to 5 most recent orders for this customer.
              items:
                type: object
                properties:
                  _id:
                    type: string
                  orderId:
                    type: string
                    description: Human-friendly order number.
                  status:
                    type: string
                  subtotal:
                    type: number
                  shippingCost:
                    type: number
                  discount:
                    type: number
                  items:
                    type: array
                    items:
                      type: object
                      properties:
                        product:
                          type: string
                          description: Product id.
                        quantity:
                          type: integer
                  createdAt:
                    type: string
                    format: date-time
            stats:
              type: object
              description: Aggregate order statistics for this customer.
              properties:
                totalOrders:
                  type: integer
                totalSpent:
                  type: number
                lastOrderDate:
                  type:
                    - string
                    - 'null'
                  format: date-time
    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
    Envelope:
      allOf:
        - $ref: '#/components/schemas/EnvelopeBase'
        - type: object
          properties:
            data:
              description: Operation-specific payload (object, array, or null).
    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'
  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.

````