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

# Retrieve one batch invoice



## OpenAPI

````yaml /openapi.json get /api/v1/batch_invoices/{id}
openapi: 3.1.0
info:
  title: YoFacturo API v1
  version: 1.0.0
  summary: API for authentication and invoice batch ingestion and status
  description: |
    API v1 operational endpoints.

    Authentication flow:
    1. Exchange organization api_key for a session token.
    2. Use Authorization: Bearer <session_token> for protected endpoints.
servers:
  - url: https://app.yofacturo.es
security: []
tags:
  - name: Auth
  - name: Invoice Batches
  - name: Batch Invoices
paths:
  /api/v1/batch_invoices/{id}:
    get:
      tags:
        - Batch Invoices
      summary: Retrieve one batch invoice
      operationId: getBatchInvoice
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: integer
            minimum: 1
      responses:
        '200':
          description: Batch invoice found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BatchInvoiceResponse'
        '401':
          description: Missing, invalid, or expired bearer token
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: Batch invoice not found in current organization
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        - bearerAuth: []
components:
  schemas:
    BatchInvoiceResponse:
      type: object
      additionalProperties: false
      required:
        - data
      properties:
        data:
          $ref: '#/components/schemas/BatchInvoice'
    ErrorResponse:
      type: object
      additionalProperties: false
      required:
        - error
      properties:
        error:
          type: object
          additionalProperties: false
          required:
            - code
            - message
          properties:
            code:
              type: string
            message:
              type: string
    BatchInvoice:
      type: object
      additionalProperties: false
      required:
        - id
        - external_invoice_id
        - invoice_number
        - total_after_taxes
        - processing_status
        - processing_error
        - issued_invoice_id
        - verifactu_state
      properties:
        id:
          type: integer
        external_invoice_id:
          type: string
          nullable: true
        invoice_number:
          type: string
          nullable: true
        total_after_taxes:
          type: string
          nullable: true
        processing_status:
          type: string
          description: >-
            pending (just received), processing (synchronizing with external
            systems), success (correctly issued), failed (`processing_error`
            will be informed).
        processing_error:
          type: string
          nullable: true
        issued_invoice_id:
          type: integer
          nullable: true
        verifactu_state:
          type: string
          nullable: true
          enum:
            - remission
            - to_fix
            - verifactu_synced
            - pre_verifactu_issued
          description: >
            Verifactu fiscal synchronization state of the associated issued
            invoice. Indicates whether the invoice has been synchronized with
            Spain's Verifactu system.

            - `null`: Invoice has not been converted to an issued invoice yet
            (no `issued_invoice_id`)

            - `remission`: Invoice created but not yet synchronized with
            Verifactu

            - `to_fix`: Invoice needs correction before Verifactu sync can
            succeed

            - `verifactu_synced`: Invoice fully synchronized with fiscal
            authorities

            - `pre_verifactu_issued`: Invoice was issued before Verifactu became
            mandatory, so it is correct as is now.
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: token

````