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

# Create an External Account

> **Scopes:** `transaction:create`



## OpenAPI

````yaml /api-reference/openapi.json post /v0/business/{business_id}/external-account
openapi: 3.1.0
info:
  title: Asset API
  version: '0.1'
servers:
  - url: https://api.sandbox.getasset.com
    description: Sandbox
  - url: https://api.getasset.com
    description: Production
security: []
paths:
  /v0/business/{business_id}/external-account:
    post:
      tags:
        - Transaction
      summary: Create an External Account
      description: '**Scopes:** `transaction:create`'
      operationId: create_external_account_v0_business__business_id__external_account_post
      parameters:
        - name: business_id
          in: path
          required: true
          schema:
            description: The id of the business
            examples:
              - biz_GA6EG2qFxA97NZHtxeLPUy
            type: string
            format: biz_string
            title: Business Id
          description: The id of the business
      requestBody:
        required: true
        content:
          application/json:
            schema:
              oneOf:
                - $ref: '#/components/schemas/PersonalAccountCreate'
                - $ref: '#/components/schemas/BusinessAccountCreate'
              discriminator:
                propertyName: type
                mapping:
                  personal:
                    $ref: '#/components/schemas/PersonalAccountCreate'
                  business:
                    $ref: '#/components/schemas/BusinessAccountCreate'
              title: External Account
            examples:
              business:
                summary: Example for a business account
                value:
                  name: Checking Account
                  mask: '4576'
                  source: manual
                  type: business
                  ledger_id: ldg_Ns6rRRLYVZPh4cVB7MDby5
              personal:
                summary: Example for a personal account
                value:
                  name: Checking Account
                  mask: '4576'
                  source: manual
                  type: personal
                  contribution_ledger_id: ldg_9p2Fp7gra8aCVNvCSekUyK
                  distribution_ledger_id: ldg_17Navjx4QVnRsUtTeYLNp8
      responses:
        '201':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ExternalAccountPublic'
        '401':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Unauthorized
        '403':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Forbidden
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Not Found
        '409':
          description: Conflict. The ledger is already connected to an external account
          content:
            application/json:
              example:
                message: string
                data: string
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Unprocessable Content
        '503':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Service Unavailable
      security:
        - OAuth2PasswordBearer:
            - transaction:create
components:
  schemas:
    PersonalAccountCreate:
      properties:
        name:
          type: string
          title: Name
          description: The name of the External Account
        mask:
          type: string
          title: Mask
          description: >-
            The mask of the External Account. It's usually the last four digits
            of the account number.
        source:
          type: string
          enum:
            - manual
            - statements
          title: Source
          description: The source of the External Account.
        metadata_:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Metadata
          description: The metadata of the External Account
        type:
          type: string
          const: personal
          title: Type
          description: The type of the External Account
        financial_account_type:
          $ref: '#/components/schemas/FinancialAccountType'
          description: >-
            The type of real-world financial account this Personal External
            Account represents. Used to derive the debit/credit designation.
        contribution_ledger_id:
          type: string
          format: ldg_string
          title: Contribution Ledger Id
          description: >-
            The ID of the Contribution Ledger associated with the Personal
            External Account. Required for personal accounts.
        distribution_ledger_id:
          type: string
          format: ldg_string
          title: Distribution Ledger Id
          description: >-
            The ID of the Distribution Ledger associated with the Personal
            External Account. Required for personal accounts.
      type: object
      required:
        - name
        - mask
        - source
        - type
        - financial_account_type
        - contribution_ledger_id
        - distribution_ledger_id
      title: PersonalAccountCreate
    BusinessAccountCreate:
      properties:
        name:
          type: string
          title: Name
          description: The name of the External Account
        mask:
          type: string
          title: Mask
          description: >-
            The mask of the External Account. It's usually the last four digits
            of the account number.
        source:
          type: string
          enum:
            - manual
            - statements
          title: Source
          description: The source of the External Account.
        metadata_:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Metadata
          description: The metadata of the External Account
        type:
          type: string
          const: business
          title: Type
          description: The type of the External Account
        financial_account_type:
          anyOf:
            - $ref: '#/components/schemas/FinancialAccountType'
            - type: 'null'
          description: >-
            The type of the Financial Account associated with the Business
            External Account. Required for business accounts.
        ledger_id:
          anyOf:
            - type: string
              format: ldg_string
            - type: 'null'
          title: Ledger Id
          description: >-
            The ID of the Bank Ledger associated with the Business External
            Account. Required for business accounts
      type: object
      required:
        - name
        - mask
        - source
        - type
      title: BusinessAccountCreate
    ExternalAccountPublic:
      properties:
        business_id:
          type: string
          format: biz_string
          title: Business Id
          description: The ID of the Business associated with the External Account
          examples:
            - biz_Pk2fNFDd8wj7EFeLWJywc7
        type:
          $ref: '#/components/schemas/ExternalAccountType'
          description: The type of the External Account
          examples:
            - business
            - personal
        ledger_id:
          anyOf:
            - type: string
              format: ldg_string
            - type: 'null'
          title: Ledger Id
          description: >-
            The ID of the Bank Ledger associated with the Business External
            Account
          examples:
            - ldg_Ns6rRRLYVZPh4cVB7MDby5
        contribution_ledger_id:
          anyOf:
            - type: string
              format: ldg_string
            - type: 'null'
          title: Contribution Ledger Id
          description: >-
            The ID of the Contribution Ledger associated with the Personal
            External Account
          examples:
            - ldg_Ns6rRRLYVZPh4cVB7MDby5
        distribution_ledger_id:
          anyOf:
            - type: string
              format: ldg_string
            - type: 'null'
          title: Distribution Ledger Id
          description: >-
            The ID of the Distribution Ledger associated with the Personal
            External Account
          examples:
            - ldg_Ns6rRRLYVZPh4cVB7MDby5
        financial_account_type:
          anyOf:
            - $ref: '#/components/schemas/FinancialAccountType'
            - type: 'null'
          description: >-
            The type of real-world financial account this External Account
            represents
          examples:
            - bank_account
        source:
          $ref: '#/components/schemas/ExternalAccountSource'
          description: The source of the External Account
          examples:
            - manual
            - plaid
        external_id:
          anyOf:
            - type: string
              maxLength: 255
            - type: 'null'
          title: External Id
          description: The external ID of the External Account
          examples:
            - '1234567890'
        metadata_:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Metadata
        name:
          anyOf:
            - type: string
              maxLength: 255
            - type: 'null'
          title: Name
          description: The name of the External Account
          examples:
            - ABC Business Checking
        mask:
          anyOf:
            - type: string
              maxLength: 255
            - type: 'null'
          title: Mask
          description: The mask of the External Account
          examples:
            - '1234'
        linked_item_id:
          anyOf:
            - type: string
              format: lni_string
            - type: 'null'
          title: Linked Item Id
          description: The ID of the Linked Item associated with the External Account
          examples:
            - lni_R2fAXCjqJPdpYata112zyW
        status:
          $ref: '#/components/schemas/ExternalAccountStatus'
          description: The status of the External Account
          default: connected
          examples:
            - connected
            - disconnected
        disconnected_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Disconnected At
          description: Datetime when the external account was disconnected
        last_synced_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Last Synced At
          description: Datetime when the external account was last synced
        last_balanced_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Last Balanced At
          description: Datetime when the external account was last balanced
        external_balance:
          anyOf:
            - type: number
            - type: 'null'
          title: External Balance
          description: The current balance of the External Account
          examples:
            - 3512.85
        last_statement_end_date:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Last Statement End Date
          description: Datetime when the external account balance was last updated
        id:
          type: string
          format: eac_string
          title: Id
          description: The ID of the External Account
          examples:
            - eac_Ns6rRRLYVZPh4cVB7MDby5
        institution_name:
          anyOf:
            - type: string
            - type: 'null'
          title: Institution Name
          description: >-
            The name of the institution associated with the External Account, if
            any
          examples:
            - Chase Bank
      type: object
      required:
        - business_id
        - type
        - source
        - external_id
        - disconnected_at
        - last_synced_at
        - last_balanced_at
        - external_balance
        - last_statement_end_date
        - id
      title: ExternalAccountPublic
    ErrorResponse:
      properties:
        error:
          anyOf:
            - type: string
            - type: 'null'
          title: Error
          description: A description of the error
        data:
          title: Data
          description: Data associated with the error
      type: object
      required:
        - error
        - data
      title: ErrorResponse
    FinancialAccountType:
      type: string
      enum:
        - bank_account
        - credit_card
        - prepaid_card
        - payments
        - payroll
        - loan
        - accounts_receivable
        - accounts_payable
      title: FinancialAccountType
    ExternalAccountType:
      type: string
      enum:
        - business
        - personal
      title: ExternalAccountType
    ExternalAccountSource:
      type: string
      enum:
        - manual
        - plaid
        - statements
        - gusto
      title: ExternalAccountSource
    ExternalAccountStatus:
      type: string
      enum:
        - connected
        - disconnected
        - untracked
      title: ExternalAccountStatus
  securitySchemes:
    OAuth2PasswordBearer:
      type: oauth2
      flows:
        password:
          scopes: {}
          tokenUrl: /v0/auth/token

````