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

# Create Virtual Accounts in Batch

This endpoint enables you to create multiple virtual accounts simultaneously, streamlining the account creation process when dealing with a large number of accounts. You can create virtual accounts between 10 and 5000 through an array.


## OpenAPI

````yaml openapi/localpayment.json POST /api/virtual-account-batch
openapi: 3.1.0
info:
  version: '1.0'
  title: Localpayment
  contact:
    name: Support
    url: mailto:support@localpayment.com
servers:
  - url: https://api.stage.localpayment.com
    description: Stage
security:
  - token: []
paths:
  /api/virtual-account-batch:
    post:
      summary: Create Virtual Accounts in Batch
      operationId: request-batch
      parameters:
        - name: Authorization
          in: header
          description: >-
            Bearer access token for authentication. This token is obtained from
            the [Get Access Token](/reference/get-token) or [Refresh Access
            Token](/reference/refresh-token) endpoints.
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                externalId:
                  type: string
                  description: >-
                    A unique identifier that you provide for this entire batch
                    process. This ID will be used to track and reference the
                    batch operation as a whole.
                accountNumber:
                  type: string
                  description: Localpayment account number.
                country:
                  type: string
                  enum:
                    - ARG
                    - BRA
                    - CHL
                    - MEX
                  description: '[Country](/reference/country-codes). ISO 3166-1 alpha-3.'
                name:
                  type: string
                accounts:
                  type: array
                  items:
                    type: object
                    properties:
                      externalId:
                        type: string
                        description: >-
                          A unique identifier that you provide for specific
                          virtual accounts within the batch. This ID will become
                          the primary reference for this individual account in
                          all future operations (e.g., checking status,
                          disabling).
                      beneficiary:
                        type: object
                        description: "The individual or entity that will receive the funds paid into this virtual account. The beneficiary is the final recipient of the money and is not necessarily the legal owner or holder of the virtual account itself.\r\n"
                        properties:
                          type:
                            type: string
                            enum:
                              - COMPANY
                              - INDIVIDUAL
                            description: Beneficiary type.
                          name:
                            type: string
                            description: >-
                              The beneficiary's name. Allowed characters depend
                              on the `type` field: for `individual`, letters
                              (including accented characters), spaces, and dots
                              (`.`); for `company`, the same set plus digits,
                              underscore (`_`), and hyphen (`-`).
                            minLength: 2
                            maxLength: 255
                          document:
                            type: object
                            description: Beneficiary documentation.
                            properties:
                              type:
                                type: string
                                description: >-
                                  The type of [identity document
                                  types](/reference/identity-document-types),
                                  such as a National Identity Number, Social
                                  Security Number, or Driver's License,
                                  depending on the country of issuance.
                                examples:
                                  - RUC
                              id:
                                type: string
                                description: >-
                                  Identity document number (usually a number).
                                  This must be a valid number according to the
                                  rules for the specific document type.
                                examples:
                                  - '1791234561009'
                            required:
                              - type
                              - id
                            examples:
                              - type: RUC
                                id: '1791234561009'
                          lastName:
                            type: string
                            description: >-
                              The beneficiary's last name. Required when `type`
                              is `individual` and ignored when `type` is
                              `company`. Allowed characters depend on `type`:
                              for `individual`, letters (including accented
                              characters), spaces, and dots (`.`); for
                              `company`, the same set plus digits, underscore
                              (`_`), and hyphen (`-`).
                            minLength: 2
                            maxLength: 255
                          address:
                            type: object
                            description: Beneficiary address.
                            properties:
                              street:
                                type: string
                                description: Street name.
                                examples:
                                  - Independencia
                              number:
                                type: string
                                description: Street number.
                                examples:
                                  - '123'
                              city:
                                type: string
                                description: City.
                                examples:
                                  - Cordoba
                              state:
                                type: string
                                description: State.
                                examples:
                                  - Cordoba
                              country:
                                type: string
                                description: Address country.
                                examples:
                                  - Argentina
                              zipCode:
                                type: string
                                description: Zip code.
                                examples:
                                  - X5000IUO
                              comment:
                                type: string
                                description: Additional address information.
                                examples:
                                  - Sucursal 123
                            examples:
                              - street: Independencia
                                number: '123'
                                city: Cordoba
                                state: Cordoba
                                country: ARG
                                zipCode: X5000IUO
                                comment: Sucursal 123
                        required:
                          - type
                          - name
                          - document
                        examples:
                          - type: INDIVIDUAL
                            name: John
                            document:
                              type: RUC
                              id: '1791234561009'
                            lastName: Doe
                            address:
                              street: Independencia
                              number: '123'
                              city: Cordoba
                              state: Cordoba
                              country: ARG
                              zipCode: X5000IUO
                              comment: Sucursal 123
                    required:
                      - beneficiary
              required:
                - externalId
                - accountNumber
                - country
                - accounts
              x-examples:
                Example 1:
                  externalId: '{{$guid}}'
                  accountNumber: '{{YourAccountNumber}}'
                  country: MEX
                  name: Virtual Account
                  accounts:
                    - externalId: 1111111111-1
                      beneficiary:
                        type: INDIVIDUAL
                        name: BeneficiaryName
                        lastname: BeneficiaryLastname
                        document:
                          id: EXTF900101NI1
                          type: RFC
                        address:
                          city: city
                          state: state
                          zipcode: zipcode
                          street: street
                          number: number
                          country: country
                    - externalId: 1111111111-2
                      beneficiary:
                        type: INDIVIDUAL
                        name: BeneficiaryName
                        lastname: BeneficiaryLastname
                        document:
                          id: EXTF900101NI1
                          type: RFC
                    - externalId: 1111111111-3
                      beneficiary:
                        type: INDIVIDUAL
                        name: BeneficiaryName
                        lastname: BeneficiaryLastname
                        document:
                          id: EXTF900101NI1
                          type: RFC
                        address:
                          city: city
                          state: state
                          zipcode: zipcode
                          street: street
                          number: number
                          country: country
                    - externalId: 1111111111-4
                      beneficiary:
                        type: INDIVIDUAL
                        name: BeneficiaryName
                        lastname: BeneficiaryLastname
                        document:
                          id: EXTF900101NI1
                          type: RFC
                    - externalId: 1111111111-5
                      beneficiary:
                        type: INDIVIDUAL
                        name: BeneficiaryName
                        lastname: BeneficiaryLastname
                        document:
                          id: EXTF900101NI1
                          type: RFC
                        address:
                          city: city
                          state: state
                          zipcode: zipcode
                          street: street
                          number: number
                          country: country
                    - externalId: 1111111111-6
                      beneficiary:
                        type: INDIVIDUAL
                        name: BeneficiaryName
                        lastname: BeneficiaryLastname
                        document:
                          id: EXTF900101NI1
                          type: RFC
                    - externalId: 1111111111-7
                      beneficiary:
                        type: INDIVIDUAL
                        name: BeneficiaryName
                        lastname: BeneficiaryLastname
                        document:
                          type: RFC
                          id: EXTF900101NI1
                        address:
                          city: city
                          state: state
                          zipcode: zipcode
                          street: street
                          number: number
                          country: country
                    - externalId: 1111111111-8
                      beneficiary:
                        type: INDIVIDUAL
                        name: BeneficiaryName
                        lastname: BeneficiaryLastname
                        document:
                          id: EXTF900101NI1
                          type: RFC
                    - externalId: 1111111111-9
                      beneficiary:
                        type: INDIVIDUAL
                        name: BeneficiaryName
                        lastname: BeneficiaryLastname
                        document:
                          id: EXTF900101NI1
                          type: RFC
                        address:
                          city: city
                          state: state
                          zipcode: zipcode
                          street: street
                          number: number
                          country: country
                    - externalId: 1111111111-10
                      beneficiary:
                        type: INDIVIDUAL
                        name: BeneficiaryName
                        lastname: BeneficiaryLastname
                        document:
                          id: EXTF900101NI1
                          type: RFC
                    - externalId: 1111111111-11
                      beneficiary:
                        type: INDIVIDUAL
                        name: BeneficiaryName
                        lastname: BeneficiaryLastname
                        document:
                          id: EXTF900101NI1
                          type: RFC
                        address:
                          city: city
                          state: state
                          zipcode: zipcode
                          street: street
                          number: number
                          country: country
                    - externalId: 1111111111-12
                      beneficiary:
                        type: INDIVIDUAL
                        name: BeneficiaryName
                        lastname: BeneficiaryLastname
                        document:
                          id: EXTF900101NI1
                          type: RFC
                        address:
                          city: city
                          state: state
                          zipcode: zipcode
                          street: street
                          number: number
                          country: country
            examples:
              100 - Batch Process Virtual Account in progress.:
                value:
                  externalId: de14bcf2-45ee-22e3-ab59-99c3fcba31e8
                  accountNumber: '{{yourLocalpaymentAccountNumber}}'
                  country: MEX
                  name: Virtual Account
                  accounts:
                    - externalId: 9210b519-5c29-4419-8d28-04f7543a914f
                      beneficiary:
                        type: INDIVIDUAL
                        name: Zhang
                        lastname: Wei
                        document:
                          id: EXTF900101NI1
                          type: RFC
                    - externalId: e4914217-41bc-49a5-b2f8-df950bf9bae7
                      beneficiary:
                        type: INDIVIDUAL
                        name: John
                        lastname: Doe
                        document:
                          id: EXTF900101NI2
                          type: RFC
              300 - Invalid params.:
                value:
                  externalId: de14bcf2-45ee-22e3-ab59-99c3fcba31e8
                  accountNumber: '{{accountNumber}}'
                  country: MEX
                  name: Virtual Account
                  accounts:
                    - externalId: 9210b519-5c29-4419-8d28-04f7543a914f
                    - externalId: e4914217-41bc-49a5-b2f8-df950bf9bae7
                      beneficiary:
                        type: INDIVIDUAL
                        name: John
                        lastname: Doe
                        document:
                          id: EXTF900101NI2
                          type: RFC
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  externalId:
                    type: string
                    description: >-
                      The unique identifier for this batch process. This is the
                      same externalId you provided in the request, confirming
                      the batch operation you are querying.
                  internalId:
                    type: string
                    description: Localpayment transaction identifier.
                  accountNumber:
                    type: string
                    description: Localpayment account number.
                  status:
                    $ref: '#/components/schemas/status'
                  comment:
                    type: string
                    description: Additional information.
                  errors:
                    type: array
                    description: Additional error information.
                    items:
                      type: object
                      properties:
                        code:
                          type: string
                          description: Error code.
                        detail:
                          type: string
                          description: Error details.
                x-examples:
                  Example 1:
                    externalId: 7facbbbf-d279-4ab5-9aeb-7583fa3f35ec
                    internalId: 1748f8f8-dcac-45d7-b1fc-7d6569245d84
                    accountNumber: '{{YourAccountNumber}}'
                    status:
                      code: '100'
                      description: INPROGRESS
                      detail: Batch Process Virtual Account in progress
                    comment: >-
                      For obtaining the asynchronous response, kindly submit a
                      request to the service after a brief interval. GET
                      {api_environment_url}/api/virtual-account-batch/7facbbbf-d279-4ab5-9aeb-7583fa3f35ec
              examples:
                100 - Batch Process Virtual Account in progress.:
                  value:
                    externalId: 7facbc4f-4c79-4a15-caeb-75833a3f35ec
                    internalId: 1748f8f8-dcac-4547-b3fb-7d6529245d84
                    accountNumber: '{{yourLocalpaymentAccountNumber}}'
                    status:
                      code: '100'
                      description: INPROGRESS
                      detail: Batch Process Virtual Account in progress
                    comment: >-
                      For obtaining the asynchronous response, kindly submit a
                      request to the service after a brief interval. GET
                      {api_environment_url}/api/virtual-account-batch/7facbbbf-d279-4ab5-9aeb-7583fa3f35ec
                300 - Invalid params.:
                  value:
                    externalId: 2f3cb0ac-1c4b-471d-a43f-1af10867d716
                    status:
                      code: '300'
                      description: REJECTED
                      detail: Invalid param + [document.id] + verification failed
                    errors:
                      - code: '300'
                        detail: Invalid param + [document.id] + verification failed
                501 - Country not found.:
                  value:
                    externalId: 75743a87-6d5e-42c4-a2ff-c596a6a27182
                    status:
                      code: '501'
                      description: REJECTED
                      detail: Country not found
                    errors:
                      - code: '501'
                        detail: Country not found
        '400':
          description: Bad Request.
          content:
            application/json:
              schema:
                type: object
                properties:
                  timestamp:
                    type: string
                    description: Service execution time.
                  status:
                    type: integer
                    description: Error status code.
                  error:
                    type: string
                    description: Error description.
                  message:
                    type: string
                    description: Message with additional information.
                  path:
                    type: string
                    description: Service path.
                x-examples:
                  Example 1:
                    timestamp: '2025-01-03T14:52:43.271+00:00'
                    status: 400
                    error: Bad Request.
                    message: Count can not be blank
                    path: /virtual-account/batch
              examples:
                400 - Count can not be blank.:
                  value:
                    timestamp: '2025-01-03T14:52:43.271+00:00'
                    status: 400
                    error: Bad Request.
                    message: Count can not be blank
                    path: /virtual-account/batch
                400 - External ID already used - Duplication.:
                  value:
                    timestamp: '2025-01-03T22:03:39.657+00:00'
                    status: 400
                    error: Bad Request.
                    message: External ID already used - Duplication
                    path: /virtual-account/batch
        '401':
          description: Unauthorized.
          content:
            application/json:
              schema:
                type: object
                properties:
                  detail:
                    type: string
                    description: Additional information of the response.
                  code:
                    type: string
                    description: Status code.
                  messages:
                    type: array
                    description: Message list.
                    items:
                      type: object
                      properties:
                        token_class:
                          type: string
                          description: Token class.
                        token_type:
                          type: string
                          description: Token type.
                        message:
                          type: string
                          description: Message with additional information.
                x-examples:
                  Example 1:
                    detail: Given token not valid for any token type
                    code: token_not_valid
                    messages:
                      - token_class: AccessToken
                        token_type: access
                        message: Token is invalid or expired
              examples:
                401 - Token is invalid or expired:
                  value:
                    detail: Given token not valid for any token type
                    code: token_not_valid
                    messages:
                      - token_class: AccessToken
                        token_type: access
                        message: Token is invalid or expired
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                type: object
                properties:
                  timestamp:
                    type: string
                    description: Service execution time.
                  status:
                    type: integer
                    description: Error status code.
                  error:
                    type: string
                    description: Error description.
                  message:
                    type: string
                    description: Message with additional information.
                  path:
                    type: string
                    description: Service path.
                x-examples:
                  Example 1:
                    timestamp: '2025-01-03T22:02:09.745+00:00'
                    status: 500
                    error: Internal Server Error
                    message: >-
                      query did not return a unique result: 12; nested exception
                      is javax.persistence.NonUniqueResultException: query did
                      not return a unique result: 12
                    path: /virtual-account/batch
              examples:
                500 - Query did not return a unique result.:
                  value:
                    timestamp: '2025-01-03T22:02:09.745+00:00'
                    status: 500
                    error: Internal Server Error
                    message: >-
                      query did not return a unique result: 12; nested exception
                      is javax.persistence.NonUniqueResultException: query did
                      not return a unique result: 12
                    path: /virtual-account/batch
      security:
        - token: []
      servers:
        - url: https://api.stage.localpayment.com
          description: Stage
components:
  schemas:
    status:
      type: object
      title: status
      description: Operation status.
      properties:
        code:
          type: string
          description: Status code.
        description:
          type: string
          description: Status description.
        detail:
          type: string
          description: Additional status information.
  securitySchemes:
    token:
      type: http
      scheme: bearer

````

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