@stigg/typescript 0.1.0-alpha.3 → 0.1.0-alpha.7

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 (204) hide show
  1. package/CHANGELOG.md +61 -0
  2. package/README.md +9 -0
  3. package/client.d.mts +6 -8
  4. package/client.d.mts.map +1 -1
  5. package/client.d.ts +6 -8
  6. package/client.d.ts.map +1 -1
  7. package/client.js +16 -21
  8. package/client.js.map +1 -1
  9. package/client.mjs +17 -22
  10. package/client.mjs.map +1 -1
  11. package/internal/parse.d.mts.map +1 -1
  12. package/internal/parse.d.ts.map +1 -1
  13. package/internal/parse.js +5 -0
  14. package/internal/parse.js.map +1 -1
  15. package/internal/parse.mjs +5 -0
  16. package/internal/parse.mjs.map +1 -1
  17. package/internal/qs/formats.d.mts +7 -0
  18. package/internal/qs/formats.d.mts.map +1 -0
  19. package/internal/qs/formats.d.ts +7 -0
  20. package/internal/qs/formats.d.ts.map +1 -0
  21. package/internal/qs/formats.js +13 -0
  22. package/internal/qs/formats.js.map +1 -0
  23. package/internal/qs/formats.mjs +9 -0
  24. package/internal/qs/formats.mjs.map +1 -0
  25. package/internal/qs/index.d.mts +10 -0
  26. package/internal/qs/index.d.mts.map +1 -0
  27. package/internal/qs/index.d.ts +10 -0
  28. package/internal/qs/index.d.ts.map +1 -0
  29. package/internal/qs/index.js +14 -0
  30. package/internal/qs/index.js.map +1 -0
  31. package/internal/qs/index.mjs +10 -0
  32. package/internal/qs/index.mjs.map +1 -0
  33. package/internal/qs/stringify.d.mts +3 -0
  34. package/internal/qs/stringify.d.mts.map +1 -0
  35. package/internal/qs/stringify.d.ts +3 -0
  36. package/internal/qs/stringify.d.ts.map +1 -0
  37. package/internal/qs/stringify.js +277 -0
  38. package/internal/qs/stringify.js.map +1 -0
  39. package/internal/qs/stringify.mjs +274 -0
  40. package/internal/qs/stringify.mjs.map +1 -0
  41. package/internal/qs/types.d.mts +57 -0
  42. package/internal/qs/types.d.mts.map +1 -0
  43. package/internal/qs/types.d.ts +57 -0
  44. package/internal/qs/types.d.ts.map +1 -0
  45. package/internal/qs/types.js +3 -0
  46. package/internal/qs/types.js.map +1 -0
  47. package/internal/qs/types.mjs +2 -0
  48. package/internal/qs/types.mjs.map +1 -0
  49. package/internal/qs/utils.d.mts +15 -0
  50. package/internal/qs/utils.d.mts.map +1 -0
  51. package/internal/qs/utils.d.ts +15 -0
  52. package/internal/qs/utils.d.ts.map +1 -0
  53. package/internal/qs/utils.js +230 -0
  54. package/internal/qs/utils.js.map +1 -0
  55. package/internal/qs/utils.mjs +217 -0
  56. package/internal/qs/utils.mjs.map +1 -0
  57. package/package.json +1 -1
  58. package/resources/index.d.mts +1 -1
  59. package/resources/index.d.mts.map +1 -1
  60. package/resources/index.d.ts +1 -1
  61. package/resources/index.d.ts.map +1 -1
  62. package/resources/index.js.map +1 -1
  63. package/resources/index.mjs +1 -1
  64. package/resources/index.mjs.map +1 -1
  65. package/resources/v1/coupons.d.mts +55 -96
  66. package/resources/v1/coupons.d.mts.map +1 -1
  67. package/resources/v1/coupons.d.ts +55 -96
  68. package/resources/v1/coupons.d.ts.map +1 -1
  69. package/resources/v1/coupons.js +4 -3
  70. package/resources/v1/coupons.js.map +1 -1
  71. package/resources/v1/coupons.mjs +4 -3
  72. package/resources/v1/coupons.mjs.map +1 -1
  73. package/resources/v1/customers/customers.d.mts +170 -46
  74. package/resources/v1/customers/customers.d.mts.map +1 -1
  75. package/resources/v1/customers/customers.d.ts +170 -46
  76. package/resources/v1/customers/customers.d.ts.map +1 -1
  77. package/resources/v1/customers/customers.js +32 -15
  78. package/resources/v1/customers/customers.js.map +1 -1
  79. package/resources/v1/customers/customers.mjs +32 -15
  80. package/resources/v1/customers/customers.mjs.map +1 -1
  81. package/resources/v1/customers/index.d.mts +2 -2
  82. package/resources/v1/customers/index.d.mts.map +1 -1
  83. package/resources/v1/customers/index.d.ts +2 -2
  84. package/resources/v1/customers/index.d.ts.map +1 -1
  85. package/resources/v1/customers/index.js +3 -3
  86. package/resources/v1/customers/index.js.map +1 -1
  87. package/resources/v1/customers/index.mjs +1 -1
  88. package/resources/v1/customers/index.mjs.map +1 -1
  89. package/resources/v1/customers/payment-method.d.mts +4 -2
  90. package/resources/v1/customers/payment-method.d.mts.map +1 -1
  91. package/resources/v1/customers/payment-method.d.ts +4 -2
  92. package/resources/v1/customers/payment-method.d.ts.map +1 -1
  93. package/resources/v1/customers/payment-method.js +4 -2
  94. package/resources/v1/customers/payment-method.js.map +1 -1
  95. package/resources/v1/customers/payment-method.mjs +4 -2
  96. package/resources/v1/customers/payment-method.mjs.map +1 -1
  97. package/resources/v1/customers/promotional-entitlements.d.mts +352 -0
  98. package/resources/v1/customers/promotional-entitlements.d.mts.map +1 -0
  99. package/resources/v1/customers/promotional-entitlements.d.ts +352 -0
  100. package/resources/v1/customers/promotional-entitlements.d.ts.map +1 -0
  101. package/resources/v1/customers/promotional-entitlements.js +25 -0
  102. package/resources/v1/customers/promotional-entitlements.js.map +1 -0
  103. package/resources/v1/customers/promotional-entitlements.mjs +21 -0
  104. package/resources/v1/customers/promotional-entitlements.mjs.map +1 -0
  105. package/resources/v1/events.d.mts +63 -0
  106. package/resources/v1/events.d.mts.map +1 -0
  107. package/resources/v1/events.d.ts +63 -0
  108. package/resources/v1/events.d.ts.map +1 -0
  109. package/resources/v1/events.js +16 -0
  110. package/resources/v1/events.js.map +1 -0
  111. package/resources/v1/events.mjs +12 -0
  112. package/resources/v1/events.mjs.map +1 -0
  113. package/resources/v1/index.d.mts +7 -4
  114. package/resources/v1/index.d.mts.map +1 -1
  115. package/resources/v1/index.d.ts +7 -4
  116. package/resources/v1/index.d.ts.map +1 -1
  117. package/resources/v1/index.js +7 -1
  118. package/resources/v1/index.js.map +1 -1
  119. package/resources/v1/index.mjs +4 -1
  120. package/resources/v1/index.mjs.map +1 -1
  121. package/resources/v1/products.d.mts +126 -0
  122. package/resources/v1/products.d.mts.map +1 -0
  123. package/resources/v1/products.d.ts +126 -0
  124. package/resources/v1/products.d.ts.map +1 -0
  125. package/resources/v1/products.js +19 -0
  126. package/resources/v1/products.js.map +1 -0
  127. package/resources/v1/products.mjs +15 -0
  128. package/resources/v1/products.mjs.map +1 -0
  129. package/resources/v1/subscriptions/future-update.d.mts +9 -22
  130. package/resources/v1/subscriptions/future-update.d.mts.map +1 -1
  131. package/resources/v1/subscriptions/future-update.d.ts +9 -22
  132. package/resources/v1/subscriptions/future-update.d.ts.map +1 -1
  133. package/resources/v1/subscriptions/future-update.js +3 -2
  134. package/resources/v1/subscriptions/future-update.js.map +1 -1
  135. package/resources/v1/subscriptions/future-update.mjs +3 -2
  136. package/resources/v1/subscriptions/future-update.mjs.map +1 -1
  137. package/resources/v1/subscriptions/index.d.mts +2 -2
  138. package/resources/v1/subscriptions/index.d.mts.map +1 -1
  139. package/resources/v1/subscriptions/index.d.ts +2 -2
  140. package/resources/v1/subscriptions/index.d.ts.map +1 -1
  141. package/resources/v1/subscriptions/index.js.map +1 -1
  142. package/resources/v1/subscriptions/index.mjs +1 -1
  143. package/resources/v1/subscriptions/index.mjs.map +1 -1
  144. package/resources/v1/subscriptions/subscriptions.d.mts +987 -949
  145. package/resources/v1/subscriptions/subscriptions.d.mts.map +1 -1
  146. package/resources/v1/subscriptions/subscriptions.d.ts +987 -949
  147. package/resources/v1/subscriptions/subscriptions.d.ts.map +1 -1
  148. package/resources/v1/subscriptions/subscriptions.js +39 -11
  149. package/resources/v1/subscriptions/subscriptions.js.map +1 -1
  150. package/resources/v1/subscriptions/subscriptions.mjs +40 -12
  151. package/resources/v1/subscriptions/subscriptions.mjs.map +1 -1
  152. package/resources/v1/usage.d.mts +230 -0
  153. package/resources/v1/usage.d.mts.map +1 -0
  154. package/resources/v1/usage.d.ts +230 -0
  155. package/resources/v1/usage.d.ts.map +1 -0
  156. package/resources/v1/usage.js +24 -0
  157. package/resources/v1/usage.js.map +1 -0
  158. package/resources/v1/usage.mjs +20 -0
  159. package/resources/v1/usage.mjs.map +1 -0
  160. package/resources/v1/v1.d.mts +18 -172
  161. package/resources/v1/v1.d.mts.map +1 -1
  162. package/resources/v1/v1.d.ts +18 -172
  163. package/resources/v1/v1.d.ts.map +1 -1
  164. package/resources/v1/v1.js +12 -12
  165. package/resources/v1/v1.js.map +1 -1
  166. package/resources/v1/v1.mjs +12 -12
  167. package/resources/v1/v1.mjs.map +1 -1
  168. package/src/client.ts +25 -40
  169. package/src/internal/parse.ts +6 -0
  170. package/src/internal/qs/LICENSE.md +13 -0
  171. package/src/internal/qs/README.md +3 -0
  172. package/src/internal/qs/formats.ts +10 -0
  173. package/src/internal/qs/index.ts +13 -0
  174. package/src/internal/qs/stringify.ts +385 -0
  175. package/src/internal/qs/types.ts +71 -0
  176. package/src/internal/qs/utils.ts +265 -0
  177. package/src/resources/index.ts +1 -7
  178. package/src/resources/v1/coupons.ts +63 -231
  179. package/src/resources/v1/customers/customers.ts +234 -60
  180. package/src/resources/v1/customers/index.ts +13 -2
  181. package/src/resources/v1/customers/payment-method.ts +4 -2
  182. package/src/resources/v1/customers/promotional-entitlements.ts +468 -0
  183. package/src/resources/v1/events.ts +74 -0
  184. package/src/resources/v1/index.ts +28 -15
  185. package/src/resources/v1/products.ts +162 -0
  186. package/src/resources/v1/subscriptions/future-update.ts +9 -30
  187. package/src/resources/v1/subscriptions/index.ts +8 -11
  188. package/src/resources/v1/subscriptions/subscriptions.ts +2699 -2280
  189. package/src/resources/v1/usage.ts +284 -0
  190. package/src/resources/v1/v1.ts +72 -220
  191. package/src/version.ts +1 -1
  192. package/version.d.mts +1 -1
  193. package/version.d.ts +1 -1
  194. package/version.js +1 -1
  195. package/version.mjs +1 -1
  196. package/resources/v1/customers/usage.d.mts +0 -4
  197. package/resources/v1/customers/usage.d.mts.map +0 -1
  198. package/resources/v1/customers/usage.d.ts +0 -4
  199. package/resources/v1/customers/usage.d.ts.map +0 -1
  200. package/resources/v1/customers/usage.js +0 -9
  201. package/resources/v1/customers/usage.js.map +0 -1
  202. package/resources/v1/customers/usage.mjs +0 -5
  203. package/resources/v1/customers/usage.mjs.map +0 -1
  204. package/src/resources/v1/customers/usage.ts +0 -5
@@ -3,8 +3,14 @@
3
3
  import { APIResource } from '../../../core/resource';
4
4
  import * as PaymentMethodAPI from './payment-method';
5
5
  import { PaymentMethod, PaymentMethodAttachParams } from './payment-method';
6
- import * as UsageAPI from './usage';
7
- import { Usage } from './usage';
6
+ import * as PromotionalEntitlementsAPI from './promotional-entitlements';
7
+ import {
8
+ PromotionalEntitlementGrantParams,
9
+ PromotionalEntitlementGrantResponse,
10
+ PromotionalEntitlementRevokeParams,
11
+ PromotionalEntitlementRevokeResponse,
12
+ PromotionalEntitlements,
13
+ } from './promotional-entitlements';
8
14
  import { APIPromise } from '../../../core/api-promise';
9
15
  import { MyCursorIDPage, type MyCursorIDPageParams, PagePromise } from '../../../core/pagination';
10
16
  import { RequestOptions } from '../../../internal/request-options';
@@ -12,31 +18,27 @@ import { path } from '../../../internal/utils/path';
12
18
 
13
19
  export class Customers extends APIResource {
14
20
  paymentMethod: PaymentMethodAPI.PaymentMethod = new PaymentMethodAPI.PaymentMethod(this._client);
15
- usage: UsageAPI.Usage = new UsageAPI.Usage(this._client);
21
+ promotionalEntitlements: PromotionalEntitlementsAPI.PromotionalEntitlements =
22
+ new PromotionalEntitlementsAPI.PromotionalEntitlements(this._client);
16
23
 
17
24
  /**
18
- * Provision customer
19
- */
20
- create(body: CustomerCreateParams, options?: RequestOptions): APIPromise<CustomerResponse> {
21
- return this._client.post('/api/v1/customers', { body, ...options });
22
- }
23
-
24
- /**
25
- * Get a single customer by ID
25
+ * Retrieves a customer by their unique identifier, including billing information
26
+ * and subscription status.
26
27
  */
27
28
  retrieve(id: string, options?: RequestOptions): APIPromise<CustomerResponse> {
28
29
  return this._client.get(path`/api/v1/customers/${id}`, options);
29
30
  }
30
31
 
31
32
  /**
32
- * Update a customer
33
+ * Updates an existing customer's properties such as name, email, and billing
34
+ * information.
33
35
  */
34
36
  update(id: string, body: CustomerUpdateParams, options?: RequestOptions): APIPromise<CustomerResponse> {
35
37
  return this._client.patch(path`/api/v1/customers/${id}`, { body, ...options });
36
38
  }
37
39
 
38
40
  /**
39
- * Get a list of customers
41
+ * Retrieves a paginated list of customers in the environment.
40
42
  */
41
43
  list(
42
44
  query: CustomerListParams | null | undefined = {},
@@ -49,14 +51,46 @@ export class Customers extends APIResource {
49
51
  }
50
52
 
51
53
  /**
52
- * Archive customer
54
+ * Archives a customer, preventing new subscriptions. Optionally cancels existing
55
+ * subscriptions.
53
56
  */
54
57
  archive(id: string, options?: RequestOptions): APIPromise<CustomerResponse> {
55
58
  return this._client.post(path`/api/v1/customers/${id}/archive`, options);
56
59
  }
57
60
 
58
61
  /**
59
- * Unarchive customer
62
+ * Imports multiple customers in bulk. Used for migrating customer data from
63
+ * external systems.
64
+ */
65
+ import(body: CustomerImportParams, options?: RequestOptions): APIPromise<CustomerImportResponse> {
66
+ return this._client.post('/api/v1/customers/import', { body, ...options });
67
+ }
68
+
69
+ /**
70
+ * Get a list of customerresources
71
+ */
72
+ listResources(
73
+ id: string,
74
+ query: CustomerListResourcesParams | null | undefined = {},
75
+ options?: RequestOptions,
76
+ ): PagePromise<CustomerListResourcesResponsesMyCursorIDPage, CustomerListResourcesResponse> {
77
+ return this._client.getAPIList(
78
+ path`/api/v1/customers/${id}/resources`,
79
+ MyCursorIDPage<CustomerListResourcesResponse>,
80
+ { query, ...options },
81
+ );
82
+ }
83
+
84
+ /**
85
+ * Creates a new customer and optionally provisions an initial subscription in a
86
+ * single operation.
87
+ */
88
+ provision(body: CustomerProvisionParams, options?: RequestOptions): APIPromise<CustomerResponse> {
89
+ return this._client.post('/api/v1/customers', { body, ...options });
90
+ }
91
+
92
+ /**
93
+ * Restores an archived customer, allowing them to create new subscriptions again.
60
94
  */
61
95
  unarchive(id: string, options?: RequestOptions): APIPromise<CustomerResponse> {
62
96
  return this._client.post(path`/api/v1/customers/${id}/unarchive`, options);
@@ -65,6 +99,8 @@ export class Customers extends APIResource {
65
99
 
66
100
  export type CustomerListResponsesMyCursorIDPage = MyCursorIDPage<CustomerListResponse>;
67
101
 
102
+ export type CustomerListResourcesResponsesMyCursorIDPage = MyCursorIDPage<CustomerListResourcesResponse>;
103
+
68
104
  /**
69
105
  * Response object
70
106
  */
@@ -311,21 +347,53 @@ export namespace CustomerListResponse {
311
347
  }
312
348
  }
313
349
 
314
- export interface CustomerCreateParams {
350
+ /**
351
+ * Response object
352
+ */
353
+ export interface CustomerImportResponse {
315
354
  /**
316
- * Customer slug
355
+ * List of newly created customer IDs from the import operation.
356
+ */
357
+ data: CustomerImportResponse.Data;
358
+ }
359
+
360
+ export namespace CustomerImportResponse {
361
+ /**
362
+ * List of newly created customer IDs from the import operation.
363
+ */
364
+ export interface Data {
365
+ /**
366
+ * Customer IDs created during import
367
+ */
368
+ newCustomers: Array<string>;
369
+ }
370
+ }
371
+
372
+ /**
373
+ * Resource object that belongs to a customer
374
+ */
375
+ export interface CustomerListResourcesResponse {
376
+ /**
377
+ * Resource slug
317
378
  */
318
379
  id: string;
319
380
 
320
381
  /**
321
- * Customer level coupon
382
+ * Timestamp of when the record was created
322
383
  */
323
- couponId?: string | null;
384
+ createdAt: string;
324
385
 
325
386
  /**
326
- * The default payment method details
387
+ * Timestamp of when the record was last updated
327
388
  */
328
- defaultPaymentMethod?: CustomerCreateParams.DefaultPaymentMethod | null;
389
+ updatedAt: string;
390
+ }
391
+
392
+ export interface CustomerUpdateParams {
393
+ /**
394
+ * Customer level coupon
395
+ */
396
+ couponId?: string | null;
329
397
 
330
398
  /**
331
399
  * The email of the customer
@@ -335,7 +403,7 @@ export interface CustomerCreateParams {
335
403
  /**
336
404
  * List of integrations
337
405
  */
338
- integrations?: Array<CustomerCreateParams.Integration>;
406
+ integrations?: Array<CustomerUpdateParams.Integration>;
339
407
 
340
408
  /**
341
409
  * Additional metadata
@@ -348,74 +416,141 @@ export interface CustomerCreateParams {
348
416
  name?: string | null;
349
417
  }
350
418
 
351
- export namespace CustomerCreateParams {
419
+ export namespace CustomerUpdateParams {
352
420
  /**
353
- * The default payment method details
421
+ * External billing or CRM integration link
354
422
  */
355
- export interface DefaultPaymentMethod {
423
+ export interface Integration {
356
424
  /**
357
- * The default payment method id
425
+ * Integration details
358
426
  */
359
- billingId: string | null;
427
+ id: string;
360
428
 
361
429
  /**
362
- * The expiration month of the default payment method
430
+ * Synced entity id
363
431
  */
364
- cardExpiryMonth: number | null;
432
+ syncedEntityId: string | null;
365
433
 
366
434
  /**
367
- * The expiration year of the default payment method
435
+ * The vendor identifier of integration
368
436
  */
369
- cardExpiryYear: number | null;
437
+ vendorIdentifier:
438
+ | 'AUTH0'
439
+ | 'ZUORA'
440
+ | 'STRIPE'
441
+ | 'HUBSPOT'
442
+ | 'AWS_MARKETPLACE'
443
+ | 'SNOWFLAKE'
444
+ | 'SALESFORCE'
445
+ | 'BIG_QUERY'
446
+ | 'OPEN_FGA'
447
+ | 'APP_STORE';
448
+ }
449
+ }
370
450
 
451
+ export interface CustomerListParams extends MyCursorIDPageParams {
452
+ /**
453
+ * Filter by creation date using range operators: gt, gte, lt, lte
454
+ */
455
+ createdAt?: CustomerListParams.CreatedAt;
456
+
457
+ /**
458
+ * Filter by exact customer email address
459
+ */
460
+ email?: string;
461
+
462
+ /**
463
+ * Filter by exact customer name
464
+ */
465
+ name?: string;
466
+ }
467
+
468
+ export namespace CustomerListParams {
469
+ /**
470
+ * Filter by creation date using range operators: gt, gte, lt, lte
471
+ */
472
+ export interface CreatedAt {
371
473
  /**
372
- * The last 4 digits of the default payment method
474
+ * Greater than the specified createdAt value
373
475
  */
374
- cardLast4Digits: string | null;
476
+ gt?: string;
375
477
 
376
478
  /**
377
- * The default payment method type
479
+ * Greater than or equal to the specified createdAt value
378
480
  */
379
- type: 'CARD' | 'BANK' | 'CASH_APP';
481
+ gte?: string;
482
+
483
+ /**
484
+ * Less than the specified createdAt value
485
+ */
486
+ lt?: string;
487
+
488
+ /**
489
+ * Less than or equal to the specified createdAt value
490
+ */
491
+ lte?: string;
380
492
  }
493
+ }
381
494
 
495
+ export interface CustomerImportParams {
382
496
  /**
383
- * External billing or CRM integration link
497
+ * List of customer objects to import
384
498
  */
385
- export interface Integration {
499
+ customers: Array<CustomerImportParams.Customer>;
500
+ }
501
+
502
+ export namespace CustomerImportParams {
503
+ export interface Customer {
386
504
  /**
387
- * Integration details
505
+ * Customer slug
388
506
  */
389
507
  id: string;
390
508
 
391
509
  /**
392
- * Synced entity id
510
+ * The email of the customer
393
511
  */
394
- syncedEntityId: string | null;
512
+ email: string | null;
395
513
 
396
514
  /**
397
- * The vendor identifier of integration
515
+ * The name of the customer
398
516
  */
399
- vendorIdentifier:
400
- | 'AUTH0'
401
- | 'ZUORA'
402
- | 'STRIPE'
403
- | 'HUBSPOT'
404
- | 'AWS_MARKETPLACE'
405
- | 'SNOWFLAKE'
406
- | 'SALESFORCE'
407
- | 'BIG_QUERY'
408
- | 'OPEN_FGA'
409
- | 'APP_STORE';
517
+ name: string | null;
518
+
519
+ /**
520
+ * Additional metadata
521
+ */
522
+ metadata?: { [key: string]: string };
523
+
524
+ /**
525
+ * Billing provider payment method id
526
+ */
527
+ paymentMethodId?: string;
528
+
529
+ /**
530
+ * Timestamp of when the record was last updated
531
+ */
532
+ updatedAt?: string;
410
533
  }
411
534
  }
412
535
 
413
- export interface CustomerUpdateParams {
536
+ export interface CustomerListResourcesParams extends MyCursorIDPageParams {}
537
+
538
+ export interface CustomerProvisionParams {
539
+ /**
540
+ * Customer slug
541
+ */
542
+ id: string;
543
+
414
544
  /**
415
545
  * Customer level coupon
416
546
  */
417
547
  couponId?: string | null;
418
548
 
549
+ /**
550
+ * The default payment method details
551
+ */
552
+ defaultPaymentMethod?: CustomerProvisionParams.DefaultPaymentMethod | null;
553
+
419
554
  /**
420
555
  * The email of the customer
421
556
  */
@@ -424,7 +559,7 @@ export interface CustomerUpdateParams {
424
559
  /**
425
560
  * List of integrations
426
561
  */
427
- integrations?: Array<CustomerUpdateParams.Integration>;
562
+ integrations?: Array<CustomerProvisionParams.Integration>;
428
563
 
429
564
  /**
430
565
  * Additional metadata
@@ -437,7 +572,37 @@ export interface CustomerUpdateParams {
437
572
  name?: string | null;
438
573
  }
439
574
 
440
- export namespace CustomerUpdateParams {
575
+ export namespace CustomerProvisionParams {
576
+ /**
577
+ * The default payment method details
578
+ */
579
+ export interface DefaultPaymentMethod {
580
+ /**
581
+ * The default payment method id
582
+ */
583
+ billingId: string | null;
584
+
585
+ /**
586
+ * The expiration month of the default payment method
587
+ */
588
+ cardExpiryMonth: number | null;
589
+
590
+ /**
591
+ * The expiration year of the default payment method
592
+ */
593
+ cardExpiryYear: number | null;
594
+
595
+ /**
596
+ * The last 4 digits of the default payment method
597
+ */
598
+ cardLast4Digits: string | null;
599
+
600
+ /**
601
+ * The default payment method type
602
+ */
603
+ type: 'CARD' | 'BANK' | 'CASH_APP';
604
+ }
605
+
441
606
  /**
442
607
  * External billing or CRM integration link
443
608
  */
@@ -469,22 +634,31 @@ export namespace CustomerUpdateParams {
469
634
  }
470
635
  }
471
636
 
472
- export interface CustomerListParams extends MyCursorIDPageParams {}
473
-
474
637
  Customers.PaymentMethod = PaymentMethod;
475
- Customers.Usage = Usage;
638
+ Customers.PromotionalEntitlements = PromotionalEntitlements;
476
639
 
477
640
  export declare namespace Customers {
478
641
  export {
479
642
  type CustomerResponse as CustomerResponse,
480
643
  type CustomerListResponse as CustomerListResponse,
644
+ type CustomerImportResponse as CustomerImportResponse,
645
+ type CustomerListResourcesResponse as CustomerListResourcesResponse,
481
646
  type CustomerListResponsesMyCursorIDPage as CustomerListResponsesMyCursorIDPage,
482
- type CustomerCreateParams as CustomerCreateParams,
647
+ type CustomerListResourcesResponsesMyCursorIDPage as CustomerListResourcesResponsesMyCursorIDPage,
483
648
  type CustomerUpdateParams as CustomerUpdateParams,
484
649
  type CustomerListParams as CustomerListParams,
650
+ type CustomerImportParams as CustomerImportParams,
651
+ type CustomerListResourcesParams as CustomerListResourcesParams,
652
+ type CustomerProvisionParams as CustomerProvisionParams,
485
653
  };
486
654
 
487
655
  export { PaymentMethod as PaymentMethod, type PaymentMethodAttachParams as PaymentMethodAttachParams };
488
656
 
489
- export { Usage as Usage };
657
+ export {
658
+ PromotionalEntitlements as PromotionalEntitlements,
659
+ type PromotionalEntitlementGrantResponse as PromotionalEntitlementGrantResponse,
660
+ type PromotionalEntitlementRevokeResponse as PromotionalEntitlementRevokeResponse,
661
+ type PromotionalEntitlementGrantParams as PromotionalEntitlementGrantParams,
662
+ type PromotionalEntitlementRevokeParams as PromotionalEntitlementRevokeParams,
663
+ };
490
664
  }
@@ -4,10 +4,21 @@ export {
4
4
  Customers,
5
5
  type CustomerResponse,
6
6
  type CustomerListResponse,
7
- type CustomerCreateParams,
7
+ type CustomerImportResponse,
8
+ type CustomerListResourcesResponse,
8
9
  type CustomerUpdateParams,
9
10
  type CustomerListParams,
11
+ type CustomerImportParams,
12
+ type CustomerListResourcesParams,
13
+ type CustomerProvisionParams,
10
14
  type CustomerListResponsesMyCursorIDPage,
15
+ type CustomerListResourcesResponsesMyCursorIDPage,
11
16
  } from './customers';
12
17
  export { PaymentMethod, type PaymentMethodAttachParams } from './payment-method';
13
- export { Usage } from './usage';
18
+ export {
19
+ PromotionalEntitlements,
20
+ type PromotionalEntitlementGrantResponse,
21
+ type PromotionalEntitlementRevokeResponse,
22
+ type PromotionalEntitlementGrantParams,
23
+ type PromotionalEntitlementRevokeParams,
24
+ } from './promotional-entitlements';
@@ -8,7 +8,8 @@ import { path } from '../../../internal/utils/path';
8
8
 
9
9
  export class PaymentMethod extends APIResource {
10
10
  /**
11
- * Attach payment method
11
+ * Attaches a payment method to a customer for billing. Required for paid
12
+ * subscriptions when integrated with a billing provider.
12
13
  */
13
14
  attach(
14
15
  id: string,
@@ -19,7 +20,8 @@ export class PaymentMethod extends APIResource {
19
20
  }
20
21
 
21
22
  /**
22
- * Detach payment method
23
+ * Removes the payment method from a customer. Ensure active paid subscriptions
24
+ * have an alternative payment method.
23
25
  */
24
26
  detach(id: string, options?: RequestOptions): APIPromise<CustomersAPI.CustomerResponse> {
25
27
  return this._client.delete(path`/api/v1/customers/${id}/payment-method`, options);