@zinn-digital/sdk 0.1.1938 → 0.1.1942

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
  */
@@ -41855,6 +41855,29 @@ export interface paths {
41855
41855
  patch?: never;
41856
41856
  trace?: never;
41857
41857
  };
41858
+ "/v1/orders/{orderId}/cancel": {
41859
+ parameters: {
41860
+ query?: never;
41861
+ header?: never;
41862
+ path: {
41863
+ /** @description The order's id. */
41864
+ orderId: components["parameters"]["OrderId"];
41865
+ };
41866
+ cookie?: never;
41867
+ };
41868
+ get?: never;
41869
+ put?: never;
41870
+ /**
41871
+ * Cancel your own unpaid order.
41872
+ * @description DAY-0296. Cancels an order that is still `pending_payment` or `payment_failed` and has no payment captured, refunded or still being confirmed (our record first, then the payment provider is asked). Nothing is charged. Cancelling an order that is already `canceled` returns it unchanged. A payment taken or still confirming is a `409` (`refusal.commerce.orderPaymentConfirmingCancel`); an order in any other state is a `409` (`refusal.commerce.orderNotUnpaidCancel`); another organization's order is a `404`. Requires `billing.payment.manage`. When the platform's unpaid-order expiry is switched on, an unpaid order is also cancelled automatically 7 days after placing, at least 48 hours after the reminder that named that date.
41873
+ */
41874
+ post: operations["cancelUnpaidOrder"];
41875
+ delete?: never;
41876
+ options?: never;
41877
+ head?: never;
41878
+ patch?: never;
41879
+ trace?: never;
41880
+ };
41858
41881
  "/v1/orders/{orderId}/customer-action": {
41859
41882
  parameters: {
41860
41883
  query?: never;
@@ -59526,6 +59549,33 @@ export interface paths {
59526
59549
  patch?: never;
59527
59550
  trace?: never;
59528
59551
  };
59552
+ "/v1/subscriptions/{subscriptionId}/renew-now": {
59553
+ parameters: {
59554
+ query?: never;
59555
+ header?: never;
59556
+ path: {
59557
+ /** @description The subscription to renew. */
59558
+ subscriptionId: components["schemas"]["Uuid"];
59559
+ };
59560
+ cookie?: never;
59561
+ };
59562
+ get?: never;
59563
+ put?: never;
59564
+ /**
59565
+ * Get the ONE unpaid order that renews this subscription now.
59566
+ * @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.
59567
+ *
59568
+ * 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.
59569
+ *
59570
+ * 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`.
59571
+ */
59572
+ post: operations["renewSubscriptionNow"];
59573
+ delete?: never;
59574
+ options?: never;
59575
+ head?: never;
59576
+ patch?: never;
59577
+ trace?: never;
59578
+ };
59529
59579
  "/v1/subscriptions/renewal-options": {
59530
59580
  parameters: {
59531
59581
  query?: never;
@@ -80781,6 +80831,28 @@ export interface components {
80781
80831
  /** @enum {string} */
80782
80832
  state: "queued" | "unavailable";
80783
80833
  };
80834
+ /**
80835
+ * @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.
80836
+ * @example once
80837
+ * @enum {string}
80838
+ */
80839
+ CardReuse: "once" | "save_for_renewals";
80840
+ /** @description What the card step offers this account. The engine's answer, so the browser never restates the market rule. */
80841
+ CardReuseOffer: {
80842
+ /**
80843
+ * @description Where `country` came from: the card's issuing country, the billing country, or neither is known (ungoverned, default-allow).
80844
+ * @enum {string}
80845
+ */
80846
+ basis: "card" | "billing" | "none";
80847
+ /**
80848
+ * @description The ISO 3166-1 alpha-2 country the offer was decided on, or empty.
80849
+ * @example ID
80850
+ */
80851
+ country: string;
80852
+ default: components["schemas"]["CardReuse"];
80853
+ /** @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. */
80854
+ shown: boolean;
80855
+ };
80784
80856
  Cart: {
80785
80857
  /** @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
80858
  coupon?: components["schemas"]["CartCoupon"] | null;
@@ -88578,6 +88650,11 @@ export interface components {
88578
88650
  };
88579
88651
  };
88580
88652
  ErrorDetail: {
88653
+ /**
88654
+ * @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>`).
88655
+ * @example /checkout?plan=starter&line=mainstream
88656
+ */
88657
+ checkout_url?: string;
88581
88658
  /** @example INVALID */
88582
88659
  code: string;
88583
88660
  /**
@@ -100347,6 +100424,9 @@ export interface components {
100347
100424
  * @description The mandate charged if the primary declines.
100348
100425
  */
100349
100426
  backup_payment_method_id: string | null;
100427
+ /** @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. */
100428
+ card_reuse_default: components["schemas"]["CardReuse"] | null;
100429
+ card_reuse_offer: components["schemas"]["CardReuseOffer"];
100350
100430
  /**
100351
100431
  * @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
100432
  * @example true
@@ -100366,11 +100446,13 @@ export interface components {
100366
100446
  primary_payment_method_id: string | null;
100367
100447
  };
100368
100448
  PaymentPreferencesUpdate: {
100449
+ /** @description Store the account's preference; `null` clears it. Audited. Stored only: no card payment reads it yet. */
100450
+ card_reuse_default?: components["schemas"]["CardReuse"] | null;
100369
100451
  /**
100370
100452
  * @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
100453
  * @example true
100372
100454
  */
100373
- pays_by_crypto: boolean;
100455
+ pays_by_crypto?: boolean;
100374
100456
  };
100375
100457
  /** @description One gateway — its catalogue, what is installed, and the last probe verdict. */
100376
100458
  PaymentProvider: {
@@ -104631,6 +104713,18 @@ export interface components {
104631
104713
  /** @description The site's new primary domain (FQDN). */
104632
104714
  new_domain: components["schemas"]["Hostname"];
104633
104715
  };
104716
+ /** @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`. */
104717
+ RenewNowOrder: {
104718
+ currency: string;
104719
+ order_id: components["schemas"]["Uuid"];
104720
+ order_number: string;
104721
+ periods: number;
104722
+ /** @description True when this order already existed. */
104723
+ reused: boolean;
104724
+ status: string;
104725
+ /** @description Including tax, server-computed. */
104726
+ total_amount_minor: number;
104727
+ };
104634
104728
  RepoBranch: {
104635
104729
  commit_sha: string;
104636
104730
  name: string;
@@ -193132,6 +193226,34 @@ export interface operations {
193132
193226
  429: components["responses"]["TooManyRequests"];
193133
193227
  };
193134
193228
  };
193229
+ cancelUnpaidOrder: {
193230
+ parameters: {
193231
+ query?: never;
193232
+ header?: never;
193233
+ path: {
193234
+ /** @description The order's id. */
193235
+ orderId: components["parameters"]["OrderId"];
193236
+ };
193237
+ cookie?: never;
193238
+ };
193239
+ requestBody?: never;
193240
+ responses: {
193241
+ /** @description The order, now canceled. */
193242
+ 200: {
193243
+ headers: {
193244
+ [name: string]: unknown;
193245
+ };
193246
+ content: {
193247
+ "application/json": components["schemas"]["Order"];
193248
+ };
193249
+ };
193250
+ 401: components["responses"]["Unauthorized"];
193251
+ 403: components["responses"]["Forbidden"];
193252
+ 404: components["responses"]["NotFound"];
193253
+ 409: components["responses"]["Conflict"];
193254
+ 429: components["responses"]["TooManyRequests"];
193255
+ };
193256
+ };
193135
193257
  openOrderCustomerAction: {
193136
193258
  parameters: {
193137
193259
  query?: never;
@@ -220828,6 +220950,45 @@ export interface operations {
220828
220950
  429: components["responses"]["TooManyRequests"];
220829
220951
  };
220830
220952
  };
220953
+ renewSubscriptionNow: {
220954
+ parameters: {
220955
+ query?: never;
220956
+ header?: never;
220957
+ path: {
220958
+ /** @description The subscription to renew. */
220959
+ subscriptionId: components["schemas"]["Uuid"];
220960
+ };
220961
+ cookie?: never;
220962
+ };
220963
+ requestBody?: never;
220964
+ responses: {
220965
+ /** @description The unpaid renewal order that already existed (reused). */
220966
+ 200: {
220967
+ headers: {
220968
+ "RateLimit-Remaining": components["headers"]["RateLimitRemaining"];
220969
+ [name: string]: unknown;
220970
+ };
220971
+ content: {
220972
+ "application/json": components["schemas"]["RenewNowOrder"];
220973
+ };
220974
+ };
220975
+ /** @description A new unpaid renewal order to settle. */
220976
+ 201: {
220977
+ headers: {
220978
+ "RateLimit-Remaining": components["headers"]["RateLimitRemaining"];
220979
+ [name: string]: unknown;
220980
+ };
220981
+ content: {
220982
+ "application/json": components["schemas"]["RenewNowOrder"];
220983
+ };
220984
+ };
220985
+ 401: components["responses"]["Unauthorized"];
220986
+ 403: components["responses"]["Forbidden"];
220987
+ 404: components["responses"]["NotFound"];
220988
+ 422: components["responses"]["UnprocessableEntity"];
220989
+ 429: components["responses"]["TooManyRequests"];
220990
+ };
220991
+ };
220831
220992
  listSubscriptionRenewalOptions: {
220832
220993
  parameters: {
220833
220994
  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.1942",
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>",