@beel_es/sdk 2.0.0 → 2.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 (41) hide show
  1. package/CHANGELOG.md +227 -0
  2. package/README.md +216 -25
  3. package/dist/index.d.mts +1450 -181
  4. package/dist/index.d.ts +1450 -181
  5. package/dist/index.js +1411 -188
  6. package/dist/index.js.map +1 -1
  7. package/dist/index.mjs +1409 -188
  8. package/dist/index.mjs.map +1 -1
  9. package/docs/reference/README.md +233 -0
  10. package/docs/reference/account-companies.md +55 -0
  11. package/docs/reference/account-invitations.md +57 -0
  12. package/docs/reference/account-members.md +97 -0
  13. package/docs/reference/account-webhooks.md +123 -0
  14. package/docs/reference/account.md +94 -0
  15. package/docs/reference/accounts.md +72 -0
  16. package/docs/reference/catalogs.md +68 -0
  17. package/docs/reference/client.md +113 -0
  18. package/docs/reference/company-customers.md +85 -0
  19. package/docs/reference/company-invoices-schedule.md +52 -0
  20. package/docs/reference/company-invoices.md +316 -0
  21. package/docs/reference/company-payment-connections-events.md +103 -0
  22. package/docs/reference/company-payment-connections.md +87 -0
  23. package/docs/reference/company-products.md +72 -0
  24. package/docs/reference/company-recurring-invoices.md +136 -0
  25. package/docs/reference/company-series.md +94 -0
  26. package/docs/reference/company-tax-configuration.md +36 -0
  27. package/docs/reference/company-verifactu-configuration.md +41 -0
  28. package/docs/reference/company.md +94 -0
  29. package/docs/reference/configuration.md +90 -0
  30. package/docs/reference/customer-builder.md +107 -0
  31. package/docs/reference/customers.md +91 -0
  32. package/docs/reference/errors.md +72 -0
  33. package/docs/reference/invoice-builder.md +149 -0
  34. package/docs/reference/invoices.md +250 -0
  35. package/docs/reference/nif.md +31 -0
  36. package/docs/reference/products.md +111 -0
  37. package/docs/reference/series.md +81 -0
  38. package/docs/reference/types.md +222 -0
  39. package/docs/reference/webhook-verifier.md +95 -0
  40. package/llms.txt +52 -0
  41. package/package.json +10 -4
@@ -0,0 +1,136 @@
1
+ <!-- Generated by `npm run docs:reference` from the SDK source and openapi/public-api.yaml. Do not edit. -->
2
+
3
+ # `beel.company(companyId).recurringInvoices` — `CompanyRecurringInvoicesResource`
4
+
5
+ [Reference index](README.md)
6
+
7
+ Recurring invoice templates of one company. Reach it as
8
+ `beel.company(companyId).recurringInvoices`.
9
+
10
+ ## Methods
11
+
12
+ | Method | HTTP | Summary |
13
+ |---|---|---|
14
+ | [`beel.company(companyId).recurringInvoices.list(params?)`](#company-recurring-invoices-list) | `GET /v1/companies/{company_id}/recurring-invoices` | List the recurring invoices. |
15
+ | [`beel.company(companyId).recurringInvoices.create(body)`](#company-recurring-invoices-create) | `POST /v1/companies/{company_id}/recurring-invoices` | Create a recurring invoice template. |
16
+ | [`beel.company(companyId).recurringInvoices.get(recurringInvoiceId)`](#company-recurring-invoices-get) | `GET /v1/companies/{company_id}/recurring-invoices/{recurring_invoice_id}` | Get one recurring invoice. |
17
+ | [`beel.company(companyId).recurringInvoices.update(recurringInvoiceId, body)`](#company-recurring-invoices-update) | `PATCH /v1/companies/{company_id}/recurring-invoices/{recurring_invoice_id}` | Update a recurring invoice. |
18
+ | [`beel.company(companyId).recurringInvoices.delete(recurringInvoiceId)`](#company-recurring-invoices-delete) | `DELETE /v1/companies/{company_id}/recurring-invoices/{recurring_invoice_id}` | Delete a recurring invoice and cancel its pending generations. |
19
+ | [`beel.company(companyId).recurringInvoices.setStatus(recurringInvoiceId, body)`](#company-recurring-invoices-set-status) | `PUT /v1/companies/{company_id}/recurring-invoices/{recurring_invoice_id}/status` | Pause, resume or end the template. |
20
+ | [`beel.company(companyId).recurringInvoices.skip(recurringInvoiceId)`](#company-recurring-invoices-skip) | `POST /v1/companies/{company_id}/recurring-invoices/{recurring_invoice_id}/skip` | Skip the next scheduled occurrence. |
21
+ | [`beel.company(companyId).recurringInvoices.generateNow(recurringInvoiceId)`](#company-recurring-invoices-generate-now) | `POST /v1/companies/{company_id}/recurring-invoices/{recurring_invoice_id}/generate` | Generate the next invoice now instead of waiting for the schedule. |
22
+ | [`beel.company(companyId).recurringInvoices.nextOccurrence(recurringInvoiceId)`](#company-recurring-invoices-next-occurrence) | `GET /v1/companies/{company_id}/recurring-invoices/{recurring_invoice_id}/next-occurrence` | Preview the next invoice the template will generate. |
23
+ | [`beel.company(companyId).recurringInvoices.history(recurringInvoiceId, params?)`](#company-recurring-invoices-history) | `GET /v1/companies/{company_id}/recurring-invoices/{recurring_invoice_id}/history` | The generation history of the template: generated, skipped and failed occurrences. |
24
+
25
+ <a id="company-recurring-invoices-list"></a>
26
+ ### `list(params?)`
27
+
28
+ List the recurring invoices.
29
+
30
+ - **HTTP:** `GET /v1/companies/{company_id}/recurring-invoices` · operation `listCompanyRecurringInvoices` · scopes `invoices:read`
31
+ - **Parameters:**
32
+ - `params?: operations['listCompanyRecurringInvoices']['parameters']['query']` — Filters and pagination.
33
+ - **Returns:** The page of `recurring_invoices` and its `pagination`. Response `200` `data`: `{ recurring_invoices: RecurringInvoiceResponse[]; pagination?: Pagination }`.
34
+ - **Throws:** `400`/`500` `BeeLApiError` · `401`/`403` `BeeLAuthError` · `422` `BeeLValidationError` · `429` `BeeLRateLimitError`
35
+
36
+ <a id="company-recurring-invoices-create"></a>
37
+ ### `create(body)`
38
+
39
+ Create a recurring invoice template.
40
+
41
+ - **HTTP:** `POST /v1/companies/{company_id}/recurring-invoices` · operation `createCompanyRecurringInvoice` · scopes `invoices:write` · accepts `Idempotency-Key`
42
+ - **Parameters:**
43
+ - `body: operations['createCompanyRecurringInvoice']['requestBody']['content']['application/json']` — Frequency, schedule, recipient and lines.
44
+ - **Returns:** The recurring invoice. Response `201` `data`: `RecurringInvoiceResponse`.
45
+ - **Throws:** `400`/`500` `BeeLApiError` · `401`/`403` `BeeLAuthError` · `404` `BeeLNotFoundError` · `422` `BeeLValidationError` · `429` `BeeLRateLimitError`
46
+
47
+ <a id="company-recurring-invoices-get"></a>
48
+ ### `get(recurringInvoiceId)`
49
+
50
+ Get one recurring invoice.
51
+
52
+ - **HTTP:** `GET /v1/companies/{company_id}/recurring-invoices/{recurring_invoice_id}` · operation `getCompanyRecurringInvoice` · scopes `invoices:read`
53
+ - **Parameters:**
54
+ - `recurringInvoiceId: string` — Recurring invoice UUID.
55
+ - **Returns:** The recurring invoice. Response `200` `data`: `RecurringInvoiceResponse`.
56
+ - **Throws:** `400`/`500` `BeeLApiError` · `401`/`403` `BeeLAuthError` · `404` `BeeLNotFoundError` · `429` `BeeLRateLimitError`
57
+
58
+ <a id="company-recurring-invoices-update"></a>
59
+ ### `update(recurringInvoiceId, body)`
60
+
61
+ Update a recurring invoice. Only the fields present in `body` change.
62
+
63
+ - **HTTP:** `PATCH /v1/companies/{company_id}/recurring-invoices/{recurring_invoice_id}` · operation `patchCompanyRecurringInvoice` · scopes `invoices:write` · accepts `Idempotency-Key`
64
+ - **Parameters:**
65
+ - `recurringInvoiceId: string` — Recurring invoice UUID.
66
+ - `body: operations['patchCompanyRecurringInvoice']['requestBody']['content']['application/json']` — Fields to change.
67
+ - **Returns:** The updated recurring invoice. Response `200` `data`: `RecurringInvoiceResponse`.
68
+ - **Throws:** `400`/`500` `BeeLApiError` · `401`/`403` `BeeLAuthError` · `404` `BeeLNotFoundError` · `409` `BeeLConflictError` · `422` `BeeLValidationError` · `429` `BeeLRateLimitError`
69
+
70
+ <a id="company-recurring-invoices-delete"></a>
71
+ ### `delete(recurringInvoiceId)`
72
+
73
+ Delete a recurring invoice and cancel its pending generations. Invoices it already
74
+ generated are kept.
75
+
76
+ - **HTTP:** `DELETE /v1/companies/{company_id}/recurring-invoices/{recurring_invoice_id}` · operation `deleteCompanyRecurringInvoice` · scopes `invoices:write`
77
+ - **Parameters:**
78
+ - `recurringInvoiceId: string` — Recurring invoice UUID.
79
+ - **Throws:** `401`/`403` `BeeLAuthError` · `404` `BeeLNotFoundError` · `429` `BeeLRateLimitError` · `500` `BeeLApiError`
80
+
81
+ <a id="company-recurring-invoices-set-status"></a>
82
+ ### `setStatus(recurringInvoiceId, body)`
83
+
84
+ Pause, resume or end the template.
85
+
86
+ - **HTTP:** `PUT /v1/companies/{company_id}/recurring-invoices/{recurring_invoice_id}/status` · operation `setCompanyRecurringInvoiceStatus` · scopes `invoices:write` · accepts `Idempotency-Key`
87
+ - **Parameters:**
88
+ - `recurringInvoiceId: string` — Recurring invoice UUID.
89
+ - `body: operations['setCompanyRecurringInvoiceStatus']['requestBody']['content']['application/json']` — Target `status` (e.g. `PAUSED`, `ACTIVE`).
90
+ - **Returns:** The updated recurring invoice. Response `200` `data`: `RecurringInvoiceResponse`.
91
+ - **Throws:** `400`/`500` `BeeLApiError` · `401`/`403` `BeeLAuthError` · `404` `BeeLNotFoundError` · `422` `BeeLValidationError` · `429` `BeeLRateLimitError`
92
+
93
+ <a id="company-recurring-invoices-skip"></a>
94
+ ### `skip(recurringInvoiceId)`
95
+
96
+ Skip the next scheduled occurrence.
97
+
98
+ - **HTTP:** `POST /v1/companies/{company_id}/recurring-invoices/{recurring_invoice_id}/skip` · operation `skipCompanyRecurringInvoice` · scopes `invoices:write` · accepts `Idempotency-Key`
99
+ - **Parameters:**
100
+ - `recurringInvoiceId: string` — Recurring invoice UUID.
101
+ - **Returns:** The recurring invoice with its next date moved. Response `200` `data`: `RecurringInvoiceResponse`.
102
+ - **Throws:** `400`/`500` `BeeLApiError` · `401`/`403` `BeeLAuthError` · `404` `BeeLNotFoundError` · `429` `BeeLRateLimitError`
103
+
104
+ <a id="company-recurring-invoices-generate-now"></a>
105
+ ### `generateNow(recurringInvoiceId)`
106
+
107
+ Generate the next invoice now instead of waiting for the schedule.
108
+
109
+ - **HTTP:** `POST /v1/companies/{company_id}/recurring-invoices/{recurring_invoice_id}/generate` · operation `generateCompanyRecurringInvoiceNow` · scopes `invoices:write` · accepts `Idempotency-Key`
110
+ - **Parameters:**
111
+ - `recurringInvoiceId: string` — Recurring invoice UUID.
112
+ - **Returns:** The generated `invoice_id` and the `next_generation` date. Response `201` `data`: `{ invoice_id?: string; next_generation?: string | null }`.
113
+ - **Throws:** `400`/`500` `BeeLApiError` · `401`/`403` `BeeLAuthError` · `404` `BeeLNotFoundError` · `409` `BeeLConflictError` · `422` `BeeLValidationError` · `429` `BeeLRateLimitError`
114
+
115
+ <a id="company-recurring-invoices-next-occurrence"></a>
116
+ ### `nextOccurrence(recurringInvoiceId)`
117
+
118
+ Preview the next invoice the template will generate.
119
+
120
+ - **HTTP:** `GET /v1/companies/{company_id}/recurring-invoices/{recurring_invoice_id}/next-occurrence` · operation `getCompanyRecurringInvoiceNextOccurrence` · scopes `invoices:read`
121
+ - **Parameters:**
122
+ - `recurringInvoiceId: string` — Recurring invoice UUID.
123
+ - **Returns:** The invoice as it would be generated. Response `200` `data`: `NextOccurrence`.
124
+ - **Throws:** `400`/`500` `BeeLApiError` · `401`/`403` `BeeLAuthError` · `404` `BeeLNotFoundError` · `409` `BeeLConflictError` · `422` `BeeLValidationError` · `429` `BeeLRateLimitError`
125
+
126
+ <a id="company-recurring-invoices-history"></a>
127
+ ### `history(recurringInvoiceId, params?)`
128
+
129
+ The generation history of the template: generated, skipped and failed occurrences.
130
+
131
+ - **HTTP:** `GET /v1/companies/{company_id}/recurring-invoices/{recurring_invoice_id}/history` · operation `getCompanyRecurringInvoiceHistory` · scopes `invoices:read`
132
+ - **Parameters:**
133
+ - `recurringInvoiceId: string` — Recurring invoice UUID.
134
+ - `params?: operations['getCompanyRecurringInvoiceHistory']['parameters']['query']` — Pagination.
135
+ - **Returns:** The `history` entries. Response `200` `data`: `{ history: GenerationHistoryResponse[]; pagination: Pagination }`.
136
+ - **Throws:** `400`/`500` `BeeLApiError` · `401`/`403` `BeeLAuthError` · `404` `BeeLNotFoundError` · `422` `BeeLValidationError` · `429` `BeeLRateLimitError`
@@ -0,0 +1,94 @@
1
+ <!-- Generated by `npm run docs:reference` from the SDK source and openapi/public-api.yaml. Do not edit. -->
2
+
3
+ # `beel.company(companyId).series` — `CompanySeriesResource`
4
+
5
+ [Reference index](README.md)
6
+
7
+ Invoice series (numbering) of one company. Each series numbers one `document_type`.
8
+ Reach it as `beel.company(companyId).series`.
9
+
10
+ ## Methods
11
+
12
+ | Method | HTTP | Summary |
13
+ |---|---|---|
14
+ | [`beel.company(companyId).series.list(params?)`](#company-series-list) | `GET /v1/companies/{company_id}/series` | List the company's series. |
15
+ | [`beel.company(companyId).series.create(body)`](#company-series-create) | `POST /v1/companies/{company_id}/series` | Create a series. |
16
+ | [`beel.company(companyId).series.update(seriesId, body)`](#company-series-update) | `PATCH /v1/companies/{company_id}/series/{series_id}` | Update a series. |
17
+ | [`beel.company(companyId).series.delete(seriesId)`](#company-series-delete) | `DELETE /v1/companies/{company_id}/series/{series_id}` | Delete (soft-delete) a series. |
18
+ | [`beel.company(companyId).series.getDefaults()`](#company-series-get-defaults) | `GET /v1/companies/{company_id}/series/defaults` | The current default series per document type. |
19
+ | [`beel.company(companyId).series.ensureDefaults()`](#company-series-ensure-defaults) | `PUT /v1/companies/{company_id}/series/defaults` | Ensure a default series exists per document type, creating the missing ones. |
20
+ | [`beel.company(companyId).series.setDefault(seriesId)`](#company-series-set-default) | `PUT /v1/companies/{company_id}/series/{series_id}/default` | Mark a series as the default for its document type. |
21
+
22
+ <a id="company-series-list"></a>
23
+ ### `list(params?)`
24
+
25
+ List the company's series.
26
+
27
+ - **HTTP:** `GET /v1/companies/{company_id}/series` · operation `listCompanySeries` · scopes `series:read`
28
+ - **Parameters:**
29
+ - `params?: operations['listCompanySeries']['parameters']['query']` — Filters; `page`/`limit` to paginate.
30
+ - **Returns:** The `series`, and `pagination` when you paginated. Response `200` `data`: `{ series: InvoiceSeries[]; pagination?: Pagination }`.
31
+ - **Throws:** `400`/`500` `BeeLApiError` · `401`/`403` `BeeLAuthError` · `422` `BeeLValidationError` · `429` `BeeLRateLimitError`
32
+
33
+ <a id="company-series-create"></a>
34
+ ### `create(body)`
35
+
36
+ Create a series.
37
+
38
+ - **HTTP:** `POST /v1/companies/{company_id}/series` · operation `createCompanySeries` · scopes `series:write` · accepts `Idempotency-Key`
39
+ - **Parameters:**
40
+ - `body: operations['createCompanySeries']['requestBody']['content']['application/json']` — Code, name, format and the `document_type` it numbers.
41
+ - **Returns:** The created series. Response `201` `data`: `InvoiceSeries`.
42
+ - **Throws:** `400`/`500` `BeeLApiError` · `401`/`403` `BeeLAuthError` · `409` `BeeLConflictError` · `422` `BeeLValidationError` · `429` `BeeLRateLimitError`
43
+
44
+ <a id="company-series-update"></a>
45
+ ### `update(seriesId, body)`
46
+
47
+ Update a series. Only the fields present in `body` change.
48
+
49
+ - **HTTP:** `PATCH /v1/companies/{company_id}/series/{series_id}` · operation `patchCompanySeries` · scopes `series:write`
50
+ - **Parameters:**
51
+ - `seriesId: string` — Series UUID.
52
+ - `body: operations['patchCompanySeries']['requestBody']['content']['application/json']` — Fields to change.
53
+ - **Returns:** The updated series. Response `200` `data`: `InvoiceSeries`.
54
+ - **Throws:** `400`/`500` `BeeLApiError` · `401`/`403` `BeeLAuthError` · `404` `BeeLNotFoundError` · `409` `BeeLConflictError` · `422` `BeeLValidationError` · `429` `BeeLRateLimitError`
55
+
56
+ <a id="company-series-delete"></a>
57
+ ### `delete(seriesId)`
58
+
59
+ Delete (soft-delete) a series. Its code stays taken, since issued invoices carry it.
60
+
61
+ - **HTTP:** `DELETE /v1/companies/{company_id}/series/{series_id}` · operation `deleteCompanySeries` · scopes `series:write`
62
+ - **Parameters:**
63
+ - `seriesId: string` — Series UUID.
64
+ - **Throws:** `400`/`500` `BeeLApiError` · `401`/`403` `BeeLAuthError` · `404` `BeeLNotFoundError` · `429` `BeeLRateLimitError`
65
+
66
+ <a id="company-series-get-defaults"></a>
67
+ ### `getDefaults()`
68
+
69
+ The current default series per document type.
70
+
71
+ - **HTTP:** `GET /v1/companies/{company_id}/series/defaults` · operation `getCompanyDefaultSeries` · scopes `series:read`
72
+ - **Returns:** One entry per document type, saying whether a default exists. Response `200` `data`: `{ defaults: DocumentTypeDefaultStatus[] }`.
73
+ - **Throws:** `400`/`500` `BeeLApiError` · `401`/`403` `BeeLAuthError` · `429` `BeeLRateLimitError`
74
+
75
+ <a id="company-series-ensure-defaults"></a>
76
+ ### `ensureDefaults()`
77
+
78
+ Ensure a default series exists per document type, creating the missing ones.
79
+ Idempotent.
80
+
81
+ - **HTTP:** `PUT /v1/companies/{company_id}/series/defaults` · operation `ensureCompanyDefaultSeries` · scopes `series:write` · accepts `Idempotency-Key`
82
+ - **Returns:** The default series. Response `200` `data`: `{ series: InvoiceSeries[] }`.
83
+ - **Throws:** `401`/`403` `BeeLAuthError` · `429` `BeeLRateLimitError` · `500` `BeeLApiError`
84
+
85
+ <a id="company-series-set-default"></a>
86
+ ### `setDefault(seriesId)`
87
+
88
+ Mark a series as the default for its document type.
89
+
90
+ - **HTTP:** `PUT /v1/companies/{company_id}/series/{series_id}/default` · operation `setCompanyDefaultSeries` · scopes `series:write` · accepts `Idempotency-Key`
91
+ - **Parameters:**
92
+ - `seriesId: string` — Series UUID.
93
+ - **Returns:** The series. Response `200` `data`: `InvoiceSeries`.
94
+ - **Throws:** `400`/`500` `BeeLApiError` · `401`/`403` `BeeLAuthError` · `404` `BeeLNotFoundError` · `409` `BeeLConflictError` · `429` `BeeLRateLimitError`
@@ -0,0 +1,36 @@
1
+ <!-- Generated by `npm run docs:reference` from the SDK source and openapi/public-api.yaml. Do not edit. -->
2
+
3
+ # `beel.company(companyId).taxConfiguration` — `CompanyTaxConfigurationResource`
4
+
5
+ [Reference index](README.md)
6
+
7
+ Tax defaults of one company (main tax, IRPF, equivalence surcharge). The canonical
8
+ replacement for the account-wide `beel.configuration.getTaxConfig()`, whose flat route is
9
+ deprecated. Reach it as `beel.company(companyId).taxConfiguration`.
10
+
11
+ ## Methods
12
+
13
+ | Method | HTTP | Summary |
14
+ |---|---|---|
15
+ | [`beel.company(companyId).taxConfiguration.get()`](#company-tax-configuration-get) | `GET /v1/companies/{company_id}/tax-configuration` | Get the tax configuration. |
16
+ | [`beel.company(companyId).taxConfiguration.update(body)`](#company-tax-configuration-update) | `PUT /v1/companies/{company_id}/tax-configuration` | Replace the tax configuration — this is a `PUT`, not a merge: send the whole state. |
17
+
18
+ <a id="company-tax-configuration-get"></a>
19
+ ### `get()`
20
+
21
+ Get the tax configuration.
22
+
23
+ - **HTTP:** `GET /v1/companies/{company_id}/tax-configuration` · operation `getCompanyTaxConfiguration` · scopes `configuration:read`
24
+ - **Returns:** The company's tax defaults. Response `200` `data`: `TaxConfiguration`.
25
+ - **Throws:** `400`/`500` `BeeLApiError` · `401`/`403` `BeeLAuthError` · `429` `BeeLRateLimitError`
26
+
27
+ <a id="company-tax-configuration-update"></a>
28
+ ### `update(body)`
29
+
30
+ Replace the tax configuration — this is a `PUT`, not a merge: send the whole state.
31
+
32
+ - **HTTP:** `PUT /v1/companies/{company_id}/tax-configuration` · operation `updateCompanyTaxConfiguration` · scopes `configuration:write`
33
+ - **Parameters:**
34
+ - `body: components['schemas']['UpdateTaxConfigurationRequest']` — The complete tax configuration.
35
+ - **Returns:** The stored configuration. Response `200` `data`: `TaxConfiguration`.
36
+ - **Throws:** `400`/`500` `BeeLApiError` · `401`/`403` `BeeLAuthError` · `422` `BeeLValidationError` · `429` `BeeLRateLimitError`
@@ -0,0 +1,41 @@
1
+ <!-- Generated by `npm run docs:reference` from the SDK source and openapi/public-api.yaml. Do not edit. -->
2
+
3
+ # `beel.company(companyId).verifactuConfiguration` — `CompanyVeriFactuConfigurationResource`
4
+
5
+ [Reference index](README.md)
6
+
7
+ VeriFactu configuration of one company. The canonical replacement for
8
+ `beel.configuration.getVerifactu()`, whose flat route is deprecated. Reach it as
9
+ `beel.company(companyId).verifactuConfiguration`.
10
+
11
+ Whether an invoice reaches AEAT is a fact of this NIF resolved at issue time, not a
12
+ per-invoice choice: `enabled` is the only writable field. Everything else — `status`,
13
+ `nif_status`, `signed`, `activated`, `pdf_generated` — is resolved server-side. The
14
+ outcome of each invoice is on the invoice itself: `invoice.verifactu.submission_status`.
15
+
16
+ ## Methods
17
+
18
+ | Method | HTTP | Summary |
19
+ |---|---|---|
20
+ | [`beel.company(companyId).verifactuConfiguration.get()`](#company-verifactu-configuration-get) | `GET /v1/companies/{company_id}/verifactu-configuration` | Get the VeriFactu configuration of this NIF. |
21
+ | [`beel.company(companyId).verifactuConfiguration.update(body)`](#company-verifactu-configuration-update) | `PUT /v1/companies/{company_id}/verifactu-configuration` | Turn VeriFactu on or off for this NIF. |
22
+
23
+ <a id="company-verifactu-configuration-get"></a>
24
+ ### `get()`
25
+
26
+ Get the VeriFactu configuration of this NIF.
27
+
28
+ - **HTTP:** `GET /v1/companies/{company_id}/verifactu-configuration` · operation `getCompanyVeriFactuConfiguration` · scopes `configuration:read`
29
+ - **Returns:** `enabled` and the server-resolved state of the NIF. Response `200` `data`: `VeriFactuConfiguration`.
30
+ - **Throws:** `400`/`500` `BeeLApiError` · `401`/`403` `BeeLAuthError` · `429` `BeeLRateLimitError`
31
+
32
+ <a id="company-verifactu-configuration-update"></a>
33
+ ### `update(body)`
34
+
35
+ Turn VeriFactu on or off for this NIF. `enabled` is the only field you can write.
36
+
37
+ - **HTTP:** `PUT /v1/companies/{company_id}/verifactu-configuration` · operation `updateCompanyVeriFactuConfiguration` · scopes `configuration:write`
38
+ - **Parameters:**
39
+ - `body: components['schemas']['UpdateVeriFactuConfigurationRequest']` — `{ enabled }`.
40
+ - **Returns:** The updated configuration. Response `200` `data`: `VeriFactuConfiguration`.
41
+ - **Throws:** `400`/`500` `BeeLApiError` · `401`/`403` `BeeLAuthError` · `422` `BeeLValidationError` · `429` `BeeLRateLimitError`
@@ -0,0 +1,94 @@
1
+ <!-- Generated by `npm run docs:reference` from the SDK source and openapi/public-api.yaml. Do not edit. -->
2
+
3
+ # `beel.company(companyId)` — `CompanyScope`
4
+
5
+ [Reference index](README.md)
6
+
7
+ Operations scoped to a single company (NIF). This is the explicit multi-NIF surface:
8
+ the company is addressed in the path, so no session focus or `BeeL-Active-Company`
9
+ header is needed. Get one with `beel.company(companyId)`; list the ids with
10
+ `beel.account(accountId).companies.list()`.
11
+
12
+ Every method rejects with a `BeeLApiError` subclass when the API answers non-2xx.
13
+
14
+ **Example**
15
+
16
+ ```typescript
17
+ const company = beel.company('company-uuid');
18
+ const invoice = await company.invoices.create({ ... });
19
+ await company.invoices.issue(invoice.id);
20
+ ```
21
+
22
+ ## Properties
23
+
24
+ | Property | Type | Description |
25
+ |---|---|---|
26
+ | `invoices` | [`CompanyInvoicesResource`](company-invoices.md) | Invoices of this company: create, issue, void, correct, list, PDF, email. |
27
+ | `customers` | [`CompanyCustomersResource`](company-customers.md) | Customers of this company. |
28
+ | `products` | [`CompanyProductsResource`](company-products.md) | Products and services of this company. |
29
+ | `series` | [`CompanySeriesResource`](company-series.md) | Invoice series (numbering) of this company. |
30
+ | `recurringInvoices` | [`CompanyRecurringInvoicesResource`](company-recurring-invoices.md) | Recurring invoice templates of this company. |
31
+ | `paymentConnections` | [`CompanyPaymentConnectionsResource`](company-payment-connections.md) | Payment provider connections (Stripe) that auto-generate invoices under this NIF. |
32
+ | `taxConfiguration` | [`CompanyTaxConfigurationResource`](company-tax-configuration.md) | Default taxes of this company. |
33
+ | `verifactuConfiguration` | [`CompanyVeriFactuConfigurationResource`](company-verifactu-configuration.md) | Whether this NIF submits its invoices to AEAT under VeriFactu. |
34
+
35
+ ## Methods
36
+
37
+ | Method | HTTP | Summary |
38
+ |---|---|---|
39
+ | [`beel.company(companyId).get(params?)`](#company-get) | `GET /v1/companies/{company_id}` | Get the company: its fiscal identity, address and settings. |
40
+ | [`beel.company(companyId).update(body)`](#company-update) | `PATCH /v1/companies/{company_id}` | Update the company's data. |
41
+ | [`beel.company(companyId).delete()`](#company-delete) | `DELETE /v1/companies/{company_id}` | Remove the company from its account. |
42
+ | [`beel.company(companyId).fiscalSummary(params?)`](#company-fiscal-summary) | `GET /v1/companies/{company_id}/fiscal-summary` | Fiscal summary of the company for a period: taxable base, VAT and IRPF aggregates. |
43
+ | [`beel.company(companyId).issuingReadiness()`](#company-issuing-readiness) | `GET /v1/companies/{company_id}/issuing-readiness` | Whether the company can issue invoices now, and what blocks it if not. |
44
+
45
+ <a id="company-get"></a>
46
+ ### `get(params?)`
47
+
48
+ Get the company: its fiscal identity, address and settings.
49
+
50
+ - **HTTP:** `GET /v1/companies/{company_id}` · operation `getCompanyById` · scopes `companies:read`
51
+ - **Parameters:**
52
+ - `params?: operations['getCompanyById']['parameters']['query']` — Optional query of `getCompanyById` (e.g. `include`).
53
+ - **Returns:** The company. Response `200` `data`: `CompanyData`.
54
+ - **Throws:** `400`/`500` `BeeLApiError` · `401`/`403` `BeeLAuthError` · `429` `BeeLRateLimitError`
55
+
56
+ <a id="company-update"></a>
57
+ ### `update(body)`
58
+
59
+ Update the company's data. Only the fields present in `body` change.
60
+
61
+ - **HTTP:** `PATCH /v1/companies/{company_id}` · operation `patchCompanyById` · scopes `companies:write`
62
+ - **Parameters:**
63
+ - `body: components['schemas']['UpdateCompanyRequest']` — Fields to change.
64
+ - **Returns:** The updated company. Response `200` `data`: `CompanyData`.
65
+ - **Throws:** `401`/`403` `BeeLAuthError` · `422` `BeeLValidationError` · `429` `BeeLRateLimitError` · `500` `BeeLApiError`
66
+
67
+ <a id="company-delete"></a>
68
+ ### `delete()`
69
+
70
+ Remove the company from its account. Blocked for the primary NIF, a NIF active in Live,
71
+ or one holding Live invoices.
72
+
73
+ - **HTTP:** `DELETE /v1/companies/{company_id}` · operation `deleteCompanyById` · scopes `companies:write`
74
+ - **Throws:** `400`/`500` `BeeLApiError` · `401`/`403` `BeeLAuthError` · `409` `BeeLConflictError` · `429` `BeeLRateLimitError`
75
+
76
+ <a id="company-fiscal-summary"></a>
77
+ ### `fiscalSummary(params?)`
78
+
79
+ Fiscal summary of the company for a period: taxable base, VAT and IRPF aggregates.
80
+
81
+ - **HTTP:** `GET /v1/companies/{company_id}/fiscal-summary` · operation `getCompanyFiscalSummary` · scopes `invoices:read`
82
+ - **Parameters:**
83
+ - `params?: operations['getCompanyFiscalSummary']['parameters']['query']` — `start_date` and `end_date` (both or neither; default: the current month).
84
+ - **Returns:** The aggregates of the period. Response `200` `data`: `FiscalSummaryResponse`.
85
+ - **Throws:** `400`/`500` `BeeLApiError` · `401`/`403` `BeeLAuthError` · `429` `BeeLRateLimitError`
86
+
87
+ <a id="company-issuing-readiness"></a>
88
+ ### `issuingReadiness()`
89
+
90
+ Whether the company can issue invoices now, and what blocks it if not.
91
+
92
+ - **HTTP:** `GET /v1/companies/{company_id}/issuing-readiness` · operation `getCompanyIssuingReadiness` · scopes `companies:read`
93
+ - **Returns:** `ready` plus the list of `blockers`. Response `200` `data`: `IssuingReadinessData`.
94
+ - **Throws:** `400`/`500` `BeeLApiError` · `401`/`403` `BeeLAuthError` · `429` `BeeLRateLimitError`
@@ -0,0 +1,90 @@
1
+ <!-- Generated by `npm run docs:reference` from the SDK source and openapi/public-api.yaml. Do not edit. -->
2
+
3
+ # `beel.configuration` — `ConfigurationResource`
4
+
5
+ [Reference index](README.md)
6
+
7
+ > **Deprecated.** The contract deprecates these routes. Use `beel.company(companyId).taxConfiguration`, `beel.company(companyId).verifactuConfiguration` and `CatalogsResource` (`beel.catalogs`) instead.
8
+
9
+ Account-wide configuration on the flat `/v1/configuration/*` routes.
10
+
11
+ ## Methods
12
+
13
+ | Method | HTTP | Summary |
14
+ |---|---|---|
15
+ | [`beel.configuration.getTaxConfig()`](#configuration-get-tax-config) | `GET /v1/configuration/taxes` | Get the tax configuration (default VAT, IRPF…) of the focused company. |
16
+ | [`beel.configuration.updateTaxConfig(body)`](#configuration-update-tax-config) | `PUT /v1/configuration/taxes` | Replace the tax configuration of the focused company. |
17
+ | [`beel.configuration.getTaxTypes()`](#configuration-get-tax-types) | `GET /v1/configuration/tax-types` | Tax types the API accepts (IVA/IGIC rates, IRPF types, equivalence surcharges). |
18
+ | [`beel.configuration.getInvoiceCustomizationOptions()`](#configuration-get-invoice-customization-options) | `GET /v1/configuration/invoice-customization-options` | Invoice customization options (templates, colors…). |
19
+ | [`beel.configuration.updateLanguage(language)`](#configuration-update-language) | `PUT /v1/configuration/language` | Update the preferred language of the signed-in person. |
20
+ | [`beel.configuration.getVerifactu()`](#configuration-get-verifactu) | `GET /v1/configuration/verifactu` | Get the VeriFactu configuration of the focused company. |
21
+ | [`beel.configuration.updateVerifactu(body)`](#configuration-update-verifactu) | `PUT /v1/configuration/verifactu` | Update the VeriFactu configuration of the focused company. |
22
+
23
+ <a id="configuration-get-tax-config"></a>
24
+ ### `getTaxConfig()`
25
+
26
+ Get the tax configuration (default VAT, IRPF…) of the focused company.
27
+
28
+ - **HTTP:** `GET /v1/configuration/taxes` · operation `getTaxConfiguration` · scopes `configuration:read` · **deprecated in the contract**
29
+ - **Returns:** The tax configuration. Response `200` `data`: `TaxConfiguration`.
30
+ - **Throws:** `401`/`403` `BeeLAuthError` · `500` `BeeLApiError`
31
+
32
+ <a id="configuration-update-tax-config"></a>
33
+ ### `updateTaxConfig(body)`
34
+
35
+ Replace the tax configuration of the focused company.
36
+
37
+ - **HTTP:** `PUT /v1/configuration/taxes` · operation `updateTaxConfiguration` · scopes `configuration:write` · **deprecated in the contract**
38
+ - **Parameters:**
39
+ - `body: any` — The complete tax configuration.
40
+ - **Returns:** The stored configuration. Response `200` `data`: `TaxConfiguration`.
41
+ - **Throws:** `400`/`500` `BeeLApiError` · `401`/`403` `BeeLAuthError` · `422` `BeeLValidationError`
42
+
43
+ <a id="configuration-get-tax-types"></a>
44
+ ### `getTaxTypes()`
45
+
46
+ Tax types the API accepts (IVA/IGIC rates, IRPF types, equivalence surcharges).
47
+
48
+ - **HTTP:** `GET /v1/configuration/tax-types` · operation `getTaxTypes` · scopes `configuration:read` · **deprecated in the contract**
49
+ - **Returns:** The tax types catalog. Response `200` `data`: `TaxTypesCatalog`.
50
+ - **Throws:** `401`/`403` `BeeLAuthError` · `500` `BeeLApiError`
51
+
52
+ <a id="configuration-get-invoice-customization-options"></a>
53
+ ### `getInvoiceCustomizationOptions()`
54
+
55
+ Invoice customization options (templates, colors…).
56
+
57
+ - **HTTP:** `GET /v1/configuration/invoice-customization-options` · operation `getInvoiceCustomizationOptions` · scopes `configuration:read` · **deprecated in the contract**
58
+ - **Returns:** The customization options. Response `200` `data`: `InvoiceCustomizationOptionsResponse`.
59
+ - **Throws:** `401`/`403` `BeeLAuthError` · `500` `BeeLApiError`
60
+
61
+ <a id="configuration-update-language"></a>
62
+ ### `updateLanguage(language)`
63
+
64
+ Update the preferred language of the signed-in person.
65
+
66
+ - **HTTP:** `PUT /v1/configuration/language` · operation `updateLanguage` · scopes `configuration:write` · **deprecated in the contract**
67
+ - **Parameters:**
68
+ - `language: string` — `es`, `en` or `ca`.
69
+ - **Returns:** The updated preferences. Response `200` `data`: `{ language?: Language }`.
70
+ - **Throws:** `400`/`500` `BeeLApiError` · `401`/`403` `BeeLAuthError` · `422` `BeeLValidationError`
71
+
72
+ <a id="configuration-get-verifactu"></a>
73
+ ### `getVerifactu()`
74
+
75
+ Get the VeriFactu configuration of the focused company.
76
+
77
+ - **HTTP:** `GET /v1/configuration/verifactu` · operation `getVeriFactuConfiguration` · scopes `configuration:read` · **deprecated in the contract**
78
+ - **Returns:** The VeriFactu configuration. Response `200` `data`: `VeriFactuConfiguration`.
79
+ - **Throws:** `401`/`403` `BeeLAuthError` · `500` `BeeLApiError`
80
+
81
+ <a id="configuration-update-verifactu"></a>
82
+ ### `updateVerifactu(body)`
83
+
84
+ Update the VeriFactu configuration of the focused company.
85
+
86
+ - **HTTP:** `PUT /v1/configuration/verifactu` · operation `updateVeriFactuConfiguration` · scopes `configuration:write` · **deprecated in the contract**
87
+ - **Parameters:**
88
+ - `body: any` — `{ enabled }`.
89
+ - **Returns:** The updated configuration. Response `200` `data`: `VeriFactuConfiguration`.
90
+ - **Throws:** `400`/`500` `BeeLApiError` · `401`/`403` `BeeLAuthError` · `422` `BeeLValidationError`
@@ -0,0 +1,107 @@
1
+ <!-- Generated by `npm run docs:reference` from the SDK source and openapi/public-api.yaml. Do not edit. -->
2
+
3
+ # `CustomerBuilder`
4
+
5
+ [Reference index](README.md)
6
+
7
+ Fluent builder for the body of `customers.create`. It builds the request object only;
8
+ send it with `beel.company(companyId).customers.create(builder.build())`.
9
+
10
+ **Example**
11
+
12
+ ```typescript
13
+ const customer = CustomerBuilder.create()
14
+ .name('Acme Corporation SL')
15
+ .nif('B12345678')
16
+ .email('contact@acme.com')
17
+ .address('Calle Mayor', '1', '28001', 'Madrid', 'Madrid', 'Spain')
18
+ .build();
19
+ ```
20
+
21
+ ## Methods
22
+
23
+ | Method | HTTP | Summary |
24
+ |---|---|---|
25
+ | [`CustomerBuilder.create()`](#customer-builder-create) | — | Start a new builder. |
26
+ | [`CustomerBuilder.name(name)`](#customer-builder-name) | — | Legal name of the customer. |
27
+ | [`CustomerBuilder.nif(nif)`](#customer-builder-nif) | — | NIF/CIF of the customer. |
28
+ | [`CustomerBuilder.email(email)`](#customer-builder-email) | — | Contact email. |
29
+ | [`CustomerBuilder.phone(phone)`](#customer-builder-phone) | — | Contact phone: 9 to 20 characters of digits, spaces, dashes, parentheses and a leading `+`. |
30
+ | [`CustomerBuilder.address(street, number, postalCode, city, province, country, countryCode?)`](#customer-builder-address) | — | Fiscal address. |
31
+ | [`CustomerBuilder.notes(notes)`](#customer-builder-notes) | — | Internal notes about the customer. |
32
+ | [`CustomerBuilder.build()`](#customer-builder-build) | — | Build the request body. |
33
+
34
+ <a id="customer-builder-create"></a>
35
+ ### `create()`
36
+
37
+ Start a new builder.
38
+
39
+ - **Returns:** An empty customer builder.
40
+
41
+ <a id="customer-builder-name"></a>
42
+ ### `name(name)`
43
+
44
+ Legal name of the customer. Required.
45
+
46
+ - **Parameters:**
47
+ - `name: string` — Legal name.
48
+ - **Returns:** This builder.
49
+
50
+ <a id="customer-builder-nif"></a>
51
+ ### `nif(nif)`
52
+
53
+ NIF/CIF of the customer. Required.
54
+
55
+ - **Parameters:**
56
+ - `nif: string` — Spanish tax id.
57
+ - **Returns:** This builder.
58
+
59
+ <a id="customer-builder-email"></a>
60
+ ### `email(email)`
61
+
62
+ Contact email.
63
+
64
+ - **Parameters:**
65
+ - `email: string` — Email address.
66
+ - **Returns:** This builder.
67
+
68
+ <a id="customer-builder-phone"></a>
69
+ ### `phone(phone)`
70
+
71
+ Contact phone: 9 to 20 characters of digits, spaces, dashes, parentheses and a leading `+`.
72
+
73
+ - **Parameters:**
74
+ - `phone: string` — Phone number.
75
+ - **Returns:** This builder.
76
+
77
+ <a id="customer-builder-address"></a>
78
+ ### `address(street, number, postalCode, city, province, country, countryCode?)`
79
+
80
+ Fiscal address. Required.
81
+
82
+ - **Parameters:**
83
+ - `street: string` — Street name.
84
+ - `number: string` — Street number.
85
+ - `postalCode: string` — Postal code.
86
+ - `city: string` — City.
87
+ - `province: string` — Province.
88
+ - `country: string` — Country name.
89
+ - `countryCode?: string` — ISO 3166-1 alpha-2 code. Default: `ES`. Default: `'ES'`.
90
+ - **Returns:** This builder.
91
+
92
+ <a id="customer-builder-notes"></a>
93
+ ### `notes(notes)`
94
+
95
+ Internal notes about the customer.
96
+
97
+ - **Parameters:**
98
+ - `notes: string` — Free text.
99
+ - **Returns:** This builder.
100
+
101
+ <a id="customer-builder-build"></a>
102
+ ### `build()`
103
+
104
+ Build the request body.
105
+
106
+ - **Returns:** The `CreateCustomerRequest`.
107
+ - **Throws:** `Error` When the name, NIF or address is missing.