@zinn-digital/sdk 0.1.1936 → 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.
- package/dist/generated/schema.d.ts +132 -10
- package/package.json +1 -1
|
@@ -10873,7 +10873,7 @@ export interface paths {
|
|
|
10873
10873
|
put?: never;
|
|
10874
10874
|
/**
|
|
10875
10875
|
* Record that nothing is owed for an unmatched payment (staff, audited).
|
|
10876
|
-
* @description Closes the row as `ignored`. A note saying why is required (`422 refusal.orphanPayment.noteRequired`). Requires staff + `billing.payment.manage`; audited as `orphan_payment.ignored`.
|
|
10876
|
+
* @description Closes the row as `ignored`. A note saying why is required (`422 refusal.orphanPayment.noteRequired`); on a `surplus` row it must be 20+ characters (`422 refusal.orphanPayment.surplusReasonRequired`). Requires staff + `billing.payment.manage`; audited as `orphan_payment.ignored`.
|
|
10877
10877
|
*/
|
|
10878
10878
|
post: operations["ignoreOrphanPayment"];
|
|
10879
10879
|
delete?: never;
|
|
@@ -10893,7 +10893,7 @@ export interface paths {
|
|
|
10893
10893
|
put?: never;
|
|
10894
10894
|
/**
|
|
10895
10895
|
* Credit an unmatched payment to a customer's wallet (staff, audited).
|
|
10896
|
-
* @description Closes the row as `linked` and credits the named, non-closed customer's wallet with the payment's amount, once (idempotent on the row). `422` with `refusal.orphanPayment.*` when the account is closed, unknown, or the amount is unknown; `409` when the row already has a decision. Requires staff + `billing.payment.manage`; audited as `orphan_payment.linked`.
|
|
10896
|
+
* @description Closes the row as `linked` and credits the named, non-closed customer's wallet with the payment's amount, once (idempotent on the row). `422` with `refusal.orphanPayment.*` when the account is closed, unknown, or the amount is unknown; `409` when the row already has a decision. A `surplus` row credits only the account whose order it paid (`422 refusal.orphanPayment.surplusOrgMismatch`), the provider-confirmed amount, once (keyed on the provider payment). Requires staff + `billing.payment.manage`; audited as `orphan_payment.linked`.
|
|
10897
10897
|
*/
|
|
10898
10898
|
post: operations["linkOrphanPayment"];
|
|
10899
10899
|
delete?: never;
|
|
@@ -10913,7 +10913,7 @@ export interface paths {
|
|
|
10913
10913
|
put?: never;
|
|
10914
10914
|
/**
|
|
10915
10915
|
* Refund an unmatched payment at the provider that took it (staff, audited).
|
|
10916
|
-
* @description Refunds the full amount through the same provider (a PayPal subscription charge as a v1 sale refund), after cancelling its provider subscription first when `cancel_subscription` is true (the default). A provider refusal is a `422` and leaves the row open: no money moved. Idempotent on the row. Requires staff + `billing.refund`; audited as `orphan_payment.refunded`.
|
|
10916
|
+
* @description Refunds the full amount through the same provider (a PayPal subscription charge as a v1 sale refund), after cancelling its provider subscription first when `cancel_subscription` is true (the default). A provider refusal is a `422` and leaves the row open: no money moved. Idempotent on the row. A `surplus` row is never refunded to its source: `422 refusal.orphanPayment.surplusCreditOnly` (refunds are account credit only; use link). Requires staff + `billing.refund`; audited as `orphan_payment.refunded`.
|
|
10917
10917
|
*/
|
|
10918
10918
|
post: operations["refundOrphanPayment"];
|
|
10919
10919
|
delete?: never;
|
|
@@ -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
|
/**
|
|
@@ -98278,18 +98332,30 @@ export interface components {
|
|
|
98278
98332
|
claimed_org_id: string;
|
|
98279
98333
|
/** @description ISO 4217; empty when the provider did not say. */
|
|
98280
98334
|
currency: string;
|
|
98335
|
+
/** @description The provider's own figures for a `surplus` row (crypto: what actually arrived, pay currency and amount, the quote). Empty on every other kind. */
|
|
98336
|
+
details: {
|
|
98337
|
+
[key: string]: unknown;
|
|
98338
|
+
};
|
|
98281
98339
|
event_type: string;
|
|
98282
98340
|
/** Format: date-time */
|
|
98283
98341
|
first_seen_at: string;
|
|
98284
98342
|
/** Format: uuid */
|
|
98285
98343
|
id: string;
|
|
98286
|
-
/**
|
|
98287
|
-
|
|
98344
|
+
/**
|
|
98345
|
+
* @description `surplus` (DOUBLEPAY): a second payment for an order another payment (or account credit) had already paid. HELD for staff: credit it to the order's own account (link, with that org) or ignore it with a reason of 20+ characters; a refund to the source is refused (`422 refusal.orphanPayment.surplusCreditOnly`), as refunds are account credit only.
|
|
98346
|
+
* @enum {string}
|
|
98347
|
+
*/
|
|
98348
|
+
kind: "payment" | "unmatched" | "subscription_charge" | "closed_org" | "provider_subscription" | "surplus";
|
|
98288
98349
|
/** Format: date-time */
|
|
98289
98350
|
last_seen_at: string;
|
|
98290
98351
|
/** Format: uuid */
|
|
98291
98352
|
linked_org_id: string | null;
|
|
98292
98353
|
livemode: boolean;
|
|
98354
|
+
/**
|
|
98355
|
+
* Format: uuid
|
|
98356
|
+
* @description The order a `surplus` row paid twice; null on every other kind.
|
|
98357
|
+
*/
|
|
98358
|
+
order_id: string | null;
|
|
98293
98359
|
payer_email: string;
|
|
98294
98360
|
/** @enum {string} */
|
|
98295
98361
|
provider: "stripe" | "paypal" | "nowpayments";
|
|
@@ -100335,6 +100401,9 @@ export interface components {
|
|
|
100335
100401
|
* @description The mandate charged if the primary declines.
|
|
100336
100402
|
*/
|
|
100337
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"];
|
|
100338
100407
|
/**
|
|
100339
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.
|
|
100340
100409
|
* @example true
|
|
@@ -100354,11 +100423,13 @@ export interface components {
|
|
|
100354
100423
|
primary_payment_method_id: string | null;
|
|
100355
100424
|
};
|
|
100356
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;
|
|
100357
100428
|
/**
|
|
100358
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.
|
|
100359
100430
|
* @example true
|
|
100360
100431
|
*/
|
|
100361
|
-
pays_by_crypto
|
|
100432
|
+
pays_by_crypto?: boolean;
|
|
100362
100433
|
};
|
|
100363
100434
|
/** @description One gateway — its catalogue, what is installed, and the last probe verdict. */
|
|
100364
100435
|
PaymentProvider: {
|
|
@@ -104619,6 +104690,18 @@ export interface components {
|
|
|
104619
104690
|
/** @description The site's new primary domain (FQDN). */
|
|
104620
104691
|
new_domain: components["schemas"]["Hostname"];
|
|
104621
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
|
+
};
|
|
104622
104705
|
RepoBranch: {
|
|
104623
104706
|
commit_sha: string;
|
|
104624
104707
|
name: string;
|
|
@@ -193209,7 +193292,7 @@ export interface operations {
|
|
|
193209
193292
|
401: components["responses"]["Unauthorized"];
|
|
193210
193293
|
403: components["responses"]["Forbidden"];
|
|
193211
193294
|
404: components["responses"]["NotFound"];
|
|
193212
|
-
/** @description `error.details[0].code` `COUPON_WITHDRAWN` (docs/1311): the order's coupon claim had lapsed while it sat unpaid and the code can no longer be used (its cap was reached, or this customer has used it since), so the code was removed and the order repriced to the full total, tax re-rated. Nothing was charged; the keyed message (`refusal.commerce.couponWithdrawn`) states the new total, and paying again pays it. */
|
|
193295
|
+
/** @description `error.details[0].code` `COUPON_WITHDRAWN` (docs/1311): the order's coupon claim had lapsed while it sat unpaid and the code can no longer be used (its cap was reached, or this customer has used it since), so the code was removed and the order repriced to the full total, tax re-rated. Nothing was charged; the keyed message (`refusal.commerce.couponWithdrawn`) states the new total, and paying again pays it. Also (DAY-0350): another payment for this order is already being processed (a second tab, or a PayPal capture in progress), so nothing was asked of any processor and nothing was charged; `error.refusal.key` is `refusal.commerce.paymentInFlight`. Wait a moment and refresh the order: it is either paid or payable again. A failed attempt frees the order at once; an attempt whose outcome is unknown frees it after 10 minutes. */
|
|
193213
193296
|
409: {
|
|
193214
193297
|
headers: {
|
|
193215
193298
|
[name: string]: unknown;
|
|
@@ -193380,7 +193463,7 @@ export interface operations {
|
|
|
193380
193463
|
401: components["responses"]["Unauthorized"];
|
|
193381
193464
|
403: components["responses"]["Forbidden"];
|
|
193382
193465
|
404: components["responses"]["NotFound"];
|
|
193383
|
-
/** @description Nothing was captured: the account credit the PayPal order was priced against is no longer there (open PayPal again), or a dedicated server sold since approval. */
|
|
193466
|
+
/** @description Nothing was captured: the account credit the PayPal order was priced against is no longer there (open PayPal again), or a dedicated server sold since approval. Also (DAY-0350): another payment for this order is already being processed (a card payment or a second capture), so PayPal was not asked to capture and nothing was taken; `error.refusal.key` is `refusal.commerce.paymentInFlight`. Wait a moment and refresh the order. */
|
|
193384
193467
|
409: {
|
|
193385
193468
|
headers: {
|
|
193386
193469
|
[name: string]: unknown;
|
|
@@ -220816,6 +220899,45 @@ export interface operations {
|
|
|
220816
220899
|
429: components["responses"]["TooManyRequests"];
|
|
220817
220900
|
};
|
|
220818
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
|
+
};
|
|
220819
220941
|
listSubscriptionRenewalOptions: {
|
|
220820
220942
|
parameters: {
|
|
220821
220943
|
query?: {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zinn-digital/sdk",
|
|
3
|
-
"version": "0.1.
|
|
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>",
|