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

# Create customer

> Creates a new customer.

If you also sell through Shopify, send the buyer's Shopify customer ID as `shopify_customer_id`. When that buyer's Shopify orders sync, they attach to this customer instead of creating a new one. Set it before the buyer's first Shopify order syncs.

If a customer already has that Shopify customer ID, you get that customer back with a `200` and nothing is created or changed. So it's safe to send the same create twice.




## OpenAPI

````yaml /api-reference/openapi.yaml post /customers
openapi: 3.0.3
info:
  title: Streamlined API
  description: >
    Access customers, customer applications, customer groups, products, payouts,
    invoices, transactions, and deposit links programmatically through this API,
    and receive webhooks when deposit links change. All requests must be
    authenticated with an API key.
  version: 1.6.0
  license:
    name: Proprietary
    url: https://streamlinedpayments.com/terms
servers:
  - url: https://api.staging.streamlinedpayments.com/api/v1
    description: Sandbox
  - url: https://api.streamlinedpayments.com/api/v1
    description: Production
security:
  - AppIdAuth: []
    ApiKeyAuth: []
tags:
  - name: Customers
    description: Create, update and delete the businesses you sell to.
  - name: Customer applications
    description: >-
      List the applications your customers submit, and approve them. Approving
      can also set net terms and export the customer to Shopify. See [Approve
      customer applications](/guides/customer-applications).
  - name: Customer groups
    description: >-
      Organize customers into groups and manage who's in each one. A group can
      be linked to a Shopify B2B company.
  - name: Customer files
    description: Upload and manage files attached to a customer.
  - name: Customer addresses
    description: Manage a customer's addresses and choose their default billing address.
  - name: Orders
    description: Create orders, add and remove line items, and schedule them.
  - name: Invoices
    description: Create invoices from orders, then list, look up and update them.
  - name: Transactions
    description: List transactions and look one up.
  - name: Payouts
    description: List payouts, including pending ones, and look one up.
  - name: Products
    description: >-
      Create and update the products and services you sell, import them in bulk,
      and merge duplicates.
  - name: Deposit links
    description: Collect money from a customer before an invoice exists.
  - name: Webhooks
    description: >-
      Register HTTPS endpoints to receive events when something changes. See
      [Webhooks](/guides/webhooks) for signatures, retries and delivery
      guarantees.
paths:
  /customers:
    post:
      tags:
        - Customers
      summary: Create customer
      description: >
        Creates a new customer.


        If you also sell through Shopify, send the buyer's Shopify customer ID
        as `shopify_customer_id`. When that buyer's Shopify orders sync, they
        attach to this customer instead of creating a new one. Set it before the
        buyer's first Shopify order syncs.


        If a customer already has that Shopify customer ID, you get that
        customer back with a `200` and nothing is created or changed. So it's
        safe to send the same create twice.
      operationId: createCustomer
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - customer
              properties:
                customer:
                  type: object
                  properties:
                    first_name:
                      type: string
                      description: First name of the customer
                    last_name:
                      type: string
                      description: Last name of the customer
                    company_name:
                      type: string
                      description: Company name of the customer
                    website:
                      type: string
                      description: Website of the customer
                    tags:
                      type: string
                      description: Tags for the customer (comma-separated)
                    tax_exempt:
                      type: boolean
                      description: Whether the customer is tax exempt
                    net_terms:
                      type: integer
                      nullable: true
                      enum:
                        - 0
                        - 7
                        - 10
                        - 15
                        - 30
                        - 45
                        - 60
                        - 90
                      description: >
                        Payment terms in days. 0 = Due on receipt. null =
                        inherit from customer group, then merchant default.

                        Only the listed values are accepted.
                    customer_group_uuid:
                      type: string
                      format: uuid
                      nullable: true
                      description: >-
                        UUID of the customer group to associate this customer
                        with. null removes from any group.
                    shopify_customer_id:
                      type: string
                      description: >
                        The buyer's Shopify customer ID, as a number
                        (`1234567890`) or a GID
                        (`gid://shopify/Customer/1234567890`). Stored and
                        returned as a GID.
                      example: '1234567890'
                    shopify_shop_domain:
                      type: string
                      description: >
                        The Shopify store the customer belongs to, like
                        `your-store` or `your-store.myshopify.com`. Required
                        when more than one Shopify store is connected to your
                        account. Only used with `shopify_customer_id`.
                      example: your-store
                    addresses_attributes:
                      type: array
                      items:
                        type: object
                        properties:
                          address1:
                            type: string
                            description: First line of the address
                          address2:
                            type: string
                            description: Second line of the address
                          city:
                            type: string
                            description: City
                          state:
                            type: string
                            description: State or province
                          postal_code:
                            type: string
                            description: Postal code
                          country:
                            type: string
                            description: Country
                          email:
                            type: string
                            format: email
                            description: Email address
                          cc_email:
                            type: string
                            format: email
                            description: CC email addresses (comma-separated list)
                          phone:
                            type: string
                            description: Phone number
                          first_name:
                            type: string
                            description: First name for the address
                          last_name:
                            type: string
                            description: Last name for the address
                          company_name:
                            type: string
                            description: Company name for the address
      responses:
        '200':
          description: >-
            A customer already has this `shopify_customer_id`. That customer is
            returned unchanged.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CustomerDetail'
        '201':
          description: Customer created successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CustomerDetail'
        '400':
          description: Bad request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '422':
          description: >
            Unprocessable entity. For `shopify_customer_id` this means the ID
            isn't a Shopify customer ID, the store isn't connected,
            `shopify_shop_domain` is missing when you have more than one store,
            or the ID belongs to a deleted customer.
          content:
            application/json:
              schema:
                type: object
                properties:
                  errors:
                    type: array
                    items:
                      type: string
components:
  schemas:
    CustomerDetail:
      type: object
      properties:
        customer:
          type: object
          properties:
            website:
              type: string
            company_name:
              type: string
            created_at:
              type: string
              format: date-time
            updated_at:
              type: string
              format: date-time
            tags:
              type: array
              items:
                type: string
            first_name:
              type: string
            last_name:
              type: string
            uuid:
              type: string
              format: uuid
            display_name:
              type: string
            customer_email:
              type: string
            total_open_balance_amount:
              type: integer
            quick_pay_enabled:
              type: boolean
            average_days_to_pay:
              type: integer
            net_terms:
              type: integer
              nullable: true
              enum:
                - 0
                - 7
                - 10
                - 15
                - 30
                - 45
                - 60
                - 90
              description: >-
                Payment terms in days. null means inherit from customer group,
                then merchant default.
            net_terms_label:
              type: string
              nullable: true
              description: >-
                Human-readable label for net_terms (e.g. "Net 30", "Due on
                receipt").
            shopify_customer_id:
              type: string
              nullable: true
              description: >-
                The Shopify customer this customer is linked to, as a GID. null
                if not linked.
              example: gid://shopify/Customer/1234567890
            shopify_shop_domain:
              type: string
              nullable: true
              description: >-
                The Shopify store the linked Shopify customer belongs to. null
                if not linked.
              example: your-store
            application_submitted_at:
              type: string
              format: date-time
              nullable: true
              description: null if the customer never applied.
            application_approved_at:
              type: string
              format: date-time
              nullable: true
              description: null until the application is approved.
            customer_group:
              type: object
              nullable: true
              description: The group this customer belongs to, if any.
              properties:
                uuid:
                  type: string
                  format: uuid
                company_name:
                  type: string
            billing_address:
              $ref: '#/components/schemas/Address'
            addresses:
              type: array
              items:
                $ref: '#/components/schemas/Address'
    Error:
      type: object
      properties:
        error:
          type: string
        message:
          type: string
    Address:
      type: object
      properties:
        id:
          type: integer
        address1:
          type: string
        address2:
          type: string
        city:
          type: string
        state:
          type: string
        postal_code:
          type: string
        phone:
          type: string
        country:
          type: string
        email:
          type: string
        cc_email:
          type: string
          description: CC email addresses (comma-separated list)
        first_name:
          type: string
        last_name:
          type: string
        company_name:
          type: string
  responses:
    Unauthorized:
      description: Authentication failed
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          examples:
            AuthenticationRequired:
              value:
                error: Authentication required
                message: >-
                  API endpoint requires authentication. Please provide valid
                  X-App-Id and X-Api-Key headers.
            InvalidCredentials:
              value:
                error: Invalid credentials
                message: >-
                  The provided API credentials are invalid. Please check your
                  X-App-Id and X-Api-Key values.
  securitySchemes:
    AppIdAuth:
      type: apiKey
      in: header
      name: X-App-Id
      description: App ID for authentication
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-Api-Key
      description: API Key for authentication

````

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