@beel_es/sdk 2.4.0 → 2.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +36 -0
- package/README.md +28 -0
- package/dist/index.d.mts +4592 -1017
- package/dist/index.d.ts +4592 -1017
- package/dist/index.js +194 -0
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +193 -0
- package/dist/index.mjs.map +1 -1
- package/docs/reference/README.md +6 -0
- package/docs/reference/company-invoice-replies.md +122 -0
- package/docs/reference/company-invoices.md +1 -1
- package/docs/reference/company.md +1 -0
- package/docs/reference/invoices.md +1 -1
- package/docs/reference/types.md +19 -1
- package/llms.txt +1 -0
- package/package.json +1 -1
package/docs/reference/README.md
CHANGED
|
@@ -36,6 +36,7 @@ Start with the [README](../../README.md) for setup and common tasks.
|
|
|
36
36
|
| [`CatalogsResource`](catalogs.md) | `beel.catalogs` | Account-wide catalogs, the credential's identity and personal preferences, on their canonical paths. |
|
|
37
37
|
| [`CompanyScope`](company.md) | `beel.company(companyId)` | Operations scoped to a single company (NIF). |
|
|
38
38
|
| [`CompanyCustomersResource`](company-customers.md) | `beel.company(companyId).customers` | Customers of one company. |
|
|
39
|
+
| [`CompanyInvoiceRepliesResource`](company-invoice-replies.md) | `beel.company(companyId).invoiceReplies` | Replies of the customers of a company about its invoices, on any channel. |
|
|
39
40
|
| [`CompanyInvoicesResource`](company-invoices.md) | `beel.company(companyId).invoices` | Invoice lifecycle of one company: create a draft (or issue it directly), issue, void, correct, list and read, PDF and email. |
|
|
40
41
|
| [`CompanyInvoiceScheduleResource`](company-invoices-schedule.md) | `beel.company(companyId).invoices.schedule` | Scheduled issuing of one invoice: read it, set it, clear it. |
|
|
41
42
|
| [`CompanyPaymentConnectionsResource`](company-payment-connections.md) | `beel.company(companyId).paymentConnections` | Payment connections of a company (NIF): the Stripe Connect link whose charges auto-generate invoices under that NIF. |
|
|
@@ -112,6 +113,11 @@ Start with the [README](../../README.md) for setup and common tasks.
|
|
|
112
113
|
| [`beel.company(companyId).customers.get(customerId)`](company-customers.md#company-customers-get) | `GET /v1/companies/{company_id}/customers/{customer_id}` | Get one customer. |
|
|
113
114
|
| [`beel.company(companyId).customers.update(customerId, body)`](company-customers.md#company-customers-update) | `PATCH /v1/companies/{company_id}/customers/{customer_id}` | Update a customer. |
|
|
114
115
|
| [`beel.company(companyId).customers.delete(customerId)`](company-customers.md#company-customers-delete) | `DELETE /v1/companies/{company_id}/customers/{customer_id}` | Delete a customer that has no invoices. |
|
|
116
|
+
| [`beel.company(companyId).invoiceReplies.list(params?, options?)`](company-invoice-replies.md#company-invoice-replies-list) | `GET /v1/companies/{company_id}/invoice-replies` | List the replies of the company, most recent first, with masked `excerpt`, `subject` and sender. |
|
|
117
|
+
| [`beel.company(companyId).invoiceReplies.create(body, options?)`](company-invoice-replies.md#company-invoice-replies-create) | `POST /v1/companies/{company_id}/invoice-replies` | Register a message that a customer sent you on a channel of your own about an invoice. |
|
|
118
|
+
| [`beel.company(companyId).invoiceReplies.get(replyId, options?)`](company-invoice-replies.md#company-invoice-replies-get) | `GET /v1/companies/{company_id}/invoice-replies/{reply_id}` | Get one reply with its full text and the file names of its attachments. |
|
|
119
|
+
| [`beel.company(companyId).invoiceReplies.delete(replyId, options?)`](company-invoice-replies.md#company-invoice-replies-delete) | `DELETE /v1/companies/{company_id}/invoice-replies/{reply_id}` | Delete a reply: its content is erased. |
|
|
120
|
+
| [`beel.company(companyId).invoiceReplies.getAttachment(replyId, attachmentId, options?)`](company-invoice-replies.md#company-invoice-replies-get-attachment) | `GET /v1/companies/{company_id}/invoice-replies/{reply_id}/attachments/{attachment_id}` | Get an attachment of a reply with a temporary `download_url` for its file. |
|
|
115
121
|
| [`beel.company(companyId).invoices.derive(body, options?)`](company-invoices.md#company-invoices-derive) | `POST /v1/companies/{company_id}/invoices/derivations` | Derive a new draft invoice from an existing one — the canonical form of `duplicate`. |
|
|
116
122
|
| [`beel.company(companyId).invoices.list(params?, options?)`](company-invoices.md#company-invoices-list) | `GET /v1/companies/{company_id}/invoices` | List the company's invoices, paginated, with filters: status, type, customer, dates, `external_ref` (exact match), VeriFactu status and more. |
|
|
117
123
|
| [`beel.company(companyId).invoices.create(body, params?, options?)`](company-invoices.md#company-invoices-create) | `POST /v1/companies/{company_id}/invoices` | Create an invoice: a `DRAFT` by default, or numbered and issued in the same call with `options.issue_directly: true`. |
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
<!-- Generated by `npm run docs:reference` from the SDK source and openapi/public-api.yaml. Do not edit. -->
|
|
2
|
+
|
|
3
|
+
# `beel.company(companyId).invoiceReplies` — `CompanyInvoiceRepliesResource`
|
|
4
|
+
|
|
5
|
+
[Reference index](README.md)
|
|
6
|
+
|
|
7
|
+
Replies of the customers of a company about its invoices, on any channel. Reach it as
|
|
8
|
+
`beel.company(companyId).invoiceReplies`.
|
|
9
|
+
|
|
10
|
+
The list masks personal data; `get` returns the full text. An attachment is read
|
|
11
|
+
with `getAttachment`, which returns a temporary download link for its file.
|
|
12
|
+
|
|
13
|
+
**Example**
|
|
14
|
+
|
|
15
|
+
```typescript
|
|
16
|
+
const replies = beel.company('company-uuid').invoiceReplies;
|
|
17
|
+
const { replies: page } = await replies.list({ invoice_id: 'invoice-uuid' });
|
|
18
|
+
const reply = await replies.get(page[0].id);
|
|
19
|
+
const attachment = await replies.getAttachment(reply.id, reply.attachments![0].id);
|
|
20
|
+
if (attachment.download_url) console.log(attachment.download_url);
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
## Methods
|
|
24
|
+
|
|
25
|
+
| Method | HTTP | Summary |
|
|
26
|
+
|---|---|---|
|
|
27
|
+
| [`beel.company(companyId).invoiceReplies.list(params?, options?)`](#company-invoice-replies-list) | `GET /v1/companies/{company_id}/invoice-replies` | List the replies of the company, most recent first, with masked `excerpt`, `subject` and sender. |
|
|
28
|
+
| [`beel.company(companyId).invoiceReplies.create(body, options?)`](#company-invoice-replies-create) | `POST /v1/companies/{company_id}/invoice-replies` | Register a message that a customer sent you on a channel of your own about an invoice. |
|
|
29
|
+
| [`beel.company(companyId).invoiceReplies.get(replyId, options?)`](#company-invoice-replies-get) | `GET /v1/companies/{company_id}/invoice-replies/{reply_id}` | Get one reply with its full text and the file names of its attachments. |
|
|
30
|
+
| [`beel.company(companyId).invoiceReplies.delete(replyId, options?)`](#company-invoice-replies-delete) | `DELETE /v1/companies/{company_id}/invoice-replies/{reply_id}` | Delete a reply: its content is erased. |
|
|
31
|
+
| [`beel.company(companyId).invoiceReplies.getAttachment(replyId, attachmentId, options?)`](#company-invoice-replies-get-attachment) | `GET /v1/companies/{company_id}/invoice-replies/{reply_id}/attachments/{attachment_id}` | Get an attachment of a reply with a temporary `download_url` for its file. |
|
|
32
|
+
|
|
33
|
+
<a id="company-invoice-replies-list"></a>
|
|
34
|
+
### `list(params?, options?)`
|
|
35
|
+
|
|
36
|
+
List the replies of the company, most recent first, with masked `excerpt`, `subject`
|
|
37
|
+
and sender.
|
|
38
|
+
|
|
39
|
+
- **HTTP:** `GET /v1/companies/{company_id}/invoice-replies` · operation `listCompanyInvoiceReplies` · scopes `invoice-replies:read`
|
|
40
|
+
- **Parameters:**
|
|
41
|
+
- `params?: operations['listCompanyInvoiceReplies']['parameters']['query']` — Filters (`invoice_id`, `customer_id`, `channel`, `from`, `to`…) and pagination.
|
|
42
|
+
- `options?: RequestOptions` — Per-call `idempotencyKey`, `signal` and `timeoutMs`. See [`RequestOptions`](types.md#requestoptions).
|
|
43
|
+
- **Returns:** The page of `replies` and its `pagination`. Response `200` `data`: `{ replies: InvoiceReplySummary[]; pagination: Pagination }`.
|
|
44
|
+
- **Throws:** `400`/`500` `BeeLApiError` · `401`/`403` `BeeLAuthError` · `422` `BeeLValidationError` · `429` `BeeLRateLimitError`
|
|
45
|
+
|
|
46
|
+
**Example**
|
|
47
|
+
|
|
48
|
+
```typescript
|
|
49
|
+
const { replies } = await company.invoiceReplies.list({ invoice_id: 'invoice-uuid' });
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
<a id="company-invoice-replies-create"></a>
|
|
53
|
+
### `create(body, options?)`
|
|
54
|
+
|
|
55
|
+
Register a message that a customer sent you on a channel of your own about an invoice.
|
|
56
|
+
|
|
57
|
+
- **HTTP:** `POST /v1/companies/{company_id}/invoice-replies` · operation `createCompanyInvoiceReply` · scopes `invoice-replies:write` · accepts `Idempotency-Key`
|
|
58
|
+
- **Parameters:**
|
|
59
|
+
- `body: components['schemas']['CreateInvoiceReplyRequest']` — The invoice, `channel`, `external_id`, sender and the text or attachments.
|
|
60
|
+
- `options?: RequestOptions` — Per-call `idempotencyKey`, `signal` and `timeoutMs`. See [`RequestOptions`](types.md#requestoptions).
|
|
61
|
+
- **Returns:** The registered reply. Response `201` `data`: `InvoiceReply`.
|
|
62
|
+
- **Throws:** `400`/`500` `BeeLApiError` · `401`/`403` `BeeLAuthError` · `404` `BeeLNotFoundError` · `409` `BeeLConflictError` · `422` `BeeLValidationError` · `429` `BeeLRateLimitError`
|
|
63
|
+
|
|
64
|
+
**Example**
|
|
65
|
+
|
|
66
|
+
```typescript
|
|
67
|
+
await company.invoiceReplies.create({
|
|
68
|
+
invoice_id: 'invoice-uuid',
|
|
69
|
+
channel: 'WHATSAPP',
|
|
70
|
+
external_id: 'wamid.EXAMPLE0001',
|
|
71
|
+
sender: { address: '+34600123456' },
|
|
72
|
+
text: 'Can you send it to Distribuciones Ejemplo S.L.?',
|
|
73
|
+
});
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
<a id="company-invoice-replies-get"></a>
|
|
77
|
+
### `get(replyId, options?)`
|
|
78
|
+
|
|
79
|
+
Get one reply with its full text and the file names of its attachments.
|
|
80
|
+
|
|
81
|
+
- **HTTP:** `GET /v1/companies/{company_id}/invoice-replies/{reply_id}` · operation `getCompanyInvoiceReply` · scopes `invoice-replies:read`
|
|
82
|
+
- **Parameters:**
|
|
83
|
+
- `replyId: string` — Reply UUID, from `list`.
|
|
84
|
+
- `options?: RequestOptions` — Per-call `idempotencyKey`, `signal` and `timeoutMs`. See [`RequestOptions`](types.md#requestoptions).
|
|
85
|
+
- **Returns:** The reply. Response `200` `data`: `InvoiceReply`.
|
|
86
|
+
- **Throws:** `401`/`403` `BeeLAuthError` · `404` `BeeLNotFoundError` · `429` `BeeLRateLimitError` · `500` `BeeLApiError`
|
|
87
|
+
|
|
88
|
+
<a id="company-invoice-replies-delete"></a>
|
|
89
|
+
### `delete(replyId, options?)`
|
|
90
|
+
|
|
91
|
+
Delete a reply: its content is erased. Deleting it again also succeeds.
|
|
92
|
+
|
|
93
|
+
- **HTTP:** `DELETE /v1/companies/{company_id}/invoice-replies/{reply_id}` · operation `deleteCompanyInvoiceReply` · scopes `invoice-replies:write`
|
|
94
|
+
- **Parameters:**
|
|
95
|
+
- `replyId: string` — Reply UUID.
|
|
96
|
+
- `options?: RequestOptions` — Per-call `idempotencyKey`, `signal` and `timeoutMs`. See [`RequestOptions`](types.md#requestoptions).
|
|
97
|
+
- **Returns:** `Promise<void>`
|
|
98
|
+
- **Throws:** `401`/`403` `BeeLAuthError` · `404` `BeeLNotFoundError` · `429` `BeeLRateLimitError` · `500` `BeeLApiError`
|
|
99
|
+
|
|
100
|
+
<a id="company-invoice-replies-get-attachment"></a>
|
|
101
|
+
### `getAttachment(replyId, attachmentId, options?)`
|
|
102
|
+
|
|
103
|
+
Get an attachment of a reply with a temporary `download_url` for its file. The link is
|
|
104
|
+
requested on each call and expires at `download_url_expires_at`: call again for a fresh
|
|
105
|
+
one rather than storing it. Both are `null` when there is no file to download.
|
|
106
|
+
|
|
107
|
+
- **HTTP:** `GET /v1/companies/{company_id}/invoice-replies/{reply_id}/attachments/{attachment_id}` · operation `getCompanyInvoiceReplyAttachment` · scopes `invoice-replies:read`
|
|
108
|
+
- **Parameters:**
|
|
109
|
+
- `replyId: string` — Reply UUID.
|
|
110
|
+
- `attachmentId: string` — Attachment UUID, from the `attachments` of the reply.
|
|
111
|
+
- `options?: RequestOptions` — Per-call `idempotencyKey`, `signal` and `timeoutMs`. See [`RequestOptions`](types.md#requestoptions).
|
|
112
|
+
- **Returns:** The attachment, with `download_url` and `download_url_expires_at`. Response `200` `data`: `InvoiceReplyAttachmentDetail`.
|
|
113
|
+
- **Throws:** `401`/`403` `BeeLAuthError` · `404` `BeeLNotFoundError` · `429` `BeeLRateLimitError` · `500`/`502` `BeeLApiError`
|
|
114
|
+
|
|
115
|
+
**Example**
|
|
116
|
+
|
|
117
|
+
```typescript
|
|
118
|
+
const attachment = await company.invoiceReplies.getAttachment(replyId, attachmentId);
|
|
119
|
+
if (attachment.download_url) {
|
|
120
|
+
const file = await fetch(attachment.download_url);
|
|
121
|
+
}
|
|
122
|
+
```
|
|
@@ -300,7 +300,7 @@ Get a short-lived download URL for the invoice PDF.
|
|
|
300
300
|
- `invoiceId: string` — Invoice UUID.
|
|
301
301
|
- `options?: RequestOptions` — Per-call `idempotencyKey`, `signal` and `timeoutMs`. See [`RequestOptions`](types.md#requestoptions).
|
|
302
302
|
- **Returns:** `download_url`, `expires_in_seconds` and `file_name`. Response `200` `data`: `{ download_url: string; expires_in_seconds: number; file_name: string }`.
|
|
303
|
-
- **Throws:** `400`/`500` `BeeLApiError` · `401`/`403` `BeeLAuthError` · `404` `BeeLNotFoundError` · `429` `BeeLRateLimitError`
|
|
303
|
+
- **Throws:** `400`/`500` `BeeLApiError` · `401`/`403` `BeeLAuthError` · `404` `BeeLNotFoundError` · `409` `BeeLConflictError` · `429` `BeeLRateLimitError`
|
|
304
304
|
|
|
305
305
|
<a id="company-invoices-send"></a>
|
|
306
306
|
### `send(invoiceId, body, options?)`
|
|
@@ -29,6 +29,7 @@ await company.invoices.issue(invoice.id);
|
|
|
29
29
|
| `series` | [`CompanySeriesResource`](company-series.md) | Invoice series (numbering) of this company. |
|
|
30
30
|
| `recurringInvoices` | [`CompanyRecurringInvoicesResource`](company-recurring-invoices.md) | Recurring invoice templates of this company. |
|
|
31
31
|
| `paymentConnections` | [`CompanyPaymentConnectionsResource`](company-payment-connections.md) | Payment provider connections (Stripe) that auto-generate invoices under this NIF. |
|
|
32
|
+
| `invoiceReplies` | [`CompanyInvoiceRepliesResource`](company-invoice-replies.md) | Replies of the customers of this company about its invoices, and their attachments. |
|
|
32
33
|
| `taxConfiguration` | [`CompanyTaxConfigurationResource`](company-tax-configuration.md) | Default taxes of this company. |
|
|
33
34
|
| `verifactuConfiguration` | [`CompanyVeriFactuConfigurationResource`](company-verifactu-configuration.md) | Whether this NIF submits its invoices to AEAT under VeriFactu. |
|
|
34
35
|
|
|
@@ -235,7 +235,7 @@ The URL expires in 5 minutes. Use `beel.downloadPdf(id)` for a simpler Buffer do
|
|
|
235
235
|
- **Parameters:**
|
|
236
236
|
- `id: string` — Invoice UUID.
|
|
237
237
|
- **Returns:** `download_url`, `expires_in_seconds` and `file_name`. Response `200` `data`: `{ download_url: string; expires_in_seconds: number; file_name: string }`.
|
|
238
|
-
- **Throws:** `400`/`500` `BeeLApiError` · `401`/`403` `BeeLAuthError` · `404` `BeeLNotFoundError` · `429` `BeeLRateLimitError`
|
|
238
|
+
- **Throws:** `400`/`500` `BeeLApiError` · `401`/`403` `BeeLAuthError` · `404` `BeeLNotFoundError` · `409` `BeeLConflictError` · `429` `BeeLRateLimitError`
|
|
239
239
|
|
|
240
240
|
<a id="invoices-send-email"></a>
|
|
241
241
|
### `sendEmail(id, options?)`
|
package/docs/reference/types.md
CHANGED
|
@@ -71,7 +71,7 @@ type BeeLErrorCode = (typeof BeeLErrorCodes)[keyof typeof BeeLErrorCodes]
|
|
|
71
71
|
Union type of all possible webhook events
|
|
72
72
|
|
|
73
73
|
```typescript
|
|
74
|
-
type WebhookEvent = | VeriFactuStatusUpdatedEvent | InvoiceIssuedEvent | InvoiceVoidedEvent | InvoiceEmailSentEvent | InvoicePdfGeneratedEvent | InvoiceScheduleFailedEvent | RecurringInvoicePausedEvent | AccountClaimedEvent | CompanyCreatedEvent | RepresentationSignedEvent | WebhookTestEvent
|
|
74
|
+
type WebhookEvent = | VeriFactuStatusUpdatedEvent | InvoiceIssuedEvent | InvoiceVoidedEvent | InvoiceEmailSentEvent | InvoicePdfGeneratedEvent | InvoiceScheduleFailedEvent | RecurringInvoicePausedEvent | AccountClaimedEvent | CompanyCreatedEvent | RepresentationSignedEvent | InvoiceReplyReceivedEvent | InvoiceReplyDeletedEvent | WebhookTestEvent
|
|
75
75
|
```
|
|
76
76
|
|
|
77
77
|
<a id="webhookeventenvelope"></a>
|
|
@@ -173,6 +173,24 @@ type CompanyCreatedEvent = BusinessEvent<'company.created', WebhookEventDataComp
|
|
|
173
173
|
type RepresentationSignedEvent = BusinessEvent<'representation.signed', WebhookEventDataRepresentationSigned>
|
|
174
174
|
```
|
|
175
175
|
|
|
176
|
+
<a id="invoicereplyreceivedevent"></a>
|
|
177
|
+
## `InvoiceReplyReceivedEvent`
|
|
178
|
+
|
|
179
|
+
`invoice.reply.received`: a customer replied about an invoice; the full reply is read with `invoiceReplies.get`.
|
|
180
|
+
|
|
181
|
+
```typescript
|
|
182
|
+
type InvoiceReplyReceivedEvent = BusinessEvent<'invoice.reply.received', WebhookEventDataInvoiceReplyReceived>
|
|
183
|
+
```
|
|
184
|
+
|
|
185
|
+
<a id="invoicereplydeletedevent"></a>
|
|
186
|
+
## `InvoiceReplyDeletedEvent`
|
|
187
|
+
|
|
188
|
+
`invoice.reply.deleted`: a reply was deleted; it carries identifiers only.
|
|
189
|
+
|
|
190
|
+
```typescript
|
|
191
|
+
type InvoiceReplyDeletedEvent = BusinessEvent<'invoice.reply.deleted', WebhookEventDataInvoiceReplyDeleted>
|
|
192
|
+
```
|
|
193
|
+
|
|
176
194
|
<a id="webhooktestevent"></a>
|
|
177
195
|
## `WebhookTestEvent`
|
|
178
196
|
|
package/llms.txt
CHANGED
|
@@ -30,6 +30,7 @@
|
|
|
30
30
|
- [beel.catalogs](docs/reference/catalogs.md): Account-wide catalogs, the credential's identity and personal preferences, on their canonical paths.
|
|
31
31
|
- [beel.company(companyId)](docs/reference/company.md): Operations scoped to a single company (NIF).
|
|
32
32
|
- [beel.company(companyId).customers](docs/reference/company-customers.md): Customers of one company.
|
|
33
|
+
- [beel.company(companyId).invoiceReplies](docs/reference/company-invoice-replies.md): Replies of the customers of a company about its invoices, on any channel.
|
|
33
34
|
- [beel.company(companyId).invoices](docs/reference/company-invoices.md): Invoice lifecycle of one company: create a draft (or issue it directly), issue, void, correct, list and read, PDF and email.
|
|
34
35
|
- [beel.company(companyId).invoices.schedule](docs/reference/company-invoices-schedule.md): Scheduled issuing of one invoice: read it, set it, clear it.
|
|
35
36
|
- [beel.company(companyId).paymentConnections](docs/reference/company-payment-connections.md): Payment connections of a company (NIF): the Stripe Connect link whose charges auto-generate invoices under that NIF.
|
package/package.json
CHANGED