@zinn-digital/sdk 0.1.1948 → 0.1.1953
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 +192 -3
- package/package.json +1 -1
|
@@ -10802,6 +10802,49 @@ export interface paths {
|
|
|
10802
10802
|
patch?: never;
|
|
10803
10803
|
trace?: never;
|
|
10804
10804
|
};
|
|
10805
|
+
"/v1/admin/orphan-debits": {
|
|
10806
|
+
parameters: {
|
|
10807
|
+
query?: never;
|
|
10808
|
+
header?: never;
|
|
10809
|
+
path?: never;
|
|
10810
|
+
cookie?: never;
|
|
10811
|
+
};
|
|
10812
|
+
/**
|
|
10813
|
+
* Every unresolved orphan wallet debit (credit taken, no payment recorded) — staff queue.
|
|
10814
|
+
* @description DAY-0351 / X173 R2. A wallet debit keyed to an order whose matching payment was never recorded is NEVER repaired by itself; this is the queue staff decide from (one row per debit, across orgs, last 60 days; a debit with a resolution is gone from it). Requires staff + `billing.entitlement.manage`.
|
|
10815
|
+
*/
|
|
10816
|
+
get: operations["listOrphanDebits"];
|
|
10817
|
+
put?: never;
|
|
10818
|
+
post?: never;
|
|
10819
|
+
delete?: never;
|
|
10820
|
+
options?: never;
|
|
10821
|
+
head?: never;
|
|
10822
|
+
patch?: never;
|
|
10823
|
+
trace?: never;
|
|
10824
|
+
};
|
|
10825
|
+
"/v1/admin/orphan-debits/{debitId}/resolve": {
|
|
10826
|
+
parameters: {
|
|
10827
|
+
query?: never;
|
|
10828
|
+
header?: never;
|
|
10829
|
+
path: {
|
|
10830
|
+
/** @description The wallet debit (`CreditDrawdown` / `ClientWalletEntry`) id. */
|
|
10831
|
+
debitId: string;
|
|
10832
|
+
};
|
|
10833
|
+
cookie?: never;
|
|
10834
|
+
};
|
|
10835
|
+
get?: never;
|
|
10836
|
+
put?: never;
|
|
10837
|
+
/**
|
|
10838
|
+
* Resolve one orphan wallet debit ONCE — apply it to the order, or give it back as credit (staff, audit-logged).
|
|
10839
|
+
* @description Records ONE resolution per debit and carries it out in the debit's own org scope. `apply` settles the order from the debit already taken (no second debit) and is refused (409, `details[0].code`) unless the order still awaits payment (`order_not_awaiting`) and the debit covers its whole total (`amount_mismatch`). When a later credit to the org names the order/debit OR equals the amount, both actions answer **422 `later_credit_found`** whose detail names that credit (`credit_id`, `credit_at`; staff only) and nothing is recorded: `apply` is never allowed then (it would pay the customer twice); `give_back` may be repeated WITH `already_given_back: true` (and the required reason) to record the debit as already given back, which moves NO money and names the found credit on the resolution and the audit row. `already_given_back: true` with no such later credit is refused 422 `no_later_credit` (it never closes a debit without money given back); with `apply` it is refused 422 `bad_action`. Otherwise `give_back` credits the amount back to the wallet (credit only, never a card). The two exclude each other (`other_action_taken`); a second press of the same action returns the first result with `created: false` and writes no second audit row. Audit actions `orphan_debit.apply` / `orphan_debit.give_back` (platform rows; the org in metadata). Requires staff + `billing.entitlement.manage`.
|
|
10840
|
+
*/
|
|
10841
|
+
post: operations["resolveOrphanDebit"];
|
|
10842
|
+
delete?: never;
|
|
10843
|
+
options?: never;
|
|
10844
|
+
head?: never;
|
|
10845
|
+
patch?: never;
|
|
10846
|
+
trace?: never;
|
|
10847
|
+
};
|
|
10805
10848
|
"/v1/admin/orphan-payments": {
|
|
10806
10849
|
parameters: {
|
|
10807
10850
|
query?: never;
|
|
@@ -27082,7 +27125,7 @@ export interface paths {
|
|
|
27082
27125
|
get: operations["getBillingProfile"];
|
|
27083
27126
|
/**
|
|
27084
27127
|
* Replace the organization's billing profile.
|
|
27085
|
-
* @description A full replace (PUT) of the editable "Bill to" fields; an omitted field resets to blank. `billing_address` (with its required `country`, needed for tax) is the one mandatory member. Editing changes only invoices issued **afterwards** — a past invoice snapshotted the buyer block at issue time and is never rewritten (docs/34 §1.1). `vat_status` is engine-owned (the validate-not-trust flow, §2.3) and is not accepted here
|
|
27128
|
+
* @description A full replace (PUT) of the editable "Bill to" fields; an omitted field resets to blank. `billing_address` (with its required `country`, needed for tax) is the one mandatory member. Editing changes only invoices issued **afterwards** — a past invoice snapshotted the buyer block at issue time and is never rewritten (docs/34 §1.1). `vat_status` is engine-owned (the validate-not-trust flow, §2.3) and is not accepted here. A changed `vat_number` (or a changed billing country with a number on file) is checked against the VAT registry **in this request**, bounded to three seconds, and the response carries the result: `valid` (VAT is removed on the next invoice where the reverse charge applies), `invalid`, or `pending` when the registry did not answer (VAT is charged and the number is re-checked daily). A number the registry cannot be asked about (for example a UK number) stays `unvalidated`. The save is never refused because a lookup failed. A `vat_number` whose country prefix names a different country from `billing_address.country` is refused with `422` (`XI` is accepted for `GB`, `EL` for `GR`). Requires `billing.invoice.manage` in the target organization.
|
|
27086
27129
|
*/
|
|
27087
27130
|
put: operations["updateBillingProfile"];
|
|
27088
27131
|
post?: never;
|
|
@@ -47247,10 +47290,12 @@ export interface paths {
|
|
|
47247
47290
|
put?: never;
|
|
47248
47291
|
/**
|
|
47249
47292
|
* What these net prices look like to a signed-out visitor, after VAT.
|
|
47250
|
-
* @description The anonymous half of `quoteTaxDisplay` (#1482). Same answer, one difference that matters: there is no organisation, so
|
|
47293
|
+
* @description The anonymous half of `quoteTaxDisplay` (#1482). Same answer, one difference that matters: there is no organisation, so a visitor is treated as a consumer **unless the server itself confirms the VAT number they typed**.
|
|
47251
47294
|
*
|
|
47252
47295
|
* ⛔ **This route accepts no buyer-validation flag, deliberately.** Reverse charge turns on a VIES-validated number and the seller carries the liability for granting it wrongly (`docs/34` §2.3), so a client-supplied validation claim would be a request to zero-rate a sale on the buyer's own say-so. Treating everyone as a consumer is also the safe direction: it over-states rather than under-states the tax due.
|
|
47253
47296
|
*
|
|
47297
|
+
* A visitor may send the `vat_number` they typed at checkout. The server asks the registry itself and prices on that answer, returned as `vat_check` with a signed `pin`. `POST /v1/public/checkout` takes the pin back as `billing.vat_pin` and prices the order on the same answer, so the quote and the order always agree. When the registry cannot be reached the quote is priced **with** VAT and says so (`vat_check.status: unavailable`); it never refuses the quote.
|
|
47298
|
+
*
|
|
47254
47299
|
* Country comes from the request body or Cloudflare's `CF-IPCountry`. The answer is always `estimated: true` — a pricing page runs on a geo hint, and the charge is rated again at checkout against real place-of-supply evidence.
|
|
47255
47300
|
*/
|
|
47256
47301
|
post: operations["quotePublicTaxDisplay"];
|
|
@@ -65834,6 +65879,68 @@ export interface components {
|
|
|
65834
65879
|
site_id: components["schemas"]["Uuid"];
|
|
65835
65880
|
verdict: string;
|
|
65836
65881
|
};
|
|
65882
|
+
/** @description One wallet debit keyed to an order with no payment recorded at its attempt key (DAY-0351). */
|
|
65883
|
+
AdminOrphanDebit: {
|
|
65884
|
+
/**
|
|
65885
|
+
* Format: int64
|
|
65886
|
+
* @description The debit in integer minor units (§2.8).
|
|
65887
|
+
*/
|
|
65888
|
+
amount_minor: number;
|
|
65889
|
+
currency: components["schemas"]["CurrencyCode"];
|
|
65890
|
+
/** Format: uuid */
|
|
65891
|
+
debit_id: string;
|
|
65892
|
+
/** @enum {string} */
|
|
65893
|
+
ledger: "account_credit" | "client_float";
|
|
65894
|
+
order_currency: components["schemas"]["CurrencyCode"];
|
|
65895
|
+
/** Format: uuid */
|
|
65896
|
+
order_id: string;
|
|
65897
|
+
order_ref: string;
|
|
65898
|
+
order_status: string;
|
|
65899
|
+
/** Format: int64 */
|
|
65900
|
+
order_total_minor: number;
|
|
65901
|
+
/** Format: uuid */
|
|
65902
|
+
org_id: string;
|
|
65903
|
+
};
|
|
65904
|
+
/** @description The ONE staff decision on an orphan wallet debit. */
|
|
65905
|
+
AdminOrphanDebitResolution: {
|
|
65906
|
+
/** @enum {string} */
|
|
65907
|
+
action: "apply" | "give_back";
|
|
65908
|
+
actor: string;
|
|
65909
|
+
/** @description True when staff recorded the debit as already given back by an earlier credit: no money moved. */
|
|
65910
|
+
already_given_back: boolean;
|
|
65911
|
+
/** Format: int64 */
|
|
65912
|
+
amount_minor: number;
|
|
65913
|
+
/** @description False on a second press (nothing was done). */
|
|
65914
|
+
created: boolean;
|
|
65915
|
+
/** Format: date-time */
|
|
65916
|
+
created_at: string;
|
|
65917
|
+
currency: components["schemas"]["CurrencyCode"];
|
|
65918
|
+
debit_id: string;
|
|
65919
|
+
/** @description When `already_given_back`: the later credit found (`<ledger>:<id>`); else empty. */
|
|
65920
|
+
found_credit_ref: string;
|
|
65921
|
+
/** Format: uuid */
|
|
65922
|
+
id: string;
|
|
65923
|
+
/** @enum {string} */
|
|
65924
|
+
ledger: "account_credit" | "client_float";
|
|
65925
|
+
/** Format: uuid */
|
|
65926
|
+
order_id: string;
|
|
65927
|
+
/** Format: uuid */
|
|
65928
|
+
org_id: string;
|
|
65929
|
+
reason: string;
|
|
65930
|
+
/** @description `apply`: the Payment id; `give_back`: the credit's idempotency key; empty when `already_given_back` (no money moved). */
|
|
65931
|
+
result_ref: string;
|
|
65932
|
+
};
|
|
65933
|
+
AdminOrphanDebitResolveRequest: {
|
|
65934
|
+
/** @enum {string} */
|
|
65935
|
+
action: "apply" | "give_back";
|
|
65936
|
+
/**
|
|
65937
|
+
* @description Only with `give_back`, and only after a 422 `later_credit_found`: staff confirm that the credit it named already gave this debit back. Records the resolution and moves no money. Refused (`no_later_credit`) when no such credit exists.
|
|
65938
|
+
* @default false
|
|
65939
|
+
*/
|
|
65940
|
+
already_given_back: boolean;
|
|
65941
|
+
/** @description Recorded on the resolution and in the audit row. */
|
|
65942
|
+
reason: string;
|
|
65943
|
+
};
|
|
65837
65944
|
/** @description A customer's own outbound mail service, as staff see it. Read-only, and it carries no credential and no vault path - only what answers "is their sender verified, and is it refusing messages?". The pointer to their API key answers neither. */
|
|
65838
65945
|
AdminOutboundMail: {
|
|
65839
65946
|
consecutive_failures: number;
|
|
@@ -79128,7 +79235,7 @@ export interface components {
|
|
|
79128
79235
|
/** @example GB123456789 */
|
|
79129
79236
|
vat_number: string;
|
|
79130
79237
|
/**
|
|
79131
|
-
* @description State of the validate-not-trust check on `vat_number` (docs/34 §2.3). Read-only
|
|
79238
|
+
* @description State of the validate-not-trust check on `vat_number` (docs/34 §2.3). Read-only. A change to `vat_number` is checked at once: `valid` or `invalid` when the registry answered, `pending` when it did not (re-checked daily), `unvalidated` when the number cannot be checked. Only `valid` removes VAT.
|
|
79132
79239
|
* @example unvalidated
|
|
79133
79240
|
* @enum {string}
|
|
79134
79241
|
*/
|
|
@@ -88741,6 +88848,13 @@ export interface components {
|
|
|
88741
88848
|
checkout_url?: string;
|
|
88742
88849
|
/** @example INVALID */
|
|
88743
88850
|
code: string;
|
|
88851
|
+
/**
|
|
88852
|
+
* Format: date-time
|
|
88853
|
+
* @description Only beside `credit_id`: when that credit was given.
|
|
88854
|
+
*/
|
|
88855
|
+
credit_at?: string;
|
|
88856
|
+
/** @description Only on a `later_credit_found` detail of a 422 from the staff-only `POST /v1/admin/orphan-debits/{debitId}/resolve`: the later credit found (`<ledger>:<id>`, ledger `account_credit` or `client_float`). */
|
|
88857
|
+
credit_id?: string;
|
|
88744
88858
|
/**
|
|
88745
88859
|
* @description JSON path to the offending field.
|
|
88746
88860
|
* @example default_currency
|
|
@@ -103277,7 +103391,10 @@ export interface components {
|
|
|
103277
103391
|
legal_name?: string;
|
|
103278
103392
|
postcode?: string;
|
|
103279
103393
|
region?: string;
|
|
103394
|
+
/** @description Optional. Stored on the new account's billing details. The order is priced on the answer `vat_pin` records, never on a fresh lookup, so it cannot differ from the quote the visitor saw. With no valid pin the number is saved, VAT is charged on this order, and the number is checked again within minutes for later invoices. A number whose country prefix names a country other than `country` is refused `422` (`vat_number_country_mismatch`). A UK number cannot be checked yet and VAT is charged. */
|
|
103280
103395
|
vat_number?: string;
|
|
103396
|
+
/** @description Optional. The `vat_check.pin` from `POST /v1/public/pricing/tax-quote` for this same `country` and `vat_number`. A pin that is missing, expired, tampered with or issued for another country or number is ignored (the order is priced with VAT); it never refuses the checkout. */
|
|
103397
|
+
vat_pin?: string;
|
|
103281
103398
|
};
|
|
103282
103399
|
PublicCart: {
|
|
103283
103400
|
currency: components["schemas"]["CurrencyCode"];
|
|
@@ -117738,6 +117855,16 @@ export interface components {
|
|
|
117738
117855
|
/** @description The single rate behind `notice`, or `0` where the basket carries more than one. A mixed basket (hosting at the buyer's rate, a website build at UK 20%) genuinely has no single rate, and naming one of them would be a false statement. */
|
|
117739
117856
|
rate_bps: number;
|
|
117740
117857
|
tax_total_minor: number;
|
|
117858
|
+
/** @description Present only when the public request carried a `vat_number`. What the server's own registry check said, and the figures above are priced on it. */
|
|
117859
|
+
vat_check?: {
|
|
117860
|
+
/** @description An opaque, signed, short-lived record of this answer. Send it back as `billing.vat_pin` on `POST /v1/public/checkout` with the same country and number, and the order is priced on exactly this answer, so the total shown and the total placed cannot differ. Without it the order is priced with VAT. */
|
|
117861
|
+
pin: string;
|
|
117862
|
+
/**
|
|
117863
|
+
* @description `confirmed`: the registry confirmed the number and the quote is priced as a business sale (reverse charge where the rules give one). `not_confirmed`: the registry says the number is not valid; VAT is shown. `unavailable`: the registry did not answer in time, or the lookup allowance is used up; VAT is shown and charged on this order, and the number is checked again within minutes so later invoices follow the confirmed answer. `not_checkable`: no registry can be asked about this country yet (a UK number); VAT is shown.
|
|
117864
|
+
* @enum {string}
|
|
117865
|
+
*/
|
|
117866
|
+
status: "confirmed" | "not_confirmed" | "unavailable" | "not_checkable";
|
|
117867
|
+
};
|
|
117741
117868
|
};
|
|
117742
117869
|
/** @description Net amounts the caller already holds, to be rated for display (#1482). ⛔ Nothing here re-prices: the amounts come from the catalogue and come back rated, so this cannot become a second source of prices. Send exactly one of `items` (display-only previews: bounded, never charged) or `cart_id` (signed-in route only: the server re-prices the caller's own cart exactly as `GET /v1/carts/{cartId}` does and builds the lines itself, so a checkout figure never rests on client amounts). Both together, or neither, is a 422. */
|
|
117743
117870
|
TaxQuoteRequest: {
|
|
@@ -117746,6 +117873,8 @@ export interface components {
|
|
|
117746
117873
|
* @description Signed-in route only (the public route refuses it with a 422). The caller's own open cart; the quote rates its server-repriced lines (`ref` = line id, net = the line's `line_total_minor`) in the cart's currency. Another organisation's cart is a 404. Mutually exclusive with `items`.
|
|
117747
117874
|
*/
|
|
117748
117875
|
cart_id?: string;
|
|
117876
|
+
/** @description Public route only, optional. The visitor's guest cart token; used only to bound how many VAT registry lookups one cart may cause. */
|
|
117877
|
+
cart_token?: string;
|
|
117749
117878
|
/** @description ISO 3166-1 alpha-2 destination. On the signed-in route this overrides the stored billing country (the customer may be pricing an address they have not saved). Omitted, the public route falls back to Cloudflare's `CF-IPCountry`; the signed-in route falls back to the stored billing country and then to `CF-IPCountry`, answering `estimated: true` for any figure not rated on the stored country (a signed-in customer with no saved address is shown the VAT their basket will carry rather than the net figure alone). */
|
|
117750
117879
|
country?: string;
|
|
117751
117880
|
/** @description ISO 4217. Defaults to the `docs/29` §3.1 resolution for the request. */
|
|
@@ -117769,6 +117898,8 @@ export interface components {
|
|
|
117769
117898
|
}[];
|
|
117770
117899
|
/** @description Absent means false. Which question is asked. `false` prices a BASKET exactly as its invoice will be rounded (VAT once per rate group, leftover cents by largest remainder), so the totals are what checkout charges: use it for a cart or checkout. `true` prices a LIST of independent items, each rated as its own one-item invoice, so an item shows the same cents whatever else is in the request: use it for a price list or plan table. The totals of a `per_item` quote are a sum of standalone prices, not a basket. Only a literal `true` enables it. */
|
|
117771
117900
|
per_item?: boolean;
|
|
117901
|
+
/** @description Public route only (the signed-in route prices on the stored billing profile and ignores it). The VAT number the visitor typed at checkout. It needs `country` in the body. A number that is malformed, longer than 32 characters, sent without a country, or whose prefix names another country is never sent to the registry and answers `vat_check.status: not_confirmed` (the quote itself is not refused; the checkout refuses a mismatched prefix with a `422`). The **server** asks the VAT registry (3 second cut-off; answers are cached by a hash of country and number, a confirmation for 24 hours, anything else for 10 minutes; lookups are rate-limited per visitor and per cart) and prices on its own answer: the caller never states whether the number is valid. The answer comes back as `vat_check`. */
|
|
117902
|
+
vat_number?: string;
|
|
117772
117903
|
};
|
|
117773
117904
|
/** @description One dated VAT rate for one country and category (docs/34 §2.4). */
|
|
117774
117905
|
TaxRate: {
|
|
@@ -140050,6 +140181,64 @@ export interface operations {
|
|
|
140050
140181
|
429: components["responses"]["TooManyRequests"];
|
|
140051
140182
|
};
|
|
140052
140183
|
};
|
|
140184
|
+
listOrphanDebits: {
|
|
140185
|
+
parameters: {
|
|
140186
|
+
query?: never;
|
|
140187
|
+
header?: never;
|
|
140188
|
+
path?: never;
|
|
140189
|
+
cookie?: never;
|
|
140190
|
+
};
|
|
140191
|
+
requestBody?: never;
|
|
140192
|
+
responses: {
|
|
140193
|
+
/** @description The unresolved orphan debits. */
|
|
140194
|
+
200: {
|
|
140195
|
+
headers: {
|
|
140196
|
+
[name: string]: unknown;
|
|
140197
|
+
};
|
|
140198
|
+
content: {
|
|
140199
|
+
"application/json": {
|
|
140200
|
+
data: components["schemas"]["AdminOrphanDebit"][];
|
|
140201
|
+
};
|
|
140202
|
+
};
|
|
140203
|
+
};
|
|
140204
|
+
401: components["responses"]["Unauthorized"];
|
|
140205
|
+
403: components["responses"]["Forbidden"];
|
|
140206
|
+
429: components["responses"]["TooManyRequests"];
|
|
140207
|
+
};
|
|
140208
|
+
};
|
|
140209
|
+
resolveOrphanDebit: {
|
|
140210
|
+
parameters: {
|
|
140211
|
+
query?: never;
|
|
140212
|
+
header?: never;
|
|
140213
|
+
path: {
|
|
140214
|
+
/** @description The wallet debit (`CreditDrawdown` / `ClientWalletEntry`) id. */
|
|
140215
|
+
debitId: string;
|
|
140216
|
+
};
|
|
140217
|
+
cookie?: never;
|
|
140218
|
+
};
|
|
140219
|
+
requestBody: {
|
|
140220
|
+
content: {
|
|
140221
|
+
"application/json": components["schemas"]["AdminOrphanDebitResolveRequest"];
|
|
140222
|
+
};
|
|
140223
|
+
};
|
|
140224
|
+
responses: {
|
|
140225
|
+
/** @description The resolution (the first one, on a second press). */
|
|
140226
|
+
200: {
|
|
140227
|
+
headers: {
|
|
140228
|
+
[name: string]: unknown;
|
|
140229
|
+
};
|
|
140230
|
+
content: {
|
|
140231
|
+
"application/json": components["schemas"]["AdminOrphanDebitResolution"];
|
|
140232
|
+
};
|
|
140233
|
+
};
|
|
140234
|
+
401: components["responses"]["Unauthorized"];
|
|
140235
|
+
403: components["responses"]["Forbidden"];
|
|
140236
|
+
404: components["responses"]["NotFound"];
|
|
140237
|
+
409: components["responses"]["Conflict"];
|
|
140238
|
+
422: components["responses"]["UnprocessableEntity"];
|
|
140239
|
+
429: components["responses"]["TooManyRequests"];
|
|
140240
|
+
};
|
|
140241
|
+
};
|
|
140053
140242
|
listOrphanPayments: {
|
|
140054
140243
|
parameters: {
|
|
140055
140244
|
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.1953",
|
|
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>",
|