@billkit-eu/sdk 0.7.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/dist/index.d.cts CHANGED
@@ -344,7 +344,7 @@ interface CustomerListParams extends BaseListParams {
344
344
  }
345
345
  /** Query parameters accepted by `GET /v1/products`. */
346
346
  interface ProductsListParams extends BaseListParams {
347
- /** Expandable here: `prices`, `stats`. */
347
+ /** Expandable here: `prices`, `stats`, `default_price`. */
348
348
  expand?: string[];
349
349
  }
350
350
  /**
@@ -398,6 +398,14 @@ interface UpdateProductParams extends IdempotencyOptions {
398
398
  active?: boolean;
399
399
  /** See {@link CreateProductParams.allow_promotion_codes}. */
400
400
  allow_promotion_codes?: boolean;
401
+ /**
402
+ * The price the billing portal offers on that price's interval. Must be
403
+ * an active price of this product; anything else is a 400 on
404
+ * `default_price_id`. An explicit `null` **clears** the default and is
405
+ * sent as a JSON null rather than pruned (only `undefined` is dropped);
406
+ * omit the field to leave the default alone.
407
+ */
408
+ default_price_id?: string | null;
401
409
  }
402
410
  /**
403
411
  * Body for `POST /v1/prices/{id}`. Every field is optional; omitted ones
@@ -840,15 +848,20 @@ interface CreditNotesListParams extends BaseListParams {
840
848
  * VAT is decided against and that an invoice prints.
841
849
  *
842
850
  * `country_code` is required on every call: there is nothing to leave
843
- * alone about a jurisdiction. Every other field is partial-update: omit
844
- * it to leave the stored value alone, or pass an explicit `null` to
845
- * clear it, because ceasing to be VAT registered (or moving office) is a
846
- * real event.
851
+ * alone about a jurisdiction. The address fields and
852
+ * `registration_number` are partial-update: omit one to leave the stored
853
+ * value alone, or pass an explicit `null` to clear it, because moving
854
+ * office is a real event.
855
+ *
856
+ * `vat_id` can be set once. After that, a different value or `null` is
857
+ * refused with a 400 (`param: "vat_id"`, reason `vat_id_locked`) and the
858
+ * call writes nothing; re-sending the stored number is accepted. BillKit
859
+ * invoices you reverse-charged against it, so support changes it.
847
860
  */
848
861
  interface SetTenantBillingProfileParams extends IdempotencyOptions {
849
862
  /** ISO-3166-1 alpha-2, e.g. `"NL"`. */
850
863
  country_code: string;
851
- /** Your own EU VAT registration, or `null` to clear it. */
864
+ /** Your own EU VAT registration. Set once; support changes or clears it. */
852
865
  vat_id?: string | null;
853
866
  address_line1?: string | null;
854
867
  address_line2?: string | null;
@@ -958,7 +971,10 @@ declare class Customers extends BaseResource {
958
971
  declare class Products extends BaseResource {
959
972
  /** Create a catalog Product, then attach one or more Prices to it. */
960
973
  create<T = unknown>(params: CreateProductParams): Promise<T>;
961
- /** Expandable: `prices` (every price on the product), `stats`. */
974
+ /**
975
+ * Expandable: `prices` (every price on the product), `stats`, and
976
+ * `default_price` (the price `default_price_id` names).
977
+ */
962
978
  retrieve<T = unknown>(id: string, options?: ExpandOptions): Promise<T>;
963
979
  /**
964
980
  * Patch mutable Product fields, or archive it with `active: false`.
@@ -1610,7 +1626,7 @@ declare class RateLimitError extends BillKitError {
1610
1626
  });
1611
1627
  }
1612
1628
 
1613
- declare const VERSION = "0.7.0";
1629
+ declare const VERSION = "0.7.1";
1614
1630
 
1615
1631
  /**
1616
1632
  * Verify `BillKit-Signature: t=<unix>,v1=<hex>` headers.
package/dist/index.d.ts CHANGED
@@ -344,7 +344,7 @@ interface CustomerListParams extends BaseListParams {
344
344
  }
345
345
  /** Query parameters accepted by `GET /v1/products`. */
346
346
  interface ProductsListParams extends BaseListParams {
347
- /** Expandable here: `prices`, `stats`. */
347
+ /** Expandable here: `prices`, `stats`, `default_price`. */
348
348
  expand?: string[];
349
349
  }
350
350
  /**
@@ -398,6 +398,14 @@ interface UpdateProductParams extends IdempotencyOptions {
398
398
  active?: boolean;
399
399
  /** See {@link CreateProductParams.allow_promotion_codes}. */
400
400
  allow_promotion_codes?: boolean;
401
+ /**
402
+ * The price the billing portal offers on that price's interval. Must be
403
+ * an active price of this product; anything else is a 400 on
404
+ * `default_price_id`. An explicit `null` **clears** the default and is
405
+ * sent as a JSON null rather than pruned (only `undefined` is dropped);
406
+ * omit the field to leave the default alone.
407
+ */
408
+ default_price_id?: string | null;
401
409
  }
402
410
  /**
403
411
  * Body for `POST /v1/prices/{id}`. Every field is optional; omitted ones
@@ -840,15 +848,20 @@ interface CreditNotesListParams extends BaseListParams {
840
848
  * VAT is decided against and that an invoice prints.
841
849
  *
842
850
  * `country_code` is required on every call: there is nothing to leave
843
- * alone about a jurisdiction. Every other field is partial-update: omit
844
- * it to leave the stored value alone, or pass an explicit `null` to
845
- * clear it, because ceasing to be VAT registered (or moving office) is a
846
- * real event.
851
+ * alone about a jurisdiction. The address fields and
852
+ * `registration_number` are partial-update: omit one to leave the stored
853
+ * value alone, or pass an explicit `null` to clear it, because moving
854
+ * office is a real event.
855
+ *
856
+ * `vat_id` can be set once. After that, a different value or `null` is
857
+ * refused with a 400 (`param: "vat_id"`, reason `vat_id_locked`) and the
858
+ * call writes nothing; re-sending the stored number is accepted. BillKit
859
+ * invoices you reverse-charged against it, so support changes it.
847
860
  */
848
861
  interface SetTenantBillingProfileParams extends IdempotencyOptions {
849
862
  /** ISO-3166-1 alpha-2, e.g. `"NL"`. */
850
863
  country_code: string;
851
- /** Your own EU VAT registration, or `null` to clear it. */
864
+ /** Your own EU VAT registration. Set once; support changes or clears it. */
852
865
  vat_id?: string | null;
853
866
  address_line1?: string | null;
854
867
  address_line2?: string | null;
@@ -958,7 +971,10 @@ declare class Customers extends BaseResource {
958
971
  declare class Products extends BaseResource {
959
972
  /** Create a catalog Product, then attach one or more Prices to it. */
960
973
  create<T = unknown>(params: CreateProductParams): Promise<T>;
961
- /** Expandable: `prices` (every price on the product), `stats`. */
974
+ /**
975
+ * Expandable: `prices` (every price on the product), `stats`, and
976
+ * `default_price` (the price `default_price_id` names).
977
+ */
962
978
  retrieve<T = unknown>(id: string, options?: ExpandOptions): Promise<T>;
963
979
  /**
964
980
  * Patch mutable Product fields, or archive it with `active: false`.
@@ -1610,7 +1626,7 @@ declare class RateLimitError extends BillKitError {
1610
1626
  });
1611
1627
  }
1612
1628
 
1613
- declare const VERSION = "0.7.0";
1629
+ declare const VERSION = "0.7.1";
1614
1630
 
1615
1631
  /**
1616
1632
  * Verify `BillKit-Signature: t=<unix>,v1=<hex>` headers.
package/dist/index.js CHANGED
@@ -166,7 +166,10 @@ var Products = class extends BaseResource {
166
166
  create(params) {
167
167
  return this.post("/v1/products", params);
168
168
  }
169
- /** Expandable: `prices` (every price on the product), `stats`. */
169
+ /**
170
+ * Expandable: `prices` (every price on the product), `stats`, and
171
+ * `default_price` (the price `default_price_id` names).
172
+ */
170
173
  retrieve(id, options = {}) {
171
174
  return this.get(`/v1/products/${p(id)}`, options);
172
175
  }
@@ -971,7 +974,7 @@ function sleep(ms) {
971
974
  }
972
975
 
973
976
  // src/version.ts
974
- var VERSION = "0.7.0";
977
+ var VERSION = "0.7.1";
975
978
 
976
979
  // src/transport.ts
977
980
  var DEFAULT_BASE_URL = "https://api.billkit.eu";