## Download TicketBAI XML

`GET`  https://{entorno}.ticketbaiws.eus/tbai-xml/

This method downloads the XML files of the request sent to the corresponding Provincial Council (Diputación Foral) and of its response

**GET methods accept the parameters either in the body as a JSON payload or as a query string in the URL, as shown in the cURL example.**

**PARAMETERS**

- `serie` (string, required): Invoice series. Ejemplo: `A`
- `numero` (string, required): Invoice number. Ejemplo: `2021000123`

**GET** `https://{entorno}.ticketbaiws.eus/tbai-xml/`

```bash
$ curl --request GET \
     --url 'https://api-test.ticketbaiws.eus/tbai-xml/?serie=A&numero=2021000123' \
     --header 'Accept: application/json' \
     --header 'Token: xxx' \
     --header 'Nif: 00000014Z'
```

Respuesta:

```json
HTTP/1.1 200 OK
{
	"result": "OK",
	"return": {
		"serie" : "A",
		"numero" : "2021000123",
		"xml_request" : "<&quest;xml version='1.0' encoding='UTF-8'&quest;><T:TicketBai xmlns:T='urn:tick. ...",
		"xml_response" : "<&quest;xml version='1.0' encoding='UTF-8' standalone ..."
	},
	"msg": null
}
```

Response (with Zuzendu corrections):

```json
HTTP/1.1 200 OK
{
	"result": "OK",
	"return": [
		{
			"serie" : "A",
			"numero" : "2021000123",
			"xml_request" : "<&quest;xml version='1.0' encoding='UTF-8'&quest;> ...",
			"xml_response" : "<&quest;xml version='1.0' encoding='UTF-8' standalone ...",
			"zuzendu" : 1
		},
		{
			"serie" : "A",
			"numero" : "2021000123",
			"xml_request" : "<&quest;xml version='1.0' encoding='UTF-8'&quest;> ...",
			"xml_response" : "<&quest;xml version='1.0' encoding='UTF-8' standalone ..."
		}
	],
	"msg": null
}
```

Response (not found):

```json
HTTP/1.1 200 OK
{
	"result": "ERROR",
	"return": null,
	"msg": "TBAI Not Found"
}
```

Fuente: https://ticketbaiws.eus/en/ticketbai-xml-get/
