@flexprice/sdk 2.1.35 → 2.1.36

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 (199) hide show
  1. package/docs/sdk/models/add-addon-ref.md +1 -0
  2. package/docs/sdk/models/add-addon-request.md +1 -0
  3. package/docs/sdk/models/add-addon-to-subscription-request.md +1 -0
  4. package/docs/sdk/models/coupon-ref.md +19 -0
  5. package/docs/sdk/models/create-credit-grant-request.md +1 -0
  6. package/docs/sdk/models/create-customer-request.md +6 -0
  7. package/docs/sdk/models/create-scheduled-task-request.md +1 -1
  8. package/docs/sdk/models/customer-contact-person.md +25 -0
  9. package/docs/sdk/models/customer-response.md +1 -0
  10. package/docs/sdk/models/customer.md +1 -0
  11. package/docs/sdk/models/external-tax-details.md +25 -0
  12. package/docs/sdk/models/line-item-change.md +1 -0
  13. package/docs/sdk/models/modify-subscription-line-item.md +1 -0
  14. package/docs/sdk/models/scheduled-task-entity-type.md +1 -1
  15. package/docs/sdk/models/tax-applied-response.md +5 -1
  16. package/docs/sdk/models/tax-exemption-reason-code.md +2 -2
  17. package/docs/sdk/models/tax-jurisdiction.md +18 -0
  18. package/docs/sdk/models/tax-provider.md +17 -0
  19. package/docs/sdk/models/tax-rate-entity-type.md +1 -1
  20. package/docs/sdk/models/tax-reversal-mode.md +17 -0
  21. package/docs/sdk/models/tax-reversal.md +16 -0
  22. package/docs/sdk/models/tax-transaction-type.md +17 -0
  23. package/docs/sdk/models/top-up-coupon.md +17 -0
  24. package/docs/sdk/models/top-up-wallet-request.md +1 -0
  25. package/docs/sdk/models/update-customer-request-request.md +7 -1
  26. package/docs/sdk/models/update-customer-request.md +4 -1
  27. package/docs/sdk/models/wallet-transaction-response.md +3 -0
  28. package/docs/sdk/models/wallet-tx-consumption.md +16 -0
  29. package/docs/sdk/models/wallet-tx-source-type.md +15 -0
  30. package/docs/sdk/models/webhook-dto-invoice-line-item.md +1 -0
  31. package/docs/sdk/models/webhook-dto-invoice.md +1 -0
  32. package/docs/sdk/models/webhook-dto-tax-applied.md +3 -0
  33. package/docs/sdk/models/webhook-dto-wallet-transaction.md +3 -0
  34. package/docs/sdks/customers/README.md +8 -2
  35. package/esm/lib/config.d.ts +3 -3
  36. package/esm/lib/config.js +3 -3
  37. package/esm/sdk/models/add-addon-ref.d.ts +3 -0
  38. package/esm/sdk/models/add-addon-ref.d.ts.map +1 -1
  39. package/esm/sdk/models/add-addon-ref.js +2 -0
  40. package/esm/sdk/models/add-addon-ref.js.map +1 -1
  41. package/esm/sdk/models/add-addon-request.d.ts +6 -0
  42. package/esm/sdk/models/add-addon-request.d.ts.map +1 -1
  43. package/esm/sdk/models/add-addon-request.js +2 -0
  44. package/esm/sdk/models/add-addon-request.js.map +1 -1
  45. package/esm/sdk/models/add-addon-to-subscription-request.d.ts +6 -0
  46. package/esm/sdk/models/add-addon-to-subscription-request.d.ts.map +1 -1
  47. package/esm/sdk/models/add-addon-to-subscription-request.js +2 -0
  48. package/esm/sdk/models/add-addon-to-subscription-request.js.map +1 -1
  49. package/esm/sdk/models/coupon-ref.d.ts +20 -0
  50. package/esm/sdk/models/coupon-ref.d.ts.map +1 -0
  51. package/esm/sdk/models/coupon-ref.js +25 -0
  52. package/esm/sdk/models/coupon-ref.js.map +1 -0
  53. package/esm/sdk/models/create-credit-grant-request.d.ts +3 -0
  54. package/esm/sdk/models/create-credit-grant-request.d.ts.map +1 -1
  55. package/esm/sdk/models/create-credit-grant-request.js +3 -0
  56. package/esm/sdk/models/create-credit-grant-request.js.map +1 -1
  57. package/esm/sdk/models/create-customer-request.d.ts +6 -0
  58. package/esm/sdk/models/create-customer-request.d.ts.map +1 -1
  59. package/esm/sdk/models/create-customer-request.js +3 -0
  60. package/esm/sdk/models/create-customer-request.js.map +1 -1
  61. package/esm/sdk/models/customer-contact-person.d.ts +33 -0
  62. package/esm/sdk/models/customer-contact-person.d.ts.map +1 -0
  63. package/esm/sdk/models/customer-contact-person.js +50 -0
  64. package/esm/sdk/models/customer-contact-person.js.map +1 -0
  65. package/esm/sdk/models/customer-response.d.ts +2 -0
  66. package/esm/sdk/models/customer-response.d.ts.map +1 -1
  67. package/esm/sdk/models/customer-response.js +3 -0
  68. package/esm/sdk/models/customer-response.js.map +1 -1
  69. package/esm/sdk/models/customer.d.ts +2 -0
  70. package/esm/sdk/models/customer.d.ts.map +1 -1
  71. package/esm/sdk/models/customer.js +3 -0
  72. package/esm/sdk/models/customer.js.map +1 -1
  73. package/esm/sdk/models/external-tax-details.d.ts +66 -0
  74. package/esm/sdk/models/external-tax-details.d.ts.map +1 -0
  75. package/esm/sdk/models/external-tax-details.js +36 -0
  76. package/esm/sdk/models/external-tax-details.js.map +1 -0
  77. package/esm/sdk/models/index.d.ts +11 -0
  78. package/esm/sdk/models/index.d.ts.map +1 -1
  79. package/esm/sdk/models/index.js +11 -0
  80. package/esm/sdk/models/index.js.map +1 -1
  81. package/esm/sdk/models/line-item-change.d.ts +6 -0
  82. package/esm/sdk/models/line-item-change.d.ts.map +1 -1
  83. package/esm/sdk/models/line-item-change.js +2 -0
  84. package/esm/sdk/models/line-item-change.js.map +1 -1
  85. package/esm/sdk/models/modify-subscription-line-item.d.ts +3 -0
  86. package/esm/sdk/models/modify-subscription-line-item.d.ts.map +1 -1
  87. package/esm/sdk/models/modify-subscription-line-item.js +2 -0
  88. package/esm/sdk/models/modify-subscription-line-item.js.map +1 -1
  89. package/esm/sdk/models/scheduled-task-entity-type.d.ts +1 -0
  90. package/esm/sdk/models/scheduled-task-entity-type.d.ts.map +1 -1
  91. package/esm/sdk/models/scheduled-task-entity-type.js +1 -0
  92. package/esm/sdk/models/scheduled-task-entity-type.js.map +1 -1
  93. package/esm/sdk/models/tax-applied-response.d.ts +13 -0
  94. package/esm/sdk/models/tax-applied-response.d.ts.map +1 -1
  95. package/esm/sdk/models/tax-applied-response.js +10 -0
  96. package/esm/sdk/models/tax-applied-response.js.map +1 -1
  97. package/esm/sdk/models/tax-exemption-reason-code.d.ts +4 -0
  98. package/esm/sdk/models/tax-exemption-reason-code.d.ts.map +1 -1
  99. package/esm/sdk/models/tax-exemption-reason-code.js +4 -0
  100. package/esm/sdk/models/tax-exemption-reason-code.js.map +1 -1
  101. package/esm/sdk/models/tax-jurisdiction.d.ts +13 -0
  102. package/esm/sdk/models/tax-jurisdiction.d.ts.map +1 -0
  103. package/esm/sdk/models/tax-jurisdiction.js +22 -0
  104. package/esm/sdk/models/tax-jurisdiction.js.map +1 -0
  105. package/esm/sdk/models/tax-provider.d.ts +10 -0
  106. package/esm/sdk/models/tax-provider.d.ts.map +1 -0
  107. package/esm/sdk/models/tax-provider.js +11 -0
  108. package/esm/sdk/models/tax-provider.js.map +1 -0
  109. package/esm/sdk/models/tax-rate-entity-type.d.ts +1 -0
  110. package/esm/sdk/models/tax-rate-entity-type.d.ts.map +1 -1
  111. package/esm/sdk/models/tax-rate-entity-type.js +1 -0
  112. package/esm/sdk/models/tax-rate-entity-type.js.map +1 -1
  113. package/esm/sdk/models/tax-reversal-mode.d.ts +10 -0
  114. package/esm/sdk/models/tax-reversal-mode.d.ts.map +1 -0
  115. package/esm/sdk/models/tax-reversal-mode.js +11 -0
  116. package/esm/sdk/models/tax-reversal-mode.js.map +1 -0
  117. package/esm/sdk/models/tax-reversal.d.ts +12 -0
  118. package/esm/sdk/models/tax-reversal.d.ts.map +1 -0
  119. package/esm/sdk/models/tax-reversal.js +22 -0
  120. package/esm/sdk/models/tax-reversal.js.map +1 -0
  121. package/esm/sdk/models/tax-transaction-type.d.ts +10 -0
  122. package/esm/sdk/models/tax-transaction-type.d.ts.map +1 -0
  123. package/esm/sdk/models/tax-transaction-type.js +11 -0
  124. package/esm/sdk/models/tax-transaction-type.js.map +1 -0
  125. package/esm/sdk/models/top-up-coupon.d.ts +12 -0
  126. package/esm/sdk/models/top-up-coupon.d.ts.map +1 -0
  127. package/esm/sdk/models/top-up-coupon.js +17 -0
  128. package/esm/sdk/models/top-up-coupon.js.map +1 -0
  129. package/esm/sdk/models/top-up-wallet-request.d.ts +3 -0
  130. package/esm/sdk/models/top-up-wallet-request.d.ts.map +1 -1
  131. package/esm/sdk/models/top-up-wallet-request.js +2 -0
  132. package/esm/sdk/models/top-up-wallet-request.js.map +1 -1
  133. package/esm/sdk/models/update-customer-request.d.ts +6 -0
  134. package/esm/sdk/models/update-customer-request.d.ts.map +1 -1
  135. package/esm/sdk/models/update-customer-request.js +3 -0
  136. package/esm/sdk/models/update-customer-request.js.map +1 -1
  137. package/esm/sdk/models/wallet-transaction-response.d.ts +8 -0
  138. package/esm/sdk/models/wallet-transaction-response.d.ts.map +1 -1
  139. package/esm/sdk/models/wallet-transaction-response.js +8 -0
  140. package/esm/sdk/models/wallet-transaction-response.js.map +1 -1
  141. package/esm/sdk/models/wallet-tx-consumption.d.ts +11 -0
  142. package/esm/sdk/models/wallet-tx-consumption.d.ts.map +1 -0
  143. package/esm/sdk/models/wallet-tx-consumption.js +20 -0
  144. package/esm/sdk/models/wallet-tx-consumption.js.map +1 -0
  145. package/esm/sdk/models/wallet-tx-source-type.d.ts +9 -0
  146. package/esm/sdk/models/wallet-tx-source-type.d.ts.map +1 -0
  147. package/esm/sdk/models/wallet-tx-source-type.js +10 -0
  148. package/esm/sdk/models/wallet-tx-source-type.js.map +1 -0
  149. package/esm/sdk/models/webhook-dto-invoice-line-item.d.ts +2 -0
  150. package/esm/sdk/models/webhook-dto-invoice-line-item.d.ts.map +1 -1
  151. package/esm/sdk/models/webhook-dto-invoice-line-item.js +3 -0
  152. package/esm/sdk/models/webhook-dto-invoice-line-item.js.map +1 -1
  153. package/esm/sdk/models/webhook-dto-invoice.d.ts +2 -0
  154. package/esm/sdk/models/webhook-dto-invoice.d.ts.map +1 -1
  155. package/esm/sdk/models/webhook-dto-invoice.js +3 -0
  156. package/esm/sdk/models/webhook-dto-invoice.js.map +1 -1
  157. package/esm/sdk/models/webhook-dto-tax-applied.d.ts +6 -0
  158. package/esm/sdk/models/webhook-dto-tax-applied.d.ts.map +1 -1
  159. package/esm/sdk/models/webhook-dto-tax-applied.js +8 -0
  160. package/esm/sdk/models/webhook-dto-tax-applied.js.map +1 -1
  161. package/esm/sdk/models/webhook-dto-wallet-transaction.d.ts +5 -0
  162. package/esm/sdk/models/webhook-dto-wallet-transaction.d.ts.map +1 -1
  163. package/esm/sdk/models/webhook-dto-wallet-transaction.js +8 -0
  164. package/esm/sdk/models/webhook-dto-wallet-transaction.js.map +1 -1
  165. package/jsr.json +1 -1
  166. package/package.json +1 -1
  167. package/src/lib/config.ts +3 -3
  168. package/src/sdk/models/add-addon-ref.ts +8 -0
  169. package/src/sdk/models/add-addon-request.ts +11 -0
  170. package/src/sdk/models/add-addon-to-subscription-request.ts +11 -0
  171. package/src/sdk/models/coupon-ref.ts +50 -0
  172. package/src/sdk/models/create-credit-grant-request.ts +8 -0
  173. package/src/sdk/models/create-customer-request.ts +12 -0
  174. package/src/sdk/models/customer-contact-person.ts +101 -0
  175. package/src/sdk/models/customer-response.ts +9 -0
  176. package/src/sdk/models/customer.ts +9 -0
  177. package/src/sdk/models/external-tax-details.ts +113 -0
  178. package/src/sdk/models/index.ts +11 -0
  179. package/src/sdk/models/line-item-change.ts +11 -0
  180. package/src/sdk/models/modify-subscription-line-item.ts +8 -0
  181. package/src/sdk/models/scheduled-task-entity-type.ts +1 -0
  182. package/src/sdk/models/tax-applied-response.ts +26 -0
  183. package/src/sdk/models/tax-exemption-reason-code.ts +4 -0
  184. package/src/sdk/models/tax-jurisdiction.ts +45 -0
  185. package/src/sdk/models/tax-provider.ts +17 -0
  186. package/src/sdk/models/tax-rate-entity-type.ts +1 -0
  187. package/src/sdk/models/tax-reversal-mode.ts +19 -0
  188. package/src/sdk/models/tax-reversal.ts +43 -0
  189. package/src/sdk/models/tax-transaction-type.ts +19 -0
  190. package/src/sdk/models/top-up-coupon.ts +34 -0
  191. package/src/sdk/models/top-up-wallet-request.ts +8 -0
  192. package/src/sdk/models/update-customer-request.ts +12 -0
  193. package/src/sdk/models/wallet-transaction-response.ts +22 -0
  194. package/src/sdk/models/wallet-tx-consumption.ts +41 -0
  195. package/src/sdk/models/wallet-tx-source-type.ts +16 -0
  196. package/src/sdk/models/webhook-dto-invoice-line-item.ts +4 -0
  197. package/src/sdk/models/webhook-dto-invoice.ts +4 -0
  198. package/src/sdk/models/webhook-dto-tax-applied.ts +17 -0
  199. package/src/sdk/models/webhook-dto-wallet-transaction.ts +19 -0
@@ -5,6 +5,11 @@
5
5
  import * as z from "zod/v4-mini";
6
6
  import { remap as remap$ } from "../../lib/primitives.js";
7
7
  import { AddonCadence, AddonCadence$outboundSchema } from "./addon-cadence.js";
8
+ import {
9
+ CouponRef,
10
+ CouponRef$Outbound,
11
+ CouponRef$outboundSchema,
12
+ } from "./coupon-ref.js";
8
13
  import {
9
14
  ProrationBehavior,
10
15
  ProrationBehavior$outboundSchema,
@@ -14,6 +19,7 @@ export type AddAddonRef = {
14
19
  addonId?: string | undefined;
15
20
  associationId?: string | undefined;
16
21
  cadence?: AddonCadence | undefined;
22
+ coupons?: Array<CouponRef> | undefined;
17
23
  prorationBehavior?: ProrationBehavior | undefined;
18
24
  startDate?: Date | undefined;
19
25
  };
@@ -23,6 +29,7 @@ export type AddAddonRef$Outbound = {
23
29
  addon_id?: string | undefined;
24
30
  association_id?: string | undefined;
25
31
  cadence?: string | undefined;
32
+ coupons?: Array<CouponRef$Outbound> | undefined;
26
33
  proration_behavior?: string | undefined;
27
34
  start_date?: string | undefined;
28
35
  };
@@ -36,6 +43,7 @@ export const AddAddonRef$outboundSchema: z.ZodMiniType<
36
43
  addonId: z.optional(z.string()),
37
44
  associationId: z.optional(z.string()),
38
45
  cadence: z.optional(AddonCadence$outboundSchema),
46
+ coupons: z.optional(z.array(CouponRef$outboundSchema)),
39
47
  prorationBehavior: z.optional(ProrationBehavior$outboundSchema),
40
48
  startDate: z.optional(z.pipe(z.date(), z.transform(v => v.toISOString()))),
41
49
  }),
@@ -25,12 +25,21 @@ import {
25
25
  ProrationBehavior$outboundSchema,
26
26
  } from "./proration-behavior.js";
27
27
  import { ScheduleType, ScheduleType$outboundSchema } from "./schedule-type.js";
28
+ import {
29
+ SubscriptionCouponInput,
30
+ SubscriptionCouponInput$Outbound,
31
+ SubscriptionCouponInput$outboundSchema,
32
+ } from "./subscription-coupon-input.js";
28
33
 
29
34
  export type AddAddonRequest = {
30
35
  addonId: string;
31
36
  cadence?: AddonCadence | undefined;
32
37
  changeAt?: ScheduleType | undefined;
33
38
  checkout?: CheckoutParams | undefined;
39
+ /**
40
+ * Coupons apply to this addon's line items; price_id targets one price, omitted targets all.
41
+ */
42
+ coupons?: Array<SubscriptionCouponInput> | undefined;
34
43
  /**
35
44
  * LineItemCommitments allows setting commitment configuration per addon line item (keyed by price_id)
36
45
  */
@@ -51,6 +60,7 @@ export type AddAddonRequest$Outbound = {
51
60
  cadence?: string | undefined;
52
61
  change_at?: string | undefined;
53
62
  checkout?: CheckoutParams$Outbound | undefined;
63
+ coupons?: Array<SubscriptionCouponInput$Outbound> | undefined;
54
64
  line_item_commitments?:
55
65
  | { [k: string]: LineItemCommitmentConfig$Outbound }
56
66
  | undefined;
@@ -71,6 +81,7 @@ export const AddAddonRequest$outboundSchema: z.ZodMiniType<
71
81
  cadence: z.optional(AddonCadence$outboundSchema),
72
82
  changeAt: z.optional(ScheduleType$outboundSchema),
73
83
  checkout: z.optional(CheckoutParams$outboundSchema),
84
+ coupons: z.optional(z.array(SubscriptionCouponInput$outboundSchema)),
74
85
  lineItemCommitments: z.optional(
75
86
  z.record(z.string(), LineItemCommitmentConfig$outboundSchema),
76
87
  ),
@@ -20,11 +20,20 @@ import {
20
20
  ProrationBehavior$outboundSchema,
21
21
  } from "./proration-behavior.js";
22
22
  import { ScheduleType, ScheduleType$outboundSchema } from "./schedule-type.js";
23
+ import {
24
+ SubscriptionCouponInput,
25
+ SubscriptionCouponInput$Outbound,
26
+ SubscriptionCouponInput$outboundSchema,
27
+ } from "./subscription-coupon-input.js";
23
28
 
24
29
  export type AddAddonToSubscriptionRequest = {
25
30
  addonId: string;
26
31
  cadence?: AddonCadence | undefined;
27
32
  changeAt?: ScheduleType | undefined;
33
+ /**
34
+ * Coupons apply to this addon's line items; price_id targets one price, omitted targets all.
35
+ */
36
+ coupons?: Array<SubscriptionCouponInput> | undefined;
28
37
  /**
29
38
  * LineItemCommitments allows setting commitment configuration per addon line item (keyed by price_id)
30
39
  */
@@ -43,6 +52,7 @@ export type AddAddonToSubscriptionRequest$Outbound = {
43
52
  addon_id: string;
44
53
  cadence?: string | undefined;
45
54
  change_at?: string | undefined;
55
+ coupons?: Array<SubscriptionCouponInput$Outbound> | undefined;
46
56
  line_item_commitments?:
47
57
  | { [k: string]: LineItemCommitmentConfig$Outbound }
48
58
  | undefined;
@@ -61,6 +71,7 @@ export const AddAddonToSubscriptionRequest$outboundSchema: z.ZodMiniType<
61
71
  addonId: z.string(),
62
72
  cadence: z.optional(AddonCadence$outboundSchema),
63
73
  changeAt: z.optional(ScheduleType$outboundSchema),
74
+ coupons: z.optional(z.array(SubscriptionCouponInput$outboundSchema)),
64
75
  lineItemCommitments: z.optional(
65
76
  z.record(z.string(), LineItemCommitmentConfig$outboundSchema),
66
77
  ),
@@ -0,0 +1,50 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import * as z from "zod/v4-mini";
6
+ import { remap as remap$ } from "../../lib/primitives.js";
7
+
8
+ export type CouponRef = {
9
+ associationId?: string | undefined;
10
+ couponId?: string | undefined;
11
+ endDate?: Date | undefined;
12
+ priceId?: string | undefined;
13
+ startDate?: Date | undefined;
14
+ };
15
+
16
+ /** @internal */
17
+ export type CouponRef$Outbound = {
18
+ association_id?: string | undefined;
19
+ coupon_id?: string | undefined;
20
+ end_date?: string | undefined;
21
+ price_id?: string | undefined;
22
+ start_date?: string | undefined;
23
+ };
24
+
25
+ /** @internal */
26
+ export const CouponRef$outboundSchema: z.ZodMiniType<
27
+ CouponRef$Outbound,
28
+ CouponRef
29
+ > = z.pipe(
30
+ z.object({
31
+ associationId: z.optional(z.string()),
32
+ couponId: z.optional(z.string()),
33
+ endDate: z.optional(z.pipe(z.date(), z.transform(v => v.toISOString()))),
34
+ priceId: z.optional(z.string()),
35
+ startDate: z.optional(z.pipe(z.date(), z.transform(v => v.toISOString()))),
36
+ }),
37
+ z.transform((v) => {
38
+ return remap$(v, {
39
+ associationId: "association_id",
40
+ couponId: "coupon_id",
41
+ endDate: "end_date",
42
+ priceId: "price_id",
43
+ startDate: "start_date",
44
+ });
45
+ }),
46
+ );
47
+
48
+ export function couponRefToJSON(couponRef: CouponRef): string {
49
+ return JSON.stringify(CouponRef$outboundSchema.parse(couponRef));
50
+ }
@@ -24,6 +24,10 @@ import {
24
24
  CreditGrantScope,
25
25
  CreditGrantScope$outboundSchema,
26
26
  } from "./credit-grant-scope.js";
27
+ import {
28
+ ProrationBehavior,
29
+ ProrationBehavior$outboundSchema,
30
+ } from "./proration-behavior.js";
27
31
 
28
32
  export type CreateCreditGrantRequest = {
29
33
  addonId?: string | undefined;
@@ -48,6 +52,7 @@ export type CreateCreditGrantRequest = {
48
52
  periodCount?: number | undefined;
49
53
  planId?: string | undefined;
50
54
  priority?: number | undefined;
55
+ prorationBehavior?: ProrationBehavior | undefined;
51
56
  scope: CreditGrantScope;
52
57
  startDate?: Date | undefined;
53
58
  subscriptionId?: string | undefined;
@@ -78,6 +83,7 @@ export type CreateCreditGrantRequest$Outbound = {
78
83
  period_count?: number | undefined;
79
84
  plan_id?: string | undefined;
80
85
  priority?: number | undefined;
86
+ proration_behavior?: string | undefined;
81
87
  scope: string;
82
88
  start_date?: string | undefined;
83
89
  subscription_id?: string | undefined;
@@ -106,6 +112,7 @@ export const CreateCreditGrantRequest$outboundSchema: z.ZodMiniType<
106
112
  periodCount: z.optional(z.int()),
107
113
  planId: z.optional(z.string()),
108
114
  priority: z.optional(z.int()),
115
+ prorationBehavior: z.optional(ProrationBehavior$outboundSchema),
109
116
  scope: CreditGrantScope$outboundSchema,
110
117
  startDate: z.optional(z.pipe(z.date(), z.transform(v => v.toISOString()))),
111
118
  subscriptionId: z.optional(z.string()),
@@ -121,6 +128,7 @@ export const CreateCreditGrantRequest$outboundSchema: z.ZodMiniType<
121
128
  expirationType: "expiration_type",
122
129
  periodCount: "period_count",
123
130
  planId: "plan_id",
131
+ prorationBehavior: "proration_behavior",
124
132
  startDate: "start_date",
125
133
  subscriptionId: "subscription_id",
126
134
  topupConversionRate: "topup_conversion_rate",
@@ -9,6 +9,11 @@ import {
9
9
  CreateEntityIntegrationMappingRequest$Outbound,
10
10
  CreateEntityIntegrationMappingRequest$outboundSchema,
11
11
  } from "./create-entity-integration-mapping-request.js";
12
+ import {
13
+ CustomerContactPerson,
14
+ CustomerContactPerson$Outbound,
15
+ CustomerContactPerson$outboundSchema,
16
+ } from "./customer-contact-person.js";
12
17
  import {
13
18
  TaxRateOverride,
14
19
  TaxRateOverride$Outbound,
@@ -52,6 +57,10 @@ export type CreateCustomerRequest = {
52
57
  * contact is an optional contact number for the customer (e.g. phone)
53
58
  */
54
59
  contact?: string | undefined;
60
+ /**
61
+ * contact_persons are people at the customer; at most one may be primary
62
+ */
63
+ contactPersons: Array<CustomerContactPerson>;
55
64
  /**
56
65
  * email is the customer's email address and must be a valid email format if provided
57
66
  */
@@ -110,6 +119,7 @@ export type CreateCustomerRequest$Outbound = {
110
119
  address_state?: string | undefined;
111
120
  billing_currency?: string | undefined;
112
121
  contact?: string | undefined;
122
+ contact_persons: Array<CustomerContactPerson$Outbound>;
113
123
  email?: string | undefined;
114
124
  external_id: string;
115
125
  integration_entity_mapping?:
@@ -138,6 +148,7 @@ export const CreateCustomerRequest$outboundSchema: z.ZodMiniType<
138
148
  addressState: z.optional(z.string()),
139
149
  billingCurrency: z.optional(z.string()),
140
150
  contact: z.optional(z.string()),
151
+ contactPersons: z.array(CustomerContactPerson$outboundSchema),
141
152
  email: z.optional(z.string()),
142
153
  externalId: z.string(),
143
154
  integrationEntityMapping: z.optional(
@@ -160,6 +171,7 @@ export const CreateCustomerRequest$outboundSchema: z.ZodMiniType<
160
171
  addressPostalCode: "address_postal_code",
161
172
  addressState: "address_state",
162
173
  billingCurrency: "billing_currency",
174
+ contactPersons: "contact_persons",
163
175
  externalId: "external_id",
164
176
  integrationEntityMapping: "integration_entity_mapping",
165
177
  onboardingWorkflowName: "onboarding_workflow_name",
@@ -0,0 +1,101 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import * as z from "zod/v4-mini";
6
+ import { remap as remap$ } from "../../lib/primitives.js";
7
+ import { safeParse } from "../../lib/schemas.js";
8
+ import { Result as SafeParseResult } from "../../types/fp.js";
9
+ import * as types from "../../types/primitives.js";
10
+ import { SDKValidationError } from "./sdk-validation-error.js";
11
+
12
+ export type CustomerContactPerson = {
13
+ department?: string | undefined;
14
+ designation?: string | undefined;
15
+ email?: string | undefined;
16
+ firstName: string;
17
+ id?: string | undefined;
18
+ isPrimary?: boolean | undefined;
19
+ lastName?: string | undefined;
20
+ mobile?: string | undefined;
21
+ salutation?: string | undefined;
22
+ };
23
+
24
+ /** @internal */
25
+ export const CustomerContactPerson$inboundSchema: z.ZodMiniType<
26
+ CustomerContactPerson,
27
+ unknown
28
+ > = z.pipe(
29
+ z.object({
30
+ department: types.optional(types.string()),
31
+ designation: types.optional(types.string()),
32
+ email: types.optional(types.string()),
33
+ first_name: types.string(),
34
+ id: types.optional(types.string()),
35
+ is_primary: types.optional(types.boolean()),
36
+ last_name: types.optional(types.string()),
37
+ mobile: types.optional(types.string()),
38
+ salutation: types.optional(types.string()),
39
+ }),
40
+ z.transform((v) => {
41
+ return remap$(v, {
42
+ "first_name": "firstName",
43
+ "is_primary": "isPrimary",
44
+ "last_name": "lastName",
45
+ });
46
+ }),
47
+ );
48
+ /** @internal */
49
+ export type CustomerContactPerson$Outbound = {
50
+ department?: string | undefined;
51
+ designation?: string | undefined;
52
+ email?: string | undefined;
53
+ first_name: string;
54
+ id?: string | undefined;
55
+ is_primary?: boolean | undefined;
56
+ last_name?: string | undefined;
57
+ mobile?: string | undefined;
58
+ salutation?: string | undefined;
59
+ };
60
+
61
+ /** @internal */
62
+ export const CustomerContactPerson$outboundSchema: z.ZodMiniType<
63
+ CustomerContactPerson$Outbound,
64
+ CustomerContactPerson
65
+ > = z.pipe(
66
+ z.object({
67
+ department: z.optional(z.string()),
68
+ designation: z.optional(z.string()),
69
+ email: z.optional(z.string()),
70
+ firstName: z.string(),
71
+ id: z.optional(z.string()),
72
+ isPrimary: z.optional(z.boolean()),
73
+ lastName: z.optional(z.string()),
74
+ mobile: z.optional(z.string()),
75
+ salutation: z.optional(z.string()),
76
+ }),
77
+ z.transform((v) => {
78
+ return remap$(v, {
79
+ firstName: "first_name",
80
+ isPrimary: "is_primary",
81
+ lastName: "last_name",
82
+ });
83
+ }),
84
+ );
85
+
86
+ export function customerContactPersonToJSON(
87
+ customerContactPerson: CustomerContactPerson,
88
+ ): string {
89
+ return JSON.stringify(
90
+ CustomerContactPerson$outboundSchema.parse(customerContactPerson),
91
+ );
92
+ }
93
+ export function customerContactPersonFromJSON(
94
+ jsonString: string,
95
+ ): SafeParseResult<CustomerContactPerson, SDKValidationError> {
96
+ return safeParse(
97
+ jsonString,
98
+ (x) => CustomerContactPerson$inboundSchema.parse(JSON.parse(x)),
99
+ `Failed to parse 'CustomerContactPerson' from JSON`,
100
+ );
101
+ }
@@ -7,6 +7,10 @@ import { remap as remap$ } from "../../lib/primitives.js";
7
7
  import { safeParse } from "../../lib/schemas.js";
8
8
  import { Result as SafeParseResult } from "../../types/fp.js";
9
9
  import * as types from "../../types/primitives.js";
10
+ import {
11
+ CustomerContactPerson,
12
+ CustomerContactPerson$inboundSchema,
13
+ } from "./customer-contact-person.js";
10
14
  import {
11
15
  EntityIntegrationMappingResponse,
12
16
  EntityIntegrationMappingResponse$inboundSchema,
@@ -51,6 +55,7 @@ export type CustomerResponse = {
51
55
  * Contact is an optional contact number for the customer (e.g. phone)
52
56
  */
53
57
  contact?: string | undefined;
58
+ contactPersons?: Array<CustomerContactPerson> | undefined;
54
59
  createdAt?: Date | undefined;
55
60
  createdBy?: string | undefined;
56
61
  /**
@@ -106,6 +111,9 @@ export const CustomerResponse$inboundSchema: z.ZodMiniType<
106
111
  address_state: types.optional(types.string()),
107
112
  billing_currency: types.optional(types.string()),
108
113
  contact: types.optional(types.string()),
114
+ contact_persons: types.optional(
115
+ z.array(CustomerContactPerson$inboundSchema),
116
+ ),
109
117
  created_at: types.optional(types.date()),
110
118
  created_by: types.optional(types.string()),
111
119
  email: types.optional(types.string()),
@@ -133,6 +141,7 @@ export const CustomerResponse$inboundSchema: z.ZodMiniType<
133
141
  "address_postal_code": "addressPostalCode",
134
142
  "address_state": "addressState",
135
143
  "billing_currency": "billingCurrency",
144
+ "contact_persons": "contactPersons",
136
145
  "created_at": "createdAt",
137
146
  "created_by": "createdBy",
138
147
  "environment_id": "environmentId",
@@ -7,6 +7,10 @@ import { remap as remap$ } from "../../lib/primitives.js";
7
7
  import { safeParse } from "../../lib/schemas.js";
8
8
  import { Result as SafeParseResult } from "../../types/fp.js";
9
9
  import * as types from "../../types/primitives.js";
10
+ import {
11
+ CustomerContactPerson,
12
+ CustomerContactPerson$inboundSchema,
13
+ } from "./customer-contact-person.js";
10
14
  import { SDKValidationError } from "./sdk-validation-error.js";
11
15
  import { Status, Status$inboundSchema } from "./status.js";
12
16
  import { TaxTreatment, TaxTreatment$inboundSchema } from "./tax-treatment.js";
@@ -44,6 +48,7 @@ export type Customer = {
44
48
  * Contact is an optional contact number for the customer (e.g. phone)
45
49
  */
46
50
  contact?: string | undefined;
51
+ contactPersons?: Array<CustomerContactPerson> | undefined;
47
52
  createdAt?: Date | undefined;
48
53
  createdBy?: string | undefined;
49
54
  /**
@@ -95,6 +100,9 @@ export const Customer$inboundSchema: z.ZodMiniType<Customer, unknown> = z.pipe(
95
100
  address_state: types.optional(types.string()),
96
101
  billing_currency: types.optional(types.string()),
97
102
  contact: types.optional(types.string()),
103
+ contact_persons: types.optional(
104
+ z.array(CustomerContactPerson$inboundSchema),
105
+ ),
98
106
  created_at: types.optional(types.date()),
99
107
  created_by: types.optional(types.string()),
100
108
  email: types.optional(types.string()),
@@ -119,6 +127,7 @@ export const Customer$inboundSchema: z.ZodMiniType<Customer, unknown> = z.pipe(
119
127
  "address_postal_code": "addressPostalCode",
120
128
  "address_state": "addressState",
121
129
  "billing_currency": "billingCurrency",
130
+ "contact_persons": "contactPersons",
122
131
  "created_at": "createdAt",
123
132
  "created_by": "createdBy",
124
133
  "environment_id": "environmentId",
@@ -0,0 +1,113 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import * as z from "zod/v4-mini";
6
+ import { remap as remap$ } from "../../lib/primitives.js";
7
+ import { safeParse } from "../../lib/schemas.js";
8
+ import { Result as SafeParseResult } from "../../types/fp.js";
9
+ import * as types from "../../types/primitives.js";
10
+ import { SDKValidationError } from "./sdk-validation-error.js";
11
+ import {
12
+ TaxJurisdiction,
13
+ TaxJurisdiction$inboundSchema,
14
+ } from "./tax-jurisdiction.js";
15
+ import { TaxReversal, TaxReversal$inboundSchema } from "./tax-reversal.js";
16
+
17
+ export type ExternalTaxDetails = {
18
+ /**
19
+ * CalculationExpiresAt is when the calculation can no longer be filed, RFC3339.
20
+ */
21
+ calculationExpiresAt?: Date | undefined;
22
+ /**
23
+ * CalculationID is the provider calculation this row was written from. Commit files it.
24
+ */
25
+ calculationId?: string | undefined;
26
+ /**
27
+ * DisplayName is the engine's own name for the tax, such as
28
+ *
29
+ * @remarks
30
+ * "Integrated goods and services tax (IGST)".
31
+ */
32
+ displayName?: string | undefined;
33
+ jurisdiction?: TaxJurisdiction | undefined;
34
+ /**
35
+ * Percentage is the resolved rate, such as "18.0". This is what was charged, not the
36
+ *
37
+ * @remarks
38
+ * rate that would apply if the tax were imposed.
39
+ */
40
+ percentage?: string | undefined;
41
+ /**
42
+ * Reference is what this row's provider transaction was filed under. It is unique across
43
+ *
44
+ * @remarks
45
+ * every transaction on the account, so it is also the only way back to a transaction whose
46
+ * id failed to land here.
47
+ */
48
+ reference?: string | undefined;
49
+ reversal?: TaxReversal | undefined;
50
+ /**
51
+ * Sourcing is whether the jurisdiction followed the seller's address or the buyer's.
52
+ */
53
+ sourcing?: string | undefined;
54
+ /**
55
+ * TaxCode is the product tax category the engine priced against, such as txcd_10000000.
56
+ *
57
+ * @remarks
58
+ * It belongs to the line rather than the rate, so today every row on an invoice carries
59
+ * the account default. It only varies once tax is calculated per line item.
60
+ */
61
+ taxCode?: string | undefined;
62
+ /**
63
+ * TaxType is the tax family, such as vat, igst or sales_tax.
64
+ */
65
+ taxType?: string | undefined;
66
+ /**
67
+ * TaxabilityReason is why the engine charged what it did, such as standard_rated or
68
+ *
69
+ * @remarks
70
+ * reverse_charge. Recorded, not yet rendered.
71
+ */
72
+ taxabilityReason?: string | undefined;
73
+ };
74
+
75
+ /** @internal */
76
+ export const ExternalTaxDetails$inboundSchema: z.ZodMiniType<
77
+ ExternalTaxDetails,
78
+ unknown
79
+ > = z.pipe(
80
+ z.object({
81
+ calculation_expires_at: types.optional(types.date()),
82
+ calculation_id: types.optional(types.string()),
83
+ display_name: types.optional(types.string()),
84
+ jurisdiction: types.optional(TaxJurisdiction$inboundSchema),
85
+ percentage: types.optional(types.string()),
86
+ reference: types.optional(types.string()),
87
+ reversal: types.optional(TaxReversal$inboundSchema),
88
+ sourcing: types.optional(types.string()),
89
+ tax_code: types.optional(types.string()),
90
+ tax_type: types.optional(types.string()),
91
+ taxability_reason: types.optional(types.string()),
92
+ }),
93
+ z.transform((v) => {
94
+ return remap$(v, {
95
+ "calculation_expires_at": "calculationExpiresAt",
96
+ "calculation_id": "calculationId",
97
+ "display_name": "displayName",
98
+ "tax_code": "taxCode",
99
+ "tax_type": "taxType",
100
+ "taxability_reason": "taxabilityReason",
101
+ });
102
+ }),
103
+ );
104
+
105
+ export function externalTaxDetailsFromJSON(
106
+ jsonString: string,
107
+ ): SafeParseResult<ExternalTaxDetails, SDKValidationError> {
108
+ return safeParse(
109
+ jsonString,
110
+ (x) => ExternalTaxDetails$inboundSchema.parse(JSON.parse(x)),
111
+ `Failed to parse 'ExternalTaxDetails' from JSON`,
112
+ );
113
+ }
@@ -110,6 +110,7 @@ export * from "./coupon-application-response.js";
110
110
  export * from "./coupon-association-response.js";
111
111
  export * from "./coupon-cadence.js";
112
112
  export * from "./coupon-filter.js";
113
+ export * from "./coupon-ref.js";
113
114
  export * from "./coupon-response.js";
114
115
  export * from "./coupon-type.js";
115
116
  export * from "./create-addon-request.js";
@@ -172,6 +173,7 @@ export * from "./creditnote-credit-note-line-item.js";
172
173
  export * from "./custom-analytic-item.js";
173
174
  export * from "./custom-currency-line-item.js";
174
175
  export * from "./custom-currency.js";
176
+ export * from "./customer-contact-person.js";
175
177
  export * from "./customer-entitlements-response.js";
176
178
  export * from "./customer-filter.js";
177
179
  export * from "./customer-invoice-summary.js";
@@ -247,6 +249,7 @@ export * from "./execute-subscription-plan-change-v2-op.js";
247
249
  export * from "./execution-details.js";
248
250
  export * from "./export-metadata-entity-type.js";
249
251
  export * from "./export-metadata-field.js";
252
+ export * from "./external-tax-details.js";
250
253
  export * from "./fact-status.js";
251
254
  export * from "./failure-point-type.js";
252
255
  export * from "./failure-point.js";
@@ -605,13 +608,18 @@ export * from "./tax-association-update-request.js";
605
608
  export * from "./tax-behavior.js";
606
609
  export * from "./tax-exemption-reason-code.js";
607
610
  export * from "./tax-exemption-summary.js";
611
+ export * from "./tax-jurisdiction.js";
612
+ export * from "./tax-provider.js";
608
613
  export * from "./tax-rate-entity-type.js";
609
614
  export * from "./tax-rate-override.js";
610
615
  export * from "./tax-rate-response.js";
611
616
  export * from "./tax-rate-scope.js";
612
617
  export * from "./tax-rate-status.js";
613
618
  export * from "./tax-rate-type.js";
619
+ export * from "./tax-reversal-mode.js";
620
+ export * from "./tax-reversal.js";
614
621
  export * from "./tax-summary.js";
622
+ export * from "./tax-transaction-type.js";
615
623
  export * from "./tax-treatment.js";
616
624
  export * from "./tenant-billing-details.js";
617
625
  export * from "./tenant-billing-usage.js";
@@ -619,6 +627,7 @@ export * from "./tenant-response.js";
619
627
  export * from "./terminate-wallet-op.js";
620
628
  export * from "./time-of-day-bucket.js";
621
629
  export * from "./time-range-filter.js";
630
+ export * from "./top-up-coupon.js";
622
631
  export * from "./top-up-wallet-op.js";
623
632
  export * from "./top-up-wallet-request.js";
624
633
  export * from "./top-up-wallet-response.js";
@@ -711,7 +720,9 @@ export * from "./wallet-status.js";
711
720
  export * from "./wallet-topup-params.js";
712
721
  export * from "./wallet-transaction-filter.js";
713
722
  export * from "./wallet-transaction-response.js";
723
+ export * from "./wallet-tx-consumption.js";
714
724
  export * from "./wallet-tx-reference-type.js";
725
+ export * from "./wallet-tx-source-type.js";
715
726
  export * from "./wallet-type.js";
716
727
  export * from "./webhook-dto-alert-webhook-payload.js";
717
728
  export * from "./webhook-dto-checkout-session-webhook-payload.js";
@@ -4,12 +4,21 @@
4
4
 
5
5
  import * as z from "zod/v4-mini";
6
6
  import { remap as remap$ } from "../../lib/primitives.js";
7
+ import {
8
+ SubscriptionCouponInput,
9
+ SubscriptionCouponInput$Outbound,
10
+ SubscriptionCouponInput$outboundSchema,
11
+ } from "./subscription-coupon-input.js";
7
12
 
8
13
  export type LineItemChange = {
9
14
  /**
10
15
  * Amount reprices the charge. Flat fee only for now.
11
16
  */
12
17
  amount?: string | undefined;
18
+ /**
19
+ * Coupons apply to the new line item created by this change.
20
+ */
21
+ coupons?: Array<SubscriptionCouponInput> | undefined;
13
22
  effectiveDate?: Date | undefined;
14
23
  id: string;
15
24
  quantity?: string | undefined;
@@ -18,6 +27,7 @@ export type LineItemChange = {
18
27
  /** @internal */
19
28
  export type LineItemChange$Outbound = {
20
29
  amount?: string | undefined;
30
+ coupons?: Array<SubscriptionCouponInput$Outbound> | undefined;
21
31
  effective_date?: string | undefined;
22
32
  id: string;
23
33
  quantity?: string | undefined;
@@ -30,6 +40,7 @@ export const LineItemChange$outboundSchema: z.ZodMiniType<
30
40
  > = z.pipe(
31
41
  z.object({
32
42
  amount: z.optional(z.string()),
43
+ coupons: z.optional(z.array(SubscriptionCouponInput$outboundSchema)),
33
44
  effectiveDate: z.optional(
34
45
  z.pipe(z.date(), z.transform(v => v.toISOString())),
35
46
  ),
@@ -4,9 +4,15 @@
4
4
 
5
5
  import * as z from "zod/v4-mini";
6
6
  import { remap as remap$ } from "../../lib/primitives.js";
7
+ import {
8
+ CouponRef,
9
+ CouponRef$Outbound,
10
+ CouponRef$outboundSchema,
11
+ } from "./coupon-ref.js";
7
12
 
8
13
  export type ModifySubscriptionLineItem = {
9
14
  amount?: string | undefined;
15
+ coupons?: Array<CouponRef> | undefined;
10
16
  effectiveDate?: Date | undefined;
11
17
  lineItemId?: string | undefined;
12
18
  quantity?: string | undefined;
@@ -15,6 +21,7 @@ export type ModifySubscriptionLineItem = {
15
21
  /** @internal */
16
22
  export type ModifySubscriptionLineItem$Outbound = {
17
23
  amount?: string | undefined;
24
+ coupons?: Array<CouponRef$Outbound> | undefined;
18
25
  effective_date?: string | undefined;
19
26
  line_item_id?: string | undefined;
20
27
  quantity?: string | undefined;
@@ -27,6 +34,7 @@ export const ModifySubscriptionLineItem$outboundSchema: z.ZodMiniType<
27
34
  > = z.pipe(
28
35
  z.object({
29
36
  amount: z.optional(z.string()),
37
+ coupons: z.optional(z.array(CouponRef$outboundSchema)),
30
38
  effectiveDate: z.optional(
31
39
  z.pipe(z.date(), z.transform(v => v.toISOString())),
32
40
  ),
@@ -10,6 +10,7 @@ export const ScheduledTaskEntityType = {
10
10
  Events: "events",
11
11
  Invoice: "invoice",
12
12
  CreditTopups: "credit_topups",
13
+ WalletDebits: "wallet_debits",
13
14
  CreditUsage: "credit_usage",
14
15
  UsageAnalytics: "usage_analytics",
15
16
  RevenueFacts: "revenue_facts",