@paygentic/sdk 0.9.11 → 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/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/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/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/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/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/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/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/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/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
|
@@ -17,7 +17,7 @@ export type GroupTrendEntry = {
|
|
|
17
17
|
*/
|
|
18
18
|
groupLabel: string;
|
|
19
19
|
/**
|
|
20
|
-
* Total issued invoice amount in dollars for this group in this bucket
|
|
20
|
+
* Total issued invoice amount in dollars for this group in this bucket, excluding tax
|
|
21
21
|
*/
|
|
22
22
|
issuedInvoices: string;
|
|
23
23
|
};
|
package/src/models/index.ts
CHANGED
|
@@ -18,6 +18,8 @@ export * from "./createapprovalrequest.js";
|
|
|
18
18
|
export * from "./createbillingschedulerequest.js";
|
|
19
19
|
export * from "./creategrantrequest.js";
|
|
20
20
|
export * from "./createmanuallineitemrequest.js";
|
|
21
|
+
export * from "./createmaximumquantityadjustment.js";
|
|
22
|
+
export * from "./createminimumquantityadjustment.js";
|
|
21
23
|
export * from "./createorderapprovalrequest.js";
|
|
22
24
|
export * from "./createorderlineitemrequest.js";
|
|
23
25
|
export * from "./createorderrequest.js";
|
|
@@ -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
|
/**
|
|
@@ -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,
|