@flexprice/sdk 2.1.48 → 2.1.49-dev.10

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 (212) hide show
  1. package/docs/sdk/models/billing-address.md +20 -0
  2. package/docs/sdk/models/billing-details.md +18 -0
  3. package/docs/sdk/models/billing-entity-mode-response.md +15 -0
  4. package/docs/sdk/models/billing-entity-mode.md +17 -0
  5. package/docs/sdk/models/billing-entity-response.md +27 -0
  6. package/docs/sdk/models/billingterm-instalment.md +1 -0
  7. package/docs/sdk/models/create-billing-entity-request.md +21 -0
  8. package/docs/sdk/models/create-customer-request.md +1 -0
  9. package/docs/sdk/models/customer-filter.md +1 -0
  10. package/docs/sdk/models/customer-response.md +1 -0
  11. package/docs/sdk/models/customer.md +1 -0
  12. package/docs/sdk/models/get-billing-entity-request.md +17 -0
  13. package/docs/sdk/models/get-usage-analytics-request.md +1 -1
  14. package/docs/sdk/models/get-usage-analytics-response.md +10 -8
  15. package/docs/sdk/models/invoice-billing-entity.md +17 -0
  16. package/docs/sdk/models/invoice-filter.md +1 -0
  17. package/docs/sdk/models/invoice-response.md +2 -0
  18. package/docs/sdk/models/list-billing-entities-order.md +15 -0
  19. package/docs/sdk/models/list-billing-entities-request.md +22 -0
  20. package/docs/sdk/models/list-billing-entities-response.md +16 -0
  21. package/docs/sdk/models/list-billing-entities-status.md +15 -0
  22. package/docs/sdk/models/tax-rate-entity-type.md +2 -2
  23. package/docs/sdk/models/update-billing-entity-request-request.md +19 -0
  24. package/docs/sdk/models/update-billing-entity-request.md +18 -0
  25. package/docs/sdk/models/update-customer-request.md +1 -0
  26. package/docs/sdk/models/usage-analytic-instalment.md +24 -0
  27. package/docs/sdk/models/webhook-dto-customer.md +1 -0
  28. package/docs/sdk/models/webhook-dto-invoice.md +1 -0
  29. package/docs/sdks/billingentities/README.md +442 -0
  30. package/docs/sdks/subscriptions/README.md +1 -1
  31. package/esm/funcs/billing-entities-create-billing-entity.d.ts +17 -0
  32. package/esm/funcs/billing-entities-create-billing-entity.d.ts.map +1 -0
  33. package/esm/funcs/billing-entities-create-billing-entity.js +83 -0
  34. package/esm/funcs/billing-entities-create-billing-entity.js.map +1 -0
  35. package/esm/funcs/billing-entities-enable-billing-entities.d.ts +17 -0
  36. package/esm/funcs/billing-entities-enable-billing-entities.d.ts.map +1 -0
  37. package/esm/funcs/billing-entities-enable-billing-entities.js +72 -0
  38. package/esm/funcs/billing-entities-enable-billing-entities.js.map +1 -0
  39. package/esm/funcs/billing-entities-get-billing-entities-status.d.ts +17 -0
  40. package/esm/funcs/billing-entities-get-billing-entities-status.d.ts.map +1 -0
  41. package/esm/funcs/billing-entities-get-billing-entities-status.js +72 -0
  42. package/esm/funcs/billing-entities-get-billing-entities-status.js.map +1 -0
  43. package/esm/funcs/billing-entities-get-billing-entity.d.ts +17 -0
  44. package/esm/funcs/billing-entities-get-billing-entity.d.ts.map +1 -0
  45. package/esm/funcs/billing-entities-get-billing-entity.js +91 -0
  46. package/esm/funcs/billing-entities-get-billing-entity.js.map +1 -0
  47. package/esm/funcs/billing-entities-list-billing-entities.d.ts +17 -0
  48. package/esm/funcs/billing-entities-list-billing-entities.d.ts.map +1 -0
  49. package/esm/funcs/billing-entities-list-billing-entities.js +94 -0
  50. package/esm/funcs/billing-entities-list-billing-entities.js.map +1 -0
  51. package/esm/funcs/billing-entities-update-billing-entity.d.ts +17 -0
  52. package/esm/funcs/billing-entities-update-billing-entity.d.ts.map +1 -0
  53. package/esm/funcs/billing-entities-update-billing-entity.js +93 -0
  54. package/esm/funcs/billing-entities-update-billing-entity.js.map +1 -0
  55. package/esm/funcs/subscriptions-cancel-subscription.js +1 -1
  56. package/esm/funcs/subscriptions-cancel-subscription.js.map +1 -1
  57. package/esm/lib/config.d.ts +2 -2
  58. package/esm/lib/config.d.ts.map +1 -1
  59. package/esm/lib/config.js +2 -2
  60. package/esm/lib/config.js.map +1 -1
  61. package/esm/sdk/billing-entities.d.ts +47 -0
  62. package/esm/sdk/billing-entities.d.ts.map +1 -0
  63. package/esm/sdk/billing-entities.js +68 -0
  64. package/esm/sdk/billing-entities.js.map +1 -0
  65. package/esm/sdk/models/billing-address.d.ts +27 -0
  66. package/esm/sdk/models/billing-address.d.ts.map +1 -0
  67. package/esm/sdk/models/billing-address.js +50 -0
  68. package/esm/sdk/models/billing-address.js.map +1 -0
  69. package/esm/sdk/models/billing-details.d.ts +24 -0
  70. package/esm/sdk/models/billing-details.d.ts.map +1 -0
  71. package/esm/sdk/models/billing-details.js +37 -0
  72. package/esm/sdk/models/billing-details.js.map +1 -0
  73. package/esm/sdk/models/billing-entity-mode-response.d.ts +11 -0
  74. package/esm/sdk/models/billing-entity-mode-response.d.ts.map +1 -0
  75. package/esm/sdk/models/billing-entity-mode-response.js +15 -0
  76. package/esm/sdk/models/billing-entity-mode-response.js.map +1 -0
  77. package/esm/sdk/models/billing-entity-mode.d.ts +11 -0
  78. package/esm/sdk/models/billing-entity-mode.d.ts.map +1 -0
  79. package/esm/sdk/models/billing-entity-mode.js +12 -0
  80. package/esm/sdk/models/billing-entity-mode.js.map +1 -0
  81. package/esm/sdk/models/billing-entity-response.d.ts +26 -0
  82. package/esm/sdk/models/billing-entity-response.d.ts.map +1 -0
  83. package/esm/sdk/models/billing-entity-response.js +41 -0
  84. package/esm/sdk/models/billing-entity-response.js.map +1 -0
  85. package/esm/sdk/models/billingterm-instalment.d.ts +4 -0
  86. package/esm/sdk/models/billingterm-instalment.d.ts.map +1 -1
  87. package/esm/sdk/models/billingterm-instalment.js +2 -0
  88. package/esm/sdk/models/billingterm-instalment.js.map +1 -1
  89. package/esm/sdk/models/create-billing-entity-request.d.ts +23 -0
  90. package/esm/sdk/models/create-billing-entity-request.d.ts.map +1 -0
  91. package/esm/sdk/models/create-billing-entity-request.js +22 -0
  92. package/esm/sdk/models/create-billing-entity-request.js.map +1 -0
  93. package/esm/sdk/models/create-customer-request.d.ts +8 -0
  94. package/esm/sdk/models/create-customer-request.d.ts.map +1 -1
  95. package/esm/sdk/models/create-customer-request.js +2 -0
  96. package/esm/sdk/models/create-customer-request.js.map +1 -1
  97. package/esm/sdk/models/customer-filter.d.ts +5 -0
  98. package/esm/sdk/models/customer-filter.d.ts.map +1 -1
  99. package/esm/sdk/models/customer-filter.js +2 -0
  100. package/esm/sdk/models/customer-filter.js.map +1 -1
  101. package/esm/sdk/models/customer-response.d.ts +4 -0
  102. package/esm/sdk/models/customer-response.d.ts.map +1 -1
  103. package/esm/sdk/models/customer-response.js +2 -0
  104. package/esm/sdk/models/customer-response.js.map +1 -1
  105. package/esm/sdk/models/customer.d.ts +4 -0
  106. package/esm/sdk/models/customer.d.ts.map +1 -1
  107. package/esm/sdk/models/customer.js +2 -0
  108. package/esm/sdk/models/customer.js.map +1 -1
  109. package/esm/sdk/models/get-billing-entity-op.d.ts +15 -0
  110. package/esm/sdk/models/get-billing-entity-op.d.ts.map +1 -0
  111. package/esm/sdk/models/get-billing-entity-op.js +12 -0
  112. package/esm/sdk/models/get-billing-entity-op.js.map +1 -0
  113. package/esm/sdk/models/get-usage-analytics-request.d.ts +1 -1
  114. package/esm/sdk/models/get-usage-analytics-response.d.ts +12 -0
  115. package/esm/sdk/models/get-usage-analytics-response.d.ts.map +1 -1
  116. package/esm/sdk/models/get-usage-analytics-response.js +4 -0
  117. package/esm/sdk/models/get-usage-analytics-response.js.map +1 -1
  118. package/esm/sdk/models/index.d.ts +13 -0
  119. package/esm/sdk/models/index.d.ts.map +1 -1
  120. package/esm/sdk/models/index.js +13 -0
  121. package/esm/sdk/models/index.js.map +1 -1
  122. package/esm/sdk/models/invoice-billing-entity.d.ts +13 -0
  123. package/esm/sdk/models/invoice-billing-entity.d.ts.map +1 -0
  124. package/esm/sdk/models/invoice-billing-entity.js +23 -0
  125. package/esm/sdk/models/invoice-billing-entity.js.map +1 -0
  126. package/esm/sdk/models/invoice-filter.d.ts +5 -0
  127. package/esm/sdk/models/invoice-filter.d.ts.map +1 -1
  128. package/esm/sdk/models/invoice-filter.js +2 -0
  129. package/esm/sdk/models/invoice-filter.js.map +1 -1
  130. package/esm/sdk/models/invoice-response.d.ts +6 -0
  131. package/esm/sdk/models/invoice-response.d.ts.map +1 -1
  132. package/esm/sdk/models/invoice-response.js +5 -0
  133. package/esm/sdk/models/invoice-response.js.map +1 -1
  134. package/esm/sdk/models/list-billing-entities-op.d.ts +42 -0
  135. package/esm/sdk/models/list-billing-entities-op.d.ts.map +1 -0
  136. package/esm/sdk/models/list-billing-entities-op.js +38 -0
  137. package/esm/sdk/models/list-billing-entities-op.js.map +1 -0
  138. package/esm/sdk/models/list-billing-entities-response.d.ts +13 -0
  139. package/esm/sdk/models/list-billing-entities-response.d.ts.map +1 -0
  140. package/esm/sdk/models/list-billing-entities-response.js +17 -0
  141. package/esm/sdk/models/list-billing-entities-response.js.map +1 -0
  142. package/esm/sdk/models/tax-rate-entity-type.d.ts +1 -0
  143. package/esm/sdk/models/tax-rate-entity-type.d.ts.map +1 -1
  144. package/esm/sdk/models/tax-rate-entity-type.js +1 -0
  145. package/esm/sdk/models/tax-rate-entity-type.js.map +1 -1
  146. package/esm/sdk/models/update-billing-entity-op.d.ts +21 -0
  147. package/esm/sdk/models/update-billing-entity-op.d.ts.map +1 -0
  148. package/esm/sdk/models/update-billing-entity-op.js +14 -0
  149. package/esm/sdk/models/update-billing-entity-op.js.map +1 -0
  150. package/esm/sdk/models/update-billing-entity-request.d.ts +23 -0
  151. package/esm/sdk/models/update-billing-entity-request.d.ts.map +1 -0
  152. package/esm/sdk/models/update-billing-entity-request.js +22 -0
  153. package/esm/sdk/models/update-billing-entity-request.js.map +1 -0
  154. package/esm/sdk/models/update-customer-request.d.ts +5 -0
  155. package/esm/sdk/models/update-customer-request.d.ts.map +1 -1
  156. package/esm/sdk/models/update-customer-request.js +2 -0
  157. package/esm/sdk/models/update-customer-request.js.map +1 -1
  158. package/esm/sdk/models/usage-analytic-instalment.d.ts +22 -0
  159. package/esm/sdk/models/usage-analytic-instalment.d.ts.map +1 -0
  160. package/esm/sdk/models/usage-analytic-instalment.js +34 -0
  161. package/esm/sdk/models/usage-analytic-instalment.js.map +1 -0
  162. package/esm/sdk/models/webhook-dto-customer.d.ts +1 -0
  163. package/esm/sdk/models/webhook-dto-customer.d.ts.map +1 -1
  164. package/esm/sdk/models/webhook-dto-customer.js +2 -0
  165. package/esm/sdk/models/webhook-dto-customer.js.map +1 -1
  166. package/esm/sdk/models/webhook-dto-invoice.d.ts +1 -0
  167. package/esm/sdk/models/webhook-dto-invoice.d.ts.map +1 -1
  168. package/esm/sdk/models/webhook-dto-invoice.js +2 -0
  169. package/esm/sdk/models/webhook-dto-invoice.js.map +1 -1
  170. package/esm/sdk/sdk.d.ts +3 -0
  171. package/esm/sdk/sdk.d.ts.map +1 -1
  172. package/esm/sdk/sdk.js +5 -0
  173. package/esm/sdk/sdk.js.map +1 -1
  174. package/jsr.json +1 -1
  175. package/package.json +3 -3
  176. package/src/funcs/billing-entities-create-billing-entity.ts +172 -0
  177. package/src/funcs/billing-entities-enable-billing-entities.ts +153 -0
  178. package/src/funcs/billing-entities-get-billing-entities-status.ts +152 -0
  179. package/src/funcs/billing-entities-get-billing-entity.ts +181 -0
  180. package/src/funcs/billing-entities-list-billing-entities.ts +191 -0
  181. package/src/funcs/billing-entities-update-billing-entity.ts +187 -0
  182. package/src/funcs/subscriptions-cancel-subscription.ts +1 -1
  183. package/src/lib/config.ts +3 -2
  184. package/src/sdk/billing-entities.ts +115 -0
  185. package/src/sdk/models/billing-address.ts +91 -0
  186. package/src/sdk/models/billing-details.ts +79 -0
  187. package/src/sdk/models/billing-entity-mode-response.ts +35 -0
  188. package/src/sdk/models/billing-entity-mode.ts +20 -0
  189. package/src/sdk/models/billing-entity-response.ts +76 -0
  190. package/src/sdk/models/billingterm-instalment.ts +6 -0
  191. package/src/sdk/models/create-billing-entity-request.ts +53 -0
  192. package/src/sdk/models/create-customer-request.ts +10 -0
  193. package/src/sdk/models/customer-filter.ts +7 -0
  194. package/src/sdk/models/customer-response.ts +6 -0
  195. package/src/sdk/models/customer.ts +6 -0
  196. package/src/sdk/models/get-billing-entity-op.ts +33 -0
  197. package/src/sdk/models/get-usage-analytics-request.ts +1 -1
  198. package/src/sdk/models/get-usage-analytics-response.ts +18 -0
  199. package/src/sdk/models/index.ts +13 -0
  200. package/src/sdk/models/invoice-billing-entity.ts +48 -0
  201. package/src/sdk/models/invoice-filter.ts +7 -0
  202. package/src/sdk/models/invoice-response.ts +13 -0
  203. package/src/sdk/models/list-billing-entities-op.ts +88 -0
  204. package/src/sdk/models/list-billing-entities-response.ts +41 -0
  205. package/src/sdk/models/tax-rate-entity-type.ts +1 -0
  206. package/src/sdk/models/update-billing-entity-op.ts +46 -0
  207. package/src/sdk/models/update-billing-entity-request.ts +53 -0
  208. package/src/sdk/models/update-customer-request.ts +7 -0
  209. package/src/sdk/models/usage-analytic-instalment.ts +66 -0
  210. package/src/sdk/models/webhook-dto-customer.ts +3 -0
  211. package/src/sdk/models/webhook-dto-invoice.ts +3 -0
  212. package/src/sdk/sdk.ts +6 -0
@@ -0,0 +1,53 @@
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 {
8
+ BillingDetails,
9
+ BillingDetails$Outbound,
10
+ BillingDetails$outboundSchema,
11
+ } from "./billing-details.js";
12
+
13
+ export type CreateBillingEntityRequest = {
14
+ billingDetails?: BillingDetails | undefined;
15
+ invoiceNumberPrefix: string;
16
+ metadata?: { [k: string]: string } | undefined;
17
+ name: string;
18
+ };
19
+
20
+ /** @internal */
21
+ export type CreateBillingEntityRequest$Outbound = {
22
+ billing_details?: BillingDetails$Outbound | undefined;
23
+ invoice_number_prefix: string;
24
+ metadata?: { [k: string]: string } | undefined;
25
+ name: string;
26
+ };
27
+
28
+ /** @internal */
29
+ export const CreateBillingEntityRequest$outboundSchema: z.ZodMiniType<
30
+ CreateBillingEntityRequest$Outbound,
31
+ CreateBillingEntityRequest
32
+ > = z.pipe(
33
+ z.object({
34
+ billingDetails: z.optional(BillingDetails$outboundSchema),
35
+ invoiceNumberPrefix: z.string(),
36
+ metadata: z.optional(z.record(z.string(), z.string())),
37
+ name: z.string(),
38
+ }),
39
+ z.transform((v) => {
40
+ return remap$(v, {
41
+ billingDetails: "billing_details",
42
+ invoiceNumberPrefix: "invoice_number_prefix",
43
+ });
44
+ }),
45
+ );
46
+
47
+ export function createBillingEntityRequestToJSON(
48
+ createBillingEntityRequest: CreateBillingEntityRequest,
49
+ ): string {
50
+ return JSON.stringify(
51
+ CreateBillingEntityRequest$outboundSchema.parse(createBillingEntityRequest),
52
+ );
53
+ }
@@ -53,6 +53,13 @@ export type CreateCustomerRequest = {
53
53
  * billing_currency is the fiat currency invoices are issued in; empty means the charge currency is used as-is
54
54
  */
55
55
  billingCurrency?: string | undefined;
56
+ /**
57
+ * billing_entity_id is the billing entity that bills this customer; defaults to the environment's
58
+ *
59
+ * @remarks
60
+ * default entity. Accepted only once billing entities are enabled, and never changes afterwards.
61
+ */
62
+ billingEntityId?: string | undefined;
56
63
  /**
57
64
  * contact is an optional contact number for the customer (e.g. phone)
58
65
  */
@@ -118,6 +125,7 @@ export type CreateCustomerRequest$Outbound = {
118
125
  address_postal_code?: string | undefined;
119
126
  address_state?: string | undefined;
120
127
  billing_currency?: string | undefined;
128
+ billing_entity_id?: string | undefined;
121
129
  contact?: string | undefined;
122
130
  contact_persons?: Array<CustomerContactPerson$Outbound> | undefined;
123
131
  email?: string | undefined;
@@ -147,6 +155,7 @@ export const CreateCustomerRequest$outboundSchema: z.ZodMiniType<
147
155
  addressPostalCode: z.optional(z.string()),
148
156
  addressState: z.optional(z.string()),
149
157
  billingCurrency: z.optional(z.string()),
158
+ billingEntityId: z.optional(z.string()),
150
159
  contact: z.optional(z.string()),
151
160
  contactPersons: z.optional(z.array(CustomerContactPerson$outboundSchema)),
152
161
  email: z.optional(z.string()),
@@ -171,6 +180,7 @@ export const CreateCustomerRequest$outboundSchema: z.ZodMiniType<
171
180
  addressPostalCode: "address_postal_code",
172
181
  addressState: "address_state",
173
182
  billingCurrency: "billing_currency",
183
+ billingEntityId: "billing_entity_id",
174
184
  contactPersons: "contact_persons",
175
185
  externalId: "external_id",
176
186
  integrationEntityMapping: "integration_entity_mapping",
@@ -24,6 +24,10 @@ export const CustomerFilterOrder = {
24
24
  export type CustomerFilterOrder = ClosedEnum<typeof CustomerFilterOrder>;
25
25
 
26
26
  export type CustomerFilter = {
27
+ /**
28
+ * billing_entity_id filters by the customer's billing entity
29
+ */
30
+ billingEntityId?: string | undefined;
27
31
  customerIds?: Array<string> | undefined;
28
32
  email?: string | undefined;
29
33
  endTime?: Date | undefined;
@@ -47,6 +51,7 @@ export const CustomerFilterOrder$outboundSchema: z.ZodMiniEnum<
47
51
 
48
52
  /** @internal */
49
53
  export type CustomerFilter$Outbound = {
54
+ billing_entity_id?: string | undefined;
50
55
  customer_ids?: Array<string> | undefined;
51
56
  email?: string | undefined;
52
57
  end_time?: string | undefined;
@@ -69,6 +74,7 @@ export const CustomerFilter$outboundSchema: z.ZodMiniType<
69
74
  CustomerFilter
70
75
  > = z.pipe(
71
76
  z.object({
77
+ billingEntityId: z.optional(z.string()),
72
78
  customerIds: z.optional(z.array(z.string())),
73
79
  email: z.optional(z.string()),
74
80
  endTime: z.optional(z.pipe(z.date(), z.transform(v => v.toISOString()))),
@@ -86,6 +92,7 @@ export const CustomerFilter$outboundSchema: z.ZodMiniType<
86
92
  }),
87
93
  z.transform((v) => {
88
94
  return remap$(v, {
95
+ billingEntityId: "billing_entity_id",
89
96
  customerIds: "customer_ids",
90
97
  endTime: "end_time",
91
98
  externalId: "external_id",
@@ -51,6 +51,10 @@ export type CustomerResponse = {
51
51
  * BillingCurrency is the fiat currency invoices are issued in; nil means charge currency is used as-is.
52
52
  */
53
53
  billingCurrency?: string | undefined;
54
+ /**
55
+ * BillingEntityID is the entity that bills the customer; nil while the environment has no billing entities. Never changes once set.
56
+ */
57
+ billingEntityId?: string | undefined;
54
58
  /**
55
59
  * Contact is an optional contact number for the customer (e.g. phone)
56
60
  */
@@ -110,6 +114,7 @@ export const CustomerResponse$inboundSchema: z.ZodMiniType<
110
114
  address_postal_code: types.optional(types.string()),
111
115
  address_state: types.optional(types.string()),
112
116
  billing_currency: types.optional(types.string()),
117
+ billing_entity_id: types.optional(types.string()),
113
118
  contact: types.optional(types.string()),
114
119
  contact_persons: types.optional(
115
120
  z.array(CustomerContactPerson$inboundSchema),
@@ -141,6 +146,7 @@ export const CustomerResponse$inboundSchema: z.ZodMiniType<
141
146
  "address_postal_code": "addressPostalCode",
142
147
  "address_state": "addressState",
143
148
  "billing_currency": "billingCurrency",
149
+ "billing_entity_id": "billingEntityId",
144
150
  "contact_persons": "contactPersons",
145
151
  "created_at": "createdAt",
146
152
  "created_by": "createdBy",
@@ -44,6 +44,10 @@ export type Customer = {
44
44
  * BillingCurrency is the fiat currency invoices are issued in; nil means charge currency is used as-is.
45
45
  */
46
46
  billingCurrency?: string | undefined;
47
+ /**
48
+ * BillingEntityID is the entity that bills the customer; nil while the environment has no billing entities. Never changes once set.
49
+ */
50
+ billingEntityId?: string | undefined;
47
51
  /**
48
52
  * Contact is an optional contact number for the customer (e.g. phone)
49
53
  */
@@ -99,6 +103,7 @@ export const Customer$inboundSchema: z.ZodMiniType<Customer, unknown> = z.pipe(
99
103
  address_postal_code: types.optional(types.string()),
100
104
  address_state: types.optional(types.string()),
101
105
  billing_currency: types.optional(types.string()),
106
+ billing_entity_id: types.optional(types.string()),
102
107
  contact: types.optional(types.string()),
103
108
  contact_persons: types.optional(
104
109
  z.array(CustomerContactPerson$inboundSchema),
@@ -127,6 +132,7 @@ export const Customer$inboundSchema: z.ZodMiniType<Customer, unknown> = z.pipe(
127
132
  "address_postal_code": "addressPostalCode",
128
133
  "address_state": "addressState",
129
134
  "billing_currency": "billingCurrency",
135
+ "billing_entity_id": "billingEntityId",
130
136
  "contact_persons": "contactPersons",
131
137
  "created_at": "createdAt",
132
138
  "created_by": "createdBy",
@@ -0,0 +1,33 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import * as z from "zod/v4-mini";
6
+
7
+ export type GetBillingEntityRequest = {
8
+ /**
9
+ * Billing entity ID
10
+ */
11
+ id: string;
12
+ };
13
+
14
+ /** @internal */
15
+ export type GetBillingEntityRequest$Outbound = {
16
+ id: string;
17
+ };
18
+
19
+ /** @internal */
20
+ export const GetBillingEntityRequest$outboundSchema: z.ZodMiniType<
21
+ GetBillingEntityRequest$Outbound,
22
+ GetBillingEntityRequest
23
+ > = z.object({
24
+ id: z.string(),
25
+ });
26
+
27
+ export function getBillingEntityRequestToJSON(
28
+ getBillingEntityRequest: GetBillingEntityRequest,
29
+ ): string {
30
+ return JSON.stringify(
31
+ GetBillingEntityRequest$outboundSchema.parse(getBillingEntityRequest),
32
+ );
33
+ }
@@ -18,7 +18,7 @@ export type GetUsageAnalyticsRequest = {
18
18
  breakdownBucket?: boolean | undefined;
19
19
  endTime?: Date | undefined;
20
20
  /**
21
- * allowed values: "price", "meter", "feature", "subscription_line_item","plan","addon"
21
+ * allowed values: "price", "meter", "feature", "subscription_line_item","plan","addon","source","instalments"
22
22
  */
23
23
  expand?: Array<string> | undefined;
24
24
  /**
@@ -12,6 +12,10 @@ import {
12
12
  CustomAnalyticItem$inboundSchema,
13
13
  } from "./custom-analytic-item.js";
14
14
  import { SDKValidationError } from "./sdk-validation-error.js";
15
+ import {
16
+ UsageAnalyticInstalment,
17
+ UsageAnalyticInstalment$inboundSchema,
18
+ } from "./usage-analytic-instalment.js";
15
19
  import {
16
20
  UsageAnalyticItem,
17
21
  UsageAnalyticItem$inboundSchema,
@@ -20,12 +24,23 @@ import {
20
24
  export type GetUsageAnalyticsResponse = {
21
25
  currency?: string | undefined;
22
26
  customAnalytics?: Array<CustomAnalyticItem> | undefined;
27
+ /**
28
+ * Instalments lists, with expand "instalments", the instalments of the v2 commitments the request applied that were
29
+ *
30
+ * @remarks
31
+ * invoiced in the range. Property and source filters apply no commitments, so they list none.
32
+ */
33
+ instalments?: Array<UsageAnalyticInstalment> | undefined;
23
34
  items?: Array<UsageAnalyticItem> | undefined;
24
35
  subtotal?: string | undefined;
25
36
  /**
26
37
  * TotalCost is the final cost after discount (Subtotal - TotalDiscount)
27
38
  */
28
39
  totalCost?: string | undefined;
40
+ /**
41
+ * TotalCostWithInstalments is TotalCost plus the amounts of Instalments, set when expand includes "instalments".
42
+ */
43
+ totalCostWithInstalments?: string | undefined;
29
44
  totalDiscount?: string | undefined;
30
45
  };
31
46
 
@@ -37,15 +52,18 @@ export const GetUsageAnalyticsResponse$inboundSchema: z.ZodMiniType<
37
52
  z.object({
38
53
  currency: types.optional(types.string()),
39
54
  custom_analytics: types.optional(z.array(CustomAnalyticItem$inboundSchema)),
55
+ instalments: types.optional(z.array(UsageAnalyticInstalment$inboundSchema)),
40
56
  items: types.optional(z.array(UsageAnalyticItem$inboundSchema)),
41
57
  subtotal: types.optional(types.string()),
42
58
  total_cost: types.optional(types.string()),
59
+ total_cost_with_instalments: types.optional(types.string()),
43
60
  total_discount: types.optional(types.string()),
44
61
  }),
45
62
  z.transform((v) => {
46
63
  return remap$(v, {
47
64
  "custom_analytics": "customAnalytics",
48
65
  "total_cost": "totalCost",
66
+ "total_cost_with_instalments": "totalCostWithInstalments",
49
67
  "total_discount": "totalDiscount",
50
68
  });
51
69
  }),
@@ -61,9 +61,14 @@ export * from "./auto-topup.js";
61
61
  export * from "./aws-marketplace-agreement.js";
62
62
  export * from "./aws-marketplace-sync-config.js";
63
63
  export * from "./azure-marketplace-agreement.js";
64
+ export * from "./billing-address.js";
64
65
  export * from "./billing-cadence.js";
65
66
  export * from "./billing-cycle-info.js";
66
67
  export * from "./billing-cycle.js";
68
+ export * from "./billing-details.js";
69
+ export * from "./billing-entity-mode-response.js";
70
+ export * from "./billing-entity-mode.js";
71
+ export * from "./billing-entity-response.js";
67
72
  export * from "./billing-model.js";
68
73
  export * from "./billing-period-behaviour.js";
69
74
  export * from "./billing-period-config.js";
@@ -155,6 +160,7 @@ export * from "./create-addon-response.js";
155
160
  export * from "./create-alert-settings-request.js";
156
161
  export * from "./create-api-key-request.js";
157
162
  export * from "./create-api-key-response.js";
163
+ export * from "./create-billing-entity-request.js";
158
164
  export * from "./create-bulk-entitlement-request.js";
159
165
  export * from "./create-bulk-entitlement-response.js";
160
166
  export * from "./create-bulk-price-request.js";
@@ -327,6 +333,7 @@ export * from "./get-addon-entitlements-op.js";
327
333
  export * from "./get-addon-op.js";
328
334
  export * from "./get-alert-settings-op.js";
329
335
  export * from "./get-analytics-view-op.js";
336
+ export * from "./get-billing-entity-op.js";
330
337
  export * from "./get-checkout-session-op.js";
331
338
  export * from "./get-commitment-billing-terms-op.js";
332
339
  export * from "./get-commitment-op.js";
@@ -423,6 +430,7 @@ export * from "./instalment-status.js";
423
430
  export * from "./integration-config-entry.js";
424
431
  export * from "./integration-config-response.js";
425
432
  export * from "./integration-entity-type.js";
433
+ export * from "./invoice-billing-entity.js";
426
434
  export * from "./invoice-billing-reason.js";
427
435
  export * from "./invoice-cadence.js";
428
436
  export * from "./invoice-coupon.js";
@@ -462,6 +470,8 @@ export * from "./list-alert-settings-response.js";
462
470
  export * from "./list-all-subscription-schedules-op.js";
463
471
  export * from "./list-analytics-views-op.js";
464
472
  export * from "./list-api-keys-op.js";
473
+ export * from "./list-billing-entities-op.js";
474
+ export * from "./list-billing-entities-response.js";
465
475
  export * from "./list-commitment-instalments-op.js";
466
476
  export * from "./list-commitments-response.js";
467
477
  export * from "./list-contracts-response.js";
@@ -776,6 +786,8 @@ export * from "./update-addon-request.js";
776
786
  export * from "./update-alert-settings-op.js";
777
787
  export * from "./update-alert-settings-request.js";
778
788
  export * from "./update-analytics-view-op.js";
789
+ export * from "./update-billing-entity-op.js";
790
+ export * from "./update-billing-entity-request.js";
779
791
  export * from "./update-commitment-op.js";
780
792
  export * from "./update-commitment-request.js";
781
793
  export * from "./update-costsheet-op.js";
@@ -832,6 +844,7 @@ export * from "./update-user-roles-request.js";
832
844
  export * from "./update-user-roles-response.js";
833
845
  export * from "./update-wallet-op.js";
834
846
  export * from "./update-wallet-request.js";
847
+ export * from "./usage-analytic-instalment.js";
835
848
  export * from "./usage-analytic-item.js";
836
849
  export * from "./usage-analytic-point.js";
837
850
  export * from "./usage-breakdown-item.js";
@@ -0,0 +1,48 @@
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 {
11
+ BillingDetails,
12
+ BillingDetails$inboundSchema,
13
+ } from "./billing-details.js";
14
+ import { SDKValidationError } from "./sdk-validation-error.js";
15
+
16
+ export type InvoiceBillingEntity = {
17
+ billingDetails?: BillingDetails | undefined;
18
+ billingEntityId?: string | undefined;
19
+ name?: string | undefined;
20
+ };
21
+
22
+ /** @internal */
23
+ export const InvoiceBillingEntity$inboundSchema: z.ZodMiniType<
24
+ InvoiceBillingEntity,
25
+ unknown
26
+ > = z.pipe(
27
+ z.object({
28
+ billing_details: types.optional(BillingDetails$inboundSchema),
29
+ billing_entity_id: types.optional(types.string()),
30
+ name: types.optional(types.string()),
31
+ }),
32
+ z.transform((v) => {
33
+ return remap$(v, {
34
+ "billing_details": "billingDetails",
35
+ "billing_entity_id": "billingEntityId",
36
+ });
37
+ }),
38
+ );
39
+
40
+ export function invoiceBillingEntityFromJSON(
41
+ jsonString: string,
42
+ ): SafeParseResult<InvoiceBillingEntity, SDKValidationError> {
43
+ return safeParse(
44
+ jsonString,
45
+ (x) => InvoiceBillingEntity$inboundSchema.parse(JSON.parse(x)),
46
+ `Failed to parse 'InvoiceBillingEntity' from JSON`,
47
+ );
48
+ }
@@ -51,6 +51,10 @@ export type InvoiceFilter = {
51
51
  * Useful for finding invoices that still have significant unpaid amounts
52
52
  */
53
53
  amountRemainingGt?: number | undefined;
54
+ /**
55
+ * billing_entity_id filters by the customer's billing entity
56
+ */
57
+ billingEntityId?: string | undefined;
54
58
  billingReason?: InvoiceBillingReason | undefined;
55
59
  /**
56
60
  * currency filters invoices by their currency (ISO 4217 code, e.g. "usd", "eur").
@@ -166,6 +170,7 @@ export const InvoiceFilterOrder$outboundSchema: z.ZodMiniEnum<
166
170
  export type InvoiceFilter$Outbound = {
167
171
  amount_due_gt?: number | undefined;
168
172
  amount_remaining_gt?: number | undefined;
173
+ billing_entity_id?: string | undefined;
169
174
  billing_reason?: string | undefined;
170
175
  currency?: string | undefined;
171
176
  customer_id?: string | undefined;
@@ -205,6 +210,7 @@ export const InvoiceFilter$outboundSchema: z.ZodMiniType<
205
210
  z.object({
206
211
  amountDueGt: z.optional(z.number()),
207
212
  amountRemainingGt: z.optional(z.number()),
213
+ billingEntityId: z.optional(z.string()),
208
214
  billingReason: z.optional(InvoiceBillingReason$outboundSchema),
209
215
  currency: z.optional(z.string()),
210
216
  customerId: z.optional(z.string()),
@@ -245,6 +251,7 @@ export const InvoiceFilter$outboundSchema: z.ZodMiniType<
245
251
  return remap$(v, {
246
252
  amountDueGt: "amount_due_gt",
247
253
  amountRemainingGt: "amount_remaining_gt",
254
+ billingEntityId: "billing_entity_id",
248
255
  billingReason: "billing_reason",
249
256
  customerId: "customer_id",
250
257
  endTime: "end_time",
@@ -24,6 +24,10 @@ import {
24
24
  CustomerResponse$inboundSchema,
25
25
  } from "./customer-response.js";
26
26
  import { FxConversion, FxConversion$inboundSchema } from "./fx-conversion.js";
27
+ import {
28
+ InvoiceBillingEntity,
29
+ InvoiceBillingEntity$inboundSchema,
30
+ } from "./invoice-billing-entity.js";
27
31
  import {
28
32
  InvoiceLineItemResponse,
29
33
  InvoiceLineItemResponse$inboundSchema,
@@ -77,6 +81,11 @@ export type InvoiceResponse = {
77
81
  * amount_remaining is the outstanding amount still owed on this invoice (calculated as amount_due minus amount_paid)
78
82
  */
79
83
  amountRemaining?: string | undefined;
84
+ billingEntity?: InvoiceBillingEntity | undefined;
85
+ /**
86
+ * BillingEntityID is the entity that bills the invoice; nil while the environment has no billing entities. Never changes once set.
87
+ */
88
+ billingEntityId?: string | undefined;
80
89
  /**
81
90
  * billing_period describes the billing period this invoice covers (e.g., "January 2024", "Q1 2024")
82
91
  */
@@ -262,6 +271,8 @@ export const InvoiceResponse$inboundSchema: z.ZodMiniType<
262
271
  amount_due: types.optional(types.string()),
263
272
  amount_paid: types.optional(types.string()),
264
273
  amount_remaining: types.optional(types.string()),
274
+ billing_entity: types.optional(InvoiceBillingEntity$inboundSchema),
275
+ billing_entity_id: types.optional(types.string()),
265
276
  billing_period: types.optional(types.string()),
266
277
  billing_reason: types.optional(types.string()),
267
278
  billing_sequence: types.optional(types.number()),
@@ -328,6 +339,8 @@ export const InvoiceResponse$inboundSchema: z.ZodMiniType<
328
339
  "amount_due": "amountDue",
329
340
  "amount_paid": "amountPaid",
330
341
  "amount_remaining": "amountRemaining",
342
+ "billing_entity": "billingEntity",
343
+ "billing_entity_id": "billingEntityId",
331
344
  "billing_period": "billingPeriod",
332
345
  "billing_reason": "billingReason",
333
346
  "billing_sequence": "billingSequence",
@@ -0,0 +1,88 @@
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 { ClosedEnum } from "../../types/enums.js";
8
+
9
+ export const ListBillingEntitiesOrder = {
10
+ Asc: "asc",
11
+ Desc: "desc",
12
+ } as const;
13
+ export type ListBillingEntitiesOrder = ClosedEnum<
14
+ typeof ListBillingEntitiesOrder
15
+ >;
16
+
17
+ export const ListBillingEntitiesStatus = {
18
+ Published: "published",
19
+ Deleted: "deleted",
20
+ Archived: "archived",
21
+ } as const;
22
+ export type ListBillingEntitiesStatus = ClosedEnum<
23
+ typeof ListBillingEntitiesStatus
24
+ >;
25
+
26
+ export type ListBillingEntitiesRequest = {
27
+ billingEntityIds?: Array<string> | undefined;
28
+ expand?: string | undefined;
29
+ isDefault?: boolean | undefined;
30
+ limit?: number | undefined;
31
+ offset?: number | undefined;
32
+ order?: ListBillingEntitiesOrder | undefined;
33
+ sort?: string | undefined;
34
+ status?: ListBillingEntitiesStatus | undefined;
35
+ };
36
+
37
+ /** @internal */
38
+ export const ListBillingEntitiesOrder$outboundSchema: z.ZodMiniEnum<
39
+ typeof ListBillingEntitiesOrder
40
+ > = z.enum(ListBillingEntitiesOrder);
41
+
42
+ /** @internal */
43
+ export const ListBillingEntitiesStatus$outboundSchema: z.ZodMiniEnum<
44
+ typeof ListBillingEntitiesStatus
45
+ > = z.enum(ListBillingEntitiesStatus);
46
+
47
+ /** @internal */
48
+ export type ListBillingEntitiesRequest$Outbound = {
49
+ billing_entity_ids?: Array<string> | undefined;
50
+ expand?: string | undefined;
51
+ is_default?: boolean | undefined;
52
+ limit?: number | undefined;
53
+ offset?: number | undefined;
54
+ order?: string | undefined;
55
+ sort?: string | undefined;
56
+ status?: string | undefined;
57
+ };
58
+
59
+ /** @internal */
60
+ export const ListBillingEntitiesRequest$outboundSchema: z.ZodMiniType<
61
+ ListBillingEntitiesRequest$Outbound,
62
+ ListBillingEntitiesRequest
63
+ > = z.pipe(
64
+ z.object({
65
+ billingEntityIds: z.optional(z.array(z.string())),
66
+ expand: z.optional(z.string()),
67
+ isDefault: z.optional(z.boolean()),
68
+ limit: z.optional(z.int()),
69
+ offset: z.optional(z.int()),
70
+ order: z.optional(ListBillingEntitiesOrder$outboundSchema),
71
+ sort: z.optional(z.string()),
72
+ status: z.optional(ListBillingEntitiesStatus$outboundSchema),
73
+ }),
74
+ z.transform((v) => {
75
+ return remap$(v, {
76
+ billingEntityIds: "billing_entity_ids",
77
+ isDefault: "is_default",
78
+ });
79
+ }),
80
+ );
81
+
82
+ export function listBillingEntitiesRequestToJSON(
83
+ listBillingEntitiesRequest: ListBillingEntitiesRequest,
84
+ ): string {
85
+ return JSON.stringify(
86
+ ListBillingEntitiesRequest$outboundSchema.parse(listBillingEntitiesRequest),
87
+ );
88
+ }
@@ -0,0 +1,41 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import * as z from "zod/v4-mini";
6
+ import { safeParse } from "../../lib/schemas.js";
7
+ import { Result as SafeParseResult } from "../../types/fp.js";
8
+ import * as types from "../../types/primitives.js";
9
+ import {
10
+ BillingEntityResponse,
11
+ BillingEntityResponse$inboundSchema,
12
+ } from "./billing-entity-response.js";
13
+ import {
14
+ PaginationResponse,
15
+ PaginationResponse$inboundSchema,
16
+ } from "./pagination-response.js";
17
+ import { SDKValidationError } from "./sdk-validation-error.js";
18
+
19
+ export type ListBillingEntitiesResponse = {
20
+ items?: Array<BillingEntityResponse> | undefined;
21
+ pagination?: PaginationResponse | undefined;
22
+ };
23
+
24
+ /** @internal */
25
+ export const ListBillingEntitiesResponse$inboundSchema: z.ZodMiniType<
26
+ ListBillingEntitiesResponse,
27
+ unknown
28
+ > = z.object({
29
+ items: types.optional(z.array(BillingEntityResponse$inboundSchema)),
30
+ pagination: types.optional(PaginationResponse$inboundSchema),
31
+ });
32
+
33
+ export function listBillingEntitiesResponseFromJSON(
34
+ jsonString: string,
35
+ ): SafeParseResult<ListBillingEntitiesResponse, SDKValidationError> {
36
+ return safeParse(
37
+ jsonString,
38
+ (x) => ListBillingEntitiesResponse$inboundSchema.parse(JSON.parse(x)),
39
+ `Failed to parse 'ListBillingEntitiesResponse' from JSON`,
40
+ );
41
+ }
@@ -12,6 +12,7 @@ export const TaxRateEntityType = {
12
12
  Invoice: "invoice",
13
13
  Tenant: "tenant",
14
14
  CreditNote: "credit_note",
15
+ BillingEntity: "billing_entity",
15
16
  } as const;
16
17
  export type TaxRateEntityType = OpenEnum<typeof TaxRateEntityType>;
17
18
 
@@ -0,0 +1,46 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import * as z from "zod/v4-mini";
6
+ import {
7
+ UpdateBillingEntityRequest,
8
+ UpdateBillingEntityRequest$Outbound,
9
+ UpdateBillingEntityRequest$outboundSchema,
10
+ } from "./update-billing-entity-request.js";
11
+
12
+ export type UpdateBillingEntityRequestRequest = {
13
+ /**
14
+ * Billing entity ID
15
+ */
16
+ id: string;
17
+ /**
18
+ * Fields to change
19
+ */
20
+ body: UpdateBillingEntityRequest;
21
+ };
22
+
23
+ /** @internal */
24
+ export type UpdateBillingEntityRequestRequest$Outbound = {
25
+ id: string;
26
+ body: UpdateBillingEntityRequest$Outbound;
27
+ };
28
+
29
+ /** @internal */
30
+ export const UpdateBillingEntityRequestRequest$outboundSchema: z.ZodMiniType<
31
+ UpdateBillingEntityRequestRequest$Outbound,
32
+ UpdateBillingEntityRequestRequest
33
+ > = z.object({
34
+ id: z.string(),
35
+ body: UpdateBillingEntityRequest$outboundSchema,
36
+ });
37
+
38
+ export function updateBillingEntityRequestRequestToJSON(
39
+ updateBillingEntityRequestRequest: UpdateBillingEntityRequestRequest,
40
+ ): string {
41
+ return JSON.stringify(
42
+ UpdateBillingEntityRequestRequest$outboundSchema.parse(
43
+ updateBillingEntityRequestRequest,
44
+ ),
45
+ );
46
+ }