@beel_es/sdk 1.0.0 → 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (106) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +167 -76
  3. package/dist/index.d.mts +9744 -0
  4. package/dist/index.d.ts +9736 -18
  5. package/dist/index.js +801 -50
  6. package/dist/index.js.map +1 -1
  7. package/dist/index.mjs +756 -0
  8. package/dist/index.mjs.map +1 -0
  9. package/package.json +48 -19
  10. package/dist/client.d.ts +0 -54
  11. package/dist/client.d.ts.map +0 -1
  12. package/dist/client.js +0 -94
  13. package/dist/client.js.map +0 -1
  14. package/dist/generated/client/client.gen.d.ts +0 -3
  15. package/dist/generated/client/client.gen.d.ts.map +0 -1
  16. package/dist/generated/client/client.gen.js +0 -240
  17. package/dist/generated/client/client.gen.js.map +0 -1
  18. package/dist/generated/client/index.d.ts +0 -9
  19. package/dist/generated/client/index.d.ts.map +0 -1
  20. package/dist/generated/client/index.js +0 -18
  21. package/dist/generated/client/index.js.map +0 -1
  22. package/dist/generated/client/types.gen.d.ts +0 -118
  23. package/dist/generated/client/types.gen.d.ts.map +0 -1
  24. package/dist/generated/client/types.gen.js +0 -4
  25. package/dist/generated/client/types.gen.js.map +0 -1
  26. package/dist/generated/client/utils.gen.d.ts +0 -34
  27. package/dist/generated/client/utils.gen.d.ts.map +0 -1
  28. package/dist/generated/client/utils.gen.js +0 -242
  29. package/dist/generated/client/utils.gen.js.map +0 -1
  30. package/dist/generated/client.gen.d.ts +0 -13
  31. package/dist/generated/client.gen.d.ts.map +0 -1
  32. package/dist/generated/client.gen.js +0 -7
  33. package/dist/generated/client.gen.js.map +0 -1
  34. package/dist/generated/core/auth.gen.d.ts +0 -19
  35. package/dist/generated/core/auth.gen.d.ts.map +0 -1
  36. package/dist/generated/core/auth.gen.js +0 -19
  37. package/dist/generated/core/auth.gen.js.map +0 -1
  38. package/dist/generated/core/bodySerializer.gen.d.ts +0 -26
  39. package/dist/generated/core/bodySerializer.gen.d.ts.map +0 -1
  40. package/dist/generated/core/bodySerializer.gen.js +0 -61
  41. package/dist/generated/core/bodySerializer.gen.js.map +0 -1
  42. package/dist/generated/core/params.gen.d.ts +0 -44
  43. package/dist/generated/core/params.gen.d.ts.map +0 -1
  44. package/dist/generated/core/params.gen.js +0 -105
  45. package/dist/generated/core/params.gen.js.map +0 -1
  46. package/dist/generated/core/pathSerializer.gen.d.ts +0 -34
  47. package/dist/generated/core/pathSerializer.gen.d.ts.map +0 -1
  48. package/dist/generated/core/pathSerializer.gen.js +0 -116
  49. package/dist/generated/core/pathSerializer.gen.js.map +0 -1
  50. package/dist/generated/core/queryKeySerializer.gen.d.ts +0 -19
  51. package/dist/generated/core/queryKeySerializer.gen.d.ts.map +0 -1
  52. package/dist/generated/core/queryKeySerializer.gen.js +0 -99
  53. package/dist/generated/core/queryKeySerializer.gen.js.map +0 -1
  54. package/dist/generated/core/serverSentEvents.gen.d.ts +0 -72
  55. package/dist/generated/core/serverSentEvents.gen.d.ts.map +0 -1
  56. package/dist/generated/core/serverSentEvents.gen.js +0 -138
  57. package/dist/generated/core/serverSentEvents.gen.js.map +0 -1
  58. package/dist/generated/core/types.gen.d.ts +0 -79
  59. package/dist/generated/core/types.gen.d.ts.map +0 -1
  60. package/dist/generated/core/types.gen.js +0 -4
  61. package/dist/generated/core/types.gen.js.map +0 -1
  62. package/dist/generated/core/utils.gen.d.ts +0 -20
  63. package/dist/generated/core/utils.gen.d.ts.map +0 -1
  64. package/dist/generated/core/utils.gen.js +0 -94
  65. package/dist/generated/core/utils.gen.js.map +0 -1
  66. package/dist/generated/index.d.ts +0 -3
  67. package/dist/generated/index.d.ts.map +0 -1
  68. package/dist/generated/index.js +0 -84
  69. package/dist/generated/index.js.map +0 -1
  70. package/dist/generated/sdk.gen.d.ts +0 -966
  71. package/dist/generated/sdk.gen.d.ts.map +0 -1
  72. package/dist/generated/sdk.gen.js +0 -1490
  73. package/dist/generated/sdk.gen.js.map +0 -1
  74. package/dist/generated/types.gen.d.ts +0 -5646
  75. package/dist/generated/types.gen.d.ts.map +0 -1
  76. package/dist/generated/types.gen.js +0 -4
  77. package/dist/generated/types.gen.js.map +0 -1
  78. package/dist/index.d.ts.map +0 -1
  79. package/dist/resources/companies.d.ts +0 -75
  80. package/dist/resources/companies.d.ts.map +0 -1
  81. package/dist/resources/companies.js +0 -77
  82. package/dist/resources/companies.js.map +0 -1
  83. package/dist/resources/config.d.ts +0 -106
  84. package/dist/resources/config.d.ts.map +0 -1
  85. package/dist/resources/config.js +0 -86
  86. package/dist/resources/config.js.map +0 -1
  87. package/dist/resources/customers.d.ts +0 -172
  88. package/dist/resources/customers.d.ts.map +0 -1
  89. package/dist/resources/customers.js +0 -96
  90. package/dist/resources/customers.js.map +0 -1
  91. package/dist/resources/invoices.d.ts +0 -370
  92. package/dist/resources/invoices.d.ts.map +0 -1
  93. package/dist/resources/invoices.js +0 -174
  94. package/dist/resources/invoices.js.map +0 -1
  95. package/dist/resources/products.d.ts +0 -155
  96. package/dist/resources/products.d.ts.map +0 -1
  97. package/dist/resources/products.js +0 -96
  98. package/dist/resources/products.js.map +0 -1
  99. package/dist/resources/series.d.ts +0 -98
  100. package/dist/resources/series.d.ts.map +0 -1
  101. package/dist/resources/series.js +0 -83
  102. package/dist/resources/series.js.map +0 -1
  103. package/dist/webhooks/index.d.ts +0 -20
  104. package/dist/webhooks/index.d.ts.map +0 -1
  105. package/dist/webhooks/index.js +0 -70
  106. package/dist/webhooks/index.js.map +0 -1
@@ -1,966 +0,0 @@
1
- import { type Client, type Options as Options2, type TDataShape } from './client';
2
- import type { CancelRepresentationData, CancelRepresentationErrors, CancelRepresentationResponses, ChangeInvoicesStatusBulkData, ChangeInvoicesStatusBulkErrors, ChangeInvoicesStatusBulkResponses, CreateCompanyApiKeyData, CreateCompanyApiKeyErrors, CreateCompanyApiKeyResponses, CreateCompanyData, CreateCompanyErrors, CreateCompanyResponses, CreateCorrectiveInvoiceData, CreateCorrectiveInvoiceErrors, CreateCorrectiveInvoiceResponses, CreateCustomerData, CreateCustomerErrors, CreateCustomerResponses, CreateCustomersBulkData, CreateCustomersBulkErrors, CreateCustomersBulkResponses, CreateInvoiceData, CreateInvoiceErrors, CreateInvoiceResponses, CreateInvoicesBulkData, CreateInvoicesBulkErrors, CreateInvoicesBulkResponses, CreateProductData, CreateProductErrors, CreateProductResponses, CreateProductsBulkData, CreateProductsBulkErrors, CreateProductsBulkResponses, CreateSeriesData, CreateSeriesErrors, CreateSeriesResponses, CreateWebhookSubscriptionData, CreateWebhookSubscriptionErrors, CreateWebhookSubscriptionResponses, DeactivateCustomerData, DeactivateCustomerErrors, DeactivateCustomerResponses, DeactivateCustomersBulkData, DeactivateCustomersBulkErrors, DeactivateCustomersBulkResponses, DeleteCompanyData, DeleteCompanyErrors, DeleteCompanyResponses, DeleteInvoiceData, DeleteInvoiceErrors, DeleteInvoiceResponses, DeleteProductData, DeleteProductErrors, DeleteProductResponses, DeleteProductsBulkData, DeleteProductsBulkErrors, DeleteProductsBulkResponses, DeleteSeriesData, DeleteSeriesErrors, DeleteSeriesResponses, DeleteWebhookSubscriptionData, DeleteWebhookSubscriptionErrors, DeleteWebhookSubscriptionResponses, DownloadCustomerTemplateCsvData, DownloadCustomerTemplateCsvErrors, DownloadCustomerTemplateCsvResponses, DownloadInvoicesPdfBulkData, DownloadInvoicesPdfBulkErrors, DownloadInvoicesPdfBulkResponses, DownloadRepresentationData, DownloadRepresentationErrors, DownloadRepresentationResponses, DuplicateInvoiceData, DuplicateInvoiceErrors, DuplicateInvoiceResponses, ExportInvoicesExcelData, ExportInvoicesExcelErrors, ExportInvoicesExcelResponses, GenerateInvoicePdfData, GenerateInvoicePdfErrors, GenerateInvoicePdfResponses, GenerateRepresentationData, GenerateRepresentationErrors, GenerateRepresentationResponses, GetCompanyData, GetCompanyErrors, GetCompanyResponses, GetCustomerData, GetCustomerErrors, GetCustomerResponses, GetInvoiceCustomizationOptionsData, GetInvoiceCustomizationOptionsErrors, GetInvoiceCustomizationOptionsResponses, GetInvoiceData, GetInvoiceErrors, GetInvoiceResponses, GetProductData, GetProductErrors, GetProductResponses, GetPublicMetricsData, GetPublicMetricsErrors, GetPublicMetricsResponses, GetRepresentationStatusData, GetRepresentationStatusErrors, GetRepresentationStatusResponses, GetSeriesData, GetSeriesErrors, GetSeriesResponses, GetTaxConfigurationData, GetTaxConfigurationErrors, GetTaxConfigurationResponses, GetTaxTypesData, GetTaxTypesErrors, GetTaxTypesResponses, GetVeriFactuConfigurationData, GetVeriFactuConfigurationErrors, GetVeriFactuConfigurationResponses, ImportCustomersCsvPreviewData, ImportCustomersCsvPreviewErrors, ImportCustomersCsvPreviewResponses, ImportHoldedContactsData, ImportHoldedContactsErrors, ImportHoldedContactsResponses, IssueInvoiceData, IssueInvoiceErrors, IssueInvoiceResponses, ListCompaniesData, ListCompaniesErrors, ListCompaniesResponses, ListCompanyApiKeysData, ListCompanyApiKeysErrors, ListCompanyApiKeysResponses, ListCustomersData, ListCustomersErrors, ListCustomersResponses, ListInvoicesData, ListInvoicesErrors, ListInvoicesResponses, ListProductsData, ListProductsErrors, ListProductsResponses, ListSeriesData, ListSeriesErrors, ListSeriesResponses, ListWebhookDeliveriesData, ListWebhookDeliveriesErrors, ListWebhookDeliveriesResponses, ListWebhookSubscriptionsData, ListWebhookSubscriptionsErrors, ListWebhookSubscriptionsResponses, MarkInvoicePaidData, MarkInvoicePaidErrors, MarkInvoicePaidResponses, MarkInvoiceSentData, MarkInvoiceSentErrors, MarkInvoiceSentResponses, PreviewDraftInvoicePdfData, PreviewDraftInvoicePdfErrors, PreviewDraftInvoicePdfResponses, RescheduleInvoiceData, RescheduleInvoiceErrors, RescheduleInvoiceResponses, RetryWebhookDeliveryData, RetryWebhookDeliveryErrors, RetryWebhookDeliveryResponses, RevertInvoiceToIssuedData, RevertInvoiceToIssuedErrors, RevertInvoiceToIssuedResponses, RevokeCompanyApiKeyData, RevokeCompanyApiKeyErrors, RevokeCompanyApiKeyResponses, RotateWebhookSecretData, RotateWebhookSecretErrors, RotateWebhookSecretResponses, ScheduleInvoiceData, ScheduleInvoiceErrors, ScheduleInvoiceResponses, SearchProductsData, SearchProductsErrors, SearchProductsResponses, SendInvoiceEmailData, SendInvoiceEmailErrors, SendInvoiceEmailResponses, SendInvoicesBulkEmailData, SendInvoicesBulkEmailErrors, SendInvoicesBulkEmailResponses, SetDefaultSeriesData, SetDefaultSeriesErrors, SetDefaultSeriesResponses, SubmitInvoiceVeriFactuData, SubmitInvoiceVeriFactuErrors, SubmitInvoiceVeriFactuResponses, SubmitRepresentationData, SubmitRepresentationErrors, SubmitRepresentationResponses, UnscheduleInvoiceData, UnscheduleInvoiceErrors, UnscheduleInvoiceResponses, UpdateCompanyData, UpdateCompanyErrors, UpdateCompanyResponses, UpdateCustomerData, UpdateCustomerErrors, UpdateCustomerResponses, UpdateInvoiceData, UpdateInvoiceErrors, UpdateInvoiceResponses, UpdateLanguageData, UpdateLanguageErrors, UpdateLanguageResponses, UpdateProductData, UpdateProductErrors, UpdateProductResponses, UpdateSeriesData, UpdateSeriesErrors, UpdateSeriesResponses, UpdateTaxConfigurationData, UpdateTaxConfigurationErrors, UpdateTaxConfigurationResponses, UpdateVeriFactuConfigurationData, UpdateVeriFactuConfigurationErrors, UpdateVeriFactuConfigurationResponses, UpdateWebhookSubscriptionData, UpdateWebhookSubscriptionErrors, UpdateWebhookSubscriptionResponses, ValidateNifData, ValidateNifErrors, ValidateNifResponses, VoidInvoiceData, VoidInvoiceErrors, VoidInvoiceResponses } from './types.gen';
3
- export type Options<TData extends TDataShape = TDataShape, ThrowOnError extends boolean = boolean> = Options2<TData, ThrowOnError> & {
4
- /**
5
- * You can provide a client instance returned by `createClient()` instead of
6
- * individual options. This might be also useful if you want to implement a
7
- * custom client.
8
- */
9
- client?: Client;
10
- /**
11
- * You can pass arbitrary values through the `meta` object. This can be
12
- * used to access values that aren't defined as part of the SDK function.
13
- */
14
- meta?: Record<string, unknown>;
15
- };
16
- /**
17
- * List invoices
18
- *
19
- * Returns a paginated list of invoices with optional filters
20
- */
21
- export declare const listInvoices: <ThrowOnError extends boolean = false>(options?: Options<ListInvoicesData, ThrowOnError>) => import("./client").RequestResult<ListInvoicesResponses, ListInvoicesErrors, ThrowOnError, "fields">;
22
- /**
23
- * Create invoice
24
- *
25
- * Creates a new invoice.
26
- *
27
- * **Idempotency:** Supports `Idempotency-Key` header to prevent duplicates.
28
- *
29
- */
30
- export declare const createInvoice: <ThrowOnError extends boolean = false>(options: Options<CreateInvoiceData, ThrowOnError>) => import("./client").RequestResult<CreateInvoiceResponses, CreateInvoiceErrors, ThrowOnError, "fields">;
31
- /**
32
- * Delete invoice
33
- *
34
- * Deletes (marks as deleted) an invoice.
35
- *
36
- * **Soft delete:** The invoice is not physically deleted, only marked as deleted.
37
- *
38
- * **Restriction:** Only invoices in `DRAFT` status can be deleted.
39
- *
40
- */
41
- export declare const deleteInvoice: <ThrowOnError extends boolean = false>(options: Options<DeleteInvoiceData, ThrowOnError>) => import("./client").RequestResult<DeleteInvoiceResponses, DeleteInvoiceErrors, ThrowOnError, "fields">;
42
- /**
43
- * Get invoice by ID
44
- *
45
- * Retrieves complete details of a specific invoice
46
- */
47
- export declare const getInvoice: <ThrowOnError extends boolean = false>(options: Options<GetInvoiceData, ThrowOnError>) => import("./client").RequestResult<GetInvoiceResponses, GetInvoiceErrors, ThrowOnError, "fields">;
48
- /**
49
- * Update invoice
50
- *
51
- * Updates an existing draft invoice.
52
- *
53
- * **Restriction:** Only invoices in `DRAFT` status can be modified.
54
- *
55
- */
56
- export declare const updateInvoice: <ThrowOnError extends boolean = false>(options: Options<UpdateInvoiceData, ThrowOnError>) => import("./client").RequestResult<UpdateInvoiceResponses, UpdateInvoiceErrors, ThrowOnError, "fields">;
57
- /**
58
- * Create multiple invoices
59
- *
60
- * Creates multiple invoices in a single operation.
61
- *
62
- * **Idempotency:** Each invoice can have its own `idempotency_key`.
63
- *
64
- * **Atomicity:** If any invoice fails, ALL invoices are rejected.
65
- *
66
- */
67
- export declare const createInvoicesBulk: <ThrowOnError extends boolean = false>(options: Options<CreateInvoicesBulkData, ThrowOnError>) => import("./client").RequestResult<CreateInvoicesBulkResponses, CreateInvoicesBulkErrors, ThrowOnError, "fields">;
68
- /**
69
- * Download multiple invoice PDFs as ZIP
70
- *
71
- * Downloads multiple invoice PDFs as a single ZIP file.
72
- *
73
- * **Limits:**
74
- * - Maximum 20 invoices per request
75
- * - Maximum 50MB total ZIP size
76
- *
77
- * **Partial success:** If some PDFs are not available (not generated, not found),
78
- * the response will include a `failures` array with details. The ZIP will still
79
- * be generated with the available PDFs.
80
- *
81
- * **Error handling:**
82
- * - If NO PDFs are available, returns 400 Bad Request
83
- * - If some PDFs are unavailable, returns 200 with partial ZIP + failures list
84
- *
85
- */
86
- export declare const downloadInvoicesPdfBulk: <ThrowOnError extends boolean = false>(options: Options<DownloadInvoicesPdfBulkData, ThrowOnError>) => import("./client").RequestResult<DownloadInvoicesPdfBulkResponses, DownloadInvoicesPdfBulkErrors, ThrowOnError, "fields">;
87
- /**
88
- * Send multiple invoices by email
89
- *
90
- * Sends multiple invoices by email to the specified recipients.
91
- *
92
- * **Limits:**
93
- * - Maximum 20 invoices per request
94
- * - Maximum 25MB total attachment size
95
- *
96
- * **Email behavior:**
97
- * - Single email with all PDFs as attachments
98
- * - Uses BULK_INVOICES template
99
- *
100
- * **Validations:**
101
- * - Invoices must have status ISSUED, PAID, SENT or OVERDUE (not DRAFT or VOIDED)
102
- * - At least one recipient required (from request or user's accountant email)
103
- *
104
- * **Partial success:** If some invoices cannot be attached, the email will
105
- * still be sent with available PDFs. Response includes `failures` array.
106
- *
107
- */
108
- export declare const sendInvoicesBulkEmail: <ThrowOnError extends boolean = false>(options: Options<SendInvoicesBulkEmailData, ThrowOnError>) => import("./client").RequestResult<SendInvoicesBulkEmailResponses, SendInvoicesBulkEmailErrors, ThrowOnError, "fields">;
109
- /**
110
- * Change status of multiple invoices
111
- *
112
- * Changes the status of multiple invoices in a single operation.
113
- *
114
- * **Supported status changes:**
115
- * - **SENT:** Mark multiple invoices as sent (from ISSUED)
116
- * - **PAID:** Mark multiple invoices as paid (from ISSUED, SENT, or OVERDUE)
117
- *
118
- * **Partial success:** If some invoices cannot be updated, the operation
119
- * continues with the others. The response includes details of failures.
120
- *
121
- * **Limits:**
122
- * - Maximum 50 invoices per request
123
- *
124
- * **Validations:**
125
- * - All invoices must belong to the authenticated user
126
- * - Each invoice must be in a valid status for the requested transition
127
- * - For PAID: payment_date is required
128
- *
129
- */
130
- export declare const changeInvoicesStatusBulk: <ThrowOnError extends boolean = false>(options: Options<ChangeInvoicesStatusBulkData, ThrowOnError>) => import("./client").RequestResult<ChangeInvoicesStatusBulkResponses, ChangeInvoicesStatusBulkErrors, ThrowOnError, "fields">;
131
- /**
132
- * Get invoice PDF download URL
133
- *
134
- * Generates a temporary pre-signed URL to download the invoice PDF.
135
- *
136
- * **Security:**
137
- * - URL expires automatically in 5 minutes
138
- * - HMAC signature prevents tampering
139
- * - Only allows download (GET), no modification
140
- *
141
- * **Benefits:**
142
- * - Direct download from storage (bypasses backend)
143
- * - Better performance and lower server load
144
- * - Compatible with browser cache and CDN
145
- * - Ideal for large files
146
- *
147
- * **Frontend usage:**
148
- * ```javascript
149
- * const response = await fetch('/v1/invoices/{id}/pdf');
150
- * const { download_url } = await response.json();
151
- * window.open(download_url, '_blank'); // Direct download
152
- * ```
153
- *
154
- * **Format:** PDF is generated according to Spanish tax regulations.
155
- *
156
- */
157
- export declare const generateInvoicePdf: <ThrowOnError extends boolean = false>(options: Options<GenerateInvoicePdfData, ThrowOnError>) => import("./client").RequestResult<GenerateInvoicePdfResponses, GenerateInvoicePdfErrors, ThrowOnError, "fields">;
158
- /**
159
- * Preview draft invoice PDF
160
- *
161
- * Generates a PDF preview for a draft invoice and returns the binary content directly.
162
- *
163
- * **Requirements:**
164
- * - Invoice must be in BORRADOR (draft) status
165
- * - The PDF shows "BORRADOR" as the invoice number
166
- * - No VeriFactu QR code is included
167
- *
168
- * **Behavior:**
169
- * - PDF is generated on-the-fly (not stored)
170
- * - Each request regenerates the PDF (reflects latest draft changes)
171
- * - Response is `application/pdf` for direct browser preview
172
- *
173
- */
174
- export declare const previewDraftInvoicePdf: <ThrowOnError extends boolean = false>(options: Options<PreviewDraftInvoicePdfData, ThrowOnError>) => import("./client").RequestResult<PreviewDraftInvoicePdfResponses, PreviewDraftInvoicePdfErrors, ThrowOnError, "fields">;
175
- /**
176
- * Send invoice by email
177
- *
178
- * Sends the invoice by email to the customer.
179
- *
180
- * **Email:** Sent to the billing emails configured for the client.
181
- *
182
- * **Attachments:** Includes the invoice PDF.
183
- *
184
- */
185
- export declare const sendInvoiceEmail: <ThrowOnError extends boolean = false>(options: Options<SendInvoiceEmailData, ThrowOnError>) => import("./client").RequestResult<SendInvoiceEmailResponses, SendInvoiceEmailErrors, ThrowOnError, "fields">;
186
- /**
187
- * Submit invoice to VeriFactu (AEAT)
188
- *
189
- * Submits the invoice to the Spanish Tax Agency's VeriFactu system.
190
- *
191
- * **Requirements:**
192
- * - VeriFactu must be enabled in settings
193
- * - Invoice must have all required data
194
- * - Only invoices NOT previously submitted
195
- *
196
- * **Process:**
197
- * 1. Validates invoice data
198
- * 2. Generates electronic fingerprint
199
- * 3. Digitally signs
200
- * 4. Sends to AEAT
201
- * 5. Stores response and CSV
202
- *
203
- */
204
- export declare const submitInvoiceVeriFactu: <ThrowOnError extends boolean = false>(options: Options<SubmitInvoiceVeriFactuData, ThrowOnError>) => import("./client").RequestResult<SubmitInvoiceVeriFactuResponses, SubmitInvoiceVeriFactuErrors, ThrowOnError, "fields">;
205
- /**
206
- * Mark invoice as paid
207
- *
208
- * Marks an invoice as paid.
209
- *
210
- * **Status change:** `SENT` → `PAID`
211
- *
212
- */
213
- export declare const markInvoicePaid: <ThrowOnError extends boolean = false>(options: Options<MarkInvoicePaidData, ThrowOnError>) => import("./client").RequestResult<MarkInvoicePaidResponses, MarkInvoicePaidErrors, ThrowOnError, "fields">;
214
- /**
215
- * Void invoice
216
- *
217
- * Voids an invoice by changing its status to `VOIDED`.
218
- *
219
- * **Status change:** `ISSUED`, `SENT`, `OVERDUE`, `PAID` or `RECTIFIED` → `VOIDED`
220
- *
221
- * **Use when:** The operation never took place (invoice issued by mistake, duplicate, etc.)
222
- * For invoices already submitted to VeriFactu, the cancellation is sent to AEAT automatically.
223
- *
224
- * **Note:** If the operation did take place but with errors, use the corrective invoice endpoint instead.
225
- *
226
- */
227
- export declare const voidInvoice: <ThrowOnError extends boolean = false>(options: Options<VoidInvoiceData, ThrowOnError>) => import("./client").RequestResult<VoidInvoiceResponses, VoidInvoiceErrors, ThrowOnError, "fields">;
228
- /**
229
- * Create corrective invoice
230
- *
231
- * Creates a corrective invoice to correct or void an issued invoice.
232
- *
233
- * **Rectification types:**
234
- * - **TOTAL**: Completely voids the original invoice (original status → VOIDED)
235
- * - **PARTIAL**: Partially corrects the original invoice (original status → RECTIFIED)
236
- *
237
- * **VeriFactu codes:**
238
- * - R1: Legal error and Art. 80 One, Two and Six LIVA
239
- * - R2: Article 80 Three LIVA (Bankruptcy)
240
- * - R3: Article 80 Four LIVA (Bad debts)
241
- * - R4: Other causes
242
- * - R5: Simplified invoices (only for simplified)
243
- *
244
- * **Validations:**
245
- * - Original invoice must be in status ISSUED, SENT, PAID, OVERDUE or RECTIFIED
246
- * - Cannot rectify a DRAFT invoice (must be issued first)
247
- * - Cannot rectify a VOIDED invoice (final status)
248
- * - For TOTAL rectification: Another total corrective cannot already exist
249
- * - For PARTIAL rectification: Multiple partial correctives are allowed
250
- *
251
- * **Lines:**
252
- * - TOTAL: Optional (if not provided, original lines are copied with negated amounts)
253
- * - PARTIAL: REQUIRED (adjustment lines with positive or negative amounts)
254
- *
255
- */
256
- export declare const createCorrectiveInvoice: <ThrowOnError extends boolean = false>(options: Options<CreateCorrectiveInvoiceData, ThrowOnError>) => import("./client").RequestResult<CreateCorrectiveInvoiceResponses, CreateCorrectiveInvoiceErrors, ThrowOnError, "fields">;
257
- /**
258
- * Issue invoice (DRAFT → ISSUED)
259
- *
260
- * Finalizes a draft invoice and marks it as issued.
261
- *
262
- * **Status change:** `DRAFT` → `ISSUED`
263
- *
264
- * **Actions performed:**
265
- * - Assigns definitive invoice number according to configured series
266
- * - Marks invoice as finalized (not modifiable)
267
- * - Prepares invoice for sending to customer
268
- *
269
- * **Validations:**
270
- * - Invoice must be in DRAFT status
271
- * - All invoice data must be complete and valid
272
- *
273
- * **Note:** After issuing, the invoice can be sent to the customer via
274
- * the `/invoices/{id}/send` endpoint
275
- *
276
- */
277
- export declare const issueInvoice: <ThrowOnError extends boolean = false>(options: Options<IssueInvoiceData, ThrowOnError>) => import("./client").RequestResult<IssueInvoiceResponses, IssueInvoiceErrors, ThrowOnError, "fields">;
278
- /**
279
- * Mark invoice as sent
280
- *
281
- * Marks an invoice as sent manually.
282
- *
283
- * **Use case:** When the invoice was sent via WhatsApp, paper, or any other
284
- * channel outside of the email system.
285
- *
286
- * **Status change:** `ISSUED` → `SENT`
287
- *
288
- * **Records:** Sets `sent_at` timestamp for tracking.
289
- *
290
- */
291
- export declare const markInvoiceSent: <ThrowOnError extends boolean = false>(options: Options<MarkInvoiceSentData, ThrowOnError>) => import("./client").RequestResult<MarkInvoiceSentResponses, MarkInvoiceSentErrors, ThrowOnError, "fields">;
292
- /**
293
- * Revert invoice to issued status
294
- *
295
- * Reverts an invoice from SENT to ISSUED status.
296
- *
297
- * **Use case:** To correct errors when an invoice was marked as sent by mistake.
298
- *
299
- * **Status change:** `SENT` → `ISSUED`
300
- *
301
- * **Side effects:** Clears the `sent_at` timestamp.
302
- *
303
- */
304
- export declare const revertInvoiceToIssued: <ThrowOnError extends boolean = false>(options: Options<RevertInvoiceToIssuedData, ThrowOnError>) => import("./client").RequestResult<RevertInvoiceToIssuedResponses, RevertInvoiceToIssuedErrors, ThrowOnError, "fields">;
305
- /**
306
- * Schedule invoice for future processing
307
- *
308
- * Schedules a draft invoice to be automatically processed on a future date.
309
- *
310
- * **Status change:** `DRAFT` → `SCHEDULED`
311
- *
312
- * **Actions available:**
313
- * - `DRAFT`: Convert to draft for manual review on the scheduled date
314
- * - `ISSUE_AND_SEND`: Issue and send automatically on the scheduled date
315
- *
316
- */
317
- export declare const scheduleInvoice: <ThrowOnError extends boolean = false>(options: Options<ScheduleInvoiceData, ThrowOnError>) => import("./client").RequestResult<ScheduleInvoiceResponses, ScheduleInvoiceErrors, ThrowOnError, "fields">;
318
- /**
319
- * Cancel scheduled invoice
320
- *
321
- * Cancels a scheduled invoice and converts it back to draft.
322
- *
323
- * **Status change:** `SCHEDULED` → `DRAFT`
324
- *
325
- * The invoice can then be edited or manually issued.
326
- *
327
- */
328
- export declare const unscheduleInvoice: <ThrowOnError extends boolean = false>(options: Options<UnscheduleInvoiceData, ThrowOnError>) => import("./client").RequestResult<UnscheduleInvoiceResponses, UnscheduleInvoiceErrors, ThrowOnError, "fields">;
329
- /**
330
- * Reschedule invoice
331
- *
332
- * Changes the scheduled date for a scheduled invoice.
333
- *
334
- * **Status:** Remains `SCHEDULED`
335
- *
336
- * The new date must be today or in the future.
337
- *
338
- */
339
- export declare const rescheduleInvoice: <ThrowOnError extends boolean = false>(options: Options<RescheduleInvoiceData, ThrowOnError>) => import("./client").RequestResult<RescheduleInvoiceResponses, RescheduleInvoiceErrors, ThrowOnError, "fields">;
340
- /**
341
- * Duplicate invoice as draft
342
- *
343
- * Creates a copy of an existing invoice as a new draft.
344
- *
345
- * **Use case:** Quickly create a new invoice based on an existing one,
346
- * useful for recurring invoices to the same client.
347
- *
348
- * **What is copied:**
349
- * - Client data (recipient)
350
- * - Invoice lines (descriptions, quantities, prices, taxes)
351
- * - Payment method
352
- * - Series (if specified, otherwise uses default)
353
- * - Observations
354
- *
355
- * **What is NOT copied (reset to defaults):**
356
- * - Invoice number (null - assigned when issued)
357
- * - Status (always DRAFT)
358
- * - Issue date (defaults to today, can be overridden)
359
- * - Due date (recalculated based on new issue date)
360
- * - VeriFactu data
361
- * - PDF
362
- * - Payment date
363
- * - Sent date
364
- *
365
- * **Result:** A new draft invoice ready for review and emission.
366
- *
367
- */
368
- export declare const duplicateInvoice: <ThrowOnError extends boolean = false>(options: Options<DuplicateInvoiceData, ThrowOnError>) => import("./client").RequestResult<DuplicateInvoiceResponses, DuplicateInvoiceErrors, ThrowOnError, "fields">;
369
- /**
370
- * Export invoices to Excel
371
- *
372
- * Exports invoices to an Excel file (XLSX format).
373
- *
374
- * **Two modes of operation:**
375
- * - **By IDs:** Export specific invoices by providing `invoice_ids`
376
- * - **By filters:** Export all invoices matching filter criteria
377
- *
378
- * **Two export formats (like Holded):**
379
- * - **SUMMARY:** One row per invoice with aggregated totals (default)
380
- * - **ITEMS:** One row per invoice line item, ideal for import compatibility
381
- *
382
- * **Columns for SUMMARY format:**
383
- * - Date, Number, Due Date, Client, NIF
384
- * - Description, Subtotal, IVA, Withholding, Equivalence Surcharge
385
- * - Total, Collected, Pending, Status, Payment Method
386
- *
387
- * **Columns for ITEMS format:**
388
- * - Invoice Number, Date, Due Date, Draft, Contact, Contact NIF
389
- * - Address, Postal Code, City, Province, Country
390
- * - SKU, Item, Units, Unit Price, Discount %
391
- * - Subtotal, Tax Type, Tax %, Tax Amount
392
- * - Surcharge %, Surcharge Amount, IRPF %, IRPF Amount, Total
393
- *
394
- * **Limits:**
395
- * - Maximum 5000 invoices per export
396
- * - All invoices must belong to the authenticated user (RLS enforced)
397
- *
398
- * **Usage example (Frontend):**
399
- * ```javascript
400
- * const response = await fetch('/v1/invoices/export/excel', {
401
- * method: 'POST',
402
- * headers: { 'Content-Type': 'application/json' },
403
- * body: JSON.stringify({ invoice_ids: [...], format: 'ITEMS' })
404
- * });
405
- * const blob = await response.blob();
406
- * // Download the blob as file
407
- * ```
408
- *
409
- */
410
- export declare const exportInvoicesExcel: <ThrowOnError extends boolean = false>(options: Options<ExportInvoicesExcelData, ThrowOnError>) => import("./client").RequestResult<ExportInvoicesExcelResponses, ExportInvoicesExcelErrors, ThrowOnError, "fields">;
411
- /**
412
- * List clients
413
- *
414
- * Returns a paginated list of clients with optional filters
415
- */
416
- export declare const listCustomers: <ThrowOnError extends boolean = false>(options?: Options<ListCustomersData, ThrowOnError>) => import("./client").RequestResult<ListCustomersResponses, ListCustomersErrors, ThrowOnError, "fields">;
417
- /**
418
- * Create client
419
- *
420
- * Creates a new client
421
- */
422
- export declare const createCustomer: <ThrowOnError extends boolean = false>(options: Options<CreateCustomerData, ThrowOnError>) => import("./client").RequestResult<CreateCustomerResponses, CreateCustomerErrors, ThrowOnError, "fields">;
423
- /**
424
- * Deactivate client
425
- *
426
- * Deactivates (marks as deleted) a client.
427
- *
428
- * **Soft delete:** The client is not physically deleted, only marked as inactive.
429
- *
430
- * **Restriction:** Cannot deactivate a client with associated invoices.
431
- *
432
- */
433
- export declare const deactivateCustomer: <ThrowOnError extends boolean = false>(options: Options<DeactivateCustomerData, ThrowOnError>) => import("./client").RequestResult<DeactivateCustomerResponses, DeactivateCustomerErrors, ThrowOnError, "fields">;
434
- /**
435
- * Get client by ID
436
- *
437
- * Retrieves complete details of a specific client
438
- */
439
- export declare const getCustomer: <ThrowOnError extends boolean = false>(options: Options<GetCustomerData, ThrowOnError>) => import("./client").RequestResult<GetCustomerResponses, GetCustomerErrors, ThrowOnError, "fields">;
440
- /**
441
- * Update client
442
- *
443
- * Updates an existing client
444
- */
445
- export declare const updateCustomer: <ThrowOnError extends boolean = false>(options: Options<UpdateCustomerData, ThrowOnError>) => import("./client").RequestResult<UpdateCustomerResponses, UpdateCustomerErrors, ThrowOnError, "fields">;
446
- /**
447
- * Delete multiple clients
448
- *
449
- * Deactivates (marks as deleted) multiple clients in a single operation.
450
- *
451
- * **Soft delete:** Clients are not physically deleted, only marked as inactive.
452
- *
453
- * **Partial behavior:** Valid clients will be deactivated, failures are reported in the errors array.
454
- *
455
- */
456
- export declare const deactivateCustomersBulk: <ThrowOnError extends boolean = false>(options: Options<DeactivateCustomersBulkData, ThrowOnError>) => import("./client").RequestResult<DeactivateCustomersBulkResponses, DeactivateCustomersBulkErrors, ThrowOnError, "fields">;
457
- /**
458
- * Create or validate multiple clients
459
- *
460
- * Creates multiple clients in a single operation or validates data without persisting.
461
- *
462
- * **Validation flow:**
463
- * 1. `dry_run=true`: Full validation only (NIFs, duplicates, format) without persistence
464
- * 2. `dry_run=false`: Validation + actual creation
465
- *
466
- * **Validations performed:**
467
- * - Individual validation of each client (same rules as single client creation)
468
- * - Detection of duplicate NIFs within the batch
469
- * - Detection of duplicate NIFs against existing database
470
- * - Parallel NIF validation against AEAT registry (VeriFactu)
471
- * - Field format verification (email, phone, etc.)
472
- *
473
- * **Result statuses:**
474
- * - `VALID`: Client valid, ready to create
475
- * - `WARNING`: Client valid but with warnings (e.g., missing email)
476
- * - `ERROR`: Client invalid, cannot process
477
- * - `DUPLICATE`: Duplicate NIF (in batch or existing DB)
478
- * - `NIF_INVALID`: NIF not valid in AEAT registry
479
- *
480
- * **Atomicity:**
481
- * - `dry_run=true`: Validation only, no persistence
482
- * - `dry_run=false`: If any client fails, ALL clients are rejected (full atomicity)
483
- *
484
- */
485
- export declare const createCustomersBulk: <ThrowOnError extends boolean = false>(options: Options<CreateCustomersBulkData, ThrowOnError>) => import("./client").RequestResult<CreateCustomersBulkResponses, CreateCustomersBulkErrors, ThrowOnError, "fields">;
486
- /**
487
- * Import clients from CSV with structured preview
488
- *
489
- * Imports multiple clients from a CSV file with full preview of all records.
490
- *
491
- * **Key features**:
492
- * - **Structured preview**: Returns all parsed records (valid and with errors)
493
- * - **Parallel validation**: NIFs validated concurrently against VeriFactu
494
- * - **Granular feedback**: Client-specific errors and warnings
495
- * - **Editable data**: Structured JSON for editable table in frontend
496
- *
497
- * **Recommended flow**:
498
- * 1. **Initial upload**: Call with `dry_run=true` to get preview
499
- * 2. **Display table**: Frontend shows parsed data with errors/warnings
500
- * 3. **Inline editing**: User corrects data directly in the table
501
- * 4. **Final import**: Send corrected data with `dry_run=false`
502
- *
503
- * **Format**: Must follow CSV template format (downloadable from `/customers/template-csv`).
504
- *
505
- * **Security limits**:
506
- * - Max size: 5MB
507
- * - Max 1,000 records per file
508
- * - Rate limiting: 3 imports per hour
509
- *
510
- * **Validation**:
511
- * - Required headers per template
512
- * - Full validation of each row with business rules
513
- * - Parallel NIF validation against AEAT registry (VeriFactu)
514
- * - Duplicate detection in CSV and database
515
- *
516
- * **Validation statuses**:
517
- * - `VALID`: Client valid, ready to import
518
- * - `WARNING`: Client valid but with warnings (eg: missing email)
519
- * - `ERROR`: Client invalid, cannot process
520
- * - `DUPLICATE`: Duplicate client (in CSV or DB)
521
- * - `NIF_INVALID`: NIF invalid in AEAT registry
522
- *
523
- */
524
- export declare const importCustomersCsvPreview: <ThrowOnError extends boolean = false>(options: Options<ImportCustomersCsvPreviewData, ThrowOnError>) => import("./client").RequestResult<ImportCustomersCsvPreviewResponses, ImportCustomersCsvPreviewErrors, ThrowOnError, "fields">;
525
- /**
526
- * Import contacts from Holded Excel
527
- *
528
- * Imports multiple clients from an Excel file exported from Holded.
529
- *
530
- * **Key features**:
531
- * - **Specific parsing**: Reads exact structure of Holded contacts Excel (29 columns)
532
- * - **Automatic mapping**: Converts Holded contacts to Client entities automatically
533
- * - **Full validation**: Validates NIFs, addresses and required data
534
- * - **Preview mode**: Allows viewing parsed data before importing
535
- *
536
- * **Recommended flow**:
537
- * 1. **Initial upload**: Call with `preview=true` to get preview
538
- * 2. **Display data**: Frontend shows parsed Holded contacts
539
- * 3. **Final import**: Call with `preview=false` to import definitively
540
- *
541
- * **Expected Excel structure** (contacts exported from Holded):
542
- * - Sheet: "Holded"
543
- * - Rows to skip: 2 (header + empty)
544
- * - Headers in row 2: Created, Name, ID, Email, Phone, Mobile, etc. (29 columns)
545
- * - Footer: "Report created automatically with Holded..."
546
- *
547
- * **Security limits**:
548
- * - Max size: 10MB
549
- * - Max 5,000 records per file
550
- * - Rate limiting: 5 imports per hour
551
- *
552
- * **Automatic Holded → Client mapping**:
553
- * - Name → legal_name
554
- * - ID → identifier (NIF/CIF)
555
- * - Email → email
556
- * - Phone/Mobile → phone (prioritizes mobile)
557
- * - Full address → address
558
- * - Tags → notes
559
- *
560
- */
561
- export declare const importHoldedContacts: <ThrowOnError extends boolean = false>(options: Options<ImportHoldedContactsData, ThrowOnError>) => import("./client").RequestResult<ImportHoldedContactsResponses, ImportHoldedContactsErrors, ThrowOnError, "fields">;
562
- /**
563
- * Download CSV template for customers
564
- *
565
- * Downloads a sample CSV file for customer import.
566
- *
567
- * **Format**: The file includes the required headers and example rows
568
- * with UTF-8 BOM for Excel compatibility.
569
- *
570
- */
571
- export declare const downloadCustomerTemplateCsv: <ThrowOnError extends boolean = false>(options?: Options<DownloadCustomerTemplateCsvData, ThrowOnError>) => import("./client").RequestResult<DownloadCustomerTemplateCsvResponses, DownloadCustomerTemplateCsvErrors, ThrowOnError, "fields">;
572
- /**
573
- * List products/services from catalog
574
- *
575
- * Returns a paginated list of products/services with optional filters
576
- */
577
- export declare const listProducts: <ThrowOnError extends boolean = false>(options?: Options<ListProductsData, ThrowOnError>) => import("./client").RequestResult<ListProductsResponses, ListProductsErrors, ThrowOnError, "fields">;
578
- /**
579
- * Create new product/service
580
- *
581
- * Creates a new product or service in the catalog
582
- */
583
- export declare const createProduct: <ThrowOnError extends boolean = false>(options: Options<CreateProductData, ThrowOnError>) => import("./client").RequestResult<CreateProductResponses, CreateProductErrors, ThrowOnError, "fields">;
584
- /**
585
- * Delete product
586
- *
587
- * Deletes a product from catalog
588
- */
589
- export declare const deleteProduct: <ThrowOnError extends boolean = false>(options: Options<DeleteProductData, ThrowOnError>) => import("./client").RequestResult<DeleteProductResponses, DeleteProductErrors, ThrowOnError, "fields">;
590
- /**
591
- * Get product by ID
592
- *
593
- * Retrieves details of a specific product
594
- */
595
- export declare const getProduct: <ThrowOnError extends boolean = false>(options: Options<GetProductData, ThrowOnError>) => import("./client").RequestResult<GetProductResponses, GetProductErrors, ThrowOnError, "fields">;
596
- /**
597
- * Update product
598
- *
599
- * Updates an existing product
600
- */
601
- export declare const updateProduct: <ThrowOnError extends boolean = false>(options: Options<UpdateProductData, ThrowOnError>) => import("./client").RequestResult<UpdateProductResponses, UpdateProductErrors, ThrowOnError, "fields">;
602
- /**
603
- * Search and autocomplete
604
- *
605
- * Optimized endpoint for active product autocomplete
606
- */
607
- export declare const searchProducts: <ThrowOnError extends boolean = false>(options?: Options<SearchProductsData, ThrowOnError>) => import("./client").RequestResult<SearchProductsResponses, SearchProductsErrors, ThrowOnError, "fields">;
608
- /**
609
- * Delete multiple products
610
- *
611
- * Deletes multiple products from catalog (max 100)
612
- */
613
- export declare const deleteProductsBulk: <ThrowOnError extends boolean = false>(options: Options<DeleteProductsBulkData, ThrowOnError>) => import("./client").RequestResult<DeleteProductsBulkResponses, DeleteProductsBulkErrors, ThrowOnError, "fields">;
614
- /**
615
- * Create multiple products
616
- *
617
- * Creates multiple products in one operation (max 100)
618
- */
619
- export declare const createProductsBulk: <ThrowOnError extends boolean = false>(options: Options<CreateProductsBulkData, ThrowOnError>) => import("./client").RequestResult<CreateProductsBulkResponses, CreateProductsBulkErrors, ThrowOnError, "fields">;
620
- /**
621
- * Get VeriFactu configuration
622
- *
623
- * Retrieves the current VeriFactu configuration
624
- */
625
- export declare const getVeriFactuConfiguration: <ThrowOnError extends boolean = false>(options?: Options<GetVeriFactuConfigurationData, ThrowOnError>) => import("./client").RequestResult<GetVeriFactuConfigurationResponses, GetVeriFactuConfigurationErrors, ThrowOnError, "fields">;
626
- /**
627
- * Update VeriFactu configuration
628
- *
629
- * Updates the user's VeriFactu configuration.
630
- *
631
- * **Business rules:**
632
- * - If `enabled` is false, `apply_by_default` must also be false
633
- * - If `apply_by_default` is true, `enabled` must be true
634
- *
635
- */
636
- export declare const updateVeriFactuConfiguration: <ThrowOnError extends boolean = false>(options: Options<UpdateVeriFactuConfigurationData, ThrowOnError>) => import("./client").RequestResult<UpdateVeriFactuConfigurationResponses, UpdateVeriFactuConfigurationErrors, ThrowOnError, "fields">;
637
- /**
638
- * Get complete tax types catalog
639
- *
640
- * Retrieves the complete catalog of available tax types with structured information
641
- * for tax configuration in Spain:
642
- *
643
- * - **Tax regimes**: VAT (Peninsula), IGIC (Canary Islands), IPSI (Ceuta/Melilla), OTHERS
644
- * - **Percentages per regime**: Valid percentages for each tax type
645
- * - **Regime codes**: VeriFactu codes for each tax type
646
- * - **IRPF**: Available withholding percentages
647
- * - **Equivalence surcharge**: Automatic mappings based on VAT percentage
648
- * - **Utilities**: Validation functions and geographic auto-detection
649
- *
650
- * This endpoint provides all necessary information for the frontend
651
- * without duplicating tax validation logic.
652
- *
653
- */
654
- export declare const getTaxTypes: <ThrowOnError extends boolean = false>(options?: Options<GetTaxTypesData, ThrowOnError>) => import("./client").RequestResult<GetTaxTypesResponses, GetTaxTypesErrors, ThrowOnError, "fields">;
655
- /**
656
- * Get user tax configuration
657
- *
658
- * Retrieves the user's tax configuration, including:
659
- * - Default tax regime (VAT, IGIC, IPSI, OTHERS)
660
- * - Default main tax percentage
661
- * - IRPF and equivalence surcharge configuration
662
- *
663
- */
664
- export declare const getTaxConfiguration: <ThrowOnError extends boolean = false>(options?: Options<GetTaxConfigurationData, ThrowOnError>) => import("./client").RequestResult<GetTaxConfigurationResponses, GetTaxConfigurationErrors, ThrowOnError, "fields">;
665
- /**
666
- * Update tax configuration
667
- *
668
- * Updates the user's tax configuration
669
- */
670
- export declare const updateTaxConfiguration: <ThrowOnError extends boolean = false>(options: Options<UpdateTaxConfigurationData, ThrowOnError>) => import("./client").RequestResult<UpdateTaxConfigurationResponses, UpdateTaxConfigurationErrors, ThrowOnError, "fields">;
671
- /**
672
- * List invoice series
673
- *
674
- * Retrieves all invoice series for the user
675
- */
676
- export declare const listSeries: <ThrowOnError extends boolean = false>(options?: Options<ListSeriesData, ThrowOnError>) => import("./client").RequestResult<ListSeriesResponses, ListSeriesErrors, ThrowOnError, "fields">;
677
- /**
678
- * Create invoice series
679
- *
680
- * Creates a new invoice series.
681
- *
682
- * **Note:** The first series created by a user is automatically marked as default.
683
- *
684
- */
685
- export declare const createSeries: <ThrowOnError extends boolean = false>(options: Options<CreateSeriesData, ThrowOnError>) => import("./client").RequestResult<CreateSeriesResponses, CreateSeriesErrors, ThrowOnError, "fields">;
686
- /**
687
- * Delete series
688
- *
689
- * Deactivates an invoice series.
690
- *
691
- * **Soft delete:** The series is marked as inactive, not physically deleted.
692
- *
693
- * **Restriction:** Cannot delete the default series or series with invoices.
694
- *
695
- */
696
- export declare const deleteSeries: <ThrowOnError extends boolean = false>(options: Options<DeleteSeriesData, ThrowOnError>) => import("./client").RequestResult<DeleteSeriesResponses, DeleteSeriesErrors, ThrowOnError, "fields">;
697
- /**
698
- * Get series by ID
699
- *
700
- * Retrieves details of a specific series
701
- */
702
- export declare const getSeries: <ThrowOnError extends boolean = false>(options: Options<GetSeriesData, ThrowOnError>) => import("./client").RequestResult<GetSeriesResponses, GetSeriesErrors, ThrowOnError, "fields">;
703
- /**
704
- * Update invoice series
705
- *
706
- * Updates an existing invoice series.
707
- *
708
- * Can only update:
709
- * - Description
710
- * - Active/inactive status
711
- * - Whether it is default
712
- *
713
- * Cannot modify: code, prefix, number_format (to maintain consistency with existing invoices).
714
- *
715
- * Business rules:
716
- * - Cannot deactivate a default series (must set another as default first)
717
- * - Cannot mark an inactive series as default
718
- *
719
- */
720
- export declare const updateSeries: <ThrowOnError extends boolean = false>(options: Options<UpdateSeriesData, ThrowOnError>) => import("./client").RequestResult<UpdateSeriesResponses, UpdateSeriesErrors, ThrowOnError, "fields">;
721
- /**
722
- * Mark series as default
723
- *
724
- * Marks an invoice series as the user's default.
725
- *
726
- * **Business rules:**
727
- * - Only one series can be default per user
728
- * - The series must be active (cannot mark an inactive series)
729
- * - The previous default series is automatically unmarked
730
- *
731
- * **Note:** This operation is idempotent - calling it multiple times
732
- * with the same series has no additional effects.
733
- *
734
- */
735
- export declare const setDefaultSeries: <ThrowOnError extends boolean = false>(options: Options<SetDefaultSeriesData, ThrowOnError>) => import("./client").RequestResult<SetDefaultSeriesResponses, SetDefaultSeriesErrors, ThrowOnError, "fields">;
736
- /**
737
- * Update user preferred language
738
- *
739
- * Updates the authenticated user's preferred language.
740
- *
741
- * This language is used for:
742
- * - UI translations
743
- * - Template names and colors in invoice customization
744
- * - Emails sent to the user
745
- *
746
- * **Supported languages:**
747
- * - `es` - Spanish (default)
748
- * - `en` - English
749
- * - `ca` - Catalan
750
- *
751
- */
752
- export declare const updateLanguage: <ThrowOnError extends boolean = false>(options: Options<UpdateLanguageData, ThrowOnError>) => import("./client").RequestResult<UpdateLanguageResponses, UpdateLanguageErrors, ThrowOnError, "fields">;
753
- /**
754
- * Get invoice customization options
755
- *
756
- * Retrieves available option catalogs to customize invoices:
757
- *
758
- * **Template types:**
759
- * - MODERN_TABLE: Structured table design, ideal for standard products/services
760
- * - PROFESSIONAL_SERVICE: Text-based design, ideal for notaries/consultancies
761
- *
762
- * **Suggested color palette:**
763
- * - BeeL default colors (orange, blue)
764
- * - Professional palette (dark grays)
765
- * - Creative palette (violet, pink, amber, emerald green)
766
- * - Classic palette (blue, red, green, purple)
767
- *
768
- * **Usage:**
769
- * User can choose a template and accent color to customize
770
- * their invoices. These values are saved in their profile and automatically applied
771
- * when generating new invoice PDFs.
772
- *
773
- * This endpoint doesn't require authentication as the data is static and public.
774
- *
775
- */
776
- export declare const getInvoiceCustomizationOptions: <ThrowOnError extends boolean = false>(options?: Options<GetInvoiceCustomizationOptionsData, ThrowOnError>) => import("./client").RequestResult<GetInvoiceCustomizationOptionsResponses, GetInvoiceCustomizationOptionsErrors, ThrowOnError, "fields">;
777
- /**
778
- * Validate NIF against AEAT registry
779
- *
780
- * **Public endpoint** to validate a NIF/CIF against the AEAT registry using VeriFactu.
781
- *
782
- * This endpoint is useful for:
783
- * - Pre-validation before registration (proactive feedback)
784
- * - Validating client NIFs before creating invoices
785
- * - Verifying that a NIF exists in the registry
786
- *
787
- * **Behavior:**
788
- * - **VALID**: The NIF exists in the AEAT registry. Returns the fiscal name.
789
- * - **INVALID**: The NIF has correct format but doesn't exist in the registry.
790
- * - **PENDING**: VeriFactu API is temporarily unavailable. The NIF has valid syntax but couldn't be verified against the registry.
791
- * - **ERROR**: Technical error during validation (invalid syntax, timeout, etc.)
792
- *
793
- * **Note about PENDING:**
794
- * If you use this endpoint for pre-validation during registration, a PENDING status
795
- * indicates that the NIF has valid format and the user can continue. The system
796
- * will validate the NIF automatically when the service becomes available.
797
- *
798
- * **Rate limiting:**
799
- * - With API Key: 100 requests/hour
800
- * - With Session Cookie: 1000 requests/hour
801
- *
802
- * **Authentication:**
803
- * This endpoint accepts both API Keys and Session Cookies.
804
- *
805
- */
806
- export declare const validateNif: <ThrowOnError extends boolean = false>(options: Options<ValidateNifData, ThrowOnError>) => import("./client").RequestResult<ValidateNifResponses, ValidateNifErrors, ThrowOnError, "fields">;
807
- /**
808
- * List all companies
809
- *
810
- * Returns all companies (sub-accounts) under the authenticated account.
811
- */
812
- export declare const listCompanies: <ThrowOnError extends boolean = false>(options?: Options<ListCompaniesData, ThrowOnError>) => import("./client").RequestResult<ListCompaniesResponses, ListCompaniesErrors, ThrowOnError, "fields">;
813
- /**
814
- * Create a company (sub-account)
815
- *
816
- * Creates a new NIF/company under the authenticated account.
817
- * Invoice series are created automatically with default values.
818
- *
819
- */
820
- export declare const createCompany: <ThrowOnError extends boolean = false>(options: Options<CreateCompanyData, ThrowOnError>) => import("./client").RequestResult<CreateCompanyResponses, CreateCompanyErrors, ThrowOnError, "fields">;
821
- /**
822
- * Delete a company
823
- *
824
- * Deletes a company (sub-account). Cannot delete the primary profile.
825
- *
826
- */
827
- export declare const deleteCompany: <ThrowOnError extends boolean = false>(options: Options<DeleteCompanyData, ThrowOnError>) => import("./client").RequestResult<DeleteCompanyResponses, DeleteCompanyErrors, ThrowOnError, "fields">;
828
- /**
829
- * Get company details
830
- *
831
- * Returns details of a specific company including VeriFactu status.
832
- */
833
- export declare const getCompany: <ThrowOnError extends boolean = false>(options: Options<GetCompanyData, ThrowOnError>) => import("./client").RequestResult<GetCompanyResponses, GetCompanyErrors, ThrowOnError, "fields">;
834
- /**
835
- * Update company details
836
- *
837
- * Updates editable fields of a company.
838
- * NIF, legal name, and entity type are immutable after creation.
839
- *
840
- */
841
- export declare const updateCompany: <ThrowOnError extends boolean = false>(options: Options<UpdateCompanyData, ThrowOnError>) => import("./client").RequestResult<UpdateCompanyResponses, UpdateCompanyErrors, ThrowOnError, "fields">;
842
- /**
843
- * Generate unsigned representation PDF
844
- *
845
- * Generates the VeriFactu representation PDF for digital signature.
846
- */
847
- export declare const generateRepresentation: <ThrowOnError extends boolean = false>(options: Options<GenerateRepresentationData, ThrowOnError>) => import("./client").RequestResult<GenerateRepresentationResponses, GenerateRepresentationErrors, ThrowOnError, "fields">;
848
- /**
849
- * Download representation PDF
850
- *
851
- * Returns a presigned URL (5min) to download the representation PDF.
852
- */
853
- export declare const downloadRepresentation: <ThrowOnError extends boolean = false>(options: Options<DownloadRepresentationData, ThrowOnError>) => import("./client").RequestResult<DownloadRepresentationResponses, DownloadRepresentationErrors, ThrowOnError, "fields">;
854
- /**
855
- * Submit signed representation PDF
856
- *
857
- * Uploads the digitally signed representation PDF.
858
- * VeriFactu will validate the signature asynchronously.
859
- *
860
- */
861
- export declare const submitRepresentation: <ThrowOnError extends boolean = false>(options: Options<SubmitRepresentationData, ThrowOnError>) => import("./client").RequestResult<SubmitRepresentationResponses, SubmitRepresentationErrors, ThrowOnError, "fields">;
862
- /**
863
- * Get representation status
864
- *
865
- * Returns the current status of the VeriFactu representation process.
866
- */
867
- export declare const getRepresentationStatus: <ThrowOnError extends boolean = false>(options: Options<GetRepresentationStatusData, ThrowOnError>) => import("./client").RequestResult<GetRepresentationStatusResponses, GetRepresentationStatusErrors, ThrowOnError, "fields">;
868
- /**
869
- * Cancel representation
870
- *
871
- * Cancels the current representation process.
872
- */
873
- export declare const cancelRepresentation: <ThrowOnError extends boolean = false>(options: Options<CancelRepresentationData, ThrowOnError>) => import("./client").RequestResult<CancelRepresentationResponses, CancelRepresentationErrors, ThrowOnError, "fields">;
874
- /**
875
- * List API keys for a company
876
- *
877
- * Returns all API keys associated with this company.
878
- */
879
- export declare const listCompanyApiKeys: <ThrowOnError extends boolean = false>(options: Options<ListCompanyApiKeysData, ThrowOnError>) => import("./client").RequestResult<ListCompanyApiKeysResponses, ListCompanyApiKeysErrors, ThrowOnError, "fields">;
880
- /**
881
- * Create API key scoped to a company
882
- *
883
- * Creates an API key that authenticates directly as this company.
884
- * The created key cannot have more scopes than the parent key.
885
- *
886
- */
887
- export declare const createCompanyApiKey: <ThrowOnError extends boolean = false>(options: Options<CreateCompanyApiKeyData, ThrowOnError>) => import("./client").RequestResult<CreateCompanyApiKeyResponses, CreateCompanyApiKeyErrors, ThrowOnError, "fields">;
888
- /**
889
- * Revoke an API key
890
- *
891
- * Revokes (deletes) an API key associated with this company.
892
- */
893
- export declare const revokeCompanyApiKey: <ThrowOnError extends boolean = false>(options: Options<RevokeCompanyApiKeyData, ThrowOnError>) => import("./client").RequestResult<RevokeCompanyApiKeyResponses, RevokeCompanyApiKeyErrors, ThrowOnError, "fields">;
894
- /**
895
- * List webhook subscriptions
896
- *
897
- * Returns all webhook subscriptions for the authenticated account.
898
- */
899
- export declare const listWebhookSubscriptions: <ThrowOnError extends boolean = false>(options?: Options<ListWebhookSubscriptionsData, ThrowOnError>) => import("./client").RequestResult<ListWebhookSubscriptionsResponses, ListWebhookSubscriptionsErrors, ThrowOnError, "fields">;
900
- /**
901
- * Create webhook subscription
902
- *
903
- * Register an HTTPS endpoint to receive real-time event notifications. Every delivery is signed with BeeL-Signature (HMAC-SHA256). The secret is returned once on creation — store it securely. Maximum 10 active webhook subscriptions per account.
904
- */
905
- export declare const createWebhookSubscription: <ThrowOnError extends boolean = false>(options: Options<CreateWebhookSubscriptionData, ThrowOnError>) => import("./client").RequestResult<CreateWebhookSubscriptionResponses, CreateWebhookSubscriptionErrors, ThrowOnError, "fields">;
906
- /**
907
- * Delete webhook subscription
908
- *
909
- * Permanently deletes a webhook subscription. No further events will be delivered.
910
- */
911
- export declare const deleteWebhookSubscription: <ThrowOnError extends boolean = false>(options: Options<DeleteWebhookSubscriptionData, ThrowOnError>) => import("./client").RequestResult<DeleteWebhookSubscriptionResponses, DeleteWebhookSubscriptionErrors, ThrowOnError, "fields">;
912
- /**
913
- * Update webhook subscription
914
- *
915
- * Partially updates a webhook subscription. Only provided fields are updated.
916
- *
917
- * Use this endpoint to:
918
- * - **Change the endpoint URL** (`url`)
919
- * - **Change subscribed events** (`events`)
920
- * - **Enable or disable** the subscription (`active`)
921
- *
922
- */
923
- export declare const updateWebhookSubscription: <ThrowOnError extends boolean = false>(options: Options<UpdateWebhookSubscriptionData, ThrowOnError>) => import("./client").RequestResult<UpdateWebhookSubscriptionResponses, UpdateWebhookSubscriptionErrors, ThrowOnError, "fields">;
924
- /**
925
- * List webhook delivery logs
926
- *
927
- * Returns the last 50 delivery attempts for a webhook subscription.
928
- */
929
- export declare const listWebhookDeliveries: <ThrowOnError extends boolean = false>(options: Options<ListWebhookDeliveriesData, ThrowOnError>) => import("./client").RequestResult<ListWebhookDeliveriesResponses, ListWebhookDeliveriesErrors, ThrowOnError, "fields">;
930
- /**
931
- * Retry a failed webhook delivery
932
- *
933
- * Immediately retries a webhook delivery using the original payload.
934
- * Creates a new delivery log entry with the result.
935
- *
936
- */
937
- export declare const retryWebhookDelivery: <ThrowOnError extends boolean = false>(options: Options<RetryWebhookDeliveryData, ThrowOnError>) => import("./client").RequestResult<RetryWebhookDeliveryResponses, RetryWebhookDeliveryErrors, ThrowOnError, "fields">;
938
- /**
939
- * Rotate webhook secret
940
- *
941
- * Generates a new HMAC secret for a webhook subscription.
942
- * The old secret is **immediately invalidated** — update your signature verification
943
- * logic before rotating to avoid missing events during the transition.
944
- * The new secret is only returned **once** in this response.
945
- *
946
- */
947
- export declare const rotateWebhookSecret: <ThrowOnError extends boolean = false>(options: Options<RotateWebhookSecretData, ThrowOnError>) => import("./client").RequestResult<RotateWebhookSecretResponses, RotateWebhookSecretErrors, ThrowOnError, "fields">;
948
- /**
949
- * Get public platform metrics
950
- *
951
- * Retrieves sanitized platform metrics safe for public display on landing page.
952
- *
953
- * **No authentication required**
954
- *
955
- * **Data is:**
956
- * - Rounded to avoid exposing exact figures
957
- * - Cached for 15 minutes
958
- * - Safe for public consumption
959
- *
960
- * **Use case:**
961
- * - Landing page social proof
962
- * - Marketing materials
963
- *
964
- */
965
- export declare const getPublicMetrics: <ThrowOnError extends boolean = false>(options?: Options<GetPublicMetricsData, ThrowOnError>) => import("./client").RequestResult<GetPublicMetricsResponses, GetPublicMetricsErrors, ThrowOnError, "fields">;
966
- //# sourceMappingURL=sdk.gen.d.ts.map