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

# Create an account

> Creates a new account with its complete B2B onboarding graph in a single atomic call.

**Atomic create:** supply `addresses[]`, `contacts[]`, `payment_methods[]`, and `tags[]`
inline. All children are written in one database transaction -- any child failure rolls back
the parent and every already-inserted child. The 201 response includes all children hydrated
inline; no follow-up GETs required.

**`name` is required.** Accepted aliases: `display_name`, `company_name`, or
`first_name`+`last_name`. Without a name the request returns 422.

**entity_id** is extracted from the API key and may NOT be supplied in the request body
(Layer 1 isolation). Auto-assigns account_number, default_pricing_level_id, payment_term_id,
and default_location_id from entity settings.

**Address field aliases:** `street1`/`region`/`postal_code` are accepted as Stripe-style
aliases for `line1`/`state`/`zip`.

**Contact field aliases:** `role` is accepted as a public alias for the `title` field.

**Tag auto-create:** tags supplied by name are auto-created for the entity if they do not
exist. Applying the same tag twice is idempotent.

**Side effects:**
- Shopify customer sync fires post-commit if entity.settings.shopify_sync.customer_sync = true.
- AvaTax recalc fires if tax_exempt or avatax_entity_code is set.

Idempotent when Idempotency-Key header is supplied (24-hour window).

**Guide:** [Creating accounts with addresses](https://arcuserp.mintlify.app/guides/creating-accounts-with-addresses)




## OpenAPI

````yaml /openapi.yaml post /accounts
openapi: 3.1.0
info:
  title: Arcus ERP Public API
  version: 1.0.0
  description: >
    Arcus ERP public REST API. Designed for external integrations and data
    migration.


    **Authentication.** Bearer token (API key) via the `Authorization` header.

    Format: `Authorization: Bearer ark_live_ent_<code>_<random>` (or
    `ark_test_*` for sandbox).

    API keys are issued per-entity in **Settings > Developers > API Keys**.


    **Entity scoping.** The entity is encoded in the API key prefix; routes are
    flat

    (e.g. `/v1/accounts`, `/v1/orders`, `/v1/products`). A small set of platform
    endpoints

    (migration, reconciliation, events, webhook endpoints, API keys) use the

    `/v1/entities/{entity_id}/...` form -- those are noted in their tags.


    **Key capabilities.**
      - Related-resource hydration via `?expand[]=` (see `x-arcus-expand` on each resource).
      - Cursor-based pagination (`starting_after` / `ending_before` / `limit`).
      - Idempotency via the `Idempotency-Key` header.
      - Webhook events for asynchronous notification.
      - Conditional requests / ETag for cache validation.
servers:
  - url: https://api.arcuserp.com/v1
    description: Arcus ERP API (accepts both live `ark_live_*` and test `ark_test_*` keys)
  - url: https://dev-api.arcuserp.com/v1
    description: >-
      Dev sandbox API (test-only data, accepts `ark_test_*` keys against dev
      RDS)
security: []
paths:
  /accounts:
    post:
      tags:
        - Accounts
      summary: Create an account
      description: >
        Creates a new account with its complete B2B onboarding graph in a single
        atomic call.


        **Atomic create:** supply `addresses[]`, `contacts[]`,
        `payment_methods[]`, and `tags[]`

        inline. All children are written in one database transaction -- any
        child failure rolls back

        the parent and every already-inserted child. The 201 response includes
        all children hydrated

        inline; no follow-up GETs required.


        **`name` is required.** Accepted aliases: `display_name`,
        `company_name`, or

        `first_name`+`last_name`. Without a name the request returns 422.


        **entity_id** is extracted from the API key and may NOT be supplied in
        the request body

        (Layer 1 isolation). Auto-assigns account_number,
        default_pricing_level_id, payment_term_id,

        and default_location_id from entity settings.


        **Address field aliases:** `street1`/`region`/`postal_code` are accepted
        as Stripe-style

        aliases for `line1`/`state`/`zip`.


        **Contact field aliases:** `role` is accepted as a public alias for the
        `title` field.


        **Tag auto-create:** tags supplied by name are auto-created for the
        entity if they do not

        exist. Applying the same tag twice is idempotent.


        **Side effects:**

        - Shopify customer sync fires post-commit if
        entity.settings.shopify_sync.customer_sync = true.

        - AvaTax recalc fires if tax_exempt or avatax_entity_code is set.


        Idempotent when Idempotency-Key header is supplied (24-hour window).


        **Guide:** [Creating accounts with
        addresses](https://arcuserp.mintlify.app/guides/creating-accounts-with-addresses)
      operationId: createAccount
      parameters:
        - name: Idempotency-Key
          in: header
          schema:
            type: string
            maxLength: 255
          description: Optional idempotency key for safe retries.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AccountCreate'
      responses:
        '201':
          description: Account created
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    $ref: '#/components/schemas/Account'
        '400':
          $ref: '#/components/responses/Error'
        '401':
          $ref: '#/components/responses/Error'
        '403':
          $ref: '#/components/responses/Error'
        '422':
          $ref: '#/components/responses/Error'
      security:
        - ApiKeyAuth:
            - accounts:write
components:
  schemas:
    AccountCreate:
      type: object
      required:
        - name
        - account_type
      description: >
        Creates a new account with its full onboarding graph in one atomic
        request.


        **Required fields:** `name` (or
        `display_name`/`company_name`/`first_name`+`last_name`)

        and `account_type`.


        **Nested children** (all optional, all atomic):

        - `addresses[]`: billing and/or shipping addresses. Supports
        `street1`/`region`/`postal_code`
          (Stripe-style aliases) or `line1`/`state`/`zip` (canonical). First address of each type
          auto-becomes the default.
        - `contacts[]`: person contacts. `role` is a public alias for the
        `title` field. At most one
          `is_primary: true`.
        - `payment_methods[]`: Stripe payment methods via
        `stripe_payment_method_id` (the `pm_*` token
          from a completed SetupIntent). Requires Stripe to be configured for the entity.
        - `tags[]`: tag names to apply. Tags are auto-created if they do not
        exist for the entity.


        **Transaction guarantee:** all children are written in a single database
        transaction. Any

        child failure rolls back the parent account and every already-inserted
        child. You get a

        complete graph or nothing.


        **Hydrated response:** the 201 body includes `addresses`, `contacts`,
        `payment_methods`,

        and `tags` arrays inline. No follow-up GETs required.


        **See also:** [Creating accounts with addresses
        guide](https://arcuserp.mintlify.app/guides/creating-accounts-with-addresses)
      properties:
        name:
          type: string
          description: >
            Human-readable name for the account. Required. Aliases:
            `display_name` (business),

            `company_name` (business), or `first_name`+`last_name` (individual).
            All are accepted;

            `name` is the canonical public API field.
        display_name:
          type: string
          nullable: true
          description: >-
            Alias for name. Auto-derived from company_name or first+last if
            omitted.
        company_name:
          type: string
          nullable: true
        first_name:
          type: string
          nullable: true
          description: For individual accounts.
        last_name:
          type: string
          nullable: true
          description: For individual accounts.
        account_type:
          type: string
          enum:
            - business
            - individual
            - lead
            - vendor
        email:
          type: string
          nullable: true
        phone:
          type: string
          nullable: true
          description: Maps to phone_main internally.
        phone_main:
          type: string
          nullable: true
        phone_secondary:
          type: string
          nullable: true
        phone_mobile:
          type: string
          nullable: true
        website:
          type: string
          nullable: true
        payment_term_id:
          type: string
          format: uuid
          nullable: true
          description: Must reference an existing payment_terms row for this entity.
        pricing_level_id:
          type: string
          format: uuid
          nullable: true
          description: Alias for default_pricing_level_id.
        credit_limit:
          type: number
          nullable: true
          description: >-
            Credit ceiling in USD. Returned as a JS number (float), never a
            string.
        tax_exempt:
          type: boolean
        avatax_entity_code:
          type: string
          nullable: true
        tax_number:
          type: string
          nullable: true
        default_pricing_level_id:
          type: string
          format: uuid
          nullable: true
        default_location_id:
          type: string
          format: uuid
          nullable: true
        default_shipping_method:
          type: string
          nullable: true
        notes:
          type: string
          nullable: true
        metadata:
          type: object
          nullable: true
        addresses:
          type: array
          description: >
            Billing and/or shipping addresses to create atomically with the
            account.

            Supports `street1`/`region`/`postal_code` (Stripe-style) OR
            `line1`/`state`/`zip` (canonical).

            At most one address per type may have `is_default_billing: true` or
            `is_default_shipping: true`.
          items:
            type: object
            required:
              - type
            properties:
              type:
                type: string
                enum:
                  - billing
                  - shipping
              label:
                type: string
                nullable: true
              street1:
                type: string
                nullable: true
                description: Alias for line1.
              street2:
                type: string
                nullable: true
                description: Alias for line2.
              line1:
                type: string
                nullable: true
              line2:
                type: string
                nullable: true
              city:
                type: string
                nullable: true
              region:
                type: string
                nullable: true
                description: Alias for state (2-letter US state code or full name).
              state:
                type: string
                nullable: true
              postal_code:
                type: string
                nullable: true
                description: Alias for zip.
              zip:
                type: string
                nullable: true
              country:
                type: string
                default: US
                description: 'ISO 3166-1 alpha-2. Default: US.'
              is_default_billing:
                type: boolean
                description: True for the primary billing address.
              is_default_shipping:
                type: boolean
                description: True for the primary shipping address.
        contacts:
          type: array
          description: >
            Person contacts to create atomically with the account.

            If omitted, an auto-generated primary contact is created from
            account-level name/email/phone.

            At most one contact may have `is_primary: true`.

            `role` is the public API alias for the internal `title` field.
          items:
            type: object
            properties:
              first_name:
                type: string
                nullable: true
              last_name:
                type: string
                nullable: true
              email:
                type: string
                nullable: true
              phone:
                type: string
                nullable: true
              role:
                type: string
                nullable: true
                description: Job role or title. Stored as 'title' internally.
              title:
                type: string
                nullable: true
                description: Alias for role.
              is_primary:
                type: boolean
                description: At most one contact may be primary.
              website:
                type: string
                nullable: true
        payment_methods:
          type: array
          description: >
            Stripe payment methods to attach atomically with the account.

            Each item requires a `stripe_payment_method_id` (the `pm_*` token
            from a completed

            Stripe SetupIntent or test card). Requires Stripe to be configured
            for the entity.
          items:
            type: object
            required:
              - stripe_payment_method_id
            properties:
              stripe_payment_method_id:
                type: string
                description: >-
                  Stripe payment method token (pm_*). Test mode: use
                  'pm_card_visa' etc.
              is_default:
                type: boolean
                description: True to set as the default payment method.
        tags:
          type: array
          description: >
            Tag names to apply to the account. Tags are auto-created if they do
            not exist for

            the entity (using the name as the slug base). Idempotent: applying
            the same tag twice

            is a no-op.
          items:
            type: string
      example:
        account_type: business
        name: Acme Wholesale
        email: ap@acme.example
        phone: +1-555-0100
        credit_limit: 25000
        addresses:
          - type: billing
            label: HQ
            is_default_billing: true
            street1: 1 Acme Way
            city: Austin
            region: TX
            postal_code: '78701'
            country: US
          - type: shipping
            label: Main Warehouse
            is_default_shipping: true
            street1: 100 Industrial Dr
            city: Austin
            region: TX
            postal_code: '78702'
            country: US
          - type: shipping
            label: Branch Warehouse
            street1: 200 Branch Rd
            city: Houston
            region: TX
            postal_code: '77001'
            country: US
        contacts:
          - first_name: Jane
            last_name: Doe
            email: jane@acme.example
            phone: +1-555-0101
            is_primary: true
            role: AP
          - first_name: John
            last_name: Smith
            email: john@acme.example
            role: Operations
        payment_methods:
          - stripe_payment_method_id: pm_card_visa
            is_default: true
        tags:
          - VIP
          - Wholesale-Tier-1
    Account:
      type: object
      description: >
        An Arcus ERP account. Represents a customer, vendor, lead, or
        individual.

        account_type drives AR vs AP behavior: business/individual/lead =
        customer (AR);

        vendor = supplier (AP). entity_id is always from the API key (Layer 1
        isolation).
      properties:
        id:
          type: string
          format: uuid
        object:
          type: string
          enum:
            - account
        entity_id:
          type: string
          format: uuid
          readOnly: true
        display_name:
          type: string
          description: UI-facing name. Required.
        company_name:
          type: string
          nullable: true
        account_type:
          type: string
          enum:
            - business
            - individual
            - lead
            - vendor
          description: business/individual/lead = customer (AR); vendor = supplier (AP).
        account_number:
          type: string
          nullable: true
          readOnly: true
          description: Auto-generated sequential number within entity. Unique per entity.
        email:
          type: string
          nullable: true
        phone_main:
          type: string
          nullable: true
        phone_secondary:
          type: string
          nullable: true
        phone_mobile:
          type: string
          nullable: true
        website:
          type: string
          nullable: true
        payment_term_id:
          type: string
          format: uuid
          nullable: true
        credit_limit:
          type: number
          nullable: true
        credit_balance:
          type: number
          readOnly: true
          description: 'SSOT: utils/ar-helpers.mjs. Do not write directly.'
        is_credit_hold:
          type: boolean
          readOnly: true
          description: |
            Read-only on PATCH /accounts/{id} (Rule 23 SSOT).
            To set or clear the credit hold use the dedicated action endpoint
            POST /accounts/{id}/credit-hold { on_hold: bool, reason?: string }.
            The action endpoint delegates to canonical
            utils/credit-hold-helpers.mjs::setCreditHold which is the SOLE
            writer and also cascades to orders.is_credit_hold_blocked.
        tax_exempt:
          type: boolean
        avatax_entity_code:
          type: string
          nullable: true
        tax_number:
          type: string
          nullable: true
        default_pricing_level_id:
          type: string
          format: uuid
          nullable: true
        default_location_id:
          type: string
          format: uuid
          nullable: true
        default_shipping_method:
          type: string
          nullable: true
        shipping_preference:
          type: string
          enum:
            - always_freight
            - always_parcel
            - auto
          nullable: true
        enable_pro_portal:
          type: boolean
        is_active:
          type: boolean
        notes:
          type: string
          nullable: true
        metadata:
          type: object
          nullable: true
        stripe_customer_id:
          type: string
          nullable: true
          readOnly: true
        source_platform:
          type: string
          nullable: true
          readOnly: true
        external_customer_id:
          type: string
          nullable: true
        created_at:
          type: string
          format: date-time
          readOnly: true
        updated_at:
          type: string
          format: date-time
          readOnly: true
    ErrorEnvelope:
      type: object
      description: |
        Canonical error response envelope. All API errors use this shape.
      required:
        - error
        - code
      properties:
        error:
          type: string
          description: Machine-readable error key
          example: not_found
        code:
          type: string
          description: Machine-readable error code (often same as error)
          example: not_found
        type:
          type: string
          enum:
            - validation_error
            - permission_error
            - not_found
            - conflict
            - rate_limit
            - internal
            - expand_error
            - not_implemented
          example: not_found
        hint:
          type: string
          description: Human-readable one-sentence explanation (English)
          example: >-
            The requested order does not exist or does not belong to this
            entity.
        param:
          type: string
          description: The parameter that caused the error, if applicable
          example: expand[0]
        required:
          type: string
          description: The scope required (only on insufficient_scope errors)
          example: accounts:read
        request_id:
          type: string
          description: >-
            Unique request ID for support tracing (maps to CloudWatch log
            stream)
          example: req_abc123
  responses:
    Error:
      description: Error response (400/401/403/404/409/422/429/500)
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorEnvelope'
  securitySchemes:
    ApiKeyAuth:
      type: http
      scheme: bearer
      description: |
        API key issued per entity via Settings > Developers > API Keys.
        Each key carries scopes (e.g. orders:read, products:write).
        Bearer token format: Authorization: Bearer ark_live_ent_<code>_<random>
        Test keys use ark_test_ent_<code>_<random>. Both are issued per entity
        via Settings > Developers > API Keys.

````