@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.
Files changed (131) hide show
  1. package/README.md +6 -0
  2. package/dist/commonjs/funcs/subscriptionsDeleteSubscriptionAdjustment.d.ts +3 -2
  3. package/dist/commonjs/funcs/subscriptionsDeleteSubscriptionAdjustment.d.ts.map +1 -1
  4. package/dist/commonjs/funcs/subscriptionsDeleteSubscriptionAdjustment.js +3 -3
  5. package/dist/commonjs/funcs/subscriptionsDeleteSubscriptionAdjustment.js.map +1 -1
  6. package/dist/commonjs/lib/config.d.ts +2 -2
  7. package/dist/commonjs/lib/config.js +2 -2
  8. package/dist/commonjs/models/costreportresponse.d.ts +20 -0
  9. package/dist/commonjs/models/costreportresponse.d.ts.map +1 -1
  10. package/dist/commonjs/models/costreportresponse.js +12 -1
  11. package/dist/commonjs/models/costreportresponse.js.map +1 -1
  12. package/dist/commonjs/models/createmaximumquantityadjustment.d.ts +45 -0
  13. package/dist/commonjs/models/createmaximumquantityadjustment.d.ts.map +1 -0
  14. package/dist/commonjs/models/createmaximumquantityadjustment.js +55 -0
  15. package/dist/commonjs/models/createmaximumquantityadjustment.js.map +1 -0
  16. package/dist/commonjs/models/createminimumquantityadjustment.d.ts +45 -0
  17. package/dist/commonjs/models/createminimumquantityadjustment.d.ts.map +1 -0
  18. package/dist/commonjs/models/createminimumquantityadjustment.js +55 -0
  19. package/dist/commonjs/models/createminimumquantityadjustment.js.map +1 -0
  20. package/dist/commonjs/models/createsubscriptionadjustmentrequest.d.ts +5 -3
  21. package/dist/commonjs/models/createsubscriptionadjustmentrequest.d.ts.map +1 -1
  22. package/dist/commonjs/models/createsubscriptionadjustmentrequest.js +4 -0
  23. package/dist/commonjs/models/createsubscriptionadjustmentrequest.js.map +1 -1
  24. package/dist/commonjs/models/currencybreakdownentry.d.ts +1 -1
  25. package/dist/commonjs/models/grouptrendentry.d.ts +1 -1
  26. package/dist/commonjs/models/index.d.ts +2 -0
  27. package/dist/commonjs/models/index.d.ts.map +1 -1
  28. package/dist/commonjs/models/index.js +2 -0
  29. package/dist/commonjs/models/index.js.map +1 -1
  30. package/dist/commonjs/models/invoice.d.ts +3 -3
  31. package/dist/commonjs/models/invoice.js +1 -1
  32. package/dist/commonjs/models/invoicecategorysummary.d.ts +1 -1
  33. package/dist/commonjs/models/operations/createbillablemetric.d.ts +3 -3
  34. package/dist/commonjs/models/operations/createbillablemetric.d.ts.map +1 -1
  35. package/dist/commonjs/models/operations/createbillablemetric.js +1 -1
  36. package/dist/commonjs/models/operations/createbillablemetric.js.map +1 -1
  37. package/dist/commonjs/models/operations/createtestclock.d.ts +1 -1
  38. package/dist/commonjs/models/operations/updatebillablemetric.d.ts +4 -4
  39. package/dist/commonjs/models/operations/updatebillablemetric.d.ts.map +1 -1
  40. package/dist/commonjs/models/operations/updatebillablemetric.js +1 -1
  41. package/dist/commonjs/models/operations/updatebillablemetric.js.map +1 -1
  42. package/dist/commonjs/models/profitabilityrow.d.ts +1 -1
  43. package/dist/commonjs/models/profitabilitysummaryresponse.d.ts +20 -0
  44. package/dist/commonjs/models/profitabilitysummaryresponse.d.ts.map +1 -1
  45. package/dist/commonjs/models/profitabilitysummaryresponse.js +11 -1
  46. package/dist/commonjs/models/profitabilitysummaryresponse.js.map +1 -1
  47. package/dist/commonjs/models/revenuesummaryresponse.d.ts +2 -2
  48. package/dist/commonjs/models/revenuetrendbucket.d.ts +1 -1
  49. package/dist/commonjs/models/subscriptionadjustment.d.ts +16 -6
  50. package/dist/commonjs/models/subscriptionadjustment.d.ts.map +1 -1
  51. package/dist/commonjs/models/subscriptionadjustment.js +4 -0
  52. package/dist/commonjs/models/subscriptionadjustment.js.map +1 -1
  53. package/dist/commonjs/sdk/subscriptions.d.ts +2 -2
  54. package/dist/commonjs/sdk/subscriptions.d.ts.map +1 -1
  55. package/dist/commonjs/sdk/subscriptions.js +1 -1
  56. package/dist/esm/funcs/subscriptionsDeleteSubscriptionAdjustment.d.ts +3 -2
  57. package/dist/esm/funcs/subscriptionsDeleteSubscriptionAdjustment.d.ts.map +1 -1
  58. package/dist/esm/funcs/subscriptionsDeleteSubscriptionAdjustment.js +3 -3
  59. package/dist/esm/funcs/subscriptionsDeleteSubscriptionAdjustment.js.map +1 -1
  60. package/dist/esm/lib/config.d.ts +2 -2
  61. package/dist/esm/lib/config.js +2 -2
  62. package/dist/esm/models/costreportresponse.d.ts +20 -0
  63. package/dist/esm/models/costreportresponse.d.ts.map +1 -1
  64. package/dist/esm/models/costreportresponse.js +10 -0
  65. package/dist/esm/models/costreportresponse.js.map +1 -1
  66. package/dist/esm/models/createmaximumquantityadjustment.d.ts +45 -0
  67. package/dist/esm/models/createmaximumquantityadjustment.d.ts.map +1 -0
  68. package/dist/esm/models/createmaximumquantityadjustment.js +18 -0
  69. package/dist/esm/models/createmaximumquantityadjustment.js.map +1 -0
  70. package/dist/esm/models/createminimumquantityadjustment.d.ts +45 -0
  71. package/dist/esm/models/createminimumquantityadjustment.d.ts.map +1 -0
  72. package/dist/esm/models/createminimumquantityadjustment.js +18 -0
  73. package/dist/esm/models/createminimumquantityadjustment.js.map +1 -0
  74. package/dist/esm/models/createsubscriptionadjustmentrequest.d.ts +5 -3
  75. package/dist/esm/models/createsubscriptionadjustmentrequest.d.ts.map +1 -1
  76. package/dist/esm/models/createsubscriptionadjustmentrequest.js +4 -0
  77. package/dist/esm/models/createsubscriptionadjustmentrequest.js.map +1 -1
  78. package/dist/esm/models/currencybreakdownentry.d.ts +1 -1
  79. package/dist/esm/models/grouptrendentry.d.ts +1 -1
  80. package/dist/esm/models/index.d.ts +2 -0
  81. package/dist/esm/models/index.d.ts.map +1 -1
  82. package/dist/esm/models/index.js +2 -0
  83. package/dist/esm/models/index.js.map +1 -1
  84. package/dist/esm/models/invoice.d.ts +3 -3
  85. package/dist/esm/models/invoice.js +1 -1
  86. package/dist/esm/models/invoicecategorysummary.d.ts +1 -1
  87. package/dist/esm/models/operations/createbillablemetric.d.ts +3 -3
  88. package/dist/esm/models/operations/createbillablemetric.d.ts.map +1 -1
  89. package/dist/esm/models/operations/createbillablemetric.js +1 -1
  90. package/dist/esm/models/operations/createbillablemetric.js.map +1 -1
  91. package/dist/esm/models/operations/createtestclock.d.ts +1 -1
  92. package/dist/esm/models/operations/updatebillablemetric.d.ts +4 -4
  93. package/dist/esm/models/operations/updatebillablemetric.d.ts.map +1 -1
  94. package/dist/esm/models/operations/updatebillablemetric.js +1 -1
  95. package/dist/esm/models/operations/updatebillablemetric.js.map +1 -1
  96. package/dist/esm/models/profitabilityrow.d.ts +1 -1
  97. package/dist/esm/models/profitabilitysummaryresponse.d.ts +20 -0
  98. package/dist/esm/models/profitabilitysummaryresponse.d.ts.map +1 -1
  99. package/dist/esm/models/profitabilitysummaryresponse.js +9 -0
  100. package/dist/esm/models/profitabilitysummaryresponse.js.map +1 -1
  101. package/dist/esm/models/revenuesummaryresponse.d.ts +2 -2
  102. package/dist/esm/models/revenuetrendbucket.d.ts +1 -1
  103. package/dist/esm/models/subscriptionadjustment.d.ts +16 -6
  104. package/dist/esm/models/subscriptionadjustment.d.ts.map +1 -1
  105. package/dist/esm/models/subscriptionadjustment.js +4 -0
  106. package/dist/esm/models/subscriptionadjustment.js.map +1 -1
  107. package/dist/esm/sdk/subscriptions.d.ts +2 -2
  108. package/dist/esm/sdk/subscriptions.d.ts.map +1 -1
  109. package/dist/esm/sdk/subscriptions.js +1 -1
  110. package/jsr.json +1 -1
  111. package/package.json +1 -1
  112. package/src/funcs/subscriptionsDeleteSubscriptionAdjustment.ts +7 -6
  113. package/src/lib/config.ts +2 -2
  114. package/src/models/costreportresponse.ts +40 -0
  115. package/src/models/createmaximumquantityadjustment.ts +72 -0
  116. package/src/models/createminimumquantityadjustment.ts +72 -0
  117. package/src/models/createsubscriptionadjustmentrequest.ts +19 -3
  118. package/src/models/currencybreakdownentry.ts +1 -1
  119. package/src/models/grouptrendentry.ts +1 -1
  120. package/src/models/index.ts +2 -0
  121. package/src/models/invoice.ts +3 -3
  122. package/src/models/invoicecategorysummary.ts +1 -1
  123. package/src/models/operations/createbillablemetric.ts +4 -4
  124. package/src/models/operations/createtestclock.ts +1 -1
  125. package/src/models/operations/updatebillablemetric.ts +5 -5
  126. package/src/models/profitabilityrow.ts +1 -1
  127. package/src/models/profitabilitysummaryresponse.ts +42 -0
  128. package/src/models/revenuesummaryresponse.ts +2 -2
  129. package/src/models/revenuetrendbucket.ts +1 -1
  130. package/src/models/subscriptionadjustment.ts +18 -6
  131. package/src/sdk/subscriptions.ts +2 -2
@@ -15,6 +15,19 @@ export type ProfitabilitySummaryResponseRevenueRange = {
15
15
  */
16
16
  to: Date;
17
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
+ };
18
31
  export type ProfitabilitySummaryResponse = {
19
32
  /**
20
33
  * Object type identifier
@@ -36,11 +49,18 @@ export type ProfitabilitySummaryResponse = {
36
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.
37
50
  */
38
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;
39
56
  };
40
57
  /** @internal */
41
58
  export declare const ProfitabilitySummaryResponseRevenueRange$inboundSchema: z.ZodType<ProfitabilitySummaryResponseRevenueRange, z.ZodTypeDef, unknown>;
42
59
  export declare function profitabilitySummaryResponseRevenueRangeFromJSON(jsonString: string): SafeParseResult<ProfitabilitySummaryResponseRevenueRange, SDKValidationError>;
43
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 */
44
64
  export declare const ProfitabilitySummaryResponse$inboundSchema: z.ZodType<ProfitabilitySummaryResponse, z.ZodTypeDef, unknown>;
45
65
  export declare function profitabilitySummaryResponseFromJSON(jsonString: string): SafeParseResult<ProfitabilitySummaryResponse, SDKValidationError>;
46
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;;GAEG;AACH,MAAM,MAAM,wCAAwC,GAAG;IACrD;;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;CAC5E,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,0CAA0C,EAAE,CAAC,CAAC,OAAO,CAChE,4BAA4B,EAC5B,CAAC,CAAC,UAAU,EACZ,OAAO,CASP,CAAC;AAEH,wBAAgB,oCAAoC,CAClD,UAAU,EAAE,MAAM,GACjB,eAAe,CAAC,4BAA4B,EAAE,kBAAkB,CAAC,CAMnE"}
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,MA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@@ -13,12 +13,21 @@ export function profitabilitySummaryResponseRevenueRangeFromJSON(jsonString) {
13
13
  return safeParse(jsonString, (x) => ProfitabilitySummaryResponseRevenueRange$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ProfitabilitySummaryResponseRevenueRange' from JSON`);
14
14
  }
15
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 */
16
24
  export const ProfitabilitySummaryResponse$inboundSchema = z.object({
17
25
  object: z.literal("profitability_summary"),
18
26
  currency: z.string(),
19
27
  rows: z.array(ProfitabilityRow$inboundSchema),
20
28
  warnings: z.array(z.string()).optional(),
21
29
  revenueRange: z.nullable(z.lazy(() => ProfitabilitySummaryResponseRevenueRange$inboundSchema)).optional(),
30
+ costRange: z.nullable(z.lazy(() => ProfitabilitySummaryResponseCostRange$inboundSchema)).optional(),
22
31
  });
23
32
  export function profitabilitySummaryResponseFromJSON(jsonString) {
24
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,MAAM,mBAAmB,CAAC;AAG9C,OAAO,EAEL,8BAA8B,GAC/B,MAAM,uBAAuB,CAAC;AAuC/B,gBAAgB;AA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,CAAC"}
@@ -25,11 +25,11 @@ export type RevenueSummaryResponse = {
25
25
  */
26
26
  object: "revenue_summary";
27
27
  /**
28
- * Net collected revenue in dollars (paid invoices + completed payments), already net of non-voided refunds. Omitted when groupBy=currency is active.
28
+ * 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.
29
29
  */
30
30
  netRevenue?: string | undefined;
31
31
  /**
32
- * Gross total of non-voided refunds (credit notes) issued in the period, in dollars. Already subtracted from netRevenue and invoice totals. Omitted when groupBy=currency is active.
32
+ * 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.
33
33
  */
34
34
  totalRefunds?: string | undefined;
35
35
  /**
@@ -8,7 +8,7 @@ export type RevenueTrendBucket = {
8
8
  */
9
9
  timestamp: Date;
10
10
  /**
11
- * Total amount of all invoices issued in this bucket (all statuses, by issuedAt)
11
+ * Total amount of all invoices issued in this bucket (all statuses, by issuedAt), excluding tax
12
12
  */
13
13
  issuedInvoices: string;
14
14
  /**
@@ -9,6 +9,8 @@ export type SubscriptionAdjustmentObject = ClosedEnum<typeof SubscriptionAdjustm
9
9
  export declare const SubscriptionAdjustmentType: {
10
10
  readonly PercentageDiscount: "percentageDiscount";
11
11
  readonly UsageDiscount: "usageDiscount";
12
+ readonly MinimumQuantity: "minimumQuantity";
13
+ readonly MaximumQuantity: "maximumQuantity";
12
14
  };
13
15
  export type SubscriptionAdjustmentType = ClosedEnum<typeof SubscriptionAdjustmentType>;
14
16
  export type SubscriptionAdjustment = {
@@ -23,27 +25,35 @@ export type SubscriptionAdjustment = {
23
25
  subscriptionId: string;
24
26
  type: SubscriptionAdjustmentType;
25
27
  /**
26
- * The discount rate as a decimal fraction between 0 and 1. "0.35" means 35 percent. Null on a usageDiscount, which carries a unit count instead.
28
+ * The discount rate as a decimal fraction between 0 and 1. "0.35" means 35 percent. Null on every other type.
27
29
  */
28
30
  percentageDiscount: string | null;
29
31
  /**
30
- * The number of usage units taken off the targeted line's billable quantity. Null on a percentageDiscount, which carries a rate instead.
32
+ * The number of usage units taken off the targeted line's billable quantity. Null on every other type.
31
33
  */
32
34
  usageDiscount: string | null;
33
35
  /**
34
- * The prices this adjustment reduces. Exactly one metered price on a usageDiscount; empty on a percentageDiscount, which reduces every discountable charge.
36
+ * The contracted minimum quantity billed for one period of the targeted price. Null on every other type.
37
+ */
38
+ minimumQuantity: string | null;
39
+ /**
40
+ * The contracted maximum quantity billed for one period of the targeted price. Null on every other type.
41
+ */
42
+ maximumQuantity: string | null;
43
+ /**
44
+ * 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.
35
45
  */
36
46
  targetPriceIds: Array<string>;
37
47
  /**
38
- * Opens the window. Read per type: INCLUSIVE on a percentageDiscount, whose window is prorated by day overlap; EXCLUSIVE on a usageDiscount, which corrects a line whose period END falls strictly after this instant.
48
+ * 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.
39
49
  */
40
50
  effectiveFrom: Date;
41
51
  /**
42
- * Closes the window, or null for never. Read per type: EXCLUSIVE on a percentageDiscount; INCLUSIVE on a usageDiscount, which corrects a line whose period END falls on or before this instant.
52
+ * 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.
43
53
  */
44
54
  effectiveTo: Date | null;
45
55
  /**
46
- * The deal's own name. Shown on each discount line a percentageDiscount emits; a usageDiscount emits no line, so its description is carried here only.
56
+ * 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.
47
57
  */
48
58
  description: string | null;
49
59
  createdAt: Date;
@@ -1 +1 @@
1
- {"version":3,"file":"subscriptionadjustment.d.ts","sourceRoot":"","sources":["../../../src/models/subscriptionadjustment.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,CAAC,MAAM,QAAQ,CAAC;AAE5B,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,EAAE,MAAM,IAAI,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAC3D,OAAO,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AAEpE,eAAO,MAAM,4BAA4B;;CAE/B,CAAC;AACX,MAAM,MAAM,4BAA4B,GAAG,UAAU,CACnD,OAAO,4BAA4B,CACpC,CAAC;AAEF,eAAO,MAAM,0BAA0B;;;CAG7B,CAAC;AACX,MAAM,MAAM,0BAA0B,GAAG,UAAU,CACjD,OAAO,0BAA0B,CAClC,CAAC;AAEF,MAAM,MAAM,sBAAsB,GAAG;IACnC,MAAM,EAAE,4BAA4B,CAAC;IACrC;;OAEG;IACH,EAAE,EAAE,MAAM,CAAC;IACX;;OAEG;IACH,cAAc,EAAE,MAAM,CAAC;IACvB,IAAI,EAAE,0BAA0B,CAAC;IACjC;;OAEG;IACH,kBAAkB,EAAE,MAAM,GAAG,IAAI,CAAC;IAClC;;OAEG;IACH,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B;;OAEG;IACH,cAAc,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;IAC9B;;OAEG;IACH,aAAa,EAAE,IAAI,CAAC;IACpB;;OAEG;IACH,WAAW,EAAE,IAAI,GAAG,IAAI,CAAC;IACzB;;OAEG;IACH,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,SAAS,EAAE,IAAI,CAAC;CACjB,CAAC;AAEF,gBAAgB;AAChB,eAAO,MAAM,0CAA0C,EAAE,CAAC,CAAC,aAAa,CACtE,OAAO,4BAA4B,CACS,CAAC;AAE/C,gBAAgB;AAChB,eAAO,MAAM,wCAAwC,EAAE,CAAC,CAAC,aAAa,CACpE,OAAO,0BAA0B,CACS,CAAC;AAE7C,gBAAgB;AAChB,eAAO,MAAM,oCAAoC,EAAE,CAAC,CAAC,OAAO,CAC1D,sBAAsB,EACtB,CAAC,CAAC,UAAU,EACZ,OAAO,CAiBP,CAAC;AAEH,wBAAgB,8BAA8B,CAC5C,UAAU,EAAE,MAAM,GACjB,eAAe,CAAC,sBAAsB,EAAE,kBAAkB,CAAC,CAM7D"}
1
+ {"version":3,"file":"subscriptionadjustment.d.ts","sourceRoot":"","sources":["../../../src/models/subscriptionadjustment.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,CAAC,MAAM,QAAQ,CAAC;AAE5B,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,EAAE,MAAM,IAAI,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAC3D,OAAO,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AAEpE,eAAO,MAAM,4BAA4B;;CAE/B,CAAC;AACX,MAAM,MAAM,4BAA4B,GAAG,UAAU,CACnD,OAAO,4BAA4B,CACpC,CAAC;AAEF,eAAO,MAAM,0BAA0B;;;;;CAK7B,CAAC;AACX,MAAM,MAAM,0BAA0B,GAAG,UAAU,CACjD,OAAO,0BAA0B,CAClC,CAAC;AAEF,MAAM,MAAM,sBAAsB,GAAG;IACnC,MAAM,EAAE,4BAA4B,CAAC;IACrC;;OAEG;IACH,EAAE,EAAE,MAAM,CAAC;IACX;;OAEG;IACH,cAAc,EAAE,MAAM,CAAC;IACvB,IAAI,EAAE,0BAA0B,CAAC;IACjC;;OAEG;IACH,kBAAkB,EAAE,MAAM,GAAG,IAAI,CAAC;IAClC;;OAEG;IACH,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B;;OAEG;IACH,eAAe,EAAE,MAAM,GAAG,IAAI,CAAC;IAC/B;;OAEG;IACH,eAAe,EAAE,MAAM,GAAG,IAAI,CAAC;IAC/B;;OAEG;IACH,cAAc,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;IAC9B;;OAEG;IACH,aAAa,EAAE,IAAI,CAAC;IACpB;;OAEG;IACH,WAAW,EAAE,IAAI,GAAG,IAAI,CAAC;IACzB;;OAEG;IACH,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,SAAS,EAAE,IAAI,CAAC;CACjB,CAAC;AAEF,gBAAgB;AAChB,eAAO,MAAM,0CAA0C,EAAE,CAAC,CAAC,aAAa,CACtE,OAAO,4BAA4B,CACS,CAAC;AAE/C,gBAAgB;AAChB,eAAO,MAAM,wCAAwC,EAAE,CAAC,CAAC,aAAa,CACpE,OAAO,0BAA0B,CACS,CAAC;AAE7C,gBAAgB;AAChB,eAAO,MAAM,oCAAoC,EAAE,CAAC,CAAC,OAAO,CAC1D,sBAAsB,EACtB,CAAC,CAAC,UAAU,EACZ,OAAO,CAmBP,CAAC;AAEH,wBAAgB,8BAA8B,CAC5C,UAAU,EAAE,MAAM,GACjB,eAAe,CAAC,sBAAsB,EAAE,kBAAkB,CAAC,CAM7D"}
@@ -9,6 +9,8 @@ export const SubscriptionAdjustmentObject = {
9
9
  export const SubscriptionAdjustmentType = {
10
10
  PercentageDiscount: "percentageDiscount",
11
11
  UsageDiscount: "usageDiscount",
12
+ MinimumQuantity: "minimumQuantity",
13
+ MaximumQuantity: "maximumQuantity",
12
14
  };
13
15
  /** @internal */
14
16
  export const SubscriptionAdjustmentObject$inboundSchema = z.nativeEnum(SubscriptionAdjustmentObject);
@@ -22,6 +24,8 @@ export const SubscriptionAdjustment$inboundSchema = z.object({
22
24
  type: SubscriptionAdjustmentType$inboundSchema,
23
25
  percentageDiscount: z.nullable(z.string()),
24
26
  usageDiscount: z.nullable(z.string()),
27
+ minimumQuantity: z.nullable(z.string()),
28
+ maximumQuantity: z.nullable(z.string()),
25
29
  targetPriceIds: z.array(z.string()),
26
30
  effectiveFrom: z.string().datetime({ offset: true }).transform(v => new Date(v)),
27
31
  effectiveTo: z.nullable(z.string().datetime({ offset: true }).transform(v => new Date(v))),
@@ -1 +1 @@
1
- {"version":3,"file":"subscriptionadjustment.js","sourceRoot":"","sources":["../../../src/models/subscriptionadjustment.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,CAAC,MAAM,QAAQ,CAAC;AAC5B,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAK9C,MAAM,CAAC,MAAM,4BAA4B,GAAG;IAC1C,sBAAsB,EAAE,wBAAwB;CACxC,CAAC;AAKX,MAAM,CAAC,MAAM,0BAA0B,GAAG;IACxC,kBAAkB,EAAE,oBAAoB;IACxC,aAAa,EAAE,eAAe;CACtB,CAAC;AA2CX,gBAAgB;AAChB,MAAM,CAAC,MAAM,0CAA0C,GAEnD,CAAC,CAAC,UAAU,CAAC,4BAA4B,CAAC,CAAC;AAE/C,gBAAgB;AAChB,MAAM,CAAC,MAAM,wCAAwC,GAEjD,CAAC,CAAC,UAAU,CAAC,0BAA0B,CAAC,CAAC;AAE7C,gBAAgB;AAChB,MAAM,CAAC,MAAM,oCAAoC,GAI7C,CAAC,CAAC,MAAM,CAAC;IACX,MAAM,EAAE,0CAA0C;IAClD,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE;IACd,cAAc,EAAE,CAAC,CAAC,MAAM,EAAE;IAC1B,IAAI,EAAE,wCAAwC;IAC9C,kBAAkB,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC;IAC1C,aAAa,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC;IACrC,cAAc,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC;IACnC,aAAa,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,EAAE,MAAM,EAAE,I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AS,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,IAAI,IAAI,CAAC,CAAC,CAAC,CAAC;CAC7E,CAAC,CAAC;AAEH,MAAM,UAAU,8BAA8B,CAC5C,UAAkB;IAElB,OAAO,SAAS,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"}
@@ -60,8 +60,8 @@ export declare class Subscriptions extends ClientSDK {
60
60
  * Delete Adjustment
61
61
  *
62
62
  * @remarks
63
- * Deletes an adjustment that has not yet reached an issued invoice. No invoice changes: an invoice still in draft keeps its numbers, and loses the discount only when its period is calculated again. An adjustment that has already discounted an issued invoice cannot be deleted, because the invoice records why the customer was charged that amount. Its window cannot be shortened afterwards either, so set effectiveTo at creation time whenever the deal has a known end date.
63
+ * 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.
64
64
  */
65
- deleteSubscriptionAdjustment(request: operations.DeleteSubscriptionAdjustmentRequest, options?: RequestOptions): Promise<void>;
65
+ deleteSubscriptionAdjustment(request: operations.DeleteSubscriptionAdjustmentRequest, options?: RequestOptions): Promise<models.SubscriptionAdjustment | undefined>;
66
66
  }
67
67
  //# sourceMappingURL=subscriptions.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"subscriptions.d.ts","sourceRoot":"","sources":["../../../src/sdk/subscriptions.ts"],"names":[],"mappings":"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IAQ/B;;;;;OAKG;IACG,kBAAkB,CACtB,OAAO,EAAE,UAAU,CAAC,yBAAyB,EAC7C,OAAO,CAAC,EAAE,cAAc,GACvB,OAAO,CAAC,MAAM,CAAC,kBAAkB,CAAC;IAQrC;;;;;OAKG;IACG,SAAS,CACb,OAAO,EAAE,UAAU,CAAC,4BAA4B,EAChD,OAAO,CAAC,EAAE,cAAc,GACvB,OAAO,CAAC,MAAM,CAAC,YAAY,CAAC;IAQ/B;;;;;OAKG;IACG,6BAA6B,CACjC,OAAO,EAAE,UAAU,CAAC,oCAAoC,EACxD,OAAO,CAAC,EAAE,cAAc,GACvB,OAAO,CAAC,MAAM,CAAC,0BAA0B,CAAC;IAQ7C;;;;;OAKG;IACG,2BAA2B,CAC/B,OAAO,EAAE,UAAU,CAAC,kCAAkC,EACtD,OAAO,CAAC,EAAE,cAAc,GACvB,OAAO,CAAC,MAAM,CAAC,+BAA+B,CAAC;IAQlD;;;;;OAKG;IACG,4BAA4B,CAChC,OAAO,EAAE,UAAU,CAAC,mCAAmC,EACvD,OAAO,CAAC,EAAE,cAAc,GACvB,OAAO,CAAC,MAAM,CAAC,sBAAsB,CAAC;IAQzC;;;;;OAKG;IACG,4BAA4B,CAChC,OAAO,EAAE,UAAU,CAAC,mCAAmC,EACvD,OAAO,CAAC,EAAE,cAAc,GACvB,OAAO,CAAC,MAAM,CAAC,sBAAsB,GAAG,SAAS,CAAC;CAOtD"}
@@ -90,7 +90,7 @@ export class Subscriptions extends ClientSDK {
90
90
  * Delete Adjustment
91
91
  *
92
92
  * @remarks
93
- * Deletes an adjustment that has not yet reached an issued invoice. No invoice changes: an invoice still in draft keeps its numbers, and loses the discount only when its period is calculated again. An adjustment that has already discounted an issued invoice cannot be deleted, because the invoice records why the customer was charged that amount. Its window cannot be shortened afterwards either, so set effectiveTo at creation time whenever the deal has a known end date.
93
+ * 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.
94
94
  */
95
95
  async deleteSubscriptionAdjustment(request, options) {
96
96
  return unwrapAsync(subscriptionsDeleteSubscriptionAdjustment(this, request, options));
package/jsr.json CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  {
4
4
  "name": "@paygentic/sdk",
5
- "version": "0.9.10",
5
+ "version": "0.9.12",
6
6
  "exports": {
7
7
  ".": "./src/index.ts",
8
8
  "./models/errors": "./src/models/errors/index.ts",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@paygentic/sdk",
3
- "version": "0.9.10",
3
+ "version": "0.9.12",
4
4
  "author": "Speakeasy",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -2,7 +2,6 @@
2
2
  * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
3
  */
4
4
 
5
- import * as z from "zod/v3";
6
5
  import { PaygenticCore } from "../core.js";
7
6
  import { encodeSimple } from "../lib/encodings.js";
8
7
  import * as M from "../lib/matchers.js";
@@ -22,6 +21,7 @@ import * as errors from "../models/errors/index.js";
22
21
  import { PaygenticError } from "../models/errors/paygenticerror.js";
23
22
  import { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
24
23
  import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
24
+ import * as models from "../models/index.js";
25
25
  import * as operations from "../models/operations/index.js";
26
26
  import { APICall, APIPromise } from "../types/async.js";
27
27
  import { Result } from "../types/fp.js";
@@ -30,7 +30,7 @@ import { Result } from "../types/fp.js";
30
30
  * Delete Adjustment
31
31
  *
32
32
  * @remarks
33
- * Deletes an adjustment that has not yet reached an issued invoice. No invoice changes: an invoice still in draft keeps its numbers, and loses the discount only when its period is calculated again. An adjustment that has already discounted an issued invoice cannot be deleted, because the invoice records why the customer was charged that amount. Its window cannot be shortened afterwards either, so set effectiveTo at creation time whenever the deal has a known end date.
33
+ * 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.
34
34
  */
35
35
  export function subscriptionsDeleteSubscriptionAdjustment(
36
36
  client: PaygenticCore,
@@ -38,7 +38,7 @@ export function subscriptionsDeleteSubscriptionAdjustment(
38
38
  options?: RequestOptions,
39
39
  ): APIPromise<
40
40
  Result<
41
- void,
41
+ models.SubscriptionAdjustment | undefined,
42
42
  | errors.ErrorT
43
43
  | PaygenticError
44
44
  | ResponseValidationError
@@ -64,7 +64,7 @@ async function $do(
64
64
  ): Promise<
65
65
  [
66
66
  Result<
67
- void,
67
+ models.SubscriptionAdjustment | undefined,
68
68
  | errors.ErrorT
69
69
  | PaygenticError
70
70
  | ResponseValidationError
@@ -160,7 +160,7 @@ async function $do(
160
160
  };
161
161
 
162
162
  const [result] = await M.match<
163
- void,
163
+ models.SubscriptionAdjustment | undefined,
164
164
  | errors.ErrorT
165
165
  | PaygenticError
166
166
  | ResponseValidationError
@@ -171,7 +171,8 @@ async function $do(
171
171
  | UnexpectedClientError
172
172
  | SDKValidationError
173
173
  >(
174
- M.nil(204, z.void()),
174
+ M.json(200, models.SubscriptionAdjustment$inboundSchema.optional()),
175
+ M.nil(204, models.SubscriptionAdjustment$inboundSchema.optional()),
175
176
  M.jsonErr([401, 403, 404, 409], errors.ErrorT$inboundSchema),
176
177
  M.jsonErr(500, errors.ErrorT$inboundSchema),
177
178
  M.fail("4XX"),
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.10",
68
+ sdkVersion: "0.9.12",
69
69
  genVersion: "2.879.13",
70
- userAgent: "speakeasy-sdk/typescript 0.9.10 2.879.13 0.1.0 @paygentic/sdk",
70
+ userAgent: "speakeasy-sdk/typescript 0.9.12 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(
@@ -0,0 +1,72 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import * as z from "zod/v3";
6
+
7
+ export type CreateMaximumQuantityAdjustment = {
8
+ /**
9
+ * Bills at most the contracted quantity on one price, whatever the customer actually used.
10
+ */
11
+ type: "maximumQuantity";
12
+ /**
13
+ * The contracted maximum quantity for one billing period of the target price, sent as a plain decimal string. Not negative, at most 6 decimal places, fewer than 35 digits before the point. Plain notation only — no sign, exponent, hex or digit separators, so "1_000" and "1e3" are rejected rather than read as 1000. "4" bills 4 seats in a period the customer used 9 in; a value of 0 bills nothing at all. Measured over the whole billing period, not per line: where a period is split into several lines, each line's quantity counts for its share of the period, and every line is scaled by the same factor to bring the period to the maximum. Several bounds of the same direction on one price do not add up — the greatest minimum and the least maximum are the ones that apply.
14
+ */
15
+ maximumQuantity: string;
16
+ /**
17
+ * Exactly one price of this subscription. A metered price is accepted, and so is a price whose supply is outside the scope of VAT: a bound constrains a measurement rather than an amount of consideration. A price that bills once rather than per period is refused, because there is no repeating period for the bound to be measured over.
18
+ */
19
+ targetPriceIds: Array<string>;
20
+ /**
21
+ * Opens the window. Exclusive for this type: a line is bounded when its period END falls after this instant, so a window opening exactly when a period ends belongs to the next period, not that one. The bound is never prorated — a window opening mid-period applies to that whole period.
22
+ */
23
+ effectiveFrom: Date;
24
+ /**
25
+ * Closes the window. INCLUSIVE for this type, like usageDiscount and unlike percentageDiscount: set this to the exact period end you are bounding and that period is covered. Null means the bound never stops. Must be after effectiveFrom.
26
+ */
27
+ effectiveTo?: Date | null | undefined;
28
+ /**
29
+ * Your own name for this term. A quantity bound emits no invoice line, so this is printed nowhere on the invoice — it is returned on the adjustment for your own records.
30
+ */
31
+ description?: string | null | undefined;
32
+ /**
33
+ * A key of your choosing that makes a retry safe. Sending the same key against the same subscription returns the adjustment already created and creates no second one. Without a key a retried request creates a second bound; two identical bounds change nothing, because bounds of one direction do not add up.
34
+ */
35
+ idempotencyKey?: string | undefined;
36
+ };
37
+
38
+ /** @internal */
39
+ export type CreateMaximumQuantityAdjustment$Outbound = {
40
+ type: "maximumQuantity";
41
+ maximumQuantity: string;
42
+ targetPriceIds: Array<string>;
43
+ effectiveFrom: string;
44
+ effectiveTo?: string | null | undefined;
45
+ description?: string | null | undefined;
46
+ idempotencyKey?: string | undefined;
47
+ };
48
+
49
+ /** @internal */
50
+ export const CreateMaximumQuantityAdjustment$outboundSchema: z.ZodType<
51
+ CreateMaximumQuantityAdjustment$Outbound,
52
+ z.ZodTypeDef,
53
+ CreateMaximumQuantityAdjustment
54
+ > = z.object({
55
+ type: z.literal("maximumQuantity"),
56
+ maximumQuantity: z.string(),
57
+ targetPriceIds: z.array(z.string()),
58
+ effectiveFrom: z.date().transform(v => v.toISOString()),
59
+ effectiveTo: z.nullable(z.date().transform(v => v.toISOString())).optional(),
60
+ description: z.nullable(z.string()).optional(),
61
+ idempotencyKey: z.string().optional(),
62
+ });
63
+
64
+ export function createMaximumQuantityAdjustmentToJSON(
65
+ createMaximumQuantityAdjustment: CreateMaximumQuantityAdjustment,
66
+ ): string {
67
+ return JSON.stringify(
68
+ CreateMaximumQuantityAdjustment$outboundSchema.parse(
69
+ createMaximumQuantityAdjustment,
70
+ ),
71
+ );
72
+ }
@@ -0,0 +1,72 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import * as z from "zod/v3";
6
+
7
+ export type CreateMinimumQuantityAdjustment = {
8
+ /**
9
+ * Bills at least the contracted quantity on one price, whatever the customer actually used.
10
+ */
11
+ type: "minimumQuantity";
12
+ /**
13
+ * The contracted minimum quantity for one billing period of the target price, sent as a plain decimal string. Not negative, at most 6 decimal places, fewer than 35 digits before the point. Plain notation only — no sign, exponent, hex or digit separators, so "1_000" and "1e3" are rejected rather than read as 1000. "4" bills 4 seats in a period the customer used 2 in; a value of 0 binds nothing. Measured over the whole billing period, not per line: where a period is split into several lines, each line's quantity counts for its share of the period, and every line is scaled by the same factor to bring the period to the minimum. Several bounds of the same direction on one price do not add up — the greatest minimum and the least maximum are the ones that apply.
14
+ */
15
+ minimumQuantity: string;
16
+ /**
17
+ * Exactly one price of this subscription. A metered price is accepted, and so is a price whose supply is outside the scope of VAT: a bound constrains a measurement rather than an amount of consideration. A price that bills once rather than per period is refused, because there is no repeating period for the bound to be measured over.
18
+ */
19
+ targetPriceIds: Array<string>;
20
+ /**
21
+ * Opens the window. Exclusive for this type: a line is bounded when its period END falls after this instant, so a window opening exactly when a period ends belongs to the next period, not that one. The bound is never prorated — a window opening mid-period applies to that whole period.
22
+ */
23
+ effectiveFrom: Date;
24
+ /**
25
+ * Closes the window. INCLUSIVE for this type, like usageDiscount and unlike percentageDiscount: set this to the exact period end you are bounding and that period is covered. Null means the bound never stops. Must be after effectiveFrom.
26
+ */
27
+ effectiveTo?: Date | null | undefined;
28
+ /**
29
+ * Your own name for this term. A quantity bound emits no invoice line, so this is printed nowhere on the invoice — it is returned on the adjustment for your own records.
30
+ */
31
+ description?: string | null | undefined;
32
+ /**
33
+ * A key of your choosing that makes a retry safe. Sending the same key against the same subscription returns the adjustment already created and creates no second one. Without a key a retried request creates a second bound; two identical bounds change nothing, because bounds of one direction do not add up.
34
+ */
35
+ idempotencyKey?: string | undefined;
36
+ };
37
+
38
+ /** @internal */
39
+ export type CreateMinimumQuantityAdjustment$Outbound = {
40
+ type: "minimumQuantity";
41
+ minimumQuantity: string;
42
+ targetPriceIds: Array<string>;
43
+ effectiveFrom: string;
44
+ effectiveTo?: string | null | undefined;
45
+ description?: string | null | undefined;
46
+ idempotencyKey?: string | undefined;
47
+ };
48
+
49
+ /** @internal */
50
+ export const CreateMinimumQuantityAdjustment$outboundSchema: z.ZodType<
51
+ CreateMinimumQuantityAdjustment$Outbound,
52
+ z.ZodTypeDef,
53
+ CreateMinimumQuantityAdjustment
54
+ > = z.object({
55
+ type: z.literal("minimumQuantity"),
56
+ minimumQuantity: z.string(),
57
+ targetPriceIds: z.array(z.string()),
58
+ effectiveFrom: z.date().transform(v => v.toISOString()),
59
+ effectiveTo: z.nullable(z.date().transform(v => v.toISOString())).optional(),
60
+ description: z.nullable(z.string()).optional(),
61
+ idempotencyKey: z.string().optional(),
62
+ });
63
+
64
+ export function createMinimumQuantityAdjustmentToJSON(
65
+ createMinimumQuantityAdjustment: CreateMinimumQuantityAdjustment,
66
+ ): string {
67
+ return JSON.stringify(
68
+ CreateMinimumQuantityAdjustment$outboundSchema.parse(
69
+ createMinimumQuantityAdjustment,
70
+ ),
71
+ );
72
+ }
@@ -3,6 +3,16 @@
3
3
  */
4
4
 
5
5
  import * as z from "zod/v3";
6
+ import {
7
+ CreateMaximumQuantityAdjustment,
8
+ CreateMaximumQuantityAdjustment$Outbound,
9
+ CreateMaximumQuantityAdjustment$outboundSchema,
10
+ } from "./createmaximumquantityadjustment.js";
11
+ import {
12
+ CreateMinimumQuantityAdjustment,
13
+ CreateMinimumQuantityAdjustment$Outbound,
14
+ CreateMinimumQuantityAdjustment$outboundSchema,
15
+ } from "./createminimumquantityadjustment.js";
6
16
  import {
7
17
  CreatePercentageDiscountAdjustment,
8
18
  CreatePercentageDiscountAdjustment$Outbound,
@@ -15,16 +25,20 @@ import {
15
25
  } from "./createusagediscountadjustment.js";
16
26
 
17
27
  /**
18
- * One adjustment to attach to the subscription. The type decides which number the body carries: a rate for percentageDiscount, a unit count and one target price for usageDiscount.
28
+ * One adjustment to attach to the subscription. The type decides which number the body carries: a rate for percentageDiscount, a unit count and one target price for usageDiscount, and a contracted quantity and one target price for minimumQuantity and maximumQuantity.
19
29
  */
20
30
  export type CreateSubscriptionAdjustmentRequest =
21
31
  | CreatePercentageDiscountAdjustment
22
- | CreateUsageDiscountAdjustment;
32
+ | CreateUsageDiscountAdjustment
33
+ | CreateMinimumQuantityAdjustment
34
+ | CreateMaximumQuantityAdjustment;
23
35
 
24
36
  /** @internal */
25
37
  export type CreateSubscriptionAdjustmentRequest$Outbound =
26
38
  | CreatePercentageDiscountAdjustment$Outbound
27
- | CreateUsageDiscountAdjustment$Outbound;
39
+ | CreateUsageDiscountAdjustment$Outbound
40
+ | CreateMinimumQuantityAdjustment$Outbound
41
+ | CreateMaximumQuantityAdjustment$Outbound;
28
42
 
29
43
  /** @internal */
30
44
  export const CreateSubscriptionAdjustmentRequest$outboundSchema: z.ZodType<
@@ -34,6 +48,8 @@ export const CreateSubscriptionAdjustmentRequest$outboundSchema: z.ZodType<
34
48
  > = z.union([
35
49
  CreatePercentageDiscountAdjustment$outboundSchema,
36
50
  CreateUsageDiscountAdjustment$outboundSchema,
51
+ CreateMinimumQuantityAdjustment$outboundSchema,
52
+ CreateMaximumQuantityAdjustment$outboundSchema,
37
53
  ]);
38
54
 
39
55
  export function createSubscriptionAdjustmentRequestToJSON(
@@ -25,7 +25,7 @@ export type CurrencyBreakdownEntry = {
25
25
  */
26
26
  currency: string;
27
27
  /**
28
- * Net collected revenue in dollars for this currency (issued invoices + completed payments)
28
+ * Revenue in dollars for this currency, excluding tax: invoices issued in the period plus completed payments
29
29
  */
30
30
  netRevenue: string;
31
31
  invoices: InvoiceSummary;
@@ -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
  };
@@ -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";