> ## 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 group



## OpenAPI

````yaml /api-reference/openapi.yaml post /customer_groups
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:
  /customer_groups:
    post:
      tags:
        - Customer groups
      summary: Create customer group
      operationId: createCustomerGroup
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - customer_group
              properties:
                customer_group:
                  type: object
                  required:
                    - company_name
                  properties:
                    company_name:
                      type: string
                    net_terms:
                      type: integer
                      nullable: true
                      enum:
                        - 0
                        - 7
                        - 10
                        - 15
                        - 30
                        - 45
                        - 60
                        - 90
                      description: >
                        Payment terms in days that cascade to all member
                        customers on update.

                        0 = Due on receipt. null = inherit from merchant
                        default.
      responses:
        '201':
          description: Customer group created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CustomerGroupDetail'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '422':
          $ref: '#/components/responses/ValidationError'
components:
  schemas:
    CustomerGroupDetail:
      type: object
      properties:
        customer_group:
          $ref: '#/components/schemas/CustomerGroupFull'
    CustomerGroupFull:
      description: >-
        Group fields with inline customers array. Returned by show, create, and
        update.
      allOf:
        - $ref: '#/components/schemas/CustomerGroupSummary'
        - type: object
          properties:
            customers:
              type: array
              description: Member customers (uuid + company_name only).
              items:
                type: object
                properties:
                  uuid:
                    type: string
                    format: uuid
                  company_name:
                    type: string
    Error:
      type: object
      properties:
        error:
          type: string
        message:
          type: string
    ValidationError:
      type: object
      description: >-
        Standard validation error envelope. Use for any 422 unless richer
        per-row detail is needed (see RowValidationError on /products/import).
      properties:
        errors:
          type: array
          items:
            type: string
    CustomerGroupSummary:
      type: object
      description: >-
        Lightweight group fields. Used in list responses; does NOT include the
        inline customers array (use show or /members for member detail).
      properties:
        uuid:
          type: string
          format: uuid
        company_name:
          type: string
        net_terms:
          type: integer
          nullable: true
          enum:
            - 0
            - 7
            - 10
            - 15
            - 30
            - 45
            - 60
            - 90
        net_terms_label:
          type: string
          nullable: true
        number_of_customers:
          type: integer
        total_open_balance_amount:
          type: integer
        statement_url:
          type: string
        created_at:
          type: string
          format: date-time
        updated_at:
          type: string
          format: date-time
  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.
    ValidationError:
      description: Validation failed.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ValidationError'
  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.