@billkit-eu/sdk 0.6.0 → 0.7.1
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 +38 -1
- package/README.md +3 -1
- package/dist/index.cjs +206 -79
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +305 -29
- package/dist/index.d.ts +305 -29
- package/dist/index.js +206 -79
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/client.ts +3 -0
- package/src/errors.ts +10 -1
- package/src/index.ts +9 -0
- package/src/resources.ts +417 -99
- package/src/transport.ts +21 -10
- package/src/version.ts +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -8,6 +8,41 @@ 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.1] - 2026-09-25
|
|
12
|
+
|
|
13
|
+
### Added
|
|
14
|
+
- `UpdateProductParams.default_price_id` (`string | null`) for the product's default price, the one the billing portal offers on that price's interval. It must be an active price of the same product. An explicit `null` clears it and is sent as a JSON null rather than pruned; omitting the field leaves the default alone.
|
|
15
|
+
- `products.retrieve` and `products.list` document the `default_price` expansion alongside `prices` and `stats`.
|
|
16
|
+
|
|
17
|
+
### Changed
|
|
18
|
+
- `SetTenantBillingProfileParams` documents that the tenant `vat_id` is set once: changing it or clearing it with `null` afterwards is refused with a 400 `vat_id_locked` on `vat_id` and writes nothing, and support changes it. The address fields and `registration_number` still clear with `null`.
|
|
19
|
+
|
|
20
|
+
## [0.7.0] - 2026-09-23
|
|
21
|
+
|
|
22
|
+
### Fixed
|
|
23
|
+
- `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.
|
|
24
|
+
- Every path id is percent-encoded, so an id containing `/`, `?` or `#` can no longer rewrite the request onto a different route.
|
|
25
|
+
- `APIConnectionError` carries the original fetch failure as `cause`, including on the timeout path, so Node's "fetch failed" no longer hides the real reason.
|
|
26
|
+
- `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.
|
|
27
|
+
|
|
28
|
+
### Added
|
|
29
|
+
- `apiKeys` resource: `create`, `retrieve`, `revoke`, `list`, `iter`.
|
|
30
|
+
- `invoices.sendEmail(id)` for `POST /v1/invoices/{id}/email`.
|
|
31
|
+
- `payments.retrieveProvider(id)` for `GET /v1/payments/{id}/provider`.
|
|
32
|
+
- `tenant.billingProfile()` / `tenant.setBillingProfile(params)` for the seller's country, VAT id and invoice address; an explicit `null` clears a field.
|
|
33
|
+
- `tenant.export()` returns the account's full JSON export as raw bytes.
|
|
34
|
+
- `webhookEndpoints.listEventTypes()` for the deliverable-event catalogue.
|
|
35
|
+
- `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`.
|
|
36
|
+
- `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()`.
|
|
37
|
+
- `CreateCheckoutSessionParams.country`, so VAT applies to the first charge on the hosted flow.
|
|
38
|
+
- `CreateBillingPortalSessionParams.deliver_email`, which also emails the portal link to the customer.
|
|
39
|
+
- New exported types: `CreateApiKeyParams`, `SetTenantBillingProfileParams`, `ExpandOptions`, `DisputesListParams`, `InvoicesListParams`, `PaymentsListParams`, `ProductsListParams`, `SetCustomerVatNumberParams`, `UpdatePriceParams`.
|
|
40
|
+
|
|
41
|
+
### Changed
|
|
42
|
+
- `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.
|
|
43
|
+
- `SetCustomerVatNumberParams.vat_number` is `string | null`; an explicit `null` clears the registration and is not pruned.
|
|
44
|
+
- `billingPortalSessions.create` prunes undefined fields instead of sending a fixed body.
|
|
45
|
+
|
|
11
46
|
## [0.6.0] - 2026-09-23
|
|
12
47
|
|
|
13
48
|
### Added
|
|
@@ -229,7 +264,9 @@ First public release.
|
|
|
229
264
|
back a one-shot paid with giropay before the shutdown works;
|
|
230
265
|
`OneShotPayment.method` is a plain `string`.
|
|
231
266
|
|
|
232
|
-
[Unreleased]: https://github.com/billkit-eu/billkit-node/compare/v0.
|
|
267
|
+
[Unreleased]: https://github.com/billkit-eu/billkit-node/compare/v0.7.1...HEAD
|
|
268
|
+
[0.7.1]: https://github.com/billkit-eu/billkit-node/compare/v0.7.0...v0.7.1
|
|
269
|
+
[0.7.0]: https://github.com/billkit-eu/billkit-node/compare/v0.6.0...v0.7.0
|
|
233
270
|
[0.6.0]: https://github.com/billkit-eu/billkit-node/compare/v0.5.0...v0.6.0
|
|
234
271
|
[0.5.0]: https://github.com/billkit-eu/billkit-node/compare/v0.4.0...v0.5.0
|
|
235
272
|
[0.4.0]: https://github.com/billkit-eu/billkit-node/compare/v0.3.0...v0.4.0
|
package/README.md
CHANGED
|
@@ -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: "
|
|
428
|
+
discount_type: "percent",
|
|
427
429
|
discount_value: 10,
|
|
428
430
|
duration: "once",
|
|
429
431
|
};
|