@zinn-digital/sdk 0.1.1950 → 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 +22 -3
- package/package.json +1 -1
|
@@ -27125,7 +27125,7 @@ export interface paths {
|
|
|
27125
27125
|
get: operations["getBillingProfile"];
|
|
27126
27126
|
/**
|
|
27127
27127
|
* Replace the organization's billing profile.
|
|
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
|
|
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.
|
|
27129
27129
|
*/
|
|
27130
27130
|
put: operations["updateBillingProfile"];
|
|
27131
27131
|
post?: never;
|
|
@@ -47290,10 +47290,12 @@ export interface paths {
|
|
|
47290
47290
|
put?: never;
|
|
47291
47291
|
/**
|
|
47292
47292
|
* What these net prices look like to a signed-out visitor, after VAT.
|
|
47293
|
-
* @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**.
|
|
47294
47294
|
*
|
|
47295
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.
|
|
47296
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
|
+
*
|
|
47297
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.
|
|
47298
47300
|
*/
|
|
47299
47301
|
post: operations["quotePublicTaxDisplay"];
|
|
@@ -79233,7 +79235,7 @@ export interface components {
|
|
|
79233
79235
|
/** @example GB123456789 */
|
|
79234
79236
|
vat_number: string;
|
|
79235
79237
|
/**
|
|
79236
|
-
* @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.
|
|
79237
79239
|
* @example unvalidated
|
|
79238
79240
|
* @enum {string}
|
|
79239
79241
|
*/
|
|
@@ -103389,7 +103391,10 @@ export interface components {
|
|
|
103389
103391
|
legal_name?: string;
|
|
103390
103392
|
postcode?: string;
|
|
103391
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. */
|
|
103392
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;
|
|
103393
103398
|
};
|
|
103394
103399
|
PublicCart: {
|
|
103395
103400
|
currency: components["schemas"]["CurrencyCode"];
|
|
@@ -117850,6 +117855,16 @@ export interface components {
|
|
|
117850
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. */
|
|
117851
117856
|
rate_bps: number;
|
|
117852
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
|
+
};
|
|
117853
117868
|
};
|
|
117854
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. */
|
|
117855
117870
|
TaxQuoteRequest: {
|
|
@@ -117858,6 +117873,8 @@ export interface components {
|
|
|
117858
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`.
|
|
117859
117874
|
*/
|
|
117860
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;
|
|
117861
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). */
|
|
117862
117879
|
country?: string;
|
|
117863
117880
|
/** @description ISO 4217. Defaults to the `docs/29` §3.1 resolution for the request. */
|
|
@@ -117881,6 +117898,8 @@ export interface components {
|
|
|
117881
117898
|
}[];
|
|
117882
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. */
|
|
117883
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;
|
|
117884
117903
|
};
|
|
117885
117904
|
/** @description One dated VAT rate for one country and category (docs/34 §2.4). */
|
|
117886
117905
|
TaxRate: {
|
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>",
|