@zinn-digital/sdk 0.1.1938 → 0.1.1941

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.
@@ -27055,8 +27055,8 @@ export interface paths {
27055
27055
  */
27056
27056
  get: operations["getPaymentPreferences"];
27057
27057
  /**
27058
- * Elect (or stop) paying by crypto.
27059
- * @description Requires `billing.payment.manage` — the same key that gates adding and removing a payment method, because this **is** a payment-method decision. ⛔ Not `billing.invoice.manage`: it changes what we can charge, not what prints on an invoice.
27058
+ * Elect (or stop) paying by crypto, or store the card-reuse preference.
27059
+ * @description Either field may be sent alone (ONEPAY-A): `card_reuse_default` stores the account's preference between paying once and saving the card. Stored only: no card payment reads it yet, so it changes nothing about what is charged or kept. Requires `billing.payment.manage` — the same key that gates adding and removing a payment method, because this **is** a payment-method decision. ⛔ Not `billing.invoice.manage`: it changes what we can charge, not what prints on an invoice.
27060
27060
  *
27061
27061
  * Turning crypto **off** answers `409` when it is currently the only way the account can be charged and something is still going to charge it. The floor is on the resulting **state**, not on one of the two actions that can breach it — otherwise a customer could satisfy it with crypto, delete their last card, then switch crypto off.
27062
27062
  */
@@ -59526,6 +59526,33 @@ export interface paths {
59526
59526
  patch?: never;
59527
59527
  trace?: never;
59528
59528
  };
59529
+ "/v1/subscriptions/{subscriptionId}/renew-now": {
59530
+ parameters: {
59531
+ query?: never;
59532
+ header?: never;
59533
+ path: {
59534
+ /** @description The subscription to renew. */
59535
+ subscriptionId: components["schemas"]["Uuid"];
59536
+ };
59537
+ cookie?: never;
59538
+ };
59539
+ get?: never;
59540
+ put?: never;
59541
+ /**
59542
+ * Get the ONE unpaid order that renews this subscription now.
59543
+ * @description The "Renew now" button (ONEPAY-A2, owner 2026-11-19: *"we need a proper renew now button at any time"*). Works at any time: before the due date (pays the next period ahead), after it, and while the subscription is frozen (a hand-paid plan freezes on its due date with no grace; paying restores the same sites). ⛔⛔ **No money is taken here**: the client settles the returned order through `POST /v1/orders/{orderId}/pay`, which offers every rail.
59544
+ *
59545
+ * Creates **or reuses** exactly one unpaid order. The renewal order already waiting for the current period (the one the reminder mails link) is returned as it is; otherwise an unpaid prepayment for this period is returned; otherwise one is minted for the periods owed (at least one). Two clicks, two tabs or a retry therefore get the SAME order (`reused: true`, status `200`). The amount is always computed by the server, in integer minor units with its currency; the request has no body.
59546
+ *
59547
+ * Requires `billing.payment.manage` (the same authority as paying an invoice). Another organisation's subscription is `404`, never `403`. `422` carries a `code` in its details: `ALREADY_PAID` (this period is paid and is being applied), `SUBSCRIPTION_CANCELLED`, `NOT_RENEWABLE` (ended for good, comped, free, or a trial with no paid plan: its details then carry `checkout_url`, the checkout for the trialled plan), and prepay's own `RAIL_NOT_SUPPORTED` / `ORDER_IN_FLIGHT`.
59548
+ */
59549
+ post: operations["renewSubscriptionNow"];
59550
+ delete?: never;
59551
+ options?: never;
59552
+ head?: never;
59553
+ patch?: never;
59554
+ trace?: never;
59555
+ };
59529
59556
  "/v1/subscriptions/renewal-options": {
59530
59557
  parameters: {
59531
59558
  query?: never;
@@ -80781,6 +80808,28 @@ export interface components {
80781
80808
  /** @enum {string} */
80782
80809
  state: "queued" | "unavailable";
80783
80810
  };
80811
+ /**
80812
+ * @description A preference between paying once (`once`) and saving the card for automatic renewal (`save_for_renewals`). Today it is only stored as the account's preference (`card_reuse_default`): no card-payment request carries it and no payment reads it, so a card added at a signed-in card step is still saved to the account.
80813
+ * @example once
80814
+ * @enum {string}
80815
+ */
80816
+ CardReuse: "once" | "save_for_renewals";
80817
+ /** @description What the card step offers this account. The engine's answer, so the browser never restates the market rule. */
80818
+ CardReuseOffer: {
80819
+ /**
80820
+ * @description Where `country` came from: the card's issuing country, the billing country, or neither is known (ungoverned, default-allow).
80821
+ * @enum {string}
80822
+ */
80823
+ basis: "card" | "billing" | "none";
80824
+ /**
80825
+ * @description The ISO 3166-1 alpha-2 country the offer was decided on, or empty.
80826
+ * @example ID
80827
+ */
80828
+ country: string;
80829
+ default: components["schemas"]["CardReuse"];
80830
+ /** @description Whether this account's market allows an unattended card charge, so a choice to save the card could be offered. `false` in a market where it cannot be made. Informational: no screen offers the choice yet. */
80831
+ shown: boolean;
80832
+ };
80784
80833
  Cart: {
80785
80834
  /** @description What the typed hosting/SEO coupon did to this basket, or null when no coupon code is typed (a domain promotion code is reported on its lines instead). */
80786
80835
  coupon?: components["schemas"]["CartCoupon"] | null;
@@ -88578,6 +88627,11 @@ export interface components {
88578
88627
  };
88579
88628
  };
88580
88629
  ErrorDetail: {
88630
+ /**
88631
+ * @description Only on a `NOT_RENEWABLE` detail from `POST /v1/subscriptions/{subscriptionId}/renew-now` for a trial with no paid plan (ONEPAY-A2): the dashboard-relative checkout for the trialled plan (`/checkout?plan=<code>&line=<line>`).
88632
+ * @example /checkout?plan=starter&line=mainstream
88633
+ */
88634
+ checkout_url?: string;
88581
88635
  /** @example INVALID */
88582
88636
  code: string;
88583
88637
  /**
@@ -100347,6 +100401,9 @@ export interface components {
100347
100401
  * @description The mandate charged if the primary declines.
100348
100402
  */
100349
100403
  backup_payment_method_id: string | null;
100404
+ /** @description The account's stored preference between paying once and saving the card, or `null` for no preference. Stored only: no card payment reads it yet, and a card added at a signed-in card step is still saved to the account. */
100405
+ card_reuse_default: components["schemas"]["CardReuse"] | null;
100406
+ card_reuse_offer: components["schemas"]["CardReuseOffer"];
100350
100407
  /**
100351
100408
  * @description Whether the nominated backup could actually catch the primary's decline. `false` when there is no backup, or when it sits on a **different gateway** — a charge resolves one gateway per organisation, so a PayPal backup cannot rescue a Stripe primary. Surfaced so the customer is told when they nominate it, not on the night it fails.
100352
100409
  * @example true
@@ -100366,11 +100423,13 @@ export interface components {
100366
100423
  primary_payment_method_id: string | null;
100367
100424
  };
100368
100425
  PaymentPreferencesUpdate: {
100426
+ /** @description Store the account's preference; `null` clears it. Audited. Stored only: no card payment reads it yet. */
100427
+ card_reuse_default?: components["schemas"]["CardReuse"] | null;
100369
100428
  /**
100370
100429
  * @description Elect (or stop) paying by crypto. ⛔ Turning it **off** is refused with `409` when crypto is currently the only way the account can be charged and something is still going to charge it — the floor is on the resulting state, not on one of the two actions that can breach it.
100371
100430
  * @example true
100372
100431
  */
100373
- pays_by_crypto: boolean;
100432
+ pays_by_crypto?: boolean;
100374
100433
  };
100375
100434
  /** @description One gateway — its catalogue, what is installed, and the last probe verdict. */
100376
100435
  PaymentProvider: {
@@ -104631,6 +104690,18 @@ export interface components {
104631
104690
  /** @description The site's new primary domain (FQDN). */
104632
104691
  new_domain: components["schemas"]["Hostname"];
104633
104692
  };
104693
+ /** @description The ONE **unpaid** order that renews a subscription (`POST /v1/subscriptions/{subscriptionId}/renew-now`). ⛔⛔ No money has been taken; settle it through `POST /v1/orders/{orderId}/pay`. */
104694
+ RenewNowOrder: {
104695
+ currency: string;
104696
+ order_id: components["schemas"]["Uuid"];
104697
+ order_number: string;
104698
+ periods: number;
104699
+ /** @description True when this order already existed. */
104700
+ reused: boolean;
104701
+ status: string;
104702
+ /** @description Including tax, server-computed. */
104703
+ total_amount_minor: number;
104704
+ };
104634
104705
  RepoBranch: {
104635
104706
  commit_sha: string;
104636
104707
  name: string;
@@ -220828,6 +220899,45 @@ export interface operations {
220828
220899
  429: components["responses"]["TooManyRequests"];
220829
220900
  };
220830
220901
  };
220902
+ renewSubscriptionNow: {
220903
+ parameters: {
220904
+ query?: never;
220905
+ header?: never;
220906
+ path: {
220907
+ /** @description The subscription to renew. */
220908
+ subscriptionId: components["schemas"]["Uuid"];
220909
+ };
220910
+ cookie?: never;
220911
+ };
220912
+ requestBody?: never;
220913
+ responses: {
220914
+ /** @description The unpaid renewal order that already existed (reused). */
220915
+ 200: {
220916
+ headers: {
220917
+ "RateLimit-Remaining": components["headers"]["RateLimitRemaining"];
220918
+ [name: string]: unknown;
220919
+ };
220920
+ content: {
220921
+ "application/json": components["schemas"]["RenewNowOrder"];
220922
+ };
220923
+ };
220924
+ /** @description A new unpaid renewal order to settle. */
220925
+ 201: {
220926
+ headers: {
220927
+ "RateLimit-Remaining": components["headers"]["RateLimitRemaining"];
220928
+ [name: string]: unknown;
220929
+ };
220930
+ content: {
220931
+ "application/json": components["schemas"]["RenewNowOrder"];
220932
+ };
220933
+ };
220934
+ 401: components["responses"]["Unauthorized"];
220935
+ 403: components["responses"]["Forbidden"];
220936
+ 404: components["responses"]["NotFound"];
220937
+ 422: components["responses"]["UnprocessableEntity"];
220938
+ 429: components["responses"]["TooManyRequests"];
220939
+ };
220940
+ };
220831
220941
  listSubscriptionRenewalOptions: {
220832
220942
  parameters: {
220833
220943
  query?: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zinn-digital/sdk",
3
- "version": "0.1.1938",
3
+ "version": "0.1.1941",
4
4
  "description": "Typed TypeScript client for the Zinn Digital Platform API, generated from its OpenAPI spec.",
5
5
  "license": "MIT",
6
6
  "author": "Neil Lock \u2014 CEO, Zinn Digital\u00ae Ltd <office@zinndigital.com>",