@zinn-digital/sdk 0.1.2022 → 0.1.2025

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.
@@ -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;
@@ -123052,6 +123125,8 @@ export interface components {
123052
123125
  auto_topup_last_run_at?: string | null;
123053
123126
  /** @description The most automatic top-ups may buy in one calendar month (UTC), in minor units; `0` means no monthly limit. A top-up that would pass it is skipped, never charged. A saved card from a market that forbids unattended card charges is likewise never charged automatically (PayPal still is). */
123054
123127
  auto_topup_monthly_cap_minor?: number;
123128
+ /** @description When the next scheduled crypto invoice is sent; `null` without a schedule. */
123129
+ auto_topup_next_due_at?: string | null;
123055
123130
  /**
123056
123131
  * @description Derived. Non-empty when the rule's rail cannot run in this currency, so the rule is PAUSED: nothing is charged and no other method is substituted. `crypto_usd_only` = the account switched off USD while the rule pays in crypto; choosing another rail (or switching back to USD) resumes it. The customer is e-mailed once per switch (`wallet.auto_topup_paused`).
123057
123132
  * @enum {string}
@@ -123064,6 +123139,11 @@ export interface components {
123064
123139
  * @enum {string}
123065
123140
  */
123066
123141
  auto_topup_rail?: "saved_method" | "crypto" | "paypal_subscription";
123142
+ /**
123143
+ * @description `""` = top up when the balance falls below the trigger. A schedule runs on the `crypto` rail only: on each due date a crypto invoice (USD only) for `auto_topup_amount_minor` is e-mailed with a pay link, whatever the balance, plus one reminder before the next date. Nothing is ever charged automatically and a due date missed by the sweep sends ONE invoice, never a backlog.
123144
+ * @enum {string}
123145
+ */
123146
+ auto_topup_schedule?: "" | "weekly" | "monthly" | "quarterly";
123067
123147
  /** @description Buy more credit when the balance falls below this. */
123068
123148
  auto_topup_trigger_minor?: number;
123069
123149
  currency: string;
@@ -123082,6 +123162,11 @@ export interface components {
123082
123162
  * @enum {string}
123083
123163
  */
123084
123164
  auto_topup_rail?: "saved_method" | "crypto";
123165
+ /**
123166
+ * @description Absent = keep. A schedule with any rail other than `crypto` is a 422 (`refusal.wallet.scheduleCryptoOnly`); moving a scheduled rule to `saved_method` clears it. A new schedule sends its first invoice on the next sweep.
123167
+ * @enum {string}
123168
+ */
123169
+ auto_topup_schedule?: "" | "weekly" | "monthly" | "quarterly";
123085
123170
  auto_topup_trigger_minor?: number;
123086
123171
  low_balance_threshold_minor?: number;
123087
123172
  };
@@ -197438,6 +197523,11 @@ export interface operations {
197438
197523
  * @example 3f6c1a52-8e0b-4d1e-9b7a-2c5d4e6f7a81
197439
197524
  */
197440
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;
197441
197531
  };
197442
197532
  };
197443
197533
  };
@@ -225253,6 +225343,67 @@ export interface operations {
225253
225343
  429: components["responses"]["TooManyRequests"];
225254
225344
  };
225255
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
+ };
225256
225407
  listSubscriptionRenewalOptions: {
225257
225408
  parameters: {
225258
225409
  query?: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zinn-digital/sdk",
3
- "version": "0.1.2022",
3
+ "version": "0.1.2025",
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>",