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

# Lookup Customers

> Clienti con account del negozio per email, nome, azienda, NIPT o
telefono (ultime 8 cifre); solo attivi e non anonimizzati. Da R2b anche i
profili ospite (`kind: "guest"`, ORD-53). Al massimo 10, in un ordine solo.

Con `user_id` al posto di `q` (ORD-54): quell'account soltanto, nella stessa
forma, o una lista vuota se non è un cliente attivo del negozio («Nuovo
ordine per questo cliente», «Ripeti ordine», bozze locali).



## OpenAPI

````yaml https://api.vellaro.io/openapi/admin.json get /api/v1/admin/orders/lookup/customers
openapi: 3.1.0
info:
  title: Vellaro Admin API
  description: >-
    Store management under `/api/v1/admin`, for back ends and integrations.
    Every call takes `Authorization: Bearer <token>`: an admin API token or a
    staff user's token. The permissions of its role decide what it can do,
    always in its own store.
  version: 0.1.0
servers:
  - url: https://api.vellaro.io
    description: Produzione
security: []
tags:
  - name: Orders
    description: >-
      Orders and manual orders, payments, refunds, shipments, invoices, returns,
      customer subscriptions.
  - name: Products
    description: Products, variants, images, prices and discounts, product lookups.
  - name: Categories & catalog setup
    description: >-
      Categories, brands, attributes, options, filters, downloadable files,
      recurring profiles.
  - name: Inventory
    description: Stock of the variants and stock statuses.
  - name: Customers
    description: Customers, customer groups, custom fields.
  - name: Reviews & questions
    description: Moderation of product reviews and questions.
  - name: Promotions & coupons
    description: Coupons and gift vouchers.
  - name: Marketing
    description: Campaigns, newsletter subscribers, affiliates and their commissions.
  - name: Content
    description: >-
      CMS pages, menus, banners, information pages, flipbooks, media library,
      SEO URLs, email templates, translations.
  - name: Settings
    description: >-
      Store settings, email delivery, languages, currencies, physical stores,
      social login providers.
  - name: Shipping
    description: Couriers, shipping rates, weight and length classes.
  - name: Taxes & geo
    description: Tax classes, rates and rules; countries, zones and geo zones.
  - name: Integrations & modules
    description: >-
      Integrations, plugins and modules (Iute, extra warranty, Nextera, Financa
      5, WhatsApp, Firebase), outbound webhooks.
  - name: AI
    description: AI content generation and the settings of the AI shopping assistant.
  - name: Imports
    description: 'CSV imports and the universal import: runs, mappings, previews, undo.'
  - name: Reports & dashboard
    description: Dashboard figures and reports.
  - name: Users & API keys
    description: Staff users and roles, publishable keys, admin API tokens.
  - name: Audit
    description: The store's audit log.
paths:
  /api/v1/admin/orders/lookup/customers:
    get:
      tags:
        - Orders
      summary: Lookup Customers
      description: >-
        Clienti con account del negozio per email, nome, azienda, NIPT o

        telefono (ultime 8 cifre); solo attivi e non anonimizzati. Da R2b anche
        i

        profili ospite (`kind: "guest"`, ORD-53). Al massimo 10, in un ordine
        solo.


        Con `user_id` al posto di `q` (ORD-54): quell'account soltanto, nella
        stessa

        forma, o una lista vuota se non è un cliente attivo del negozio («Nuovo

        ordine per questo cliente», «Ripeti ordine», bozze locali).
      operationId: lookup_customers_api_v1_admin_orders_lookup_customers_get
      parameters:
        - name: q
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                minLength: 2
                maxLength: 100
              - type: 'null'
            title: Q
        - name: user_id
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                format: uuid
              - type: 'null'
            description: This account only, in the same shape (instead of q)
            title: User Id
          description: This account only, in the same shape (instead of q)
        - name: lang
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: Force content language (it|en|sq)
            title: Lang
          description: Force content language (it|en|sq)
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/ApiResponse_list_Annotated_Union_CustomerLookupOut__GuestLookupOut___FieldInfo_annotation_NoneType__required_True__discriminator__kind_____
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - HTTPBearer: []
components:
  schemas:
    ApiResponse_list_Annotated_Union_CustomerLookupOut__GuestLookupOut___FieldInfo_annotation_NoneType__required_True__discriminator__kind_____:
      properties:
        data:
          anyOf:
            - items:
                oneOf:
                  - $ref: '#/components/schemas/CustomerLookupOut'
                  - $ref: '#/components/schemas/GuestLookupOut'
                discriminator:
                  propertyName: kind
                  mapping:
                    account: '#/components/schemas/CustomerLookupOut'
                    guest: '#/components/schemas/GuestLookupOut'
              type: array
            - type: 'null'
          title: Data
        meta:
          anyOf:
            - $ref: '#/components/schemas/PaginationMeta'
            - type: 'null'
        error:
          anyOf:
            - type: string
            - type: 'null'
          title: Error
        error_code:
          anyOf:
            - type: string
            - type: 'null'
          title: Error Code
      type: object
      title: >-
        ApiResponse[list[Annotated[Union[CustomerLookupOut, GuestLookupOut],
        FieldInfo(annotation=NoneType, required=True, discriminator='kind')]]]
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    CustomerLookupOut:
      properties:
        kind:
          type: string
          const: account
          title: Kind
          default: account
        user_id:
          type: string
          format: uuid
          title: User Id
        full_name:
          anyOf:
            - type: string
            - type: 'null'
          title: Full Name
        email:
          type: string
          title: Email
        phones:
          items:
            type: string
          type: array
          title: Phones
        business_type:
          type: string
          title: Business Type
        company_name:
          anyOf:
            - type: string
            - type: 'null'
          title: Company Name
        tax_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Tax Id
        vat_number:
          anyOf:
            - type: string
            - type: 'null'
          title: Vat Number
        customer_group:
          anyOf:
            - $ref: '#/components/schemas/CustomerGroupRef'
            - type: 'null'
        language:
          anyOf:
            - type: string
            - type: 'null'
          title: Language
        needs_password_setup:
          type: boolean
          title: Needs Password Setup
        orders_count:
          type: integer
          title: Orders Count
        last_order_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Last Order At
        addresses:
          items:
            $ref: '#/components/schemas/LookupAddressOut'
          type: array
          title: Addresses
        recent_orders:
          items:
            $ref: '#/components/schemas/RecentOrderOut'
          type: array
          title: Recent Orders
      type: object
      required:
        - user_id
        - full_name
        - email
        - phones
        - business_type
        - company_name
        - tax_id
        - vat_number
        - customer_group
        - language
        - needs_password_setup
        - orders_count
        - last_order_at
        - addresses
        - recent_orders
      title: CustomerLookupOut
    GuestLookupOut:
      properties:
        kind:
          type: string
          const: guest
          title: Kind
          default: guest
        full_name:
          anyOf:
            - type: string
            - type: 'null'
          title: Full Name
        email:
          anyOf:
            - type: string
            - type: 'null'
          title: Email
        phone:
          anyOf:
            - type: string
            - type: 'null'
          title: Phone
        orders_count:
          type: integer
          title: Orders Count
        last_order_at:
          type: string
          format: date-time
          title: Last Order At
        addresses:
          items:
            $ref: '#/components/schemas/GuestAddressOut'
          type: array
          title: Addresses
        recent_orders:
          items:
            $ref: '#/components/schemas/RecentOrderOut'
          type: array
          title: Recent Orders
      type: object
      required:
        - full_name
        - email
        - phone
        - orders_count
        - last_order_at
        - addresses
        - recent_orders
      title: GuestLookupOut
      description: >-
        Un profilo ospite (ORD-53): gli ordini senza account con la stessa email

        o lo stesso telefono. Si sceglie come «ospite» con i suoi contatti, mai
        come

        un account.
    PaginationMeta:
      properties:
        page:
          type: integer
          title: Page
        page_size:
          type: integer
          title: Page Size
        total:
          type: integer
          title: Total
        total_pages:
          type: integer
          title: Total Pages
      type: object
      required:
        - page
        - page_size
        - total
        - total_pages
      title: PaginationMeta
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
    CustomerGroupRef:
      properties:
        id:
          type: string
          format: uuid
          title: Id
        name:
          anyOf:
            - type: string
            - type: 'null'
          title: Name
        is_active:
          type: boolean
          title: Is Active
      type: object
      required:
        - id
        - name
        - is_active
      title: CustomerGroupRef
    LookupAddressOut:
      properties:
        first_name:
          type: string
          title: First Name
        last_name:
          type: string
          title: Last Name
        company:
          anyOf:
            - type: string
            - type: 'null'
          title: Company
        address_line1:
          type: string
          title: Address Line1
        address_line2:
          anyOf:
            - type: string
            - type: 'null'
          title: Address Line2
        city:
          type: string
          title: City
        state:
          anyOf:
            - type: string
            - type: 'null'
          title: State
        postal_code:
          type: string
          title: Postal Code
        country:
          type: string
          title: Country
        phone:
          anyOf:
            - type: string
            - type: 'null'
          title: Phone
        id:
          type: string
          format: uuid
          title: Id
        is_default:
          type: boolean
          title: Is Default
      type: object
      required:
        - first_name
        - last_name
        - address_line1
        - city
        - postal_code
        - country
        - id
        - is_default
      title: LookupAddressOut
      description: Un indirizzo salvato, già nella forma dell'ordine (`AddressSchema`).
    RecentOrderOut:
      properties:
        id:
          type: string
          format: uuid
          title: Id
        reference:
          type: string
          title: Reference
        created_at:
          type: string
          format: date-time
          title: Created At
        total:
          type: string
          pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$
          title: Total
        currency:
          type: string
          title: Currency
      type: object
      required:
        - id
        - reference
        - created_at
        - total
        - currency
      title: RecentOrderOut
    GuestAddressOut:
      properties:
        first_name:
          type: string
          title: First Name
        last_name:
          type: string
          title: Last Name
        company:
          anyOf:
            - type: string
            - type: 'null'
          title: Company
        address_line1:
          type: string
          title: Address Line1
        address_line2:
          anyOf:
            - type: string
            - type: 'null'
          title: Address Line2
        city:
          type: string
          title: City
        state:
          anyOf:
            - type: string
            - type: 'null'
          title: State
        postal_code:
          type: string
          title: Postal Code
        country:
          type: string
          title: Country
        phone:
          anyOf:
            - type: string
            - type: 'null'
          title: Phone
        id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Id
        is_default:
          type: boolean
          title: Is Default
          default: true
      type: object
      required:
        - first_name
        - last_name
        - address_line1
        - city
        - postal_code
        - country
      title: GuestAddressOut
      description: |-
        L'indirizzo dell'ultimo ordine spedito di un profilo ospite: senza id
        (non è una rubrica) e già scelto.
  securitySchemes:
    HTTPBearer:
      type: http
      scheme: bearer

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.