## LROE - Send received invoices

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

**IMPORTANT: This method is only valid for BATUZ Bizkaia.**  Lets you send received invoices (purchases) 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`
  - `tipo_documento` (string, optional): Type of identification document for foreign suppliers. Defaults to 02.
    Possible values:
    **02**  => VAT ID (NIF-IVA)
    **03**  => Passport
    **04**  => Official identity document issued by the country or territory of residence,
    **05**  => Certificate of residence
    **06**  => Other supporting document. Ejemplo: `02`
  - `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.`
  - `serie` (string, optional): Invoice series. Ejemplo: `A`
  - `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`
  - `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`
    - `tipo` (enum, optional (to specify a value different from the invoice-level one)): Possible values:
      **compras**  (Purchase of current goods)
      **inversion**  (Acquisition of capital goods)
      **gasto**  (Expenses) Ejemplo: `inversion`
    - `cuota_soportada` (float, optional): If not set, the input VAT amount is calculated automatically. If you
      specify the input VAT amount, you must also specify the
      deductible amount. Ejemplo: `21.00`
    - `cuota_deducible` (float, optional): If set, the prorrata parameter has no effect. Required if you want to
      specify the input VAT amount. Ejemplo: `10.50`
    - `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`
    - `bien_afecto_irpf_iva` (integer, optional, only for individuals (natural persons) in Bizkaia (LROE 140)): Identifier specifying whether this is the acquisition of a business asset for IRPF (personal income tax) purposes or a VAT capital good. If this field is not provided, it defaults to «N». Possible values: I, R, or N. Ejemplo: `N`
    - `importe_gasto_irpf` (integer, optional, only for individuals (natural persons) in Bizkaia (LROE 140)): Amount of the expense deductible for IRPF (personal income tax) Ejemplo: `121.00`
    - `concepto_contable` (integer, optional, only for individuals (natural persons) in Bizkaia (LROE 140)): Code identifying the accounting subgroup or account. Ejemplo: `600`
    - `referencia_bien` (integer, optional, only for individuals (natural persons) in Bizkaia (LROE 140)): Reference of the business asset to which the expense in the accounting account may relate; it must match the reference shown in the business assets or capital goods section. Ejemplo: `ABC`
    - `modo_recargo_simplificado` (integer, optional, only for individuals (natural persons) in Bizkaia (LROE 140)): Identifier specifying whether the invoice was received by a taxpayer under the simplified scheme or the equivalence surcharge scheme. If this field is not provided, it defaults to «N». Possible options: E (Equivalence surcharge), N (General scheme), S (Simplified scheme) Ejemplo: `E`
  - `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`
  - `serie_factura_rectificada` (string, optional): Series of the invoice being corrected. Ejemplo: `A`
  - `num_factura_rectificada` (string, required if corrective): Number of the invoice being corrected. Ejemplo: `2023000100`
  - `fecha_rectificada` (string, required if corrective): 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`
  - `clave_factura` (string, optional): Invoice type code. Defaults to F1.
    Possible values:
    **F1**  - Invoice identifying the recipient
    **F2**  - Invoice without identifying the recipient
    **F3**  - Invoice issued to replace previously declared simplified invoices
    **F4**  - Invoice summary entry
    **F5**  - Imports with DUA (customs import declaration)
    **F6**  - Other supporting documents
    **LC**  - Customs - Supplementary assessment. Ejemplo: `F1`

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

```bash
$ curl --request POST \
     --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-post/
