# Convert UBL to JSON

For the case where the next step is code, not a spreadsheet. The invoice comes out as JSON with the same field names the other exports use.

Source: https://tally-stick.com/ubl-to-json

## Why JSON and not the raw XML

The raw XML is already structured, but the way the standard wants, not the way an integration wants: deeply nested, namespace-prefixed, with the same value reachable by three paths. The JSON here is the flattened result of the mapping, so a UBL file and a CII file produce the same keys and your code stops caring which syntax arrived.

## What you get out

- document, seller, buyer, lines, tax, totals and payment as objects
- The same key names across every input format the tool reads
- Numbers as numbers, dates in ISO form
- The detected format and syntax included in the payload

## Questions

### Is there an API?

Not yet. This page is a browser tool: the JSON is produced on your machine and downloaded. An API endpoint is on the paid roadmap, so say on the feedback form if that is what you actually need.

### Is the schema stable?

The key names are the ones documented in the field list on the home page and they have not moved. Treat additions as possible and removals as unlikely.

### Can I convert several files at once?

One file at a time here, within the fair usage limit. Folder and ZIP batches are the paid side of the split.

## Related

- [UBL to Excel](https://tally-stick.com/ubl-invoice-to-excel)
- [CII to Excel](https://tally-stick.com/cii-to-excel)
- [Peppol BIS to Excel](https://tally-stick.com/peppol-bis-to-excel)
- [FatturaPA to Excel](https://tally-stick.com/fatturapa-to-excel)
- [PDF invoice to JSON](https://tally-stick.com/pdf-to-json)

## How it works

The invoice is read on your own device. No file is uploaded, no account is required, and the fair usage limit is the only cap. Exports are PDF, Excel, CSV and JSON.
