---
updatedAt: 2026-04-21T06:16:37.000Z
agentTools:
  projectIndex: https://b2brouter.readme.io/llms.txt
---

# Download a Ledger

Download a Ledger, the XML document sent to the Tax Authority.
For ledgers created through the import endpoint the stored document is available from creation. Natively generated ledgers are built and sent asynchronously: they cannot be downloaded until all their tax reports have been chained and the ledger has been sent.

# OpenAPI definition

```json
{
  "openapi": "3.0.1",
  "info": {
    "title": "B2Brouter API",
    "description": "The B2Brouter API allows you to send and receive electronic documents.",
    "version": "2026-06-26",
    "contact": {
      "name": "Service Delivery Team",
      "email": "servicedelivery@b2brouter.net"
    }
  },
  "servers": [
    {
      "url": "https://api-staging.b2brouter.net",
      "description": "Test server"
    },
    {
      "url": "https://api.b2brouter.net",
      "description": "Production server"
    }
  ],
  "tags": [
    {
      "name": "Ledgers",
      "description": "Related to ledgers (sets of tax reports)"
    }
  ],
  "paths": {
    "/ledgers/{id}/download": {
      "get": {
        "operationId": "download-ledger",
        "tags": [
          "Ledgers"
        ],
        "summary": "Download a Ledger",
        "description": "Download a Ledger, the XML document sent to the Tax Authority.\nFor ledgers created through the import endpoint the stored document is available from creation. Natively generated ledgers are built and sent asynchronously: they cannot be downloaded until all their tax reports have been chained and the ledger has been sent.",
        "parameters": [
          {
            "$ref": "#/components/parameters/api_version_header"
          },
          {
            "$ref": "#/components/parameters/ledger_id"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/xml": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "403": {
            "description": "Unauthorized"
          },
          "404": {
            "description": "Tax Report not found"
          }
        },
        "security": [
          {
            "api_key": []
          }
        ]
      }
    }
  },
  "components": {
    "securitySchemes": {
      "api_key": {
        "type": "apiKey",
        "description": "API Key of your account",
        "name": "X-B2B-API-Key",
        "in": "header"
      }
    },
    "parameters": {
      "api_version_header": {
        "name": "X-B2B-API-Version",
        "in": "header",
        "description": "Specifies the version of the API to use in this request. If not specified uses the API-Version set in the group conifguration\nB2Brouter UI Application -> Developers -> API Keys -> API Version\n",
        "required": false,
        "schema": {
          "type": "string",
          "example": "2026-06-26",
          "default": "2026-06-26"
        }
      },
      "ledger_id": {
        "name": "id",
        "in": "path",
        "description": "A unique internal identifier of the Ledger in B2Brouter.\n",
        "required": true,
        "example": 405,
        "schema": {
          "type": "integer"
        }
      }
    }
  }
}
```