@billkit-eu/sdk 0.5.0 → 0.7.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 CHANGED
@@ -8,6 +8,74 @@ 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.7.0] - 2026-09-23
12
+
13
+ ### Fixed
14
+ - `CreateCouponParams.discount_type` now types the API's two literals, `"percent"` and `"fixed_cents"`; it had offered `"percentage"` / `"amount"`, neither of which the API accepts.
15
+ - Every path id is percent-encoded, so an id containing `/`, `?` or `#` can no longer rewrite the request onto a different route.
16
+ - `APIConnectionError` carries the original fetch failure as `cause`, including on the timeout path, so Node's "fetch failed" no longer hides the real reason.
17
+ - `BaseListParams` lost its index signature, so a misspelled filter is a compile error instead of a query parameter the server ignores. `ListParams` stays exported as a deprecated alias.
18
+
19
+ ### Added
20
+ - `apiKeys` resource: `create`, `retrieve`, `revoke`, `list`, `iter`.
21
+ - `invoices.sendEmail(id)` for `POST /v1/invoices/{id}/email`.
22
+ - `payments.retrieveProvider(id)` for `GET /v1/payments/{id}/provider`.
23
+ - `tenant.billingProfile()` / `tenant.setBillingProfile(params)` for the seller's country, VAT id and invoice address; an explicit `null` clears a field.
24
+ - `tenant.export()` returns the account's full JSON export as raw bytes.
25
+ - `webhookEndpoints.listEventTypes()` for the deliverable-event catalogue.
26
+ - `expand?: string[]` on `customers.list`, `products.list`, `subscriptions.list`, `payments.list`, `invoices.list` and `events.list`, and as an optional second argument on `products.retrieve`, `subscriptions.retrieve`, `payments.retrieve` and `invoices.retrieve`.
27
+ - `payments.list` types `customer_id`; `invoices.list` types `customer_id`, `subscription_id`, `payment_id` and `status`; `disputes.list` types `status` and `payment_id`. All are carried onto every page by `iter()`.
28
+ - `CreateCheckoutSessionParams.country`, so VAT applies to the first charge on the hosted flow.
29
+ - `CreateBillingPortalSessionParams.deliver_email`, which also emails the portal link to the customer.
30
+ - New exported types: `CreateApiKeyParams`, `SetTenantBillingProfileParams`, `ExpandOptions`, `DisputesListParams`, `InvoicesListParams`, `PaymentsListParams`, `ProductsListParams`, `SetCustomerVatNumberParams`, `UpdatePriceParams`.
31
+
32
+ ### Changed
33
+ - `UpdatePriceParams` accepts every field `PriceUpdate` does (`active`, `metadata`, `tax_behavior`, `payment_methods`, `refund_on_cancel`, `refund_window_initial_days`, `refund_window_renewal_days`), all optional, where `active` was previously required and alone.
34
+ - `SetCustomerVatNumberParams.vat_number` is `string | null`; an explicit `null` clears the registration and is not pruned.
35
+ - `billingPortalSessions.create` prunes undefined fields instead of sending a fixed body.
36
+
37
+ ## [0.6.0] - 2026-09-23
38
+
39
+ ### Added
40
+ - **`eps` and `paypal` can now start a subscription**, not just take a one-off
41
+ charge. Both are accepted wherever a payment method is named: the
42
+ `checkoutSessions.create` `method` union, a price's `payment_methods`
43
+ allowlist, and the one-shot union.
44
+ - **EPS** mints a *SEPA* mandate, exactly as iDEAL does, so the subscription
45
+ renews on `directdebit`.
46
+ - EPS is **Austria-only** and carries a **EUR 1.00 minimum** — a hundred
47
+ times iDEAL's. A fully-discounted first charge on a price offering it is
48
+ raised to that floor.
49
+ - **PayPal** mints a `paypal` mandate and renews on itself. No country
50
+ restriction.
51
+ - `bancontact` stays one-off only: Mollie's recurring guide and its
52
+ Bancontact method page disagree about whether it mints a mandate, and that
53
+ is being settled against a live profile rather than guessed.
54
+
55
+ - **`banktransfer` joins the `oneShotPayments.create` method union.** One-off
56
+ only, for the same reason `bancontact` is.
57
+ - It mints no mandate, so it can neither anchor a subscription nor settle a
58
+ metered cycle. Mollie refuses it at `sequenceType=first` with "The payment
59
+ method does not support sequence type" — which is why the checkout union
60
+ stays narrower than the one-shot one rather than the two converging.
61
+ - **It settles in days, not seconds.** The payer is handed bank details and
62
+ pays on their own schedule, so Mollie holds the payment `open` for about a
63
+ fortnight and `expires_at` comes back roughly 13 days out.
64
+ - A pending bank transfer is **not a failure and not something to poll** —
65
+ wait for `one_shot_payment.succeeded` / `.failed`.
66
+ - Nothing expires early: the server's reaper keys on the `expires_at` copied
67
+ from Mollie's own answer, not on a BillKit-invented window.
68
+ - Minimum is EUR 0.01, measured against a live profile rather than read off
69
+ a page.
70
+
71
+ - **`resource_id` filter on `auditLogs.list()` and `auditLogs.iter()`.**
72
+ - It answers "everything that ever happened to this customer", which is the
73
+ question an audit log mostly exists for.
74
+ - The API has always accepted it; this SDK named three of its four filters
75
+ and omitted this one.
76
+ - Matches exactly, and combines with `resource_type` rather than replacing
77
+ it.
78
+
11
79
  ## [0.5.0] - 2026-09-22
12
80
 
13
81
  ### Changed
@@ -187,5 +255,11 @@ First public release.
187
255
  back a one-shot paid with giropay before the shutdown works;
188
256
  `OneShotPayment.method` is a plain `string`.
189
257
 
190
- [Unreleased]: https://github.com/billkit-eu/billkit-node/compare/v0.1.0...HEAD
258
+ [Unreleased]: https://github.com/billkit-eu/billkit-node/compare/v0.6.0...HEAD
259
+ [0.6.0]: https://github.com/billkit-eu/billkit-node/compare/v0.5.0...v0.6.0
260
+ [0.5.0]: https://github.com/billkit-eu/billkit-node/compare/v0.4.0...v0.5.0
261
+ [0.4.0]: https://github.com/billkit-eu/billkit-node/compare/v0.3.0...v0.4.0
262
+ [0.3.0]: https://github.com/billkit-eu/billkit-node/compare/v0.2.1...v0.3.0
263
+ [0.2.1]: https://github.com/billkit-eu/billkit-node/compare/v0.2.0...v0.2.1
264
+ [0.2.0]: https://github.com/billkit-eu/billkit-node/compare/v0.1.0...v0.2.0
191
265
  [0.1.0]: https://github.com/billkit-eu/billkit-node/releases/tag/v0.1.0
package/README.md CHANGED
@@ -107,7 +107,7 @@ The client exposes one accessor per resource family. Each mirrors the verbs from
107
107
  | `client.taxRates` | `create`, `retrieve`, `update` (retire with `active: false`), `list`, `iter` |
108
108
  | `client.invoices` | `retrieve`, `retrievePdf`, `list`, `iter`, `void` |
109
109
  | `client.creditNotes` | `retrieve`, `retrievePdf`, `list`, `iter` (filter by `invoice_id`, `customer_id`) |
110
- | `client.auditLogs` | `retrieve`, `list`, `iter` (filter by `action`, `resource_type`, `actor_id`) |
110
+ | `client.auditLogs` | `retrieve`, `list`, `iter` (filter by `action`, `resource_type`, `resource_id`, `actor_id`) |
111
111
  | `client.payments` | `retrieve`, `list`, `iter` |
112
112
  | `client.billingPortalSessions` | `create`, `revoke` |
113
113
 
@@ -422,8 +422,10 @@ import type {
422
422
  } from "@billkit-eu/sdk";
423
423
 
424
424
  const couponParams: CreateCouponParams = {
425
+ // "percent" reads discount_value as whole percent; "fixed_cents" reads
426
+ // it as minor units off the charge. Those are the only two values.
425
427
  code: "WELCOME10",
426
- discount_type: "percentage",
428
+ discount_type: "percent",
427
429
  discount_value: 10,
428
430
  duration: "once",
429
431
  };