orb-billing 6.0.1 → 6.1.0

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 (263) hide show
  1. package/CHANGELOG.md +22 -0
  2. package/README.md +1 -4
  3. package/bin/cli +52 -0
  4. package/bin/migration-config.json +238 -0
  5. package/client.d.mts +5 -10
  6. package/client.d.mts.map +1 -1
  7. package/client.d.ts +5 -10
  8. package/client.d.ts.map +1 -1
  9. package/client.js +140 -149
  10. package/client.js.map +1 -1
  11. package/client.mjs +138 -146
  12. package/client.mjs.map +1 -1
  13. package/core/api-promise.d.mts +2 -2
  14. package/core/api-promise.d.mts.map +1 -1
  15. package/core/api-promise.d.ts +2 -2
  16. package/core/api-promise.d.ts.map +1 -1
  17. package/core/api-promise.js.map +1 -1
  18. package/core/api-promise.mjs.map +1 -1
  19. package/core/pagination.d.mts +4 -4
  20. package/core/pagination.d.mts.map +1 -1
  21. package/core/pagination.d.ts +4 -4
  22. package/core/pagination.d.ts.map +1 -1
  23. package/core/pagination.js.map +1 -1
  24. package/core/pagination.mjs.map +1 -1
  25. package/core/resource.d.mts +3 -3
  26. package/core/resource.d.mts.map +1 -1
  27. package/core/resource.d.ts +3 -3
  28. package/core/resource.d.ts.map +1 -1
  29. package/core/resource.js.map +1 -1
  30. package/core/resource.mjs.map +1 -1
  31. package/index.d.mts +1 -1
  32. package/index.d.mts.map +1 -1
  33. package/index.d.ts +1 -1
  34. package/index.d.ts.map +1 -1
  35. package/index.js +1 -2
  36. package/index.js.map +1 -1
  37. package/index.mjs +1 -1
  38. package/index.mjs.map +1 -1
  39. package/internal/parse.d.mts +2 -2
  40. package/internal/parse.d.mts.map +1 -1
  41. package/internal/parse.d.ts +2 -2
  42. package/internal/parse.d.ts.map +1 -1
  43. package/internal/parse.js.map +1 -1
  44. package/internal/parse.mjs.map +1 -1
  45. package/internal/uploads.d.mts +4 -4
  46. package/internal/uploads.d.mts.map +1 -1
  47. package/internal/uploads.d.ts +4 -4
  48. package/internal/uploads.d.ts.map +1 -1
  49. package/internal/uploads.js.map +1 -1
  50. package/internal/uploads.mjs.map +1 -1
  51. package/internal/utils/log.d.mts +3 -3
  52. package/internal/utils/log.d.mts.map +1 -1
  53. package/internal/utils/log.d.ts +3 -3
  54. package/internal/utils/log.d.ts.map +1 -1
  55. package/internal/utils/log.js.map +1 -1
  56. package/internal/utils/log.mjs.map +1 -1
  57. package/package.json +4 -1
  58. package/resources/alerts.d.mts +18 -7
  59. package/resources/alerts.d.mts.map +1 -1
  60. package/resources/alerts.d.ts +18 -7
  61. package/resources/alerts.d.ts.map +1 -1
  62. package/resources/alerts.js +31 -14
  63. package/resources/alerts.js.map +1 -1
  64. package/resources/alerts.mjs +31 -14
  65. package/resources/alerts.mjs.map +1 -1
  66. package/resources/beta/beta.d.mts +2 -2
  67. package/resources/beta/beta.d.ts +2 -2
  68. package/resources/beta/beta.js +6 -6
  69. package/resources/beta/beta.js.map +1 -1
  70. package/resources/beta/beta.mjs +6 -6
  71. package/resources/beta/beta.mjs.map +1 -1
  72. package/resources/beta/external-plan-id.d.mts +2 -2
  73. package/resources/beta/external-plan-id.d.ts +2 -2
  74. package/resources/beta/external-plan-id.js +6 -6
  75. package/resources/beta/external-plan-id.js.map +1 -1
  76. package/resources/beta/external-plan-id.mjs +6 -6
  77. package/resources/beta/external-plan-id.mjs.map +1 -1
  78. package/resources/coupons/coupons.d.mts +2 -2
  79. package/resources/coupons/coupons.d.ts +2 -2
  80. package/resources/coupons/coupons.js +4 -4
  81. package/resources/coupons/coupons.mjs +4 -4
  82. package/resources/coupons/subscriptions.d.mts +1 -1
  83. package/resources/coupons/subscriptions.d.ts +1 -1
  84. package/resources/coupons/subscriptions.js +2 -2
  85. package/resources/coupons/subscriptions.mjs +2 -2
  86. package/resources/credit-blocks.d.mts +3 -3
  87. package/resources/credit-blocks.d.ts +3 -3
  88. package/resources/credit-blocks.js +6 -6
  89. package/resources/credit-blocks.mjs +6 -6
  90. package/resources/credit-notes.d.mts +1 -1
  91. package/resources/credit-notes.d.ts +1 -1
  92. package/resources/credit-notes.js +2 -2
  93. package/resources/credit-notes.mjs +2 -2
  94. package/resources/customers/balance-transactions.d.mts +2 -2
  95. package/resources/customers/balance-transactions.d.ts +2 -2
  96. package/resources/customers/balance-transactions.js +4 -4
  97. package/resources/customers/balance-transactions.mjs +4 -4
  98. package/resources/customers/costs.d.mts +2 -2
  99. package/resources/customers/costs.d.ts +2 -2
  100. package/resources/customers/costs.js +4 -4
  101. package/resources/customers/costs.mjs +4 -4
  102. package/resources/customers/credits/credits.d.mts +2 -2
  103. package/resources/customers/credits/credits.d.ts +2 -2
  104. package/resources/customers/credits/credits.js +4 -4
  105. package/resources/customers/credits/credits.mjs +4 -4
  106. package/resources/customers/credits/ledger.d.mts +4 -4
  107. package/resources/customers/credits/ledger.d.ts +4 -4
  108. package/resources/customers/credits/ledger.js +8 -8
  109. package/resources/customers/credits/ledger.mjs +8 -8
  110. package/resources/customers/credits/top-ups.d.mts +6 -6
  111. package/resources/customers/credits/top-ups.d.ts +6 -6
  112. package/resources/customers/credits/top-ups.js +14 -14
  113. package/resources/customers/credits/top-ups.js.map +1 -1
  114. package/resources/customers/credits/top-ups.mjs +14 -14
  115. package/resources/customers/credits/top-ups.mjs.map +1 -1
  116. package/resources/customers/customers.d.mts +65 -7
  117. package/resources/customers/customers.d.mts.map +1 -1
  118. package/resources/customers/customers.d.ts +65 -7
  119. package/resources/customers/customers.d.ts.map +1 -1
  120. package/resources/customers/customers.js +35 -12
  121. package/resources/customers/customers.js.map +1 -1
  122. package/resources/customers/customers.mjs +35 -12
  123. package/resources/customers/customers.mjs.map +1 -1
  124. package/resources/customers/index.d.mts +1 -1
  125. package/resources/customers/index.d.mts.map +1 -1
  126. package/resources/customers/index.d.ts +1 -1
  127. package/resources/customers/index.d.ts.map +1 -1
  128. package/resources/customers/index.js.map +1 -1
  129. package/resources/customers/index.mjs.map +1 -1
  130. package/resources/dimensional-price-groups/dimensional-price-groups.d.mts +2 -2
  131. package/resources/dimensional-price-groups/dimensional-price-groups.d.ts +2 -2
  132. package/resources/dimensional-price-groups/dimensional-price-groups.js +4 -4
  133. package/resources/dimensional-price-groups/dimensional-price-groups.mjs +4 -4
  134. package/resources/dimensional-price-groups/external-dimensional-price-group-id.d.mts +2 -2
  135. package/resources/dimensional-price-groups/external-dimensional-price-group-id.d.ts +2 -2
  136. package/resources/dimensional-price-groups/external-dimensional-price-group-id.js +4 -4
  137. package/resources/dimensional-price-groups/external-dimensional-price-group-id.mjs +4 -4
  138. package/resources/events/backfills.d.mts +3 -3
  139. package/resources/events/backfills.d.ts +3 -3
  140. package/resources/events/backfills.js +6 -6
  141. package/resources/events/backfills.mjs +6 -6
  142. package/resources/events/events.d.mts +2 -18
  143. package/resources/events/events.d.mts.map +1 -1
  144. package/resources/events/events.d.ts +2 -18
  145. package/resources/events/events.d.ts.map +1 -1
  146. package/resources/events/events.js +6 -6
  147. package/resources/events/events.js.map +1 -1
  148. package/resources/events/events.mjs +6 -6
  149. package/resources/events/events.mjs.map +1 -1
  150. package/resources/index.d.mts +1 -1
  151. package/resources/index.d.mts.map +1 -1
  152. package/resources/index.d.ts +1 -1
  153. package/resources/index.d.ts.map +1 -1
  154. package/resources/index.js.map +1 -1
  155. package/resources/index.mjs.map +1 -1
  156. package/resources/invoices.d.mts +74 -8
  157. package/resources/invoices.d.mts.map +1 -1
  158. package/resources/invoices.d.ts +74 -8
  159. package/resources/invoices.d.ts.map +1 -1
  160. package/resources/invoices.js +87 -17
  161. package/resources/invoices.js.map +1 -1
  162. package/resources/invoices.mjs +87 -17
  163. package/resources/invoices.mjs.map +1 -1
  164. package/resources/items.d.mts +3 -3
  165. package/resources/items.d.ts +3 -3
  166. package/resources/items.js +6 -6
  167. package/resources/items.mjs +6 -6
  168. package/resources/license-types.d.mts +1 -1
  169. package/resources/license-types.d.ts +1 -1
  170. package/resources/license-types.js +2 -2
  171. package/resources/license-types.mjs +2 -2
  172. package/resources/licenses/external-licenses.d.mts +1 -1
  173. package/resources/licenses/external-licenses.d.ts +1 -1
  174. package/resources/licenses/external-licenses.js +2 -2
  175. package/resources/licenses/external-licenses.mjs +2 -2
  176. package/resources/licenses/licenses.d.mts +3 -3
  177. package/resources/licenses/licenses.d.ts +3 -3
  178. package/resources/licenses/licenses.js +6 -6
  179. package/resources/licenses/licenses.mjs +6 -6
  180. package/resources/licenses/usage.d.mts +1 -1
  181. package/resources/licenses/usage.d.ts +1 -1
  182. package/resources/licenses/usage.js +2 -2
  183. package/resources/licenses/usage.mjs +2 -2
  184. package/resources/metrics.d.mts +2 -2
  185. package/resources/metrics.d.ts +2 -2
  186. package/resources/metrics.js +4 -4
  187. package/resources/metrics.mjs +4 -4
  188. package/resources/plans/external-plan-id.d.mts +2 -2
  189. package/resources/plans/external-plan-id.d.ts +2 -2
  190. package/resources/plans/external-plan-id.js +4 -4
  191. package/resources/plans/external-plan-id.mjs +4 -4
  192. package/resources/plans/migrations.d.mts +3 -3
  193. package/resources/plans/migrations.d.ts +3 -3
  194. package/resources/plans/migrations.js +8 -8
  195. package/resources/plans/migrations.js.map +1 -1
  196. package/resources/plans/migrations.mjs +8 -8
  197. package/resources/plans/migrations.mjs.map +1 -1
  198. package/resources/plans/plans.d.mts +2 -2
  199. package/resources/plans/plans.d.ts +2 -2
  200. package/resources/plans/plans.js +4 -4
  201. package/resources/plans/plans.mjs +4 -4
  202. package/resources/prices/external-price-id.d.mts +2 -2
  203. package/resources/prices/external-price-id.d.ts +2 -2
  204. package/resources/prices/external-price-id.js +4 -4
  205. package/resources/prices/external-price-id.mjs +4 -4
  206. package/resources/prices/prices.d.mts +3 -3
  207. package/resources/prices/prices.d.ts +3 -3
  208. package/resources/prices/prices.js +6 -6
  209. package/resources/prices/prices.mjs +6 -6
  210. package/resources/subscription-changes.d.mts +3 -3
  211. package/resources/subscription-changes.d.ts +3 -3
  212. package/resources/subscription-changes.js +6 -6
  213. package/resources/subscription-changes.mjs +6 -6
  214. package/resources/subscriptions.d.mts +15 -15
  215. package/resources/subscriptions.d.ts +15 -15
  216. package/resources/subscriptions.js +30 -30
  217. package/resources/subscriptions.mjs +30 -30
  218. package/src/client.ts +11 -8
  219. package/src/core/api-promise.ts +4 -7
  220. package/src/core/pagination.ts +5 -5
  221. package/src/core/resource.ts +3 -3
  222. package/src/index.ts +1 -1
  223. package/src/internal/parse.ts +2 -2
  224. package/src/internal/uploads.ts +5 -5
  225. package/src/internal/utils/log.ts +3 -3
  226. package/src/resources/alerts.ts +32 -14
  227. package/src/resources/beta/beta.ts +6 -6
  228. package/src/resources/beta/external-plan-id.ts +6 -6
  229. package/src/resources/coupons/coupons.ts +4 -4
  230. package/src/resources/coupons/subscriptions.ts +2 -2
  231. package/src/resources/credit-blocks.ts +6 -6
  232. package/src/resources/credit-notes.ts +2 -2
  233. package/src/resources/customers/balance-transactions.ts +4 -4
  234. package/src/resources/customers/costs.ts +4 -4
  235. package/src/resources/customers/credits/credits.ts +4 -4
  236. package/src/resources/customers/credits/ledger.ts +8 -8
  237. package/src/resources/customers/credits/top-ups.ts +14 -14
  238. package/src/resources/customers/customers.ts +105 -12
  239. package/src/resources/customers/index.ts +4 -0
  240. package/src/resources/dimensional-price-groups/dimensional-price-groups.ts +4 -4
  241. package/src/resources/dimensional-price-groups/external-dimensional-price-group-id.ts +4 -4
  242. package/src/resources/events/backfills.ts +6 -6
  243. package/src/resources/events/events.ts +6 -26
  244. package/src/resources/index.ts +4 -0
  245. package/src/resources/invoices.ts +89 -17
  246. package/src/resources/items.ts +6 -6
  247. package/src/resources/license-types.ts +2 -2
  248. package/src/resources/licenses/external-licenses.ts +2 -2
  249. package/src/resources/licenses/licenses.ts +6 -6
  250. package/src/resources/licenses/usage.ts +2 -2
  251. package/src/resources/metrics.ts +4 -4
  252. package/src/resources/plans/external-plan-id.ts +4 -4
  253. package/src/resources/plans/migrations.ts +8 -8
  254. package/src/resources/plans/plans.ts +4 -4
  255. package/src/resources/prices/external-price-id.ts +4 -4
  256. package/src/resources/prices/prices.ts +6 -6
  257. package/src/resources/subscription-changes.ts +6 -6
  258. package/src/resources/subscriptions.ts +30 -30
  259. package/src/version.ts +1 -1
  260. package/version.d.mts +1 -1
  261. package/version.d.ts +1 -1
  262. package/version.js +1 -1
  263. package/version.mjs +1 -1
@@ -83,8 +83,8 @@ export class Customers extends APIResource {
83
83
  * be set if it has not already been set on the customer. Other fields on a
84
84
  * customer are currently immutable.
85
85
  */
86
- update(customerId: string, body: CustomerUpdateParams, options?: RequestOptions): APIPromise<Customer> {
87
- return this._client.put(path`/customers/${customerId}`, { body, ...options });
86
+ update(customerID: string, body: CustomerUpdateParams, options?: RequestOptions): APIPromise<Customer> {
87
+ return this._client.put(path`/customers/${customerID}`, { body, ...options });
88
88
  }
89
89
 
90
90
  /**
@@ -116,13 +116,46 @@ export class Customers extends APIResource {
116
116
  * customer on subsequent GET requests while deletion is in process will reflect
117
117
  * its deletion.
118
118
  */
119
- delete(customerId: string, options?: RequestOptions): APIPromise<void> {
120
- return this._client.delete(path`/customers/${customerId}`, {
119
+ delete(customerID: string, options?: RequestOptions): APIPromise<void> {
120
+ return this._client.delete(path`/customers/${customerID}`, {
121
121
  ...options,
122
122
  headers: buildHeaders([{ Accept: '*/*' }, options?.headers]),
123
123
  });
124
124
  }
125
125
 
126
+ /**
127
+ * Creates a portal session for the customer, returning a short-lived URL that
128
+ * provides authenticated access to the customer's billing portal. The session
129
+ * expires after `expires_in_minutes` (default 60, max 180). By default, creating a
130
+ * new session invalidates any other active portal sessions for the customer; pass
131
+ * `invalidate_existing=false` to allow concurrent sessions.
132
+ */
133
+ createPortalSession(
134
+ customerID: string,
135
+ body: CustomerCreatePortalSessionParams,
136
+ options?: RequestOptions,
137
+ ): APIPromise<CustomerCreatePortalSessionResponse> {
138
+ return this._client.post(path`/customers/${customerID}/portal_sessions`, { body, ...options });
139
+ }
140
+
141
+ /**
142
+ * Creates a portal session for the customer, returning a short-lived URL that
143
+ * provides authenticated access to the customer's billing portal. The session
144
+ * expires after `expires_in_minutes` (default 60, max 180). By default, creating a
145
+ * new session invalidates any other active portal sessions for the customer; pass
146
+ * `invalidate_existing=false` to allow concurrent sessions.
147
+ */
148
+ createPortalSessionByExternalID(
149
+ externalCustomerID: string,
150
+ body: CustomerCreatePortalSessionByExternalIDParams,
151
+ options?: RequestOptions,
152
+ ): APIPromise<CustomerCreatePortalSessionByExternalIDResponse> {
153
+ return this._client.post(path`/customers/external_customer_id/${externalCustomerID}/portal_sessions`, {
154
+ body,
155
+ ...options,
156
+ });
157
+ }
158
+
126
159
  /**
127
160
  * This endpoint is used to fetch customer details given an identifier. If the
128
161
  * `Customer` is in the process of being deleted, only the properties `id` and
@@ -131,8 +164,8 @@ export class Customers extends APIResource {
131
164
  * See the [Customer resource](/core-concepts#customer) for a full discussion of
132
165
  * the Customer model.
133
166
  */
134
- fetch(customerId: string, options?: RequestOptions): APIPromise<Customer> {
135
- return this._client.get(path`/customers/${customerId}`, options);
167
+ fetch(customerID: string, options?: RequestOptions): APIPromise<Customer> {
168
+ return this._client.get(path`/customers/${customerID}`, options);
136
169
  }
137
170
 
138
171
  /**
@@ -142,8 +175,8 @@ export class Customers extends APIResource {
142
175
  * Note that the resource and semantics of this endpoint exactly mirror
143
176
  * [Get Customer](fetch-customer).
144
177
  */
145
- fetchByExternalID(externalCustomerId: string, options?: RequestOptions): APIPromise<Customer> {
146
- return this._client.get(path`/customers/external_customer_id/${externalCustomerId}`, options);
178
+ fetchByExternalID(externalCustomerID: string, options?: RequestOptions): APIPromise<Customer> {
179
+ return this._client.get(path`/customers/external_customer_id/${externalCustomerID}`, options);
147
180
  }
148
181
 
149
182
  /**
@@ -154,8 +187,8 @@ export class Customers extends APIResource {
154
187
  *
155
188
  * **Note**: This functionality is currently only available for Stripe.
156
189
  */
157
- syncPaymentMethodsFromGateway(customerId: string, options?: RequestOptions): APIPromise<void> {
158
- return this._client.post(path`/customers/${customerId}/sync_payment_methods_from_gateway`, {
190
+ syncPaymentMethodsFromGateway(customerID: string, options?: RequestOptions): APIPromise<void> {
191
+ return this._client.post(path`/customers/${customerID}/sync_payment_methods_from_gateway`, {
159
192
  ...options,
160
193
  headers: buildHeaders([{ Accept: '*/*' }, options?.headers]),
161
194
  });
@@ -170,11 +203,11 @@ export class Customers extends APIResource {
170
203
  * **Note**: This functionality is currently only available for Stripe.
171
204
  */
172
205
  syncPaymentMethodsFromGatewayByExternalCustomerID(
173
- externalCustomerId: string,
206
+ externalCustomerID: string,
174
207
  options?: RequestOptions,
175
208
  ): APIPromise<void> {
176
209
  return this._client.post(
177
- path`/customers/external_customer_id/${externalCustomerId}/sync_payment_methods_from_gateway`,
210
+ path`/customers/external_customer_id/${externalCustomerID}/sync_payment_methods_from_gateway`,
178
211
  { ...options, headers: buildHeaders([{ Accept: '*/*' }, options?.headers]) },
179
212
  );
180
213
  }
@@ -687,6 +720,30 @@ export interface NewTaxJarConfiguration {
687
720
  automatic_tax_enabled?: boolean | null;
688
721
  }
689
722
 
723
+ export interface CustomerCreatePortalSessionResponse {
724
+ id: string;
725
+
726
+ created_at: string;
727
+
728
+ customer_id: string;
729
+
730
+ expires_at: string | null;
731
+
732
+ url: string;
733
+ }
734
+
735
+ export interface CustomerCreatePortalSessionByExternalIDResponse {
736
+ id: string;
737
+
738
+ created_at: string;
739
+
740
+ customer_id: string;
741
+
742
+ expires_at: string | null;
743
+
744
+ url: string;
745
+ }
746
+
690
747
  export interface CustomerCreateParams {
691
748
  /**
692
749
  * A valid customer email, to be used for notifications. When Orb triggers payment
@@ -1384,6 +1441,38 @@ export interface CustomerListParams extends PageParams {
1384
1441
  'created_at[lte]'?: string | null;
1385
1442
  }
1386
1443
 
1444
+ export interface CustomerCreatePortalSessionParams {
1445
+ /**
1446
+ * Duration in minutes until the portal session expires. Defaults to 60.
1447
+ * Maximum 180.
1448
+ */
1449
+ expires_in_minutes?: number;
1450
+
1451
+ /**
1452
+ * When true (default), creating this session soft-deletes any other active portal
1453
+ * sessions for the customer. Set to false to allow concurrent sessions — useful
1454
+ * when minting portal links for multiple authenticated end-users at once. The
1455
+ * customer's permanent portal link (if any) is never invalidated by this.
1456
+ */
1457
+ invalidate_existing?: boolean;
1458
+ }
1459
+
1460
+ export interface CustomerCreatePortalSessionByExternalIDParams {
1461
+ /**
1462
+ * Duration in minutes until the portal session expires. Defaults to 60.
1463
+ * Maximum 180.
1464
+ */
1465
+ expires_in_minutes?: number;
1466
+
1467
+ /**
1468
+ * When true (default), creating this session soft-deletes any other active portal
1469
+ * sessions for the customer. Set to false to allow concurrent sessions — useful
1470
+ * when minting portal links for multiple authenticated end-users at once. The
1471
+ * customer's permanent portal link (if any) is never invalidated by this.
1472
+ */
1473
+ invalidate_existing?: boolean;
1474
+ }
1475
+
1387
1476
  export interface CustomerUpdateByExternalIDParams {
1388
1477
  accounting_sync_configuration?: NewAccountingSyncConfiguration | null;
1389
1478
 
@@ -1745,10 +1834,14 @@ export declare namespace Customers {
1745
1834
  type NewReportingConfiguration as NewReportingConfiguration,
1746
1835
  type NewSphereConfiguration as NewSphereConfiguration,
1747
1836
  type NewTaxJarConfiguration as NewTaxJarConfiguration,
1837
+ type CustomerCreatePortalSessionResponse as CustomerCreatePortalSessionResponse,
1838
+ type CustomerCreatePortalSessionByExternalIDResponse as CustomerCreatePortalSessionByExternalIDResponse,
1748
1839
  type CustomersPage as CustomersPage,
1749
1840
  type CustomerCreateParams as CustomerCreateParams,
1750
1841
  type CustomerUpdateParams as CustomerUpdateParams,
1751
1842
  type CustomerListParams as CustomerListParams,
1843
+ type CustomerCreatePortalSessionParams as CustomerCreatePortalSessionParams,
1844
+ type CustomerCreatePortalSessionByExternalIDParams as CustomerCreatePortalSessionByExternalIDParams,
1752
1845
  type CustomerUpdateByExternalIDParams as CustomerUpdateByExternalIDParams,
1753
1846
  };
1754
1847
 
@@ -35,9 +35,13 @@ export {
35
35
  type NewReportingConfiguration,
36
36
  type NewSphereConfiguration,
37
37
  type NewTaxJarConfiguration,
38
+ type CustomerCreatePortalSessionResponse,
39
+ type CustomerCreatePortalSessionByExternalIDResponse,
38
40
  type CustomerCreateParams,
39
41
  type CustomerUpdateParams,
40
42
  type CustomerListParams,
43
+ type CustomerCreatePortalSessionParams,
44
+ type CustomerCreatePortalSessionByExternalIDParams,
41
45
  type CustomerUpdateByExternalIDParams,
42
46
  type CustomersPage,
43
47
  } from './customers';
@@ -54,8 +54,8 @@ export class DimensionalPriceGroups extends APIResource {
54
54
  * );
55
55
  * ```
56
56
  */
57
- retrieve(dimensionalPriceGroupId: string, options?: RequestOptions): APIPromise<DimensionalPriceGroup> {
58
- return this._client.get(path`/dimensional_price_groups/${dimensionalPriceGroupId}`, options);
57
+ retrieve(dimensionalPriceGroupID: string, options?: RequestOptions): APIPromise<DimensionalPriceGroup> {
58
+ return this._client.get(path`/dimensional_price_groups/${dimensionalPriceGroupID}`, options);
59
59
  }
60
60
 
61
61
  /**
@@ -72,11 +72,11 @@ export class DimensionalPriceGroups extends APIResource {
72
72
  * ```
73
73
  */
74
74
  update(
75
- dimensionalPriceGroupId: string,
75
+ dimensionalPriceGroupID: string,
76
76
  body: DimensionalPriceGroupUpdateParams,
77
77
  options?: RequestOptions,
78
78
  ): APIPromise<DimensionalPriceGroup> {
79
- return this._client.put(path`/dimensional_price_groups/${dimensionalPriceGroupId}`, { body, ...options });
79
+ return this._client.put(path`/dimensional_price_groups/${dimensionalPriceGroupID}`, { body, ...options });
80
80
  }
81
81
 
82
82
  /**
@@ -19,11 +19,11 @@ export class ExternalDimensionalPriceGroupID extends APIResource {
19
19
  * ```
20
20
  */
21
21
  retrieve(
22
- externalDimensionalPriceGroupId: string,
22
+ externalDimensionalPriceGroupID: string,
23
23
  options?: RequestOptions,
24
24
  ): APIPromise<DimensionalPriceGroupsAPI.DimensionalPriceGroup> {
25
25
  return this._client.get(
26
- path`/dimensional_price_groups/external_dimensional_price_group_id/${externalDimensionalPriceGroupId}`,
26
+ path`/dimensional_price_groups/external_dimensional_price_group_id/${externalDimensionalPriceGroupID}`,
27
27
  options,
28
28
  );
29
29
  }
@@ -42,12 +42,12 @@ export class ExternalDimensionalPriceGroupID extends APIResource {
42
42
  * ```
43
43
  */
44
44
  update(
45
- externalDimensionalPriceGroupId: string,
45
+ externalDimensionalPriceGroupID: string,
46
46
  body: ExternalDimensionalPriceGroupIDUpdateParams,
47
47
  options?: RequestOptions,
48
48
  ): APIPromise<DimensionalPriceGroupsAPI.DimensionalPriceGroup> {
49
49
  return this._client.put(
50
- path`/dimensional_price_groups/external_dimensional_price_group_id/${externalDimensionalPriceGroupId}`,
50
+ path`/dimensional_price_groups/external_dimensional_price_group_id/${externalDimensionalPriceGroupID}`,
51
51
  { body, ...options },
52
52
  );
53
53
  }
@@ -102,8 +102,8 @@ export class Backfills extends APIResource {
102
102
  * );
103
103
  * ```
104
104
  */
105
- close(backfillId: string, options?: RequestOptions): APIPromise<BackfillCloseResponse> {
106
- return this._client.post(path`/events/backfills/${backfillId}/close`, options);
105
+ close(backfillID: string, options?: RequestOptions): APIPromise<BackfillCloseResponse> {
106
+ return this._client.post(path`/events/backfills/${backfillID}/close`, options);
107
107
  }
108
108
 
109
109
  /**
@@ -116,8 +116,8 @@ export class Backfills extends APIResource {
116
116
  * );
117
117
  * ```
118
118
  */
119
- fetch(backfillId: string, options?: RequestOptions): APIPromise<BackfillFetchResponse> {
120
- return this._client.get(path`/events/backfills/${backfillId}`, options);
119
+ fetch(backfillID: string, options?: RequestOptions): APIPromise<BackfillFetchResponse> {
120
+ return this._client.get(path`/events/backfills/${backfillID}`, options);
121
121
  }
122
122
 
123
123
  /**
@@ -136,8 +136,8 @@ export class Backfills extends APIResource {
136
136
  * );
137
137
  * ```
138
138
  */
139
- revert(backfillId: string, options?: RequestOptions): APIPromise<BackfillRevertResponse> {
140
- return this._client.post(path`/events/backfills/${backfillId}/revert`, options);
139
+ revert(backfillID: string, options?: RequestOptions): APIPromise<BackfillRevertResponse> {
140
+ return this._client.post(path`/events/backfills/${backfillID}/revert`, options);
141
141
  }
142
142
  }
143
143
 
@@ -85,11 +85,11 @@ export class Events extends APIResource {
85
85
  * ```
86
86
  */
87
87
  update(
88
- eventId: string,
88
+ eventID: string,
89
89
  body: EventUpdateParams,
90
90
  options?: RequestOptions,
91
91
  ): APIPromise<EventUpdateResponse> {
92
- return this._client.put(path`/events/${eventId}`, { body, ...options });
92
+ return this._client.put(path`/events/${eventID}`, { body, ...options });
93
93
  }
94
94
 
95
95
  /**
@@ -139,8 +139,8 @@ export class Events extends APIResource {
139
139
  * const response = await client.events.deprecate('event_id');
140
140
  * ```
141
141
  */
142
- deprecate(eventId: string, options?: RequestOptions): APIPromise<EventDeprecateResponse> {
143
- return this._client.put(path`/events/${eventId}/deprecate`, options);
142
+ deprecate(eventID: string, options?: RequestOptions): APIPromise<EventDeprecateResponse> {
143
+ return this._client.put(path`/events/${eventID}/deprecate`, options);
144
144
  }
145
145
 
146
146
  /**
@@ -337,8 +337,8 @@ export class Events extends APIResource {
337
337
  * ```
338
338
  */
339
339
  ingest(params: EventIngestParams, options?: RequestOptions): APIPromise<EventIngestResponse> {
340
- const { backfill_id, debug, ...body } = params;
341
- return this._client.post('/ingest', { query: { backfill_id, debug }, body, ...options });
340
+ const { backfill_id, ...body } = params;
341
+ return this._client.post('/ingest', { query: { backfill_id }, body, ...options });
342
342
  }
343
343
 
344
344
  /**
@@ -390,11 +390,6 @@ export interface EventIngestResponse {
390
390
  * always be empty. This field will always be present.
391
391
  */
392
392
  validation_failed: Array<EventIngestResponse.ValidationFailed>;
393
-
394
- /**
395
- * @deprecated
396
- */
397
- debug?: EventIngestResponse.Debug | null;
398
393
  }
399
394
 
400
395
  export namespace EventIngestResponse {
@@ -410,15 +405,6 @@ export namespace EventIngestResponse {
410
405
  */
411
406
  validation_errors: Array<string>;
412
407
  }
413
-
414
- /**
415
- * @deprecated
416
- */
417
- export interface Debug {
418
- duplicate: Array<string>;
419
-
420
- ingested: Array<string>;
421
- }
422
408
  }
423
409
 
424
410
  export interface EventSearchResponse {
@@ -517,12 +503,6 @@ export interface EventIngestParams {
517
503
  * ties the ingested events to the backfill
518
504
  */
519
505
  backfill_id?: string | null;
520
-
521
- /**
522
- * @deprecated Query param: Pending Deprecation: Flag to enable additional debug
523
- * information in the endpoint response
524
- */
525
- debug?: boolean;
526
506
  }
527
507
 
528
508
  export namespace EventIngestParams {
@@ -46,9 +46,13 @@ export {
46
46
  type NewReportingConfiguration,
47
47
  type NewSphereConfiguration,
48
48
  type NewTaxJarConfiguration,
49
+ type CustomerCreatePortalSessionResponse,
50
+ type CustomerCreatePortalSessionByExternalIDResponse,
49
51
  type CustomerCreateParams,
50
52
  type CustomerUpdateParams,
51
53
  type CustomerListParams,
54
+ type CustomerCreatePortalSessionParams,
55
+ type CustomerCreatePortalSessionByExternalIDParams,
52
56
  type CustomerUpdateByExternalIDParams,
53
57
  type CustomersPage,
54
58
  } from './customers/customers';
@@ -57,8 +57,8 @@ export class Invoices extends APIResource {
57
57
  * const invoice = await client.invoices.update('invoice_id');
58
58
  * ```
59
59
  */
60
- update(invoiceId: string, body: InvoiceUpdateParams, options?: RequestOptions): APIPromise<Shared.Invoice> {
61
- return this._client.put(path`/invoices/${invoiceId}`, { body, ...options });
60
+ update(invoiceID: string, body: InvoiceUpdateParams, options?: RequestOptions): APIPromise<Shared.Invoice> {
61
+ return this._client.put(path`/invoices/${invoiceID}`, { body, ...options });
62
62
  }
63
63
 
64
64
  /**
@@ -110,12 +110,12 @@ export class Invoices extends APIResource {
110
110
  * ```
111
111
  */
112
112
  deleteLineItem(
113
- lineItemId: string,
113
+ lineItemID: string,
114
114
  params: InvoiceDeleteLineItemParams,
115
115
  options?: RequestOptions,
116
116
  ): APIPromise<void> {
117
- const { invoice_id: invoiceId } = params;
118
- return this._client.delete(path`/invoices/${invoiceId}/invoice_line_items/${lineItemId}`, {
117
+ const { invoice_id } = params;
118
+ return this._client.delete(path`/invoices/${invoice_id}/invoice_line_items/${lineItemID}`, {
119
119
  ...options,
120
120
  headers: buildHeaders([{ Accept: '*/*' }, options?.headers]),
121
121
  });
@@ -130,8 +130,8 @@ export class Invoices extends APIResource {
130
130
  * const invoice = await client.invoices.fetch('invoice_id');
131
131
  * ```
132
132
  */
133
- fetch(invoiceId: string, options?: RequestOptions): APIPromise<Shared.Invoice> {
134
- return this._client.get(path`/invoices/${invoiceId}`, options);
133
+ fetch(invoiceID: string, options?: RequestOptions): APIPromise<Shared.Invoice> {
134
+ return this._client.get(path`/invoices/${invoiceID}`, options);
135
135
  }
136
136
 
137
137
  /**
@@ -167,11 +167,11 @@ export class Invoices extends APIResource {
167
167
  * ```
168
168
  */
169
169
  issue(
170
- invoiceId: string,
170
+ invoiceID: string,
171
171
  body: InvoiceIssueParams | null | undefined = {},
172
172
  options?: RequestOptions,
173
173
  ): APIPromise<Shared.Invoice> {
174
- return this._client.post(path`/invoices/${invoiceId}/issue`, { body, ...options });
174
+ return this._client.post(path`/invoices/${invoiceID}/issue`, { body, ...options });
175
175
  }
176
176
 
177
177
  /**
@@ -193,11 +193,11 @@ export class Invoices extends APIResource {
193
193
  * ```
194
194
  */
195
195
  issueSummary(
196
- invoiceId: string,
196
+ invoiceID: string,
197
197
  body: InvoiceIssueSummaryParams | null | undefined = {},
198
198
  options?: RequestOptions,
199
199
  ): APIPromise<InvoiceIssueSummaryResponse> {
200
- return this._client.post(path`/invoices/summary/${invoiceId}/issue`, { body, ...options });
200
+ return this._client.post(path`/invoices/summary/${invoiceID}/issue`, { body, ...options });
201
201
  }
202
202
 
203
203
  /**
@@ -249,11 +249,11 @@ export class Invoices extends APIResource {
249
249
  * ```
250
250
  */
251
251
  markPaid(
252
- invoiceId: string,
252
+ invoiceID: string,
253
253
  body: InvoiceMarkPaidParams,
254
254
  options?: RequestOptions,
255
255
  ): APIPromise<Shared.Invoice> {
256
- return this._client.post(path`/invoices/${invoiceId}/mark_paid`, { body, ...options });
256
+ return this._client.post(path`/invoices/${invoiceID}/mark_paid`, { body, ...options });
257
257
  }
258
258
 
259
259
  /**
@@ -269,8 +269,80 @@ export class Invoices extends APIResource {
269
269
  * });
270
270
  * ```
271
271
  */
272
- pay(invoiceId: string, body: InvoicePayParams, options?: RequestOptions): APIPromise<Shared.Invoice> {
273
- return this._client.post(path`/invoices/${invoiceId}/pay`, { body, ...options });
272
+ pay(invoiceID: string, body: InvoicePayParams, options?: RequestOptions): APIPromise<Shared.Invoice> {
273
+ return this._client.post(path`/invoices/${invoiceID}/pay`, { body, ...options });
274
+ }
275
+
276
+ /**
277
+ * This endpoint triggers a regeneration of the PDF for a finalized invoice.
278
+ *
279
+ * The invoice must be finalized (`issued`, `paid`, `synced`, or `void`) and must
280
+ * already have an existing PDF. The original PDF is archived (not permanently
281
+ * deleted) to maintain an audit trail.
282
+ *
283
+ * **Important Legal Considerations:**
284
+ *
285
+ * Regenerating invoice PDFs may not be permitted in all jurisdictions. Many tax
286
+ * authorities require that issued invoices remain unmodified. Before using this
287
+ * endpoint, ensure that:
288
+ *
289
+ * - Your local tax regulations permit modification of issued billing documents
290
+ * - You have a legitimate business reason (e.g., fixing template errors, updating
291
+ * branding)
292
+ * - You maintain proper records of the original PDF (archived automatically by
293
+ * Orb)
294
+ *
295
+ * Recommended use cases:
296
+ *
297
+ * - Correcting template rendering issues
298
+ * - Applying updated company branding
299
+ * - Updating customer data that was incorrect at issuance
300
+ *
301
+ * @example
302
+ * ```ts
303
+ * const invoice = await client.invoices.regenerateInvoicePdf(
304
+ * 'invoice_id',
305
+ * );
306
+ * ```
307
+ */
308
+ regenerateInvoicePdf(invoiceID: string, options?: RequestOptions): APIPromise<Shared.Invoice> {
309
+ return this._client.post(path`/invoices/${invoiceID}/regenerate_invoice_pdf`, options);
310
+ }
311
+
312
+ /**
313
+ * This endpoint triggers a regeneration of the receipt PDF for a paid invoice.
314
+ *
315
+ * The invoice must be in `paid` status and must already have an existing receipt
316
+ * PDF. The original PDF is archived (not permanently deleted) to maintain an audit
317
+ * trail.
318
+ *
319
+ * **Important Legal Considerations:**
320
+ *
321
+ * Regenerating receipt PDFs may not be permitted in all jurisdictions. Many tax
322
+ * authorities require that issued receipts remain unmodified. Before using this
323
+ * endpoint, ensure that:
324
+ *
325
+ * - Your local tax regulations permit modification of issued billing documents
326
+ * - You have a legitimate business reason (e.g., fixing template errors, updating
327
+ * branding)
328
+ * - You maintain proper records of the original PDF (archived automatically by
329
+ * Orb)
330
+ *
331
+ * Recommended use cases:
332
+ *
333
+ * - Correcting template rendering issues
334
+ * - Applying updated company branding
335
+ * - Updating customer data that was incorrect at issuance
336
+ *
337
+ * @example
338
+ * ```ts
339
+ * const invoice = await client.invoices.regenerateReceiptPdf(
340
+ * 'invoice_id',
341
+ * );
342
+ * ```
343
+ */
344
+ regenerateReceiptPdf(invoiceID: string, options?: RequestOptions): APIPromise<Shared.Invoice> {
345
+ return this._client.post(path`/invoices/${invoiceID}/regenerate_receipt_pdf`, options);
274
346
  }
275
347
 
276
348
  /**
@@ -291,8 +363,8 @@ export class Invoices extends APIResource {
291
363
  * const invoice = await client.invoices.void('invoice_id');
292
364
  * ```
293
365
  */
294
- void(invoiceId: string, options?: RequestOptions): APIPromise<Shared.Invoice> {
295
- return this._client.post(path`/invoices/${invoiceId}/void`, options);
366
+ void(invoiceID: string, options?: RequestOptions): APIPromise<Shared.Invoice> {
367
+ return this._client.post(path`/invoices/${invoiceID}/void`, options);
296
368
  }
297
369
  }
298
370
 
@@ -33,8 +33,8 @@ export class Items extends APIResource {
33
33
  * const item = await client.items.update('item_id');
34
34
  * ```
35
35
  */
36
- update(itemId: string, body: ItemUpdateParams, options?: RequestOptions): APIPromise<Item> {
37
- return this._client.put(path`/items/${itemId}`, { body, ...options });
36
+ update(itemID: string, body: ItemUpdateParams, options?: RequestOptions): APIPromise<Item> {
37
+ return this._client.put(path`/items/${itemID}`, { body, ...options });
38
38
  }
39
39
 
40
40
  /**
@@ -64,8 +64,8 @@ export class Items extends APIResource {
64
64
  * const item = await client.items.archive('item_id');
65
65
  * ```
66
66
  */
67
- archive(itemId: string, options?: RequestOptions): APIPromise<Item> {
68
- return this._client.post(path`/items/${itemId}/archive`, options);
67
+ archive(itemID: string, options?: RequestOptions): APIPromise<Item> {
68
+ return this._client.post(path`/items/${itemID}/archive`, options);
69
69
  }
70
70
 
71
71
  /**
@@ -76,8 +76,8 @@ export class Items extends APIResource {
76
76
  * const item = await client.items.fetch('item_id');
77
77
  * ```
78
78
  */
79
- fetch(itemId: string, options?: RequestOptions): APIPromise<Item> {
80
- return this._client.get(path`/items/${itemId}`, options);
79
+ fetch(itemID: string, options?: RequestOptions): APIPromise<Item> {
80
+ return this._client.get(path`/items/${itemID}`, options);
81
81
  }
82
82
  }
83
83
 
@@ -28,8 +28,8 @@ export class LicenseTypes extends APIResource {
28
28
  * Use this endpoint to retrieve details about a specific license type, including
29
29
  * its name and grouping key.
30
30
  */
31
- retrieve(licenseTypeId: string, options?: RequestOptions): APIPromise<LicenseTypeRetrieveResponse> {
32
- return this._client.get(path`/license_types/${licenseTypeId}`, options);
31
+ retrieve(licenseTypeID: string, options?: RequestOptions): APIPromise<LicenseTypeRetrieveResponse> {
32
+ return this._client.get(path`/license_types/${licenseTypeID}`, options);
33
33
  }
34
34
 
35
35
  /**
@@ -26,11 +26,11 @@ export class ExternalLicenses extends APIResource {
26
26
  * ```
27
27
  */
28
28
  getUsage(
29
- externalLicenseId: string,
29
+ externalLicenseID: string,
30
30
  query: ExternalLicenseGetUsageParams,
31
31
  options?: RequestOptions,
32
32
  ): APIPromise<ExternalLicenseGetUsageResponse> {
33
- return this._client.get(path`/licenses/external_licenses/${externalLicenseId}/usage`, {
33
+ return this._client.get(path`/licenses/external_licenses/${externalLicenseID}/usage`, {
34
34
  query,
35
35
  ...options,
36
36
  });
@@ -56,8 +56,8 @@ export class Licenses extends APIResource {
56
56
  * );
57
57
  * ```
58
58
  */
59
- retrieve(licenseId: string, options?: RequestOptions): APIPromise<LicenseRetrieveResponse> {
60
- return this._client.get(path`/licenses/${licenseId}`, options);
59
+ retrieve(licenseID: string, options?: RequestOptions): APIPromise<LicenseRetrieveResponse> {
60
+ return this._client.get(path`/licenses/${licenseID}`, options);
61
61
  }
62
62
 
63
63
  /**
@@ -95,11 +95,11 @@ export class Licenses extends APIResource {
95
95
  * ```
96
96
  */
97
97
  deactivate(
98
- licenseId: string,
98
+ licenseID: string,
99
99
  body: LicenseDeactivateParams,
100
100
  options?: RequestOptions,
101
101
  ): APIPromise<LicenseDeactivateResponse> {
102
- return this._client.post(path`/licenses/${licenseId}/deactivate`, { body, ...options });
102
+ return this._client.post(path`/licenses/${licenseID}/deactivate`, { body, ...options });
103
103
  }
104
104
 
105
105
  /**
@@ -117,11 +117,11 @@ export class Licenses extends APIResource {
117
117
  * ```
118
118
  */
119
119
  retrieveByExternalID(
120
- externalLicenseId: string,
120
+ externalLicenseID: string,
121
121
  query: LicenseRetrieveByExternalIDParams,
122
122
  options?: RequestOptions,
123
123
  ): APIPromise<LicenseRetrieveByExternalIDResponse> {
124
- return this._client.get(path`/licenses/external_license_id/${externalLicenseId}`, { query, ...options });
124
+ return this._client.get(path`/licenses/external_license_id/${externalLicenseID}`, { query, ...options });
125
125
  }
126
126
  }
127
127
 
@@ -38,11 +38,11 @@ export class Usage extends APIResource {
38
38
  * ```
39
39
  */
40
40
  getUsage(
41
- licenseId: string,
41
+ licenseID: string,
42
42
  query: UsageGetUsageParams | null | undefined = {},
43
43
  options?: RequestOptions,
44
44
  ): APIPromise<UsageGetUsageResponse> {
45
- return this._client.get(path`/licenses/${licenseId}/usage`, { query, ...options });
45
+ return this._client.get(path`/licenses/${licenseID}/usage`, { query, ...options });
46
46
  }
47
47
  }
48
48