@zinn-digital/sdk 0.1.2023 → 0.1.2026

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.
@@ -42856,7 +42856,7 @@ export interface paths {
42856
42856
  put?: never;
42857
42857
  /**
42858
42858
  * Cancel your own unpaid order.
42859
- * @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.
42859
+ * @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`. A card attempt the provider holds at `requires_payment_method` or `canceled` (nothing authorised) is cancelled at the provider first and does not block the cancel; a provider that cannot be asked keeps the `409`. The cancel is audit-logged (`order.cancelled_unpaid`). 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.
42860
42860
  */
42861
42861
  post: operations["cancelUnpaidOrder"];
42862
42862
  delete?: never;
@@ -60687,6 +60687,35 @@ export interface paths {
60687
60687
  patch?: never;
60688
60688
  trace?: never;
60689
60689
  };
60690
+ "/v1/subscriptions/{subscriptionId}/renewal-method": {
60691
+ parameters: {
60692
+ query?: never;
60693
+ header?: never;
60694
+ path: {
60695
+ /** @description The subscription whose "How this renews" choice is read or changed. */
60696
+ subscriptionId: components["schemas"]["Uuid"];
60697
+ };
60698
+ cookie?: never;
60699
+ };
60700
+ /**
60701
+ * Read how this plan renews (auto or by hand, and by which method).
60702
+ * @description The one per-plan "How this renews" read: `mode` (`auto` or `by_hand`), the `method` an automatic renewal uses (`card`, `paypal` or `crypto`; null when by hand) and the paid-until date, which no change of method ever moves. Requires `billing.payment.manage`; another tenant's plan is 404.
60703
+ */
60704
+ get: operations["getSubscriptionRenewalMethod"];
60705
+ put?: never;
60706
+ /**
60707
+ * Change how this plan renews, with nothing charged.
60708
+ * @description Switch between renewing **automatically** and paying **by hand** (by hand KEEPS the plan: each renewal is invoiced ahead with a pay link and no stored card or PayPal agreement is charged; account credit still settles it), and choose the method an automatic renewal uses: `card`, `paypal` or `crypto`.
60709
+ *
60710
+ * ⛔⛔ The old provider is cancelled **first** (a PayPal agreement is cancelled at PayPal before the plan is unbound; a crypto auto-renew plan is stopped), the paid-until date is kept and **nothing is charged** by this call. Choosing `paypal` returns an `approval_url` and grants nothing until PayPal's signed activation webhook arrives. `change_account: true` with `method: paypal` cancels the current agreement and opens a new one for a different PayPal account in the same call. Changing the card itself is the SCA/3-D Secure setup flow on the payment-methods surface.
60711
+ */
60712
+ post: operations["setSubscriptionRenewalMethod"];
60713
+ delete?: never;
60714
+ options?: never;
60715
+ head?: never;
60716
+ patch?: never;
60717
+ trace?: never;
60718
+ };
60690
60719
  "/v1/subscriptions/renewal-options": {
60691
60720
  parameters: {
60692
60721
  query?: never;
@@ -106631,6 +106660,50 @@ export interface components {
106631
106660
  /** @description The site's new primary domain (FQDN). */
106632
106661
  new_domain: components["schemas"]["Hostname"];
106633
106662
  };
106663
+ RenewalMethod: {
106664
+ /**
106665
+ * Format: uri
106666
+ * @description Where the buyer approves a new PayPal agreement; null otherwise.
106667
+ */
106668
+ approval_url: string | null;
106669
+ /**
106670
+ * @description The automatic method; null when the plan renews by hand.
106671
+ * @enum {string|null}
106672
+ */
106673
+ method: "card" | "paypal" | "crypto" | null;
106674
+ /** @enum {string} */
106675
+ mode: "auto" | "by_hand";
106676
+ /**
106677
+ * Format: date-time
106678
+ * @description The end of the paid period. No change of method moves it.
106679
+ */
106680
+ paid_until: string;
106681
+ /** @description True when a PayPal agreement is bound to this plan. */
106682
+ paypal_agreement_active: boolean;
106683
+ subscription_id: components["schemas"]["Uuid"];
106684
+ };
106685
+ RenewalMethodRequest: {
106686
+ /**
106687
+ * @description With `method` `paypal`, cancel the current agreement and approve a new PayPal account.
106688
+ * @default false
106689
+ */
106690
+ change_account: boolean;
106691
+ /**
106692
+ * Format: email
106693
+ * @description With `method` `crypto`, where the renewal links are e-mailed (defaults to the billing e-mail).
106694
+ */
106695
+ email?: string;
106696
+ /**
106697
+ * @description Required when `mode` is `auto`; ignored when `by_hand`.
106698
+ * @enum {string}
106699
+ */
106700
+ method?: "card" | "paypal" | "crypto";
106701
+ /**
106702
+ * @description Renew automatically, or pay each renewal by hand and keep the plan.
106703
+ * @enum {string}
106704
+ */
106705
+ mode: "auto" | "by_hand";
106706
+ };
106634
106707
  /** @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`. */
106635
106708
  RenewNowOrder: {
106636
106709
  currency: string;
@@ -197450,6 +197523,11 @@ export interface operations {
197450
197523
  * @example 3f6c1a52-8e0b-4d1e-9b7a-2c5d4e6f7a81
197451
197524
  */
197452
197525
  payment_method_id?: string;
197526
+ /**
197527
+ * @description Whether account credit pays first (BILLPARITY F1, owner 2026-11-22). Omit, or send `true`, for the default: the balance pays first and only the rest reaches `gateway`. Send `false` when the customer's balance covers the order but they chose to pay by card, PayPal or crypto instead: the balance is not drawn and the chosen rail is charged for the whole order. Anything that is not a JSON boolean is `422` with `details[0].field = use_balance`; `false` together with `credit_only: true` is a contradiction and also `422` on `use_balance`. Nothing is drawn or charged on either refusal.
197528
+ * @example false
197529
+ */
197530
+ use_balance?: boolean;
197453
197531
  };
197454
197532
  };
197455
197533
  };
@@ -225265,6 +225343,67 @@ export interface operations {
225265
225343
  429: components["responses"]["TooManyRequests"];
225266
225344
  };
225267
225345
  };
225346
+ getSubscriptionRenewalMethod: {
225347
+ parameters: {
225348
+ query?: never;
225349
+ header?: never;
225350
+ path: {
225351
+ /** @description The subscription whose "How this renews" choice is read or changed. */
225352
+ subscriptionId: components["schemas"]["Uuid"];
225353
+ };
225354
+ cookie?: never;
225355
+ };
225356
+ requestBody?: never;
225357
+ responses: {
225358
+ /** @description How this plan renews now. */
225359
+ 200: {
225360
+ headers: {
225361
+ [name: string]: unknown;
225362
+ };
225363
+ content: {
225364
+ "application/json": components["schemas"]["RenewalMethod"];
225365
+ };
225366
+ };
225367
+ 401: components["responses"]["Unauthorized"];
225368
+ 403: components["responses"]["Forbidden"];
225369
+ 404: components["responses"]["NotFound"];
225370
+ 429: components["responses"]["TooManyRequests"];
225371
+ };
225372
+ };
225373
+ setSubscriptionRenewalMethod: {
225374
+ parameters: {
225375
+ query?: never;
225376
+ header?: never;
225377
+ path: {
225378
+ /** @description The subscription whose "How this renews" choice is read or changed. */
225379
+ subscriptionId: components["schemas"]["Uuid"];
225380
+ };
225381
+ cookie?: never;
225382
+ };
225383
+ requestBody: {
225384
+ content: {
225385
+ "application/json": components["schemas"]["RenewalMethodRequest"];
225386
+ };
225387
+ };
225388
+ responses: {
225389
+ /** @description How this plan renews now, with an approval URL when PayPal needs one. */
225390
+ 200: {
225391
+ headers: {
225392
+ [name: string]: unknown;
225393
+ };
225394
+ content: {
225395
+ "application/json": components["schemas"]["RenewalMethod"];
225396
+ };
225397
+ };
225398
+ 400: components["responses"]["UnprocessableEntity"];
225399
+ 401: components["responses"]["Unauthorized"];
225400
+ 403: components["responses"]["Forbidden"];
225401
+ 404: components["responses"]["NotFound"];
225402
+ 422: components["responses"]["UnprocessableEntity"];
225403
+ 429: components["responses"]["TooManyRequests"];
225404
+ 503: components["responses"]["ServiceUnavailable"];
225405
+ };
225406
+ };
225268
225407
  listSubscriptionRenewalOptions: {
225269
225408
  parameters: {
225270
225409
  query?: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zinn-digital/sdk",
3
- "version": "0.1.2023",
3
+ "version": "0.1.2026",
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>",