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

# Getting started

> YoFacturo API and developer documentation.

# About YoFacturo

YoFacturo is a Spanish invoicing platform that lets organizations create, issue, and manage invoices in compliance with Spanish fiscal regulations, including the **VeriFactu** system for real-time invoice synchronization with the Spanish tax authorities (AEAT).

## What you can do with the API

The YoFacturo API v1 allows external systems and integrations to:

* **Submit invoice batches** — send up to 1,000 invoices per request for asynchronous processing and issuance.
* **Track batch status** — poll the status of submitted batches and inspect the processing result of each individual invoice.
* **Monitor VeriFactu synchronization** — check whether each invoice has been synchronized with Spain's VeriFactu fiscal system.

## Who is this documentation for?

This documentation is aimed at **developers** integrating third-party systems (ERPs, billing tools, accounting software) with YoFacturo programmatically via the REST API.

If you are an end user of the YoFacturo web application, visit [app.yofacturo.es](https://app.yofacturo.es) instead.

## Key concepts

| Concept                             | Description                                                                                                              |
| ----------------------------------- | ------------------------------------------------------------------------------------------------------------------------ |
| **Organization**                    | The billing entity in YoFacturo. Each organization has an `api_key` used to authenticate API requests.                   |
| **Invoice Batch** (`invoice_batch`) | A container of 1–1,000 invoices submitted in a single API call. Batches are processed asynchronously.                    |
| **Batch Invoice** (`batch_invoice`) | An individual invoice inside a batch. Tracks `processing_status` and `verifactu_state`.                                  |
| **VeriFactu**                       | Spain's real-time invoice verification system managed by AEAT. Issued invoices are automatically submitted to VeriFactu. |
| **Session Token**                   | A short-lived bearer token (24 h) obtained by exchanging your `api_key`. Required for all protected endpoints.           |

## Quick start

<Steps>
  <Step title="Get your API key" />

  <Step title="Exchange it for a session token">
    ```bash theme={null}
    curl -X POST https://app.yofacturo.es/api/v1/auth/sessions \
      -H "Content-Type: application/json" \
      -d '{"api_key": "your_api_key_here"}'
    ```
  </Step>

  <Step title="Submit an invoice batch">
    Use the `session_token` from the previous step as a Bearer token to call `POST /api/v1/invoice_batches`.
  </Step>
</Steps>
