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

# Creare conti virtuali in batch

Questo endpoint ti permette di creare più conti virtuali contemporaneamente, semplificando il processo di creazione quando gestisci un numero elevato di conti. Tramite un array puoi creare da 10 a 5000 conti virtuali.


## OpenAPI

````yaml openapi/it/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: Creare conti virtuali in batch
      operationId: request-batch
      parameters:
        - name: Authorization
          in: header
          description: >-
            Token di accesso Bearer per l'autenticazione. Questo token si
            ottiene dagli endpoint [Ottenere il token di
            accesso](/it/reference/get-token) o [Rinnovare il token di
            accesso](/it/reference/refresh-token).
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                externalId:
                  type: string
                  description: >-
                    Identificatore univoco che fornisci per l'intero processo
                    batch. Questo ID verrà usato per tracciare l'operazione
                    batch nel suo complesso e farvi riferimento.
                accountNumber:
                  type: string
                  description: Numero di conto Localpayment.
                country:
                  type: string
                  enum:
                    - ARG
                    - BRA
                    - CHL
                    - MEX
                  description: '[Paese](/it/reference/country-codes). ISO 3166-1 alpha-3.'
                name:
                  type: string
                accounts:
                  type: array
                  items:
                    type: object
                    properties:
                      externalId:
                        type: string
                        description: >-
                          Identificatore univoco che fornisci per conti virtuali
                          specifici all'interno del batch. Questo ID diventerà
                          il riferimento principale per questo singolo conto in
                          tutte le operazioni future (ad es. verifica dello
                          stato, disattivazione).
                      beneficiary:
                        type: object
                        description: "Persona fisica o entità che riceverà i fondi versati su questo conto virtuale. Il beneficiario è il destinatario finale del denaro e non è necessariamente il proprietario legale o il titolare del conto virtuale stesso.\r\n"
                        properties:
                          type:
                            type: string
                            enum:
                              - COMPANY
                              - INDIVIDUAL
                            description: Tipo di beneficiario.
                          name:
                            type: string
                            description: >-
                              Nome del beneficiario. I caratteri consentiti
                              dipendono dal campo `type`: per `individual`,
                              lettere (inclusi i caratteri accentati), spazi e
                              punti (`.`); per `company`, lo stesso insieme più
                              cifre, trattino basso (`_`) e trattino (`-`).
                            minLength: 2
                            maxLength: 255
                          document:
                            type: object
                            description: Documentazione del beneficiario.
                            properties:
                              type:
                                type: string
                                description: >-
                                  Il [tipo di documento
                                  d'identità](/it/reference/identity-document-types),
                                  ad esempio un numero di identità nazionale, un
                                  numero di previdenza sociale o una patente di
                                  guida, a seconda del paese di emissione.
                                examples:
                                  - RUC
                              id:
                                type: string
                                description: >-
                                  Numero del documento d'identità (di solito un
                                  numero). Deve essere un numero valido secondo
                                  le regole del tipo di documento specifico.
                                examples:
                                  - '1791234561009'
                            required:
                              - type
                              - id
                            examples:
                              - type: RUC
                                id: '1791234561009'
                          lastName:
                            type: string
                            description: >-
                              Cognome del beneficiario. Obbligatorio quando
                              `type` è `individual` e ignorato quando `type` è
                              `company`. I caratteri consentiti dipendono da
                              `type`: per `individual`, lettere (inclusi i
                              caratteri accentati), spazi e punti (`.`); per
                              `company`, lo stesso insieme più cifre, trattino
                              basso (`_`) e trattino (`-`).
                            minLength: 2
                            maxLength: 255
                          address:
                            type: object
                            description: Indirizzo del beneficiario.
                            properties:
                              street:
                                type: string
                                description: Nome della via.
                                examples:
                                  - Independencia
                              number:
                                type: string
                                description: Numero civico.
                                examples:
                                  - '123'
                              city:
                                type: string
                                description: Città.
                                examples:
                                  - Cordoba
                              state:
                                type: string
                                description: Stato.
                                examples:
                                  - Cordoba
                              country:
                                type: string
                                description: Paese dell'indirizzo.
                                examples:
                                  - Argentina
                              zipCode:
                                type: string
                                description: Codice postale.
                                examples:
                                  - X5000IUO
                              comment:
                                type: string
                                description: Informazioni aggiuntive sull'indirizzo.
                                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: >-
                      Identificatore univoco di questo processo batch. È lo
                      stesso externalId che hai fornito nella richiesta e
                      conferma l'operazione batch che stai consultando.
                  internalId:
                    type: string
                    description: Identificatore della transazione Localpayment.
                  accountNumber:
                    type: string
                    description: Numero di conto Localpayment.
                  status:
                    $ref: '#/components/schemas/status'
                  comment:
                    type: string
                    description: Informazioni aggiuntive.
                  errors:
                    type: array
                    description: Informazioni aggiuntive sull'errore.
                    items:
                      type: object
                      properties:
                        code:
                          type: string
                          description: Codice di errore.
                        detail:
                          type: string
                          description: Dettagli dell'errore.
                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: Richiesta non valida.
          content:
            application/json:
              schema:
                type: object
                properties:
                  timestamp:
                    type: string
                    description: Tempo di esecuzione del servizio.
                  status:
                    type: integer
                    description: Codice di stato dell'errore.
                  error:
                    type: string
                    description: Descrizione dell'errore.
                  message:
                    type: string
                    description: Messaggio con informazioni aggiuntive.
                  path:
                    type: string
                    description: Percorso del servizio.
                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: Non autorizzato.
          content:
            application/json:
              schema:
                type: object
                properties:
                  detail:
                    type: string
                    description: Informazioni aggiuntive della risposta.
                  code:
                    type: string
                    description: Codice di stato.
                  messages:
                    type: array
                    description: Elenco dei messaggi.
                    items:
                      type: object
                      properties:
                        token_class:
                          type: string
                          description: Classe del token.
                        token_type:
                          type: string
                          description: Tipo di token.
                        message:
                          type: string
                          description: Messaggio con informazioni aggiuntive.
                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: Errore interno del server
          content:
            application/json:
              schema:
                type: object
                properties:
                  timestamp:
                    type: string
                    description: Tempo di esecuzione del servizio.
                  status:
                    type: integer
                    description: Codice di stato dell'errore.
                  error:
                    type: string
                    description: Descrizione dell'errore.
                  message:
                    type: string
                    description: Messaggio con informazioni aggiuntive.
                  path:
                    type: string
                    description: Percorso del servizio.
                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: Stato dell'operazione.
      properties:
        code:
          type: string
          description: Codice di stato.
        description:
          type: string
          description: Descrizione dello stato.
        detail:
          type: string
          description: Informazioni aggiuntive sullo stato.
  securitySchemes:
    token:
      type: http
      scheme: bearer

````

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