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

# Bulk Upsert Customers

> Creates or updates up to 100 customers in one call and waits for the write to finish. A customer is matched by id or reference_id; no match creates a new customer. A present contacts or addresses list is the full published set ([] archives all); omit the key to leave stored rows unchanged.



## OpenAPI

````yaml post /v1/customers/bulk
openapi: 3.1.0
info:
  description: Client-facing Open APIs for WizCommerce
  title: WizCommerce Open API's
  termsOfService: https://wizcommerce.com/terms/
  contact:
    name: Tech Support
    url: https://help.wizcommerce.com/
    email: tech@wizcommerce.com
  license:
    name: MIT
    url: https://opensource.org/licenses/MIT
  version: '1.0'
servers:
  - url: https://api.wizcommerce.com
    description: Production BaseURL
  - url: https://api-staging.sourcerer.tech
    description: Staging BaseURL
security: []
paths:
  /v1/customers/bulk:
    post:
      tags:
        - Customer
      summary: Bulk Upsert Customers
      description: >-
        Creates or updates up to 100 customers in one call and waits for the
        write to finish. A customer is matched by id or reference_id; no match
        creates a new customer. A present contacts or addresses list is the full
        published set ([] archives all); omit the key to leave stored rows
        unchanged.
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/bulkdto.BulkCustomerRequest'
        description: 1-100 items; body must not exceed 10 MiB
        required: true
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/bulkdto.BulkCustomerResponse'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/errors.HttpError'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/errors.HttpError'
        '413':
          description: Request Entity Too Large
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/errors.HttpError'
        '422':
          description: Unprocessable Entity
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/errors.HttpError'
        '429':
          description: Too Many Requests
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/errors.HttpError'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/errors.HttpError'
        '502':
          description: Bad Gateway
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/errors.HttpError'
        '504':
          description: Gateway Timeout
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/errors.HttpError'
      security:
        - ApiKeyAuth: []
components:
  schemas:
    bulkdto.BulkCustomerRequest:
      type: object
      required:
        - data
      properties:
        data:
          description: 1-100 customers. Body must not exceed 10 MiB.
          type: array
          maxItems: 100
          minItems: 1
          items:
            $ref: '#/components/schemas/bulkdto.BulkCustomer'
    bulkdto.BulkCustomerResponse:
      type: object
      properties:
        data:
          description: One entry per written customer, in request order.
          type: array
          items:
            $ref: '#/components/schemas/bulkdto.BulkCustomerResult'
    errors.HttpError:
      type: object
      properties:
        code:
          type: string
          x-order: '1'
        message:
          type: string
          x-order: '2'
        details:
          type: array
          items:
            $ref: '#/components/schemas/errors.HttpErrorDetails'
          x-order: '3'
    bulkdto.BulkCustomer:
      type: object
      properties:
        id:
          description: Existing customer id (UUID). Updates that customer.
          type: string
          x-order: '1'
          example: 7b0d6c1e-3a52-4c8f-9f0e-1d2c3b4a5f60
        reference_id:
          description: >-
            Your system's id. Matches an existing customer to update, else
            creates one. Send it so retries never create duplicates.
          type: string
          x-order: '2'
          example: CUST-1001
        company_name:
          type: string
          x-order: '3'
          example: Acme Home Retail
        display_name:
          type: string
          x-order: '4'
          example: Acme Home
        display_id:
          type: string
          x-order: '5'
          example: ACME-01
        first_name:
          type: string
          x-order: '6'
          example: Asha
        last_name:
          type: string
          x-order: '7'
          example: Rao
        email:
          type: string
          x-order: '8'
          example: asha@acmehome.com
        phone:
          type: string
          x-order: '9'
          example: '+14155550101'
        status:
          description: 'Create: omitted means active. Update: omitted leaves it unchanged.'
          type: string
          enum:
            - active
            - inactive
          x-order: '10'
          example: active
        customer_type:
          type: string
          x-order: '11'
          example: Retailer
        assigned_sales_rep_ids:
          description: >-
            Sales rep UUIDs. Unknown or blank values fall back to the tenant
            default.
          type: array
          items:
            type: string
          x-order: '12'
          example:
            - 5a6b7c8d-1e2f-4a3b-9c8d-7e6f5a4b3c2d
        assigned_sales_rep_reference_ids:
          description: Alternative to assigned_sales_rep_ids.
          type: array
          items:
            type: string
          x-order: '13'
          example:
            - REP-07
        assigned_price_list_id:
          description: Price list UUID. Unknown or blank falls back to the tenant default.
          type: string
          x-order: '14'
          example: 9c8b7a6d-5e4f-4a3b-8c2d-1e0f9a8b7c6d
        assigned_price_list_reference_id:
          description: Alternative to assigned_price_list_id.
          type: string
          x-order: '15'
          example: WHOLESALE
        payment_term:
          type: string
          x-order: '16'
          example: Net 30
        payment_mode:
          type: string
          x-order: '17'
          example: Credit Card
        shipping_method:
          type: string
          x-order: '18'
          example: Ground
        freight_term:
          type: string
          x-order: '19'
          example: Prepaid
        tax_rate:
          type: number
          x-order: '20'
          example: 8.25
        sale_price_adjustment_percentage:
          type: number
          x-order: '21'
          example: 5
        addresses:
          description: >-
            Full published set: addresses not in the list are archived, []
            archives all. Omit the key to leave stored addresses unchanged.
          type: array
          items:
            $ref: '#/components/schemas/bulkdto.BulkCustomerAddress'
          x-order: '22'
        contacts:
          description: >-
            Full published set: contacts not in the list are archived, []
            archives all. Omit the key to leave stored contacts unchanged.
          type: array
          items:
            $ref: '#/components/schemas/bulkdto.BulkCustomerContact'
          x-order: '23'
        attributes:
          description: >-
            Custom customer attributes. Unknown attributes are skipped with a
            warning.
          type: array
          items:
            $ref: '#/components/schemas/bulkdto.BulkAttribute'
          x-order: '24'
    bulkdto.BulkCustomerResult:
      type: object
      properties:
        id:
          type: string
          x-order: '1'
          example: 7b0d6c1e-3a52-4c8f-9f0e-1d2c3b4a5f60
        reference_id:
          type: string
          x-order: '2'
          example: CUST-1001
        display_id:
          type: string
          x-order: '3'
          example: ACME-01
        warnings:
          description: Present only when some attributes were skipped.
          type: array
          items:
            $ref: '#/components/schemas/bulkdto.BulkWarning'
          x-order: '4'
    errors.HttpErrorDetails:
      type: object
      properties:
        field:
          type: string
          x-order: '1'
        reason:
          type: string
          x-order: '2'
    bulkdto.BulkCustomerAddress:
      type: object
      required:
        - type
      properties:
        id:
          type: string
          x-order: '1'
          example: c2d3e4f5-a6b7-4c8d-9e0f-1a2b3c4d5e6f
        reference_id:
          type: string
          x-order: '2'
          example: CUST-1001-BILL
        type:
          type: string
          enum:
            - billing
            - shipping
          x-order: '3'
          example: billing
        first_name:
          type: string
          x-order: '4'
          example: Asha
        last_name:
          type: string
          x-order: '5'
          example: Rao
        phone:
          type: string
          x-order: '6'
          example: '+14155550101'
        email:
          type: string
          x-order: '7'
          example: billing@acmehome.com
        address_line_1:
          type: string
          x-order: '8'
          example: 100 Market St
        address_line_2:
          type: string
          x-order: '9'
          example: Suite 400
        city:
          type: string
          x-order: '10'
          example: San Francisco
        state:
          type: string
          x-order: '11'
          example: CA
        country:
          type: string
          x-order: '12'
          example: US
        zip_code:
          type: string
          x-order: '13'
          example: '94105'
        is_default:
          type: boolean
          x-order: '14'
          example: true
        attributes:
          type: array
          items:
            $ref: '#/components/schemas/bulkdto.BulkAttribute'
          x-order: '15'
    bulkdto.BulkCustomerContact:
      type: object
      required:
        - first_name
      properties:
        id:
          type: string
          x-order: '1'
          example: d3e4f5a6-b7c8-4d9e-8f0a-1b2c3d4e5f6a
        reference_id:
          type: string
          x-order: '2'
          example: CUST-1001-C1
        first_name:
          type: string
          x-order: '3'
          example: Asha
        last_name:
          type: string
          x-order: '4'
          example: Rao
        email:
          type: string
          x-order: '5'
          example: asha@acmehome.com
        phone:
          type: string
          x-order: '6'
          example: '+14155550101'
        designation:
          type: string
          x-order: '7'
          example: Owner
        is_default:
          type: boolean
          x-order: '8'
          example: true
        attributes:
          type: array
          items:
            $ref: '#/components/schemas/bulkdto.BulkAttribute'
          x-order: '9'
    bulkdto.BulkAttribute:
      type: object
      properties:
        id:
          description: Attribute id. Either id or name is required.
          type: string
          x-order: '1'
          example: 3f1c2b9e-7a1d-4c55-9a0e-2f8d6b1c4e21
        name:
          description: Attribute name. Either id or name is required.
          type: string
          x-order: '2'
          example: Region
        value:
          type: string
          x-order: '3'
          example: West
    bulkdto.BulkWarning:
      type: object
      properties:
        field:
          type: string
          x-order: '1'
          example: attributes[0].name
        reason:
          type: string
          x-order: '2'
          example: Attribute with name Region does not exist; skipped
  securitySchemes:
    ApiKeyAuth:
      description: API Key for authentication
      type: apiKey
      name: X-API-Key
      in: header

````

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