@billkit-eu/sdk 0.7.0 → 0.8.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,27 @@ 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
+ ## [Unreleased]
12
+
13
+ ## [0.8.0] - 2026-09-26
14
+
15
+ ### Added
16
+ - `oneShotPayments.list(params)` and `oneShotPayments.iter(options)` for `GET /v1/checkout/one_shot`, newest first, filtered by `customer_id` and `status`. New exported type `OneShotPaymentsListParams`.
17
+ - `payments.retrieve` documents the `refund_eligibility` expansion: `{ object, eligible, amount_cents, currency, days_remaining, window_ends_at, reason }`, whether a refund of the remaining balance would succeed now. It is retrieve-only; `payments.list` refuses it.
18
+
19
+ ### Changed
20
+ - An explicit `null` now clears `UpdateProductParams.description`, `UpdateCustomerParams.name`, `UpdateWebhookEndpointParams.description`, `UpdateCouponParams.max_redemptions` and `redeem_by`, and `UpdateTaxRateParams.display_name`. The types accept `null`, and it is sent as a JSON null rather than pruned; omitting the field still leaves it alone.
21
+ **Upgrade note:** a `null` you pass through from your own data now clears the field. `customers.update(id, { name: user.name })` with `user.name` sometimes `null` used to leave the name alone and now erases it; pass `undefined` (or omit the key) when you mean "leave it".
22
+
23
+ ## [0.7.1] - 2026-09-25
24
+
25
+ ### Added
26
+ - `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.
27
+ - `products.retrieve` and `products.list` document the `default_price` expansion alongside `prices` and `stats`.
28
+
29
+ ### Changed
30
+ - `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`.
31
+
11
32
  ## [0.7.0] - 2026-09-23
12
33
 
13
34
  ### Fixed
@@ -255,7 +276,10 @@ First public release.
255
276
  back a one-shot paid with giropay before the shutdown works;
256
277
  `OneShotPayment.method` is a plain `string`.
257
278
 
258
- [Unreleased]: https://github.com/billkit-eu/billkit-node/compare/v0.6.0...HEAD
279
+ [Unreleased]: https://github.com/billkit-eu/billkit-node/compare/v0.8.0...HEAD
280
+ [0.8.0]: https://github.com/billkit-eu/billkit-node/compare/v0.7.1...v0.8.0
281
+ [0.7.1]: https://github.com/billkit-eu/billkit-node/compare/v0.7.0...v0.7.1
282
+ [0.7.0]: https://github.com/billkit-eu/billkit-node/compare/v0.6.0...v0.7.0
259
283
  [0.6.0]: https://github.com/billkit-eu/billkit-node/compare/v0.5.0...v0.6.0
260
284
  [0.5.0]: https://github.com/billkit-eu/billkit-node/compare/v0.4.0...v0.5.0
261
285
  [0.4.0]: https://github.com/billkit-eu/billkit-node/compare/v0.3.0...v0.4.0
package/README.md CHANGED
@@ -96,7 +96,7 @@ The client exposes one accessor per resource family. Each mirrors the verbs from
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
- | `client.oneShotPayments` | `create`, `retrieve` |
99
+ | `client.oneShotPayments` | `create`, `retrieve`, `list`, `iter` (filter by `customer_id`, `status`) |
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
102
  | `client.disputes` | `retrieve`, `list`, `iter` |
@@ -108,9 +108,13 @@ The client exposes one accessor per resource family. Each mirrors the verbs from
108
108
  | `client.invoices` | `retrieve`, `retrievePdf`, `list`, `iter`, `void` |
109
109
  | `client.creditNotes` | `retrieve`, `retrievePdf`, `list`, `iter` (filter by `invoice_id`, `customer_id`) |
110
110
  | `client.auditLogs` | `retrieve`, `list`, `iter` (filter by `action`, `resource_type`, `resource_id`, `actor_id`) |
111
- | `client.payments` | `retrieve`, `list`, `iter` |
111
+ | `client.payments` | `retrieve` (`expand: ["refund_eligibility"]` says whether a refund would succeed now), `list`, `iter` |
112
112
  | `client.billingPortalSessions` | `create`, `revoke` |
113
113
 
114
+ ### Clearing an optional field
115
+
116
+ On an update, an explicit `null` clears a field and omitting it leaves the stored value alone. Only `undefined` is pruned from a request body, so `null` reaches the API as a JSON null. This applies to `products.update` (`description`, `default_price_id`), `customers.update` (`name`), `webhookEndpoints.update` (`description`), `coupons.update` (`max_redemptions` removes the cap, `redeem_by` removes the expiry) and `taxRates.update` (`display_name`).
117
+
114
118
  ### Retiring something, and deleting something
115
119
 
116
120
  `delete()` exists on `customers` and `webhookEndpoints`, and it resolves to `{ id, object, deleted: true }` rather than the object: it has left the API, so there is nothing to hand back. A deleted endpoint takes its delivery rows with it, because those are readable only through the endpoint that owns them; the events stay in `client.events`, which is the record of what you were sent.
package/dist/index.cjs CHANGED
@@ -168,7 +168,10 @@ var Products = class extends BaseResource {
168
168
  create(params) {
169
169
  return this.post("/v1/products", params);
170
170
  }
171
- /** Expandable: `prices` (every price on the product), `stats`. */
171
+ /**
172
+ * Expandable: `prices` (every price on the product), `stats`, and
173
+ * `default_price` (the price `default_price_id` names).
174
+ */
172
175
  retrieve(id, options = {}) {
173
176
  return this.get(`/v1/products/${p(id)}`, options);
174
177
  }
@@ -262,6 +265,16 @@ var OneShotPayments = class extends BaseResource {
262
265
  retrieve(id) {
263
266
  return this.get(`/v1/checkout/one_shot/${p(id)}`);
264
267
  }
268
+ /** List one-off charges, newest first. Filter by `customer_id` and `status`. */
269
+ list(params = {}) {
270
+ return this.get("/v1/checkout/one_shot", params);
271
+ }
272
+ iter(options = {}) {
273
+ return paginate((page) => this.get("/v1/checkout/one_shot", page), {
274
+ pageSize: options.pageSize,
275
+ filters: { customer_id: options.customer_id, status: options.status }
276
+ });
277
+ }
265
278
  };
266
279
  var Subscriptions = class extends BaseResource {
267
280
  /** Expandable: `customer`, `price`, `refund_eligibility`. */
@@ -774,7 +787,20 @@ var AuditLogs = class extends BaseResource {
774
787
  }
775
788
  };
776
789
  var Payments = class extends BaseResource {
777
- /** Expandable: `customer`, `subscription`. */
790
+ /**
791
+ * Expandable: `customer`, `subscription`, `refund_eligibility`. The last
792
+ * is retrieve-only (`list` refuses it with a `400`) and attaches
793
+ * `refund_eligibility: { object: "refund_eligibility", eligible,
794
+ * amount_cents, currency, days_remaining, window_ends_at, reason }`:
795
+ * whether `refunds.create` for the remaining balance would succeed now,
796
+ * applying the refund window and the price's refund policy, which
797
+ * `amount_refundable_cents` does not. When `eligible` is false, `reason`
798
+ * is one of `not_paid`, `unrefundable_type`, `window_expired`,
799
+ * `fully_refunded`, `disputed`, `operation_pending` or
800
+ * `plan_change_pending` (a plan change is settling: the full balance
801
+ * cannot be refunded yet, a partial refund still can); treat any other
802
+ * value as "not refundable".
803
+ */
778
804
  retrieve(id, options = {}) {
779
805
  return this.get(`/v1/payments/${p(id)}`, options);
780
806
  }
@@ -973,7 +999,7 @@ function sleep(ms) {
973
999
  }
974
1000
 
975
1001
  // src/version.ts
976
- var VERSION = "0.7.0";
1002
+ var VERSION = "0.8.0";
977
1003
 
978
1004
  // src/transport.ts
979
1005
  var DEFAULT_BASE_URL = "https://api.billkit.eu";