@paygentic/sdk 0.9.10 → 0.9.12
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/README.md +6 -0
- package/dist/commonjs/funcs/subscriptionsDeleteSubscriptionAdjustment.d.ts +3 -2
- package/dist/commonjs/funcs/subscriptionsDeleteSubscriptionAdjustment.d.ts.map +1 -1
- package/dist/commonjs/funcs/subscriptionsDeleteSubscriptionAdjustment.js +3 -3
- package/dist/commonjs/funcs/subscriptionsDeleteSubscriptionAdjustment.js.map +1 -1
- package/dist/commonjs/lib/config.d.ts +2 -2
- package/dist/commonjs/lib/config.js +2 -2
- 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/createmaximumquantityadjustment.d.ts +45 -0
- package/dist/commonjs/models/createmaximumquantityadjustment.d.ts.map +1 -0
- package/dist/commonjs/models/createmaximumquantityadjustment.js +55 -0
- package/dist/commonjs/models/createmaximumquantityadjustment.js.map +1 -0
- package/dist/commonjs/models/createminimumquantityadjustment.d.ts +45 -0
- package/dist/commonjs/models/createminimumquantityadjustment.d.ts.map +1 -0
- package/dist/commonjs/models/createminimumquantityadjustment.js +55 -0
- package/dist/commonjs/models/createminimumquantityadjustment.js.map +1 -0
- package/dist/commonjs/models/createsubscriptionadjustmentrequest.d.ts +5 -3
- package/dist/commonjs/models/createsubscriptionadjustmentrequest.d.ts.map +1 -1
- package/dist/commonjs/models/createsubscriptionadjustmentrequest.js +4 -0
- package/dist/commonjs/models/createsubscriptionadjustmentrequest.js.map +1 -1
- package/dist/commonjs/models/currencybreakdownentry.d.ts +1 -1
- package/dist/commonjs/models/grouptrendentry.d.ts +1 -1
- package/dist/commonjs/models/index.d.ts +2 -0
- package/dist/commonjs/models/index.d.ts.map +1 -1
- package/dist/commonjs/models/index.js +2 -0
- package/dist/commonjs/models/index.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/invoicecategorysummary.d.ts +1 -1
- package/dist/commonjs/models/operations/createbillablemetric.d.ts +3 -3
- package/dist/commonjs/models/operations/createbillablemetric.d.ts.map +1 -1
- package/dist/commonjs/models/operations/createbillablemetric.js +1 -1
- package/dist/commonjs/models/operations/createbillablemetric.js.map +1 -1
- package/dist/commonjs/models/operations/createtestclock.d.ts +1 -1
- package/dist/commonjs/models/operations/updatebillablemetric.d.ts +4 -4
- package/dist/commonjs/models/operations/updatebillablemetric.d.ts.map +1 -1
- package/dist/commonjs/models/operations/updatebillablemetric.js +1 -1
- package/dist/commonjs/models/operations/updatebillablemetric.js.map +1 -1
- package/dist/commonjs/models/profitabilityrow.d.ts +1 -1
- package/dist/commonjs/models/profitabilitysummaryresponse.d.ts +20 -0
- package/dist/commonjs/models/profitabilitysummaryresponse.d.ts.map +1 -1
- package/dist/commonjs/models/profitabilitysummaryresponse.js +11 -1
- package/dist/commonjs/models/profitabilitysummaryresponse.js.map +1 -1
- package/dist/commonjs/models/revenuesummaryresponse.d.ts +2 -2
- package/dist/commonjs/models/revenuetrendbucket.d.ts +1 -1
- package/dist/commonjs/models/subscriptionadjustment.d.ts +16 -6
- package/dist/commonjs/models/subscriptionadjustment.d.ts.map +1 -1
- package/dist/commonjs/models/subscriptionadjustment.js +4 -0
- package/dist/commonjs/models/subscriptionadjustment.js.map +1 -1
- package/dist/commonjs/sdk/subscriptions.d.ts +2 -2
- package/dist/commonjs/sdk/subscriptions.d.ts.map +1 -1
- package/dist/commonjs/sdk/subscriptions.js +1 -1
- package/dist/esm/funcs/subscriptionsDeleteSubscriptionAdjustment.d.ts +3 -2
- package/dist/esm/funcs/subscriptionsDeleteSubscriptionAdjustment.d.ts.map +1 -1
- package/dist/esm/funcs/subscriptionsDeleteSubscriptionAdjustment.js +3 -3
- package/dist/esm/funcs/subscriptionsDeleteSubscriptionAdjustment.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/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/createmaximumquantityadjustment.d.ts +45 -0
- package/dist/esm/models/createmaximumquantityadjustment.d.ts.map +1 -0
- package/dist/esm/models/createmaximumquantityadjustment.js +18 -0
- package/dist/esm/models/createmaximumquantityadjustment.js.map +1 -0
- package/dist/esm/models/createminimumquantityadjustment.d.ts +45 -0
- package/dist/esm/models/createminimumquantityadjustment.d.ts.map +1 -0
- package/dist/esm/models/createminimumquantityadjustment.js +18 -0
- package/dist/esm/models/createminimumquantityadjustment.js.map +1 -0
- package/dist/esm/models/createsubscriptionadjustmentrequest.d.ts +5 -3
- package/dist/esm/models/createsubscriptionadjustmentrequest.d.ts.map +1 -1
- package/dist/esm/models/createsubscriptionadjustmentrequest.js +4 -0
- package/dist/esm/models/createsubscriptionadjustmentrequest.js.map +1 -1
- package/dist/esm/models/currencybreakdownentry.d.ts +1 -1
- package/dist/esm/models/grouptrendentry.d.ts +1 -1
- package/dist/esm/models/index.d.ts +2 -0
- package/dist/esm/models/index.d.ts.map +1 -1
- package/dist/esm/models/index.js +2 -0
- package/dist/esm/models/index.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/invoicecategorysummary.d.ts +1 -1
- package/dist/esm/models/operations/createbillablemetric.d.ts +3 -3
- package/dist/esm/models/operations/createbillablemetric.d.ts.map +1 -1
- package/dist/esm/models/operations/createbillablemetric.js +1 -1
- package/dist/esm/models/operations/createbillablemetric.js.map +1 -1
- package/dist/esm/models/operations/createtestclock.d.ts +1 -1
- package/dist/esm/models/operations/updatebillablemetric.d.ts +4 -4
- package/dist/esm/models/operations/updatebillablemetric.d.ts.map +1 -1
- package/dist/esm/models/operations/updatebillablemetric.js +1 -1
- package/dist/esm/models/operations/updatebillablemetric.js.map +1 -1
- package/dist/esm/models/profitabilityrow.d.ts +1 -1
- package/dist/esm/models/profitabilitysummaryresponse.d.ts +20 -0
- package/dist/esm/models/profitabilitysummaryresponse.d.ts.map +1 -1
- package/dist/esm/models/profitabilitysummaryresponse.js +9 -0
- package/dist/esm/models/profitabilitysummaryresponse.js.map +1 -1
- package/dist/esm/models/revenuesummaryresponse.d.ts +2 -2
- package/dist/esm/models/revenuetrendbucket.d.ts +1 -1
- package/dist/esm/models/subscriptionadjustment.d.ts +16 -6
- package/dist/esm/models/subscriptionadjustment.d.ts.map +1 -1
- package/dist/esm/models/subscriptionadjustment.js +4 -0
- package/dist/esm/models/subscriptionadjustment.js.map +1 -1
- package/dist/esm/sdk/subscriptions.d.ts +2 -2
- package/dist/esm/sdk/subscriptions.d.ts.map +1 -1
- package/dist/esm/sdk/subscriptions.js +1 -1
- package/jsr.json +1 -1
- package/package.json +1 -1
- package/src/funcs/subscriptionsDeleteSubscriptionAdjustment.ts +7 -6
- package/src/lib/config.ts +2 -2
- package/src/models/costreportresponse.ts +40 -0
- package/src/models/createmaximumquantityadjustment.ts +72 -0
- package/src/models/createminimumquantityadjustment.ts +72 -0
- package/src/models/createsubscriptionadjustmentrequest.ts +19 -3
- package/src/models/currencybreakdownentry.ts +1 -1
- package/src/models/grouptrendentry.ts +1 -1
- package/src/models/index.ts +2 -0
- package/src/models/invoice.ts +3 -3
- package/src/models/invoicecategorysummary.ts +1 -1
- package/src/models/operations/createbillablemetric.ts +4 -4
- package/src/models/operations/createtestclock.ts +1 -1
- package/src/models/operations/updatebillablemetric.ts +5 -5
- package/src/models/profitabilityrow.ts +1 -1
- package/src/models/profitabilitysummaryresponse.ts +42 -0
- package/src/models/revenuesummaryresponse.ts +2 -2
- package/src/models/revenuetrendbucket.ts +1 -1
- package/src/models/subscriptionadjustment.ts +18 -6
- package/src/sdk/subscriptions.ts +2 -2
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
|
/**
|
|
@@ -56,9 +56,9 @@ export type CreateBillableMetricRequest = {
|
|
|
56
56
|
/**
|
|
57
57
|
* CloudEvents type for meter routing. Links this billable metric to the metering service.
|
|
58
58
|
*/
|
|
59
|
-
eventType
|
|
59
|
+
eventType: string;
|
|
60
60
|
/**
|
|
61
|
-
* JSONPath to extract a numeric value from event data. Must start with `$.` (example: `$.amount` or `$.payload.bytes`). Required for SUM/AVG/MIN/MAX/LATEST aggregations.
|
|
61
|
+
* JSONPath to extract a numeric value from event data. Must start with `$.` (example: `$.amount` or `$.payload.bytes`). Required for SUM/AVG/MIN/MAX/LATEST aggregations. Optional for UNIQUE_COUNT, which counts distinct values of this property when set and distinct events when not. Not stored for COUNT.
|
|
62
62
|
*/
|
|
63
63
|
valueProperty?: string | undefined;
|
|
64
64
|
/**
|
|
@@ -85,7 +85,7 @@ export type CreateBillableMetricRequest$Outbound = {
|
|
|
85
85
|
productId?: string | undefined;
|
|
86
86
|
itemId?: string | undefined;
|
|
87
87
|
unit: string;
|
|
88
|
-
eventType
|
|
88
|
+
eventType: string;
|
|
89
89
|
valueProperty?: string | undefined;
|
|
90
90
|
groupBy?: { [k: string]: string } | undefined;
|
|
91
91
|
eventFrom?: string | undefined;
|
|
@@ -104,7 +104,7 @@ export const CreateBillableMetricRequest$outboundSchema: z.ZodType<
|
|
|
104
104
|
productId: z.string().optional(),
|
|
105
105
|
itemId: z.string().optional(),
|
|
106
106
|
unit: z.string(),
|
|
107
|
-
eventType: z.string()
|
|
107
|
+
eventType: z.string(),
|
|
108
108
|
valueProperty: z.string().optional(),
|
|
109
109
|
groupBy: z.record(z.string()).optional(),
|
|
110
110
|
eventFrom: z.date().transform(v => v.toISOString()).optional(),
|
|
@@ -6,7 +6,7 @@ import * as z from "zod/v3";
|
|
|
6
6
|
|
|
7
7
|
export type CreateTestClockRequest = {
|
|
8
8
|
/**
|
|
9
|
-
* Initial time for the test clock (defaults to current time).
|
|
9
|
+
* Initial time for the test clock (defaults to current time). May be in the past, which lets a subscription on the clock start on a past date and bill its periods as the clock advances.
|
|
10
10
|
*/
|
|
11
11
|
currentTime?: Date | undefined;
|
|
12
12
|
/**
|
|
@@ -23,11 +23,11 @@ export type UpdateBillableMetricRequestBody = {
|
|
|
23
23
|
*/
|
|
24
24
|
itemId?: string | null | undefined;
|
|
25
25
|
/**
|
|
26
|
-
* CloudEvents type for meter routing.
|
|
26
|
+
* CloudEvents type for meter routing. Cannot be cleared: every billable metric needs one.
|
|
27
27
|
*/
|
|
28
|
-
eventType?: string |
|
|
28
|
+
eventType?: string | undefined;
|
|
29
29
|
/**
|
|
30
|
-
* JSONPath to extract a numeric value from event data. Must start with `$.` (example: `$.amount` or `$.payload.bytes`).
|
|
30
|
+
* JSONPath to extract a numeric value from event data. Must start with `$.` (example: `$.amount` or `$.payload.bytes`). Cannot be cleared on a SUM/AVG/MIN/MAX/LATEST metric. Not stored for COUNT.
|
|
31
31
|
*/
|
|
32
32
|
valueProperty?: string | null | undefined;
|
|
33
33
|
/**
|
|
@@ -51,7 +51,7 @@ export type UpdateBillableMetricRequestBody$Outbound = {
|
|
|
51
51
|
name?: string | undefined;
|
|
52
52
|
unit?: string | undefined;
|
|
53
53
|
itemId?: string | null | undefined;
|
|
54
|
-
eventType?: string |
|
|
54
|
+
eventType?: string | undefined;
|
|
55
55
|
valueProperty?: string | null | undefined;
|
|
56
56
|
groupBy?: { [k: string]: string } | null | undefined;
|
|
57
57
|
eventFrom?: string | null | undefined;
|
|
@@ -67,7 +67,7 @@ export const UpdateBillableMetricRequestBody$outboundSchema: z.ZodType<
|
|
|
67
67
|
name: z.string().optional(),
|
|
68
68
|
unit: z.string().optional(),
|
|
69
69
|
itemId: z.nullable(z.string()).optional(),
|
|
70
|
-
eventType: z.
|
|
70
|
+
eventType: z.string().optional(),
|
|
71
71
|
valueProperty: z.nullable(z.string()).optional(),
|
|
72
72
|
groupBy: z.nullable(z.record(z.string())).optional(),
|
|
73
73
|
eventFrom: z.nullable(z.date().transform(v => v.toISOString())).optional(),
|
|
@@ -21,7 +21,7 @@ export type ProfitabilityRow = {
|
|
|
21
21
|
*/
|
|
22
22
|
customerName: string;
|
|
23
23
|
/**
|
|
24
|
-
*
|
|
24
|
+
* Revenue excluding tax (paid + outstanding invoices issued in the period), in unit currency, with two decimals.
|
|
25
25
|
*/
|
|
26
26
|
netRevenue: string;
|
|
27
27
|
/**
|
|
@@ -25,6 +25,20 @@ export type ProfitabilitySummaryResponseRevenueRange = {
|
|
|
25
25
|
to: Date;
|
|
26
26
|
};
|
|
27
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
|
+
|
|
28
42
|
export type ProfitabilitySummaryResponse = {
|
|
29
43
|
/**
|
|
30
44
|
* Object type identifier
|
|
@@ -46,6 +60,10 @@ export type ProfitabilitySummaryResponse = {
|
|
|
46
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.
|
|
47
61
|
*/
|
|
48
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;
|
|
49
67
|
};
|
|
50
68
|
|
|
51
69
|
/** @internal */
|
|
@@ -74,6 +92,27 @@ export function profitabilitySummaryResponseRevenueRangeFromJSON(
|
|
|
74
92
|
);
|
|
75
93
|
}
|
|
76
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
|
+
|
|
77
116
|
/** @internal */
|
|
78
117
|
export const ProfitabilitySummaryResponse$inboundSchema: z.ZodType<
|
|
79
118
|
ProfitabilitySummaryResponse,
|
|
@@ -87,6 +126,9 @@ export const ProfitabilitySummaryResponse$inboundSchema: z.ZodType<
|
|
|
87
126
|
revenueRange: z.nullable(
|
|
88
127
|
z.lazy(() => ProfitabilitySummaryResponseRevenueRange$inboundSchema),
|
|
89
128
|
).optional(),
|
|
129
|
+
costRange: z.nullable(
|
|
130
|
+
z.lazy(() => ProfitabilitySummaryResponseCostRange$inboundSchema),
|
|
131
|
+
).optional(),
|
|
90
132
|
});
|
|
91
133
|
|
|
92
134
|
export function profitabilitySummaryResponseFromJSON(
|
|
@@ -47,11 +47,11 @@ export type RevenueSummaryResponse = {
|
|
|
47
47
|
*/
|
|
48
48
|
object: "revenue_summary";
|
|
49
49
|
/**
|
|
50
|
-
*
|
|
50
|
+
* Revenue in dollars, excluding tax: invoices issued in the period plus completed payments, less non-voided refunds issued in the period. Invoices and refunds are counted excluding tax. Omitted when groupBy=currency is active.
|
|
51
51
|
*/
|
|
52
52
|
netRevenue?: string | undefined;
|
|
53
53
|
/**
|
|
54
|
-
*
|
|
54
|
+
* Total of non-voided refunds (credit notes) issued in the period, in dollars, including tax. netRevenue subtracts these refunds excluding tax. Omitted when groupBy=currency is active.
|
|
55
55
|
*/
|
|
56
56
|
totalRefunds?: string | undefined;
|
|
57
57
|
/**
|
|
@@ -17,7 +17,7 @@ export type RevenueTrendBucket = {
|
|
|
17
17
|
*/
|
|
18
18
|
timestamp: Date;
|
|
19
19
|
/**
|
|
20
|
-
* Total amount of all invoices issued in this bucket (all statuses, by issuedAt)
|
|
20
|
+
* Total amount of all invoices issued in this bucket (all statuses, by issuedAt), excluding tax
|
|
21
21
|
*/
|
|
22
22
|
issuedInvoices: string;
|
|
23
23
|
/**
|
|
@@ -18,6 +18,8 @@ export type SubscriptionAdjustmentObject = ClosedEnum<
|
|
|
18
18
|
export const SubscriptionAdjustmentType = {
|
|
19
19
|
PercentageDiscount: "percentageDiscount",
|
|
20
20
|
UsageDiscount: "usageDiscount",
|
|
21
|
+
MinimumQuantity: "minimumQuantity",
|
|
22
|
+
MaximumQuantity: "maximumQuantity",
|
|
21
23
|
} as const;
|
|
22
24
|
export type SubscriptionAdjustmentType = ClosedEnum<
|
|
23
25
|
typeof SubscriptionAdjustmentType
|
|
@@ -35,27 +37,35 @@ export type SubscriptionAdjustment = {
|
|
|
35
37
|
subscriptionId: string;
|
|
36
38
|
type: SubscriptionAdjustmentType;
|
|
37
39
|
/**
|
|
38
|
-
* The discount rate as a decimal fraction between 0 and 1. "0.35" means 35 percent. Null on
|
|
40
|
+
* The discount rate as a decimal fraction between 0 and 1. "0.35" means 35 percent. Null on every other type.
|
|
39
41
|
*/
|
|
40
42
|
percentageDiscount: string | null;
|
|
41
43
|
/**
|
|
42
|
-
* The number of usage units taken off the targeted line's billable quantity. Null on
|
|
44
|
+
* The number of usage units taken off the targeted line's billable quantity. Null on every other type.
|
|
43
45
|
*/
|
|
44
46
|
usageDiscount: string | null;
|
|
45
47
|
/**
|
|
46
|
-
* The
|
|
48
|
+
* The contracted minimum quantity billed for one period of the targeted price. Null on every other type.
|
|
49
|
+
*/
|
|
50
|
+
minimumQuantity: string | null;
|
|
51
|
+
/**
|
|
52
|
+
* The contracted maximum quantity billed for one period of the targeted price. Null on every other type.
|
|
53
|
+
*/
|
|
54
|
+
maximumQuantity: string | null;
|
|
55
|
+
/**
|
|
56
|
+
* The prices this adjustment applies to. Exactly one price on a usageDiscount; empty on a percentageDiscount, which reduces every discountable charge. A minimumQuantity or maximumQuantity is created against exactly one price, and later lists more than one only where that charge moved to a new price — a floating subscription moving to a new plan version, or a price edit freezing the subscription's version. Every id listed is the same charge, and the bound applies to whichever one a period bills under.
|
|
47
57
|
*/
|
|
48
58
|
targetPriceIds: Array<string>;
|
|
49
59
|
/**
|
|
50
|
-
* Opens the window. Read per type: INCLUSIVE on a percentageDiscount, whose window is prorated by day overlap; EXCLUSIVE on a usageDiscount, which
|
|
60
|
+
* Opens the window. Read per type: INCLUSIVE on a percentageDiscount, whose window is prorated by day overlap; EXCLUSIVE on a usageDiscount and on both quantity bounds, which apply to a line whose period END falls strictly after this instant.
|
|
51
61
|
*/
|
|
52
62
|
effectiveFrom: Date;
|
|
53
63
|
/**
|
|
54
|
-
* Closes the window, or null for never. Read per type: EXCLUSIVE on a percentageDiscount; INCLUSIVE on a usageDiscount, which
|
|
64
|
+
* Closes the window, or null for never. Read per type: EXCLUSIVE on a percentageDiscount; INCLUSIVE on a usageDiscount and on both quantity bounds, which apply to a line whose period END falls on or before this instant. A delete shortens this to the end of the last period the adjustment has already been billed on.
|
|
55
65
|
*/
|
|
56
66
|
effectiveTo: Date | null;
|
|
57
67
|
/**
|
|
58
|
-
* The deal's own name. Shown on each discount line a percentageDiscount emits;
|
|
68
|
+
* The deal's own name. Shown on each discount line a percentageDiscount emits; every other type emits no line, so its description is carried here only.
|
|
59
69
|
*/
|
|
60
70
|
description: string | null;
|
|
61
71
|
createdAt: Date;
|
|
@@ -83,6 +93,8 @@ export const SubscriptionAdjustment$inboundSchema: z.ZodType<
|
|
|
83
93
|
type: SubscriptionAdjustmentType$inboundSchema,
|
|
84
94
|
percentageDiscount: z.nullable(z.string()),
|
|
85
95
|
usageDiscount: z.nullable(z.string()),
|
|
96
|
+
minimumQuantity: z.nullable(z.string()),
|
|
97
|
+
maximumQuantity: z.nullable(z.string()),
|
|
86
98
|
targetPriceIds: z.array(z.string()),
|
|
87
99
|
effectiveFrom: z.string().datetime({ offset: true }).transform(v =>
|
|
88
100
|
new Date(v)
|
package/src/sdk/subscriptions.ts
CHANGED
|
@@ -166,12 +166,12 @@ export class Subscriptions extends ClientSDK {
|
|
|
166
166
|
* Delete Adjustment
|
|
167
167
|
*
|
|
168
168
|
* @remarks
|
|
169
|
-
*
|
|
169
|
+
* Stops an adjustment from applying to any period it has not already been billed on. An adjustment that has never reached an issued invoice is removed, and the response is 204. An adjustment that has already been billed on an issued invoice is RETRACTED instead: its effectiveTo moves to the end of the last period it was billed on, the adjustment still exists, and the response is 200 carrying it. Read a 200 as "shortened", not as "removed". No invoice changes either way: an issued invoice keeps its numbers, and a draft loses the adjustment only when its period is calculated again. Deleting the same adjustment again returns the same 200 and the same window.
|
|
170
170
|
*/
|
|
171
171
|
async deleteSubscriptionAdjustment(
|
|
172
172
|
request: operations.DeleteSubscriptionAdjustmentRequest,
|
|
173
173
|
options?: RequestOptions,
|
|
174
|
-
): Promise<
|
|
174
|
+
): Promise<models.SubscriptionAdjustment | undefined> {
|
|
175
175
|
return unwrapAsync(subscriptionsDeleteSubscriptionAdjustment(
|
|
176
176
|
this,
|
|
177
177
|
request,
|