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

# Bulk upsert customers

> Bulk upsert customers into Atlas by unique external ID (e.g. the customer ID in your system). Does not automatically subscribe the customers to the default plan if eligible.



## OpenAPI

````yaml https://platform.runonatlas.com/external/schema post /external/customers/upsert/bulk
openapi: 3.0.0
info:
  title: Atlas API
  version: 1.0.0
servers:
  - url: https://platform.runonatlas.com
security: []
paths:
  /external/customers/upsert/bulk:
    post:
      tags:
        - Customers
      summary: Bulk upsert customers
      description: >-
        Bulk upsert customers into Atlas by unique external ID (e.g. the
        customer ID in your system). Does not automatically subscribe the
        customers to the default plan if eligible.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: array
              items:
                type: object
                properties:
                  billingAddress1:
                    type: string
                    nullable: true
                    minLength: 1
                    description: Billing address line 1
                    example: 123 Main St
                  billingAddress2:
                    type: string
                    nullable: true
                    minLength: 1
                    description: Billing address line 2
                    example: Apt 1
                  billingCity:
                    type: string
                    nullable: true
                    minLength: 1
                    description: Billing city
                    example: Anytown
                  billingCountry:
                    type: string
                    nullable: true
                    minLength: 1
                    description: Billing country
                    example: US
                  billingState:
                    type: string
                    nullable: true
                    minLength: 1
                    description: Billing state
                    example: CA
                  billingZipCode:
                    type: string
                    nullable: true
                    pattern: ^\d{5}(-\d{4})?$
                    description: Billing zip code. Must be 5 digits or 5+4 format.
                    example: '12345'
                  shippingAddress1:
                    type: string
                    nullable: true
                    minLength: 1
                    description: Shipping address line 1
                    example: 123 Main St
                  shippingAddress2:
                    type: string
                    nullable: true
                    minLength: 1
                    description: Shipping address line 2
                    example: Apt 1
                  shippingCity:
                    type: string
                    nullable: true
                    minLength: 1
                    description: Shipping city
                    example: Anytown
                  shippingCountry:
                    type: string
                    nullable: true
                    minLength: 1
                    description: Shipping country
                    example: US
                  shippingState:
                    type: string
                    nullable: true
                    minLength: 1
                    description: Shipping state
                    example: CA
                  shippingZipCode:
                    type: string
                    nullable: true
                    pattern: ^\d{5}(-\d{4})?$
                    description: Shipping zip code. Must be 5 digits or 5+4 format.
                    example: '12345'
                  email:
                    type: string
                    nullable: true
                    minLength: 1
                    format: email
                    description: The email of the customer
                    example: john.doe@example.com
                  externalId:
                    type: string
                    minLength: 1
                    description: >-
                      The external ID of the customer (e.g. the customer ID in
                      your system)
                    example: external-customer-id-123
                  name:
                    type: string
                    nullable: true
                    minLength: 1
                    description: The name of the customer
                    example: John Doe
                  quickBooksId:
                    type: string
                    nullable: true
                    minLength: 1
                    description: The QuickBooks ID of the customer
                    example: quickbooks-customer-id-123
                  stripeId:
                    type: string
                    nullable: true
                    minLength: 1
                    description: The Stripe ID of the customer
                    example: stripe-customer-id-123
                  xeroId:
                    type: string
                    nullable: true
                    minLength: 1
                    description: The Xero ID of the customer
                    example: xero-customer-id-123
                required:
                  - externalId
                additionalProperties: false
              minItems: 1
      responses:
        '200':
          description: The customers that have been upserted.
          content:
            application/json:
              schema:
                type: array
                items:
                  type: object
                  properties:
                    billingAddress1:
                      type: string
                      nullable: true
                      minLength: 1
                      description: Billing address line 1
                      example: 123 Main St
                    billingAddress2:
                      type: string
                      nullable: true
                      minLength: 1
                      description: Billing address line 2
                      example: Apt 1
                    billingCity:
                      type: string
                      nullable: true
                      minLength: 1
                      description: Billing city
                      example: Anytown
                    billingCountry:
                      type: string
                      nullable: true
                      minLength: 1
                      description: Billing country
                      example: US
                    billingState:
                      type: string
                      nullable: true
                      minLength: 1
                      description: Billing state
                      example: CA
                    billingZipCode:
                      type: string
                      nullable: true
                      pattern: ^\d{5}(-\d{4})?$
                      description: Billing zip code. Must be 5 digits or 5+4 format.
                      example: '12345'
                    shippingAddress1:
                      type: string
                      nullable: true
                      minLength: 1
                      description: Shipping address line 1
                      example: 123 Main St
                    shippingAddress2:
                      type: string
                      nullable: true
                      minLength: 1
                      description: Shipping address line 2
                      example: Apt 1
                    shippingCity:
                      type: string
                      nullable: true
                      minLength: 1
                      description: Shipping city
                      example: Anytown
                    shippingCountry:
                      type: string
                      nullable: true
                      minLength: 1
                      description: Shipping country
                      example: US
                    shippingState:
                      type: string
                      nullable: true
                      minLength: 1
                      description: Shipping state
                      example: CA
                    shippingZipCode:
                      type: string
                      nullable: true
                      pattern: ^\d{5}(-\d{4})?$
                      description: Shipping zip code. Must be 5 digits or 5+4 format.
                      example: '12345'
                    createdAt:
                      type: string
                      format: date
                      description: The date and time the customer was created
                      example: '2021-01-01T00:00:00.000Z'
                    email:
                      type: string
                      nullable: true
                      minLength: 1
                      format: email
                      description: The email of the customer
                      example: john.doe@example.com
                    externalId:
                      type: string
                      nullable: true
                      minLength: 1
                      description: >-
                        The external ID of the customer (e.g. the customer ID in
                        your system)
                      example: external-customer-id-123
                    id:
                      type: string
                      minLength: 1
                      description: The Atlas customer ID
                      example: atlas-internal-customer-id-123
                    name:
                      type: string
                      nullable: true
                      minLength: 1
                      description: The name of the customer
                      example: John Doe
                    updatedAt:
                      type: string
                      format: date
                      description: The date and time the customer was last updated
                      example: '2021-01-01T00:00:00.000Z'
                    quickBooksId:
                      type: string
                      nullable: true
                      minLength: 1
                      description: The QuickBooks ID of the customer
                      example: quickbooks-customer-id-123
                    stripeId:
                      type: string
                      nullable: true
                      minLength: 1
                      description: The Stripe ID of the customer
                      example: stripe-customer-id-123
                    merchantId:
                      type: string
                      minLength: 1
                      description: The Atlas merchant ID
                      example: atlas-internal-merchant-id-123
                  required:
                    - createdAt
                    - id
                    - updatedAt
                    - merchantId
        '400':
          description: >-
            There is an issue with the request data. See the response for more
            details.
        '401':
          description: Invalid API key provided.
        '409':
          description: >-
            A unique constraint violation occurred. See the response for more
            details.
      security:
        - apiKeyAuth: []
components:
  securitySchemes:
    apiKeyAuth:
      type: apiKey
      name: x-api-key
      in: header
      description: >-
        You can obtain this key from the Atlas dashboard. It must be of type
        `secret`

````