@zinn-digital/sdk 0.1.1926 → 0.1.1930
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 +57 -6
- package/package.json +1 -1
|
@@ -43901,6 +43901,8 @@ export interface paths {
|
|
|
43901
43901
|
* The response carries whichever credential the chosen rail needs: `client_token` is a card intent's client secret for the browser SDK, `redirect_url` is an approval page for PayPal or a crypto invoice. `settled: true` means the total was zero and the order completed with no gateway at all.
|
|
43902
43902
|
*
|
|
43903
43903
|
* ⛔ Nothing here captures money and nothing here decides an order is paid. The gateway's webhook does both, exactly as it does for every other order on the platform.
|
|
43904
|
+
*
|
|
43905
|
+
* ⛔ This link needs no sign-in, so it never charges a payment method the payer org stored earlier, on any rail (a saved card, a saved PayPal account), and never draws the org's account credit: the first press always answers with the step where the payer presents a payment. A refusal carries its code in `error.details[].code` (`field: payment`) and is recorded on the audit log.
|
|
43904
43906
|
*/
|
|
43905
43907
|
post: operations["startDirectInvoicePayment"];
|
|
43906
43908
|
delete?: never;
|
|
@@ -43920,11 +43922,11 @@ export interface paths {
|
|
|
43920
43922
|
put?: never;
|
|
43921
43923
|
/**
|
|
43922
43924
|
* The payer entered a card — record it and take the money. Unauthenticated.
|
|
43923
|
-
* @description The second half of a two-step that cannot be collapsed into one.
|
|
43925
|
+
* @description The second half of a two-step that cannot be collapsed into one. The card rail of `/checkout` always answers with a **SetupIntent** (`status: setup_required`, nothing charged), whether or not the payer's organization already has a saved card: this link is public, so a saved card is never charged from it. The payer confirms the intent in the browser and lands here; this records the mandate and charges ONLY that card (never a saved one, and never another saved one after this card is declined).
|
|
43924
43926
|
*
|
|
43925
43927
|
* Charging on the first call instead would put a failed payment on the order — this platform classifies a mandate-less charge as *nothing was presented* — and the capture webhook refuses to settle one of those, so the money would be taken and never recorded.
|
|
43926
43928
|
*
|
|
43927
|
-
* `setup_intent_id` is an id and not a credential. The mandate behind it is re-read from the gateway and refused unless the gateway itself says it belongs to this invoice's payer, so holding one pay link cannot attach a stranger's saved card.
|
|
43929
|
+
* `setup_intent_id` is an id and not a credential. The mandate behind it is re-read from the gateway and refused unless the gateway itself says it belongs to this invoice's payer, so holding one pay link cannot attach a stranger's saved card. It must also be the intent THIS link opened (an intent of the same organization opened elsewhere is refused with the same `409`), and it must have succeeded at the gateway: an intent still awaiting authentication is not a card yet and nothing is recorded or charged.
|
|
43928
43930
|
*/
|
|
43929
43931
|
post: operations["confirmDirectInvoicePayment"];
|
|
43930
43932
|
delete?: never;
|
|
@@ -100275,6 +100277,42 @@ export interface components {
|
|
|
100275
100277
|
charge_currencies?: {
|
|
100276
100278
|
[key: string]: string;
|
|
100277
100279
|
};
|
|
100280
|
+
/** @description `getOrderPaymentOptions` only (owner 2026-11-18: crypto is USD only at checkout, docs/311). `null` when crypto is not offered for this order or the order is already USD. Otherwise either the EXACT USD quote a crypto payment would charge (`available: true`), which the customer confirms by sending `total_minor` as `payOrder.expected_usd_total_minor`, or `available: false` with why this order cannot be switched to USD (crypto stays offered; the screen shows `message`). */
|
|
100281
|
+
crypto_usd?: {
|
|
100282
|
+
available: boolean;
|
|
100283
|
+
/**
|
|
100284
|
+
* @description Always `USD` when available.
|
|
100285
|
+
* @example USD
|
|
100286
|
+
*/
|
|
100287
|
+
currency?: string;
|
|
100288
|
+
/** @description The refusal, rendered in the request's locale. */
|
|
100289
|
+
message?: string;
|
|
100290
|
+
/** @example refusal.commerce.cryptoUsdUnavailable */
|
|
100291
|
+
message_key?: string;
|
|
100292
|
+
/** @example TRY */
|
|
100293
|
+
order_currency?: string;
|
|
100294
|
+
/**
|
|
100295
|
+
* @description The order's total in its own currency, before conversion.
|
|
100296
|
+
* @example 210000
|
|
100297
|
+
*/
|
|
100298
|
+
order_total_minor?: number;
|
|
100299
|
+
/** Format: date */
|
|
100300
|
+
rate_date?: string | null;
|
|
100301
|
+
/** @description When unavailable, the machine reason: `order_status`, `invoice_issued`, `payment_exists`, `authorisation_in_flight`, `fulfilment_exists`, `refund_exists`, `linked_amount`, or `no_rate`. */
|
|
100302
|
+
reason?: string;
|
|
100303
|
+
/** @example 1000 */
|
|
100304
|
+
tax_minor?: number;
|
|
100305
|
+
/**
|
|
100306
|
+
* @description The exact USD total, tax included, in minor units.
|
|
100307
|
+
* @example 6000
|
|
100308
|
+
*/
|
|
100309
|
+
total_minor?: number;
|
|
100310
|
+
/**
|
|
100311
|
+
* @description Decimal string, one major unit of `order_currency` in USD.
|
|
100312
|
+
* @example 0.0285714
|
|
100313
|
+
*/
|
|
100314
|
+
usd_rate?: string;
|
|
100315
|
+
} | null;
|
|
100278
100316
|
/** @description Provider codes (`stripe`, `paypal`, `nowpayments`). Never empty — `stripe` is always present, because an unreadable provider registry must not be reported as "nothing is enabled". */
|
|
100279
100317
|
gateways: string[];
|
|
100280
100318
|
/**
|
|
@@ -119233,7 +119271,7 @@ export interface components {
|
|
|
119233
119271
|
TrialEligibility: {
|
|
119234
119272
|
/** @description ⚖️ 2026-10-21 (ZEAB2): a verified payment method we can charge off-session later is already on file for this org (a Stripe card, wallet, SEPA, Link, Revolut Pay or Amazon Pay mandate, or a vaulted PayPal account; never charged), so a `requires_card` trial can start without the card step. s1014 row 145: any gateway, not only Stripe. */
|
|
119235
119273
|
card_on_file?: boolean;
|
|
119236
|
-
/** @description The crypto alternative to the card step: deposit `amount_minor` `currency` (the plan's first monthly price, never below the smallest wallet top-up; a settled deposit of the first month is what starts the trial) through `POST /v1/wallet/top-ups` with `gateway: nowpayments`. `null` when the trial needs no card, the plan has no monthly price
|
|
119274
|
+
/** @description The crypto alternative to the card step: deposit `amount_minor` `currency` (the plan's first monthly price, never below the smallest wallet top-up; a settled deposit of the first month is what starts the trial) through `POST /v1/wallet/top-ups` with `gateway: nowpayments`. ⛔ Always `USD`, whatever the caller's currency: crypto is taken in US dollars only, and a USD deposit is measured against the plan's USD first month. `null` when the trial needs no card, the plan has no USD monthly price, or no crypto rail is enabled. */
|
|
119237
119275
|
crypto_prepay?: {
|
|
119238
119276
|
/**
|
|
119239
119277
|
* Format: int64
|
|
@@ -121789,7 +121827,7 @@ export interface components {
|
|
|
121789
121827
|
/** @description The option set on every line in that category (`V2`). */
|
|
121790
121828
|
app_tracking_option: string;
|
|
121791
121829
|
/**
|
|
121792
|
-
* @description `RAIL:CURRENCY` → the Xero **AccountID** each rail's money is paid into when a finalised period is settled (docs/311). ⛔ An AccountID, never a name: three apps post into one Xero organisation, and a name pick put another app's crypto into V2's account (ZH-4323). An absent key means that rail+currency is not settled by code; a configured id that is missing, archived or in another currency refuses that payment.
|
|
121830
|
+
* @description `RAIL:CURRENCY` → the Xero **AccountID** each rail's money is paid into when a finalised period is settled (docs/311). ⛔ An AccountID, never a name: three apps post into one Xero organisation, and a name pick put another app's crypto into V2's account (ZH-4323). An absent key means that rail+currency is not settled by code; a configured id that is missing, archived or in another currency refuses that payment. ⛔ Crypto is settled in USD only: a `NOWPAYMENTS:<non-USD>` key is refused with 422 `refusal.accounting.cryptoClearingUsdOnly` and nothing is saved.
|
|
121793
121831
|
* @example {
|
|
121794
121832
|
* "NOWPAYMENTS:USD": "96ade7e4-bb78-4fb7-8996-4f915bd9661f"
|
|
121795
121833
|
* }
|
|
@@ -193103,6 +193141,11 @@ export interface operations {
|
|
|
193103
193141
|
requestBody?: {
|
|
193104
193142
|
content: {
|
|
193105
193143
|
"application/json": {
|
|
193144
|
+
/**
|
|
193145
|
+
* @description Crypto is priced and invoiced in USD only (owner 2026-11-18, docs/311). When `gateway` is `nowpayments` and the unpaid order is in another currency, the exact USD total (minor units) the customer confirmed from `getOrderPaymentOptions.crypto_usd.total_minor`. The order is converted to USD in place only when this equals the engine's current quote; otherwise `422` with `details[0].code = USD_CONFIRMATION_REQUIRED` and `details[0].message` = the current exact USD total, nothing charged and nothing converted. Ignored for any other rail or a USD order.
|
|
193146
|
+
* @example 6000
|
|
193147
|
+
*/
|
|
193148
|
+
expected_usd_total_minor?: number;
|
|
193106
193149
|
/**
|
|
193107
193150
|
* @description The rail to settle on (`stripe`, `paypal`, `nowpayments`). Omit to use the org's nominated payment method. `422` if it is not one of this order's `getOrderPaymentOptions`.
|
|
193108
193151
|
* @example paypal
|
|
@@ -193147,7 +193190,7 @@ export interface operations {
|
|
|
193147
193190
|
"application/json": components["schemas"]["Error"];
|
|
193148
193191
|
};
|
|
193149
193192
|
};
|
|
193150
|
-
/** @description The order is in a state that cannot be paid (canceled, refunding, draft), or `gateway` names a rail this order may not be settled on, or the card's share is under the gateway's smallest charge and account credit cannot cover the whole order (docs/31 §4.4), or the gateway answered and refused the charge. Nothing was charged and any account credit drawn was given back. `refusal.commerce.priorPaymentHeld` (STRIPEFIX r3, docs/05): the previous attempt cannot be resolved safely (the gateway no longer knows it, or it captured another amount), so nothing new was attempted and staff were alerted; the message quotes the order reference. */
|
|
193193
|
+
/** @description The order is in a state that cannot be paid (canceled, refunding, draft), or `gateway` names a rail this order may not be settled on, or the card's share is under the gateway's smallest charge and account credit cannot cover the whole order (docs/31 §4.4), or the gateway answered and refused the charge. Nothing was charged and any account credit drawn was given back. `refusal.commerce.priorPaymentHeld` (STRIPEFIX r3, docs/05): the previous attempt cannot be resolved safely (the gateway no longer knows it, or it captured another amount), so nothing new was attempted and staff were alerted; the message quotes the order reference. On the crypto rail for a non-USD order, `details[0].code` is `USD_CONFIRMATION_REQUIRED` (send `expected_usd_total_minor` equal to `details[0].message`) or `CRYPTO_USD_UNAVAILABLE` (the order cannot be switched to USD: `details[0].message` names why, e.g. account credit applied, a coupon, or no exchange rate; pay by card). */
|
|
193151
193194
|
422: {
|
|
193152
193195
|
headers: {
|
|
193153
193196
|
[name: string]: unknown;
|
|
@@ -223635,7 +223678,15 @@ export interface operations {
|
|
|
223635
223678
|
401: components["responses"]["Unauthorized"];
|
|
223636
223679
|
403: components["responses"]["Forbidden"];
|
|
223637
223680
|
404: components["responses"]["NotFound"];
|
|
223638
|
-
|
|
223681
|
+
/** @description The top-up cannot be started. `details[0].code` `CRYPTO_USD_ONLY` (owner 2026-11-18, docs/311): a crypto (`nowpayments`) top-up of a non-USD balance is refused before anything is charged, because crypto is priced in USD only; top up by card or PayPal, or hold a USD balance. */
|
|
223682
|
+
422: {
|
|
223683
|
+
headers: {
|
|
223684
|
+
[name: string]: unknown;
|
|
223685
|
+
};
|
|
223686
|
+
content: {
|
|
223687
|
+
"application/json": components["schemas"]["Error"];
|
|
223688
|
+
};
|
|
223689
|
+
};
|
|
223639
223690
|
429: components["responses"]["TooManyRequests"];
|
|
223640
223691
|
};
|
|
223641
223692
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zinn-digital/sdk",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.1930",
|
|
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>",
|