@billkit-eu/sdk 0.7.1 → 0.8.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 CHANGED
@@ -8,6 +8,26 @@ 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.1] - 2026-09-26
14
+
15
+ ### Changed
16
+ - `UpdateCouponParams.applies_to_price_ids` (`null` lifts the price restriction), `UpdateCouponParams.min_amount_cents` (`null` lifts the minimum), `UpdateProductParams.marketing_features` (`null` empties the list) and `UpdatePriceParams.refund_window_initial_days` / `refund_window_renewal_days` (`null` drops the price's override) now accept `null`, sent as a JSON null. The request already carried a `null` through; the types refused it. Every other update field stays typed without `null`.
17
+ **Upgrade note:** as in 0.8.0, a null passed through from your own data clears the field: `coupons.update(id, { min_amount_cents: row.min })` with `row.min` sometimes `null` now lifts the coupon's minimum, which widens who can redeem it. Omit the field when you mean "leave it".
18
+ **Requires the matching API release.** An older API accepts the null on `applies_to_price_ids`, `min_amount_cents` and `marketing_features` and leaves the value in place.
19
+ - Every other update field refuses an explicit null with a `400` naming the field (the API used to ignore it). The SDK never sends one there; omit the field to leave it unchanged.
20
+
21
+ ## [0.8.0] - 2026-09-26
22
+
23
+ ### Added
24
+ - `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`.
25
+ - `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.
26
+
27
+ ### Changed
28
+ - 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.
29
+ **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".
30
+
11
31
  ## [0.7.1] - 2026-09-25
12
32
 
13
33
  ### Added
@@ -264,7 +284,9 @@ First public release.
264
284
  back a one-shot paid with giropay before the shutdown works;
265
285
  `OneShotPayment.method` is a plain `string`.
266
286
 
267
- [Unreleased]: https://github.com/billkit-eu/billkit-node/compare/v0.7.1...HEAD
287
+ [Unreleased]: https://github.com/billkit-eu/billkit-node/compare/v0.8.1...HEAD
288
+ [0.8.1]: https://github.com/billkit-eu/billkit-node/compare/v0.8.0...v0.8.1
289
+ [0.8.0]: https://github.com/billkit-eu/billkit-node/compare/v0.7.1...v0.8.0
268
290
  [0.7.1]: https://github.com/billkit-eu/billkit-node/compare/v0.7.0...v0.7.1
269
291
  [0.7.0]: https://github.com/billkit-eu/billkit-node/compare/v0.6.0...v0.7.0
270
292
  [0.6.0]: https://github.com/billkit-eu/billkit-node/compare/v0.5.0...v0.6.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`, `marketing_features` empties the list), `prices.update` (`refund_window_initial_days` and `refund_window_renewal_days` drop the price's override), `customers.update` (`name`), `webhookEndpoints.update` (`description`), `coupons.update` (`max_redemptions` removes the cap, `redeem_by` removes the expiry, `applies_to_price_ids` lifts the price restriction, `min_amount_cents` lifts the minimum) and `taxRates.update` (`display_name`). Every other update field is typed without `null`, and the API refuses a null there with a 400 naming the field. A `metadata` update replaces the stored object whole, so `metadata: {}` is how it is emptied.
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
@@ -265,6 +265,16 @@ var OneShotPayments = class extends BaseResource {
265
265
  retrieve(id) {
266
266
  return this.get(`/v1/checkout/one_shot/${p(id)}`);
267
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
+ }
268
278
  };
269
279
  var Subscriptions = class extends BaseResource {
270
280
  /** Expandable: `customer`, `price`, `refund_eligibility`. */
@@ -777,7 +787,20 @@ var AuditLogs = class extends BaseResource {
777
787
  }
778
788
  };
779
789
  var Payments = class extends BaseResource {
780
- /** 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
+ */
781
804
  retrieve(id, options = {}) {
782
805
  return this.get(`/v1/payments/${p(id)}`, options);
783
806
  }
@@ -976,7 +999,7 @@ function sleep(ms) {
976
999
  }
977
1000
 
978
1001
  // src/version.ts
979
- var VERSION = "0.7.1";
1002
+ var VERSION = "0.8.1";
980
1003
 
981
1004
  // src/transport.ts
982
1005
  var DEFAULT_BASE_URL = "https://api.billkit.eu";