{"openapi":"3.1.0","info":{"title":"FacturaX.app API","version":"1.0.0"},"paths":{"/contabilidad/stats/vendors-learned":{"get":{"tags":["Contabilidad — libro mayor"],"summary":"Get Vendors Learned","description":"Cuántos proveedores distintos reconoce ya automáticamente el sistema\npara este usuario (vendor_accounting, confirmados por categorización\naprendida). Es la \"inteligencia acumulada\" del usuario — cuantas más\nfacturas procesa, más proveedores reconoce sin preguntar. Se muestra\ncomo contador visible en el panel para que se note que el sistema\nmejora con el uso, en vez de quedar invisible en segundo plano.","operationId":"get_vendors_learned_contabilidad_stats_vendors_learned_get","parameters":[{"name":"X-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/contabilidad/access":{"get":{"tags":["Contabilidad — libro mayor"],"summary":"Get Access","description":"Devuelve si el usuario tiene acceso a /contabilidad y por qué.\nEl frontend lo llama al cargar la página para decidir si mostrar\nel paywall o el panel.","operationId":"get_access_contabilidad_access_get","parameters":[{"name":"X-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/contabilidad/expiry-summary":{"get":{"tags":["Contabilidad — libro mayor"],"summary":"Get Expiry Summary","description":"\"Lo que hay en juego\" cuando el trial expira — usado por el paywall\npara mostrar datos reales del usuario en vez de una frase genérica\n(\"Tienes 47 asientos y un IVA estimado de 1.240€ para el T3\").\n\nA propósito NO pasa por _plan_gate: tiene que poder devolver datos\naunque el trial ya haya expirado (access=False) — es precisamente el\nmomento en que el frontend lo necesita. Solo exige sesión válida.\n\nrecommended_plan es una heurística sobre USO REAL durante el trial\n(no sobre lo que \"podría\" necesitar), para que el CTA del paywall\nlleve directo al plan que de verdad usó — evita mandarle a Básico\na alguien que ya activó recordatorios de cobro automáticos.","operationId":"get_expiry_summary_contabilidad_expiry_summary_get","parameters":[{"name":"X-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/contabilidad/auto-import-preference":{"post":{"tags":["Contabilidad — libro mayor"],"summary":"Set Auto Import Preference","description":"Guarda si el usuario quiere que sus extracciones se importen solas al\nlibro mayor. Se llama una sola vez, la primera vez que se le pregunta\n(al marcar o no la casilla del popup tras procesar su primera factura\ncon acceso a contabilidad) — por eso también marca import_popup_shown,\npara que ese popup no se le vuelva a mostrar después.","operationId":"set_auto_import_preference_contabilidad_auto_import_preference_post","parameters":[{"name":"X-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AutoImportPreference"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/contabilidad/subscribe":{"post":{"tags":["Contabilidad — libro mayor"],"summary":"Create Subscription","description":"Crea una sesión de Stripe Checkout para un plan de contabilidad.\nbody: { \"plan\": \"contab_basic\" | \"contab_pro\" | \"contab_business\" }","operationId":"create_subscription_contabilidad_subscribe_post","parameters":[{"name":"X-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Body"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/contabilidad/entries":{"get":{"tags":["Contabilidad — libro mayor"],"summary":"List Entries","operationId":"list_entries_contabilidad_entries_get","parameters":[{"name":"type","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Type"}},{"name":"q","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Q"}},{"name":"from_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"From Date"}},{"name":"to_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"To Date"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":500,"default":200,"title":"Limit"}},{"name":"X-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["Contabilidad — libro mayor"],"summary":"Create Entry","operationId":"create_entry_contabilidad_entries_post","parameters":[{"name":"X-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EntryCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/contabilidad/entries/{entry_id}":{"patch":{"tags":["Contabilidad — libro mayor"],"summary":"Patch Entry","operationId":"patch_entry_contabilidad_entries__entry_id__patch","parameters":[{"name":"entry_id","in":"path","required":true,"schema":{"type":"integer","title":"Entry Id"}},{"name":"X-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EntryPatch"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["Contabilidad — libro mayor"],"summary":"Delete Entry","operationId":"delete_entry_contabilidad_entries__entry_id__delete","parameters":[{"name":"entry_id","in":"path","required":true,"schema":{"type":"integer","title":"Entry Id"}},{"name":"X-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/contabilidad/entries/{entry_id}/attachment":{"post":{"tags":["Contabilidad — libro mayor"],"summary":"Upload Attachment","description":"Sube (o sustituye) el justificante adjunto de un asiento. Máx. 5 MB, PDF o imagen.","operationId":"upload_attachment_contabilidad_entries__entry_id__attachment_post","parameters":[{"name":"entry_id","in":"path","required":true,"schema":{"type":"integer","title":"Entry Id"}},{"name":"X-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_upload_attachment_contabilidad_entries__entry_id__attachment_post"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["Contabilidad — libro mayor"],"summary":"Get Attachment","description":"Descarga el justificante adjunto de un asiento (requiere ser su dueño).","operationId":"get_attachment_contabilidad_entries__entry_id__attachment_get","parameters":[{"name":"entry_id","in":"path","required":true,"schema":{"type":"integer","title":"Entry Id"}},{"name":"X-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["Contabilidad — libro mayor"],"summary":"Remove Attachment","description":"Elimina el justificante adjunto de un asiento (el asiento en sí no se borra).","operationId":"remove_attachment_contabilidad_entries__entry_id__attachment_delete","parameters":[{"name":"entry_id","in":"path","required":true,"schema":{"type":"integer","title":"Entry Id"}},{"name":"X-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/contabilidad/entries/import-from-facturax":{"post":{"tags":["Contabilidad — libro mayor"],"summary":"Import From Facturax","description":"Lee las extracciones del usuario desde usage_log que aún no han sido\nimportadas al libro mayor, y las añade como asientos.","operationId":"import_from_facturax_contabilidad_entries_import_from_facturax_post","parameters":[{"name":"X-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/contabilidad/entries/pending-import":{"get":{"tags":["Contabilidad — libro mayor"],"summary":"Pending Import Count","description":"Cuenta cuántos logs son REALMENTE importables ahora mismo (mismo\ncriterio que import_from_facturax). Antes contaba TODOS los logs no\nimportados, incluyendo los que nunca se podrían importar (JSON\ninválido, importe 0) — esos se quedaban pendientes para siempre y el\naviso nunca llegaba a 0 aunque se importara todo lo importable.","operationId":"pending_import_count_contabilidad_entries_pending_import_get","parameters":[{"name":"X-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/contabilidad/recurring":{"get":{"tags":["Contabilidad — libro mayor"],"summary":"List Recurring","operationId":"list_recurring_contabilidad_recurring_get","parameters":[{"name":"X-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["Contabilidad — libro mayor"],"summary":"Create Recurring","operationId":"create_recurring_contabilidad_recurring_post","parameters":[{"name":"X-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RecurringCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/contabilidad/recurring/{rid}":{"delete":{"tags":["Contabilidad — libro mayor"],"summary":"Delete Recurring","operationId":"delete_recurring_contabilidad_recurring__rid__delete","parameters":[{"name":"rid","in":"path","required":true,"schema":{"type":"integer","title":"Rid"}},{"name":"X-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/contabilidad/recurring-invoices":{"get":{"tags":["Contabilidad — libro mayor"],"summary":"List Recurring Invoices","operationId":"list_recurring_invoices_contabilidad_recurring_invoices_get","parameters":[{"name":"X-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["Contabilidad — libro mayor"],"summary":"Create Recurring Invoice","operationId":"create_recurring_invoice_contabilidad_recurring_invoices_post","parameters":[{"name":"X-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RecurringInvoiceCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/contabilidad/recurring-invoices/{rid}":{"delete":{"tags":["Contabilidad — libro mayor"],"summary":"Delete Recurring Invoice","operationId":"delete_recurring_invoice_contabilidad_recurring_invoices__rid__delete","parameters":[{"name":"rid","in":"path","required":true,"schema":{"type":"integer","title":"Rid"}},{"name":"X-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/contabilidad/bank/match":{"post":{"tags":["Contabilidad — libro mayor"],"summary":"Match Bank Movements","description":"Recibe los movimientos parseados del extracto CSV (esto sigue\nocurriendo en el navegador — el parseo de formatos de banco no\ncambia) y, para cada uno, busca asientos PENDIENTES del usuario que\ncoincidan en importe (±1 céntimo) y en fecha (±10 días):\n\n  - 1 candidato exacto  → se concilia solo: el asiento pasa a\n    cobrado/pagado y no hace falta que el usuario toque nada.\n  - varios candidatos   → se devuelven como sugerencias para que el\n    usuario elija cuál es, en vez de arriesgarse a adivinar mal.\n  - 0 candidatos        → sigue el flujo actual (crear un asiento\n    nuevo clasificándolo a mano).","operationId":"match_bank_movements_contabilidad_bank_match_post","parameters":[{"name":"X-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BankMatchRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/contabilidad/bank/confirm/{entry_id}":{"post":{"tags":["Contabilidad — libro mayor"],"summary":"Confirm Bank Match","description":"Confirma manualmente cuál de los candidatos ambiguos corresponde\na un movimiento bancario concreto, marcándolo como cobrado/pagado.","operationId":"confirm_bank_match_contabilidad_bank_confirm__entry_id__post","parameters":[{"name":"entry_id","in":"path","required":true,"schema":{"type":"integer","title":"Entry Id"}},{"name":"X-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Body"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/contabilidad/insights":{"get":{"tags":["Contabilidad — libro mayor"],"summary":"Get Insights","description":"Clientes, alertas y previsión de tesorería — Profesional/Business (o trial).","operationId":"get_insights_contabilidad_insights_get","parameters":[{"name":"period","in":"query","required":false,"schema":{"type":"string","default":"T3","title":"Period"}},{"name":"year","in":"query","required":true,"schema":{"type":"integer","title":"Year"}},{"name":"X-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/contabilidad/insights/yoy":{"get":{"tags":["Contabilidad — libro mayor"],"summary":"Get Insights Yoy","description":"Comparativa año a año — exclusiva de Business (o trial).","operationId":"get_insights_yoy_contabilidad_insights_yoy_get","parameters":[{"name":"period","in":"query","required":false,"schema":{"type":"string","default":"T3","title":"Period"}},{"name":"year","in":"query","required":true,"schema":{"type":"integer","title":"Year"}},{"name":"X-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/contabilidad/budget":{"get":{"tags":["Contabilidad — libro mayor"],"summary":"Get Budget","operationId":"get_budget_contabilidad_budget_get","parameters":[{"name":"X-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"tags":["Contabilidad — libro mayor"],"summary":"Update Budget","operationId":"update_budget_contabilidad_budget_put","parameters":[{"name":"X-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BudgetUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/contabilidad/tax-payments":{"get":{"tags":["Contabilidad — libro mayor"],"summary":"List Tax Payments","operationId":"list_tax_payments_contabilidad_tax_payments_get","parameters":[{"name":"X-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["Contabilidad — libro mayor"],"summary":"Upsert Tax Payment","operationId":"upsert_tax_payment_contabilidad_tax_payments_post","parameters":[{"name":"X-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaxPaymentUpsert"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/contabilidad/proposals":{"get":{"tags":["Contabilidad — libro mayor"],"summary":"List Proposals","operationId":"list_proposals_contabilidad_proposals_get","parameters":[{"name":"X-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["Contabilidad — libro mayor"],"summary":"Create Proposal","operationId":"create_proposal_contabilidad_proposals_post","parameters":[{"name":"X-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProposalCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/contabilidad/proposals/{pid}":{"patch":{"tags":["Contabilidad — libro mayor"],"summary":"Patch Proposal","operationId":"patch_proposal_contabilidad_proposals__pid__patch","parameters":[{"name":"pid","in":"path","required":true,"schema":{"type":"integer","title":"Pid"}},{"name":"X-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProposalPatch"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["Contabilidad — libro mayor"],"summary":"Delete Proposal","operationId":"delete_proposal_contabilidad_proposals__pid__delete","parameters":[{"name":"pid","in":"path","required":true,"schema":{"type":"integer","title":"Pid"}},{"name":"X-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/contabilidad/proposals/{pid}/convert":{"post":{"tags":["Contabilidad — libro mayor"],"summary":"Convert Proposal To Invoice","description":"Convierte una propuesta aceptada en un asiento de ingreso pendiente de cobro.","operationId":"convert_proposal_to_invoice_contabilidad_proposals__pid__convert_post","parameters":[{"name":"pid","in":"path","required":true,"schema":{"type":"integer","title":"Pid"}},{"name":"X-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/contabilidad/fiscal-profile":{"get":{"tags":["Contabilidad — libro mayor"],"summary":"Get Fiscal Profile","operationId":"get_fiscal_profile_contabilidad_fiscal_profile_get","parameters":[{"name":"X-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["Contabilidad — libro mayor"],"summary":"Save Fiscal Profile","operationId":"save_fiscal_profile_contabilidad_fiscal_profile_post","parameters":[{"name":"X-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FiscalProfileUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/auth/register":{"post":{"tags":["Auth"],"summary":"Register","operationId":"register_auth_register_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RegisterRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/auth/verify":{"get":{"tags":["Auth"],"summary":"Verify Email","operationId":"verify_email_auth_verify_get","parameters":[{"name":"token","in":"query","required":true,"schema":{"type":"string","title":"Token"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/auth/login":{"post":{"tags":["Auth"],"summary":"Login","operationId":"login_auth_login_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LoginRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/auth/google":{"post":{"tags":["Auth"],"summary":"Google Auth","operationId":"google_auth_auth_google_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Body"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/auth/forgot-password":{"post":{"tags":["Auth"],"summary":"Forgot Password","operationId":"forgot_password_auth_forgot_password_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResetRequestBody"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/auth/reset-password":{"post":{"tags":["Auth"],"summary":"Do Reset Password","operationId":"do_reset_password_auth_reset_password_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResetPasswordBody"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/auth/me":{"get":{"tags":["Auth"],"summary":"Get Me","operationId":"get_me_auth_me_get","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"type":"string","title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/extract":{"post":{"tags":["Extraction"],"summary":"Extract Invoice","operationId":"extract_invoice_extract_post","parameters":[{"name":"X-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_extract_invoice_extract_post"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/extract/batch":{"post":{"tags":["Extraction"],"summary":"Extract Batch","description":"Procesa múltiples facturas en paralelo.\nDevuelve un array con los resultados de cada archivo.","operationId":"extract_batch_extract_batch_post","parameters":[{"name":"X-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_extract_batch_extract_batch_post"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/batch/job":{"post":{"tags":["Batch Jobs"],"summary":"Create Batch Job","description":"Crea un job de procesamiento en background.\nDevuelve job_id inmediatamente — el cliente hace polling a GET /batch/job/{job_id}.","operationId":"create_batch_job_batch_job_post","parameters":[{"name":"X-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_create_batch_job_batch_job_post"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/batch/job/{job_id}":{"get":{"tags":["Batch Jobs"],"summary":"Get Batch Job","description":"Devuelve el estado actual de un batch job.","operationId":"get_batch_job_batch_job__job_id__get","parameters":[{"name":"job_id","in":"path","required":true,"schema":{"type":"string","title":"Job Id"}},{"name":"X-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/batch/jobs":{"get":{"tags":["Batch Jobs"],"summary":"List Batch Jobs","description":"Lists the last 20 jobs for the user.","operationId":"list_batch_jobs_batch_jobs_get","parameters":[{"name":"X-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/extract/batch/download-zip":{"post":{"tags":["Extraction"],"summary":"Batch Download Zip","description":"Genera un ZIP con los Facturae XML de los log_ids indicados.\nBody: { \"log_ids\": [1, 2, 3, ...] }","operationId":"batch_download_zip_extract_batch_download_zip_post","parameters":[{"name":"X-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/due-dates":{"get":{"tags":["Historial"],"summary":"Get Due Dates","description":"Devuelve las facturas con due_date extraído, ordenadas por fecha de vencimiento.\nUsado por la página de Vencimientos del dashboard.","operationId":"get_due_dates_due_dates_get","parameters":[{"name":"X-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/history":{"get":{"tags":["Historial"],"summary":"Get History","operationId":"get_history_history_get","parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":200,"minimum":1,"description":"Records per page (1-200)","default":50,"title":"Limit"},"description":"Records per page (1-200)"},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"description":"Number of records to skip","default":0,"title":"Offset"},"description":"Number of records to skip"},{"name":"subaccount_id","in":"query","required":false,"schema":{"type":"integer","description":"Filtrar por ID de subcuenta (solo Business)","default":0,"title":"Subaccount Id"},"description":"Filtrar por ID de subcuenta (solo Business)"},{"name":"q","in":"query","required":false,"schema":{"type":"string","description":"Buscar en filename, emisor, nº factura, external_ref","default":"","title":"Q"},"description":"Buscar en filename, emisor, nº factura, external_ref"},{"name":"status","in":"query","required":false,"schema":{"type":"string","description":"ok | error","default":"","title":"Status"},"description":"ok | error"},{"name":"date_from","in":"query","required":false,"schema":{"type":"string","description":"YYYY-MM-DD","default":"","title":"Date From"},"description":"YYYY-MM-DD"},{"name":"date_to","in":"query","required":false,"schema":{"type":"string","description":"YYYY-MM-DD","default":"","title":"Date To"},"description":"YYYY-MM-DD"},{"name":"X-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/metrics":{"get":{"tags":["Metrics"],"summary":"Get Metrics","operationId":"get_metrics_metrics_get","parameters":[{"name":"X-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/subaccounts":{"get":{"tags":["Subaccounts"],"summary":"List Subaccounts","description":"Lista las subcuentas del usuario.\nDisponible en plan Business. Filtra por nombre con ?q=texto.\nRespuesta incluye uso y cuota agregada de cada subcuenta.","operationId":"list_subaccounts_subaccounts_get","parameters":[{"name":"q","in":"query","required":false,"schema":{"type":"string","description":"Buscar por nombre o slug","default":"","title":"Q"},"description":"Buscar por nombre o slug"},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":200,"minimum":1,"default":50,"title":"Limit"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"default":0,"title":"Offset"}},{"name":"authorization","in":"header","required":false,"schema":{"type":"string","title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["Subaccounts"],"summary":"Create Subaccount","description":"Crea una subcuenta. El slug se genera automáticamente del nombre.\nLa cuota se comparte con la cuenta maestra — cada subcuenta tiene\nsu propia API key con cuota independiente asignada por el master.","operationId":"create_subaccount_subaccounts_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"type":"string","title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SubaccountCreate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/subaccounts/summary":{"get":{"tags":["Subaccounts"],"summary":"Subaccounts Summary","description":"Resumen ejecutivo de todas las subcuentas: uso total, subcuenta\nmás activa, facturas procesadas en los últimos 30 días y alertas.","operationId":"subaccounts_summary_subaccounts_summary_get","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"type":"string","title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/subaccounts/{subaccount_id}":{"get":{"tags":["Subaccounts"],"summary":"Get Subaccount Detail","description":"Detalle de una subcuenta con sus API keys y uso agregado.","operationId":"get_subaccount_detail_subaccounts__subaccount_id__get","parameters":[{"name":"subaccount_id","in":"path","required":true,"schema":{"type":"integer","title":"Subaccount Id"}},{"name":"authorization","in":"header","required":false,"schema":{"type":"string","title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"tags":["Subaccounts"],"summary":"Update Subaccount","description":"Edita nombre o notas de una subcuenta.","operationId":"update_subaccount_subaccounts__subaccount_id__put","parameters":[{"name":"subaccount_id","in":"path","required":true,"schema":{"type":"integer","title":"Subaccount Id"}},{"name":"authorization","in":"header","required":false,"schema":{"type":"string","title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SubaccountUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["Subaccounts"],"summary":"Delete Subaccount","description":"Desactiva una subcuenta (soft delete). Sus datos se conservan.","operationId":"delete_subaccount_subaccounts__subaccount_id__delete","parameters":[{"name":"subaccount_id","in":"path","required":true,"schema":{"type":"integer","title":"Subaccount Id"}},{"name":"authorization","in":"header","required":false,"schema":{"type":"string","title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/subaccounts/{subaccount_id}/keys":{"post":{"tags":["Subaccounts"],"summary":"Create Subaccount Key","description":"Crea una API key vinculada a una subcuenta.\nLa cuota es independiente de la cuenta maestra — el ERP puede\nasignar un presupuesto diferente a cada empresa cliente.","operationId":"create_subaccount_key_subaccounts__subaccount_id__keys_post","parameters":[{"name":"subaccount_id","in":"path","required":true,"schema":{"type":"integer","title":"Subaccount Id"}},{"name":"authorization","in":"header","required":false,"schema":{"type":"string","title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SubaccountKeyCreate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/subaccounts/{subaccount_id}/history":{"get":{"tags":["Subaccounts"],"summary":"Subaccount History","description":"Historial de extracciones de una subcuenta con filtros completos.\nBuscable por texto libre (filename, emisor, número de factura, external_ref),\nestado (ok/error) y rango de fechas.","operationId":"subaccount_history_subaccounts__subaccount_id__history_get","parameters":[{"name":"subaccount_id","in":"path","required":true,"schema":{"type":"integer","title":"Subaccount Id"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":200,"minimum":1,"default":50,"title":"Limit"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"default":0,"title":"Offset"}},{"name":"q","in":"query","required":false,"schema":{"type":"string","description":"Buscar en filename, vendor_name, invoice_number, external_ref","default":"","title":"Q"},"description":"Buscar en filename, vendor_name, invoice_number, external_ref"},{"name":"status","in":"query","required":false,"schema":{"type":"string","description":"ok | error","default":"","title":"Status"},"description":"ok | error"},{"name":"date_from","in":"query","required":false,"schema":{"type":"string","description":"YYYY-MM-DD","default":"","title":"Date From"},"description":"YYYY-MM-DD"},{"name":"date_to","in":"query","required":false,"schema":{"type":"string","description":"YYYY-MM-DD","default":"","title":"Date To"},"description":"YYYY-MM-DD"},{"name":"authorization","in":"header","required":false,"schema":{"type":"string","title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/subaccounts/{subaccount_id}/metrics":{"get":{"tags":["Subaccounts"],"summary":"Subaccount Metrics","description":"Métricas de uso de una subcuenta: total procesado, confianza media,\nerrores, uso diario de los últimos 30 días y desglose por API key.","operationId":"subaccount_metrics_subaccounts__subaccount_id__metrics_get","parameters":[{"name":"subaccount_id","in":"path","required":true,"schema":{"type":"integer","title":"Subaccount Id"}},{"name":"authorization","in":"header","required":false,"schema":{"type":"string","title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/keys":{"post":{"tags":["API Keys"],"summary":"Create Key","operationId":"create_key_keys_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"type":"string","title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateKeyRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/keys/me":{"get":{"tags":["API Keys"],"summary":"Get My Key","operationId":"get_my_key_keys_me_get","parameters":[{"name":"X-API-Key","in":"header","required":true,"schema":{"type":"string","title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/keys/list":{"get":{"tags":["API Keys"],"summary":"List Keys","operationId":"list_keys_keys_list_get","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"type":"string","title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/keys/revoke":{"delete":{"tags":["API Keys"],"summary":"Revoke Key","operationId":"revoke_key_keys_revoke_delete","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"type":"string","title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RevokeKeyRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/keys/revoke-by-id":{"delete":{"tags":["API Keys"],"summary":"Revoke Key By Id","operationId":"revoke_key_by_id_keys_revoke_by_id_delete","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"type":"string","title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Body"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/health":{"get":{"tags":["Sistema"],"summary":"Health","description":"Comprueba el estado del servicio. Alias ligero de /status para load balancers.","operationId":"health_health_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/ping":{"get":{"tags":["Sistema"],"summary":"Ping","description":"Health check ultra ligero para monitores externos (UptimeRobot, etc.)","operationId":"ping_ping_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}},"head":{"tags":["Sistema"],"summary":"Ping","description":"Health check ultra ligero para monitores externos (UptimeRobot, etc.)","operationId":"ping_ping_head","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/status":{"get":{"tags":["Sistema"],"summary":"Status","description":"Estado detallado del servicio para monitorización desde ERPs.\nNo requiere autenticación. Incluye versión, uptime y estado de servicios dependientes.","operationId":"status_status_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}},"head":{"tags":["Sistema"],"summary":"Status","description":"Estado detallado del servicio para monitorización desde ERPs.\nNo requiere autenticación. Incluye versión, uptime y estado de servicios dependientes.","operationId":"status_status_head","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/quota":{"get":{"tags":["Sistema"],"summary":"Get Quota","description":"Returns the current quota status for the user. Useful for integrations.","operationId":"get_quota_quota_get","parameters":[{"name":"X-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/request-logs":{"get":{"tags":["Sistema"],"summary":"Get Request Logs","description":"Logs de peticiones API de los últimos 30 días para depurar integraciones.\nIncluye: request_id, método, path, status_code, duración, sandbox y error_code.\nÚsalo para auditar fallos sin necesidad de llamar al soporte.","operationId":"get_request_logs_request_logs_get","parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":200,"minimum":1,"description":"Records per page (1-200)","default":50,"title":"Limit"},"description":"Records per page (1-200)"},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"description":"Registros a saltar","default":0,"title":"Offset"},"description":"Registros a saltar"},{"name":"path","in":"query","required":false,"schema":{"type":"string","description":"Filtrar por path (ej: /extract)","default":"","title":"Path"},"description":"Filtrar por path (ej: /extract)"},{"name":"status","in":"query","required":false,"schema":{"type":"integer","description":"Filtrar por HTTP status (ej: 500)","default":0,"title":"Status"},"description":"Filtrar por HTTP status (ej: 500)"},{"name":"X-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/limits":{"get":{"tags":["Sistema"],"summary":"Get Limits","description":"Returns rate limits and quotas per plan. No authentication required.","operationId":"get_limits_limits_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/user/certificate":{"post":{"tags":["Certificado"],"summary":"Upload Certificate","description":"Sube y guarda el certificado .p12/.pfx del usuario para firma XAdES-BES.\nDisponible desde el plan Starter.\nEl certificado y la contraseña se almacenan cifrados con Fernet.","operationId":"upload_certificate_user_certificate_post","parameters":[{"name":"password","in":"query","required":false,"schema":{"type":"string","default":"","title":"Password"}},{"name":"X-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_upload_certificate_user_certificate_post"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["Certificado"],"summary":"Get Certificate Info","description":"Devuelve la info del certificado guardado (nunca los bytes ni la contraseña).","operationId":"get_certificate_info_user_certificate_get","parameters":[{"name":"X-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["Certificado"],"summary":"Delete Certificate","description":"Elimina el certificado guardado del usuario.","operationId":"delete_certificate_user_certificate_delete","parameters":[{"name":"X-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/user/export":{"get":{"tags":["Usuario"],"summary":"Export User Data","description":"RGPD Art. 15 y 20 — Derecho de acceso y portabilidad.\nGenera y devuelve un ZIP con todos los datos del usuario en formato JSON.\nContenido: perfil, extracciones, API keys (sin hashes), webhooks, proveedores de confianza.","operationId":"export_user_data_user_export_get","parameters":[{"name":"X-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/user/delete":{"delete":{"tags":["Usuario"],"summary":"Delete User Account","description":"Elimina permanentemente la cuenta del usuario y todos sus datos.\nLos Facturae firmados en B2 se conservan en legal_custody durante 4 años.","operationId":"delete_user_account_user_delete_delete","parameters":[{"name":"X-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/webhooks":{"get":{"tags":["Webhooks"],"summary":"List Webhooks","description":"Lista los webhooks configurados.","operationId":"list_webhooks_webhooks_get","parameters":[{"name":"X-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["Webhooks"],"summary":"Create Webhook Endpoint","description":"Crea un webhook. Solo disponible en Business.\nBody: { url, events?, secret? }","operationId":"create_webhook_endpoint_webhooks_post","parameters":[{"name":"X-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Body"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/webhooks/{webhook_id}":{"delete":{"tags":["Webhooks"],"summary":"Delete Webhook Endpoint","description":"Elimina un webhook.","operationId":"delete_webhook_endpoint_webhooks__webhook_id__delete","parameters":[{"name":"webhook_id","in":"path","required":true,"schema":{"type":"integer","title":"Webhook Id"}},{"name":"X-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/webhooks/{webhook_id}/deliveries":{"get":{"tags":["Webhooks"],"summary":"Get Webhook Deliveries","description":"Últimas 20 entregas de un webhook.","operationId":"get_webhook_deliveries_webhooks__webhook_id__deliveries_get","parameters":[{"name":"webhook_id","in":"path","required":true,"schema":{"type":"integer","title":"Webhook Id"}},{"name":"X-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/webhooks/test":{"post":{"tags":["Webhooks"],"summary":"Test Webhook","description":"Envía un evento de prueba a todos los webhooks del usuario.","operationId":"test_webhook_webhooks_test_post","parameters":[{"name":"X-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/stripe/config":{"get":{"tags":["Stripe"],"summary":"Stripe Config","description":"Devuelve la publishable key para el frontend.","operationId":"stripe_config_stripe_config_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/stripe/create-checkout":{"post":{"tags":["Stripe"],"summary":"Stripe Create Checkout","description":"Crea una sesión de Stripe Checkout.\nSuscripciones legacy: { plan: 'starter'|'pro'|'business', billing: 'monthly'|'annual' }\nPacks (pago único, créditos dashboard): { plan: 'pack_s'|'pack_m'|'pack_l' }\nVolume (API-only, suscripción mensual con precio dinámico) — DEPRECATED:\n    { plan: 'volume', invoices_per_month: 500-10000 }\nParse (suscripción mensual, tramos fijos, 14 días de prueba sin tarjeta):\n    { plan: 'parse_100'|'parse_500'|'parse_2500'|'parse_5000'|'parse_10000'|'parse_25000',\n      billing: 'monthly'|'annual' }","operationId":"stripe_create_checkout_stripe_create_checkout_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"type":"string","title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Body"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/stripe/portal":{"post":{"tags":["Stripe"],"summary":"Stripe Portal","description":"Crea una sesión del portal de Stripe para gestionar la suscripción.","operationId":"stripe_portal_stripe_portal_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"type":"string","title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/stripe/end-trial":{"post":{"tags":["Stripe"],"summary":"Stripe End Trial","description":"Termina el trial de 14 días de un plan Parse ahora mismo, en vez de\nesperar a que acabe solo. Pensado para cuando el usuario se gasta los\n500 créditos del trial antes de tiempo y quiere seguir sin esperar:\nañade tarjeta en /stripe/portal y luego llama a este endpoint.\nRequiere que ya tenga un método de pago guardado en Stripe.","operationId":"stripe_end_trial_stripe_end_trial_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"type":"string","title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/categorize":{"post":{"tags":["Contabilidad"],"summary":"Categorize Invoice","description":"Categoriza una factura según el PGC español.","operationId":"categorize_invoice_categorize_post","parameters":[{"name":"X-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Body"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/invoices/{log_id}/update-fields":{"post":{"tags":["Facturas"],"summary":"Update Invoice Fields","description":"Actualiza campos editables de una factura ya extraída (result_json).\nSolo se permiten los campos básicos: vendor_name, vendor_vat,\ninvoice_number, invoice_date, due_date, iban.","operationId":"update_invoice_fields_invoices__log_id__update_fields_post","parameters":[{"name":"log_id","in":"path","required":true,"schema":{"type":"integer","title":"Log Id"}},{"name":"X-API-Key","in":"header","required":true,"schema":{"type":"string","title":"X-Api-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Body"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/invoices/{log_id}/confirm-accounting":{"post":{"tags":["Contabilidad"],"summary":"Confirm Accounting","description":"Confirma o corrige la categoría contable de una extracción.\nEl sistema aprende y usará esta categoría para el mismo proveedor en el futuro.","operationId":"confirm_accounting_invoices__log_id__confirm_accounting_post","parameters":[{"name":"log_id","in":"path","required":true,"schema":{"type":"integer","title":"Log Id"}},{"name":"X-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Body"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/accounting/vendors":{"get":{"tags":["Contabilidad"],"summary":"List Learned Vendors","description":"Lista los proveedores con categoría contable aprendida.","operationId":"list_learned_vendors_accounting_vendors_get","parameters":[{"name":"X-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/certificates":{"post":{"tags":["Certificados"],"summary":"Create Managed Certificate","description":"Sube un certificado .p12 de un cliente y devuelve un certificate_id.\nEl ERP almacena ese ID y lo pasa en futuras peticiones de firma\nen lugar de reenviar el .p12 en cada llamada.\nSolo disponible en planes Pro y Business.","operationId":"create_managed_certificate_certificates_post","parameters":[{"name":"X-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_create_managed_certificate_certificates_post"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["Certificados"],"summary":"List Managed Certificates","description":"Lista los certificados gestionados de la cuenta.","operationId":"list_managed_certificates_certificates_get","parameters":[{"name":"X-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/certificates/{certificate_id}":{"delete":{"tags":["Certificados"],"summary":"Delete Managed Certificate","description":"Elimina un certificado gestionado.","operationId":"delete_managed_certificate_certificates__certificate_id__delete","parameters":[{"name":"certificate_id","in":"path","required":true,"schema":{"type":"string","title":"Certificate Id"}},{"name":"X-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/convert-to-facturae":{"post":{"tags":["Facturae"],"summary":"Convert To Facturae","description":"Convierte un JSON de factura extraído al formato Facturae 3.2.2.\nFirma con XAdES-BES si:\n  - El usuario tiene un certificado guardado en BD, O\n  - Se provee p12_b64 directamente en el body.\nAñade X-Sandbox: true para recibir un XML ficticio sin consumir cuota.","operationId":"convert_to_facturae_convert_to_facturae_post","parameters":[{"name":"X-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FacturaeRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/convert-to-facturae/download":{"post":{"tags":["Facturae"],"summary":"Download Facturae","description":"Genera el Facturae XML, lo firma si hay certificado,\nlo guarda en BD y B2, registra en legal_custody, y lo devuelve para descarga.","operationId":"download_facturae_convert_to_facturae_download_post","parameters":[{"name":"X-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FacturaeRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/convert":{"post":{"tags":["API"],"summary":"Convert Unified","description":"Endpoint unificado para integraciones externas.\n\n**Modo PDF→XML** (multipart/form-data):\n- `file`: archivo PDF, JPG o PNG — extrae con IA y genera Facturae firmado. Consume 1 crédito.\n\n**Modo JSON→XML** (application/json):\n- Body JSON con los campos ya estructurados — genera XML sin OCR. Consume 1 crédito.\n\n**Modo log_id→XML** — SIN coste adicional:\n- `{ \"from_log_id\": 123 }` — reutiliza una extracción previa de `/extract` ya pagada.\n- Genera el XML firmado sin consumir ningún crédito extra.\n- Ideal para el flujo de dos pasos: `/extract` → `/convert` con el log_id devuelto.\n\n**Respuesta unificada**:\n```json\n{\n  \"xml\": \"<?xml ...\",\n  \"xml_base64\": \"...\",\n  \"signed\": true,\n  \"source\": \"pdf | json | log_id\",\n  \"invoice\": { \"vendor_name\": \"...\", \"vendor_vat\": \"...\", \"total\": 121.0, ... },\n  \"warnings\": [],\n  \"confidence\": 0.97,\n  \"filename\": \"facturae_F2024-001.xml\"\n}\n```","operationId":"convert_unified_convert_post","parameters":[{"name":"json_body","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Json Body"}},{"name":"X-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_convert_unified_convert_post"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/invoices/{log_id}/facturae":{"post":{"tags":["Facturae"],"summary":"Facturae From History","description":"Recupera el Facturae XML: B2 -> copia local BD -> generar y firmar.","operationId":"facturae_from_history_invoices__log_id__facturae_post","parameters":[{"name":"log_id","in":"path","required":true,"schema":{"type":"integer","title":"Log Id"}},{"name":"X-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"default":{},"title":"Body"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/sign":{"post":{"tags":["API"],"summary":"Sign Xml Endpoint","description":"Firma un XML Facturae 3.2.x ya generado con XAdES-BES.\n\nPensado para ERPs que ya generan su propio XML (STEL Order, Selenne, NCS…)\npero no tienen firma XAdES integrada. Recibe el XML sin firmar y devuelve\nel .xml firmado con XAdES-BES incrustado, listo para subir a FACe.\n\n**Modos de envío:**\n- `multipart/form-data` con campo `file` (fichero .xml)\n- `application/xml` o `text/xml` con el XML en el body directamente\n\n**Certificado (por prioridad):**\n1. `X-Certificate-ID` en header — certificado gestionado (ideal para ERPs multi-cliente)\n2. `X-P12-B64` + `X-P12-Password` en headers — certificado puntual en Base64\n3. Certificado guardado en el perfil del usuario\n**Coste:** 1 crédito por llamada (igual que /convert).","operationId":"sign_xml_endpoint_sign_post","parameters":[{"name":"X-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_sign_xml_endpoint_sign_post"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/vendors":{"get":{"tags":["Fraude"],"summary":"List Vendors","operationId":"list_vendors_vendors_get","parameters":[{"name":"X-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/vendors/{vendor_vat}/iban":{"put":{"tags":["Fraude"],"summary":"Update Vendor Iban","operationId":"update_vendor_iban_vendors__vendor_vat__iban_put","parameters":[{"name":"vendor_vat","in":"path","required":true,"schema":{"type":"string","title":"Vendor Vat"}},{"name":"X-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Body"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/invoices/{log_id}/confirm-duplicate":{"post":{"tags":["Fraude"],"summary":"Confirm Dup","description":"Confirma que esta extracción es un duplicado real. La marca para bloqueo contable.","operationId":"confirm_dup_invoices__log_id__confirm_duplicate_post","parameters":[{"name":"log_id","in":"path","required":true,"schema":{"type":"integer","title":"Log Id"}},{"name":"X-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/invoices/{log_id}/dismiss-duplicate":{"post":{"tags":["Fraude"],"summary":"Dismiss Dup","description":"Descarta el aviso de duplicado (falso positivo).","operationId":"dismiss_dup_invoices__log_id__dismiss_duplicate_post","parameters":[{"name":"log_id","in":"path","required":true,"schema":{"type":"integer","title":"Log Id"}},{"name":"X-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/keys/{key_id}/auto-recharge":{"post":{"tags":["API Keys"],"summary":"Set Auto Recharge","description":"Activa o desactiva la recarga automática para una API key.\nCuando el saldo baje de 10€ equivalente, Stripe recargará\nautomáticamente el importe configurado (mínimo 10€).","operationId":"set_auto_recharge_keys__key_id__auto_recharge_post","parameters":[{"name":"key_id","in":"path","required":true,"schema":{"type":"integer","title":"Key Id"}},{"name":"authorization","in":"header","required":false,"schema":{"type":"string","title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AutoRechargeRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/extract":{"post":{"tags":["v1"],"summary":"V1 Extract","description":"v1 — alias de POST /extract","operationId":"v1_extract_v1_extract_post","parameters":[{"name":"X-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_v1_extract_v1_extract_post"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/convert":{"post":{"tags":["v1"],"summary":"V1 Convert","description":"v1 — alias de POST /convert","operationId":"v1_convert_v1_convert_post","parameters":[{"name":"X-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_v1_convert_v1_convert_post"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/convert-to-facturae":{"post":{"tags":["v1"],"summary":"V1 Convert To Facturae","description":"v1 — alias de POST /convert-to-facturae","operationId":"v1_convert_to_facturae_v1_convert_to_facturae_post","parameters":[{"name":"X-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FacturaeRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/convert-to-facturae/download":{"post":{"tags":["v1"],"summary":"V1 Download Facturae","description":"v1 — alias de POST /convert-to-facturae/download","operationId":"v1_download_facturae_v1_convert_to_facturae_download_post","parameters":[{"name":"X-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FacturaeRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/history":{"get":{"tags":["v1"],"summary":"V1 History","description":"v1 — alias de GET /history","operationId":"v1_history_v1_history_get","parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":200,"minimum":1,"default":50,"title":"Limit"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"default":0,"title":"Offset"}},{"name":"subaccount_id","in":"query","required":false,"schema":{"type":"integer","default":0,"title":"Subaccount Id"}},{"name":"q","in":"query","required":false,"schema":{"type":"string","default":"","title":"Q"}},{"name":"status","in":"query","required":false,"schema":{"type":"string","default":"","title":"Status"}},{"name":"date_from","in":"query","required":false,"schema":{"type":"string","default":"","title":"Date From"}},{"name":"date_to","in":"query","required":false,"schema":{"type":"string","default":"","title":"Date To"}},{"name":"X-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/request-logs":{"get":{"tags":["v1"],"summary":"V1 Request Logs","description":"v1 — alias de GET /request-logs","operationId":"v1_request_logs_v1_request_logs_get","parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":200,"minimum":1,"default":50,"title":"Limit"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"default":0,"title":"Offset"}},{"name":"path","in":"query","required":false,"schema":{"type":"string","default":"","title":"Path"}},{"name":"status","in":"query","required":false,"schema":{"type":"integer","default":0,"title":"Status"}},{"name":"X-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/quota":{"get":{"tags":["v1"],"summary":"V1 Quota","description":"v1 — alias de GET /quota","operationId":"v1_quota_v1_quota_get","parameters":[{"name":"X-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/metrics":{"get":{"tags":["v1"],"summary":"V1 Metrics","description":"v1 — alias de GET /metrics","operationId":"v1_metrics_v1_metrics_get","parameters":[{"name":"X-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/status":{"get":{"tags":["v1"],"summary":"V1 Status","description":"v1 — alias de GET /status","operationId":"v1_status_v1_status_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}},"head":{"tags":["v1"],"summary":"V1 Status","description":"v1 — alias de GET /status","operationId":"v1_status_v1_status_head","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/v1/invoices/{log_id}/facturae":{"post":{"tags":["v1"],"summary":"V1 Facturae From History","description":"v1 — alias de POST /invoices/{log_id}/facturae","operationId":"v1_facturae_from_history_v1_invoices__log_id__facturae_post","parameters":[{"name":"log_id","in":"path","required":true,"schema":{"type":"integer","title":"Log Id"}},{"name":"X-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"default":{},"title":"Body"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/invoices/{log_id}/update-fields":{"post":{"tags":["v1"],"summary":"V1 Update Fields","description":"v1 — alias de POST /invoices/{log_id}/update-fields","operationId":"v1_update_fields_v1_invoices__log_id__update_fields_post","parameters":[{"name":"log_id","in":"path","required":true,"schema":{"type":"integer","title":"Log Id"}},{"name":"X-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Fields"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}}},"components":{"schemas":{"AutoImportPreference":{"properties":{"enabled":{"type":"boolean","title":"Enabled"}},"type":"object","required":["enabled"],"title":"AutoImportPreference"},"AutoRechargeRequest":{"properties":{"enabled":{"type":"boolean","title":"Enabled"},"amount_eur":{"type":"number","title":"Amount Eur","default":20.0}},"type":"object","required":["enabled"],"title":"AutoRechargeRequest"},"BankMatchRequest":{"properties":{"movements":{"items":{"$ref":"#/components/schemas/BankMovement"},"type":"array","title":"Movements"}},"type":"object","required":["movements"],"title":"BankMatchRequest"},"BankMovement":{"properties":{"date":{"type":"string","title":"Date"},"concept":{"type":"string","title":"Concept"},"amount":{"type":"number","title":"Amount"}},"type":"object","required":["date","concept","amount"],"title":"BankMovement"},"Body_convert_unified_convert_post":{"properties":{"file":{"anyOf":[{"type":"string","contentMediaType":"application/octet-stream"},{"type":"null"}],"title":"File"}},"type":"object","title":"Body_convert_unified_convert_post"},"Body_create_batch_job_batch_job_post":{"properties":{"files":{"items":{"type":"string","contentMediaType":"application/octet-stream"},"type":"array","title":"Files"}},"type":"object","required":["files"],"title":"Body_create_batch_job_batch_job_post"},"Body_create_managed_certificate_certificates_post":{"properties":{"file":{"type":"string","contentMediaType":"application/octet-stream","title":"File"},"name":{"type":"string","title":"Name"},"password":{"type":"string","title":"Password","default":""}},"type":"object","required":["file","name"],"title":"Body_create_managed_certificate_certificates_post"},"Body_extract_batch_extract_batch_post":{"properties":{"files":{"items":{"type":"string","contentMediaType":"application/octet-stream"},"type":"array","title":"Files"}},"type":"object","required":["files"],"title":"Body_extract_batch_extract_batch_post"},"Body_extract_invoice_extract_post":{"properties":{"file":{"type":"string","contentMediaType":"application/octet-stream","title":"File"}},"type":"object","required":["file"],"title":"Body_extract_invoice_extract_post"},"Body_sign_xml_endpoint_sign_post":{"properties":{"file":{"type":"string","contentMediaType":"application/octet-stream","title":"File"}},"type":"object","title":"Body_sign_xml_endpoint_sign_post"},"Body_upload_attachment_contabilidad_entries__entry_id__attachment_post":{"properties":{"file":{"type":"string","contentMediaType":"application/octet-stream","title":"File"}},"type":"object","required":["file"],"title":"Body_upload_attachment_contabilidad_entries__entry_id__attachment_post"},"Body_upload_certificate_user_certificate_post":{"properties":{"file":{"type":"string","contentMediaType":"application/octet-stream","title":"File"}},"type":"object","required":["file"],"title":"Body_upload_certificate_user_certificate_post"},"Body_v1_convert_v1_convert_post":{"properties":{"file":{"anyOf":[{"type":"string","contentMediaType":"application/octet-stream"},{"type":"null"}],"title":"File"}},"type":"object","title":"Body_v1_convert_v1_convert_post"},"Body_v1_extract_v1_extract_post":{"properties":{"file":{"type":"string","contentMediaType":"application/octet-stream","title":"File"}},"type":"object","required":["file"],"title":"Body_v1_extract_v1_extract_post"},"BudgetUpdate":{"properties":{"income_target":{"type":"number","title":"Income Target"},"expense_limit":{"type":"number","title":"Expense Limit"},"quarter":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Quarter"}},"type":"object","required":["income_target","expense_limit"],"title":"BudgetUpdate"},"CreateKeyRequest":{"properties":{"name":{"type":"string","title":"Name"},"plan":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Plan","default":"free"}},"type":"object","required":["name"],"title":"CreateKeyRequest"},"EntryCreate":{"properties":{"type":{"type":"string","title":"Type"},"vendor":{"type":"string","title":"Vendor"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description","default":""},"category":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Category","default":"629 · Otros servicios"},"date":{"type":"string","title":"Date"},"due_date":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Due Date"},"amount":{"type":"number","title":"Amount"},"iva":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Iva","default":0},"irpf":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Irpf","default":0},"paid":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Paid","default":false},"invoice_num":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Invoice Num"},"recurring":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Recurring","default":false},"source":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Source","default":"manual"},"client_email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Client Email"},"remind_client":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Remind Client","default":false}},"type":"object","required":["type","vendor","date","amount"],"title":"EntryCreate"},"EntryPatch":{"properties":{"paid":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Paid"},"cob_state":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Cob State"},"vendor":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Vendor"},"amount":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Amount"},"date":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Date"},"category":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Category"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"notes":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Notes"},"client_email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Client Email"},"remind_client":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Remind Client"}},"type":"object","title":"EntryPatch"},"FacturaeRequest":{"properties":{"invoice_data":{"additionalProperties":true,"type":"object","title":"Invoice Data"},"seller_info":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Seller Info"},"buyer_info":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Buyer Info"},"sign":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Sign","default":false},"p12_b64":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"P12 B64"},"p12_password":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"P12 Password"},"external_ref":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"External Ref"},"certificate_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Certificate Id"}},"type":"object","required":["invoice_data"],"title":"FacturaeRequest"},"FiscalProfileUpdate":{"properties":{"regimen":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Regimen"},"anos_alta":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Anos Alta"},"hijos":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Hijos"},"otros_ingresos":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Otros Ingresos"},"pension_anual":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Pension Anual"},"comunidad":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Comunidad"},"exento_130":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Exento 130"},"retencion_pct":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Retencion Pct"},"iva_criterio":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Iva Criterio"},"completed":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Completed"}},"type":"object","title":"FiscalProfileUpdate"},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"LoginRequest":{"properties":{"email":{"type":"string","title":"Email"},"password":{"type":"string","title":"Password"}},"type":"object","required":["email","password"],"title":"LoginRequest"},"ProposalCreate":{"properties":{"client_name":{"type":"string","title":"Client Name"},"client_nif":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Client Nif"},"concept":{"type":"string","title":"Concept"},"amount":{"type":"number","title":"Amount"},"iva_rate":{"type":"number","title":"Iva Rate","default":21},"irpf_rate":{"type":"number","title":"Irpf Rate","default":0},"valid_until":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Valid Until"},"notes":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Notes"}},"type":"object","required":["client_name","concept","amount"],"title":"ProposalCreate"},"ProposalPatch":{"properties":{"status":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Status"},"client_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Client Name"},"client_nif":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Client Nif"},"concept":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Concept"},"amount":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Amount"},"iva_rate":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Iva Rate"},"irpf_rate":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Irpf Rate"},"valid_until":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Valid Until"},"notes":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Notes"}},"type":"object","title":"ProposalPatch"},"RecurringCreate":{"properties":{"name":{"type":"string","title":"Name"},"amount":{"type":"number","title":"Amount"},"iva_rate":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Iva Rate","default":0},"day_of_month":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Day Of Month","default":1},"category":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Category","default":"629 · Otros servicios"}},"type":"object","required":["name","amount"],"title":"RecurringCreate"},"RecurringInvoiceCreate":{"properties":{"client_name":{"type":"string","title":"Client Name"},"client_nif":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Client Nif"},"client_email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Client Email"},"concept":{"type":"string","title":"Concept"},"amount":{"type":"number","title":"Amount"},"iva_rate":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Iva Rate","default":21},"irpf_rate":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Irpf Rate","default":0},"day_of_month":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Day Of Month","default":1},"auto_send_email":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Auto Send Email","default":false},"remind_client":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Remind Client","default":false}},"type":"object","required":["client_name","concept","amount"],"title":"RecurringInvoiceCreate"},"RegisterRequest":{"properties":{"email":{"type":"string","title":"Email"},"password":{"type":"string","title":"Password"},"full_name":{"type":"string","title":"Full Name"},"ref_source":{"type":"string","title":"Ref Source","default":"organic"},"lang":{"type":"string","title":"Lang","default":"es"}},"type":"object","required":["email","password","full_name"],"title":"RegisterRequest"},"ResetPasswordBody":{"properties":{"token":{"type":"string","title":"Token"},"new_password":{"type":"string","title":"New Password"}},"type":"object","required":["token","new_password"],"title":"ResetPasswordBody"},"ResetRequestBody":{"properties":{"email":{"type":"string","title":"Email"}},"type":"object","required":["email"],"title":"ResetRequestBody"},"RevokeKeyRequest":{"properties":{"api_key":{"type":"string","title":"Api Key"}},"type":"object","required":["api_key"],"title":"RevokeKeyRequest"},"SubaccountCreate":{"properties":{"name":{"type":"string","title":"Name"},"notes":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Notes"}},"type":"object","required":["name"],"title":"SubaccountCreate"},"SubaccountKeyCreate":{"properties":{"name":{"type":"string","title":"Name"},"quota":{"type":"integer","title":"Quota","default":150}},"type":"object","required":["name"],"title":"SubaccountKeyCreate"},"SubaccountUpdate":{"properties":{"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name"},"notes":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Notes"}},"type":"object","title":"SubaccountUpdate"},"TaxPaymentUpsert":{"properties":{"year":{"type":"integer","title":"Year"},"quarter":{"type":"integer","title":"Quarter"},"model":{"type":"string","title":"Model"},"amount":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Amount"},"paid":{"type":"boolean","title":"Paid","default":false},"paid_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Paid At"}},"type":"object","required":["year","quarter","model"],"title":"TaxPaymentUpsert"},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"},"input":{"title":"Input"},"ctx":{"type":"object","title":"Context"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"}}}}