@billkit-eu/sdk 0.4.0 → 0.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 +64 -1
- package/README.md +10 -6
- package/dist/index.cjs +17 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +39 -7
- package/dist/index.d.ts +39 -7
- package/dist/index.js +17 -2
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/index.ts +1 -0
- package/src/resources.ts +58 -6
- package/src/version.ts +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -8,6 +8,63 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
8
8
|
Versioning is independent of the Python SDK; the two ship on their own cadence,
|
|
9
9
|
so the numbers will diverge after this first release.
|
|
10
10
|
|
|
11
|
+
## [0.6.0] - 2026-09-23
|
|
12
|
+
|
|
13
|
+
### Added
|
|
14
|
+
- **`eps` and `paypal` can now start a subscription**, not just take a one-off
|
|
15
|
+
charge. Both are accepted wherever a payment method is named: the
|
|
16
|
+
`checkoutSessions.create` `method` union, a price's `payment_methods`
|
|
17
|
+
allowlist, and the one-shot union.
|
|
18
|
+
- **EPS** mints a *SEPA* mandate, exactly as iDEAL does, so the subscription
|
|
19
|
+
renews on `directdebit`.
|
|
20
|
+
- EPS is **Austria-only** and carries a **EUR 1.00 minimum** — a hundred
|
|
21
|
+
times iDEAL's. A fully-discounted first charge on a price offering it is
|
|
22
|
+
raised to that floor.
|
|
23
|
+
- **PayPal** mints a `paypal` mandate and renews on itself. No country
|
|
24
|
+
restriction.
|
|
25
|
+
- `bancontact` stays one-off only: Mollie's recurring guide and its
|
|
26
|
+
Bancontact method page disagree about whether it mints a mandate, and that
|
|
27
|
+
is being settled against a live profile rather than guessed.
|
|
28
|
+
|
|
29
|
+
- **`banktransfer` joins the `oneShotPayments.create` method union.** One-off
|
|
30
|
+
only, for the same reason `bancontact` is.
|
|
31
|
+
- It mints no mandate, so it can neither anchor a subscription nor settle a
|
|
32
|
+
metered cycle. Mollie refuses it at `sequenceType=first` with "The payment
|
|
33
|
+
method does not support sequence type" — which is why the checkout union
|
|
34
|
+
stays narrower than the one-shot one rather than the two converging.
|
|
35
|
+
- **It settles in days, not seconds.** The payer is handed bank details and
|
|
36
|
+
pays on their own schedule, so Mollie holds the payment `open` for about a
|
|
37
|
+
fortnight and `expires_at` comes back roughly 13 days out.
|
|
38
|
+
- A pending bank transfer is **not a failure and not something to poll** —
|
|
39
|
+
wait for `one_shot_payment.succeeded` / `.failed`.
|
|
40
|
+
- Nothing expires early: the server's reaper keys on the `expires_at` copied
|
|
41
|
+
from Mollie's own answer, not on a BillKit-invented window.
|
|
42
|
+
- Minimum is EUR 0.01, measured against a live profile rather than read off
|
|
43
|
+
a page.
|
|
44
|
+
|
|
45
|
+
- **`resource_id` filter on `auditLogs.list()` and `auditLogs.iter()`.**
|
|
46
|
+
- It answers "everything that ever happened to this customer", which is the
|
|
47
|
+
question an audit log mostly exists for.
|
|
48
|
+
- The API has always accepted it; this SDK named three of its four filters
|
|
49
|
+
and omitted this one.
|
|
50
|
+
- Matches exactly, and combines with `resource_type` rather than replacing
|
|
51
|
+
it.
|
|
52
|
+
|
|
53
|
+
## [0.5.0] - 2026-09-22
|
|
54
|
+
|
|
55
|
+
### Changed
|
|
56
|
+
- `webhookEndpoints.getDelivery()` is now `retrieveDelivery()`. Every other
|
|
57
|
+
single-row fetch in every BillKit SDK is `retrieve`, and python and php
|
|
58
|
+
already spelled this one `retrieve_delivery` / `retrieveDelivery`, so node
|
|
59
|
+
was the outlier and the obvious name was a type error. `getDelivery` stays as
|
|
60
|
+
a deprecated alias — removing it would break callers over a naming
|
|
61
|
+
preference — and goes in the next major.
|
|
62
|
+
|
|
63
|
+
### Fixed
|
|
64
|
+
- `CustomerListParams` is exported from the package entry point. The interface
|
|
65
|
+
documented the `provisional` filter but could not be imported, so callers
|
|
66
|
+
building the params object ahead of the call had nothing to type it with.
|
|
67
|
+
|
|
11
68
|
## [0.4.0]
|
|
12
69
|
|
|
13
70
|
### Added
|
|
@@ -172,5 +229,11 @@ First public release.
|
|
|
172
229
|
back a one-shot paid with giropay before the shutdown works;
|
|
173
230
|
`OneShotPayment.method` is a plain `string`.
|
|
174
231
|
|
|
175
|
-
[Unreleased]: https://github.com/billkit-eu/billkit-node/compare/v0.
|
|
232
|
+
[Unreleased]: https://github.com/billkit-eu/billkit-node/compare/v0.6.0...HEAD
|
|
233
|
+
[0.6.0]: https://github.com/billkit-eu/billkit-node/compare/v0.5.0...v0.6.0
|
|
234
|
+
[0.5.0]: https://github.com/billkit-eu/billkit-node/compare/v0.4.0...v0.5.0
|
|
235
|
+
[0.4.0]: https://github.com/billkit-eu/billkit-node/compare/v0.3.0...v0.4.0
|
|
236
|
+
[0.3.0]: https://github.com/billkit-eu/billkit-node/compare/v0.2.1...v0.3.0
|
|
237
|
+
[0.2.1]: https://github.com/billkit-eu/billkit-node/compare/v0.2.0...v0.2.1
|
|
238
|
+
[0.2.0]: https://github.com/billkit-eu/billkit-node/compare/v0.1.0...v0.2.0
|
|
176
239
|
[0.1.0]: https://github.com/billkit-eu/billkit-node/releases/tag/v0.1.0
|
package/README.md
CHANGED
|
@@ -92,20 +92,22 @@ The client exposes one accessor per resource family. Each mirrors the verbs from
|
|
|
92
92
|
|
|
93
93
|
| Accessor | Verbs |
|
|
94
94
|
| --- | --- |
|
|
95
|
-
| `client.customers` | `create`, `retrieve`, `update`, `delete`, `list
|
|
95
|
+
| `client.customers` | `create`, `retrieve`, `update`, `delete`, `list` (filter by `provisional`), `iter`, `setVatNumber`, `purge` |
|
|
96
96
|
| `client.products` | `create`, `retrieve`, `update` (archive with `active: false`), `list`, `iter` |
|
|
97
97
|
| `client.prices` | `create`, `retrieve`, `update` (archive with `active: false`, restore with `active: true`), `list`, `iter` |
|
|
98
98
|
| `client.checkoutSessions` | `create`, `retrieve` |
|
|
99
99
|
| `client.oneShotPayments` | `create`, `retrieve` |
|
|
100
100
|
| `client.subscriptions` | `retrieve`, `list`, `iter` (filter by `customer_id`, `status`, `renewal_state`), `cancel`, `pause`, `resume`, `reactivate`, `previewUpdate`, `update`, `reauthorizePaymentMethod`, `createUsageRecord`, `listUsageRecords`, `iterUsageRecords`, `retrieveUsageSummary` |
|
|
101
101
|
| `client.refunds` | `create`, `retrieve`, `list`, `iter` |
|
|
102
|
-
| `client.
|
|
102
|
+
| `client.disputes` | `retrieve`, `list`, `iter` |
|
|
103
|
+
| `client.webhookEndpoints` | `create`, `retrieve`, `update` (stop delivery with `status: "disabled"`), `delete`, `rotateSecret`, `list`, `iter`, `listDeliveries`, `iterDeliveries`, `retrieveDelivery`, `redeliver` |
|
|
103
104
|
| `client.events` | `retrieve`, `list`, `iter` (filter by `type`) |
|
|
104
105
|
| `client.tenant` | `capabilities`, `portalBranding`, `setPortalBranding`, `rotateProviderCredential` |
|
|
105
106
|
| `client.coupons` | `create`, `retrieve`, `update` (withdraw with `active: false`), `validate`, `list`, `iter` |
|
|
106
107
|
| `client.taxRates` | `create`, `retrieve`, `update` (retire with `active: false`), `list`, `iter` |
|
|
107
|
-
| `client.invoices` | `retrieve`, `retrievePdf`, `list`, `iter` |
|
|
108
|
-
| `client.
|
|
108
|
+
| `client.invoices` | `retrieve`, `retrievePdf`, `list`, `iter`, `void` |
|
|
109
|
+
| `client.creditNotes` | `retrieve`, `retrievePdf`, `list`, `iter` (filter by `invoice_id`, `customer_id`) |
|
|
110
|
+
| `client.auditLogs` | `retrieve`, `list`, `iter` (filter by `action`, `resource_type`, `resource_id`, `actor_id`) |
|
|
109
111
|
| `client.payments` | `retrieve`, `list`, `iter` |
|
|
110
112
|
| `client.billingPortalSessions` | `create`, `revoke` |
|
|
111
113
|
|
|
@@ -225,14 +227,16 @@ const session = await client.checkoutSessions.create<{ client_secret: string }>(
|
|
|
225
227
|
});
|
|
226
228
|
```
|
|
227
229
|
|
|
228
|
-
### Invoice PDFs
|
|
230
|
+
### Invoice and credit-note PDFs
|
|
229
231
|
|
|
230
232
|
```ts
|
|
231
233
|
const pdf = await client.invoices.retrievePdf("inv_123");
|
|
232
234
|
await writeFile("invoice.pdf", Buffer.from(pdf));
|
|
235
|
+
|
|
236
|
+
const credit = await client.creditNotes.retrievePdf("cn_123");
|
|
233
237
|
```
|
|
234
238
|
|
|
235
|
-
Returns the raw bytes. S3-backed deployments answer with a redirect to a presigned URL, which is followed transparently under the SDK's own timeout and retry policy, so both storage adapters look the same from here. A deployment with PDF rendering disabled throws a `ServerError` with `code: "rendering_pending"`; `retrieve()` still gives you the structured
|
|
239
|
+
Returns the raw bytes. S3-backed deployments answer with a redirect to a presigned URL, which is followed transparently under the SDK's own timeout and retry policy, so both storage adapters look the same from here — and the API key is never sent to the storage host, because the presigned URL carries its own credential. A deployment with PDF rendering disabled throws a `ServerError` with `code: "rendering_pending"`; `retrieve()` still gives you the structured document to render yourself.
|
|
236
240
|
|
|
237
241
|
## Auto-pagination
|
|
238
242
|
|
package/dist/index.cjs
CHANGED
|
@@ -462,9 +462,23 @@ var WebhookEndpoints = class extends BaseResource {
|
|
|
462
462
|
);
|
|
463
463
|
}
|
|
464
464
|
/** Fetch one delivery row for inspection before deciding to redeliver. */
|
|
465
|
-
|
|
465
|
+
retrieveDelivery(endpointId, deliveryId) {
|
|
466
466
|
return this.get(`/v1/webhook_endpoints/${endpointId}/deliveries/${deliveryId}`);
|
|
467
467
|
}
|
|
468
|
+
/**
|
|
469
|
+
* @deprecated Renamed to {@link WebhookEndpoints.retrieveDelivery}.
|
|
470
|
+
*
|
|
471
|
+
* Every other single-row fetch in every BillKit SDK is `retrieve`; this
|
|
472
|
+
* one method was `get`, which meant reaching for the obvious name and
|
|
473
|
+
* getting a type error. The python and php clients already spell it
|
|
474
|
+
* `retrieve_delivery` / `retrieveDelivery`, so node was the outlier.
|
|
475
|
+
*
|
|
476
|
+
* Kept as an alias because removing it would break callers for a naming
|
|
477
|
+
* preference. It will go in the next major.
|
|
478
|
+
*/
|
|
479
|
+
getDelivery(endpointId, deliveryId) {
|
|
480
|
+
return this.retrieveDelivery(endpointId, deliveryId);
|
|
481
|
+
}
|
|
468
482
|
/**
|
|
469
483
|
* Re-enqueue a delivery row for the dispatcher.
|
|
470
484
|
*
|
|
@@ -674,6 +688,7 @@ var AuditLogs = class extends BaseResource {
|
|
|
674
688
|
filters: {
|
|
675
689
|
action: options.action,
|
|
676
690
|
resource_type: options.resource_type,
|
|
691
|
+
resource_id: options.resource_id,
|
|
677
692
|
actor_id: options.actor_id
|
|
678
693
|
}
|
|
679
694
|
});
|
|
@@ -837,7 +852,7 @@ function sleep(ms) {
|
|
|
837
852
|
}
|
|
838
853
|
|
|
839
854
|
// src/version.ts
|
|
840
|
-
var VERSION = "0.
|
|
855
|
+
var VERSION = "0.6.0";
|
|
841
856
|
|
|
842
857
|
// src/transport.ts
|
|
843
858
|
var DEFAULT_BASE_URL = "https://api.billkit.eu";
|