@pimia/sdk 0.17.0 → 0.18.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/api.d.ts CHANGED
@@ -1563,6 +1563,37 @@ export interface paths {
1563
1563
  patch?: never;
1564
1564
  trace?: never;
1565
1565
  };
1566
+ "/invoices/{invoice}/einvoice": {
1567
+ parameters: {
1568
+ query?: never;
1569
+ header?: never;
1570
+ path?: never;
1571
+ cookie?: never;
1572
+ };
1573
+ /**
1574
+ * Descarga la factura electrónica del país del emisor
1575
+ * @description Devuelve los BYTES del documento con su tipo real en `Content-Type`
1576
+ * (`application/xml` para Facturae, `application/pdf` para Factur-X) y el
1577
+ * nombre de fichero en `Content-Disposition`. El contrato lo publica como
1578
+ * `application/octet-stream` porque el tipo depende del formato.
1579
+ *
1580
+ * Casos que no son el `200`: `404` con `{error: true, message, available}`
1581
+ * si el país del emisor no ofrece el formato pedido —o no ofrece ninguno—,
1582
+ * donde `available` lista los que sí ofrece; `422` de validación (`{message,
1583
+ * errors}`) si la factura está en borrador, sin número o sin fecha de
1584
+ * expedición —la factura electrónica solo existe sobre una factura
1585
+ * publicada—; `500` con `{error: true, message}` si el documento no se
1586
+ * pudo generar.
1587
+ */
1588
+ get: operations["eInvoice.download"];
1589
+ put?: never;
1590
+ post?: never;
1591
+ delete?: never;
1592
+ options?: never;
1593
+ head?: never;
1594
+ patch?: never;
1595
+ trace?: never;
1596
+ };
1566
1597
  "/employees": {
1567
1598
  parameters: {
1568
1599
  query?: never;
@@ -1924,7 +1955,14 @@ export interface paths {
1924
1955
  path?: never;
1925
1956
  cookie?: never;
1926
1957
  };
1927
- /** Download FacturaE XML for an invoice */
1958
+ /**
1959
+ * Download FacturaE XML for an invoice
1960
+ * @description Casos que no son el `200`: `404` con `{error: true, message}` si el
1961
+ * emisor no ofrece Facturae; `422` de validación (`{message, errors}`) si la
1962
+ * factura está en borrador, sin número o sin fecha de expedición —el
1963
+ * Facturae solo existe sobre una factura publicada—; `500` con `{error:
1964
+ * true, message}` si el XML no se pudo generar.
1965
+ */
1928
1966
  get: operations["facturae.download"];
1929
1967
  put?: never;
1930
1968
  post?: never;
@@ -1997,6 +2035,71 @@ export interface paths {
1997
2035
  patch?: never;
1998
2036
  trace?: never;
1999
2037
  };
2038
+ "/settings/fr/ereporting/transactions": {
2039
+ parameters: {
2040
+ query?: never;
2041
+ header?: never;
2042
+ path?: never;
2043
+ cookie?: never;
2044
+ };
2045
+ /**
2046
+ * Operaciones de la cola de e-reporting de la empresa, de la más reciente
2047
+ * a la más antigua. Filtros: `status` (pending, sent, attached, declared,
2048
+ * rejected, error, withdrawn), `flow_type` (10.1, 10.2, 10.3, 10.4), `from`
2049
+ * y `to` (fecha de la operación, `YYYY-MM-DD`), `per_page` (máximo 100).
2050
+ * `aggregates` va en subunidades de euro
2051
+ */
2052
+ get: operations["frEReporting.transactions"];
2053
+ put?: never;
2054
+ post?: never;
2055
+ delete?: never;
2056
+ options?: never;
2057
+ head?: never;
2058
+ patch?: never;
2059
+ trace?: never;
2060
+ };
2061
+ "/settings/fr/ereporting/reports": {
2062
+ parameters: {
2063
+ query?: never;
2064
+ header?: never;
2065
+ path?: never;
2066
+ cookie?: never;
2067
+ };
2068
+ /**
2069
+ * Reports (periodos) del e-reporting que la plateforme ha comunicado
2070
+ * para la empresa, del más reciente al más antiguo: abiertos, cerrados,
2071
+ * transmitidos al PPF, declarados o rechazados (con el motivo en `error`).
2072
+ * `per_page` máximo 100
2073
+ */
2074
+ get: operations["frEReporting.reports"];
2075
+ put?: never;
2076
+ post?: never;
2077
+ delete?: never;
2078
+ options?: never;
2079
+ head?: never;
2080
+ patch?: never;
2081
+ trace?: never;
2082
+ };
2083
+ "/settings/fr": {
2084
+ parameters: {
2085
+ query?: never;
2086
+ header?: never;
2087
+ path?: never;
2088
+ cookie?: never;
2089
+ };
2090
+ get: operations["frSettings.index"];
2091
+ /**
2092
+ * Guarda los ajustes que vengan (los que no vengan se conservan) y devuelve
2093
+ * el conjunto resuelto, como `index`
2094
+ */
2095
+ put: operations["frSettings.update"];
2096
+ post?: never;
2097
+ delete?: never;
2098
+ options?: never;
2099
+ head?: never;
2100
+ patch?: never;
2101
+ trace?: never;
2102
+ };
2000
2103
  "/gestoria-link/asesorias": {
2001
2104
  parameters: {
2002
2105
  query?: never;
@@ -2203,6 +2306,38 @@ export interface paths {
2203
2306
  patch?: never;
2204
2307
  trace?: never;
2205
2308
  };
2309
+ "/received-invoices/{received_invoice}/einvoice/approve": {
2310
+ parameters: {
2311
+ query?: never;
2312
+ header?: never;
2313
+ path?: never;
2314
+ cookie?: never;
2315
+ };
2316
+ get?: never;
2317
+ put?: never;
2318
+ post: operations["inboundEInvoice.approve"];
2319
+ delete?: never;
2320
+ options?: never;
2321
+ head?: never;
2322
+ patch?: never;
2323
+ trace?: never;
2324
+ };
2325
+ "/received-invoices/{received_invoice}/einvoice/refuse": {
2326
+ parameters: {
2327
+ query?: never;
2328
+ header?: never;
2329
+ path?: never;
2330
+ cookie?: never;
2331
+ };
2332
+ get?: never;
2333
+ put?: never;
2334
+ post: operations["inboundEInvoice.refuse"];
2335
+ delete?: never;
2336
+ options?: never;
2337
+ head?: never;
2338
+ patch?: never;
2339
+ trace?: never;
2340
+ };
2206
2341
  "/incidences/{incidence}/review": {
2207
2342
  parameters: {
2208
2343
  query?: never;
@@ -2299,6 +2434,40 @@ export interface paths {
2299
2434
  patch?: never;
2300
2435
  trace?: never;
2301
2436
  };
2437
+ "/invoices/{invoice}/fiscal": {
2438
+ parameters: {
2439
+ query?: never;
2440
+ header?: never;
2441
+ path?: never;
2442
+ cookie?: never;
2443
+ };
2444
+ /**
2445
+ * Estado fiscal de la factura, neutro al país
2446
+ * @description `country` es el país fiscal del EMISOR (`companies.country_code`, o el
2447
+ * de la config si la empresa no lo declara). `fiscal` es la fila neutra
2448
+ * —`null` mientras la factura no haya pasado por ningún registro:
2449
+ * borradores, países sin driver, módulo de cumplimiento apagado— con la
2450
+ * misma forma que `InvoiceResource.fiscal`. `driver_detail` es lo que el
2451
+ * driver del país añade preguntando a su servicio: para España, el
2452
+ * registro tal como lo tiene VeriFactu (la misma forma que
2453
+ * `GET /invoices/{invoice}/verifactu/detail`, a un nivel); para Francia
2454
+ * (#653), el ciclo de vida que la plateforme agréée ha contado
2455
+ * (`events`, en orden), el literal y código del último estado y el
2456
+ * documento exacto depositado (`document`).
2457
+ *
2458
+ * Si el servicio del driver no contesta, la respuesta sigue siendo `200`
2459
+ * con la fila neutra —que es verdad y está en casa— y el motivo en
2460
+ * `driver_detail_error`; `driver_detail` queda a `null`.
2461
+ */
2462
+ get: operations["invoiceFiscal.show"];
2463
+ put?: never;
2464
+ post?: never;
2465
+ delete?: never;
2466
+ options?: never;
2467
+ head?: never;
2468
+ patch?: never;
2469
+ trace?: never;
2470
+ };
2302
2471
  "/invoice-formats": {
2303
2472
  parameters: {
2304
2473
  query?: never;
@@ -5046,6 +5215,140 @@ export interface paths {
5046
5215
  patch?: never;
5047
5216
  trace?: never;
5048
5217
  };
5218
+ "/billing/plans": {
5219
+ parameters: {
5220
+ query?: never;
5221
+ header?: never;
5222
+ path?: never;
5223
+ cookie?: never;
5224
+ };
5225
+ /**
5226
+ * Los planes que esta instancia puede contratar
5227
+ * @description **Reservada al panel de Pimia.** Exige `billing:read`, que el Authorization Server emite SOLO al client de primera parte: un client de integrador no puede pedir ese scope —se le rechaza en el registro y no se le anuncia— y con cualquier otro token la llamada recibe `403`. Está en el contrato porque es el panel web de Pimia quien la consume, y sus tipos salen de aquí.
5228
+ *
5229
+ * Sin los planes de canal (`Asesoría`, `Desarrollador`): esos los contrata
5230
+ * una gestoría o un desarrollador para su cartera, no una pyme. Con la
5231
+ * instancia en marca blanca —su licencia la paga un desarrollador— la lista
5232
+ * llega VACÍA y `white_label` a `true`: el cliente vive dentro del producto
5233
+ * del partner y no ve precios de Pimia. El corte va en el servidor.
5234
+ */
5235
+ get: operations["tenantBilling.plans"];
5236
+ put?: never;
5237
+ post?: never;
5238
+ delete?: never;
5239
+ options?: never;
5240
+ head?: never;
5241
+ patch?: never;
5242
+ trace?: never;
5243
+ };
5244
+ "/billing/subscription": {
5245
+ parameters: {
5246
+ query?: never;
5247
+ header?: never;
5248
+ path?: never;
5249
+ cookie?: never;
5250
+ };
5251
+ /**
5252
+ * El plan de ESTA instancia: límites, consumo, prueba, quién la paga y el
5253
+ * estado de la suscripción en Stripe
5254
+ * @description **Reservada al panel de Pimia.** Exige `billing:read`, que el Authorization Server emite SOLO al client de primera parte: un client de integrador no puede pedir ese scope —se le rechaza en el registro y no se le anuncia— y con cualquier otro token la llamada recibe `403`. Está en el contrato porque es el panel web de Pimia quien la consume, y sus tipos salen de aquí.
5255
+ *
5256
+ * Lo puede leer cualquier usuario de la instancia: el plan y el consumo son
5257
+ * de la empresa. `billing.can_manage` dice si QUIEN MIRA puede contratar,
5258
+ * cambiar de plan o abrir el portal — el dueño de la instancia, y no en
5259
+ * marca blanca —; es lo que la pantalla usa para enseñar o esconder los
5260
+ * botones, pero el corte real lo hacen las rutas de escritura.
5261
+ *
5262
+ * `usage.storage` es `null` cuando no se puede medir (esquema a medias) y
5263
+ * `subscription.current_period_end` es `null` cuando Stripe no contesta:
5264
+ * un dato que no consta se dice como tal, no se inventa un cero.
5265
+ */
5266
+ get: operations["tenantBilling.subscription"];
5267
+ put?: never;
5268
+ post?: never;
5269
+ delete?: never;
5270
+ options?: never;
5271
+ head?: never;
5272
+ patch?: never;
5273
+ trace?: never;
5274
+ };
5275
+ "/billing/checkout": {
5276
+ parameters: {
5277
+ query?: never;
5278
+ header?: never;
5279
+ path?: never;
5280
+ cookie?: never;
5281
+ };
5282
+ get?: never;
5283
+ put?: never;
5284
+ /**
5285
+ * Contratar un plan de pago desde el panel web
5286
+ * @description **Reservada al panel de Pimia.** Exige `billing:write`, que el Authorization Server emite SOLO al client de primera parte: un client de integrador no puede pedir ese scope —se le rechaza en el registro y no se le anuncia— y con cualquier otro token la llamada recibe `403`. Está en el contrato porque es el panel web de Pimia quien la consume, y sus tipos salen de aquí.
5287
+ *
5288
+ * Devuelve la URL del Checkout alojado de Stripe: la tarjeta se teclea allí
5289
+ * y nunca pasa por Pimia. Al terminar, Stripe devuelve al panel web
5290
+ * (`/pimia/plan?checkout=success|cancelled`) y el asiento lo anota el
5291
+ * webhook `checkout.session.completed`. Solo el dueño de la instancia.
5292
+ *
5293
+ * Errores, con su código en `error`: `white_label` (403), `no_payer` (409),
5294
+ * `free_plan` y `channel_plan` (422), `tenant_already_subscribed` (422),
5295
+ * `stripe_price_missing` (503).
5296
+ */
5297
+ post: operations["tenantBilling.checkoutFromPanel"];
5298
+ delete?: never;
5299
+ options?: never;
5300
+ head?: never;
5301
+ patch?: never;
5302
+ trace?: never;
5303
+ };
5304
+ "/billing/portal": {
5305
+ parameters: {
5306
+ query?: never;
5307
+ header?: never;
5308
+ path?: never;
5309
+ cookie?: never;
5310
+ };
5311
+ get?: never;
5312
+ put?: never;
5313
+ /**
5314
+ * El portal de Stripe del pagador: cambiar la tarjeta, ver y descargar las
5315
+ * facturas de Pimia, cancelar. Solo el dueño, y solo si ya hay cuenta de
5316
+ * facturación en Stripe (`no_billing_account`, 404, si nunca contrató)
5317
+ * @description **Reservada al panel de Pimia.** Exige `billing:write`, que el Authorization Server emite SOLO al client de primera parte: un client de integrador no puede pedir ese scope —se le rechaza en el registro y no se le anuncia— y con cualquier otro token la llamada recibe `403`. Está en el contrato porque es el panel web de Pimia quien la consume, y sus tipos salen de aquí.
5318
+ */
5319
+ post: operations["tenantBilling.portal"];
5320
+ delete?: never;
5321
+ options?: never;
5322
+ head?: never;
5323
+ patch?: never;
5324
+ trace?: never;
5325
+ };
5326
+ "/billing/change-plan": {
5327
+ parameters: {
5328
+ query?: never;
5329
+ header?: never;
5330
+ path?: never;
5331
+ cookie?: never;
5332
+ };
5333
+ get?: never;
5334
+ put?: never;
5335
+ /**
5336
+ * Cambiar de plan: subir, bajar entre planes de pago o bajar a Free
5337
+ * @description **Reservada al panel de Pimia.** Exige `billing:write`, que el Authorization Server emite SOLO al client de primera parte: un client de integrador no puede pedir ese scope —se le rechaza en el registro y no se le anuncia— y con cualquier otro token la llamada recibe `403`. Está en el contrato porque es el panel web de Pimia quien la consume, y sus tipos salen de aquí.
5338
+ *
5339
+ * Las reglas son las de `PlanChange`, las mismas que en el plano central:
5340
+ * `not_the_payer` (403) si la licencia la paga otra cuenta, `channel_plan`
5341
+ * y `channel_seat` (422), `no_active_subscription` (422: sin suscripción
5342
+ * viva hay que pasar por el checkout), `subscription_not_linked` (409),
5343
+ * `stripe_price_missing` (503). Solo el dueño de la instancia.
5344
+ */
5345
+ post: operations["tenantBilling.changePlan"];
5346
+ delete?: never;
5347
+ options?: never;
5348
+ head?: never;
5349
+ patch?: never;
5350
+ trace?: never;
5351
+ };
5049
5352
  "/delegated-tasks": {
5050
5353
  parameters: {
5051
5354
  query?: never;
@@ -5713,8 +6016,23 @@ export interface paths {
5713
6016
  };
5714
6017
  /**
5715
6018
  * Get full VeriFactu details for an invoice
5716
- * @description Returns the complete data from VeriFactu API including
5717
- * AEAT response, alerts, attempts count, etc.
6019
+ * @description Devuelve el registro tal como lo tiene el servicio VeriFactu: el estado
6020
+ * ante la AEAT (`aeat_status`), el CSV que devolvió al aceptarlo
6021
+ * (`aeat_csv`), su respuesta literal (`aeat_response`: el motivo del rechazo
6022
+ * o del aviso, o `{status: 'correct', csv}` si lo aceptó), cuándo se envió
6023
+ * (`sent_at`, en UTC), cuántos intentos lleva, la huella y la URL del QR.
6024
+ *
6025
+ * El cuerpo es `{data: <registro>}`, UN solo nivel. Hasta 2026-09-02 el
6026
+ * registro llegaba DOS niveles dentro: `VeriFactuClient::getInvoice()`
6027
+ * devuelve el cuerpo entero de verifactuApi, que ya es `{data: <registro>}`,
6028
+ * y aquí se volvía a envolver. Nadie lo leía bien: el modal de VeriFactu
6029
+ * del panel pintaba «—» y «No enviada» sobre facturas ACEPTADAS, y la vista
6030
+ * de la factura nunca encontraba el motivo del rechazo (#646). `sync` y
6031
+ * `retry` ya desenvolvían con `VeriFactuClient::datos()` desde el #505.
6032
+ *
6033
+ * Casos que no son el `200`: `422` si la factura no está registrada en
6034
+ * VeriFactu (no tiene `verifactu_record_id`); `500` si el servicio no
6035
+ * contesta o devuelve error, con el motivo en `message`.
5718
6036
  */
5719
6037
  get: operations["veriFactu.detail"];
5720
6038
  put?: never;
@@ -6364,6 +6682,18 @@ export interface components {
6364
6682
  name: string;
6365
6683
  trade_name?: string | null;
6366
6684
  vat_id?: string | null;
6685
+ /**
6686
+ * @description Número de registro mercantil de la empresa. En Francia es el
6687
+ * SIREN (9 dígitos) o el SIRET (14) y se comprueba su dígito de
6688
+ * control; es lo que identifica al emisor en la facturación
6689
+ * electrónica francesa y sin él no se puede publicar. En España
6690
+ * no hace falta: el NIF (`vat_id`) es el identificador.
6691
+ */
6692
+ registration_number?: string | null;
6693
+ /** @description País fiscal del emisor (ISO 3166-1 alfa-2). */
6694
+ country_code?: string | null;
6695
+ /** @description Régimen fiscal por defecto de la empresa (clave AEAT de dos dígitos). */
6696
+ tax_regime?: string | null;
6367
6697
  slug?: string | null;
6368
6698
  address: {
6369
6699
  country_id: string;
@@ -6375,6 +6705,9 @@ export interface components {
6375
6705
  name: string;
6376
6706
  trade_name: string | null;
6377
6707
  vat_id: string | null;
6708
+ registration_number: string | null;
6709
+ country_code: string;
6710
+ tax_regime: string | null;
6378
6711
  /**
6379
6712
  * @description Sin `tax_id` ni `owner_id`: no son columnas de `companies` y se
6380
6713
  * publicaban a null (#377). Del dueño responde `User::isOwner()`.
@@ -6576,6 +6909,9 @@ export interface components {
6576
6909
  name: string;
6577
6910
  trade_name: string | null;
6578
6911
  vat_id: string | null;
6912
+ registration_number: string | null;
6913
+ country_code: string;
6914
+ tax_regime: string | null;
6579
6915
  /**
6580
6916
  * @description Sin `tax_id` ni `owner_id`: no son columnas de `companies` y se
6581
6917
  * publicaban a null (#377). Del dueño responde `User::isOwner()`.
@@ -6670,6 +7006,7 @@ export interface components {
6670
7006
  payment_method_id: number | null;
6671
7007
  customer_type: string;
6672
7008
  notes: string | null;
7009
+ registration_number: string | null;
6673
7010
  avatar: string;
6674
7011
  currency?: components["schemas"]["Currency"] | null;
6675
7012
  };
@@ -6688,6 +7025,15 @@ export interface components {
6688
7025
  * como `taxNumber` del comprador en FacturaE.
6689
7026
  */
6690
7027
  tax_id?: string | null;
7028
+ /**
7029
+ * @description Número de registro mercantil del cliente. Para un emisor
7030
+ * francés es el SIREN (9 dígitos) o el SIRET (14) del cliente,
7031
+ * mención obligatoria de la factura electrónica y lo que la
7032
+ * plataforma usa para enrutarla: sin él no se puede publicar una
7033
+ * factura a una empresa. Se comprueba su dígito de control; para
7034
+ * un emisor de otro país es texto libre.
7035
+ */
7036
+ registration_number?: string | null;
6691
7037
  notes?: string | null;
6692
7038
  /**
6693
7039
  * @description Referencia externa: TU identificador para este cliente (el id
@@ -6796,6 +7142,7 @@ export interface components {
6796
7142
  base_due_amount: number | null;
6797
7143
  prefix: string | null;
6798
7144
  tax_id: string | null;
7145
+ registration_number: string | null;
6799
7146
  notes: string | null;
6800
7147
  /**
6801
7148
  * @description Referencia externa DE QUIEN PREGUNTA: la resuelve el client OAuth
@@ -7552,6 +7899,29 @@ export interface components {
7552
7899
  catalog_id: number | null;
7553
7900
  is_override: boolean;
7554
7901
  };
7902
+ /** InboundEInvoiceResource */
7903
+ InboundEInvoiceResource: {
7904
+ id: number;
7905
+ source: string;
7906
+ external_id: string;
7907
+ network: string | null;
7908
+ format: string | null;
7909
+ type_code: string | null;
7910
+ invoice_number: string | null;
7911
+ supplier_siren: string | null;
7912
+ supplier_vat: string | null;
7913
+ status: string;
7914
+ error: string | null;
7915
+ pa_status: string | null;
7916
+ /** Format: date-time */
7917
+ pa_status_sent_at: string | null;
7918
+ rejection_reason: string | null;
7919
+ rejection_message: string | null;
7920
+ /** Format: date-time */
7921
+ imported_at: string | null;
7922
+ /** Format: date-time */
7923
+ received_at: string | null;
7924
+ };
7555
7925
  /** IncidenceRequest */
7556
7926
  IncidenceRequest: {
7557
7927
  /** Format: date */
@@ -7673,6 +8043,7 @@ export interface components {
7673
8043
  viewed_at: string | null;
7674
8044
  contract_id: number | null;
7675
8045
  export_batch_id: number | null;
8046
+ operation_nature: string | null;
7676
8047
  };
7677
8048
  /** InvoiceItem */
7678
8049
  InvoiceItem: {
@@ -7748,6 +8119,7 @@ export interface components {
7748
8119
  tax_included: string;
7749
8120
  discount_per_item: string | null;
7750
8121
  notes: string | null;
8122
+ operation_nature: string | null;
7751
8123
  discount_type: string | null;
7752
8124
  discount: number;
7753
8125
  discount_val: number;
@@ -7808,10 +8180,27 @@ export interface components {
7808
8180
  overdue: string;
7809
8181
  effective_paid_status: string;
7810
8182
  effective_overdue: string;
8183
+ /** @description Fachada ESPAÑOLA del registro fiscal, deprecada desde #656: el mismo estado viaja neutro en `fiscal.status`. Se mantiene tal cual (VeriFactu la escribe y el panel la lee); para una factura de otro país no dice nada (`not_applicable`). */
7811
8184
  aeat_status: string;
7812
8185
  qr_data: string | null;
7813
8186
  hash: string | null;
8187
+ /** @description CSV de la AEAT, fachada española deprecada desde #656: el acuse neutro es `fiscal.receipt`. */
7814
8188
  aeat_csv: string | null;
8189
+ /** @description El registro fiscal de la factura, NEUTRO al país (#656): la fila de `invoice_fiscal_registrations` que escribe el driver del país del emisor (`verifactu` para ES, `fr-platform` para FR). `null` mientras la factura no haya pasado por ningún registro: borradores, países sin driver, módulo de cumplimiento apagado. Un consumidor sigue una factura española y una francesa por `fiscal.status`; el detalle que sepa el driver está en `GET /invoices/{invoice}/fiscal`. */
8190
+ fiscal: {
8191
+ country: string;
8192
+ driver: string;
8193
+ status: string;
8194
+ /** @description Literal del último estado tal como lo cuenta el régimen (Francia: `RECEIVED`, `DISPUTED`…); null para España, cuyo `status` ya es el literal. */
8195
+ external_status: string | null;
8196
+ /** @description Código del régimen de ese estado (Francia: el código DGFiP, `202`, `207`…); null para España. */
8197
+ external_status_code: string | null;
8198
+ external_id: string | null;
8199
+ receipt: string | null;
8200
+ error: string | null;
8201
+ /** @description Cuándo se presentó ante la administración (ISO 8601, zona de la app); null hasta que el driver presenta. */
8202
+ submitted_at: string | null;
8203
+ } | null;
7815
8204
  is_credit_note: boolean;
7816
8205
  rectified_invoice_id: number | null;
7817
8206
  rectified_invoice_number?: string | null;
@@ -8056,6 +8445,15 @@ export interface components {
8056
8445
  * guardarse. Los `max` son los de la columna.
8057
8446
  */
8058
8447
  notes?: string | null;
8448
+ /**
8449
+ * @description Naturaleza de la operación, mención obligatoria de la factura
8450
+ * electrónica francesa: `S1` prestación de servicios, `B1` entrega
8451
+ * de bienes, `M1` mixta. Sin declararla, el Factur-X toma el valor
8452
+ * por defecto de la empresa (`fr_operation_nature`). Para un emisor
8453
+ * de otro país no tiene efecto.
8454
+ * @enum {string|null}
8455
+ */
8456
+ operation_nature?: "S1" | "B1" | "M1" | null;
8059
8457
  discount_type?: string | null;
8060
8458
  /**
8061
8459
  * @description Referencia libre del documento («Su pedido 4711»), distinta de
@@ -8865,6 +9263,7 @@ export interface components {
8865
9263
  * está cargada (show) para no disparar N+1 en el listado.
8866
9264
  */
8867
9265
  document_meta?: string;
9266
+ einvoice?: components["schemas"]["InboundEInvoiceResource"] | null;
8868
9267
  items?: components["schemas"]["ReceivedInvoiceItemResource"][];
8869
9268
  supplier?: components["schemas"]["SupplierResource"] | null;
8870
9269
  taxes?: components["schemas"]["TaxResource"][];
@@ -9056,6 +9455,21 @@ export interface components {
9056
9455
  creator?: components["schemas"]["UserResource"] | null;
9057
9456
  currency?: components["schemas"]["CurrencyResource"] | null;
9058
9457
  };
9458
+ /** RefuseInboundEInvoiceRequest */
9459
+ RefuseInboundEInvoiceRequest: {
9460
+ /**
9461
+ * @description Motivo del rechazo, del enum `rejectionDetail.reason` de la plateforme
9462
+ * (p. ej. `LEGAL_INFORMATION_MISSING`, `SIRET_INCORRECT_OR_MISSING`,
9463
+ * `DUPLICATE_INVOICE`, `VAT_RATE_INCORRECT`). Se reenvía tal cual al
9464
+ * emisor como estado 210 «refusée». Mayúsculas y guiones bajos.
9465
+ */
9466
+ reason: string;
9467
+ /**
9468
+ * @description Texto libre para el emisor: qué está mal y qué se espera en la
9469
+ * factura corregida.
9470
+ */
9471
+ message?: string | null;
9472
+ };
9059
9473
  /**
9060
9474
  * RenewContractRequest
9061
9475
  * @description Renovación manual de un contrato (`POST /contracts/{contract}/renew`).
@@ -9620,16 +10034,19 @@ export interface components {
9620
10034
  is_default: boolean;
9621
10035
  is_system: boolean;
9622
10036
  is_active: boolean;
10037
+ vat_category: string | null;
10038
+ vat_exemption_code: string | null;
9623
10039
  };
9624
10040
  /** TaxTypeRequest */
9625
10041
  TaxTypeRequest: {
9626
10042
  name: string;
9627
10043
  /**
9628
- * @description `calculation_type` y `fixed_amount` estaban aquí y NO son columnas
9629
- * de `tax_types`: se validaban, se metían en el payload y Eloquent
9630
- * las descartaba en silencio (#377). El primero además era
9631
- * `required`, así que un cliente de la API que no se inventara el
9632
- * campo se comía un 422 por un dato que no se guardaba.
10044
+ * @description Porcentaje del impuesto. ⚠️ Una retención de IRPF se guarda en
10045
+ * NEGATIVO —un IRPF del 15 % es `-15`, porque resta de la factura—
10046
+ * y con `tax_category: "IRPF"` el positivo se rechaza con un 422.
10047
+ * El contrato no puede expresar esa condición: la regla depende de
10048
+ * otro campo y el generador evalúa `rules()` en frío. Por eso se
10049
+ * dice aquí.
9633
10050
  */
9634
10051
  percent?: number | null;
9635
10052
  description?: string | null;
@@ -9665,6 +10082,21 @@ export interface components {
9665
10082
  * `111` o `115` las retenciones.
9666
10083
  */
9667
10084
  aeat_model?: string | null;
10085
+ /**
10086
+ * @description Categoría de IVA de la norma europea EN 16931, la que viaja en la
10087
+ * factura electrónica (Factur-X, UBL): `S` tipo normal, `Z` tipo
10088
+ * cero, `E` exento, `AE` inversión del sujeto pasivo, `K` entrega
10089
+ * intracomunitaria, `G` exportación, `O` no sujeto. Si se omite, el
10090
+ * documento electrónico la deduce del porcentaje (>0 ⇒ `S`, 0 ⇒ `E`).
10091
+ * @enum {string|null}
10092
+ */
10093
+ vat_category?: "S" | "Z" | "E" | "AE" | "K" | "G" | "O" | null;
10094
+ /**
10095
+ * @description Código VATEX del motivo de exención (p. ej. `VATEX-FR-FRANCHISE`,
10096
+ * `VATEX-EU-AE`, `VATEX-EU-IC`, `VATEX-EU-G`) para las categorías
10097
+ * sin cuota. Sin efecto en un tipo `S`.
10098
+ */
10099
+ vat_exemption_code?: string | null;
9668
10100
  };
9669
10101
  /** TaxTypeResource */
9670
10102
  TaxTypeResource: {
@@ -9685,6 +10117,12 @@ export interface components {
9685
10117
  tax_category: string;
9686
10118
  aeat_model: string | null;
9687
10119
  tax_scope: string;
10120
+ /**
10121
+ * @description Categoría EN 16931 y VATEX (#651): null en los catálogos que no
10122
+ * la declaran, y el documento electrónico la deduce.
10123
+ */
10124
+ vat_category: string | null;
10125
+ vat_exemption_code: string | null;
9688
10126
  is_default: boolean;
9689
10127
  is_system: boolean;
9690
10128
  is_active: boolean;
@@ -9902,6 +10340,9 @@ export interface components {
9902
10340
  name: string;
9903
10341
  trade_name: string | null;
9904
10342
  vat_id: string | null;
10343
+ registration_number: string | null;
10344
+ country_code: string;
10345
+ tax_regime: string | null;
9905
10346
  /**
9906
10347
  * @description Sin `tax_id` ni `owner_id`: no son columnas de `companies` y se
9907
10348
  * publicaban a null (#377). Del dueño responde `User::isOwner()`.
@@ -13309,40 +13750,79 @@ export interface operations {
13309
13750
  };
13310
13751
  };
13311
13752
  };
13312
- "employees.index": {
13753
+ "eInvoice.download": {
13313
13754
  parameters: {
13314
13755
  query?: {
13315
- limit?: string;
13756
+ /** @description Formato del documento electrónico: `facturae` (España, XML) o `facturx` (Francia, PDF/A-3). Sin él, el primero que ofrezca el país del emisor. */
13757
+ format?: string;
13316
13758
  };
13317
13759
  header?: never;
13318
- path?: never;
13760
+ path: {
13761
+ /** @description The invoice ID */
13762
+ invoice: number;
13763
+ };
13319
13764
  cookie?: never;
13320
13765
  };
13321
13766
  requestBody?: never;
13322
13767
  responses: {
13323
- /** @description Array of `EmployeeProfileResource` */
13324
13768
  200: {
13325
13769
  headers: {
13770
+ "Content-Disposition"?: string;
13326
13771
  [name: string]: unknown;
13327
13772
  };
13328
13773
  content: {
13329
- "application/json": {
13330
- data: components["schemas"]["EmployeeProfileResource"][];
13331
- meta: {
13332
- employee_total_count: number;
13333
- active_count: number;
13334
- };
13335
- };
13774
+ "application/octet-stream": Blob;
13336
13775
  };
13337
13776
  };
13338
- 403: components["responses"]["AuthorizationException"];
13339
- };
13340
- };
13341
- "employees.store": {
13342
- parameters: {
13343
- query?: never;
13344
- header?: never;
13345
- path?: never;
13777
+ 404: components["responses"]["ModelNotFoundException"];
13778
+ 422: components["responses"]["ValidationException"];
13779
+ 500: {
13780
+ headers: {
13781
+ [name: string]: unknown;
13782
+ };
13783
+ content: {
13784
+ "application/json": {
13785
+ error: boolean;
13786
+ message: string;
13787
+ };
13788
+ };
13789
+ };
13790
+ };
13791
+ };
13792
+ "employees.index": {
13793
+ parameters: {
13794
+ query?: {
13795
+ limit?: string;
13796
+ };
13797
+ header?: never;
13798
+ path?: never;
13799
+ cookie?: never;
13800
+ };
13801
+ requestBody?: never;
13802
+ responses: {
13803
+ /** @description Array of `EmployeeProfileResource` */
13804
+ 200: {
13805
+ headers: {
13806
+ [name: string]: unknown;
13807
+ };
13808
+ content: {
13809
+ "application/json": {
13810
+ data: components["schemas"]["EmployeeProfileResource"][];
13811
+ meta: {
13812
+ employee_total_count: number;
13813
+ active_count: number;
13814
+ };
13815
+ };
13816
+ };
13817
+ };
13818
+ 403: components["responses"]["AuthorizationException"];
13819
+ };
13820
+ };
13821
+ "employees.store": {
13822
+ parameters: {
13823
+ query?: never;
13824
+ header?: never;
13825
+ path?: never;
13346
13826
  cookie?: never;
13347
13827
  };
13348
13828
  requestBody: {
@@ -14225,6 +14705,7 @@ export interface operations {
14225
14705
  };
14226
14706
  };
14227
14707
  404: components["responses"]["ModelNotFoundException"];
14708
+ 422: components["responses"]["ValidationException"];
14228
14709
  500: {
14229
14710
  headers: {
14230
14711
  [name: string]: unknown;
@@ -14306,6 +14787,309 @@ export interface operations {
14306
14787
  422: components["responses"]["ValidationException"];
14307
14788
  };
14308
14789
  };
14790
+ "frEReporting.transactions": {
14791
+ parameters: {
14792
+ query?: {
14793
+ status?: "pending" | "sent" | "attached" | "declared" | "rejected" | "error" | "withdrawn";
14794
+ flow_type?: "10.1" | "10.2" | "10.3" | "10.4";
14795
+ from?: string;
14796
+ to?: string;
14797
+ per_page?: number;
14798
+ };
14799
+ header?: never;
14800
+ path?: never;
14801
+ cookie?: never;
14802
+ };
14803
+ requestBody?: never;
14804
+ responses: {
14805
+ 200: {
14806
+ headers: {
14807
+ [name: string]: unknown;
14808
+ };
14809
+ content: {
14810
+ "application/json": {
14811
+ data: {
14812
+ id: number;
14813
+ flow_type: string;
14814
+ source_type: string;
14815
+ source_id: number;
14816
+ status: string;
14817
+ transaction_date: string | null;
14818
+ period_start: string | null;
14819
+ period_end: string | null;
14820
+ currency_code: string;
14821
+ category_code: string | null;
14822
+ aggregates: {
14823
+ [key: string]: unknown;
14824
+ }[];
14825
+ external_id: string | null;
14826
+ report_id: string | null;
14827
+ error: string | null;
14828
+ sent_at: string | null;
14829
+ attached_at: string | null;
14830
+ created_at: string | null;
14831
+ }[];
14832
+ meta: {
14833
+ current_page: number;
14834
+ last_page: number;
14835
+ per_page: number;
14836
+ total: number;
14837
+ };
14838
+ };
14839
+ };
14840
+ };
14841
+ 422: components["responses"]["ValidationException"];
14842
+ };
14843
+ };
14844
+ "frEReporting.reports": {
14845
+ parameters: {
14846
+ query?: {
14847
+ status?: "open" | "closed" | "submitted" | "declared" | "rejected";
14848
+ per_page?: number;
14849
+ };
14850
+ header?: never;
14851
+ path?: never;
14852
+ cookie?: never;
14853
+ };
14854
+ requestBody?: never;
14855
+ responses: {
14856
+ 200: {
14857
+ headers: {
14858
+ [name: string]: unknown;
14859
+ };
14860
+ content: {
14861
+ "application/json": {
14862
+ data: {
14863
+ id: number;
14864
+ report_id: string;
14865
+ status: string;
14866
+ period_start: string | null;
14867
+ period_end: string | null;
14868
+ auto_close_at: string | null;
14869
+ declaration_type: string | null;
14870
+ file_link: string | null;
14871
+ error: string | null;
14872
+ transactions: number;
14873
+ submitted_at: string | null;
14874
+ declared_at: string | null;
14875
+ created_at: string | null;
14876
+ }[];
14877
+ meta: {
14878
+ current_page: number;
14879
+ last_page: number;
14880
+ per_page: number;
14881
+ total: number;
14882
+ };
14883
+ };
14884
+ };
14885
+ };
14886
+ 422: components["responses"]["ValidationException"];
14887
+ };
14888
+ };
14889
+ "frSettings.index": {
14890
+ parameters: {
14891
+ query?: never;
14892
+ header?: never;
14893
+ path?: never;
14894
+ cookie?: never;
14895
+ };
14896
+ requestBody?: never;
14897
+ responses: {
14898
+ 200: {
14899
+ headers: {
14900
+ [name: string]: unknown;
14901
+ };
14902
+ content: {
14903
+ "application/json": {
14904
+ data: {
14905
+ fr_operation_nature: string;
14906
+ fr_vat_on_debits: string;
14907
+ fr_payment_terms: string;
14908
+ fr_mention_pmt: string;
14909
+ fr_mention_pmd: string;
14910
+ fr_mention_aab: string;
14911
+ fr_vat_exemption_reason: string;
14912
+ fr_vat_regime: string | null;
14913
+ issuer: {
14914
+ name: string | null;
14915
+ registration_number: string | null;
14916
+ vat_number: string | null;
14917
+ siren: string | null;
14918
+ vat_number_valid: boolean;
14919
+ ready_to_publish: boolean;
14920
+ };
14921
+ platform: {
14922
+ provider: string;
14923
+ configured: boolean;
14924
+ environment: string | null;
14925
+ webhook_configured: boolean;
14926
+ entity_id: string | null;
14927
+ enrollment_id: string | null;
14928
+ enrollment_status: string | null;
14929
+ enrollment_started_at: string | null;
14930
+ };
14931
+ ereporting: {
14932
+ enabled: boolean;
14933
+ regime: string | null;
14934
+ regime_label: string | null;
14935
+ frequency: {
14936
+ transactions: string;
14937
+ payments: string;
14938
+ } | null;
14939
+ counts: {
14940
+ pending: number;
14941
+ sent: number;
14942
+ attached: number;
14943
+ declared: number;
14944
+ rejected: number;
14945
+ error: number;
14946
+ };
14947
+ current_period: {
14948
+ start: string;
14949
+ end: string;
14950
+ deadline: string;
14951
+ unattached: number;
14952
+ } | null;
14953
+ last_report: {
14954
+ id: number;
14955
+ report_id: string;
14956
+ status: string;
14957
+ period_start: string | null;
14958
+ period_end: string | null;
14959
+ auto_close_at: string | null;
14960
+ declaration_type: string | null;
14961
+ file_link: string | null;
14962
+ error: string | null;
14963
+ transactions: number;
14964
+ submitted_at: string | null;
14965
+ declared_at: string | null;
14966
+ created_at: string | null;
14967
+ } | null;
14968
+ };
14969
+ };
14970
+ };
14971
+ };
14972
+ };
14973
+ };
14974
+ };
14975
+ "frSettings.update": {
14976
+ parameters: {
14977
+ query?: never;
14978
+ header?: never;
14979
+ path?: never;
14980
+ cookie?: never;
14981
+ };
14982
+ requestBody?: {
14983
+ content: {
14984
+ "application/json": {
14985
+ /**
14986
+ * @description Naturaleza de la operación por defecto (BT-23): `S1` servicios,
14987
+ * `B1` bienes, `M1` mixta. Una factura puede declarar la suya.
14988
+ * @enum {string}
14989
+ */
14990
+ fr_operation_nature?: "S1" | "B1" | "M1";
14991
+ /**
14992
+ * @description Opción «TVA sur les débits» (BT-8 = 5): `YES` o `NO`.
14993
+ * @enum {string}
14994
+ */
14995
+ fr_vat_on_debits?: "YES" | "NO";
14996
+ fr_payment_terms?: string;
14997
+ /**
14998
+ * @description Las tres menciones legales obligatorias en toda factura francesa
14999
+ * (frais de recouvrement, pénalités de retard, escompte).
15000
+ */
15001
+ fr_mention_pmt?: string;
15002
+ fr_mention_pmd?: string;
15003
+ fr_mention_aab?: string;
15004
+ /** @description Texto de la exención para las líneas sin TVA (franquicia en base). */
15005
+ fr_vat_exemption_reason?: string;
15006
+ /**
15007
+ * @description Régimen de TVA (#665): `reel_normal_mensuel`, `reel_normal_trimestriel`, `reel_simplifie` o `franchise_en_base`. Fija la periodicidad del e-reporting y lo ACTIVA; `null` lo apaga.
15008
+ * @enum {string|null}
15009
+ */
15010
+ fr_vat_regime?: "reel_normal_mensuel" | "reel_normal_trimestriel" | "reel_simplifie" | "franchise_en_base" | null;
15011
+ };
15012
+ };
15013
+ };
15014
+ responses: {
15015
+ 200: {
15016
+ headers: {
15017
+ [name: string]: unknown;
15018
+ };
15019
+ content: {
15020
+ "application/json": {
15021
+ data: {
15022
+ fr_operation_nature: string;
15023
+ fr_vat_on_debits: string;
15024
+ fr_payment_terms: string;
15025
+ fr_mention_pmt: string;
15026
+ fr_mention_pmd: string;
15027
+ fr_mention_aab: string;
15028
+ fr_vat_exemption_reason: string;
15029
+ fr_vat_regime: string | null;
15030
+ issuer: {
15031
+ name: string | null;
15032
+ registration_number: string | null;
15033
+ vat_number: string | null;
15034
+ siren: string | null;
15035
+ vat_number_valid: boolean;
15036
+ ready_to_publish: boolean;
15037
+ };
15038
+ platform: {
15039
+ provider: string;
15040
+ configured: boolean;
15041
+ environment: string | null;
15042
+ webhook_configured: boolean;
15043
+ entity_id: string | null;
15044
+ enrollment_id: string | null;
15045
+ enrollment_status: string | null;
15046
+ enrollment_started_at: string | null;
15047
+ };
15048
+ ereporting: {
15049
+ enabled: boolean;
15050
+ regime: string | null;
15051
+ regime_label: string | null;
15052
+ frequency: {
15053
+ transactions: string;
15054
+ payments: string;
15055
+ } | null;
15056
+ counts: {
15057
+ pending: number;
15058
+ sent: number;
15059
+ attached: number;
15060
+ declared: number;
15061
+ rejected: number;
15062
+ error: number;
15063
+ };
15064
+ current_period: {
15065
+ start: string;
15066
+ end: string;
15067
+ deadline: string;
15068
+ unattached: number;
15069
+ } | null;
15070
+ last_report: {
15071
+ id: number;
15072
+ report_id: string;
15073
+ status: string;
15074
+ period_start: string | null;
15075
+ period_end: string | null;
15076
+ auto_close_at: string | null;
15077
+ declaration_type: string | null;
15078
+ file_link: string | null;
15079
+ error: string | null;
15080
+ transactions: number;
15081
+ submitted_at: string | null;
15082
+ declared_at: string | null;
15083
+ created_at: string | null;
15084
+ } | null;
15085
+ };
15086
+ };
15087
+ };
15088
+ };
15089
+ };
15090
+ 422: components["responses"]["ValidationException"];
15091
+ };
15092
+ };
14309
15093
  "gestoriaLink.asesorias": {
14310
15094
  parameters: {
14311
15095
  query?: {
@@ -14667,6 +15451,69 @@ export interface operations {
14667
15451
  422: components["responses"]["ValidationException"];
14668
15452
  };
14669
15453
  };
15454
+ "inboundEInvoice.approve": {
15455
+ parameters: {
15456
+ query?: never;
15457
+ header?: never;
15458
+ path: {
15459
+ /** @description The received invoice ID */
15460
+ received_invoice: number;
15461
+ };
15462
+ cookie?: never;
15463
+ };
15464
+ requestBody?: {
15465
+ content: {
15466
+ "application/json": {
15467
+ message?: string;
15468
+ };
15469
+ };
15470
+ };
15471
+ responses: {
15472
+ /** @description `ReceivedInvoiceResource` */
15473
+ 200: {
15474
+ headers: {
15475
+ [name: string]: unknown;
15476
+ };
15477
+ content: {
15478
+ "application/json": {
15479
+ data: components["schemas"]["ReceivedInvoiceResource"];
15480
+ };
15481
+ };
15482
+ };
15483
+ 404: components["responses"]["ModelNotFoundException"];
15484
+ };
15485
+ };
15486
+ "inboundEInvoice.refuse": {
15487
+ parameters: {
15488
+ query?: never;
15489
+ header?: never;
15490
+ path: {
15491
+ /** @description The received invoice ID */
15492
+ received_invoice: number;
15493
+ };
15494
+ cookie?: never;
15495
+ };
15496
+ requestBody: {
15497
+ content: {
15498
+ "application/json": components["schemas"]["RefuseInboundEInvoiceRequest"];
15499
+ };
15500
+ };
15501
+ responses: {
15502
+ /** @description `ReceivedInvoiceResource` */
15503
+ 200: {
15504
+ headers: {
15505
+ [name: string]: unknown;
15506
+ };
15507
+ content: {
15508
+ "application/json": {
15509
+ data: components["schemas"]["ReceivedInvoiceResource"];
15510
+ };
15511
+ };
15512
+ };
15513
+ 404: components["responses"]["ModelNotFoundException"];
15514
+ 422: components["responses"]["ValidationException"];
15515
+ };
15516
+ };
14670
15517
  "incidence.review": {
14671
15518
  parameters: {
14672
15519
  query?: never;
@@ -15032,6 +15879,49 @@ export interface operations {
15032
15879
  404: components["responses"]["ModelNotFoundException"];
15033
15880
  };
15034
15881
  };
15882
+ "invoiceFiscal.show": {
15883
+ parameters: {
15884
+ query?: never;
15885
+ header?: never;
15886
+ path: {
15887
+ /** @description The invoice ID */
15888
+ invoice: number;
15889
+ };
15890
+ cookie?: never;
15891
+ };
15892
+ requestBody?: never;
15893
+ responses: {
15894
+ 200: {
15895
+ headers: {
15896
+ [name: string]: unknown;
15897
+ };
15898
+ content: {
15899
+ "application/json": {
15900
+ data: {
15901
+ country: string;
15902
+ fiscal: {
15903
+ country: string;
15904
+ driver: string;
15905
+ status: string;
15906
+ external_status: string | null;
15907
+ external_status_code: string | null;
15908
+ external_id: string | null;
15909
+ receipt: string | null;
15910
+ error: string | null;
15911
+ submitted_at: string | null;
15912
+ } | null;
15913
+ driver_detail: {
15914
+ [key: string]: unknown;
15915
+ } | null;
15916
+ driver_detail_error: string | null;
15917
+ };
15918
+ };
15919
+ };
15920
+ };
15921
+ 403: components["responses"]["AuthorizationException"];
15922
+ 404: components["responses"]["ModelNotFoundException"];
15923
+ };
15924
+ };
15035
15925
  "invoice.invoiceFormats": {
15036
15926
  parameters: {
15037
15927
  query?: never;
@@ -20947,6 +21837,220 @@ export interface operations {
20947
21837
  404: components["responses"]["ModelNotFoundException"];
20948
21838
  };
20949
21839
  };
21840
+ "tenantBilling.plans": {
21841
+ parameters: {
21842
+ query?: never;
21843
+ header?: never;
21844
+ path?: never;
21845
+ cookie?: never;
21846
+ };
21847
+ requestBody?: never;
21848
+ responses: {
21849
+ 200: {
21850
+ headers: {
21851
+ [name: string]: unknown;
21852
+ };
21853
+ content: {
21854
+ "application/json": {
21855
+ data: {
21856
+ id: number;
21857
+ name: string;
21858
+ price: string;
21859
+ price_cents: number;
21860
+ max_invoices_month: number;
21861
+ max_users: number;
21862
+ max_storage_mb: number;
21863
+ features: string[];
21864
+ is_free: boolean;
21865
+ }[];
21866
+ white_label: boolean;
21867
+ message: string | null;
21868
+ };
21869
+ };
21870
+ };
21871
+ 404: components["responses"]["ModelNotFoundException"];
21872
+ };
21873
+ };
21874
+ "tenantBilling.subscription": {
21875
+ parameters: {
21876
+ query?: never;
21877
+ header?: never;
21878
+ path?: never;
21879
+ cookie?: never;
21880
+ };
21881
+ requestBody?: never;
21882
+ responses: {
21883
+ 200: {
21884
+ headers: {
21885
+ [name: string]: unknown;
21886
+ };
21887
+ content: {
21888
+ "application/json": {
21889
+ data: {
21890
+ plan: {
21891
+ id: number;
21892
+ name: string;
21893
+ price: string;
21894
+ price_cents: number;
21895
+ max_invoices_month: number;
21896
+ max_users: number;
21897
+ max_storage_mb: number;
21898
+ features: string[];
21899
+ is_free: boolean;
21900
+ } | null;
21901
+ limits: {
21902
+ max_invoices_month: number;
21903
+ max_users: number;
21904
+ max_storage_mb: number;
21905
+ };
21906
+ usage: {
21907
+ invoices_month: number;
21908
+ users: number;
21909
+ storage: {
21910
+ used_bytes: number;
21911
+ used_mb: number;
21912
+ limit_mb: number;
21913
+ unlimited: boolean;
21914
+ percent: number | null;
21915
+ } | null;
21916
+ };
21917
+ trial: {
21918
+ active: boolean;
21919
+ ends_at: string | null;
21920
+ };
21921
+ billing: {
21922
+ mode: string;
21923
+ white_label: boolean;
21924
+ can_manage: boolean;
21925
+ seat: {
21926
+ role: string;
21927
+ grace_until: string | null;
21928
+ suspended_at: string | null;
21929
+ } | null;
21930
+ };
21931
+ subscription: {
21932
+ status: string;
21933
+ current_period_end: number | null;
21934
+ cancel_at_period_end: boolean;
21935
+ ends_at: string | null;
21936
+ } | null;
21937
+ status: string;
21938
+ };
21939
+ };
21940
+ };
21941
+ };
21942
+ 404: components["responses"]["ModelNotFoundException"];
21943
+ };
21944
+ };
21945
+ "tenantBilling.checkoutFromPanel": {
21946
+ parameters: {
21947
+ query?: never;
21948
+ header?: never;
21949
+ path?: never;
21950
+ cookie?: never;
21951
+ };
21952
+ requestBody?: never;
21953
+ responses: {
21954
+ 200: {
21955
+ headers: {
21956
+ [name: string]: unknown;
21957
+ };
21958
+ content: {
21959
+ "application/json": {
21960
+ data: {
21961
+ checkout_url: string;
21962
+ };
21963
+ };
21964
+ };
21965
+ };
21966
+ };
21967
+ };
21968
+ "tenantBilling.portal": {
21969
+ parameters: {
21970
+ query?: never;
21971
+ header?: never;
21972
+ path?: never;
21973
+ cookie?: never;
21974
+ };
21975
+ requestBody?: never;
21976
+ responses: {
21977
+ 200: {
21978
+ headers: {
21979
+ [name: string]: unknown;
21980
+ };
21981
+ content: {
21982
+ "application/json": {
21983
+ data: {
21984
+ portal_url: string;
21985
+ };
21986
+ };
21987
+ };
21988
+ };
21989
+ /** @description An error */
21990
+ 403: {
21991
+ headers: {
21992
+ [name: string]: unknown;
21993
+ };
21994
+ content: {
21995
+ "application/json": {
21996
+ /**
21997
+ * @description Error overview.
21998
+ * @example Solo el administrador de la instancia puede gestionar su suscripción.
21999
+ */
22000
+ message: string;
22001
+ };
22002
+ };
22003
+ };
22004
+ 404: components["responses"]["ModelNotFoundException"];
22005
+ };
22006
+ };
22007
+ "tenantBilling.changePlan": {
22008
+ parameters: {
22009
+ query?: never;
22010
+ header?: never;
22011
+ path?: never;
22012
+ cookie?: never;
22013
+ };
22014
+ requestBody: {
22015
+ content: {
22016
+ "application/json": {
22017
+ plan_id: number;
22018
+ };
22019
+ };
22020
+ };
22021
+ responses: {
22022
+ 200: {
22023
+ headers: {
22024
+ [name: string]: unknown;
22025
+ };
22026
+ content: {
22027
+ "application/json": {
22028
+ message: string;
22029
+ data: {
22030
+ plan: string;
22031
+ };
22032
+ };
22033
+ };
22034
+ };
22035
+ /** @description An error */
22036
+ 403: {
22037
+ headers: {
22038
+ [name: string]: unknown;
22039
+ };
22040
+ content: {
22041
+ "application/json": {
22042
+ /**
22043
+ * @description Error overview.
22044
+ * @example Solo el administrador de la instancia puede cambiar su plan.
22045
+ */
22046
+ message: string;
22047
+ };
22048
+ };
22049
+ };
22050
+ 404: components["responses"]["ModelNotFoundException"];
22051
+ 422: components["responses"]["ValidationException"];
22052
+ };
22053
+ };
20950
22054
  "tenantDelegationCallback.delegatedIndex": {
20951
22055
  parameters: {
20952
22056
  query?: never;
@@ -24899,28 +26003,30 @@ export interface operations {
24899
26003
  };
24900
26004
  content: {
24901
26005
  "application/json": {
24902
- data: unknown[];
24903
- };
24904
- };
24905
- };
24906
- 422: {
24907
- headers: {
24908
- [name: string]: unknown;
24909
- };
24910
- content: {
24911
- "application/json": {
24912
- /** @constant */
24913
- message: "Invoice not registered in VeriFactu";
24914
- };
24915
- };
24916
- };
24917
- 500: {
24918
- headers: {
24919
- [name: string]: unknown;
24920
- };
24921
- content: {
24922
- "application/json": {
24923
- message: string;
26006
+ data: {
26007
+ id: string;
26008
+ invoice_number: string;
26009
+ invoice_date: string;
26010
+ invoice_type: string;
26011
+ issuer_nif: string;
26012
+ recipient_nif: string | null;
26013
+ recipient_name: string | null;
26014
+ total_amount: string;
26015
+ total_tax_amount: string;
26016
+ record_type: string;
26017
+ aeat_status: string;
26018
+ aeat_csv: string | null;
26019
+ aeat_response: {
26020
+ [key: string]: unknown;
26021
+ } | string | null;
26022
+ sent_at: string | null;
26023
+ attempts: number;
26024
+ hash: string;
26025
+ previous_hash: string | null;
26026
+ qr_url: string | null;
26027
+ generation_timestamp: string;
26028
+ created_at: string;
26029
+ };
24924
26030
  };
24925
26031
  };
24926
26032
  };
@@ -24952,6 +26058,8 @@ export interface operations {
24952
26058
  hash: string | null;
24953
26059
  qr_data: string | null;
24954
26060
  verifactu_record_id: string | null;
26061
+ /** @description Código Seguro de Verificación que devuelve la AEAT al aceptar el registro; null hasta entonces. */
26062
+ aeat_csv: string | null;
24955
26063
  };
24956
26064
  };
24957
26065
  };