@pimia/sdk 0.17.0 → 0.19.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,146 @@ 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
+ * Si el pagador tenía una suscripción cancelada a fin de periodo (bajó a
5294
+ * Free y se arrepintió), NO hay checkout: se reanuda esa suscripción, se
5295
+ * recrea el asiento y el plan cambia al instante. Entonces `resumed` es
5296
+ * `true`, `checkout_url` es `null` y `plan` dice a cuál: el panel no tiene
5297
+ * a dónde ir, solo refrescar.
5298
+ *
5299
+ * Errores, con su código en `error`: `white_label` (403), `no_payer` (409),
5300
+ * `free_plan` y `channel_plan` (422), `tenant_already_subscribed` (422),
5301
+ * `stripe_resume_failed` (502), `stripe_price_missing` (503).
5302
+ */
5303
+ post: operations["tenantBilling.checkoutFromPanel"];
5304
+ delete?: never;
5305
+ options?: never;
5306
+ head?: never;
5307
+ patch?: never;
5308
+ trace?: never;
5309
+ };
5310
+ "/billing/portal": {
5311
+ parameters: {
5312
+ query?: never;
5313
+ header?: never;
5314
+ path?: never;
5315
+ cookie?: never;
5316
+ };
5317
+ get?: never;
5318
+ put?: never;
5319
+ /**
5320
+ * El portal de Stripe del pagador: cambiar la tarjeta, ver y descargar las
5321
+ * facturas de Pimia, cancelar. Solo el dueño, y solo si ya hay cuenta de
5322
+ * facturación en Stripe (`no_billing_account`, 404, si nunca contrató)
5323
+ * @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í.
5324
+ */
5325
+ post: operations["tenantBilling.portal"];
5326
+ delete?: never;
5327
+ options?: never;
5328
+ head?: never;
5329
+ patch?: never;
5330
+ trace?: never;
5331
+ };
5332
+ "/billing/change-plan": {
5333
+ parameters: {
5334
+ query?: never;
5335
+ header?: never;
5336
+ path?: never;
5337
+ cookie?: never;
5338
+ };
5339
+ get?: never;
5340
+ put?: never;
5341
+ /**
5342
+ * Cambiar de plan: subir, bajar entre planes de pago o bajar a Free
5343
+ * @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í.
5344
+ *
5345
+ * Las reglas son las de `PlanChange`, las mismas que en el plano central:
5346
+ * `not_the_payer` (403) si la licencia la paga otra cuenta, `channel_plan`
5347
+ * y `channel_seat` (422), `no_active_subscription` (422: sin suscripción
5348
+ * viva hay que pasar por el checkout), `subscription_not_linked` (409),
5349
+ * `stripe_price_missing` (503). Solo el dueño de la instancia.
5350
+ */
5351
+ post: operations["tenantBilling.changePlan"];
5352
+ delete?: never;
5353
+ options?: never;
5354
+ head?: never;
5355
+ patch?: never;
5356
+ trace?: never;
5357
+ };
5049
5358
  "/delegated-tasks": {
5050
5359
  parameters: {
5051
5360
  query?: never;
@@ -5713,8 +6022,23 @@ export interface paths {
5713
6022
  };
5714
6023
  /**
5715
6024
  * Get full VeriFactu details for an invoice
5716
- * @description Returns the complete data from VeriFactu API including
5717
- * AEAT response, alerts, attempts count, etc.
6025
+ * @description Devuelve el registro tal como lo tiene el servicio VeriFactu: el estado
6026
+ * ante la AEAT (`aeat_status`), el CSV que devolvió al aceptarlo
6027
+ * (`aeat_csv`), su respuesta literal (`aeat_response`: el motivo del rechazo
6028
+ * o del aviso, o `{status: 'correct', csv}` si lo aceptó), cuándo se envió
6029
+ * (`sent_at`, en UTC), cuántos intentos lleva, la huella y la URL del QR.
6030
+ *
6031
+ * El cuerpo es `{data: <registro>}`, UN solo nivel. Hasta 2026-09-02 el
6032
+ * registro llegaba DOS niveles dentro: `VeriFactuClient::getInvoice()`
6033
+ * devuelve el cuerpo entero de verifactuApi, que ya es `{data: <registro>}`,
6034
+ * y aquí se volvía a envolver. Nadie lo leía bien: el modal de VeriFactu
6035
+ * del panel pintaba «—» y «No enviada» sobre facturas ACEPTADAS, y la vista
6036
+ * de la factura nunca encontraba el motivo del rechazo (#646). `sync` y
6037
+ * `retry` ya desenvolvían con `VeriFactuClient::datos()` desde el #505.
6038
+ *
6039
+ * Casos que no son el `200`: `422` si la factura no está registrada en
6040
+ * VeriFactu (no tiene `verifactu_record_id`); `500` si el servicio no
6041
+ * contesta o devuelve error, con el motivo en `message`.
5718
6042
  */
5719
6043
  get: operations["veriFactu.detail"];
5720
6044
  put?: never;
@@ -6364,6 +6688,18 @@ export interface components {
6364
6688
  name: string;
6365
6689
  trade_name?: string | null;
6366
6690
  vat_id?: string | null;
6691
+ /**
6692
+ * @description Número de registro mercantil de la empresa. En Francia es el
6693
+ * SIREN (9 dígitos) o el SIRET (14) y se comprueba su dígito de
6694
+ * control; es lo que identifica al emisor en la facturación
6695
+ * electrónica francesa y sin él no se puede publicar. En España
6696
+ * no hace falta: el NIF (`vat_id`) es el identificador.
6697
+ */
6698
+ registration_number?: string | null;
6699
+ /** @description País fiscal del emisor (ISO 3166-1 alfa-2). */
6700
+ country_code?: string | null;
6701
+ /** @description Régimen fiscal por defecto de la empresa (clave AEAT de dos dígitos). */
6702
+ tax_regime?: string | null;
6367
6703
  slug?: string | null;
6368
6704
  address: {
6369
6705
  country_id: string;
@@ -6375,6 +6711,9 @@ export interface components {
6375
6711
  name: string;
6376
6712
  trade_name: string | null;
6377
6713
  vat_id: string | null;
6714
+ registration_number: string | null;
6715
+ country_code: string;
6716
+ tax_regime: string | null;
6378
6717
  /**
6379
6718
  * @description Sin `tax_id` ni `owner_id`: no son columnas de `companies` y se
6380
6719
  * publicaban a null (#377). Del dueño responde `User::isOwner()`.
@@ -6576,6 +6915,9 @@ export interface components {
6576
6915
  name: string;
6577
6916
  trade_name: string | null;
6578
6917
  vat_id: string | null;
6918
+ registration_number: string | null;
6919
+ country_code: string;
6920
+ tax_regime: string | null;
6579
6921
  /**
6580
6922
  * @description Sin `tax_id` ni `owner_id`: no son columnas de `companies` y se
6581
6923
  * publicaban a null (#377). Del dueño responde `User::isOwner()`.
@@ -6670,6 +7012,7 @@ export interface components {
6670
7012
  payment_method_id: number | null;
6671
7013
  customer_type: string;
6672
7014
  notes: string | null;
7015
+ registration_number: string | null;
6673
7016
  avatar: string;
6674
7017
  currency?: components["schemas"]["Currency"] | null;
6675
7018
  };
@@ -6688,6 +7031,15 @@ export interface components {
6688
7031
  * como `taxNumber` del comprador en FacturaE.
6689
7032
  */
6690
7033
  tax_id?: string | null;
7034
+ /**
7035
+ * @description Número de registro mercantil del cliente. Para un emisor
7036
+ * francés es el SIREN (9 dígitos) o el SIRET (14) del cliente,
7037
+ * mención obligatoria de la factura electrónica y lo que la
7038
+ * plataforma usa para enrutarla: sin él no se puede publicar una
7039
+ * factura a una empresa. Se comprueba su dígito de control; para
7040
+ * un emisor de otro país es texto libre.
7041
+ */
7042
+ registration_number?: string | null;
6691
7043
  notes?: string | null;
6692
7044
  /**
6693
7045
  * @description Referencia externa: TU identificador para este cliente (el id
@@ -6796,6 +7148,7 @@ export interface components {
6796
7148
  base_due_amount: number | null;
6797
7149
  prefix: string | null;
6798
7150
  tax_id: string | null;
7151
+ registration_number: string | null;
6799
7152
  notes: string | null;
6800
7153
  /**
6801
7154
  * @description Referencia externa DE QUIEN PREGUNTA: la resuelve el client OAuth
@@ -7552,6 +7905,29 @@ export interface components {
7552
7905
  catalog_id: number | null;
7553
7906
  is_override: boolean;
7554
7907
  };
7908
+ /** InboundEInvoiceResource */
7909
+ InboundEInvoiceResource: {
7910
+ id: number;
7911
+ source: string;
7912
+ external_id: string;
7913
+ network: string | null;
7914
+ format: string | null;
7915
+ type_code: string | null;
7916
+ invoice_number: string | null;
7917
+ supplier_siren: string | null;
7918
+ supplier_vat: string | null;
7919
+ status: string;
7920
+ error: string | null;
7921
+ pa_status: string | null;
7922
+ /** Format: date-time */
7923
+ pa_status_sent_at: string | null;
7924
+ rejection_reason: string | null;
7925
+ rejection_message: string | null;
7926
+ /** Format: date-time */
7927
+ imported_at: string | null;
7928
+ /** Format: date-time */
7929
+ received_at: string | null;
7930
+ };
7555
7931
  /** IncidenceRequest */
7556
7932
  IncidenceRequest: {
7557
7933
  /** Format: date */
@@ -7673,6 +8049,7 @@ export interface components {
7673
8049
  viewed_at: string | null;
7674
8050
  contract_id: number | null;
7675
8051
  export_batch_id: number | null;
8052
+ operation_nature: string | null;
7676
8053
  };
7677
8054
  /** InvoiceItem */
7678
8055
  InvoiceItem: {
@@ -7748,6 +8125,7 @@ export interface components {
7748
8125
  tax_included: string;
7749
8126
  discount_per_item: string | null;
7750
8127
  notes: string | null;
8128
+ operation_nature: string | null;
7751
8129
  discount_type: string | null;
7752
8130
  discount: number;
7753
8131
  discount_val: number;
@@ -7808,10 +8186,27 @@ export interface components {
7808
8186
  overdue: string;
7809
8187
  effective_paid_status: string;
7810
8188
  effective_overdue: string;
8189
+ /** @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
8190
  aeat_status: string;
7812
8191
  qr_data: string | null;
7813
8192
  hash: string | null;
8193
+ /** @description CSV de la AEAT, fachada española deprecada desde #656: el acuse neutro es `fiscal.receipt`. */
7814
8194
  aeat_csv: string | null;
8195
+ /** @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`. */
8196
+ fiscal: {
8197
+ country: string;
8198
+ driver: string;
8199
+ status: string;
8200
+ /** @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. */
8201
+ external_status: string | null;
8202
+ /** @description Código del régimen de ese estado (Francia: el código DGFiP, `202`, `207`…); null para España. */
8203
+ external_status_code: string | null;
8204
+ external_id: string | null;
8205
+ receipt: string | null;
8206
+ error: string | null;
8207
+ /** @description Cuándo se presentó ante la administración (ISO 8601, zona de la app); null hasta que el driver presenta. */
8208
+ submitted_at: string | null;
8209
+ } | null;
7815
8210
  is_credit_note: boolean;
7816
8211
  rectified_invoice_id: number | null;
7817
8212
  rectified_invoice_number?: string | null;
@@ -8056,6 +8451,15 @@ export interface components {
8056
8451
  * guardarse. Los `max` son los de la columna.
8057
8452
  */
8058
8453
  notes?: string | null;
8454
+ /**
8455
+ * @description Naturaleza de la operación, mención obligatoria de la factura
8456
+ * electrónica francesa: `S1` prestación de servicios, `B1` entrega
8457
+ * de bienes, `M1` mixta. Sin declararla, el Factur-X toma el valor
8458
+ * por defecto de la empresa (`fr_operation_nature`). Para un emisor
8459
+ * de otro país no tiene efecto.
8460
+ * @enum {string|null}
8461
+ */
8462
+ operation_nature?: "S1" | "B1" | "M1" | null;
8059
8463
  discount_type?: string | null;
8060
8464
  /**
8061
8465
  * @description Referencia libre del documento («Su pedido 4711»), distinta de
@@ -8865,6 +9269,7 @@ export interface components {
8865
9269
  * está cargada (show) para no disparar N+1 en el listado.
8866
9270
  */
8867
9271
  document_meta?: string;
9272
+ einvoice?: components["schemas"]["InboundEInvoiceResource"] | null;
8868
9273
  items?: components["schemas"]["ReceivedInvoiceItemResource"][];
8869
9274
  supplier?: components["schemas"]["SupplierResource"] | null;
8870
9275
  taxes?: components["schemas"]["TaxResource"][];
@@ -9056,6 +9461,21 @@ export interface components {
9056
9461
  creator?: components["schemas"]["UserResource"] | null;
9057
9462
  currency?: components["schemas"]["CurrencyResource"] | null;
9058
9463
  };
9464
+ /** RefuseInboundEInvoiceRequest */
9465
+ RefuseInboundEInvoiceRequest: {
9466
+ /**
9467
+ * @description Motivo del rechazo, del enum `rejectionDetail.reason` de la plateforme
9468
+ * (p. ej. `LEGAL_INFORMATION_MISSING`, `SIRET_INCORRECT_OR_MISSING`,
9469
+ * `DUPLICATE_INVOICE`, `VAT_RATE_INCORRECT`). Se reenvía tal cual al
9470
+ * emisor como estado 210 «refusée». Mayúsculas y guiones bajos.
9471
+ */
9472
+ reason: string;
9473
+ /**
9474
+ * @description Texto libre para el emisor: qué está mal y qué se espera en la
9475
+ * factura corregida.
9476
+ */
9477
+ message?: string | null;
9478
+ };
9059
9479
  /**
9060
9480
  * RenewContractRequest
9061
9481
  * @description Renovación manual de un contrato (`POST /contracts/{contract}/renew`).
@@ -9620,16 +10040,19 @@ export interface components {
9620
10040
  is_default: boolean;
9621
10041
  is_system: boolean;
9622
10042
  is_active: boolean;
10043
+ vat_category: string | null;
10044
+ vat_exemption_code: string | null;
9623
10045
  };
9624
10046
  /** TaxTypeRequest */
9625
10047
  TaxTypeRequest: {
9626
10048
  name: string;
9627
10049
  /**
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.
10050
+ * @description Porcentaje del impuesto. ⚠️ Una retención de IRPF se guarda en
10051
+ * NEGATIVO —un IRPF del 15 % es `-15`, porque resta de la factura—
10052
+ * y con `tax_category: "IRPF"` el positivo se rechaza con un 422.
10053
+ * El contrato no puede expresar esa condición: la regla depende de
10054
+ * otro campo y el generador evalúa `rules()` en frío. Por eso se
10055
+ * dice aquí.
9633
10056
  */
9634
10057
  percent?: number | null;
9635
10058
  description?: string | null;
@@ -9665,6 +10088,21 @@ export interface components {
9665
10088
  * `111` o `115` las retenciones.
9666
10089
  */
9667
10090
  aeat_model?: string | null;
10091
+ /**
10092
+ * @description Categoría de IVA de la norma europea EN 16931, la que viaja en la
10093
+ * factura electrónica (Factur-X, UBL): `S` tipo normal, `Z` tipo
10094
+ * cero, `E` exento, `AE` inversión del sujeto pasivo, `K` entrega
10095
+ * intracomunitaria, `G` exportación, `O` no sujeto. Si se omite, el
10096
+ * documento electrónico la deduce del porcentaje (>0 ⇒ `S`, 0 ⇒ `E`).
10097
+ * @enum {string|null}
10098
+ */
10099
+ vat_category?: "S" | "Z" | "E" | "AE" | "K" | "G" | "O" | null;
10100
+ /**
10101
+ * @description Código VATEX del motivo de exención (p. ej. `VATEX-FR-FRANCHISE`,
10102
+ * `VATEX-EU-AE`, `VATEX-EU-IC`, `VATEX-EU-G`) para las categorías
10103
+ * sin cuota. Sin efecto en un tipo `S`.
10104
+ */
10105
+ vat_exemption_code?: string | null;
9668
10106
  };
9669
10107
  /** TaxTypeResource */
9670
10108
  TaxTypeResource: {
@@ -9685,6 +10123,12 @@ export interface components {
9685
10123
  tax_category: string;
9686
10124
  aeat_model: string | null;
9687
10125
  tax_scope: string;
10126
+ /**
10127
+ * @description Categoría EN 16931 y VATEX (#651): null en los catálogos que no
10128
+ * la declaran, y el documento electrónico la deduce.
10129
+ */
10130
+ vat_category: string | null;
10131
+ vat_exemption_code: string | null;
9688
10132
  is_default: boolean;
9689
10133
  is_system: boolean;
9690
10134
  is_active: boolean;
@@ -9902,6 +10346,9 @@ export interface components {
9902
10346
  name: string;
9903
10347
  trade_name: string | null;
9904
10348
  vat_id: string | null;
10349
+ registration_number: string | null;
10350
+ country_code: string;
10351
+ tax_regime: string | null;
9905
10352
  /**
9906
10353
  * @description Sin `tax_id` ni `owner_id`: no son columnas de `companies` y se
9907
10354
  * publicaban a null (#377). Del dueño responde `User::isOwner()`.
@@ -13309,39 +13756,78 @@ export interface operations {
13309
13756
  };
13310
13757
  };
13311
13758
  };
13312
- "employees.index": {
13759
+ "eInvoice.download": {
13313
13760
  parameters: {
13314
13761
  query?: {
13315
- limit?: string;
13762
+ /** @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. */
13763
+ format?: string;
13316
13764
  };
13317
13765
  header?: never;
13318
- path?: never;
13766
+ path: {
13767
+ /** @description The invoice ID */
13768
+ invoice: number;
13769
+ };
13319
13770
  cookie?: never;
13320
13771
  };
13321
13772
  requestBody?: never;
13322
13773
  responses: {
13323
- /** @description Array of `EmployeeProfileResource` */
13324
13774
  200: {
13325
13775
  headers: {
13776
+ "Content-Disposition"?: string;
13326
13777
  [name: string]: unknown;
13327
13778
  };
13328
13779
  content: {
13329
- "application/json": {
13330
- data: components["schemas"]["EmployeeProfileResource"][];
13331
- meta: {
13332
- employee_total_count: number;
13333
- active_count: number;
13334
- };
13335
- };
13780
+ "application/octet-stream": Blob;
13336
13781
  };
13337
13782
  };
13338
- 403: components["responses"]["AuthorizationException"];
13339
- };
13340
- };
13341
- "employees.store": {
13342
- parameters: {
13343
- query?: never;
13344
- header?: never;
13783
+ 404: components["responses"]["ModelNotFoundException"];
13784
+ 422: components["responses"]["ValidationException"];
13785
+ 500: {
13786
+ headers: {
13787
+ [name: string]: unknown;
13788
+ };
13789
+ content: {
13790
+ "application/json": {
13791
+ error: boolean;
13792
+ message: string;
13793
+ };
13794
+ };
13795
+ };
13796
+ };
13797
+ };
13798
+ "employees.index": {
13799
+ parameters: {
13800
+ query?: {
13801
+ limit?: string;
13802
+ };
13803
+ header?: never;
13804
+ path?: never;
13805
+ cookie?: never;
13806
+ };
13807
+ requestBody?: never;
13808
+ responses: {
13809
+ /** @description Array of `EmployeeProfileResource` */
13810
+ 200: {
13811
+ headers: {
13812
+ [name: string]: unknown;
13813
+ };
13814
+ content: {
13815
+ "application/json": {
13816
+ data: components["schemas"]["EmployeeProfileResource"][];
13817
+ meta: {
13818
+ employee_total_count: number;
13819
+ active_count: number;
13820
+ };
13821
+ };
13822
+ };
13823
+ };
13824
+ 403: components["responses"]["AuthorizationException"];
13825
+ };
13826
+ };
13827
+ "employees.store": {
13828
+ parameters: {
13829
+ query?: never;
13830
+ header?: never;
13345
13831
  path?: never;
13346
13832
  cookie?: never;
13347
13833
  };
@@ -14225,6 +14711,7 @@ export interface operations {
14225
14711
  };
14226
14712
  };
14227
14713
  404: components["responses"]["ModelNotFoundException"];
14714
+ 422: components["responses"]["ValidationException"];
14228
14715
  500: {
14229
14716
  headers: {
14230
14717
  [name: string]: unknown;
@@ -14306,6 +14793,309 @@ export interface operations {
14306
14793
  422: components["responses"]["ValidationException"];
14307
14794
  };
14308
14795
  };
14796
+ "frEReporting.transactions": {
14797
+ parameters: {
14798
+ query?: {
14799
+ status?: "pending" | "sent" | "attached" | "declared" | "rejected" | "error" | "withdrawn";
14800
+ flow_type?: "10.1" | "10.2" | "10.3" | "10.4";
14801
+ from?: string;
14802
+ to?: string;
14803
+ per_page?: number;
14804
+ };
14805
+ header?: never;
14806
+ path?: never;
14807
+ cookie?: never;
14808
+ };
14809
+ requestBody?: never;
14810
+ responses: {
14811
+ 200: {
14812
+ headers: {
14813
+ [name: string]: unknown;
14814
+ };
14815
+ content: {
14816
+ "application/json": {
14817
+ data: {
14818
+ id: number;
14819
+ flow_type: string;
14820
+ source_type: string;
14821
+ source_id: number;
14822
+ status: string;
14823
+ transaction_date: string | null;
14824
+ period_start: string | null;
14825
+ period_end: string | null;
14826
+ currency_code: string;
14827
+ category_code: string | null;
14828
+ aggregates: {
14829
+ [key: string]: unknown;
14830
+ }[];
14831
+ external_id: string | null;
14832
+ report_id: string | null;
14833
+ error: string | null;
14834
+ sent_at: string | null;
14835
+ attached_at: string | null;
14836
+ created_at: string | null;
14837
+ }[];
14838
+ meta: {
14839
+ current_page: number;
14840
+ last_page: number;
14841
+ per_page: number;
14842
+ total: number;
14843
+ };
14844
+ };
14845
+ };
14846
+ };
14847
+ 422: components["responses"]["ValidationException"];
14848
+ };
14849
+ };
14850
+ "frEReporting.reports": {
14851
+ parameters: {
14852
+ query?: {
14853
+ status?: "open" | "closed" | "submitted" | "declared" | "rejected";
14854
+ per_page?: number;
14855
+ };
14856
+ header?: never;
14857
+ path?: never;
14858
+ cookie?: never;
14859
+ };
14860
+ requestBody?: never;
14861
+ responses: {
14862
+ 200: {
14863
+ headers: {
14864
+ [name: string]: unknown;
14865
+ };
14866
+ content: {
14867
+ "application/json": {
14868
+ data: {
14869
+ id: number;
14870
+ report_id: string;
14871
+ status: string;
14872
+ period_start: string | null;
14873
+ period_end: string | null;
14874
+ auto_close_at: string | null;
14875
+ declaration_type: string | null;
14876
+ file_link: string | null;
14877
+ error: string | null;
14878
+ transactions: number;
14879
+ submitted_at: string | null;
14880
+ declared_at: string | null;
14881
+ created_at: string | null;
14882
+ }[];
14883
+ meta: {
14884
+ current_page: number;
14885
+ last_page: number;
14886
+ per_page: number;
14887
+ total: number;
14888
+ };
14889
+ };
14890
+ };
14891
+ };
14892
+ 422: components["responses"]["ValidationException"];
14893
+ };
14894
+ };
14895
+ "frSettings.index": {
14896
+ parameters: {
14897
+ query?: never;
14898
+ header?: never;
14899
+ path?: never;
14900
+ cookie?: never;
14901
+ };
14902
+ requestBody?: never;
14903
+ responses: {
14904
+ 200: {
14905
+ headers: {
14906
+ [name: string]: unknown;
14907
+ };
14908
+ content: {
14909
+ "application/json": {
14910
+ data: {
14911
+ fr_operation_nature: string;
14912
+ fr_vat_on_debits: string;
14913
+ fr_payment_terms: string;
14914
+ fr_mention_pmt: string;
14915
+ fr_mention_pmd: string;
14916
+ fr_mention_aab: string;
14917
+ fr_vat_exemption_reason: string;
14918
+ fr_vat_regime: string | null;
14919
+ issuer: {
14920
+ name: string | null;
14921
+ registration_number: string | null;
14922
+ vat_number: string | null;
14923
+ siren: string | null;
14924
+ vat_number_valid: boolean;
14925
+ ready_to_publish: boolean;
14926
+ };
14927
+ platform: {
14928
+ provider: string;
14929
+ configured: boolean;
14930
+ environment: string | null;
14931
+ webhook_configured: boolean;
14932
+ entity_id: string | null;
14933
+ enrollment_id: string | null;
14934
+ enrollment_status: string | null;
14935
+ enrollment_started_at: string | null;
14936
+ };
14937
+ ereporting: {
14938
+ enabled: boolean;
14939
+ regime: string | null;
14940
+ regime_label: string | null;
14941
+ frequency: {
14942
+ transactions: string;
14943
+ payments: string;
14944
+ } | null;
14945
+ counts: {
14946
+ pending: number;
14947
+ sent: number;
14948
+ attached: number;
14949
+ declared: number;
14950
+ rejected: number;
14951
+ error: number;
14952
+ };
14953
+ current_period: {
14954
+ start: string;
14955
+ end: string;
14956
+ deadline: string;
14957
+ unattached: number;
14958
+ } | null;
14959
+ last_report: {
14960
+ id: number;
14961
+ report_id: string;
14962
+ status: string;
14963
+ period_start: string | null;
14964
+ period_end: string | null;
14965
+ auto_close_at: string | null;
14966
+ declaration_type: string | null;
14967
+ file_link: string | null;
14968
+ error: string | null;
14969
+ transactions: number;
14970
+ submitted_at: string | null;
14971
+ declared_at: string | null;
14972
+ created_at: string | null;
14973
+ } | null;
14974
+ };
14975
+ };
14976
+ };
14977
+ };
14978
+ };
14979
+ };
14980
+ };
14981
+ "frSettings.update": {
14982
+ parameters: {
14983
+ query?: never;
14984
+ header?: never;
14985
+ path?: never;
14986
+ cookie?: never;
14987
+ };
14988
+ requestBody?: {
14989
+ content: {
14990
+ "application/json": {
14991
+ /**
14992
+ * @description Naturaleza de la operación por defecto (BT-23): `S1` servicios,
14993
+ * `B1` bienes, `M1` mixta. Una factura puede declarar la suya.
14994
+ * @enum {string}
14995
+ */
14996
+ fr_operation_nature?: "S1" | "B1" | "M1";
14997
+ /**
14998
+ * @description Opción «TVA sur les débits» (BT-8 = 5): `YES` o `NO`.
14999
+ * @enum {string}
15000
+ */
15001
+ fr_vat_on_debits?: "YES" | "NO";
15002
+ fr_payment_terms?: string;
15003
+ /**
15004
+ * @description Las tres menciones legales obligatorias en toda factura francesa
15005
+ * (frais de recouvrement, pénalités de retard, escompte).
15006
+ */
15007
+ fr_mention_pmt?: string;
15008
+ fr_mention_pmd?: string;
15009
+ fr_mention_aab?: string;
15010
+ /** @description Texto de la exención para las líneas sin TVA (franquicia en base). */
15011
+ fr_vat_exemption_reason?: string;
15012
+ /**
15013
+ * @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.
15014
+ * @enum {string|null}
15015
+ */
15016
+ fr_vat_regime?: "reel_normal_mensuel" | "reel_normal_trimestriel" | "reel_simplifie" | "franchise_en_base" | null;
15017
+ };
15018
+ };
15019
+ };
15020
+ responses: {
15021
+ 200: {
15022
+ headers: {
15023
+ [name: string]: unknown;
15024
+ };
15025
+ content: {
15026
+ "application/json": {
15027
+ data: {
15028
+ fr_operation_nature: string;
15029
+ fr_vat_on_debits: string;
15030
+ fr_payment_terms: string;
15031
+ fr_mention_pmt: string;
15032
+ fr_mention_pmd: string;
15033
+ fr_mention_aab: string;
15034
+ fr_vat_exemption_reason: string;
15035
+ fr_vat_regime: string | null;
15036
+ issuer: {
15037
+ name: string | null;
15038
+ registration_number: string | null;
15039
+ vat_number: string | null;
15040
+ siren: string | null;
15041
+ vat_number_valid: boolean;
15042
+ ready_to_publish: boolean;
15043
+ };
15044
+ platform: {
15045
+ provider: string;
15046
+ configured: boolean;
15047
+ environment: string | null;
15048
+ webhook_configured: boolean;
15049
+ entity_id: string | null;
15050
+ enrollment_id: string | null;
15051
+ enrollment_status: string | null;
15052
+ enrollment_started_at: string | null;
15053
+ };
15054
+ ereporting: {
15055
+ enabled: boolean;
15056
+ regime: string | null;
15057
+ regime_label: string | null;
15058
+ frequency: {
15059
+ transactions: string;
15060
+ payments: string;
15061
+ } | null;
15062
+ counts: {
15063
+ pending: number;
15064
+ sent: number;
15065
+ attached: number;
15066
+ declared: number;
15067
+ rejected: number;
15068
+ error: number;
15069
+ };
15070
+ current_period: {
15071
+ start: string;
15072
+ end: string;
15073
+ deadline: string;
15074
+ unattached: number;
15075
+ } | null;
15076
+ last_report: {
15077
+ id: number;
15078
+ report_id: string;
15079
+ status: string;
15080
+ period_start: string | null;
15081
+ period_end: string | null;
15082
+ auto_close_at: string | null;
15083
+ declaration_type: string | null;
15084
+ file_link: string | null;
15085
+ error: string | null;
15086
+ transactions: number;
15087
+ submitted_at: string | null;
15088
+ declared_at: string | null;
15089
+ created_at: string | null;
15090
+ } | null;
15091
+ };
15092
+ };
15093
+ };
15094
+ };
15095
+ };
15096
+ 422: components["responses"]["ValidationException"];
15097
+ };
15098
+ };
14309
15099
  "gestoriaLink.asesorias": {
14310
15100
  parameters: {
14311
15101
  query?: {
@@ -14667,6 +15457,69 @@ export interface operations {
14667
15457
  422: components["responses"]["ValidationException"];
14668
15458
  };
14669
15459
  };
15460
+ "inboundEInvoice.approve": {
15461
+ parameters: {
15462
+ query?: never;
15463
+ header?: never;
15464
+ path: {
15465
+ /** @description The received invoice ID */
15466
+ received_invoice: number;
15467
+ };
15468
+ cookie?: never;
15469
+ };
15470
+ requestBody?: {
15471
+ content: {
15472
+ "application/json": {
15473
+ message?: string;
15474
+ };
15475
+ };
15476
+ };
15477
+ responses: {
15478
+ /** @description `ReceivedInvoiceResource` */
15479
+ 200: {
15480
+ headers: {
15481
+ [name: string]: unknown;
15482
+ };
15483
+ content: {
15484
+ "application/json": {
15485
+ data: components["schemas"]["ReceivedInvoiceResource"];
15486
+ };
15487
+ };
15488
+ };
15489
+ 404: components["responses"]["ModelNotFoundException"];
15490
+ };
15491
+ };
15492
+ "inboundEInvoice.refuse": {
15493
+ parameters: {
15494
+ query?: never;
15495
+ header?: never;
15496
+ path: {
15497
+ /** @description The received invoice ID */
15498
+ received_invoice: number;
15499
+ };
15500
+ cookie?: never;
15501
+ };
15502
+ requestBody: {
15503
+ content: {
15504
+ "application/json": components["schemas"]["RefuseInboundEInvoiceRequest"];
15505
+ };
15506
+ };
15507
+ responses: {
15508
+ /** @description `ReceivedInvoiceResource` */
15509
+ 200: {
15510
+ headers: {
15511
+ [name: string]: unknown;
15512
+ };
15513
+ content: {
15514
+ "application/json": {
15515
+ data: components["schemas"]["ReceivedInvoiceResource"];
15516
+ };
15517
+ };
15518
+ };
15519
+ 404: components["responses"]["ModelNotFoundException"];
15520
+ 422: components["responses"]["ValidationException"];
15521
+ };
15522
+ };
14670
15523
  "incidence.review": {
14671
15524
  parameters: {
14672
15525
  query?: never;
@@ -15032,6 +15885,49 @@ export interface operations {
15032
15885
  404: components["responses"]["ModelNotFoundException"];
15033
15886
  };
15034
15887
  };
15888
+ "invoiceFiscal.show": {
15889
+ parameters: {
15890
+ query?: never;
15891
+ header?: never;
15892
+ path: {
15893
+ /** @description The invoice ID */
15894
+ invoice: number;
15895
+ };
15896
+ cookie?: never;
15897
+ };
15898
+ requestBody?: never;
15899
+ responses: {
15900
+ 200: {
15901
+ headers: {
15902
+ [name: string]: unknown;
15903
+ };
15904
+ content: {
15905
+ "application/json": {
15906
+ data: {
15907
+ country: string;
15908
+ fiscal: {
15909
+ country: string;
15910
+ driver: string;
15911
+ status: string;
15912
+ external_status: string | null;
15913
+ external_status_code: string | null;
15914
+ external_id: string | null;
15915
+ receipt: string | null;
15916
+ error: string | null;
15917
+ submitted_at: string | null;
15918
+ } | null;
15919
+ driver_detail: {
15920
+ [key: string]: unknown;
15921
+ } | null;
15922
+ driver_detail_error: string | null;
15923
+ };
15924
+ };
15925
+ };
15926
+ };
15927
+ 403: components["responses"]["AuthorizationException"];
15928
+ 404: components["responses"]["ModelNotFoundException"];
15929
+ };
15930
+ };
15035
15931
  "invoice.invoiceFormats": {
15036
15932
  parameters: {
15037
15933
  query?: never;
@@ -20947,6 +21843,222 @@ export interface operations {
20947
21843
  404: components["responses"]["ModelNotFoundException"];
20948
21844
  };
20949
21845
  };
21846
+ "tenantBilling.plans": {
21847
+ parameters: {
21848
+ query?: never;
21849
+ header?: never;
21850
+ path?: never;
21851
+ cookie?: never;
21852
+ };
21853
+ requestBody?: never;
21854
+ responses: {
21855
+ 200: {
21856
+ headers: {
21857
+ [name: string]: unknown;
21858
+ };
21859
+ content: {
21860
+ "application/json": {
21861
+ data: {
21862
+ id: number;
21863
+ name: string;
21864
+ price: string;
21865
+ price_cents: number;
21866
+ max_invoices_month: number;
21867
+ max_users: number;
21868
+ max_storage_mb: number;
21869
+ features: string[];
21870
+ is_free: boolean;
21871
+ }[];
21872
+ white_label: boolean;
21873
+ message: string | null;
21874
+ };
21875
+ };
21876
+ };
21877
+ 404: components["responses"]["ModelNotFoundException"];
21878
+ };
21879
+ };
21880
+ "tenantBilling.subscription": {
21881
+ parameters: {
21882
+ query?: never;
21883
+ header?: never;
21884
+ path?: never;
21885
+ cookie?: never;
21886
+ };
21887
+ requestBody?: never;
21888
+ responses: {
21889
+ 200: {
21890
+ headers: {
21891
+ [name: string]: unknown;
21892
+ };
21893
+ content: {
21894
+ "application/json": {
21895
+ data: {
21896
+ plan: {
21897
+ id: number;
21898
+ name: string;
21899
+ price: string;
21900
+ price_cents: number;
21901
+ max_invoices_month: number;
21902
+ max_users: number;
21903
+ max_storage_mb: number;
21904
+ features: string[];
21905
+ is_free: boolean;
21906
+ } | null;
21907
+ limits: {
21908
+ max_invoices_month: number;
21909
+ max_users: number;
21910
+ max_storage_mb: number;
21911
+ };
21912
+ usage: {
21913
+ invoices_month: number;
21914
+ users: number;
21915
+ storage: {
21916
+ used_bytes: number;
21917
+ used_mb: number;
21918
+ limit_mb: number;
21919
+ unlimited: boolean;
21920
+ percent: number | null;
21921
+ } | null;
21922
+ };
21923
+ trial: {
21924
+ active: boolean;
21925
+ ends_at: string | null;
21926
+ };
21927
+ billing: {
21928
+ mode: string;
21929
+ white_label: boolean;
21930
+ can_manage: boolean;
21931
+ seat: {
21932
+ role: string;
21933
+ grace_until: string | null;
21934
+ suspended_at: string | null;
21935
+ } | null;
21936
+ };
21937
+ subscription: {
21938
+ status: string;
21939
+ current_period_end: number | null;
21940
+ cancel_at_period_end: boolean;
21941
+ ends_at: string | null;
21942
+ } | null;
21943
+ status: string;
21944
+ };
21945
+ };
21946
+ };
21947
+ };
21948
+ 404: components["responses"]["ModelNotFoundException"];
21949
+ };
21950
+ };
21951
+ "tenantBilling.checkoutFromPanel": {
21952
+ parameters: {
21953
+ query?: never;
21954
+ header?: never;
21955
+ path?: never;
21956
+ cookie?: never;
21957
+ };
21958
+ requestBody?: never;
21959
+ responses: {
21960
+ 200: {
21961
+ headers: {
21962
+ [name: string]: unknown;
21963
+ };
21964
+ content: {
21965
+ "application/json": {
21966
+ data: {
21967
+ checkout_url: string | null;
21968
+ resumed: boolean;
21969
+ plan: string | null;
21970
+ };
21971
+ };
21972
+ };
21973
+ };
21974
+ };
21975
+ };
21976
+ "tenantBilling.portal": {
21977
+ parameters: {
21978
+ query?: never;
21979
+ header?: never;
21980
+ path?: never;
21981
+ cookie?: never;
21982
+ };
21983
+ requestBody?: never;
21984
+ responses: {
21985
+ 200: {
21986
+ headers: {
21987
+ [name: string]: unknown;
21988
+ };
21989
+ content: {
21990
+ "application/json": {
21991
+ data: {
21992
+ portal_url: string;
21993
+ };
21994
+ };
21995
+ };
21996
+ };
21997
+ /** @description An error */
21998
+ 403: {
21999
+ headers: {
22000
+ [name: string]: unknown;
22001
+ };
22002
+ content: {
22003
+ "application/json": {
22004
+ /**
22005
+ * @description Error overview.
22006
+ * @example Solo el administrador de la instancia puede gestionar su suscripción.
22007
+ */
22008
+ message: string;
22009
+ };
22010
+ };
22011
+ };
22012
+ 404: components["responses"]["ModelNotFoundException"];
22013
+ };
22014
+ };
22015
+ "tenantBilling.changePlan": {
22016
+ parameters: {
22017
+ query?: never;
22018
+ header?: never;
22019
+ path?: never;
22020
+ cookie?: never;
22021
+ };
22022
+ requestBody: {
22023
+ content: {
22024
+ "application/json": {
22025
+ plan_id: number;
22026
+ };
22027
+ };
22028
+ };
22029
+ responses: {
22030
+ 200: {
22031
+ headers: {
22032
+ [name: string]: unknown;
22033
+ };
22034
+ content: {
22035
+ "application/json": {
22036
+ message: string;
22037
+ data: {
22038
+ plan: string;
22039
+ };
22040
+ };
22041
+ };
22042
+ };
22043
+ /** @description An error */
22044
+ 403: {
22045
+ headers: {
22046
+ [name: string]: unknown;
22047
+ };
22048
+ content: {
22049
+ "application/json": {
22050
+ /**
22051
+ * @description Error overview.
22052
+ * @example Solo el administrador de la instancia puede cambiar su plan.
22053
+ */
22054
+ message: string;
22055
+ };
22056
+ };
22057
+ };
22058
+ 404: components["responses"]["ModelNotFoundException"];
22059
+ 422: components["responses"]["ValidationException"];
22060
+ };
22061
+ };
20950
22062
  "tenantDelegationCallback.delegatedIndex": {
20951
22063
  parameters: {
20952
22064
  query?: never;
@@ -24899,28 +26011,30 @@ export interface operations {
24899
26011
  };
24900
26012
  content: {
24901
26013
  "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;
26014
+ data: {
26015
+ id: string;
26016
+ invoice_number: string;
26017
+ invoice_date: string;
26018
+ invoice_type: string;
26019
+ issuer_nif: string;
26020
+ recipient_nif: string | null;
26021
+ recipient_name: string | null;
26022
+ total_amount: string;
26023
+ total_tax_amount: string;
26024
+ record_type: string;
26025
+ aeat_status: string;
26026
+ aeat_csv: string | null;
26027
+ aeat_response: {
26028
+ [key: string]: unknown;
26029
+ } | string | null;
26030
+ sent_at: string | null;
26031
+ attempts: number;
26032
+ hash: string;
26033
+ previous_hash: string | null;
26034
+ qr_url: string | null;
26035
+ generation_timestamp: string;
26036
+ created_at: string;
26037
+ };
24924
26038
  };
24925
26039
  };
24926
26040
  };
@@ -24952,6 +26066,8 @@ export interface operations {
24952
26066
  hash: string | null;
24953
26067
  qr_data: string | null;
24954
26068
  verifactu_record_id: string | null;
26069
+ /** @description Código Seguro de Verificación que devuelve la AEAT al aceptar el registro; null hasta entonces. */
26070
+ aeat_csv: string | null;
24955
26071
  };
24956
26072
  };
24957
26073
  };