orb-billing 6.0.2 → 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 (260) hide show
  1. package/CHANGELOG.md +15 -0
  2. package/client.d.mts +5 -10
  3. package/client.d.mts.map +1 -1
  4. package/client.d.ts +5 -10
  5. package/client.d.ts.map +1 -1
  6. package/client.js +140 -149
  7. package/client.js.map +1 -1
  8. package/client.mjs +138 -146
  9. package/client.mjs.map +1 -1
  10. package/core/api-promise.d.mts +2 -2
  11. package/core/api-promise.d.mts.map +1 -1
  12. package/core/api-promise.d.ts +2 -2
  13. package/core/api-promise.d.ts.map +1 -1
  14. package/core/api-promise.js.map +1 -1
  15. package/core/api-promise.mjs.map +1 -1
  16. package/core/pagination.d.mts +4 -4
  17. package/core/pagination.d.mts.map +1 -1
  18. package/core/pagination.d.ts +4 -4
  19. package/core/pagination.d.ts.map +1 -1
  20. package/core/pagination.js.map +1 -1
  21. package/core/pagination.mjs.map +1 -1
  22. package/core/resource.d.mts +3 -3
  23. package/core/resource.d.mts.map +1 -1
  24. package/core/resource.d.ts +3 -3
  25. package/core/resource.d.ts.map +1 -1
  26. package/core/resource.js.map +1 -1
  27. package/core/resource.mjs.map +1 -1
  28. package/index.d.mts +1 -1
  29. package/index.d.mts.map +1 -1
  30. package/index.d.ts +1 -1
  31. package/index.d.ts.map +1 -1
  32. package/index.js +1 -2
  33. package/index.js.map +1 -1
  34. package/index.mjs +1 -1
  35. package/index.mjs.map +1 -1
  36. package/internal/parse.d.mts +2 -2
  37. package/internal/parse.d.mts.map +1 -1
  38. package/internal/parse.d.ts +2 -2
  39. package/internal/parse.d.ts.map +1 -1
  40. package/internal/parse.js.map +1 -1
  41. package/internal/parse.mjs.map +1 -1
  42. package/internal/uploads.d.mts +4 -4
  43. package/internal/uploads.d.mts.map +1 -1
  44. package/internal/uploads.d.ts +4 -4
  45. package/internal/uploads.d.ts.map +1 -1
  46. package/internal/uploads.js.map +1 -1
  47. package/internal/uploads.mjs.map +1 -1
  48. package/internal/utils/log.d.mts +3 -3
  49. package/internal/utils/log.d.mts.map +1 -1
  50. package/internal/utils/log.d.ts +3 -3
  51. package/internal/utils/log.d.ts.map +1 -1
  52. package/internal/utils/log.js.map +1 -1
  53. package/internal/utils/log.mjs.map +1 -1
  54. package/package.json +4 -4
  55. package/resources/alerts.d.mts +18 -7
  56. package/resources/alerts.d.mts.map +1 -1
  57. package/resources/alerts.d.ts +18 -7
  58. package/resources/alerts.d.ts.map +1 -1
  59. package/resources/alerts.js +31 -14
  60. package/resources/alerts.js.map +1 -1
  61. package/resources/alerts.mjs +31 -14
  62. package/resources/alerts.mjs.map +1 -1
  63. package/resources/beta/beta.d.mts +2 -2
  64. package/resources/beta/beta.d.ts +2 -2
  65. package/resources/beta/beta.js +6 -6
  66. package/resources/beta/beta.js.map +1 -1
  67. package/resources/beta/beta.mjs +6 -6
  68. package/resources/beta/beta.mjs.map +1 -1
  69. package/resources/beta/external-plan-id.d.mts +2 -2
  70. package/resources/beta/external-plan-id.d.ts +2 -2
  71. package/resources/beta/external-plan-id.js +6 -6
  72. package/resources/beta/external-plan-id.js.map +1 -1
  73. package/resources/beta/external-plan-id.mjs +6 -6
  74. package/resources/beta/external-plan-id.mjs.map +1 -1
  75. package/resources/coupons/coupons.d.mts +2 -2
  76. package/resources/coupons/coupons.d.ts +2 -2
  77. package/resources/coupons/coupons.js +4 -4
  78. package/resources/coupons/coupons.mjs +4 -4
  79. package/resources/coupons/subscriptions.d.mts +1 -1
  80. package/resources/coupons/subscriptions.d.ts +1 -1
  81. package/resources/coupons/subscriptions.js +2 -2
  82. package/resources/coupons/subscriptions.mjs +2 -2
  83. package/resources/credit-blocks.d.mts +3 -3
  84. package/resources/credit-blocks.d.ts +3 -3
  85. package/resources/credit-blocks.js +6 -6
  86. package/resources/credit-blocks.mjs +6 -6
  87. package/resources/credit-notes.d.mts +1 -1
  88. package/resources/credit-notes.d.ts +1 -1
  89. package/resources/credit-notes.js +2 -2
  90. package/resources/credit-notes.mjs +2 -2
  91. package/resources/customers/balance-transactions.d.mts +2 -2
  92. package/resources/customers/balance-transactions.d.ts +2 -2
  93. package/resources/customers/balance-transactions.js +4 -4
  94. package/resources/customers/balance-transactions.mjs +4 -4
  95. package/resources/customers/costs.d.mts +2 -2
  96. package/resources/customers/costs.d.ts +2 -2
  97. package/resources/customers/costs.js +4 -4
  98. package/resources/customers/costs.mjs +4 -4
  99. package/resources/customers/credits/credits.d.mts +2 -2
  100. package/resources/customers/credits/credits.d.ts +2 -2
  101. package/resources/customers/credits/credits.js +4 -4
  102. package/resources/customers/credits/credits.mjs +4 -4
  103. package/resources/customers/credits/ledger.d.mts +4 -4
  104. package/resources/customers/credits/ledger.d.ts +4 -4
  105. package/resources/customers/credits/ledger.js +8 -8
  106. package/resources/customers/credits/ledger.mjs +8 -8
  107. package/resources/customers/credits/top-ups.d.mts +6 -6
  108. package/resources/customers/credits/top-ups.d.ts +6 -6
  109. package/resources/customers/credits/top-ups.js +14 -14
  110. package/resources/customers/credits/top-ups.js.map +1 -1
  111. package/resources/customers/credits/top-ups.mjs +14 -14
  112. package/resources/customers/credits/top-ups.mjs.map +1 -1
  113. package/resources/customers/customers.d.mts +65 -7
  114. package/resources/customers/customers.d.mts.map +1 -1
  115. package/resources/customers/customers.d.ts +65 -7
  116. package/resources/customers/customers.d.ts.map +1 -1
  117. package/resources/customers/customers.js +35 -12
  118. package/resources/customers/customers.js.map +1 -1
  119. package/resources/customers/customers.mjs +35 -12
  120. package/resources/customers/customers.mjs.map +1 -1
  121. package/resources/customers/index.d.mts +1 -1
  122. package/resources/customers/index.d.mts.map +1 -1
  123. package/resources/customers/index.d.ts +1 -1
  124. package/resources/customers/index.d.ts.map +1 -1
  125. package/resources/customers/index.js.map +1 -1
  126. package/resources/customers/index.mjs.map +1 -1
  127. package/resources/dimensional-price-groups/dimensional-price-groups.d.mts +2 -2
  128. package/resources/dimensional-price-groups/dimensional-price-groups.d.ts +2 -2
  129. package/resources/dimensional-price-groups/dimensional-price-groups.js +4 -4
  130. package/resources/dimensional-price-groups/dimensional-price-groups.mjs +4 -4
  131. package/resources/dimensional-price-groups/external-dimensional-price-group-id.d.mts +2 -2
  132. package/resources/dimensional-price-groups/external-dimensional-price-group-id.d.ts +2 -2
  133. package/resources/dimensional-price-groups/external-dimensional-price-group-id.js +4 -4
  134. package/resources/dimensional-price-groups/external-dimensional-price-group-id.mjs +4 -4
  135. package/resources/events/backfills.d.mts +3 -3
  136. package/resources/events/backfills.d.ts +3 -3
  137. package/resources/events/backfills.js +6 -6
  138. package/resources/events/backfills.mjs +6 -6
  139. package/resources/events/events.d.mts +2 -18
  140. package/resources/events/events.d.mts.map +1 -1
  141. package/resources/events/events.d.ts +2 -18
  142. package/resources/events/events.d.ts.map +1 -1
  143. package/resources/events/events.js +6 -6
  144. package/resources/events/events.js.map +1 -1
  145. package/resources/events/events.mjs +6 -6
  146. package/resources/events/events.mjs.map +1 -1
  147. package/resources/index.d.mts +1 -1
  148. package/resources/index.d.mts.map +1 -1
  149. package/resources/index.d.ts +1 -1
  150. package/resources/index.d.ts.map +1 -1
  151. package/resources/index.js.map +1 -1
  152. package/resources/index.mjs.map +1 -1
  153. package/resources/invoices.d.mts +74 -8
  154. package/resources/invoices.d.mts.map +1 -1
  155. package/resources/invoices.d.ts +74 -8
  156. package/resources/invoices.d.ts.map +1 -1
  157. package/resources/invoices.js +87 -17
  158. package/resources/invoices.js.map +1 -1
  159. package/resources/invoices.mjs +87 -17
  160. package/resources/invoices.mjs.map +1 -1
  161. package/resources/items.d.mts +3 -3
  162. package/resources/items.d.ts +3 -3
  163. package/resources/items.js +6 -6
  164. package/resources/items.mjs +6 -6
  165. package/resources/license-types.d.mts +1 -1
  166. package/resources/license-types.d.ts +1 -1
  167. package/resources/license-types.js +2 -2
  168. package/resources/license-types.mjs +2 -2
  169. package/resources/licenses/external-licenses.d.mts +1 -1
  170. package/resources/licenses/external-licenses.d.ts +1 -1
  171. package/resources/licenses/external-licenses.js +2 -2
  172. package/resources/licenses/external-licenses.mjs +2 -2
  173. package/resources/licenses/licenses.d.mts +3 -3
  174. package/resources/licenses/licenses.d.ts +3 -3
  175. package/resources/licenses/licenses.js +6 -6
  176. package/resources/licenses/licenses.mjs +6 -6
  177. package/resources/licenses/usage.d.mts +1 -1
  178. package/resources/licenses/usage.d.ts +1 -1
  179. package/resources/licenses/usage.js +2 -2
  180. package/resources/licenses/usage.mjs +2 -2
  181. package/resources/metrics.d.mts +2 -2
  182. package/resources/metrics.d.ts +2 -2
  183. package/resources/metrics.js +4 -4
  184. package/resources/metrics.mjs +4 -4
  185. package/resources/plans/external-plan-id.d.mts +2 -2
  186. package/resources/plans/external-plan-id.d.ts +2 -2
  187. package/resources/plans/external-plan-id.js +4 -4
  188. package/resources/plans/external-plan-id.mjs +4 -4
  189. package/resources/plans/migrations.d.mts +3 -3
  190. package/resources/plans/migrations.d.ts +3 -3
  191. package/resources/plans/migrations.js +8 -8
  192. package/resources/plans/migrations.js.map +1 -1
  193. package/resources/plans/migrations.mjs +8 -8
  194. package/resources/plans/migrations.mjs.map +1 -1
  195. package/resources/plans/plans.d.mts +2 -2
  196. package/resources/plans/plans.d.ts +2 -2
  197. package/resources/plans/plans.js +4 -4
  198. package/resources/plans/plans.mjs +4 -4
  199. package/resources/prices/external-price-id.d.mts +2 -2
  200. package/resources/prices/external-price-id.d.ts +2 -2
  201. package/resources/prices/external-price-id.js +4 -4
  202. package/resources/prices/external-price-id.mjs +4 -4
  203. package/resources/prices/prices.d.mts +3 -3
  204. package/resources/prices/prices.d.ts +3 -3
  205. package/resources/prices/prices.js +6 -6
  206. package/resources/prices/prices.mjs +6 -6
  207. package/resources/subscription-changes.d.mts +3 -3
  208. package/resources/subscription-changes.d.ts +3 -3
  209. package/resources/subscription-changes.js +6 -6
  210. package/resources/subscription-changes.mjs +6 -6
  211. package/resources/subscriptions.d.mts +15 -15
  212. package/resources/subscriptions.d.ts +15 -15
  213. package/resources/subscriptions.js +30 -30
  214. package/resources/subscriptions.mjs +30 -30
  215. package/src/client.ts +11 -8
  216. package/src/core/api-promise.ts +4 -7
  217. package/src/core/pagination.ts +5 -5
  218. package/src/core/resource.ts +3 -3
  219. package/src/index.ts +1 -1
  220. package/src/internal/parse.ts +2 -2
  221. package/src/internal/uploads.ts +5 -5
  222. package/src/internal/utils/log.ts +3 -3
  223. package/src/resources/alerts.ts +32 -14
  224. package/src/resources/beta/beta.ts +6 -6
  225. package/src/resources/beta/external-plan-id.ts +6 -6
  226. package/src/resources/coupons/coupons.ts +4 -4
  227. package/src/resources/coupons/subscriptions.ts +2 -2
  228. package/src/resources/credit-blocks.ts +6 -6
  229. package/src/resources/credit-notes.ts +2 -2
  230. package/src/resources/customers/balance-transactions.ts +4 -4
  231. package/src/resources/customers/costs.ts +4 -4
  232. package/src/resources/customers/credits/credits.ts +4 -4
  233. package/src/resources/customers/credits/ledger.ts +8 -8
  234. package/src/resources/customers/credits/top-ups.ts +14 -14
  235. package/src/resources/customers/customers.ts +105 -12
  236. package/src/resources/customers/index.ts +4 -0
  237. package/src/resources/dimensional-price-groups/dimensional-price-groups.ts +4 -4
  238. package/src/resources/dimensional-price-groups/external-dimensional-price-group-id.ts +4 -4
  239. package/src/resources/events/backfills.ts +6 -6
  240. package/src/resources/events/events.ts +6 -26
  241. package/src/resources/index.ts +4 -0
  242. package/src/resources/invoices.ts +89 -17
  243. package/src/resources/items.ts +6 -6
  244. package/src/resources/license-types.ts +2 -2
  245. package/src/resources/licenses/external-licenses.ts +2 -2
  246. package/src/resources/licenses/licenses.ts +6 -6
  247. package/src/resources/licenses/usage.ts +2 -2
  248. package/src/resources/metrics.ts +4 -4
  249. package/src/resources/plans/external-plan-id.ts +4 -4
  250. package/src/resources/plans/migrations.ts +8 -8
  251. package/src/resources/plans/plans.ts +4 -4
  252. package/src/resources/prices/external-price-id.ts +4 -4
  253. package/src/resources/prices/prices.ts +6 -6
  254. package/src/resources/subscription-changes.ts +6 -6
  255. package/src/resources/subscriptions.ts +30 -30
  256. package/src/version.ts +1 -1
  257. package/version.d.mts +1 -1
  258. package/version.d.ts +1 -1
  259. package/version.js +1 -1
  260. package/version.mjs +1 -1
@@ -5,6 +5,7 @@ import * as AlertsAPI from './alerts';
5
5
  import * as Shared from './shared';
6
6
  import { APIPromise } from '../core/api-promise';
7
7
  import { Page, type PageParams, PagePromise } from '../core/pagination';
8
+ import { buildHeaders } from '../internal/headers';
8
9
  import { RequestOptions } from '../internal/request-options';
9
10
  import { path } from '../internal/utils/path';
10
11
 
@@ -18,15 +19,15 @@ export class Alerts extends APIResource {
18
19
  /**
19
20
  * This endpoint retrieves an alert by its ID.
20
21
  */
21
- retrieve(alertId: string, options?: RequestOptions): APIPromise<Alert> {
22
- return this._client.get(path`/alerts/${alertId}`, options);
22
+ retrieve(alertID: string, options?: RequestOptions): APIPromise<Alert> {
23
+ return this._client.get(path`/alerts/${alertID}`, options);
23
24
  }
24
25
 
25
26
  /**
26
27
  * This endpoint updates the thresholds of an alert.
27
28
  */
28
- update(alertConfigurationId: string, body: AlertUpdateParams, options?: RequestOptions): APIPromise<Alert> {
29
- return this._client.put(path`/alerts/${alertConfigurationId}`, { body, ...options });
29
+ update(alertConfigurationID: string, body: AlertUpdateParams, options?: RequestOptions): APIPromise<Alert> {
30
+ return this._client.put(path`/alerts/${alertConfigurationID}`, { body, ...options });
30
31
  }
31
32
 
32
33
  /**
@@ -49,6 +50,23 @@ export class Alerts extends APIResource {
49
50
  return this._client.getAPIList('/alerts', Page<Alert>, { query, ...options });
50
51
  }
51
52
 
53
+ /**
54
+ * This endpoint trashes a subscription- or customer-scoped alert. The alert is
55
+ * soft-deleted: it stops firing immediately and no longer appears in fetch or list
56
+ * responses, while the underlying record is retained internally for audit.
57
+ *
58
+ * Plan-level alerts cannot be trashed via the API — disable them instead
59
+ * (`POST /v1/alerts/{alert_configuration_id}/disable`). Their removal would need
60
+ * to be unwound from every subscription the alert was propagated to, which isn't
61
+ * supported yet.
62
+ */
63
+ delete(alertConfigurationID: string, options?: RequestOptions): APIPromise<void> {
64
+ return this._client.delete(path`/alerts/${alertConfigurationID}`, {
65
+ ...options,
66
+ headers: buildHeaders([{ Accept: '*/*' }, options?.headers]),
67
+ });
68
+ }
69
+
52
70
  /**
53
71
  * This endpoint creates a new alert to monitor a customer's credit balance. There
54
72
  * are three types of alerts that can be scoped to customers:
@@ -60,11 +78,11 @@ export class Alerts extends APIResource {
60
78
  * require thresholds.
61
79
  */
62
80
  createForCustomer(
63
- customerId: string,
81
+ customerID: string,
64
82
  body: AlertCreateForCustomerParams,
65
83
  options?: RequestOptions,
66
84
  ): APIPromise<Alert> {
67
- return this._client.post(path`/alerts/customer_id/${customerId}`, { body, ...options });
85
+ return this._client.post(path`/alerts/customer_id/${customerID}`, { body, ...options });
68
86
  }
69
87
 
70
88
  /**
@@ -78,11 +96,11 @@ export class Alerts extends APIResource {
78
96
  * require thresholds.
79
97
  */
80
98
  createForExternalCustomer(
81
- externalCustomerId: string,
99
+ externalCustomerID: string,
82
100
  body: AlertCreateForExternalCustomerParams,
83
101
  options?: RequestOptions,
84
102
  ): APIPromise<Alert> {
85
- return this._client.post(path`/alerts/external_customer_id/${externalCustomerId}`, { body, ...options });
103
+ return this._client.post(path`/alerts/external_customer_id/${externalCustomerID}`, { body, ...options });
86
104
  }
87
105
 
88
106
  /**
@@ -99,11 +117,11 @@ export class Alerts extends APIResource {
99
117
  * usage or cost conditions met during the current billing cycle.
100
118
  */
101
119
  createForSubscription(
102
- subscriptionId: string,
120
+ subscriptionID: string,
103
121
  body: AlertCreateForSubscriptionParams,
104
122
  options?: RequestOptions,
105
123
  ): APIPromise<Alert> {
106
- return this._client.post(path`/alerts/subscription_id/${subscriptionId}`, { body, ...options });
124
+ return this._client.post(path`/alerts/subscription_id/${subscriptionID}`, { body, ...options });
107
125
  }
108
126
 
109
127
  /**
@@ -112,12 +130,12 @@ export class Alerts extends APIResource {
112
130
  * `subscription_id` is not required for customer or subscription level alerts.
113
131
  */
114
132
  disable(
115
- alertConfigurationId: string,
133
+ alertConfigurationID: string,
116
134
  params: AlertDisableParams | null | undefined = {},
117
135
  options?: RequestOptions,
118
136
  ): APIPromise<Alert> {
119
137
  const { subscription_id } = params ?? {};
120
- return this._client.post(path`/alerts/${alertConfigurationId}/disable`, {
138
+ return this._client.post(path`/alerts/${alertConfigurationID}/disable`, {
121
139
  query: { subscription_id },
122
140
  ...options,
123
141
  });
@@ -129,12 +147,12 @@ export class Alerts extends APIResource {
129
147
  * `subscription_id` is not required for customer or subscription level alerts.
130
148
  */
131
149
  enable(
132
- alertConfigurationId: string,
150
+ alertConfigurationID: string,
133
151
  params: AlertEnableParams | null | undefined = {},
134
152
  options?: RequestOptions,
135
153
  ): APIPromise<Alert> {
136
154
  const { subscription_id } = params ?? {};
137
- return this._client.post(path`/alerts/${alertConfigurationId}/enable`, {
155
+ return this._client.post(path`/alerts/${alertConfigurationID}/enable`, {
138
156
  query: { subscription_id },
139
157
  ...options,
140
158
  });
@@ -26,11 +26,11 @@ export class Beta extends APIResource {
26
26
  * This endpoint allows the creation of a new plan version for an existing plan.
27
27
  */
28
28
  createPlanVersion(
29
- planId: string,
29
+ planID: string,
30
30
  body: BetaCreatePlanVersionParams,
31
31
  options?: RequestOptions,
32
32
  ): APIPromise<PlanVersion> {
33
- return this._client.post(path`/plans/${planId}/versions`, { body, ...options });
33
+ return this._client.post(path`/plans/${planID}/versions`, { body, ...options });
34
34
  }
35
35
 
36
36
  /**
@@ -42,19 +42,19 @@ export class Beta extends APIResource {
42
42
  params: BetaFetchPlanVersionParams,
43
43
  options?: RequestOptions,
44
44
  ): APIPromise<PlanVersion> {
45
- const { plan_id: planId } = params;
46
- return this._client.get(path`/plans/${planId}/versions/${version}`, options);
45
+ const { plan_id } = params;
46
+ return this._client.get(path`/plans/${plan_id}/versions/${version}`, options);
47
47
  }
48
48
 
49
49
  /**
50
50
  * This endpoint allows setting the default version of a plan.
51
51
  */
52
52
  setDefaultPlanVersion(
53
- planId: string,
53
+ planID: string,
54
54
  body: BetaSetDefaultPlanVersionParams,
55
55
  options?: RequestOptions,
56
56
  ): APIPromise<PlansAPI.Plan> {
57
- return this._client.post(path`/plans/${planId}/set_default_version`, { body, ...options });
57
+ return this._client.post(path`/plans/${planID}/set_default_version`, { body, ...options });
58
58
  }
59
59
  }
60
60
 
@@ -18,11 +18,11 @@ export class ExternalPlanID extends APIResource {
18
18
  * This endpoint allows the creation of a new plan version for an existing plan.
19
19
  */
20
20
  createPlanVersion(
21
- externalPlanId: string,
21
+ externalPlanID: string,
22
22
  body: ExternalPlanIDCreatePlanVersionParams,
23
23
  options?: RequestOptions,
24
24
  ): APIPromise<BetaAPI.PlanVersion> {
25
- return this._client.post(path`/plans/external_plan_id/${externalPlanId}/versions`, { body, ...options });
25
+ return this._client.post(path`/plans/external_plan_id/${externalPlanID}/versions`, { body, ...options });
26
26
  }
27
27
 
28
28
  /**
@@ -34,19 +34,19 @@ export class ExternalPlanID extends APIResource {
34
34
  params: ExternalPlanIDFetchPlanVersionParams,
35
35
  options?: RequestOptions,
36
36
  ): APIPromise<BetaAPI.PlanVersion> {
37
- const { external_plan_id: externalPlanId } = params;
38
- return this._client.get(path`/plans/external_plan_id/${externalPlanId}/versions/${version}`, options);
37
+ const { external_plan_id } = params;
38
+ return this._client.get(path`/plans/external_plan_id/${external_plan_id}/versions/${version}`, options);
39
39
  }
40
40
 
41
41
  /**
42
42
  * This endpoint allows setting the default version of a plan.
43
43
  */
44
44
  setDefaultPlanVersion(
45
- externalPlanId: string,
45
+ externalPlanID: string,
46
46
  body: ExternalPlanIDSetDefaultPlanVersionParams,
47
47
  options?: RequestOptions,
48
48
  ): APIPromise<PlansAPI.Plan> {
49
- return this._client.post(path`/plans/external_plan_id/${externalPlanId}/set_default_version`, {
49
+ return this._client.post(path`/plans/external_plan_id/${externalPlanID}/set_default_version`, {
50
50
  body,
51
51
  ...options,
52
52
  });
@@ -66,8 +66,8 @@ export class Coupons extends APIResource {
66
66
  * const coupon = await client.coupons.archive('coupon_id');
67
67
  * ```
68
68
  */
69
- archive(couponId: string, options?: RequestOptions): APIPromise<Coupon> {
70
- return this._client.post(path`/coupons/${couponId}/archive`, options);
69
+ archive(couponID: string, options?: RequestOptions): APIPromise<Coupon> {
70
+ return this._client.post(path`/coupons/${couponID}/archive`, options);
71
71
  }
72
72
 
73
73
  /**
@@ -80,8 +80,8 @@ export class Coupons extends APIResource {
80
80
  * const coupon = await client.coupons.fetch('coupon_id');
81
81
  * ```
82
82
  */
83
- fetch(couponId: string, options?: RequestOptions): APIPromise<Coupon> {
84
- return this._client.get(path`/coupons/${couponId}`, options);
83
+ fetch(couponID: string, options?: RequestOptions): APIPromise<Coupon> {
84
+ return this._client.get(path`/coupons/${couponID}`, options);
85
85
  }
86
86
  }
87
87
 
@@ -28,12 +28,12 @@ export class Subscriptions extends APIResource {
28
28
  * ```
29
29
  */
30
30
  list(
31
- couponId: string,
31
+ couponID: string,
32
32
  query: SubscriptionListParams | null | undefined = {},
33
33
  options?: RequestOptions,
34
34
  ): PagePromise<SubscriptionsPage, SubscriptionsAPI.Subscription> {
35
35
  return this._client.getAPIList(
36
- path`/coupons/${couponId}/subscriptions`,
36
+ path`/coupons/${couponID}/subscriptions`,
37
37
  Page<SubscriptionsAPI.Subscription>,
38
38
  { query, ...options },
39
39
  );
@@ -14,8 +14,8 @@ export class CreditBlocks extends APIResource {
14
14
  /**
15
15
  * This endpoint returns a credit block identified by its block_id.
16
16
  */
17
- retrieve(blockId: string, options?: RequestOptions): APIPromise<CreditBlockRetrieveResponse> {
18
- return this._client.get(path`/credit_blocks/${blockId}`, options);
17
+ retrieve(blockID: string, options?: RequestOptions): APIPromise<CreditBlockRetrieveResponse> {
18
+ return this._client.get(path`/credit_blocks/${blockID}`, options);
19
19
  }
20
20
 
21
21
  /**
@@ -35,8 +35,8 @@ export class CreditBlocks extends APIResource {
35
35
  * reflect the state as if credits from the deleted block were never applied.
36
36
  * </Note>
37
37
  */
38
- delete(blockId: string, options?: RequestOptions): APIPromise<void> {
39
- return this._client.delete(path`/credit_blocks/${blockId}`, {
38
+ delete(blockID: string, options?: RequestOptions): APIPromise<void> {
39
+ return this._client.delete(path`/credit_blocks/${blockID}`, {
40
40
  ...options,
41
41
  headers: buildHeaders([{ Accept: '*/*' }, options?.headers]),
42
42
  });
@@ -61,8 +61,8 @@ export class CreditBlocks extends APIResource {
61
61
  * future releases. Please contact support before building production integrations
62
62
  * against this endpoint.**
63
63
  */
64
- listInvoices(blockId: string, options?: RequestOptions): APIPromise<CreditBlockListInvoicesResponse> {
65
- return this._client.get(path`/credit_blocks/${blockId}/invoices`, options);
64
+ listInvoices(blockID: string, options?: RequestOptions): APIPromise<CreditBlockListInvoicesResponse> {
65
+ return this._client.get(path`/credit_blocks/${blockID}/invoices`, options);
66
66
  }
67
67
  }
68
68
 
@@ -90,8 +90,8 @@ export class CreditNotes extends APIResource {
90
90
  * );
91
91
  * ```
92
92
  */
93
- fetch(creditNoteId: string, options?: RequestOptions): APIPromise<Shared.CreditNote> {
94
- return this._client.get(path`/credit_notes/${creditNoteId}`, options);
93
+ fetch(creditNoteID: string, options?: RequestOptions): APIPromise<Shared.CreditNote> {
94
+ return this._client.get(path`/credit_notes/${creditNoteID}`, options);
95
95
  }
96
96
  }
97
97
 
@@ -29,11 +29,11 @@ export class BalanceTransactions extends APIResource {
29
29
  * returns back the newly created transaction.
30
30
  */
31
31
  create(
32
- customerId: string,
32
+ customerID: string,
33
33
  body: BalanceTransactionCreateParams,
34
34
  options?: RequestOptions,
35
35
  ): APIPromise<BalanceTransactionCreateResponse> {
36
- return this._client.post(path`/customers/${customerId}/balance_transactions`, { body, ...options });
36
+ return this._client.post(path`/customers/${customerID}/balance_transactions`, { body, ...options });
37
37
  }
38
38
 
39
39
  /**
@@ -60,12 +60,12 @@ export class BalanceTransactions extends APIResource {
60
60
  * all adjustments and invoice applications.
61
61
  */
62
62
  list(
63
- customerId: string,
63
+ customerID: string,
64
64
  query: BalanceTransactionListParams | null | undefined = {},
65
65
  options?: RequestOptions,
66
66
  ): PagePromise<BalanceTransactionListResponsesPage, BalanceTransactionListResponse> {
67
67
  return this._client.getAPIList(
68
- path`/customers/${customerId}/balance_transactions`,
68
+ path`/customers/${customerID}/balance_transactions`,
69
69
  Page<BalanceTransactionListResponse>,
70
70
  { query, ...options },
71
71
  );
@@ -143,11 +143,11 @@ export class Costs extends APIResource {
143
143
  * `grouping_value` and `secondary_grouping_value` available.
144
144
  */
145
145
  list(
146
- customerId: string,
146
+ customerID: string,
147
147
  query: CostListParams | null | undefined = {},
148
148
  options?: RequestOptions,
149
149
  ): APIPromise<CostListResponse> {
150
- return this._client.get(path`/customers/${customerId}/costs`, { query, ...options });
150
+ return this._client.get(path`/customers/${customerID}/costs`, { query, ...options });
151
151
  }
152
152
 
153
153
  /**
@@ -270,11 +270,11 @@ export class Costs extends APIResource {
270
270
  * `grouping_value` and `secondary_grouping_value` available.
271
271
  */
272
272
  listByExternalID(
273
- externalCustomerId: string,
273
+ externalCustomerID: string,
274
274
  query: CostListByExternalIDParams | null | undefined = {},
275
275
  options?: RequestOptions,
276
276
  ): APIPromise<CostListByExternalIDResponse> {
277
- return this._client.get(path`/customers/external_customer_id/${externalCustomerId}/costs`, {
277
+ return this._client.get(path`/customers/external_customer_id/${externalCustomerID}/costs`, {
278
278
  query,
279
279
  ...options,
280
280
  });
@@ -67,11 +67,11 @@ export class Credits extends APIResource {
67
67
  * becomes effective, which may differ from creation time for backdated credits.
68
68
  */
69
69
  list(
70
- customerId: string,
70
+ customerID: string,
71
71
  query: CreditListParams | null | undefined = {},
72
72
  options?: RequestOptions,
73
73
  ): PagePromise<CreditListResponsesPage, CreditListResponse> {
74
- return this._client.getAPIList(path`/customers/${customerId}/credits`, Page<CreditListResponse>, {
74
+ return this._client.getAPIList(path`/customers/${customerID}/credits`, Page<CreditListResponse>, {
75
75
  query,
76
76
  ...options,
77
77
  });
@@ -92,12 +92,12 @@ export class Credits extends APIResource {
92
92
  * becomes effective, which may differ from creation time for backdated credits.
93
93
  */
94
94
  listByExternalID(
95
- externalCustomerId: string,
95
+ externalCustomerID: string,
96
96
  query: CreditListByExternalIDParams | null | undefined = {},
97
97
  options?: RequestOptions,
98
98
  ): PagePromise<CreditListByExternalIDResponsesPage, CreditListByExternalIDResponse> {
99
99
  return this._client.getAPIList(
100
- path`/customers/external_customer_id/${externalCustomerId}/credits`,
100
+ path`/customers/external_customer_id/${externalCustomerID}/credits`,
101
101
  Page<CreditListByExternalIDResponse>,
102
102
  { query, ...options },
103
103
  );
@@ -93,11 +93,11 @@ export class Ledger extends APIResource {
93
93
  * entry will be added to the ledger to indicate the adjustment of credits.
94
94
  */
95
95
  list(
96
- customerId: string,
96
+ customerID: string,
97
97
  query: LedgerListParams | null | undefined = {},
98
98
  options?: RequestOptions,
99
99
  ): PagePromise<LedgerListResponsesPage, LedgerListResponse> {
100
- return this._client.getAPIList(path`/customers/${customerId}/credits/ledger`, Page<LedgerListResponse>, {
100
+ return this._client.getAPIList(path`/customers/${customerID}/credits/ledger`, Page<LedgerListResponse>, {
101
101
  query,
102
102
  ...options,
103
103
  });
@@ -230,11 +230,11 @@ export class Ledger extends APIResource {
230
230
  * return to the customer, up to the block's initial balance.
231
231
  */
232
232
  createEntry(
233
- customerId: string,
233
+ customerID: string,
234
234
  body: LedgerCreateEntryParams,
235
235
  options?: RequestOptions,
236
236
  ): APIPromise<LedgerCreateEntryResponse> {
237
- return this._client.post(path`/customers/${customerId}/credits/ledger_entry`, { body, ...options });
237
+ return this._client.post(path`/customers/${customerID}/credits/ledger_entry`, { body, ...options });
238
238
  }
239
239
 
240
240
  /**
@@ -364,12 +364,12 @@ export class Ledger extends APIResource {
364
364
  * return to the customer, up to the block's initial balance.
365
365
  */
366
366
  createEntryByExternalID(
367
- externalCustomerId: string,
367
+ externalCustomerID: string,
368
368
  body: LedgerCreateEntryByExternalIDParams,
369
369
  options?: RequestOptions,
370
370
  ): APIPromise<LedgerCreateEntryByExternalIDResponse> {
371
371
  return this._client.post(
372
- path`/customers/external_customer_id/${externalCustomerId}/credits/ledger_entry`,
372
+ path`/customers/external_customer_id/${externalCustomerID}/credits/ledger_entry`,
373
373
  { body, ...options },
374
374
  );
375
375
  }
@@ -456,12 +456,12 @@ export class Ledger extends APIResource {
456
456
  * entry will be added to the ledger to indicate the adjustment of credits.
457
457
  */
458
458
  listByExternalID(
459
- externalCustomerId: string,
459
+ externalCustomerID: string,
460
460
  query: LedgerListByExternalIDParams | null | undefined = {},
461
461
  options?: RequestOptions,
462
462
  ): PagePromise<LedgerListByExternalIDResponsesPage, LedgerListByExternalIDResponse> {
463
463
  return this._client.getAPIList(
464
- path`/customers/external_customer_id/${externalCustomerId}/credits/ledger`,
464
+ path`/customers/external_customer_id/${externalCustomerID}/credits/ledger`,
465
465
  Page<LedgerListByExternalIDResponse>,
466
466
  { query, ...options },
467
467
  );
@@ -21,22 +21,22 @@ export class TopUps extends APIResource {
21
21
  * top-up will be replaced.
22
22
  */
23
23
  create(
24
- customerId: string,
24
+ customerID: string,
25
25
  body: TopUpCreateParams,
26
26
  options?: RequestOptions,
27
27
  ): APIPromise<TopUpCreateResponse> {
28
- return this._client.post(path`/customers/${customerId}/credits/top_ups`, { body, ...options });
28
+ return this._client.post(path`/customers/${customerID}/credits/top_ups`, { body, ...options });
29
29
  }
30
30
 
31
31
  /**
32
32
  * List top-ups
33
33
  */
34
34
  list(
35
- customerId: string,
35
+ customerID: string,
36
36
  query: TopUpListParams | null | undefined = {},
37
37
  options?: RequestOptions,
38
38
  ): PagePromise<TopUpListResponsesPage, TopUpListResponse> {
39
- return this._client.getAPIList(path`/customers/${customerId}/credits/top_ups`, Page<TopUpListResponse>, {
39
+ return this._client.getAPIList(path`/customers/${customerID}/credits/top_ups`, Page<TopUpListResponse>, {
40
40
  query,
41
41
  ...options,
42
42
  });
@@ -46,9 +46,9 @@ export class TopUps extends APIResource {
46
46
  * This deactivates the top-up and voids any invoices associated with pending
47
47
  * credit blocks purchased through the top-up.
48
48
  */
49
- delete(topUpId: string, params: TopUpDeleteParams, options?: RequestOptions): APIPromise<void> {
50
- const { customer_id: customerId } = params;
51
- return this._client.delete(path`/customers/${customerId}/credits/top_ups/${topUpId}`, {
49
+ delete(topUpID: string, params: TopUpDeleteParams, options?: RequestOptions): APIPromise<void> {
50
+ const { customer_id } = params;
51
+ return this._client.delete(path`/customers/${customer_id}/credits/top_ups/${topUpID}`, {
52
52
  ...options,
53
53
  headers: buildHeaders([{ Accept: '*/*' }, options?.headers]),
54
54
  });
@@ -64,11 +64,11 @@ export class TopUps extends APIResource {
64
64
  * top-up will be replaced.
65
65
  */
66
66
  createByExternalID(
67
- externalCustomerId: string,
67
+ externalCustomerID: string,
68
68
  body: TopUpCreateByExternalIDParams,
69
69
  options?: RequestOptions,
70
70
  ): APIPromise<TopUpCreateByExternalIDResponse> {
71
- return this._client.post(path`/customers/external_customer_id/${externalCustomerId}/credits/top_ups`, {
71
+ return this._client.post(path`/customers/external_customer_id/${externalCustomerID}/credits/top_ups`, {
72
72
  body,
73
73
  ...options,
74
74
  });
@@ -79,13 +79,13 @@ export class TopUps extends APIResource {
79
79
  * credit blocks purchased through the top-up.
80
80
  */
81
81
  deleteByExternalID(
82
- topUpId: string,
82
+ topUpID: string,
83
83
  params: TopUpDeleteByExternalIDParams,
84
84
  options?: RequestOptions,
85
85
  ): APIPromise<void> {
86
- const { external_customer_id: externalCustomerId } = params;
86
+ const { external_customer_id } = params;
87
87
  return this._client.delete(
88
- path`/customers/external_customer_id/${externalCustomerId}/credits/top_ups/${topUpId}`,
88
+ path`/customers/external_customer_id/${external_customer_id}/credits/top_ups/${topUpID}`,
89
89
  { ...options, headers: buildHeaders([{ Accept: '*/*' }, options?.headers]) },
90
90
  );
91
91
  }
@@ -94,12 +94,12 @@ export class TopUps extends APIResource {
94
94
  * List top-ups by external ID
95
95
  */
96
96
  listByExternalID(
97
- externalCustomerId: string,
97
+ externalCustomerID: string,
98
98
  query: TopUpListByExternalIDParams | null | undefined = {},
99
99
  options?: RequestOptions,
100
100
  ): PagePromise<TopUpListByExternalIDResponsesPage, TopUpListByExternalIDResponse> {
101
101
  return this._client.getAPIList(
102
- path`/customers/external_customer_id/${externalCustomerId}/credits/top_ups`,
102
+ path`/customers/external_customer_id/${externalCustomerID}/credits/top_ups`,
103
103
  Page<TopUpListByExternalIDResponse>,
104
104
  { query, ...options },
105
105
  );