@paygentic/sdk 0.9.7 → 0.9.8

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 (144) hide show
  1. package/dist/commonjs/funcs/customersList.js +2 -2
  2. package/dist/commonjs/funcs/customersList.js.map +1 -1
  3. package/dist/commonjs/funcs/subscriptionsCreateSubscriptionAdjustment.d.ts +1 -1
  4. package/dist/commonjs/funcs/subscriptionsCreateSubscriptionAdjustment.js +1 -1
  5. package/dist/commonjs/funcs/subscriptionsReconcileSubscriptionFeatures.js +2 -2
  6. package/dist/commonjs/funcs/subscriptionsReconcileSubscriptionFeatures.js.map +1 -1
  7. package/dist/commonjs/lib/config.d.ts +2 -2
  8. package/dist/commonjs/lib/config.js +2 -2
  9. package/dist/commonjs/models/createpercentagediscountadjustment.d.ts +40 -0
  10. package/dist/commonjs/models/createpercentagediscountadjustment.d.ts.map +1 -0
  11. package/dist/commonjs/models/createpercentagediscountadjustment.js +54 -0
  12. package/dist/commonjs/models/createpercentagediscountadjustment.js.map +1 -0
  13. package/dist/commonjs/models/createsubscriptionadjustmentrequest.d.ts +5 -45
  14. package/dist/commonjs/models/createsubscriptionadjustmentrequest.d.ts.map +1 -1
  15. package/dist/commonjs/models/createsubscriptionadjustmentrequest.js +7 -18
  16. package/dist/commonjs/models/createsubscriptionadjustmentrequest.js.map +1 -1
  17. package/dist/commonjs/models/createusagediscountadjustment.d.ts +45 -0
  18. package/dist/commonjs/models/createusagediscountadjustment.d.ts.map +1 -0
  19. package/dist/commonjs/models/createusagediscountadjustment.js +55 -0
  20. package/dist/commonjs/models/createusagediscountadjustment.js.map +1 -0
  21. package/dist/commonjs/models/index.d.ts +4 -0
  22. package/dist/commonjs/models/index.d.ts.map +1 -1
  23. package/dist/commonjs/models/index.js +4 -0
  24. package/dist/commonjs/models/index.js.map +1 -1
  25. package/dist/commonjs/models/lineitem.d.ts +4 -0
  26. package/dist/commonjs/models/lineitem.d.ts.map +1 -1
  27. package/dist/commonjs/models/lineitem.js +1 -0
  28. package/dist/commonjs/models/lineitem.js.map +1 -1
  29. package/dist/commonjs/models/operations/createprice.d.ts +15 -0
  30. package/dist/commonjs/models/operations/createprice.d.ts.map +1 -1
  31. package/dist/commonjs/models/operations/createprice.js +3 -0
  32. package/dist/commonjs/models/operations/createprice.js.map +1 -1
  33. package/dist/commonjs/models/operations/updateprice.d.ts +15 -0
  34. package/dist/commonjs/models/operations/updateprice.d.ts.map +1 -1
  35. package/dist/commonjs/models/operations/updateprice.js +3 -0
  36. package/dist/commonjs/models/operations/updateprice.js.map +1 -1
  37. package/dist/commonjs/models/planversionpriceslot.d.ts +22 -0
  38. package/dist/commonjs/models/planversionpriceslot.d.ts.map +1 -1
  39. package/dist/commonjs/models/planversionpriceslot.js +13 -1
  40. package/dist/commonjs/models/planversionpriceslot.js.map +1 -1
  41. package/dist/commonjs/models/price.d.ts +22 -0
  42. package/dist/commonjs/models/price.d.ts.map +1 -1
  43. package/dist/commonjs/models/price.js +13 -1
  44. package/dist/commonjs/models/price.js.map +1 -1
  45. package/dist/commonjs/models/pricetax.d.ts +58 -0
  46. package/dist/commonjs/models/pricetax.d.ts.map +1 -0
  47. package/dist/commonjs/models/pricetax.js +82 -0
  48. package/dist/commonjs/models/pricetax.js.map +1 -0
  49. package/dist/commonjs/models/ratetype.d.ts +18 -0
  50. package/dist/commonjs/models/ratetype.d.ts.map +1 -0
  51. package/dist/commonjs/models/ratetype.js +53 -0
  52. package/dist/commonjs/models/ratetype.js.map +1 -0
  53. package/dist/commonjs/models/schemasprice.d.ts +14 -0
  54. package/dist/commonjs/models/schemasprice.d.ts.map +1 -1
  55. package/dist/commonjs/models/schemasprice.js +5 -0
  56. package/dist/commonjs/models/schemasprice.js.map +1 -1
  57. package/dist/commonjs/models/subscriptionadjustment.d.ts +14 -5
  58. package/dist/commonjs/models/subscriptionadjustment.d.ts.map +1 -1
  59. package/dist/commonjs/models/subscriptionadjustment.js +4 -1
  60. package/dist/commonjs/models/subscriptionadjustment.js.map +1 -1
  61. package/dist/commonjs/sdk/subscriptions.d.ts +1 -1
  62. package/dist/commonjs/sdk/subscriptions.js +1 -1
  63. package/dist/esm/funcs/customersList.js +2 -2
  64. package/dist/esm/funcs/customersList.js.map +1 -1
  65. package/dist/esm/funcs/subscriptionsCreateSubscriptionAdjustment.d.ts +1 -1
  66. package/dist/esm/funcs/subscriptionsCreateSubscriptionAdjustment.js +1 -1
  67. package/dist/esm/funcs/subscriptionsReconcileSubscriptionFeatures.js +2 -2
  68. package/dist/esm/funcs/subscriptionsReconcileSubscriptionFeatures.js.map +1 -1
  69. package/dist/esm/lib/config.d.ts +2 -2
  70. package/dist/esm/lib/config.js +2 -2
  71. package/dist/esm/models/createpercentagediscountadjustment.d.ts +40 -0
  72. package/dist/esm/models/createpercentagediscountadjustment.d.ts.map +1 -0
  73. package/dist/esm/models/createpercentagediscountadjustment.js +17 -0
  74. package/dist/esm/models/createpercentagediscountadjustment.js.map +1 -0
  75. package/dist/esm/models/createsubscriptionadjustmentrequest.d.ts +5 -45
  76. package/dist/esm/models/createsubscriptionadjustmentrequest.d.ts.map +1 -1
  77. package/dist/esm/models/createsubscriptionadjustmentrequest.js +6 -17
  78. package/dist/esm/models/createsubscriptionadjustmentrequest.js.map +1 -1
  79. package/dist/esm/models/createusagediscountadjustment.d.ts +45 -0
  80. package/dist/esm/models/createusagediscountadjustment.d.ts.map +1 -0
  81. package/dist/esm/models/createusagediscountadjustment.js +18 -0
  82. package/dist/esm/models/createusagediscountadjustment.js.map +1 -0
  83. package/dist/esm/models/index.d.ts +4 -0
  84. package/dist/esm/models/index.d.ts.map +1 -1
  85. package/dist/esm/models/index.js +4 -0
  86. package/dist/esm/models/index.js.map +1 -1
  87. package/dist/esm/models/lineitem.d.ts +4 -0
  88. package/dist/esm/models/lineitem.d.ts.map +1 -1
  89. package/dist/esm/models/lineitem.js +1 -0
  90. package/dist/esm/models/lineitem.js.map +1 -1
  91. package/dist/esm/models/operations/createprice.d.ts +15 -0
  92. package/dist/esm/models/operations/createprice.d.ts.map +1 -1
  93. package/dist/esm/models/operations/createprice.js +3 -0
  94. package/dist/esm/models/operations/createprice.js.map +1 -1
  95. package/dist/esm/models/operations/updateprice.d.ts +15 -0
  96. package/dist/esm/models/operations/updateprice.d.ts.map +1 -1
  97. package/dist/esm/models/operations/updateprice.js +3 -0
  98. package/dist/esm/models/operations/updateprice.js.map +1 -1
  99. package/dist/esm/models/planversionpriceslot.d.ts +22 -0
  100. package/dist/esm/models/planversionpriceslot.d.ts.map +1 -1
  101. package/dist/esm/models/planversionpriceslot.js +12 -0
  102. package/dist/esm/models/planversionpriceslot.js.map +1 -1
  103. package/dist/esm/models/price.d.ts +22 -0
  104. package/dist/esm/models/price.d.ts.map +1 -1
  105. package/dist/esm/models/price.js +12 -0
  106. package/dist/esm/models/price.js.map +1 -1
  107. package/dist/esm/models/pricetax.d.ts +58 -0
  108. package/dist/esm/models/pricetax.d.ts.map +1 -0
  109. package/dist/esm/models/pricetax.js +44 -0
  110. package/dist/esm/models/pricetax.js.map +1 -0
  111. package/dist/esm/models/ratetype.d.ts +18 -0
  112. package/dist/esm/models/ratetype.d.ts.map +1 -0
  113. package/dist/esm/models/ratetype.js +17 -0
  114. package/dist/esm/models/ratetype.js.map +1 -0
  115. package/dist/esm/models/schemasprice.d.ts +14 -0
  116. package/dist/esm/models/schemasprice.d.ts.map +1 -1
  117. package/dist/esm/models/schemasprice.js +5 -0
  118. package/dist/esm/models/schemasprice.js.map +1 -1
  119. package/dist/esm/models/subscriptionadjustment.d.ts +14 -5
  120. package/dist/esm/models/subscriptionadjustment.d.ts.map +1 -1
  121. package/dist/esm/models/subscriptionadjustment.js +4 -1
  122. package/dist/esm/models/subscriptionadjustment.js.map +1 -1
  123. package/dist/esm/sdk/subscriptions.d.ts +1 -1
  124. package/dist/esm/sdk/subscriptions.js +1 -1
  125. package/jsr.json +1 -1
  126. package/package.json +1 -1
  127. package/src/funcs/customersList.ts +2 -2
  128. package/src/funcs/subscriptionsCreateSubscriptionAdjustment.ts +1 -1
  129. package/src/funcs/subscriptionsReconcileSubscriptionFeatures.ts +2 -2
  130. package/src/lib/config.ts +2 -2
  131. package/src/models/createpercentagediscountadjustment.ts +66 -0
  132. package/src/models/createsubscriptionadjustmentrequest.ts +21 -59
  133. package/src/models/createusagediscountadjustment.ts +72 -0
  134. package/src/models/index.ts +4 -0
  135. package/src/models/lineitem.ts +5 -0
  136. package/src/models/operations/createprice.ts +18 -0
  137. package/src/models/operations/updateprice.ts +18 -0
  138. package/src/models/planversionpriceslot.ts +30 -0
  139. package/src/models/price.ts +28 -0
  140. package/src/models/pricetax.ts +100 -0
  141. package/src/models/ratetype.ts +25 -0
  142. package/src/models/schemasprice.ts +17 -0
  143. package/src/models/subscriptionadjustment.ts +17 -6
  144. package/src/sdk/subscriptions.ts +1 -1
@@ -4,6 +4,7 @@
4
4
  import * as z from "zod/v3";
5
5
  import { safeParse } from "../lib/schemas.js";
6
6
  import { PriceFeature$inboundSchema } from "./pricefeature.js";
7
+ import { PriceTax$inboundSchema } from "./pricetax.js";
7
8
  export const PriceObject = {
8
9
  Price: "price",
9
10
  };
@@ -17,6 +18,13 @@ export const PricePaymentTerm = {
17
18
  InArrears: "in_arrears",
18
19
  InAdvance: "in_advance",
19
20
  };
21
+ /**
22
+ * What properties.unitPrice is denominated in. 'amount' (the default) is an amount of the invoice currency for each unit metered, so the quantity is the multiplier. 'proportion' is the reverse: a dimensionless share of a currency-denominated quantity, so '0.02' is 2% and the invoice prints '2.00%'. Presentation only. Requires a standard metered price in real currency.
23
+ */
24
+ export const PriceRateType = {
25
+ Amount: "amount",
26
+ Proportion: "proportion",
27
+ };
20
28
  /** @internal */
21
29
  export const PriceObject$inboundSchema = z
22
30
  .nativeEnum(PriceObject);
@@ -26,6 +34,8 @@ export const PriceModel1$inboundSchema = z
26
34
  /** @internal */
27
35
  export const PricePaymentTerm$inboundSchema = z.nativeEnum(PricePaymentTerm);
28
36
  /** @internal */
37
+ export const PriceRateType$inboundSchema = z.nativeEnum(PriceRateType);
38
+ /** @internal */
29
39
  export const Price$inboundSchema = z
30
40
  .object({
31
41
  id: z.string(),
@@ -46,6 +56,8 @@ export const Price$inboundSchema = z
46
56
  features: z.array(PriceFeature$inboundSchema).optional(),
47
57
  grantDiscountEnabled: z.boolean().default(false),
48
58
  isObligation: z.boolean().default(false),
59
+ rateType: PriceRateType$inboundSchema.default("amount"),
60
+ tax: PriceTax$inboundSchema,
49
61
  quantity: z.number().int().default(1),
50
62
  });
51
63
  export function priceFromJSON(jsonString) {
@@ -1 +1 @@
1
- {"version":3,"file":"price.js","sourceRoot":"","sources":["../../../src/models/price.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,CAAC,MAAM,QAAQ,CAAC;AAC5B,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAI9C,OAAO,EAAgB,0BAA0B,EAAE,MAAM,mBAAmB,CAAC;AAE7E,MAAM,CAAC,MAAM,WAAW,GAAG;IACzB,KAAK,EAAE,OAAO;CACN,CAAC;AAGX,MAAM,CAAC,MAAM,WAAW,GAAG;IACzB,QAAQ,EAAE,UAAU;IACpB,OAAO,EAAE,SAAS;IAClB,MAAM,EAAE,QAAQ;IAChB,UAAU,EAAE,YAAY;CAChB,CAAC;AAGX,MAAM,CAAC,MAAM,gBAAgB,GAAG;IAC9B,SAAS,EAAE,YAAY;IACvB,SAAS,EAAE,YAAY;CACf,CAAC;AAiDX,gBAAgB;AAChB,MAAM,CAAC,MAAM,yBAAyB,GAAwC,CAAC;KAC5E,UAAU,CAAC,WAAW,CAAC,CAAC;AAE3B,gBAAgB;AAChB,MAAM,CAAC,MAAM,yBAAyB,GAAwC,CAAC;KAC5E,UAAU,CAAC,WAAW,CAAC,CAAC;AAE3B,gBAAgB;AAChB,MAAM,CAAC,MAAM,8BAA8B,GAEvC,CAAC,CAAC,UAAU,CAAC,gBAAgB,CAAC,CAAC;AAEnC,gBAAgB;AAChB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,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IACjC,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,CAC7D,IAAI,IAAI,CAAC,CAAC,CAAC,CACZ;IACD,QAAQ,EAAE,CAAC,CAAC,KAAK,CAAC,0BAA0B,CAAC,CAAC,QAAQ,EAAE;IACxD,oBAAoB,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC;IAChD,YAAY,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC;IACxC,QAAQ,EAAE,2BAA2B,CAAC,OAAO,CAAC,QAAQ,CAAC;IACvD,GAAG,EAAE,sBAAsB;IAC3B,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,OAAO,CAAC,CAAC,CAAC;CACtC,CAAC,CAAC;AAEL,MAAM,UAAU,aAAa,CAC3B,UAAkB;IAElB,OAAO,SAAS,CACd,UAAU,EACV,CAAC,CAAC,EAAE,EAAE,CAAC,mBAAmB,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,EAC/C,mCAAmC,CACpC,CAAC;AACJ,CAAC"}
@@ -0,0 +1,58 @@
1
+ import * as z from "zod/v3";
2
+ import { ClosedEnum } from "../types/enums.js";
3
+ import { Result as SafeParseResult } from "../types/fp.js";
4
+ import { SDKValidationError } from "./errors/sdkvalidationerror.js";
5
+ /**
6
+ * Whether this price's money is consideration for a supply — the one tax fact only you can state, because it is settled when you agree the deal rather than derived from what was sold. `IN_SCOPE` (the default) is consideration: it enters the taxable amount, positive as a charge or negative as a reduction in the price of the supply it applies to. `OUTSIDE_SCOPE` money is not consideration for anything, so it does not change the taxable amount, carries no tax, does not appear on the tax document, and nets into the amount payable after tax. This means "not consideration for a supply" — it does NOT mean "a supply outside this jurisdiction": exports and place-of-supply answers are worked out from the addresses on the sale by the tax provider, and are never declared on a price. How a supply is then classified — standard, zero-rated, exempt — is the tax provider's determination and is not set here either. Omit the whole `tax` object to leave a price in scope; there is deliberately no schema default on this property, so that a misspelt key is refused rather than silently defaulted.
7
+ */
8
+ export declare const SupplyScope: {
9
+ readonly InScope: "IN_SCOPE";
10
+ readonly OutsideScope: "OUTSIDE_SCOPE";
11
+ };
12
+ /**
13
+ * Whether this price's money is consideration for a supply — the one tax fact only you can state, because it is settled when you agree the deal rather than derived from what was sold. `IN_SCOPE` (the default) is consideration: it enters the taxable amount, positive as a charge or negative as a reduction in the price of the supply it applies to. `OUTSIDE_SCOPE` money is not consideration for anything, so it does not change the taxable amount, carries no tax, does not appear on the tax document, and nets into the amount payable after tax. This means "not consideration for a supply" — it does NOT mean "a supply outside this jurisdiction": exports and place-of-supply answers are worked out from the addresses on the sale by the tax provider, and are never declared on a price. How a supply is then classified — standard, zero-rated, exempt — is the tax provider's determination and is not set here either. Omit the whole `tax` object to leave a price in scope; there is deliberately no schema default on this property, so that a misspelt key is refused rather than silently defaulted.
14
+ */
15
+ export type SupplyScope = ClosedEnum<typeof SupplyScope>;
16
+ /**
17
+ * What an `OUTSIDE_SCOPE` amount is called in the invoice totals, so the wording follows the declaration rather than being retyped per price. Required when `supplyScope` is `OUTSIDE_SCOPE`, and rejected otherwise. `CASHBACK` is the only value today, and a price declaring it must use the `standard` model and must not carry a positive `unitPrice` — a cashback is money paid back, not charged.
18
+ */
19
+ export declare const OutsideScopeLabel: {
20
+ readonly Cashback: "CASHBACK";
21
+ };
22
+ /**
23
+ * What an `OUTSIDE_SCOPE` amount is called in the invoice totals, so the wording follows the declaration rather than being retyped per price. Required when `supplyScope` is `OUTSIDE_SCOPE`, and rejected otherwise. `CASHBACK` is the only value today, and a price declaring it must use the `standard` model and must not carry a positive `unitPrice` — a cashback is money paid back, not charged.
24
+ */
25
+ export type OutsideScopeLabel = ClosedEnum<typeof OutsideScopeLabel>;
26
+ /**
27
+ * A price's tax declaration. Optional on write — a price that declares nothing is `IN_SCOPE`, and is billed and taxed exactly as it was before this object existed. Always present on read. Replaced as a whole on update: send the object to change it, omit it to leave it alone.
28
+ */
29
+ export type PriceTax = {
30
+ /**
31
+ * Whether this price's money is consideration for a supply — the one tax fact only you can state, because it is settled when you agree the deal rather than derived from what was sold. `IN_SCOPE` (the default) is consideration: it enters the taxable amount, positive as a charge or negative as a reduction in the price of the supply it applies to. `OUTSIDE_SCOPE` money is not consideration for anything, so it does not change the taxable amount, carries no tax, does not appear on the tax document, and nets into the amount payable after tax. This means "not consideration for a supply" — it does NOT mean "a supply outside this jurisdiction": exports and place-of-supply answers are worked out from the addresses on the sale by the tax provider, and are never declared on a price. How a supply is then classified — standard, zero-rated, exempt — is the tax provider's determination and is not set here either. Omit the whole `tax` object to leave a price in scope; there is deliberately no schema default on this property, so that a misspelt key is refused rather than silently defaulted.
32
+ */
33
+ supplyScope: SupplyScope;
34
+ /**
35
+ * What an `OUTSIDE_SCOPE` amount is called in the invoice totals, so the wording follows the declaration rather than being retyped per price. Required when `supplyScope` is `OUTSIDE_SCOPE`, and rejected otherwise. `CASHBACK` is the only value today, and a price declaring it must use the `standard` model and must not carry a positive `unitPrice` — a cashback is money paid back, not charged.
36
+ */
37
+ outsideScopeLabel?: OutsideScopeLabel | null | undefined;
38
+ };
39
+ /** @internal */
40
+ export declare const SupplyScope$inboundSchema: z.ZodNativeEnum<typeof SupplyScope>;
41
+ /** @internal */
42
+ export declare const SupplyScope$outboundSchema: z.ZodNativeEnum<typeof SupplyScope>;
43
+ /** @internal */
44
+ export declare const OutsideScopeLabel$inboundSchema: z.ZodNativeEnum<typeof OutsideScopeLabel>;
45
+ /** @internal */
46
+ export declare const OutsideScopeLabel$outboundSchema: z.ZodNativeEnum<typeof OutsideScopeLabel>;
47
+ /** @internal */
48
+ export declare const PriceTax$inboundSchema: z.ZodType<PriceTax, z.ZodTypeDef, unknown>;
49
+ /** @internal */
50
+ export type PriceTax$Outbound = {
51
+ supplyScope: string;
52
+ outsideScopeLabel?: string | null | undefined;
53
+ };
54
+ /** @internal */
55
+ export declare const PriceTax$outboundSchema: z.ZodType<PriceTax$Outbound, z.ZodTypeDef, PriceTax>;
56
+ export declare function priceTaxToJSON(priceTax: PriceTax): string;
57
+ export declare function priceTaxFromJSON(jsonString: string): SafeParseResult<PriceTax, SDKValidationError>;
58
+ //# sourceMappingURL=pricetax.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pricetax.d.ts","sourceRoot":"","sources":["../../../src/models/pricetax.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;;GAEG;AACH,eAAO,MAAM,WAAW;;;CAGd,CAAC;AACX;;GAEG;AACH,MAAM,MAAM,WAAW,GAAG,UAAU,CAAC,OAAO,WAAW,CAAC,CAAC;AAEzD;;GAEG;AACH,eAAO,MAAM,iBAAiB;;CAEpB,CAAC;AACX;;GAEG;AACH,MAAM,MAAM,iBAAiB,GAAG,UAAU,CAAC,OAAO,iBAAiB,CAAC,CAAC;AAErE;;GAEG;AACH,MAAM,MAAM,QAAQ,GAAG;IACrB;;OAEG;IACH,WAAW,EAAE,WAAW,CAAC;IACzB;;OAEG;IACH,iBAAiB,CAAC,EAAE,iBAAiB,GAAG,IAAI,GAAG,SAAS,CAAC;CAC1D,CAAC;AAEF,gBAAgB;AAChB,eAAO,MAAM,yBAAyB,EAAE,CAAC,CAAC,aAAa,CAAC,OAAO,WAAW,CAChD,CAAC;AAC3B,gBAAgB;AAChB,eAAO,MAAM,0BAA0B,EAAE,CAAC,CAAC,aAAa,CAAC,OAAO,WAAW,CAChD,CAAC;AAE5B,gBAAgB;AAChB,eAAO,MAAM,+BAA+B,EAAE,CAAC,CAAC,aAAa,CAC3D,OAAO,iBAAiB,CACS,CAAC;AACpC,gBAAgB;AAChB,eAAO,MAAM,gCAAgC,EAAE,CAAC,CAAC,aAAa,CAC5D,OAAO,iBAAiB,CACS,CAAC;AAEpC,gBAAgB;AAChB,eAAO,MAAM,sBAAsB,EAAE,CAAC,CAAC,OAAO,CAC5C,QAAQ,EACR,CAAC,CAAC,UAAU,EACZ,OAAO,CAIP,CAAC;AACH,gBAAgB;AAChB,MAAM,MAAM,iBAAiB,GAAG;IAC9B,WAAW,EAAE,MAAM,CAAC;IACpB,iBAAiB,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC;CAC/C,CAAC;AAEF,gBAAgB;AAChB,eAAO,MAAM,uBAAuB,EAAE,CAAC,CAAC,OAAO,CAC7C,iBAAiB,EACjB,CAAC,CAAC,UAAU,EACZ,QAAQ,CAIR,CAAC;AAEH,wBAAgB,cAAc,CAAC,QAAQ,EAAE,QAAQ,GAAG,MAAM,CAEzD;AACD,wBAAgB,gBAAgB,CAC9B,UAAU,EAAE,MAAM,GACjB,eAAe,CAAC,QAAQ,EAAE,kBAAkB,CAAC,CAM/C"}
@@ -0,0 +1,44 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+ import * as z from "zod/v3";
5
+ import { safeParse } from "../lib/schemas.js";
6
+ /**
7
+ * Whether this price's money is consideration for a supply — the one tax fact only you can state, because it is settled when you agree the deal rather than derived from what was sold. `IN_SCOPE` (the default) is consideration: it enters the taxable amount, positive as a charge or negative as a reduction in the price of the supply it applies to. `OUTSIDE_SCOPE` money is not consideration for anything, so it does not change the taxable amount, carries no tax, does not appear on the tax document, and nets into the amount payable after tax. This means "not consideration for a supply" — it does NOT mean "a supply outside this jurisdiction": exports and place-of-supply answers are worked out from the addresses on the sale by the tax provider, and are never declared on a price. How a supply is then classified — standard, zero-rated, exempt — is the tax provider's determination and is not set here either. Omit the whole `tax` object to leave a price in scope; there is deliberately no schema default on this property, so that a misspelt key is refused rather than silently defaulted.
8
+ */
9
+ export const SupplyScope = {
10
+ InScope: "IN_SCOPE",
11
+ OutsideScope: "OUTSIDE_SCOPE",
12
+ };
13
+ /**
14
+ * What an `OUTSIDE_SCOPE` amount is called in the invoice totals, so the wording follows the declaration rather than being retyped per price. Required when `supplyScope` is `OUTSIDE_SCOPE`, and rejected otherwise. `CASHBACK` is the only value today, and a price declaring it must use the `standard` model and must not carry a positive `unitPrice` — a cashback is money paid back, not charged.
15
+ */
16
+ export const OutsideScopeLabel = {
17
+ Cashback: "CASHBACK",
18
+ };
19
+ /** @internal */
20
+ export const SupplyScope$inboundSchema = z
21
+ .nativeEnum(SupplyScope);
22
+ /** @internal */
23
+ export const SupplyScope$outboundSchema = SupplyScope$inboundSchema;
24
+ /** @internal */
25
+ export const OutsideScopeLabel$inboundSchema = z.nativeEnum(OutsideScopeLabel);
26
+ /** @internal */
27
+ export const OutsideScopeLabel$outboundSchema = OutsideScopeLabel$inboundSchema;
28
+ /** @internal */
29
+ export const PriceTax$inboundSchema = z.object({
30
+ supplyScope: SupplyScope$inboundSchema,
31
+ outsideScopeLabel: z.nullable(OutsideScopeLabel$inboundSchema).optional(),
32
+ });
33
+ /** @internal */
34
+ export const PriceTax$outboundSchema = z.object({
35
+ supplyScope: SupplyScope$outboundSchema,
36
+ outsideScopeLabel: z.nullable(OutsideScopeLabel$outboundSchema).optional(),
37
+ });
38
+ export function priceTaxToJSON(priceTax) {
39
+ return JSON.stringify(PriceTax$outboundSchema.parse(priceTax));
40
+ }
41
+ export function priceTaxFromJSON(jsonString) {
42
+ return safeParse(jsonString, (x) => PriceTax$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'PriceTax' from JSON`);
43
+ }
44
+ //# sourceMappingURL=pricetax.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pricetax.js","sourceR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,MAAM,UAAU,gBAAgB,CAC9B,UAAkB;IAElB,OAAO,SAAS,CACd,UAAU,EACV,CAAC,CAAC,EAAE,EAAE,CAAC,sBAAsB,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,EAClD,sCAAsC,CACvC,CAAC;AACJ,CAAC"}
@@ -0,0 +1,18 @@
1
+ import * as z from "zod/v3";
2
+ import { ClosedEnum } from "../types/enums.js";
3
+ /**
4
+ * What properties.unitPrice is denominated in. 'amount' (the default) is an amount of the invoice currency for each unit metered, so the quantity is the multiplier. 'proportion' is the reverse: a dimensionless share of a currency-denominated quantity, so '0.02' is 2% and the invoice prints '2.00%'. Presentation only. Requires a standard metered price in real currency.
5
+ */
6
+ export declare const RateType: {
7
+ readonly Amount: "amount";
8
+ readonly Proportion: "proportion";
9
+ };
10
+ /**
11
+ * What properties.unitPrice is denominated in. 'amount' (the default) is an amount of the invoice currency for each unit metered, so the quantity is the multiplier. 'proportion' is the reverse: a dimensionless share of a currency-denominated quantity, so '0.02' is 2% and the invoice prints '2.00%'. Presentation only. Requires a standard metered price in real currency.
12
+ */
13
+ export type RateType = ClosedEnum<typeof RateType>;
14
+ /** @internal */
15
+ export declare const RateType$inboundSchema: z.ZodNativeEnum<typeof RateType>;
16
+ /** @internal */
17
+ export declare const RateType$outboundSchema: z.ZodNativeEnum<typeof RateType>;
18
+ //# sourceMappingURL=ratetype.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ratetype.d.ts","sourceRoot":"","sources":["../../../src/models/ratetype.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,CAAC,MAAM,QAAQ,CAAC;AAC5B,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAE/C;;GAEG;AACH,eAAO,MAAM,QAAQ;;;CAGX,CAAC;AACX;;GAEG;AACH,MAAM,MAAM,QAAQ,GAAG,UAAU,CAAC,OAAO,QAAQ,CAAC,CAAC;AAEnD,gBAAgB;AAChB,eAAO,MAAM,sBAAsB,EAAE,CAAC,CAAC,aAAa,CAAC,OAAO,QAAQ,CAC7C,CAAC;AACxB,gBAAgB;AAChB,eAAO,MAAM,uBAAuB,EAAE,CAAC,CAAC,aAAa,CAAC,OAAO,QAAQ,CAC7C,CAAC"}
@@ -0,0 +1,17 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+ import * as z from "zod/v3";
5
+ /**
6
+ * What properties.unitPrice is denominated in. 'amount' (the default) is an amount of the invoice currency for each unit metered, so the quantity is the multiplier. 'proportion' is the reverse: a dimensionless share of a currency-denominated quantity, so '0.02' is 2% and the invoice prints '2.00%'. Presentation only. Requires a standard metered price in real currency.
7
+ */
8
+ export const RateType = {
9
+ Amount: "amount",
10
+ Proportion: "proportion",
11
+ };
12
+ /** @internal */
13
+ export const RateType$inboundSchema = z
14
+ .nativeEnum(RateType);
15
+ /** @internal */
16
+ export const RateType$outboundSchema = RateType$inboundSchema;
17
+ //# sourceMappingURL=ratetype.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ratetype.js","sourceRoot":"","sources":["../../../src/models/ratetype.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,CAAC,MAAM,QAAQ,CAAC;AAG5B;;GAEG;AACH,MAAM,CAAC,MAAM,QAAQ,GAAG;IACtB,MAAM,EAAE,QAAQ;IAChB,UAAU,EAAE,YAAY;CAChB,CAAC;AAMX,gBAAgB;AAChB,MAAM,CAAC,MAAM,sBAAsB,GAAqC,CAAC;KACtE,UAAU,CAAC,QAAQ,CAAC,CAAC;AACxB,gBAAgB;AAChB,MAAM,CAAC,MAAM,uBAAuB,GAClC,sBAAsB,CAAC"}
@@ -5,6 +5,8 @@ import { SDKValidationError } from "./errors/sdkvalidationerror.js";
5
5
  import { PriceFeature } from "./pricefeature.js";
6
6
  import { PriceModel } from "./pricemodel.js";
7
7
  import { PriceProperties } from "./priceproperties.js";
8
+ import { PriceTax } from "./pricetax.js";
9
+ import { RateType } from "./ratetype.js";
8
10
  export declare const SchemasPriceObject: {
9
11
  readonly Price: "price";
10
12
  };
@@ -42,6 +44,10 @@ export type SchemasPrice = {
42
44
  billingCadence?: string | null | undefined;
43
45
  createdAt: Date;
44
46
  invoiceDisplayName: string;
47
+ /**
48
+ * Presentation only. Prices sharing this value, within one billing period, print as a single row on the rendered invoice PDF and are described by this string. Every member still bills its own line item on the ledger, this API and the compliance document. The combined row's rate is derived from the members' own rates. Requires the 'standard' pricing model. Sample values: 'Cross Border Fees', 'FX Fees'
49
+ */
50
+ invoiceDisplayGroup?: string | null | undefined;
45
51
  /**
46
52
  * Pricing model of a price as returned by the API. Includes the legacy models ('dynamic', 'percentage') retained for existing prices; 'standard' and 'volume' can be created (see PriceModelInput).
47
53
  */
@@ -61,6 +67,14 @@ export type SchemasPrice = {
61
67
  * A fixed amount owed whole rather than a per-period rate. An obligation is not prorated over a partial first period: when a subscription starts before its billing anchor, no truncated stub is billed and the first charge is the full amount at the next anchor. An obligation also refuses an interval boundary that falls strictly inside one of its own billing periods, since part of an amount owed whole is not a thing to bill. Defaults to false, which is a rate and is today's behaviour for every price. Not supported on a metered price, whose amount resolves from usage at close.
62
68
  */
63
69
  isObligation: boolean;
70
+ /**
71
+ * What properties.unitPrice is denominated in. 'amount' (the default) is an amount of the invoice currency for each unit metered, so the quantity is the multiplier. 'proportion' is the reverse: a dimensionless share of a currency-denominated quantity, so '0.02' is 2% and the invoice prints '2.00%'. Presentation only. Requires a standard metered price in real currency.
72
+ */
73
+ rateType?: RateType | undefined;
74
+ /**
75
+ * A price's tax declaration. Optional on write — a price that declares nothing is `IN_SCOPE`, and is billed and taxed exactly as it was before this object existed. Always present on read. Replaced as a whole on update: send the object to change it, omit it to leave it alone.
76
+ */
77
+ tax: PriceTax;
64
78
  /**
65
79
  * Quantity for invoice line items. Total per period = quantity × unitPrice. Only supported for fee prices; metered prices derive quantity from usage. Defaults to 1.
66
80
  */
@@ -1 +1 @@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;OAEG;IACH,QAAQ,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF,gBAAgB;AAChB,eAAO,MAAM,gCAAgC,EAAE,CAAC,CAAC,aAAa,CAC5D,OAAO,kBAAkB,CACS,CAAC;AAErC,gBAAgB;AAChB,eAAO,MAAM,qCAAqC,EAAE,CAAC,CAAC,aAAa,CACjE,OAAO,uBAAuB,CACS,CAAC;AAE1C,gBAAgB;AAChB,eAAO,MAAM,0BAA0B,EAAE,CAAC,CAAC,OAAO,CAChD,YAAY,EACZ,CAAC,CAAC,UAAU,EACZ,OAAO,CAsBP,CAAC;AAEH,wBAAgB,oBAAoB,CAClC,UAAU,EAAE,MAAM,GACjB,eAAe,CAAC,YAAY,EAAE,kBAAkB,CAAC,CAMnD"}
@@ -6,6 +6,8 @@ import { safeParse } from "../lib/schemas.js";
6
6
  import { PriceFeature$inboundSchema } from "./pricefeature.js";
7
7
  import { PriceModel$inboundSchema } from "./pricemodel.js";
8
8
  import { PriceProperties$inboundSchema, } from "./priceproperties.js";
9
+ import { PriceTax$inboundSchema } from "./pricetax.js";
10
+ import { RateType$inboundSchema } from "./ratetype.js";
9
11
  export const SchemasPriceObject = {
10
12
  Price: "price",
11
13
  };
@@ -28,6 +30,7 @@ export const SchemasPrice$inboundSchema = z.object({
28
30
  billingCadence: z.nullable(z.string()).optional(),
29
31
  createdAt: z.string().datetime({ offset: true }).transform(v => new Date(v)),
30
32
  invoiceDisplayName: z.string(),
33
+ invoiceDisplayGroup: z.nullable(z.string()).optional(),
31
34
  model: PriceModel$inboundSchema.optional(),
32
35
  paymentTerm: SchemasPricePaymentTerm$inboundSchema,
33
36
  properties: PriceProperties$inboundSchema,
@@ -35,6 +38,8 @@ export const SchemasPrice$inboundSchema = z.object({
35
38
  features: z.array(PriceFeature$inboundSchema).optional(),
36
39
  grantDiscountEnabled: z.boolean().default(false),
37
40
  isObligation: z.boolean().default(false),
41
+ rateType: RateType$inboundSchema.optional(),
42
+ tax: PriceTax$inboundSchema,
38
43
  quantity: z.number().int(),
39
44
  });
40
45
  export function schemasPriceFromJSON(jsonString) {
@@ -1 +1 @@
1
- {"version":3,"file":"schemasprice.js","sourceRoot":"","sources":["../../../src/models/schemasprice.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,CAAC,MAAM,QAAQ,CAAC;AAC5B,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAI9C,OAAO,EAAgB,0BAA0B,EAAE,MAAM,mBAAmB,CAAC;AAC7E,OAAO,EAAc,wBAAwB,EAAE,MAAM,iBAAiB,CAAC;AACvE,OAAO,EAEL,6BAA6B,GAC9B,MAAM,sBAAsB,CAAC;AAE9B,MAAM,CAAC,MAAM,kBAAkB,GAAG;IAChC,KAAK,EAAE,OAAO;CACN,CAAC;AAGX,MAAM,CAAC,MAAM,uBAAuB,GAAG;IACrC,SAAS,EAAE,YAAY;IACvB,SAAS,EAAE,YAAY;CACf,CAAC;AA0DX,gBAAgB;AAChB,MAAM,CAAC,MAAM,gCAAgC,GAEzC,CAAC,CAAC,UAAU,CAAC,kBAAkB,CAAC,CAAC;AAErC,gBAAgB;AAChB,MAAM,CAAC,MAAM,qCAAqC,GAE9C,CAAC,CAAC,UAAU,CAAC,uBAAuB,CAAC,CAAC;AAE1C,gBAAgB;AAChB,MAAM,CAAC,MAAM,0BAA0B,GAInC,CAAC,CAAC,MAAM,CAAC;IACX,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE;IACd,MAAM,EAAE,gCAAgC,CAAC,OAAO,CAAC,OAAO,CAAC;IACzD,gBAAgB,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IACvC,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC5B,aAAa,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IACpC,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE;IACtB,cAAc,EAAE,CAAC,CAAC,QAAQ,C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scriptionAdjustmentType: {
10
10
  readonly PercentageDiscount: "percentageDiscount";
11
+ readonly UsageDiscount: "usageDiscount";
11
12
  };
12
13
  export type SubscriptionAdjustmentType = ClosedEnum<typeof SubscriptionAdjustmentType>;
13
14
  export type SubscriptionAdjustment = {
@@ -22,19 +23,27 @@ export type SubscriptionAdjustment = {
22
23
  subscriptionId: string;
23
24
  type: SubscriptionAdjustmentType;
24
25
  /**
25
- * The discount rate as a decimal fraction between 0 and 1. "0.35" means 35 percent.
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.
26
27
  */
27
- percentageDiscount: string;
28
+ percentageDiscount: string | null;
28
29
  /**
29
- * The first instant the discount applies. Inclusive.
30
+ * The number of usage units taken off the targeted line's billable quantity. Null on a percentageDiscount, which carries a rate instead.
31
+ */
32
+ usageDiscount: string | null;
33
+ /**
34
+ * The prices this adjustment reduces. Exactly one metered price on a usageDiscount; empty on a percentageDiscount, which reduces every discountable charge.
35
+ */
36
+ targetPriceIds: Array<string>;
37
+ /**
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.
30
39
  */
31
40
  effectiveFrom: Date;
32
41
  /**
33
- * The instant the discount stops applying. Exclusive. Null means the discount never stops.
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.
34
43
  */
35
44
  effectiveTo: Date | null;
36
45
  /**
37
- * The deal's own name, shown on each discount line of the invoice.
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.
38
47
  */
39
48
  description: string | null;
40
49
  createdAt: Date;
@@ -1 +1 @@
1
- {"version":3,"file":"subscriptionadjustment.d.ts","sourceRoot":"","sources":["../../../src/models/subscriptionadjustment.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,CAA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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;;;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"}
@@ -8,6 +8,7 @@ export const SubscriptionAdjustmentObject = {
8
8
  };
9
9
  export const SubscriptionAdjustmentType = {
10
10
  PercentageDiscount: "percentageDiscount",
11
+ UsageDiscount: "usageDiscount",
11
12
  };
12
13
  /** @internal */
13
14
  export const SubscriptionAdjustmentObject$inboundSchema = z.nativeEnum(SubscriptionAdjustmentObject);
@@ -19,7 +20,9 @@ export const SubscriptionAdjustment$inboundSchema = z.object({
19
20
  id: z.string(),
20
21
  subscriptionId: z.string(),
21
22
  type: SubscriptionAdjustmentType$inboundSchema,
22
- percentageDiscount: z.string(),
23
+ percentageDiscount: z.nullable(z.string()),
24
+ usageDiscount: z.nullable(z.string()),
25
+ targetPriceIds: z.array(z.string()),
23
26
  effectiveFrom: z.string().datetime({ offset: true }).transform(v => new Date(v)),
24
27
  effectiveTo: z.nullable(z.string().datetime({ offset: true }).transform(v => new Date(v))),
25
28
  description: z.nullable(z.string()),
@@ -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;C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AAC,CAAC,CAAC,EAAE,CACjE,IAAI,IAAI,CAAC,CAAC,CAAC,CACZ;IACD,WAAW,EAAE,CAAC,CAAC,QAAQ,CACrB,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,CAClE;IACD,WAAW,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC;IACnC,SAAS,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"}
@@ -53,7 +53,7 @@ export declare class Subscriptions extends ClientSDK {
53
53
  * Create Adjustment
54
54
  *
55
55
  * @remarks
56
- * Attaches a percentage discount to the subscription for a dated window. Every invoice calculated while the window is open carries one discount line for each discounted charge, and tax is assessed on the reduced amount. An invoice that already exists is not changed, including one still in draft — the discount reaches the periods that close after it is created. There is no update operation, and a window cannot be changed after it is created. To change a rate before any invoice has issued under the discount, delete the adjustment and create a replacement. Once an invoice has issued the adjustment is permanent, so set effectiveTo at creation time whenever the deal has a known end date.
56
+ * Attaches an adjustment to the subscription for a dated window. A percentageDiscount reduces every discountable charge by a rate and carries one discount line per charge on the invoice. A usageDiscount takes a number of usage units off one metered price's billable quantity before that line is priced, so the line re-slots on a volume ladder and shows the corrected quantity; it emits no line of its own. Tax is assessed on the reduced amount either way. An invoice that already exists is not changed, including one still in draft — the adjustment reaches the periods that close after it is created. There is no update operation, and a window cannot be changed after it is created. To change an adjustment before any invoice has issued under it, delete it and create a replacement. Once an invoice has issued the adjustment is permanent, so set effectiveTo at creation time whenever the deal has a known end date.
57
57
  */
58
58
  createSubscriptionAdjustment(request: operations.CreateSubscriptionAdjustmentRequest, options?: RequestOptions): Promise<models.SubscriptionAdjustment>;
59
59
  /**
@@ -81,7 +81,7 @@ export class Subscriptions extends ClientSDK {
81
81
  * Create Adjustment
82
82
  *
83
83
  * @remarks
84
- * Attaches a percentage discount to the subscription for a dated window. Every invoice calculated while the window is open carries one discount line for each discounted charge, and tax is assessed on the reduced amount. An invoice that already exists is not changed, including one still in draft — the discount reaches the periods that close after it is created. There is no update operation, and a window cannot be changed after it is created. To change a rate before any invoice has issued under the discount, delete the adjustment and create a replacement. Once an invoice has issued the adjustment is permanent, so set effectiveTo at creation time whenever the deal has a known end date.
84
+ * Attaches an adjustment to the subscription for a dated window. A percentageDiscount reduces every discountable charge by a rate and carries one discount line per charge on the invoice. A usageDiscount takes a number of usage units off one metered price's billable quantity before that line is priced, so the line re-slots on a volume ladder and shows the corrected quantity; it emits no line of its own. Tax is assessed on the reduced amount either way. An invoice that already exists is not changed, including one still in draft — the adjustment reaches the periods that close after it is created. There is no update operation, and a window cannot be changed after it is created. To change an adjustment before any invoice has issued under it, delete it and create a replacement. Once an invoice has issued the adjustment is permanent, so set effectiveTo at creation time whenever the deal has a known end date.
85
85
  */
86
86
  async createSubscriptionAdjustment(request, options) {
87
87
  return unwrapAsync(subscriptionsCreateSubscriptionAdjustment(this, request, options));
package/jsr.json CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  {
4
4
  "name": "@paygentic/sdk",
5
- "version": "0.9.7",
5
+ "version": "0.9.8",
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.7",
3
+ "version": "0.9.8",
4
4
  "author": "Speakeasy",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -139,7 +139,7 @@ async function $do(
139
139
 
140
140
  const doResult = await client._do(req, {
141
141
  context,
142
- errorCodes: ["400", "403", "4XX", "500", "5XX"],
142
+ errorCodes: ["400", "403", "429", "4XX", "500", "5XX"],
143
143
  retryConfig: context.retryConfig,
144
144
  retryCodes: context.retryCodes,
145
145
  });
@@ -167,7 +167,7 @@ async function $do(
167
167
  >(
168
168
  M.json(200, operations.ListCustomersResponse$inboundSchema),
169
169
  M.jsonErr(400, errors.BadRequest$inboundSchema),
170
- M.jsonErr(403, errors.ErrorT$inboundSchema),
170
+ M.jsonErr([403, 429], errors.ErrorT$inboundSchema),
171
171
  M.jsonErr(500, errors.ErrorT$inboundSchema),
172
172
  M.fail("4XX"),
173
173
  M.fail("5XX"),
@@ -30,7 +30,7 @@ import { Result } from "../types/fp.js";
30
30
  * Create Adjustment
31
31
  *
32
32
  * @remarks
33
- * Attaches a percentage discount to the subscription for a dated window. Every invoice calculated while the window is open carries one discount line for each discounted charge, and tax is assessed on the reduced amount. An invoice that already exists is not changed, including one still in draft — the discount reaches the periods that close after it is created. There is no update operation, and a window cannot be changed after it is created. To change a rate before any invoice has issued under the discount, delete the adjustment and create a replacement. Once an invoice has issued the adjustment is permanent, so set effectiveTo at creation time whenever the deal has a known end date.
33
+ * Attaches an adjustment to the subscription for a dated window. A percentageDiscount reduces every discountable charge by a rate and carries one discount line per charge on the invoice. A usageDiscount takes a number of usage units off one metered price's billable quantity before that line is priced, so the line re-slots on a volume ladder and shows the corrected quantity; it emits no line of its own. Tax is assessed on the reduced amount either way. An invoice that already exists is not changed, including one still in draft — the adjustment reaches the periods that close after it is created. There is no update operation, and a window cannot be changed after it is created. To change an adjustment before any invoice has issued under it, delete it and create a replacement. Once an invoice has issued the adjustment is permanent, so set effectiveTo at creation time whenever the deal has a known end date.
34
34
  */
35
35
  export function subscriptionsCreateSubscriptionAdjustment(
36
36
  client: PaygenticCore,
@@ -143,7 +143,7 @@ async function $do(
143
143
 
144
144
  const doResult = await client._do(req, {
145
145
  context,
146
- errorCodes: ["400", "401", "403", "404", "4XX", "500", "5XX"],
146
+ errorCodes: ["400", "401", "403", "404", "429", "4XX", "500", "5XX"],
147
147
  retryConfig: context.retryConfig,
148
148
  retryCodes: context.retryCodes,
149
149
  });
@@ -171,7 +171,7 @@ async function $do(
171
171
  >(
172
172
  M.json([200, 201], models.SubscriptionReconciliation$inboundSchema),
173
173
  M.jsonErr(400, errors.BadRequest$inboundSchema),
174
- M.jsonErr([401, 403, 404], errors.ErrorT$inboundSchema),
174
+ M.jsonErr([401, 403, 404, 429], errors.ErrorT$inboundSchema),
175
175
  M.jsonErr(500, errors.ErrorT$inboundSchema),
176
176
  M.fail("4XX"),
177
177
  M.fail("5XX"),
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.7",
68
+ sdkVersion: "0.9.8",
69
69
  genVersion: "2.879.13",
70
- userAgent: "speakeasy-sdk/typescript 0.9.7 2.879.13 0.1.0 @paygentic/sdk",
70
+ userAgent: "speakeasy-sdk/typescript 0.9.8 2.879.13 0.1.0 @paygentic/sdk",
71
71
  } as const;
@@ -0,0 +1,66 @@
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 CreatePercentageDiscountAdjustment = {
8
+ /**
9
+ * Reduces every discountable charge on the invoice by a rate.
10
+ */
11
+ type: "percentageDiscount";
12
+ /**
13
+ * The discount rate as a decimal fraction between 0 and 1, sent as a string. "0.35" means 35 percent. "1" means 100 percent, not 1 percent. At most 6 decimal places. A value of 0 or above 1 is rejected.
14
+ */
15
+ percentageDiscount: string;
16
+ /**
17
+ * The first instant the discount applies. Inclusive.
18
+ */
19
+ effectiveFrom: Date;
20
+ /**
21
+ * The instant the discount stops applying. Exclusive, so a window ending on the same date another begins neither overlaps nor leaves a gap. Null means the discount never stops, and it cannot be ended later — set an instant whenever the deal has a known end date. Must be after effectiveFrom.
22
+ */
23
+ effectiveTo?: Date | null | undefined;
24
+ /**
25
+ * The deal's own name, shown on each discount line of the invoice.
26
+ */
27
+ description?: string | null | undefined;
28
+ /**
29
+ * 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 adjustment, and two percentage discounts compound — two of 0.35 bill 57.75 percent off, not 35 percent.
30
+ */
31
+ idempotencyKey?: string | undefined;
32
+ };
33
+
34
+ /** @internal */
35
+ export type CreatePercentageDiscountAdjustment$Outbound = {
36
+ type: "percentageDiscount";
37
+ percentageDiscount: string;
38
+ effectiveFrom: string;
39
+ effectiveTo?: string | null | undefined;
40
+ description?: string | null | undefined;
41
+ idempotencyKey?: string | undefined;
42
+ };
43
+
44
+ /** @internal */
45
+ export const CreatePercentageDiscountAdjustment$outboundSchema: z.ZodType<
46
+ CreatePercentageDiscountAdjustment$Outbound,
47
+ z.ZodTypeDef,
48
+ CreatePercentageDiscountAdjustment
49
+ > = z.object({
50
+ type: z.literal("percentageDiscount"),
51
+ percentageDiscount: z.string(),
52
+ effectiveFrom: z.date().transform(v => v.toISOString()),
53
+ effectiveTo: z.nullable(z.date().transform(v => v.toISOString())).optional(),
54
+ description: z.nullable(z.string()).optional(),
55
+ idempotencyKey: z.string().optional(),
56
+ });
57
+
58
+ export function createPercentageDiscountAdjustmentToJSON(
59
+ createPercentageDiscountAdjustment: CreatePercentageDiscountAdjustment,
60
+ ): string {
61
+ return JSON.stringify(
62
+ CreatePercentageDiscountAdjustment$outboundSchema.parse(
63
+ createPercentageDiscountAdjustment,
64
+ ),
65
+ );
66
+ }