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

# Batch import of accounts

> Batch data import involve processing large volumes of account data at once.



## OpenAPI

````yaml /api/openapi_api_adapter.json post /amlyze-ws-rest/batch-accounts
openapi: 3.1.0
info:
  title: OpenAPI definition
  version: v0
servers:
  - url: https://{{baseUrl}}
    description: Generated server url
security:
  - bearerAuth: []
tags: []
paths:
  /amlyze-ws-rest/batch-accounts:
    post:
      tags:
        - account
      summary: Batch import of accounts
      description: >-
        Batch data import involve processing large volumes of account data at
        once.
      operationId: batchAccounts
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/BatchAccountsRequestDataApi'
            examples:
              mandatory_fields:
                summary: Mandatory fields example
                value:
                  accounts:
                    - communicationNumber: 1b1e1c23-f62f-4338-90b9-8d54993dd2cd
                      requester: SYSTEMX
                      businessUnit: sandbox
                      businessEntityExtId: ORG_IMPORT_B1_TEST
                      accountExtId: accountExtId3
                      accountNumber: LI9208800274335945522
                      accountStatus: ACTIVE
                      currencyCode: EUR
                      openingDate: '2023-09-05T08:07:34.605Z'
                      bic: AMLYZEXX22
                      isOtherFinInstAccount: true
                    - communicationNumber: 1b1e1c23-f62f-4338-90b9-8d54993dd2cd
                      requester: SYSTEMX
                      businessUnit: sandbox
                      businessEntityExtId: ORG_C1_TEST
                      accountExtId: accountExtId4
                      accountNumber: LI9208800274335945523
                      accountStatus: ACTIVE
                      currencyCode: EUR
                      openingDate: '2023-09-05T08:07:34.605Z'
                      bic: SANDLT00XXX
        required: true
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BatchAccountsResponseDataApi'
              examples:
                all_accepted:
                  summary: All requests accepted
                  value:
                    results:
                      - resultType: REQUEST_ACCEPTED
                        communicationNumber: 1b1e1c23-f62f-4338-90b9-8d54993dd2cd
                        accountExtId: accountExtId0
                        businessUnit: sandbox
                        timeElapsedMs: 203
                      - resultType: REQUEST_ACCEPTED
                        communicationNumber: 1b1e1c23-f62f-4338-90b9-8d54993dd2cd
                        accountExtId: accountExtId0
                        businessUnit: sandbox
                        timeElapsedMs: 203
                    timeElapsedMs: 408
                partial_rejection:
                  summary: Partial rejection
                  value:
                    results:
                      - resultType: REQUEST_ACCEPTED
                        communicationNumber: 1b1e1c23-f62f-4338-90b9-8d54993dd2cd
                        accountExtId: accountExtId0
                        businessUnit: sandbox
                        timeElapsedMs: 203
                      - resultType: REQUEST_REJECTED
                        communicationNumber: 1b1e1c23-f62f-4338-90b9-8d54993dd2cd
                        accountExtId: accountExtId1
                        businessUnit: sandbox
                        errorCode: O005
                        errorDescription: CommunicationNumber already used in AMLYZE
                        timeElapsedMs: 20
                    timeElapsedMs: 223
        '400':
          description: >-
            Bad Request. The request is invalid, e.g., the JSON body is
            malformed or a mandatory field is missing. A list of possible error
            codes and their descriptions is available in the endpoint
            documentation.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiAdapterErrorResponse'
              example:
                timestamp: '2024-05-26T16:49:50.237+00:00'
                status: 400
                error: Bad Request
                path: /amlyze-ws-rest/batch-accounts
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiAdapterErrorResponse'
              example:
                errorCode: '500'
                errorDescription: Processing failed
                timeElapsedMs: 172
components:
  schemas:
    BatchAccountsRequestDataApi:
      properties:
        accounts:
          items:
            $ref: '#/components/schemas/AmlyzeAccountApi'
          type: array
      required:
        - accounts
      type: object
    BatchAccountsResponseDataApi:
      properties:
        errorCode:
          description: Error code.
          type: string
        errorDescription:
          description: Error description.
          type: string
        results:
          items:
            $ref: '#/components/schemas/BatchAccountResultApi'
          type: array
        timeElapsedMs:
          description: Time elapsed in milliseconds.
          format: int64
          type: integer
      type: object
    ApiAdapterErrorResponse:
      properties:
        errorCode:
          type: string
        errorDescription:
          type: string
        resultType:
          type: string
        errors:
          type: array
          items:
            type: string
        timestamp:
          type: string
        status:
          type: number
        error:
          type: string
        path:
          type: string
    AmlyzeAccountApi:
      properties:
        accountExtId:
          description: >-
            External account identification number used to track activity
            regarding the specific account.
          type: string
        accountNumber:
          description: Unique account identification number used in performing operations.
          type: string
        accountPurpose:
          description: The purpose of owning the account in question.
          type: string
        accountStatus:
          description: >-
            Refers to the current condition or state of an account. `ACTIVE` -
            Account is in use. `SUSPENDED` - Account is restricted. `CLOSED` -
            Account is disabled.
          enum:
            - ACTIVE
            - CLOSED
            - SUSPENDED
          type: string
        accountType:
          description: >-
            Categorizes accounts by their intended purposes and features. Values
            can be retrieved from the `/classifier/accountType` endpoint.
          type: string
          x-dynamic-enum:
            path: /classifier/accountType
            valueField: code
        action:
          description: >-
            Element is used to indicate whether an account needs to be created
            or the existing account's data to be updated. If not provided,
            'CREATE' is the default. When using 'UPDATE', all existing data for
            the account will be replaced by the new data provided.
          enum:
            - CREATE
            - UPDATE
          type: string
        bankTitle:
          description: Title of the bank with which the operations are happening.
          type: string
        bic:
          description: >-
            Bank identifier code for account number. Mandatory if
            `isOtherFinInstAccount` is `true`.
          type: string
        businessEntityExtId:
          description: >-
            External business entity indicator. Refers to the same value used
            for the `customerExtId`, which links an account to a customer. This
            identifier corresponds to the client's identifier in the financial
            institution.
          type: string
        businessUnit:
          description: >-
            It serves to specify the unique identifier for the business unit.
            Business units are logical groupings of users and data. Each
            business unit can have its own set of users, permissions, and data
            access rules. Value is taken from /classifier/businessUnit
            endpoint.❗Mandatory field for clients utilizing a
            multi-organizational solution. Omit this parameter unless instructed
            about it. 
          maxLength: 255
          type: string
          x-dynamic-enum:
            path: /classifier/businessUnit
            valueField: code
        closingDate:
          description: >-
            Account closing date. Timestamp format: RFC 3339 (ISO 8601).
            Mandatory if `accountStatus` is `CLOSED`. if `accountStatus`:
            `SUSPENDED`, instead of `closingDate` field, `suspensionReasons`
            field could be provided. e.g. `suspensionReasons`:`Security breach
            investigation in progress.`
          format: date-time
          type: string
        communicationNumber:
          description: >-
            Unique number of communication. It is used for risk assessment
            callback.
          maxLength: 255
          type: string
        currencyCode:
          description: International currency code.
          type: string
        isOtherFinInstAccount:
          description: >-
            Declaring whether the account belongs to other financial
            institution. If true, the `bic` value needs to be provided.
          type: boolean
        openingDate:
          description: 'Account opening date. Timestamp format: RFC 3339 (ISO 8601)'
          format: date-time
          type: string
        requester:
          description: Name of the system requesting web service.
          maxLength: 100
          type: string
        suspensionReasons:
          description: >-
            A reason for suspension. Can only be provided if `accountStatus` is
            `SUSPENDED`.
          type: string
      required:
        - accountExtId
        - accountNumber
        - accountStatus
        - businessEntityExtId
        - communicationNumber
        - currencyCode
        - openingDate
        - requester
      type: object
    BatchAccountResultApi:
      properties:
        accountExtId:
          description: External account identification number.
          type: string
        businessUnit:
          description: >-
            Mandatory field for clients utilizing a multi-organizational
            solution. It serves to specify the unique identifier for the
            business unit. Business units are logical groupings of users and
            data. Each business unit can have its own set of users, permissions,
            and data access rules.
          type: string
        communicationNumber:
          description: >-
            Unique number of communication. It is used for risk assessment
            callback.
          maxLength: 255
          type: string
        errorCode:
          description: Error code.
          type: string
        errorDescription:
          description: Error description.
          type: string
        resultType:
          description: Result type.
          enum:
            - ERROR
            - OK
          type: string
        timeElapsedMs:
          description: Time elapsed in milliseconds.
          format: int64
          type: integer
      type: object
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

````