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

# Create or update customer

> Create a new customer or update an existing one. If a customer with the given customer_number exists, it will be updated; otherwise, a new customer will be created. UUID is auto-generated if not provided.




## OpenAPI

````yaml PUT /customer/{customer_number}
openapi: 3.1.0
info:
  title: DocOpsAI API
  version: 0.1.0
  description: >
    AI-based order processing application that extracts information from email
    attachments and forwards to backend systems. Provides endpoints for order
    management, customer and product CRUD, email watching, and template
    parameter configuration.
  contact:
    name: DevOps Company
servers:
  - url: https://start.aiotic.ai
    description: Production server
security:
  - ApiKeyAuth: []
tags:
  - name: healthcheck
    description: Service health monitoring
  - name: order
    description: Order document upload and processing
  - name: order_status
    description: Order processing status tracking
  - name: customer
    description: Customer record management with vector search
  - name: product
    description: Product record management
  - name: template_parameters
    description: Prompt template parameter management
  - name: email-watcher
    description: Email inbox monitoring and processing
paths:
  /customer/{customer_number}:
    put:
      tags:
        - customer
      summary: Create or update customer
      description: >
        Create a new customer or update an existing one. If a customer with the
        given customer_number exists, it will be updated; otherwise, a new
        customer will be created. UUID is auto-generated if not provided.
      operationId: upsertCustomer
      parameters:
        - $ref: '#/components/parameters/CustomerNumberPath'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CustomerUpsert'
      responses:
        '202':
          description: Customer created or updated
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Customer'
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
components:
  parameters:
    CustomerNumberPath:
      name: customer_number
      in: path
      required: true
      description: Unique customer number (string)
      schema:
        type: string
  schemas:
    CustomerUpsert:
      type: object
      properties:
        id:
          type: string
          format: uuid
          nullable: true
          description: Internal UUID (auto-generated if not provided)
        name:
          type: string
          nullable: true
          description: Company name
        postal_code:
          type: string
          nullable: true
          description: Postal code
        city:
          type: string
          nullable: true
          description: City
        address:
          type: string
          nullable: true
          description: Street address
        contact_person:
          type: string
          nullable: true
          description: Primary contact person
        phone_number:
          type: string
          nullable: true
          description: Phone number
        vat_number:
          type: string
          nullable: true
          description: VAT/BTW number
        email:
          type: string
          nullable: true
          description: Customer email address
        coc_number:
          type: string
          nullable: true
          description: Chamber of Commerce number
        home_page:
          type: string
          nullable: true
          description: Company website URL
    Customer:
      type: object
      required:
        - number
      properties:
        number:
          type: string
          description: Customer number (external, unique)
        id:
          type: string
          format: uuid
          description: Unique customer identifier
        name:
          type: string
          nullable: true
          description: Company name
        postal_code:
          type: string
          nullable: true
          description: Postal code
        city:
          type: string
          nullable: true
          description: City
        address:
          type: string
          nullable: true
          description: Street address
        contact_person:
          type: string
          nullable: true
          description: Primary contact person
        phone_number:
          type: string
          nullable: true
          description: Phone number
        vat_number:
          type: string
          nullable: true
          description: VAT/BTW number
        email:
          type: string
          nullable: true
          description: Customer email address
        coc_number:
          type: string
          nullable: true
          description: Chamber of Commerce number
        home_page:
          type: string
          nullable: true
          description: Company website URL
        similarity:
          type: number
          format: float
          nullable: true
          description: Similarity score (only populated in search results, 0.0 to 1.0)
    ErrorResponse:
      type: object
      required:
        - detail
      properties:
        detail:
          type: string
          description: Error message describing what went wrong
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-API-Key
      description: >
        API key for authentication. Required on all endpoints except
        /healthcheck. Customer and product endpoints also accept a
        customer-specific API key.

````