@paygentic/sdk 0.9.3 → 0.9.4
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/commonjs/lib/config.d.ts +2 -2
- package/dist/commonjs/lib/config.js +2 -2
- package/dist/commonjs/models/invoice.d.ts +21 -1
- package/dist/commonjs/models/invoice.d.ts.map +1 -1
- package/dist/commonjs/models/invoice.js +16 -1
- package/dist/commonjs/models/invoice.js.map +1 -1
- package/dist/esm/lib/config.d.ts +2 -2
- package/dist/esm/lib/config.js +2 -2
- package/dist/esm/models/invoice.d.ts +21 -1
- package/dist/esm/models/invoice.d.ts.map +1 -1
- package/dist/esm/models/invoice.js +15 -0
- package/dist/esm/models/invoice.js.map +1 -1
- package/jsr.json +1 -1
- package/package.json +1 -1
- package/src/lib/config.ts +2 -2
- package/src/models/invoice.ts +30 -1
|
@@ -31,8 +31,8 @@ export declare function serverURLFromOptions(options: SDKOptions): URL | null;
|
|
|
31
31
|
export declare const SDK_METADATA: {
|
|
32
32
|
readonly language: "typescript";
|
|
33
33
|
readonly openapiDocVersion: "0.1.0";
|
|
34
|
-
readonly sdkVersion: "0.9.
|
|
34
|
+
readonly sdkVersion: "0.9.4";
|
|
35
35
|
readonly genVersion: "2.879.13";
|
|
36
|
-
readonly userAgent: "speakeasy-sdk/typescript 0.9.
|
|
36
|
+
readonly userAgent: "speakeasy-sdk/typescript 0.9.4 2.879.13 0.1.0 @paygentic/sdk";
|
|
37
37
|
};
|
|
38
38
|
//# sourceMappingURL=config.d.ts.map
|
|
@@ -35,8 +35,8 @@ function serverURLFromOptions(options) {
|
|
|
35
35
|
exports.SDK_METADATA = {
|
|
36
36
|
language: "typescript",
|
|
37
37
|
openapiDocVersion: "0.1.0",
|
|
38
|
-
sdkVersion: "0.9.
|
|
38
|
+
sdkVersion: "0.9.4",
|
|
39
39
|
genVersion: "2.879.13",
|
|
40
|
-
userAgent: "speakeasy-sdk/typescript 0.9.
|
|
40
|
+
userAgent: "speakeasy-sdk/typescript 0.9.4 2.879.13 0.1.0 @paygentic/sdk",
|
|
41
41
|
};
|
|
42
42
|
//# sourceMappingURL=config.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as z from "zod/v3";
|
|
2
|
-
import { ClosedEnum } from "../types/enums.js";
|
|
2
|
+
import { ClosedEnum, OpenEnum } from "../types/enums.js";
|
|
3
3
|
import { Result as SafeParseResult } from "../types/fp.js";
|
|
4
4
|
import { SDKValidationError } from "./errors/sdkvalidationerror.js";
|
|
5
5
|
import { InvoiceLineItem } from "./invoicelineitem.js";
|
|
@@ -50,6 +50,20 @@ export declare const PdfSource: {
|
|
|
50
50
|
* Who produced the document at pdfUrl, or null when there is none. `paygentic` means pdfUrl is this API's download endpoint and the request must carry your API key; `tax_provider` means it is the provider's own link, which opens directly in a browser.
|
|
51
51
|
*/
|
|
52
52
|
export type PdfSource = ClosedEnum<typeof PdfSource>;
|
|
53
|
+
/**
|
|
54
|
+
* Why no Paygentic-rendered document exists for this invoice, or null when none was withheld. A tax-registered merchant's document is a compliance artefact, so it is withheld unless the recorded tax reconciles with the provider exactly and the registered issuer identity is complete. Non-null therefore always accompanies pdfSource `tax_provider` or null, and never `paygentic`. Use it to tell a withheld document apart from an invoice the tax provider serves by design — both report pdfSource `tax_provider`, but only a withheld one can be repaired by POST /v2/invoices/{id}/generate-pdf. `tax_unreconciled`: the provider's tax figure was never recorded against this invoice. `issuer_identity_incomplete`: the registered legal name, tax ID or address could not be read. `tax_component_unpriceable`: a recorded tax component carried no presentable amount. `ledger_mismatch`: the recorded tax figures and the invoice's own totals disagree. `tax_provider_disagrees`: the provider re-read its filing and reported a different tax to the one this invoice was charged — terminal, because correcting an issued invoice is a credit note's job, so retrying the repair cannot clear it. New values may be added, so treat an unrecognised one as withheld rather than failing.
|
|
55
|
+
*/
|
|
56
|
+
export declare const DocumentWithheldReason: {
|
|
57
|
+
readonly TaxUnreconciled: "tax_unreconciled";
|
|
58
|
+
readonly IssuerIdentityIncomplete: "issuer_identity_incomplete";
|
|
59
|
+
readonly TaxComponentUnpriceable: "tax_component_unpriceable";
|
|
60
|
+
readonly LedgerMismatch: "ledger_mismatch";
|
|
61
|
+
readonly TaxProviderDisagrees: "tax_provider_disagrees";
|
|
62
|
+
};
|
|
63
|
+
/**
|
|
64
|
+
* Why no Paygentic-rendered document exists for this invoice, or null when none was withheld. A tax-registered merchant's document is a compliance artefact, so it is withheld unless the recorded tax reconciles with the provider exactly and the registered issuer identity is complete. Non-null therefore always accompanies pdfSource `tax_provider` or null, and never `paygentic`. Use it to tell a withheld document apart from an invoice the tax provider serves by design — both report pdfSource `tax_provider`, but only a withheld one can be repaired by POST /v2/invoices/{id}/generate-pdf. `tax_unreconciled`: the provider's tax figure was never recorded against this invoice. `issuer_identity_incomplete`: the registered legal name, tax ID or address could not be read. `tax_component_unpriceable`: a recorded tax component carried no presentable amount. `ledger_mismatch`: the recorded tax figures and the invoice's own totals disagree. `tax_provider_disagrees`: the provider re-read its filing and reported a different tax to the one this invoice was charged — terminal, because correcting an issued invoice is a credit note's job, so retrying the repair cannot clear it. New values may be added, so treat an unrecognised one as withheld rather than failing.
|
|
65
|
+
*/
|
|
66
|
+
export type DocumentWithheldReason = OpenEnum<typeof DocumentWithheldReason>;
|
|
53
67
|
/**
|
|
54
68
|
* The current status of the invoice
|
|
55
69
|
*/
|
|
@@ -198,6 +212,10 @@ export type Invoice = {
|
|
|
198
212
|
* Who produced the document at pdfUrl, or null when there is none. `paygentic` means pdfUrl is this API's download endpoint and the request must carry your API key; `tax_provider` means it is the provider's own link, which opens directly in a browser.
|
|
199
213
|
*/
|
|
200
214
|
pdfSource?: PdfSource | null | undefined;
|
|
215
|
+
/**
|
|
216
|
+
* Why no Paygentic-rendered document exists for this invoice, or null when none was withheld. A tax-registered merchant's document is a compliance artefact, so it is withheld unless the recorded tax reconciles with the provider exactly and the registered issuer identity is complete. Non-null therefore always accompanies pdfSource `tax_provider` or null, and never `paygentic`. Use it to tell a withheld document apart from an invoice the tax provider serves by design — both report pdfSource `tax_provider`, but only a withheld one can be repaired by POST /v2/invoices/{id}/generate-pdf. `tax_unreconciled`: the provider's tax figure was never recorded against this invoice. `issuer_identity_incomplete`: the registered legal name, tax ID or address could not be read. `tax_component_unpriceable`: a recorded tax component carried no presentable amount. `ledger_mismatch`: the recorded tax figures and the invoice's own totals disagree. `tax_provider_disagrees`: the provider re-read its filing and reported a different tax to the one this invoice was charged — terminal, because correcting an issued invoice is a credit note's job, so retrying the repair cannot clear it. New values may be added, so treat an unrecognised one as withheld rather than failing.
|
|
217
|
+
*/
|
|
218
|
+
documentWithheldReason?: DocumentWithheldReason | null | undefined;
|
|
201
219
|
/**
|
|
202
220
|
* The end of the billing period
|
|
203
221
|
*/
|
|
@@ -255,6 +273,8 @@ export declare function invoiceLineItemsFromJSON(jsonString: string): SafeParseR
|
|
|
255
273
|
/** @internal */
|
|
256
274
|
export declare const PdfSource$inboundSchema: z.ZodNativeEnum<typeof PdfSource>;
|
|
257
275
|
/** @internal */
|
|
276
|
+
export declare const DocumentWithheldReason$inboundSchema: z.ZodType<DocumentWithheldReason, z.ZodTypeDef, unknown>;
|
|
277
|
+
/** @internal */
|
|
258
278
|
export declare const InvoiceStatus$inboundSchema: z.ZodNativeEnum<typeof InvoiceStatus>;
|
|
259
279
|
/** @internal */
|
|
260
280
|
export declare const Tax$inboundSchema: z.ZodType<Tax, z.ZodTypeDef, unknown>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"invoice.d.ts","sourceRoot":"","sources":["../../../src/models/invoice.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,CAAC,MAAM,QAAQ,CAAC;
|
|
1
|
+
{"version":3,"file":"invoice.d.ts","sourceRoot":"","sources":["../../../src/models/invoice.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,CAAC,MAAM,QAAQ,CAAC;AAG5B,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC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;AAEhC,gBAAgB;AAChB,eAAO,MAAM,8BAA8B,EAAE,CAAC,CAAC,OAAO,CACpD,gBAAgB,EAChB,CAAC,CAAC,UAAU,EACZ,OAAO,CAOP,CAAC;AAEH,wBAAgB,wBAAwB,CACtC,UAAU,EAAE,MAAM,GACjB,eAAe,CAAC,gBAAgB,EAAE,kBAAkB,CAAC,CAMvD;AAED,gBAAgB;AAChB,eAAO,MAAM,uBAAuB,EAAE,CAAC,CAAC,aAAa,CAAC,OAAO,SAAS,CAC9C,CAAC;AAEzB,gBAAgB;AAChB,eAAO,MAAM,oCAAoC,EAAE,CAAC,CAAC,OAAO,CAC1D,sBAAsB,EACtB,CAAC,CAAC,UAAU,EACZ,OAAO,CAC0C,CAAC;AAEpD,gBAAgB;AAChB,eAAO,MAAM,2BAA2B,EAAE,CAAC,CAAC,aAAa,CACvD,OAAO,aAAa,CACS,CAAC;AAEhC,gBAAgB;AAChB,eAAO,MAAM,iBAAiB,EAAE,CAAC,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,CAAC,UAAU,EAAE,OAAO,CAWhE,CAAC;AAEL,wBAAgB,WAAW,CACzB,UAAU,EAAE,MAAM,GACjB,eAAe,CAAC,GAAG,EAAE,kBAAkB,CAAC,CAM1C;AAED,gBAAgB;AAChB,eAAO,MAAM,qBAAqB,EAAE,CAAC,CAAC,OAAO,CAAC,OAAO,EAAE,CAAC,CAAC,UAAU,EAAE,OAAO,CA0DxE,CAAC;AAEL,wBAAgB,eAAe,CAC7B,UAAU,EAAE,MAAM,GACjB,eAAe,CAAC,OAAO,EAAE,kBAAkB,CAAC,CAM9C"}
|
|
@@ -36,12 +36,13 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
36
36
|
};
|
|
37
37
|
})();
|
|
38
38
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
-
exports.Invoice$inboundSchema = exports.Tax$inboundSchema = exports.InvoiceStatus$inboundSchema = exports.PdfSource$inboundSchema = exports.InvoiceLineItems$inboundSchema = exports.InvoiceObject$inboundSchema = exports.InvoiceStatus = exports.PdfSource = exports.InvoiceObject = void 0;
|
|
39
|
+
exports.Invoice$inboundSchema = exports.Tax$inboundSchema = exports.InvoiceStatus$inboundSchema = exports.DocumentWithheldReason$inboundSchema = exports.PdfSource$inboundSchema = exports.InvoiceLineItems$inboundSchema = exports.InvoiceObject$inboundSchema = exports.InvoiceStatus = exports.DocumentWithheldReason = exports.PdfSource = exports.InvoiceObject = void 0;
|
|
40
40
|
exports.invoiceLineItemsFromJSON = invoiceLineItemsFromJSON;
|
|
41
41
|
exports.taxFromJSON = taxFromJSON;
|
|
42
42
|
exports.invoiceFromJSON = invoiceFromJSON;
|
|
43
43
|
const z = __importStar(require("zod/v3"));
|
|
44
44
|
const schemas_js_1 = require("../lib/schemas.js");
|
|
45
|
+
const openEnums = __importStar(require("../types/enums.js"));
|
|
45
46
|
const invoicelineitem_js_1 = require("./invoicelineitem.js");
|
|
46
47
|
const resolveditem_js_1 = require("./resolveditem.js");
|
|
47
48
|
/**
|
|
@@ -57,6 +58,16 @@ exports.PdfSource = {
|
|
|
57
58
|
Paygentic: "paygentic",
|
|
58
59
|
TaxProvider: "tax_provider",
|
|
59
60
|
};
|
|
61
|
+
/**
|
|
62
|
+
* Why no Paygentic-rendered document exists for this invoice, or null when none was withheld. A tax-registered merchant's document is a compliance artefact, so it is withheld unless the recorded tax reconciles with the provider exactly and the registered issuer identity is complete. Non-null therefore always accompanies pdfSource `tax_provider` or null, and never `paygentic`. Use it to tell a withheld document apart from an invoice the tax provider serves by design — both report pdfSource `tax_provider`, but only a withheld one can be repaired by POST /v2/invoices/{id}/generate-pdf. `tax_unreconciled`: the provider's tax figure was never recorded against this invoice. `issuer_identity_incomplete`: the registered legal name, tax ID or address could not be read. `tax_component_unpriceable`: a recorded tax component carried no presentable amount. `ledger_mismatch`: the recorded tax figures and the invoice's own totals disagree. `tax_provider_disagrees`: the provider re-read its filing and reported a different tax to the one this invoice was charged — terminal, because correcting an issued invoice is a credit note's job, so retrying the repair cannot clear it. New values may be added, so treat an unrecognised one as withheld rather than failing.
|
|
63
|
+
*/
|
|
64
|
+
exports.DocumentWithheldReason = {
|
|
65
|
+
TaxUnreconciled: "tax_unreconciled",
|
|
66
|
+
IssuerIdentityIncomplete: "issuer_identity_incomplete",
|
|
67
|
+
TaxComponentUnpriceable: "tax_component_unpriceable",
|
|
68
|
+
LedgerMismatch: "ledger_mismatch",
|
|
69
|
+
TaxProviderDisagrees: "tax_provider_disagrees",
|
|
70
|
+
};
|
|
60
71
|
/**
|
|
61
72
|
* The current status of the invoice
|
|
62
73
|
*/
|
|
@@ -90,6 +101,8 @@ function invoiceLineItemsFromJSON(jsonString) {
|
|
|
90
101
|
exports.PdfSource$inboundSchema = z
|
|
91
102
|
.nativeEnum(exports.PdfSource);
|
|
92
103
|
/** @internal */
|
|
104
|
+
exports.DocumentWithheldReason$inboundSchema = openEnums.inboundSchema(exports.DocumentWithheldReason);
|
|
105
|
+
/** @internal */
|
|
93
106
|
exports.InvoiceStatus$inboundSchema = z.nativeEnum(exports.InvoiceStatus);
|
|
94
107
|
/** @internal */
|
|
95
108
|
exports.Tax$inboundSchema = z
|
|
@@ -131,6 +144,8 @@ exports.Invoice$inboundSchema = z.object({
|
|
|
131
144
|
paymentUrl: z.nullable(z.string()).optional(),
|
|
132
145
|
pdfUrl: z.nullable(z.string()).optional(),
|
|
133
146
|
pdfSource: z.nullable(exports.PdfSource$inboundSchema).optional(),
|
|
147
|
+
documentWithheldReason: z.nullable(exports.DocumentWithheldReason$inboundSchema)
|
|
148
|
+
.optional(),
|
|
134
149
|
periodEnd: z.string().datetime({ offset: true }).transform(v => new Date(v)),
|
|
135
150
|
periodStart: z.string().datetime({ offset: true }).transform(v => new Date(v)),
|
|
136
151
|
permalink: z.nullable(z.string()).optional(),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"invoice.js","sourceRoot":"","sources":["../../../src/models/invoice.ts"],"names":[],"mappings":";AAAA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QAAQ,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,CAC7D,IAAI,IAAI,CAAC,CAAC,CAAC,CACZ;CACF,CAAC,CAAC;AAEL,SAAgB,eAAe,CAC7B,UAAkB;IAElB,OAAO,IAAA,sBAAS,EACd,UAAU,EACV,CAAC,CAAC,EAAE,EAAE,CAAC,6BAAqB,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,EACjD,qCAAqC,CACtC,CAAC;AACJ,CAAC"}
|
package/dist/esm/lib/config.d.ts
CHANGED
|
@@ -31,8 +31,8 @@ export declare function serverURLFromOptions(options: SDKOptions): URL | null;
|
|
|
31
31
|
export declare const SDK_METADATA: {
|
|
32
32
|
readonly language: "typescript";
|
|
33
33
|
readonly openapiDocVersion: "0.1.0";
|
|
34
|
-
readonly sdkVersion: "0.9.
|
|
34
|
+
readonly sdkVersion: "0.9.4";
|
|
35
35
|
readonly genVersion: "2.879.13";
|
|
36
|
-
readonly userAgent: "speakeasy-sdk/typescript 0.9.
|
|
36
|
+
readonly userAgent: "speakeasy-sdk/typescript 0.9.4 2.879.13 0.1.0 @paygentic/sdk";
|
|
37
37
|
};
|
|
38
38
|
//# sourceMappingURL=config.d.ts.map
|
package/dist/esm/lib/config.js
CHANGED
|
@@ -31,8 +31,8 @@ export function serverURLFromOptions(options) {
|
|
|
31
31
|
export const SDK_METADATA = {
|
|
32
32
|
language: "typescript",
|
|
33
33
|
openapiDocVersion: "0.1.0",
|
|
34
|
-
sdkVersion: "0.9.
|
|
34
|
+
sdkVersion: "0.9.4",
|
|
35
35
|
genVersion: "2.879.13",
|
|
36
|
-
userAgent: "speakeasy-sdk/typescript 0.9.
|
|
36
|
+
userAgent: "speakeasy-sdk/typescript 0.9.4 2.879.13 0.1.0 @paygentic/sdk",
|
|
37
37
|
};
|
|
38
38
|
//# sourceMappingURL=config.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as z from "zod/v3";
|
|
2
|
-
import { ClosedEnum } from "../types/enums.js";
|
|
2
|
+
import { ClosedEnum, OpenEnum } from "../types/enums.js";
|
|
3
3
|
import { Result as SafeParseResult } from "../types/fp.js";
|
|
4
4
|
import { SDKValidationError } from "./errors/sdkvalidationerror.js";
|
|
5
5
|
import { InvoiceLineItem } from "./invoicelineitem.js";
|
|
@@ -50,6 +50,20 @@ export declare const PdfSource: {
|
|
|
50
50
|
* Who produced the document at pdfUrl, or null when there is none. `paygentic` means pdfUrl is this API's download endpoint and the request must carry your API key; `tax_provider` means it is the provider's own link, which opens directly in a browser.
|
|
51
51
|
*/
|
|
52
52
|
export type PdfSource = ClosedEnum<typeof PdfSource>;
|
|
53
|
+
/**
|
|
54
|
+
* Why no Paygentic-rendered document exists for this invoice, or null when none was withheld. A tax-registered merchant's document is a compliance artefact, so it is withheld unless the recorded tax reconciles with the provider exactly and the registered issuer identity is complete. Non-null therefore always accompanies pdfSource `tax_provider` or null, and never `paygentic`. Use it to tell a withheld document apart from an invoice the tax provider serves by design — both report pdfSource `tax_provider`, but only a withheld one can be repaired by POST /v2/invoices/{id}/generate-pdf. `tax_unreconciled`: the provider's tax figure was never recorded against this invoice. `issuer_identity_incomplete`: the registered legal name, tax ID or address could not be read. `tax_component_unpriceable`: a recorded tax component carried no presentable amount. `ledger_mismatch`: the recorded tax figures and the invoice's own totals disagree. `tax_provider_disagrees`: the provider re-read its filing and reported a different tax to the one this invoice was charged — terminal, because correcting an issued invoice is a credit note's job, so retrying the repair cannot clear it. New values may be added, so treat an unrecognised one as withheld rather than failing.
|
|
55
|
+
*/
|
|
56
|
+
export declare const DocumentWithheldReason: {
|
|
57
|
+
readonly TaxUnreconciled: "tax_unreconciled";
|
|
58
|
+
readonly IssuerIdentityIncomplete: "issuer_identity_incomplete";
|
|
59
|
+
readonly TaxComponentUnpriceable: "tax_component_unpriceable";
|
|
60
|
+
readonly LedgerMismatch: "ledger_mismatch";
|
|
61
|
+
readonly TaxProviderDisagrees: "tax_provider_disagrees";
|
|
62
|
+
};
|
|
63
|
+
/**
|
|
64
|
+
* Why no Paygentic-rendered document exists for this invoice, or null when none was withheld. A tax-registered merchant's document is a compliance artefact, so it is withheld unless the recorded tax reconciles with the provider exactly and the registered issuer identity is complete. Non-null therefore always accompanies pdfSource `tax_provider` or null, and never `paygentic`. Use it to tell a withheld document apart from an invoice the tax provider serves by design — both report pdfSource `tax_provider`, but only a withheld one can be repaired by POST /v2/invoices/{id}/generate-pdf. `tax_unreconciled`: the provider's tax figure was never recorded against this invoice. `issuer_identity_incomplete`: the registered legal name, tax ID or address could not be read. `tax_component_unpriceable`: a recorded tax component carried no presentable amount. `ledger_mismatch`: the recorded tax figures and the invoice's own totals disagree. `tax_provider_disagrees`: the provider re-read its filing and reported a different tax to the one this invoice was charged — terminal, because correcting an issued invoice is a credit note's job, so retrying the repair cannot clear it. New values may be added, so treat an unrecognised one as withheld rather than failing.
|
|
65
|
+
*/
|
|
66
|
+
export type DocumentWithheldReason = OpenEnum<typeof DocumentWithheldReason>;
|
|
53
67
|
/**
|
|
54
68
|
* The current status of the invoice
|
|
55
69
|
*/
|
|
@@ -198,6 +212,10 @@ export type Invoice = {
|
|
|
198
212
|
* Who produced the document at pdfUrl, or null when there is none. `paygentic` means pdfUrl is this API's download endpoint and the request must carry your API key; `tax_provider` means it is the provider's own link, which opens directly in a browser.
|
|
199
213
|
*/
|
|
200
214
|
pdfSource?: PdfSource | null | undefined;
|
|
215
|
+
/**
|
|
216
|
+
* Why no Paygentic-rendered document exists for this invoice, or null when none was withheld. A tax-registered merchant's document is a compliance artefact, so it is withheld unless the recorded tax reconciles with the provider exactly and the registered issuer identity is complete. Non-null therefore always accompanies pdfSource `tax_provider` or null, and never `paygentic`. Use it to tell a withheld document apart from an invoice the tax provider serves by design — both report pdfSource `tax_provider`, but only a withheld one can be repaired by POST /v2/invoices/{id}/generate-pdf. `tax_unreconciled`: the provider's tax figure was never recorded against this invoice. `issuer_identity_incomplete`: the registered legal name, tax ID or address could not be read. `tax_component_unpriceable`: a recorded tax component carried no presentable amount. `ledger_mismatch`: the recorded tax figures and the invoice's own totals disagree. `tax_provider_disagrees`: the provider re-read its filing and reported a different tax to the one this invoice was charged — terminal, because correcting an issued invoice is a credit note's job, so retrying the repair cannot clear it. New values may be added, so treat an unrecognised one as withheld rather than failing.
|
|
217
|
+
*/
|
|
218
|
+
documentWithheldReason?: DocumentWithheldReason | null | undefined;
|
|
201
219
|
/**
|
|
202
220
|
* The end of the billing period
|
|
203
221
|
*/
|
|
@@ -255,6 +273,8 @@ export declare function invoiceLineItemsFromJSON(jsonString: string): SafeParseR
|
|
|
255
273
|
/** @internal */
|
|
256
274
|
export declare const PdfSource$inboundSchema: z.ZodNativeEnum<typeof PdfSource>;
|
|
257
275
|
/** @internal */
|
|
276
|
+
export declare const DocumentWithheldReason$inboundSchema: z.ZodType<DocumentWithheldReason, z.ZodTypeDef, unknown>;
|
|
277
|
+
/** @internal */
|
|
258
278
|
export declare const InvoiceStatus$inboundSchema: z.ZodNativeEnum<typeof InvoiceStatus>;
|
|
259
279
|
/** @internal */
|
|
260
280
|
export declare const Tax$inboundSchema: z.ZodType<Tax, z.ZodTypeDef, unknown>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"invoice.d.ts","sourceRoot":"","sources":["../../../src/models/invoice.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,CAAC,MAAM,QAAQ,CAAC;
|
|
1
|
+
{"version":3,"file":"invoice.d.ts","sourceRoot":"","sources":["../../../src/models/invoice.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,CAAC,MAAM,QAAQ,CAAC;AAG5B,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AACzD,OAAO,EAAE,MAAM,IAAI,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAC3D,OAAO,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AACpE,OAAO,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AAEH,wBAAgB,wBAAwB,CACtC,UAAU,EAAE,MAAM,GACjB,eAAe,CAAC,gBAAgB,EAAE,kBAAkB,CAAC,CAMvD;AAED,gBAAgB;AAChB,eAAO,MAAM,uBAAuB,EAAE,CAAC,CAAC,aAAa,CAAC,OAAO,SAAS,CAC9C,CAAC;AAEzB,gBAAgB;AAChB,eAAO,MAAM,oCAAoC,EAAE,CAAC,CAAC,OAAO,CAC1D,sBAAsB,EACtB,CAAC,CAAC,UAAU,EACZ,OAAO,CAC0C,CAAC;AAEpD,gBAAgB;AAChB,eAAO,MAAM,2BAA2B,EAAE,CAAC,CAAC,aAAa,CACvD,OAAO,aAAa,CACS,CAAC;AAEhC,gBAAgB;AAChB,eAAO,MAAM,iBAAiB,EAAE,CAAC,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,CAAC,UAAU,EAAE,OAAO,CAWhE,CAAC;AAEL,wBAAgB,WAAW,CACzB,UAAU,EAAE,MAAM,GACjB,eAAe,CAAC,GAAG,EAAE,kBAAkB,CAAC,CAM1C;AAED,gBAAgB;AAChB,eAAO,MAAM,qBAAqB,EAAE,CAAC,CAAC,OAAO,CAAC,OAAO,EAAE,CAAC,CAAC,UAAU,EAAE,OAAO,CA0DxE,CAAC;AAEL,wBAAgB,eAAe,CAC7B,UAAU,EAAE,MAAM,GACjB,eAAe,CAAC,OAAO,EAAE,kBAAkB,CAAC,CAM9C"}
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import * as z from "zod/v3";
|
|
5
5
|
import { safeParse } from "../lib/schemas.js";
|
|
6
|
+
import * as openEnums from "../types/enums.js";
|
|
6
7
|
import { InvoiceLineItem$inboundSchema, } from "./invoicelineitem.js";
|
|
7
8
|
import { ResolvedItem$inboundSchema } from "./resolveditem.js";
|
|
8
9
|
/**
|
|
@@ -18,6 +19,16 @@ export const PdfSource = {
|
|
|
18
19
|
Paygentic: "paygentic",
|
|
19
20
|
TaxProvider: "tax_provider",
|
|
20
21
|
};
|
|
22
|
+
/**
|
|
23
|
+
* Why no Paygentic-rendered document exists for this invoice, or null when none was withheld. A tax-registered merchant's document is a compliance artefact, so it is withheld unless the recorded tax reconciles with the provider exactly and the registered issuer identity is complete. Non-null therefore always accompanies pdfSource `tax_provider` or null, and never `paygentic`. Use it to tell a withheld document apart from an invoice the tax provider serves by design — both report pdfSource `tax_provider`, but only a withheld one can be repaired by POST /v2/invoices/{id}/generate-pdf. `tax_unreconciled`: the provider's tax figure was never recorded against this invoice. `issuer_identity_incomplete`: the registered legal name, tax ID or address could not be read. `tax_component_unpriceable`: a recorded tax component carried no presentable amount. `ledger_mismatch`: the recorded tax figures and the invoice's own totals disagree. `tax_provider_disagrees`: the provider re-read its filing and reported a different tax to the one this invoice was charged — terminal, because correcting an issued invoice is a credit note's job, so retrying the repair cannot clear it. New values may be added, so treat an unrecognised one as withheld rather than failing.
|
|
24
|
+
*/
|
|
25
|
+
export const DocumentWithheldReason = {
|
|
26
|
+
TaxUnreconciled: "tax_unreconciled",
|
|
27
|
+
IssuerIdentityIncomplete: "issuer_identity_incomplete",
|
|
28
|
+
TaxComponentUnpriceable: "tax_component_unpriceable",
|
|
29
|
+
LedgerMismatch: "ledger_mismatch",
|
|
30
|
+
TaxProviderDisagrees: "tax_provider_disagrees",
|
|
31
|
+
};
|
|
21
32
|
/**
|
|
22
33
|
* The current status of the invoice
|
|
23
34
|
*/
|
|
@@ -51,6 +62,8 @@ export function invoiceLineItemsFromJSON(jsonString) {
|
|
|
51
62
|
export const PdfSource$inboundSchema = z
|
|
52
63
|
.nativeEnum(PdfSource);
|
|
53
64
|
/** @internal */
|
|
65
|
+
export const DocumentWithheldReason$inboundSchema = openEnums.inboundSchema(DocumentWithheldReason);
|
|
66
|
+
/** @internal */
|
|
54
67
|
export const InvoiceStatus$inboundSchema = z.nativeEnum(InvoiceStatus);
|
|
55
68
|
/** @internal */
|
|
56
69
|
export const Tax$inboundSchema = z
|
|
@@ -92,6 +105,8 @@ export const Invoice$inboundSchema = z.object({
|
|
|
92
105
|
paymentUrl: z.nullable(z.string()).optional(),
|
|
93
106
|
pdfUrl: z.nullable(z.string()).optional(),
|
|
94
107
|
pdfSource: z.nullable(PdfSource$inboundSchema).optional(),
|
|
108
|
+
documentWithheldReason: z.nullable(DocumentWithheldReason$inboundSchema)
|
|
109
|
+
.optional(),
|
|
95
110
|
periodEnd: z.string().datetime({ offset: true }).transform(v => new Date(v)),
|
|
96
111
|
periodStart: z.string().datetime({ offset: true }).transform(v => new Date(v)),
|
|
97
112
|
permalink: z.nullable(z.string()).optional(),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"invoice.js","sourceRoot":"","sources":["../../../src/models/invoice.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,CAAC,MAAM,QAAQ,CAAC;AAC5B,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"invoice.js","sourceRoot":"","sources":["../../../src/models/invoice.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,CAAC,MAAM,QAAQ,CAAC;AAC5B,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAC9C,OAAO,KAAK,SAAS,MAAM,mBAAmB,CAAC;AAI/C,OAAO,EAEL,6BAA6B,GAC9B,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAgB,0BAA0B,EAAE,MAAM,mBAAmB,CAAC;AAE7E;;GAEG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG;IAC3B,OAAO,EAAE,SAAS;CACV,CAAC;AAgCX;;GAEG;AACH,MAAM,CAAC,MAAM,SAAS,GAAG;IACvB,SAAS,EAAE,WAAW;IACtB,WAAW,EAAE,cAAc;CACnB,CAAC;AAMX;;GAEG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAG;IACpC,eAAe,EAAE,kBAAkB;IACnC,wBAAwB,EAAE,4BAA4B;IACtD,uBAAuB,EAAE,2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,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,CAC/D,IAAI,IAAI,CAAC,CAAC,CAAC,CACZ;IACD,SAAS,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,QAAQ,EAAE;IAC5C,cAAc,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE;IAChC,MAAM,EAAE,2BAA2B;IACnC,cAAc,EAAE,CAAC,CAAC,MAAM,EAAE;IAC1B,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE;IACtB,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE;IACpB,GAAG,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,iBAAiB,CAAC,CAAC,CAAC,QAAQ,EAAE;IAC3D,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE;IACpB,YAAY,EAAE,CAAC,CAAC,MAAM,EAAE;IACxB,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,CAC7D,IAAI,IAAI,CAAC,CAAC,CAAC,CACZ;CACF,CAAC,CAAC;AAEL,MAAM,UAAU,eAAe,CAC7B,UAAkB;IAElB,OAAO,SAAS,CACd,UAAU,EACV,CAAC,CAAC,EAAE,EAAE,CAAC,qBAAqB,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,EACjD,qCAAqC,CACtC,CAAC;AACJ,CAAC"}
|
package/jsr.json
CHANGED
package/package.json
CHANGED
package/src/lib/config.ts
CHANGED
|
@@ -65,7 +65,7 @@ export function serverURLFromOptions(options: SDKOptions): URL | null {
|
|
|
65
65
|
export const SDK_METADATA = {
|
|
66
66
|
language: "typescript",
|
|
67
67
|
openapiDocVersion: "0.1.0",
|
|
68
|
-
sdkVersion: "0.9.
|
|
68
|
+
sdkVersion: "0.9.4",
|
|
69
69
|
genVersion: "2.879.13",
|
|
70
|
-
userAgent: "speakeasy-sdk/typescript 0.9.
|
|
70
|
+
userAgent: "speakeasy-sdk/typescript 0.9.4 2.879.13 0.1.0 @paygentic/sdk",
|
|
71
71
|
} as const;
|
package/src/models/invoice.ts
CHANGED
|
@@ -4,7 +4,8 @@
|
|
|
4
4
|
|
|
5
5
|
import * as z from "zod/v3";
|
|
6
6
|
import { safeParse } from "../lib/schemas.js";
|
|
7
|
-
import
|
|
7
|
+
import * as openEnums from "../types/enums.js";
|
|
8
|
+
import { ClosedEnum, OpenEnum } from "../types/enums.js";
|
|
8
9
|
import { Result as SafeParseResult } from "../types/fp.js";
|
|
9
10
|
import { SDKValidationError } from "./errors/sdkvalidationerror.js";
|
|
10
11
|
import {
|
|
@@ -62,6 +63,21 @@ export const PdfSource = {
|
|
|
62
63
|
*/
|
|
63
64
|
export type PdfSource = ClosedEnum<typeof PdfSource>;
|
|
64
65
|
|
|
66
|
+
/**
|
|
67
|
+
* Why no Paygentic-rendered document exists for this invoice, or null when none was withheld. A tax-registered merchant's document is a compliance artefact, so it is withheld unless the recorded tax reconciles with the provider exactly and the registered issuer identity is complete. Non-null therefore always accompanies pdfSource `tax_provider` or null, and never `paygentic`. Use it to tell a withheld document apart from an invoice the tax provider serves by design — both report pdfSource `tax_provider`, but only a withheld one can be repaired by POST /v2/invoices/{id}/generate-pdf. `tax_unreconciled`: the provider's tax figure was never recorded against this invoice. `issuer_identity_incomplete`: the registered legal name, tax ID or address could not be read. `tax_component_unpriceable`: a recorded tax component carried no presentable amount. `ledger_mismatch`: the recorded tax figures and the invoice's own totals disagree. `tax_provider_disagrees`: the provider re-read its filing and reported a different tax to the one this invoice was charged — terminal, because correcting an issued invoice is a credit note's job, so retrying the repair cannot clear it. New values may be added, so treat an unrecognised one as withheld rather than failing.
|
|
68
|
+
*/
|
|
69
|
+
export const DocumentWithheldReason = {
|
|
70
|
+
TaxUnreconciled: "tax_unreconciled",
|
|
71
|
+
IssuerIdentityIncomplete: "issuer_identity_incomplete",
|
|
72
|
+
TaxComponentUnpriceable: "tax_component_unpriceable",
|
|
73
|
+
LedgerMismatch: "ledger_mismatch",
|
|
74
|
+
TaxProviderDisagrees: "tax_provider_disagrees",
|
|
75
|
+
} as const;
|
|
76
|
+
/**
|
|
77
|
+
* Why no Paygentic-rendered document exists for this invoice, or null when none was withheld. A tax-registered merchant's document is a compliance artefact, so it is withheld unless the recorded tax reconciles with the provider exactly and the registered issuer identity is complete. Non-null therefore always accompanies pdfSource `tax_provider` or null, and never `paygentic`. Use it to tell a withheld document apart from an invoice the tax provider serves by design — both report pdfSource `tax_provider`, but only a withheld one can be repaired by POST /v2/invoices/{id}/generate-pdf. `tax_unreconciled`: the provider's tax figure was never recorded against this invoice. `issuer_identity_incomplete`: the registered legal name, tax ID or address could not be read. `tax_component_unpriceable`: a recorded tax component carried no presentable amount. `ledger_mismatch`: the recorded tax figures and the invoice's own totals disagree. `tax_provider_disagrees`: the provider re-read its filing and reported a different tax to the one this invoice was charged — terminal, because correcting an issued invoice is a credit note's job, so retrying the repair cannot clear it. New values may be added, so treat an unrecognised one as withheld rather than failing.
|
|
78
|
+
*/
|
|
79
|
+
export type DocumentWithheldReason = OpenEnum<typeof DocumentWithheldReason>;
|
|
80
|
+
|
|
65
81
|
/**
|
|
66
82
|
* The current status of the invoice
|
|
67
83
|
*/
|
|
@@ -210,6 +226,10 @@ export type Invoice = {
|
|
|
210
226
|
* Who produced the document at pdfUrl, or null when there is none. `paygentic` means pdfUrl is this API's download endpoint and the request must carry your API key; `tax_provider` means it is the provider's own link, which opens directly in a browser.
|
|
211
227
|
*/
|
|
212
228
|
pdfSource?: PdfSource | null | undefined;
|
|
229
|
+
/**
|
|
230
|
+
* Why no Paygentic-rendered document exists for this invoice, or null when none was withheld. A tax-registered merchant's document is a compliance artefact, so it is withheld unless the recorded tax reconciles with the provider exactly and the registered issuer identity is complete. Non-null therefore always accompanies pdfSource `tax_provider` or null, and never `paygentic`. Use it to tell a withheld document apart from an invoice the tax provider serves by design — both report pdfSource `tax_provider`, but only a withheld one can be repaired by POST /v2/invoices/{id}/generate-pdf. `tax_unreconciled`: the provider's tax figure was never recorded against this invoice. `issuer_identity_incomplete`: the registered legal name, tax ID or address could not be read. `tax_component_unpriceable`: a recorded tax component carried no presentable amount. `ledger_mismatch`: the recorded tax figures and the invoice's own totals disagree. `tax_provider_disagrees`: the provider re-read its filing and reported a different tax to the one this invoice was charged — terminal, because correcting an issued invoice is a credit note's job, so retrying the repair cannot clear it. New values may be added, so treat an unrecognised one as withheld rather than failing.
|
|
231
|
+
*/
|
|
232
|
+
documentWithheldReason?: DocumentWithheldReason | null | undefined;
|
|
213
233
|
/**
|
|
214
234
|
* The end of the billing period
|
|
215
235
|
*/
|
|
@@ -292,6 +312,13 @@ export function invoiceLineItemsFromJSON(
|
|
|
292
312
|
export const PdfSource$inboundSchema: z.ZodNativeEnum<typeof PdfSource> = z
|
|
293
313
|
.nativeEnum(PdfSource);
|
|
294
314
|
|
|
315
|
+
/** @internal */
|
|
316
|
+
export const DocumentWithheldReason$inboundSchema: z.ZodType<
|
|
317
|
+
DocumentWithheldReason,
|
|
318
|
+
z.ZodTypeDef,
|
|
319
|
+
unknown
|
|
320
|
+
> = openEnums.inboundSchema(DocumentWithheldReason);
|
|
321
|
+
|
|
295
322
|
/** @internal */
|
|
296
323
|
export const InvoiceStatus$inboundSchema: z.ZodNativeEnum<
|
|
297
324
|
typeof InvoiceStatus
|
|
@@ -360,6 +387,8 @@ export const Invoice$inboundSchema: z.ZodType<Invoice, z.ZodTypeDef, unknown> =
|
|
|
360
387
|
paymentUrl: z.nullable(z.string()).optional(),
|
|
361
388
|
pdfUrl: z.nullable(z.string()).optional(),
|
|
362
389
|
pdfSource: z.nullable(PdfSource$inboundSchema).optional(),
|
|
390
|
+
documentWithheldReason: z.nullable(DocumentWithheldReason$inboundSchema)
|
|
391
|
+
.optional(),
|
|
363
392
|
periodEnd: z.string().datetime({ offset: true }).transform(v =>
|
|
364
393
|
new Date(v)
|
|
365
394
|
),
|