@billkit-eu/sdk 0.7.1 → 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 +14 -1
- package/README.md +6 -2
- package/dist/index.cjs +25 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +49 -9
- package/dist/index.d.ts +49 -9
- package/dist/index.js +25 -2
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/index.ts +1 -0
- package/src/resources.ts +55 -7
- package/src/version.ts +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -8,6 +8,18 @@ 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
|
+
|
|
11
23
|
## [0.7.1] - 2026-09-25
|
|
12
24
|
|
|
13
25
|
### Added
|
|
@@ -264,7 +276,8 @@ First public release.
|
|
|
264
276
|
back a one-shot paid with giropay before the shutdown works;
|
|
265
277
|
`OneShotPayment.method` is a plain `string`.
|
|
266
278
|
|
|
267
|
-
[Unreleased]: https://github.com/billkit-eu/billkit-node/compare/v0.
|
|
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
|
|
268
281
|
[0.7.1]: https://github.com/billkit-eu/billkit-node/compare/v0.7.0...v0.7.1
|
|
269
282
|
[0.7.0]: https://github.com/billkit-eu/billkit-node/compare/v0.6.0...v0.7.0
|
|
270
283
|
[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
|
|
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
|
@@ -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
|
-
/**
|
|
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.
|
|
1002
|
+
var VERSION = "0.8.0";
|
|
980
1003
|
|
|
981
1004
|
// src/transport.ts
|
|
982
1005
|
var DEFAULT_BASE_URL = "https://api.billkit.eu";
|