## LROE - Modify received invoices

`PUT`  https://{entorno}.ticketbaiws.eus/lroe-recibidas/

**IMPORTANT: This method is only valid for BATUZ Bizkaia.**  Lets you modify received invoices (purchases) previously sent to the Batuz LROE

**PARAMETERS**

- `ejercicio` (integer, required): Fiscal year of the batch of received invoices, in yyyy format. Ejemplo: `2023`
- `facturas` (object array, required (max 1000) records)
  - `fecha` (string, required): Invoice issue date in dd/mm/yyyy format. Ejemplo: `13/11/2023`
  - `fecha_operacion` (string, optional): Date on which the transaction took place, if different from the issue date, in dd/mm/yyyy format. Ejemplo: `13/11/2023`
  - `fecha_recepcion` (string, optional): Date the invoice was received, in dd/mm/yyyy format. Ejemplo: `13/11/2023`
  - `nif` (string, required): NIF (Spanish tax ID) of the invoice issuer. Ejemplo: `B01000012`
  - `pais` (string, optional): Two-letter country code of the invoice issuer if the supplier's tax ID is foreign (ISO-3166 Alpha-2 code format) Ejemplo: `ES`
  - `nombre_social` (string, required): Company name of the supplier issuing the invoice. Ejemplo: `Empresa de ejemplo S.L.`
  - `num_factura` (string, required): Invoice number. Ejemplo: `2023715273`
  - `descripcion` (string, required): Description of the transaction (sent to Batuz as DescripcionOperacion). Maximum 250 characters. Ejemplo: `Factura móviles`
  - `descripción` (string, required): Description of the service and/or product on the invoice. Ejemplo: `Factura móviles`
  - `importacion` (boolean, required): Whether it is an import invoice. Ejemplo: `false`
  - `tipo_factura` (enum, required): Invoice type: inversion or gasto. Ejemplo: `gasto`
  - `importe_total` (float, required): Invoice total amount, VAT included. Ejemplo: `121.00`
  - `bases` (object array., required): Tax bases of the invoice
    - `base_imponible` (float, required): Tax base amount EXCLUDING VAT. Ejemplo: `100.00`
    - `tipo_iva` (float, required): VAT percentage applied to the tax base. Ejemplo: `21.00`
    - `tipo_req` (float, required): Equivalence surcharge percentage applied to the line. Ejemplo: `0.00`
    - `epigrafe` (integer, optional, only for individuals (natural persons) in Bizkaia (LROE 140)): Indicates that the item belongs to a specific IAE activity code, different from the general one defined in the company profile or from the one defined on the invoice. Ejemplo: `197210`
  - `regimen_iva` (integer, optional): VAT special scheme code. Ejemplo: `17`
  - `regimen_iva_2` (integer, optional): VAT special scheme code 2. Ejemplo: `17`
  - `regimen_iva_3` (integer, optional): VAT special scheme code 3. Ejemplo: `17`
  - `inversion_sujeto_pasivo` (boolean, optional): Invoice subject to reverse charge. Ejemplo: `false`
  - `rectificativa` (boolean, required): Whether it is a corrective invoice. Ejemplo: `false`
  - `num_factura_rectificada` (string, required if corrective): Number of the invoice being corrected. Ejemplo: `2023000100`
  - `fecha_rectificada` (string, required): Date of the invoice being corrected, in dd/mm/yyyy format. Ejemplo: `13/11/2023`
  - `clave_rectificativa` (string, optional): Corrective invoice code (R1, R2, R3, R4, R5). If not set, R1 is used, or R5 for a simplified invoice. Ejemplo: `R1`
  - `tipo_rectificativa` (string, optional): Corrective invoice type: (S) substitution (I) by differences. If not set, it is treated as**I (by differences)**. Ejemplo: `I`
  - `base_rectificada` (float, required if corrective): Tax base of the invoice being corrected. Ejemplo: `100.00`
  - `cuota_rectificada` (float, required if corrective): VAT amount of the invoice being corrected. Ejemplo: `21.00`
  - `prorrata` (integer, optional): Deductible percentage of the invoice amount. Ejemplo: `92`

**PUT** `https://{entorno}.ticketbaiws.eus/lroe-recibidas/`

```bash
$ curl --request PUT \
     --url https://api-test.ticketbaiws.eus/lroe-recibidas/ \
     --header 'Accept: application/json' \
     --header 'Content-Type: application/json' \
     --header 'Token: xxx' \
     --header 'Nif: 00000014Z'
	 --data '
{
    "ejercicio": 2023,
    "facturas":[
        {
            "fecha": "02/09/2023",
            "nombre_social": "Empresa de ejemplo S.L.",
            "nif": "B01000012",
            "num_factura": "2023715273",
            "descripcion": "Factura móviles",
            "importacion": false,
            "tipo_factura": "gasto",
            "importe_total":121.00,
            "bases": [
                {
                    "base_imponible": 100.00,
                    "tipo_iva": 21.00,
					"tipo_req": 0,
					"epigrafe": "197210"
                }
            ],
			"regimen_iva": 1,
			"inversion_sujeto_pasivo": false,
			"rectificativa": true,
			"num_factura_rectificada": "2023015273",
			"fecha_rectificada": "13/11/2023",
			"clave_rectificativa": "R1",
			"tipo_rectificativa": "S",
			"base_rectificada": 80.00,
			"cuota_rectificada" : 16.80
        }
    ]
}'
```

Respuesta:

```json
HTTP/1.1 200 OK
{
    "result": "OK",
    "return": {
        "response": [
            {
                "fecha": "01-09-2023",
                "num_factura": "9092",
                "estado": "Incorrecto",
                "codigo_error": "B4_2000000",
                "descripcion_error": "El campo es obligatorio por lo que debe venir informado: [DescripcionOperacion].",
                "nif": "A88888888"
            },
            {
                "fecha": "01-09-2023",
                "num_factura": "9091",
                "estado": "Correcto",
                "nif": "A88888888"
            }
        ],
        "status": "ERROR"
    },
    "msg": null
}
```

Fuente: https://ticketbaiws.eus/en/lroe-recibidas-put/
