@paygentic/sdk 0.9.9 → 0.9.11
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/funcs/subscriptionsReconcileSubscriptionFeatures.js +2 -2
- package/dist/commonjs/funcs/subscriptionsReconcileSubscriptionFeatures.js.map +1 -1
- package/dist/commonjs/lib/config.d.ts +2 -2
- package/dist/commonjs/lib/config.js +2 -2
- package/dist/commonjs/lib/config.js.map +1 -1
- package/dist/commonjs/models/costreportresponse.d.ts +20 -0
- package/dist/commonjs/models/costreportresponse.d.ts.map +1 -1
- package/dist/commonjs/models/costreportresponse.js +12 -1
- package/dist/commonjs/models/costreportresponse.js.map +1 -1
- package/dist/commonjs/models/invoice.d.ts +3 -3
- package/dist/commonjs/models/invoice.js +1 -1
- package/dist/commonjs/models/lineitem.d.ts +1 -1
- package/dist/commonjs/models/profitabilitysummaryresponse.d.ts +40 -0
- package/dist/commonjs/models/profitabilitysummaryresponse.d.ts.map +1 -1
- package/dist/commonjs/models/profitabilitysummaryresponse.js +21 -1
- package/dist/commonjs/models/profitabilitysummaryresponse.js.map +1 -1
- package/dist/commonjs/models/revenuesummaryresponse.d.ts +20 -0
- package/dist/commonjs/models/revenuesummaryresponse.d.ts.map +1 -1
- package/dist/commonjs/models/revenuesummaryresponse.js +11 -1
- package/dist/commonjs/models/revenuesummaryresponse.js.map +1 -1
- package/dist/esm/funcs/subscriptionsReconcileSubscriptionFeatures.js +2 -2
- package/dist/esm/funcs/subscriptionsReconcileSubscriptionFeatures.js.map +1 -1
- package/dist/esm/lib/config.d.ts +2 -2
- package/dist/esm/lib/config.js +2 -2
- package/dist/esm/lib/config.js.map +1 -1
- package/dist/esm/models/costreportresponse.d.ts +20 -0
- package/dist/esm/models/costreportresponse.d.ts.map +1 -1
- package/dist/esm/models/costreportresponse.js +10 -0
- package/dist/esm/models/costreportresponse.js.map +1 -1
- package/dist/esm/models/invoice.d.ts +3 -3
- package/dist/esm/models/invoice.js +1 -1
- package/dist/esm/models/lineitem.d.ts +1 -1
- package/dist/esm/models/profitabilitysummaryresponse.d.ts +40 -0
- package/dist/esm/models/profitabilitysummaryresponse.d.ts.map +1 -1
- package/dist/esm/models/profitabilitysummaryresponse.js +18 -0
- package/dist/esm/models/profitabilitysummaryresponse.js.map +1 -1
- package/dist/esm/models/revenuesummaryresponse.d.ts +20 -0
- package/dist/esm/models/revenuesummaryresponse.d.ts.map +1 -1
- package/dist/esm/models/revenuesummaryresponse.js +9 -0
- package/dist/esm/models/revenuesummaryresponse.js.map +1 -1
- package/jsr.json +1 -1
- package/package.json +1 -1
- package/src/funcs/subscriptionsReconcileSubscriptionFeatures.ts +2 -2
- package/src/lib/config.ts +2 -2
- package/src/models/costreportresponse.ts +40 -0
- package/src/models/invoice.ts +3 -3
- package/src/models/lineitem.ts +1 -1
- package/src/models/profitabilitysummaryresponse.ts +89 -0
- package/src/models/revenuesummaryresponse.ts +42 -0
|
@@ -29,6 +29,14 @@ export function paginationFromJSON(jsonString) {
|
|
|
29
29
|
return safeParse(jsonString, (x) => Pagination$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Pagination' from JSON`);
|
|
30
30
|
}
|
|
31
31
|
/** @internal */
|
|
32
|
+
export const CostReportResponseCostRange$inboundSchema = z.object({
|
|
33
|
+
from: z.string().datetime({ offset: true }).transform(v => new Date(v)),
|
|
34
|
+
to: z.string().datetime({ offset: true }).transform(v => new Date(v)),
|
|
35
|
+
});
|
|
36
|
+
export function costReportResponseCostRangeFromJSON(jsonString) {
|
|
37
|
+
return safeParse(jsonString, (x) => CostReportResponseCostRange$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CostReportResponseCostRange' from JSON`);
|
|
38
|
+
}
|
|
39
|
+
/** @internal */
|
|
32
40
|
export const CostReportResponse$inboundSchema = z.object({
|
|
33
41
|
object: CostReportResponseObject$inboundSchema.default("cost_report"),
|
|
34
42
|
currency: z.string(),
|
|
@@ -41,6 +49,8 @@ export const CostReportResponse$inboundSchema = z.object({
|
|
|
41
49
|
availableDimensions: z.array(z.string()),
|
|
42
50
|
warnings: z.array(z.string()).optional(),
|
|
43
51
|
pagination: z.lazy(() => Pagination$inboundSchema),
|
|
52
|
+
costRange: z.nullable(z.lazy(() => CostReportResponseCostRange$inboundSchema))
|
|
53
|
+
.optional(),
|
|
44
54
|
});
|
|
45
55
|
export function costReportResponseFromJSON(jsonString) {
|
|
46
56
|
return safeParse(jsonString, (x) => CostReportResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CostReportResponse' from JSON`);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"costreportresponse.js","sourceRoot":"","sources":["../../../src/models/costreportresponse.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,CAAC,MAAM,QAAQ,CAAC;AAC5B,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAG9C,OAAO,EAEL,6BAA6B,GAC9B,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAEL,kCAAkC,GACnC,MAAM,2BAA2B,CAAC;AAGnC,MAAM,CAAC,MAAM,wBAAwB,GAAG;IACtC,UAAU,EAAE,aAAa;CACjB,CAAC;
|
|
1
|
+
{"version":3,"file":"costreportresponse.js","sourceRoot":"","sources":["../../../src/models/costreportresponse.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,CAAC,MAAM,QAAQ,CAAC;AAC5B,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAG9C,OAAO,EAEL,6BAA6B,GAC9B,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAEL,kCAAkC,GACnC,MAAM,2BAA2B,CAAC;AAGnC,MAAM,CAAC,MAAM,wBAAwB,GAAG;IACtC,UAAU,EAAE,aAAa;CACjB,CAAC;AAwEX,gBAAgB;AAChB,MAAM,CAAC,MAAM,sCAAsC,GAE/C,CAAC,CAAC,UAAU,CAAC,wBAAwB,CAAC,CA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ACxC,UAAU,EAAE,CAAC,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,wBAAwB,CAAC;IAClD,SAAS,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,yCAAyC,CAAC,CAAC;SAC3E,QAAQ,EAAE;CACd,CAAC,CAAC;AAEH,MAAM,UAAU,0BAA0B,CACxC,UAAkB;IAElB,OAAO,SAAS,CACd,UAAU,EACV,CAAC,CAAC,EAAE,EAAE,CAAC,gCAAgC,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,EAC5D,gDAAgD,CACjD,CAAC;AACJ,CAAC"}
|
|
@@ -51,7 +51,7 @@ export declare const PdfSource: {
|
|
|
51
51
|
*/
|
|
52
52
|
export type PdfSource = ClosedEnum<typeof PdfSource>;
|
|
53
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 `
|
|
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 `null`, and never `paygentic`: an invoice whose document is withheld is not served the provider's in its place, because recording that link would mark the invoice as already served and stop a later repair rendering ours. Use it to tell a withheld invoice apart from one that simply has no document yet — both report pdfSource `null`, and only a withheld one names why. An invoice the tax provider serves by design reports pdfSource `tax_provider` with no reason, and needs no repair. Both an invoice with no document and 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
55
|
*/
|
|
56
56
|
export declare const DocumentWithheldReason: {
|
|
57
57
|
readonly TaxUnreconciled: "tax_unreconciled";
|
|
@@ -61,7 +61,7 @@ export declare const DocumentWithheldReason: {
|
|
|
61
61
|
readonly TaxProviderDisagrees: "tax_provider_disagrees";
|
|
62
62
|
};
|
|
63
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 `
|
|
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 `null`, and never `paygentic`: an invoice whose document is withheld is not served the provider's in its place, because recording that link would mark the invoice as already served and stop a later repair rendering ours. Use it to tell a withheld invoice apart from one that simply has no document yet — both report pdfSource `null`, and only a withheld one names why. An invoice the tax provider serves by design reports pdfSource `tax_provider` with no reason, and needs no repair. Both an invoice with no document and 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
65
|
*/
|
|
66
66
|
export type DocumentWithheldReason = OpenEnum<typeof DocumentWithheldReason>;
|
|
67
67
|
/**
|
|
@@ -213,7 +213,7 @@ export type Invoice = {
|
|
|
213
213
|
*/
|
|
214
214
|
pdfSource?: PdfSource | null | undefined;
|
|
215
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 `
|
|
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 `null`, and never `paygentic`: an invoice whose document is withheld is not served the provider's in its place, because recording that link would mark the invoice as already served and stop a later repair rendering ours. Use it to tell a withheld invoice apart from one that simply has no document yet — both report pdfSource `null`, and only a withheld one names why. An invoice the tax provider serves by design reports pdfSource `tax_provider` with no reason, and needs no repair. Both an invoice with no document and 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
217
|
*/
|
|
218
218
|
documentWithheldReason?: DocumentWithheldReason | null | undefined;
|
|
219
219
|
/**
|
|
@@ -20,7 +20,7 @@ export const PdfSource = {
|
|
|
20
20
|
TaxProvider: "tax_provider",
|
|
21
21
|
};
|
|
22
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 `
|
|
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 `null`, and never `paygentic`: an invoice whose document is withheld is not served the provider's in its place, because recording that link would mark the invoice as already served and stop a later repair rendering ours. Use it to tell a withheld invoice apart from one that simply has no document yet — both report pdfSource `null`, and only a withheld one names why. An invoice the tax provider serves by design reports pdfSource `tax_provider` with no reason, and needs no repair. Both an invoice with no document and 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
24
|
*/
|
|
25
25
|
export const DocumentWithheldReason = {
|
|
26
26
|
TaxUnreconciled: "tax_unreconciled",
|
|
@@ -144,7 +144,7 @@ export type LineItem = {
|
|
|
144
144
|
*/
|
|
145
145
|
estimatedMeteredQuantity?: string | null | undefined;
|
|
146
146
|
/**
|
|
147
|
-
* Real-time estimated subtotal
|
|
147
|
+
* Real-time estimated subtotal for a line whose amount is not final yet: current usage for a metered item, the rate the subscription is on for a fee. Null for manual items, and for any line whose amount is already final or cannot be estimated.
|
|
148
148
|
*/
|
|
149
149
|
estimatedSubtotal?: string | null | undefined;
|
|
150
150
|
};
|
|
@@ -2,6 +2,32 @@ import * as z from "zod/v3";
|
|
|
2
2
|
import { Result as SafeParseResult } from "../types/fp.js";
|
|
3
3
|
import { SDKValidationError } from "./errors/sdkvalidationerror.js";
|
|
4
4
|
import { ProfitabilityRow } from "./profitabilityrow.js";
|
|
5
|
+
/**
|
|
6
|
+
* Where the caller's revenue actually lies in time. Scoped by the same filters as the request (merchant, and where given customer, subscription and currency), so it is not an account-wide statement. Present only when the selected range returned nothing. An object carries the bounds of the real revenue; null means no revenue under these filters at any time; an absent field means the extent was not resolved, because the result was not empty or because the lookup failed. An absent field must never be read as an absence. The bounds may span more than this endpoint's maximum queryable range, so clamp before re-querying.
|
|
7
|
+
*/
|
|
8
|
+
export type ProfitabilitySummaryResponseRevenueRange = {
|
|
9
|
+
/**
|
|
10
|
+
* Earliest invoice issue instant.
|
|
11
|
+
*/
|
|
12
|
+
from: Date;
|
|
13
|
+
/**
|
|
14
|
+
* Latest invoice issue instant.
|
|
15
|
+
*/
|
|
16
|
+
to: Date;
|
|
17
|
+
};
|
|
18
|
+
/**
|
|
19
|
+
* Where the caller's cost data actually lies in time. Present only when the selected range returned no cost. An object carries the bounds of the real cost events; null means the caller has no cost event at any time; an absent field means the extent was not resolved, because the result was not empty, because the lookup failed, or because the metering service does not serve the bounds method. An absent field must never be read as an absence.
|
|
20
|
+
*/
|
|
21
|
+
export type ProfitabilitySummaryResponseCostRange = {
|
|
22
|
+
/**
|
|
23
|
+
* Earliest cost event instant.
|
|
24
|
+
*/
|
|
25
|
+
from: Date;
|
|
26
|
+
/**
|
|
27
|
+
* Latest cost event instant.
|
|
28
|
+
*/
|
|
29
|
+
to: Date;
|
|
30
|
+
};
|
|
5
31
|
export type ProfitabilitySummaryResponse = {
|
|
6
32
|
/**
|
|
7
33
|
* Object type identifier
|
|
@@ -19,8 +45,22 @@ export type ProfitabilitySummaryResponse = {
|
|
|
19
45
|
* Non-fatal warnings collected during cost discovery (e.g. an individual cost query failed). Empty array on a clean run.
|
|
20
46
|
*/
|
|
21
47
|
warnings?: Array<string> | undefined;
|
|
48
|
+
/**
|
|
49
|
+
* Where the caller's revenue actually lies in time. Scoped by the same filters as the request (merchant, and where given customer, subscription and currency), so it is not an account-wide statement. Present only when the selected range returned nothing. An object carries the bounds of the real revenue; null means no revenue under these filters at any time; an absent field means the extent was not resolved, because the result was not empty or because the lookup failed. An absent field must never be read as an absence. The bounds may span more than this endpoint's maximum queryable range, so clamp before re-querying.
|
|
50
|
+
*/
|
|
51
|
+
revenueRange?: ProfitabilitySummaryResponseRevenueRange | null | undefined;
|
|
52
|
+
/**
|
|
53
|
+
* Where the caller's cost data actually lies in time. Present only when the selected range returned no cost. An object carries the bounds of the real cost events; null means the caller has no cost event at any time; an absent field means the extent was not resolved, because the result was not empty, because the lookup failed, or because the metering service does not serve the bounds method. An absent field must never be read as an absence.
|
|
54
|
+
*/
|
|
55
|
+
costRange?: ProfitabilitySummaryResponseCostRange | null | undefined;
|
|
22
56
|
};
|
|
23
57
|
/** @internal */
|
|
58
|
+
export declare const ProfitabilitySummaryResponseRevenueRange$inboundSchema: z.ZodType<ProfitabilitySummaryResponseRevenueRange, z.ZodTypeDef, unknown>;
|
|
59
|
+
export declare function profitabilitySummaryResponseRevenueRangeFromJSON(jsonString: string): SafeParseResult<ProfitabilitySummaryResponseRevenueRange, SDKValidationError>;
|
|
60
|
+
/** @internal */
|
|
61
|
+
export declare const ProfitabilitySummaryResponseCostRange$inboundSchema: z.ZodType<ProfitabilitySummaryResponseCostRange, z.ZodTypeDef, unknown>;
|
|
62
|
+
export declare function profitabilitySummaryResponseCostRangeFromJSON(jsonString: string): SafeParseResult<ProfitabilitySummaryResponseCostRange, SDKValidationError>;
|
|
63
|
+
/** @internal */
|
|
24
64
|
export declare const ProfitabilitySummaryResponse$inboundSchema: z.ZodType<ProfitabilitySummaryResponse, z.ZodTypeDef, unknown>;
|
|
25
65
|
export declare function profitabilitySummaryResponseFromJSON(jsonString: string): SafeParseResult<ProfitabilitySummaryResponse, SDKValidationError>;
|
|
26
66
|
//# sourceMappingURL=profitabilitysummaryresponse.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"profitabilitysummaryresponse.d.ts","sourceRoot":"","sources":["../../../src/models/profitabilitysummaryresponse.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,CAAC,MAAM,QAAQ,CAAC;AAE5B,OAAO,EAAE,MAAM,IAAI,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAC3D,OAAO,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AACpE,OAAO,EACL,gBAAgB,EAEjB,MAAM,uBAAuB,CAAC;AAE/B,MAAM,MAAM,4BAA4B,GAAG;IACzC;;OAEG;IACH,MAAM,EAAE,uBAAuB,CAAC;IAChC;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAC;IACjB;;OAEG;IACH,IAAI,EAAE,KAAK,CAAC,gBAAgB,CAAC,CAAC;IAC9B;;OAEG;IACH,QAAQ,CAAC,EAAE,KAAK,CAAC,MAAM,CAAC,GAAG,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"profitabilitysummaryresponse.d.ts","sourceRoot":"","sources":["../../../src/models/profitabilitysummaryresponse.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,CAAC,MAAM,QAAQ,CAAC;AAE5B,OAAO,EAAE,MAAM,IAAI,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAC3D,OAAO,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AACpE,OAAO,EACL,gBAAgB,EAEjB,MAAM,uBAAuB,CAAC;AAE/B;;GAEG;AACH,MAAM,MAAM,wCAAwC,GAAG;IACrD;;OAEG;IACH,IAAI,EAAE,IAAI,CAAC;IACX;;OAEG;IACH,EAAE,EAAE,IAAI,CAAC;CACV,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,qCAAqC,GAAG;IAClD;;OAEG;IACH,IAAI,EAAE,IAAI,CAAC;IACX;;OAEG;IACH,EAAE,EAAE,IAAI,CAAC;CACV,CAAC;AAEF,MAAM,MAAM,4BAA4B,GAAG;IACzC;;OAEG;IACH,MAAM,EAAE,uBAAuB,CAAC;IAChC;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAC;IACjB;;OAEG;IACH,IAAI,EAAE,KAAK,CAAC,gBAAgB,CAAC,CAAC;IAC9B;;OAEG;IACH,QAAQ,CAAC,EAAE,KAAK,CAAC,MAAM,CAAC,GAAG,SAAS,CAAC;IACrC;;OAEG;IACH,YAAY,CAAC,EAAE,wCAAwC,GAAG,IAAI,GAAG,SAAS,CAAC;IAC3E;;OAEG;IACH,SAAS,CAAC,EAAE,qCAAqC,GAAG,IAAI,GAAG,SAAS,CAAC;CACtE,CAAC;AAEF,gBAAgB;AAChB,eAAO,MAAM,sDAAsD,EAAE,CAAC,CAAC,OAAO,CAC5E,wCAAwC,EACxC,CAAC,CAAC,UAAU,EACZ,OAAO,CAIP,CAAC;AAEH,wBAAgB,gDAAgD,CAC9D,UAAU,EAAE,MAAM,GACjB,eAAe,CAChB,wCAAwC,EACxC,kBAAkB,CACnB,CASA;AAED,gBAAgB;AAChB,eAAO,MAAM,mDAAmD,EAAE,CAAC,CAAC,OAAO,CACzE,qCAAqC,EACrC,CAAC,CAAC,UAAU,EACZ,OAAO,CAIP,CAAC;AAEH,wBAAgB,6CAA6C,CAC3D,UAAU,EAAE,MAAM,GACjB,eAAe,CAAC,qCAAqC,EAAE,kBAAkB,CAAC,CAO5E;AAED,gBAAgB;AAChB,eAAO,MAAM,0CAA0C,EAAE,CAAC,CAAC,OAAO,CAChE,4BAA4B,EAC5B,CAAC,CAAC,UAAU,EACZ,OAAO,CAYP,CAAC;AAEH,wBAAgB,oCAAoC,CAClD,UAAU,EAAE,MAAM,GACjB,eAAe,CAAC,4BAA4B,EAAE,kBAAkB,CAAC,CAMnE"}
|
|
@@ -5,11 +5,29 @@ import * as z from "zod/v3";
|
|
|
5
5
|
import { safeParse } from "../lib/schemas.js";
|
|
6
6
|
import { ProfitabilityRow$inboundSchema, } from "./profitabilityrow.js";
|
|
7
7
|
/** @internal */
|
|
8
|
+
export const ProfitabilitySummaryResponseRevenueRange$inboundSchema = z.object({
|
|
9
|
+
from: z.string().datetime({ offset: true }).transform(v => new Date(v)),
|
|
10
|
+
to: z.string().datetime({ offset: true }).transform(v => new Date(v)),
|
|
11
|
+
});
|
|
12
|
+
export function profitabilitySummaryResponseRevenueRangeFromJSON(jsonString) {
|
|
13
|
+
return safeParse(jsonString, (x) => ProfitabilitySummaryResponseRevenueRange$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ProfitabilitySummaryResponseRevenueRange' from JSON`);
|
|
14
|
+
}
|
|
15
|
+
/** @internal */
|
|
16
|
+
export const ProfitabilitySummaryResponseCostRange$inboundSchema = z.object({
|
|
17
|
+
from: z.string().datetime({ offset: true }).transform(v => new Date(v)),
|
|
18
|
+
to: z.string().datetime({ offset: true }).transform(v => new Date(v)),
|
|
19
|
+
});
|
|
20
|
+
export function profitabilitySummaryResponseCostRangeFromJSON(jsonString) {
|
|
21
|
+
return safeParse(jsonString, (x) => ProfitabilitySummaryResponseCostRange$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ProfitabilitySummaryResponseCostRange' from JSON`);
|
|
22
|
+
}
|
|
23
|
+
/** @internal */
|
|
8
24
|
export const ProfitabilitySummaryResponse$inboundSchema = z.object({
|
|
9
25
|
object: z.literal("profitability_summary"),
|
|
10
26
|
currency: z.string(),
|
|
11
27
|
rows: z.array(ProfitabilityRow$inboundSchema),
|
|
12
28
|
warnings: z.array(z.string()).optional(),
|
|
29
|
+
revenueRange: z.nullable(z.lazy(() => ProfitabilitySummaryResponseRevenueRange$inboundSchema)).optional(),
|
|
30
|
+
costRange: z.nullable(z.lazy(() => ProfitabilitySummaryResponseCostRange$inboundSchema)).optional(),
|
|
13
31
|
});
|
|
14
32
|
export function profitabilitySummaryResponseFromJSON(jsonString) {
|
|
15
33
|
return safeParse(jsonString, (x) => ProfitabilitySummaryResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ProfitabilitySummaryResponse' from JSON`);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"profitabilitysummaryresponse.js","sourceRoot":"","sources":["../../../src/models/profitabilitysummaryresponse.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,CAAC,MAAM,QAAQ,CAAC;AAC5B,OAAO,EAAE,SAAS,EAAE,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}
|
|
@@ -6,6 +6,19 @@ import { GroupInvoiceSummary } from "./groupinvoicesummary.js";
|
|
|
6
6
|
import { InvoiceSummary } from "./invoicesummary.js";
|
|
7
7
|
import { PaymentSummary } from "./paymentsummary.js";
|
|
8
8
|
import { RevenueTrendBucket } from "./revenuetrendbucket.js";
|
|
9
|
+
/**
|
|
10
|
+
* Where the caller's revenue actually lies in time. Scoped by the same filters as the request (merchant, and where given customer, subscription and currency), so it is not an account-wide statement. Present only when the selected range returned nothing. An object carries the bounds of the real revenue; null means no revenue under these filters at any time; an absent field means the extent was not resolved, because the result was not empty or because the lookup failed. An absent field must never be read as an absence. The bounds may span more than this endpoint's maximum queryable range, so clamp before re-querying.
|
|
11
|
+
*/
|
|
12
|
+
export type RevenueSummaryResponseRevenueRange = {
|
|
13
|
+
/**
|
|
14
|
+
* Earliest invoice issue instant.
|
|
15
|
+
*/
|
|
16
|
+
from: Date;
|
|
17
|
+
/**
|
|
18
|
+
* Latest invoice issue instant.
|
|
19
|
+
*/
|
|
20
|
+
to: Date;
|
|
21
|
+
};
|
|
9
22
|
export type RevenueSummaryResponse = {
|
|
10
23
|
/**
|
|
11
24
|
* Object type identifier
|
|
@@ -45,8 +58,15 @@ export type RevenueSummaryResponse = {
|
|
|
45
58
|
* Per-currency revenue aggregates (only present when groupBy=currency is specified). Primary currency appears first, then alphabetical by ISO code. When present, top-level netRevenue, invoices, payments, and trend fields are omitted.
|
|
46
59
|
*/
|
|
47
60
|
currencyBreakdown?: Array<CurrencyBreakdownEntry> | undefined;
|
|
61
|
+
/**
|
|
62
|
+
* Where the caller's revenue actually lies in time. Scoped by the same filters as the request (merchant, and where given customer, subscription and currency), so it is not an account-wide statement. Present only when the selected range returned nothing. An object carries the bounds of the real revenue; null means no revenue under these filters at any time; an absent field means the extent was not resolved, because the result was not empty or because the lookup failed. An absent field must never be read as an absence. The bounds may span more than this endpoint's maximum queryable range, so clamp before re-querying.
|
|
63
|
+
*/
|
|
64
|
+
revenueRange?: RevenueSummaryResponseRevenueRange | null | undefined;
|
|
48
65
|
};
|
|
49
66
|
/** @internal */
|
|
67
|
+
export declare const RevenueSummaryResponseRevenueRange$inboundSchema: z.ZodType<RevenueSummaryResponseRevenueRange, z.ZodTypeDef, unknown>;
|
|
68
|
+
export declare function revenueSummaryResponseRevenueRangeFromJSON(jsonString: string): SafeParseResult<RevenueSummaryResponseRevenueRange, SDKValidationError>;
|
|
69
|
+
/** @internal */
|
|
50
70
|
export declare const RevenueSummaryResponse$inboundSchema: z.ZodType<RevenueSummaryResponse, z.ZodTypeDef, unknown>;
|
|
51
71
|
export declare function revenueSummaryResponseFromJSON(jsonString: string): SafeParseResult<RevenueSummaryResponse, SDKValidationError>;
|
|
52
72
|
//# sourceMappingURL=revenuesummaryresponse.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"revenuesummaryresponse.d.ts","sourceRoot":"","sources":["../../../src/models/revenuesummaryresponse.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,CAAC,MAAM,QAAQ,CAAC;AAE5B,OAAO,EAAE,MAAM,IAAI,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAC3D,OAAO,EACL,sBAAsB,EAEvB,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AACpE,OAAO,EACL,mBAAmB,EAEpB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EACL,cAAc,EAEf,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EACL,cAAc,EAEf,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EACL,kBAAkB,EAEnB,MAAM,yBAAyB,CAAC;AAEjC,MAAM,MAAM,sBAAsB,GAAG;IACnC;;OAEG;IACH,MAAM,EAAE,iBAAiB,CAAC;IAC1B;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAChC;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAClC;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,6 +9,14 @@ import { InvoiceSummary$inboundSchema, } from "./invoicesummary.js";
|
|
|
9
9
|
import { PaymentSummary$inboundSchema, } from "./paymentsummary.js";
|
|
10
10
|
import { RevenueTrendBucket$inboundSchema, } from "./revenuetrendbucket.js";
|
|
11
11
|
/** @internal */
|
|
12
|
+
export const RevenueSummaryResponseRevenueRange$inboundSchema = z.object({
|
|
13
|
+
from: z.string().datetime({ offset: true }).transform(v => new Date(v)),
|
|
14
|
+
to: z.string().datetime({ offset: true }).transform(v => new Date(v)),
|
|
15
|
+
});
|
|
16
|
+
export function revenueSummaryResponseRevenueRangeFromJSON(jsonString) {
|
|
17
|
+
return safeParse(jsonString, (x) => RevenueSummaryResponseRevenueRange$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'RevenueSummaryResponseRevenueRange' from JSON`);
|
|
18
|
+
}
|
|
19
|
+
/** @internal */
|
|
12
20
|
export const RevenueSummaryResponse$inboundSchema = z.object({
|
|
13
21
|
object: z.literal("revenue_summary"),
|
|
14
22
|
netRevenue: z.string().optional(),
|
|
@@ -21,6 +29,7 @@ export const RevenueSummaryResponse$inboundSchema = z.object({
|
|
|
21
29
|
trend: z.array(RevenueTrendBucket$inboundSchema).optional(),
|
|
22
30
|
groupBreakdown: z.array(GroupInvoiceSummary$inboundSchema).optional(),
|
|
23
31
|
currencyBreakdown: z.array(CurrencyBreakdownEntry$inboundSchema).optional(),
|
|
32
|
+
revenueRange: z.nullable(z.lazy(() => RevenueSummaryResponseRevenueRange$inboundSchema)).optional(),
|
|
24
33
|
});
|
|
25
34
|
export function revenueSummaryResponseFromJSON(jsonString) {
|
|
26
35
|
return safeParse(jsonString, (x) => RevenueSummaryResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'RevenueSummaryResponse' from JSON`);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"revenuesummaryresponse.js","sourceRoot":"","sources":["../../../src/models/revenuesummaryresponse.ts"],"names":[],"mappings":"AAAA;;GAEG;A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S,CACd,UAAU,EACV,CAAC,CAAC,EAAE,EAAE,CAAC,oCAAoC,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,EAChE,oDAAoD,CACrD,CAAC;AACJ,CAAC"}
|
package/jsr.json
CHANGED
package/package.json
CHANGED
|
@@ -143,7 +143,7 @@ async function $do(
|
|
|
143
143
|
|
|
144
144
|
const doResult = await client._do(req, {
|
|
145
145
|
context,
|
|
146
|
-
errorCodes: ["400", "401", "403", "404", "429", "4XX", "500", "5XX"],
|
|
146
|
+
errorCodes: ["400", "401", "403", "404", "429", "4XX", "500", "503", "5XX"],
|
|
147
147
|
retryConfig: context.retryConfig,
|
|
148
148
|
retryCodes: context.retryCodes,
|
|
149
149
|
});
|
|
@@ -172,7 +172,7 @@ async function $do(
|
|
|
172
172
|
M.json([200, 201], models.SubscriptionReconciliation$inboundSchema),
|
|
173
173
|
M.jsonErr(400, errors.BadRequest$inboundSchema),
|
|
174
174
|
M.jsonErr([401, 403, 404, 429], errors.ErrorT$inboundSchema),
|
|
175
|
-
M.jsonErr(500, errors.ErrorT$inboundSchema),
|
|
175
|
+
M.jsonErr([500, 503], errors.ErrorT$inboundSchema),
|
|
176
176
|
M.fail("4XX"),
|
|
177
177
|
M.fail("5XX"),
|
|
178
178
|
)(response, req, { extraFields: responseFields });
|
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.11",
|
|
69
69
|
genVersion: "2.879.13",
|
|
70
|
-
userAgent: "speakeasy-sdk/typescript 0.9.
|
|
70
|
+
userAgent: "speakeasy-sdk/typescript 0.9.11 2.879.13 0.1.0 @paygentic/sdk",
|
|
71
71
|
} as const;
|
|
@@ -34,6 +34,20 @@ export type Pagination = {
|
|
|
34
34
|
offset: number;
|
|
35
35
|
};
|
|
36
36
|
|
|
37
|
+
/**
|
|
38
|
+
* Where the caller's cost data actually lies in time. Present only when the selected range returned no cost. An object carries the bounds of the real cost events; null means the caller has no cost event at any time; an absent field means the extent was not resolved, because the result was not empty, because the lookup failed, or because the metering service does not serve the bounds method. An absent field must never be read as an absence.
|
|
39
|
+
*/
|
|
40
|
+
export type CostReportResponseCostRange = {
|
|
41
|
+
/**
|
|
42
|
+
* Earliest cost event instant.
|
|
43
|
+
*/
|
|
44
|
+
from: Date;
|
|
45
|
+
/**
|
|
46
|
+
* Latest cost event instant.
|
|
47
|
+
*/
|
|
48
|
+
to: Date;
|
|
49
|
+
};
|
|
50
|
+
|
|
37
51
|
export type CostReportResponse = {
|
|
38
52
|
object: CostReportResponseObject;
|
|
39
53
|
/**
|
|
@@ -70,6 +84,10 @@ export type CostReportResponse = {
|
|
|
70
84
|
*/
|
|
71
85
|
warnings?: Array<string> | undefined;
|
|
72
86
|
pagination: Pagination;
|
|
87
|
+
/**
|
|
88
|
+
* Where the caller's cost data actually lies in time. Present only when the selected range returned no cost. An object carries the bounds of the real cost events; null means the caller has no cost event at any time; an absent field means the extent was not resolved, because the result was not empty, because the lookup failed, or because the metering service does not serve the bounds method. An absent field must never be read as an absence.
|
|
89
|
+
*/
|
|
90
|
+
costRange?: CostReportResponseCostRange | null | undefined;
|
|
73
91
|
};
|
|
74
92
|
|
|
75
93
|
/** @internal */
|
|
@@ -115,6 +133,26 @@ export function paginationFromJSON(
|
|
|
115
133
|
);
|
|
116
134
|
}
|
|
117
135
|
|
|
136
|
+
/** @internal */
|
|
137
|
+
export const CostReportResponseCostRange$inboundSchema: z.ZodType<
|
|
138
|
+
CostReportResponseCostRange,
|
|
139
|
+
z.ZodTypeDef,
|
|
140
|
+
unknown
|
|
141
|
+
> = z.object({
|
|
142
|
+
from: z.string().datetime({ offset: true }).transform(v => new Date(v)),
|
|
143
|
+
to: z.string().datetime({ offset: true }).transform(v => new Date(v)),
|
|
144
|
+
});
|
|
145
|
+
|
|
146
|
+
export function costReportResponseCostRangeFromJSON(
|
|
147
|
+
jsonString: string,
|
|
148
|
+
): SafeParseResult<CostReportResponseCostRange, SDKValidationError> {
|
|
149
|
+
return safeParse(
|
|
150
|
+
jsonString,
|
|
151
|
+
(x) => CostReportResponseCostRange$inboundSchema.parse(JSON.parse(x)),
|
|
152
|
+
`Failed to parse 'CostReportResponseCostRange' from JSON`,
|
|
153
|
+
);
|
|
154
|
+
}
|
|
155
|
+
|
|
118
156
|
/** @internal */
|
|
119
157
|
export const CostReportResponse$inboundSchema: z.ZodType<
|
|
120
158
|
CostReportResponse,
|
|
@@ -132,6 +170,8 @@ export const CostReportResponse$inboundSchema: z.ZodType<
|
|
|
132
170
|
availableDimensions: z.array(z.string()),
|
|
133
171
|
warnings: z.array(z.string()).optional(),
|
|
134
172
|
pagination: z.lazy(() => Pagination$inboundSchema),
|
|
173
|
+
costRange: z.nullable(z.lazy(() => CostReportResponseCostRange$inboundSchema))
|
|
174
|
+
.optional(),
|
|
135
175
|
});
|
|
136
176
|
|
|
137
177
|
export function costReportResponseFromJSON(
|
package/src/models/invoice.ts
CHANGED
|
@@ -64,7 +64,7 @@ export const PdfSource = {
|
|
|
64
64
|
export type PdfSource = ClosedEnum<typeof PdfSource>;
|
|
65
65
|
|
|
66
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 `
|
|
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 `null`, and never `paygentic`: an invoice whose document is withheld is not served the provider's in its place, because recording that link would mark the invoice as already served and stop a later repair rendering ours. Use it to tell a withheld invoice apart from one that simply has no document yet — both report pdfSource `null`, and only a withheld one names why. An invoice the tax provider serves by design reports pdfSource `tax_provider` with no reason, and needs no repair. Both an invoice with no document and 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
68
|
*/
|
|
69
69
|
export const DocumentWithheldReason = {
|
|
70
70
|
TaxUnreconciled: "tax_unreconciled",
|
|
@@ -74,7 +74,7 @@ export const DocumentWithheldReason = {
|
|
|
74
74
|
TaxProviderDisagrees: "tax_provider_disagrees",
|
|
75
75
|
} as const;
|
|
76
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 `
|
|
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 `null`, and never `paygentic`: an invoice whose document is withheld is not served the provider's in its place, because recording that link would mark the invoice as already served and stop a later repair rendering ours. Use it to tell a withheld invoice apart from one that simply has no document yet — both report pdfSource `null`, and only a withheld one names why. An invoice the tax provider serves by design reports pdfSource `tax_provider` with no reason, and needs no repair. Both an invoice with no document and 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
78
|
*/
|
|
79
79
|
export type DocumentWithheldReason = OpenEnum<typeof DocumentWithheldReason>;
|
|
80
80
|
|
|
@@ -227,7 +227,7 @@ export type Invoice = {
|
|
|
227
227
|
*/
|
|
228
228
|
pdfSource?: PdfSource | null | undefined;
|
|
229
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 `
|
|
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 `null`, and never `paygentic`: an invoice whose document is withheld is not served the provider's in its place, because recording that link would mark the invoice as already served and stop a later repair rendering ours. Use it to tell a withheld invoice apart from one that simply has no document yet — both report pdfSource `null`, and only a withheld one names why. An invoice the tax provider serves by design reports pdfSource `tax_provider` with no reason, and needs no repair. Both an invoice with no document and 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
231
|
*/
|
|
232
232
|
documentWithheldReason?: DocumentWithheldReason | null | undefined;
|
|
233
233
|
/**
|
package/src/models/lineitem.ts
CHANGED
|
@@ -153,7 +153,7 @@ export type LineItem = {
|
|
|
153
153
|
*/
|
|
154
154
|
estimatedMeteredQuantity?: string | null | undefined;
|
|
155
155
|
/**
|
|
156
|
-
* Real-time estimated subtotal
|
|
156
|
+
* Real-time estimated subtotal for a line whose amount is not final yet: current usage for a metered item, the rate the subscription is on for a fee. Null for manual items, and for any line whose amount is already final or cannot be estimated.
|
|
157
157
|
*/
|
|
158
158
|
estimatedSubtotal?: string | null | undefined;
|
|
159
159
|
};
|
|
@@ -11,6 +11,34 @@ import {
|
|
|
11
11
|
ProfitabilityRow$inboundSchema,
|
|
12
12
|
} from "./profitabilityrow.js";
|
|
13
13
|
|
|
14
|
+
/**
|
|
15
|
+
* Where the caller's revenue actually lies in time. Scoped by the same filters as the request (merchant, and where given customer, subscription and currency), so it is not an account-wide statement. Present only when the selected range returned nothing. An object carries the bounds of the real revenue; null means no revenue under these filters at any time; an absent field means the extent was not resolved, because the result was not empty or because the lookup failed. An absent field must never be read as an absence. The bounds may span more than this endpoint's maximum queryable range, so clamp before re-querying.
|
|
16
|
+
*/
|
|
17
|
+
export type ProfitabilitySummaryResponseRevenueRange = {
|
|
18
|
+
/**
|
|
19
|
+
* Earliest invoice issue instant.
|
|
20
|
+
*/
|
|
21
|
+
from: Date;
|
|
22
|
+
/**
|
|
23
|
+
* Latest invoice issue instant.
|
|
24
|
+
*/
|
|
25
|
+
to: Date;
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Where the caller's cost data actually lies in time. Present only when the selected range returned no cost. An object carries the bounds of the real cost events; null means the caller has no cost event at any time; an absent field means the extent was not resolved, because the result was not empty, because the lookup failed, or because the metering service does not serve the bounds method. An absent field must never be read as an absence.
|
|
30
|
+
*/
|
|
31
|
+
export type ProfitabilitySummaryResponseCostRange = {
|
|
32
|
+
/**
|
|
33
|
+
* Earliest cost event instant.
|
|
34
|
+
*/
|
|
35
|
+
from: Date;
|
|
36
|
+
/**
|
|
37
|
+
* Latest cost event instant.
|
|
38
|
+
*/
|
|
39
|
+
to: Date;
|
|
40
|
+
};
|
|
41
|
+
|
|
14
42
|
export type ProfitabilitySummaryResponse = {
|
|
15
43
|
/**
|
|
16
44
|
* Object type identifier
|
|
@@ -28,8 +56,63 @@ export type ProfitabilitySummaryResponse = {
|
|
|
28
56
|
* Non-fatal warnings collected during cost discovery (e.g. an individual cost query failed). Empty array on a clean run.
|
|
29
57
|
*/
|
|
30
58
|
warnings?: Array<string> | undefined;
|
|
59
|
+
/**
|
|
60
|
+
* Where the caller's revenue actually lies in time. Scoped by the same filters as the request (merchant, and where given customer, subscription and currency), so it is not an account-wide statement. Present only when the selected range returned nothing. An object carries the bounds of the real revenue; null means no revenue under these filters at any time; an absent field means the extent was not resolved, because the result was not empty or because the lookup failed. An absent field must never be read as an absence. The bounds may span more than this endpoint's maximum queryable range, so clamp before re-querying.
|
|
61
|
+
*/
|
|
62
|
+
revenueRange?: ProfitabilitySummaryResponseRevenueRange | null | undefined;
|
|
63
|
+
/**
|
|
64
|
+
* Where the caller's cost data actually lies in time. Present only when the selected range returned no cost. An object carries the bounds of the real cost events; null means the caller has no cost event at any time; an absent field means the extent was not resolved, because the result was not empty, because the lookup failed, or because the metering service does not serve the bounds method. An absent field must never be read as an absence.
|
|
65
|
+
*/
|
|
66
|
+
costRange?: ProfitabilitySummaryResponseCostRange | null | undefined;
|
|
31
67
|
};
|
|
32
68
|
|
|
69
|
+
/** @internal */
|
|
70
|
+
export const ProfitabilitySummaryResponseRevenueRange$inboundSchema: z.ZodType<
|
|
71
|
+
ProfitabilitySummaryResponseRevenueRange,
|
|
72
|
+
z.ZodTypeDef,
|
|
73
|
+
unknown
|
|
74
|
+
> = z.object({
|
|
75
|
+
from: z.string().datetime({ offset: true }).transform(v => new Date(v)),
|
|
76
|
+
to: z.string().datetime({ offset: true }).transform(v => new Date(v)),
|
|
77
|
+
});
|
|
78
|
+
|
|
79
|
+
export function profitabilitySummaryResponseRevenueRangeFromJSON(
|
|
80
|
+
jsonString: string,
|
|
81
|
+
): SafeParseResult<
|
|
82
|
+
ProfitabilitySummaryResponseRevenueRange,
|
|
83
|
+
SDKValidationError
|
|
84
|
+
> {
|
|
85
|
+
return safeParse(
|
|
86
|
+
jsonString,
|
|
87
|
+
(x) =>
|
|
88
|
+
ProfitabilitySummaryResponseRevenueRange$inboundSchema.parse(
|
|
89
|
+
JSON.parse(x),
|
|
90
|
+
),
|
|
91
|
+
`Failed to parse 'ProfitabilitySummaryResponseRevenueRange' from JSON`,
|
|
92
|
+
);
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
/** @internal */
|
|
96
|
+
export const ProfitabilitySummaryResponseCostRange$inboundSchema: z.ZodType<
|
|
97
|
+
ProfitabilitySummaryResponseCostRange,
|
|
98
|
+
z.ZodTypeDef,
|
|
99
|
+
unknown
|
|
100
|
+
> = z.object({
|
|
101
|
+
from: z.string().datetime({ offset: true }).transform(v => new Date(v)),
|
|
102
|
+
to: z.string().datetime({ offset: true }).transform(v => new Date(v)),
|
|
103
|
+
});
|
|
104
|
+
|
|
105
|
+
export function profitabilitySummaryResponseCostRangeFromJSON(
|
|
106
|
+
jsonString: string,
|
|
107
|
+
): SafeParseResult<ProfitabilitySummaryResponseCostRange, SDKValidationError> {
|
|
108
|
+
return safeParse(
|
|
109
|
+
jsonString,
|
|
110
|
+
(x) =>
|
|
111
|
+
ProfitabilitySummaryResponseCostRange$inboundSchema.parse(JSON.parse(x)),
|
|
112
|
+
`Failed to parse 'ProfitabilitySummaryResponseCostRange' from JSON`,
|
|
113
|
+
);
|
|
114
|
+
}
|
|
115
|
+
|
|
33
116
|
/** @internal */
|
|
34
117
|
export const ProfitabilitySummaryResponse$inboundSchema: z.ZodType<
|
|
35
118
|
ProfitabilitySummaryResponse,
|
|
@@ -40,6 +123,12 @@ export const ProfitabilitySummaryResponse$inboundSchema: z.ZodType<
|
|
|
40
123
|
currency: z.string(),
|
|
41
124
|
rows: z.array(ProfitabilityRow$inboundSchema),
|
|
42
125
|
warnings: z.array(z.string()).optional(),
|
|
126
|
+
revenueRange: z.nullable(
|
|
127
|
+
z.lazy(() => ProfitabilitySummaryResponseRevenueRange$inboundSchema),
|
|
128
|
+
).optional(),
|
|
129
|
+
costRange: z.nullable(
|
|
130
|
+
z.lazy(() => ProfitabilitySummaryResponseCostRange$inboundSchema),
|
|
131
|
+
).optional(),
|
|
43
132
|
});
|
|
44
133
|
|
|
45
134
|
export function profitabilitySummaryResponseFromJSON(
|