@whop/sdk 0.0.34 → 0.0.36

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (139) hide show
  1. package/CHANGELOG.md +68 -0
  2. package/client.d.mts +12 -6
  3. package/client.d.mts.map +1 -1
  4. package/client.d.ts +12 -6
  5. package/client.d.ts.map +1 -1
  6. package/client.js +6 -0
  7. package/client.js.map +1 -1
  8. package/client.mjs +7 -1
  9. package/client.mjs.map +1 -1
  10. package/internal/utils/env.js +2 -2
  11. package/internal/utils/env.js.map +1 -1
  12. package/internal/utils/env.mjs +2 -2
  13. package/internal/utils/env.mjs.map +1 -1
  14. package/package.json +1 -1
  15. package/resources/affiliates/affiliates.d.mts +353 -0
  16. package/resources/affiliates/affiliates.d.mts.map +1 -0
  17. package/resources/affiliates/affiliates.d.ts +353 -0
  18. package/resources/affiliates/affiliates.d.ts.map +1 -0
  19. package/resources/affiliates/affiliates.js +112 -0
  20. package/resources/affiliates/affiliates.js.map +1 -0
  21. package/resources/affiliates/affiliates.mjs +107 -0
  22. package/resources/affiliates/affiliates.mjs.map +1 -0
  23. package/resources/affiliates/index.d.mts +3 -0
  24. package/resources/affiliates/index.d.mts.map +1 -0
  25. package/resources/affiliates/index.d.ts +3 -0
  26. package/resources/affiliates/index.d.ts.map +1 -0
  27. package/resources/affiliates/index.js +9 -0
  28. package/resources/affiliates/index.js.map +1 -0
  29. package/resources/affiliates/index.mjs +4 -0
  30. package/resources/affiliates/index.mjs.map +1 -0
  31. package/resources/affiliates/overrides.d.mts +451 -0
  32. package/resources/affiliates/overrides.d.mts.map +1 -0
  33. package/resources/affiliates/overrides.d.ts +451 -0
  34. package/resources/affiliates/overrides.d.ts.map +1 -0
  35. package/resources/affiliates/overrides.js +117 -0
  36. package/resources/affiliates/overrides.js.map +1 -0
  37. package/resources/affiliates/overrides.mjs +113 -0
  38. package/resources/affiliates/overrides.mjs.map +1 -0
  39. package/resources/affiliates.d.mts +2 -0
  40. package/resources/affiliates.d.mts.map +1 -0
  41. package/resources/affiliates.d.ts +2 -0
  42. package/resources/affiliates.d.ts.map +1 -0
  43. package/resources/affiliates.js +6 -0
  44. package/resources/affiliates.js.map +1 -0
  45. package/resources/affiliates.mjs +3 -0
  46. package/resources/affiliates.mjs.map +1 -0
  47. package/resources/ai-chats.d.mts +21 -2
  48. package/resources/ai-chats.d.mts.map +1 -1
  49. package/resources/ai-chats.d.ts +21 -2
  50. package/resources/ai-chats.d.ts.map +1 -1
  51. package/resources/ai-chats.js +2 -1
  52. package/resources/ai-chats.js.map +1 -1
  53. package/resources/ai-chats.mjs +2 -1
  54. package/resources/ai-chats.mjs.map +1 -1
  55. package/resources/apps.d.mts +26 -0
  56. package/resources/apps.d.mts.map +1 -1
  57. package/resources/apps.d.ts +26 -0
  58. package/resources/apps.d.ts.map +1 -1
  59. package/resources/checkout-configurations.d.mts +69 -0
  60. package/resources/checkout-configurations.d.mts.map +1 -1
  61. package/resources/checkout-configurations.d.ts +69 -0
  62. package/resources/checkout-configurations.d.ts.map +1 -1
  63. package/resources/companies.d.mts +19 -0
  64. package/resources/companies.d.mts.map +1 -1
  65. package/resources/companies.d.ts +19 -0
  66. package/resources/companies.d.ts.map +1 -1
  67. package/resources/index.d.mts +4 -3
  68. package/resources/index.d.mts.map +1 -1
  69. package/resources/index.d.ts +4 -3
  70. package/resources/index.d.ts.map +1 -1
  71. package/resources/index.js +4 -2
  72. package/resources/index.js.map +1 -1
  73. package/resources/index.mjs +1 -0
  74. package/resources/index.mjs.map +1 -1
  75. package/resources/invoices.d.mts +179 -345
  76. package/resources/invoices.d.mts.map +1 -1
  77. package/resources/invoices.d.ts +179 -345
  78. package/resources/invoices.d.ts.map +1 -1
  79. package/resources/invoices.js +20 -2
  80. package/resources/invoices.js.map +1 -1
  81. package/resources/invoices.mjs +20 -2
  82. package/resources/invoices.mjs.map +1 -1
  83. package/resources/memberships.d.mts +1 -1
  84. package/resources/memberships.d.mts.map +1 -1
  85. package/resources/memberships.d.ts +1 -1
  86. package/resources/memberships.d.ts.map +1 -1
  87. package/resources/payments.d.mts +21 -2
  88. package/resources/payments.d.mts.map +1 -1
  89. package/resources/payments.d.ts +21 -2
  90. package/resources/payments.d.ts.map +1 -1
  91. package/resources/plans.d.mts +46 -0
  92. package/resources/plans.d.mts.map +1 -1
  93. package/resources/plans.d.ts +46 -0
  94. package/resources/plans.d.ts.map +1 -1
  95. package/resources/products.d.mts +2 -2
  96. package/resources/products.d.ts +2 -2
  97. package/resources/refunds.d.mts +1 -1
  98. package/resources/refunds.d.mts.map +1 -1
  99. package/resources/refunds.d.ts +1 -1
  100. package/resources/refunds.d.ts.map +1 -1
  101. package/resources/setup-intents.d.mts +74 -0
  102. package/resources/setup-intents.d.mts.map +1 -1
  103. package/resources/setup-intents.d.ts +74 -0
  104. package/resources/setup-intents.d.ts.map +1 -1
  105. package/resources/shared.d.mts +54 -5
  106. package/resources/shared.d.mts.map +1 -1
  107. package/resources/shared.d.ts +54 -5
  108. package/resources/shared.d.ts.map +1 -1
  109. package/resources/webhooks.d.mts +653 -3
  110. package/resources/webhooks.d.mts.map +1 -1
  111. package/resources/webhooks.d.ts +653 -3
  112. package/resources/webhooks.d.ts.map +1 -1
  113. package/resources/webhooks.js.map +1 -1
  114. package/resources/webhooks.mjs.map +1 -1
  115. package/src/client.ts +50 -1
  116. package/src/internal/utils/env.ts +2 -2
  117. package/src/resources/affiliates/affiliates.ts +475 -0
  118. package/src/resources/affiliates/index.ts +32 -0
  119. package/src/resources/affiliates/overrides.ts +593 -0
  120. package/src/resources/affiliates.ts +3 -0
  121. package/src/resources/ai-chats.ts +25 -1
  122. package/src/resources/apps.ts +31 -0
  123. package/src/resources/checkout-configurations.ts +81 -0
  124. package/src/resources/companies.ts +23 -0
  125. package/src/resources/index.ts +19 -0
  126. package/src/resources/invoices.ts +316 -397
  127. package/src/resources/memberships.ts +1 -1
  128. package/src/resources/payments.ts +26 -1
  129. package/src/resources/plans.ts +54 -0
  130. package/src/resources/products.ts +2 -2
  131. package/src/resources/refunds.ts +2 -1
  132. package/src/resources/setup-intents.ts +90 -0
  133. package/src/resources/shared.ts +65 -5
  134. package/src/resources/webhooks.ts +818 -0
  135. package/src/version.ts +1 -1
  136. package/version.d.mts +1 -1
  137. package/version.d.ts +1 -1
  138. package/version.js +1 -1
  139. package/version.mjs +1 -1
@@ -7,6 +7,7 @@ import * as PaymentsAPI from './payments';
7
7
  import * as PayoutAccountsAPI from './payout-accounts';
8
8
  import * as PayoutMethodsAPI from './payout-methods';
9
9
  import * as RefundsAPI from './refunds';
10
+ import * as ResolutionCenterCasesAPI from './resolution-center-cases';
10
11
  import * as SetupIntentsAPI from './setup-intents';
11
12
  import * as Shared from './shared';
12
13
  import * as VerificationsAPI from './verifications';
@@ -201,6 +202,7 @@ export interface Webhook {
201
202
  */
202
203
  export type WebhookEvent =
203
204
  | 'invoice.created'
205
+ | 'invoice.marked_uncollectible'
204
206
  | 'invoice.paid'
205
207
  | 'invoice.past_due'
206
208
  | 'invoice.voided'
@@ -219,6 +221,9 @@ export type WebhookEvent =
219
221
  | 'payout_method.created'
220
222
  | 'verification.succeeded'
221
223
  | 'payout_account.status_updated'
224
+ | 'resolution_center_case.created'
225
+ | 'resolution_center_case.updated'
226
+ | 'resolution_center_case.decided'
222
227
  | 'payment.created'
223
228
  | 'payment.succeeded'
224
229
  | 'payment.failed'
@@ -371,6 +376,40 @@ export interface InvoiceCreatedWebhookEvent {
371
376
  company_id?: string | null;
372
377
  }
373
378
 
379
+ export interface InvoiceMarkedUncollectibleWebhookEvent {
380
+ /**
381
+ * A unique ID for every single webhook request
382
+ */
383
+ id: string;
384
+
385
+ /**
386
+ * The API version for this webhook
387
+ */
388
+ api_version: 'v1';
389
+
390
+ /**
391
+ * An invoice represents an itemized bill sent by a company to a customer for a
392
+ * specific product and plan, tracking the amount owed, due date, and payment
393
+ * status.
394
+ */
395
+ data: Shared.Invoice;
396
+
397
+ /**
398
+ * The timestamp in ISO 8601 format that the webhook was sent at on the server
399
+ */
400
+ timestamp: string;
401
+
402
+ /**
403
+ * The webhook event type
404
+ */
405
+ type: 'invoice.marked_uncollectible';
406
+
407
+ /**
408
+ * The company ID that this webhook event is associated with
409
+ */
410
+ company_id?: string | null;
411
+ }
412
+
374
413
  export interface InvoicePaidWebhookEvent {
375
414
  /**
376
415
  * A unique ID for every single webhook request
@@ -1223,6 +1262,777 @@ export namespace PayoutAccountStatusUpdatedWebhookEvent {
1223
1262
  }
1224
1263
  }
1225
1264
 
1265
+ export interface ResolutionCenterCaseCreatedWebhookEvent {
1266
+ /**
1267
+ * A unique ID for every single webhook request
1268
+ */
1269
+ id: string;
1270
+
1271
+ /**
1272
+ * The API version for this webhook
1273
+ */
1274
+ api_version: 'v1';
1275
+
1276
+ /**
1277
+ * A resolution center case is a dispute or support case between a user and a
1278
+ * company, tracking the issue, status, and outcome.
1279
+ */
1280
+ data: ResolutionCenterCaseCreatedWebhookEvent.Data;
1281
+
1282
+ /**
1283
+ * The timestamp in ISO 8601 format that the webhook was sent at on the server
1284
+ */
1285
+ timestamp: string;
1286
+
1287
+ /**
1288
+ * The webhook event type
1289
+ */
1290
+ type: 'resolution_center_case.created';
1291
+
1292
+ /**
1293
+ * The company ID that this webhook event is associated with
1294
+ */
1295
+ company_id?: string | null;
1296
+ }
1297
+
1298
+ export namespace ResolutionCenterCaseCreatedWebhookEvent {
1299
+ /**
1300
+ * A resolution center case is a dispute or support case between a user and a
1301
+ * company, tracking the issue, status, and outcome.
1302
+ */
1303
+ export interface Data {
1304
+ /**
1305
+ * The unique identifier for the resolution.
1306
+ */
1307
+ id: string;
1308
+
1309
+ /**
1310
+ * The company involved in this resolution case. Null if the company no longer
1311
+ * exists.
1312
+ */
1313
+ company: Data.Company | null;
1314
+
1315
+ /**
1316
+ * The datetime the resolution was created.
1317
+ */
1318
+ created_at: string;
1319
+
1320
+ /**
1321
+ * Whether the customer has filed an appeal after the initial resolution decision.
1322
+ */
1323
+ customer_appealed: boolean;
1324
+
1325
+ /**
1326
+ * The list of actions currently available to the customer.
1327
+ */
1328
+ customer_response_actions: Array<ResolutionCenterCasesAPI.ResolutionCenterCaseCustomerResponse>;
1329
+
1330
+ /**
1331
+ * The deadline by which the next response is required. Null if no deadline is
1332
+ * currently active. As a Unix timestamp.
1333
+ */
1334
+ due_date: string | null;
1335
+
1336
+ /**
1337
+ * The category of the dispute.
1338
+ */
1339
+ issue: ResolutionCenterCasesAPI.ResolutionCenterCaseIssueType;
1340
+
1341
+ /**
1342
+ * The membership record associated with the disputed payment. Null if the
1343
+ * membership no longer exists.
1344
+ */
1345
+ member: Data.Member | null;
1346
+
1347
+ /**
1348
+ * Whether the merchant has filed an appeal after the initial resolution decision.
1349
+ */
1350
+ merchant_appealed: boolean;
1351
+
1352
+ /**
1353
+ * The list of actions currently available to the merchant.
1354
+ */
1355
+ merchant_response_actions: Array<ResolutionCenterCasesAPI.ResolutionCenterCaseMerchantResponse>;
1356
+
1357
+ /**
1358
+ * The payment record that is the subject of this resolution case.
1359
+ */
1360
+ payment: Data.Payment;
1361
+
1362
+ /**
1363
+ * The list of actions currently available to the Whop platform for moderating this
1364
+ * resolution.
1365
+ */
1366
+ platform_response_actions: Array<ResolutionCenterCasesAPI.ResolutionCenterCasePlatformResponse>;
1367
+
1368
+ /**
1369
+ * The most recent 50 messages, actions, and status changes that have occurred
1370
+ * during this resolution case.
1371
+ */
1372
+ resolution_events: Array<Data.ResolutionEvent>;
1373
+
1374
+ /**
1375
+ * The current status of the resolution case, indicating which party needs to
1376
+ * respond or if the case is closed.
1377
+ */
1378
+ status: ResolutionCenterCasesAPI.ResolutionCenterCaseStatus;
1379
+
1380
+ /**
1381
+ * The datetime the resolution was last updated.
1382
+ */
1383
+ updated_at: string;
1384
+
1385
+ /**
1386
+ * The customer (buyer) who filed this resolution case.
1387
+ */
1388
+ user: Data.User;
1389
+ }
1390
+
1391
+ export namespace Data {
1392
+ /**
1393
+ * The company involved in this resolution case. Null if the company no longer
1394
+ * exists.
1395
+ */
1396
+ export interface Company {
1397
+ /**
1398
+ * The unique identifier for the company.
1399
+ */
1400
+ id: string;
1401
+
1402
+ /**
1403
+ * The display name of the company shown to customers.
1404
+ */
1405
+ title: string;
1406
+ }
1407
+
1408
+ /**
1409
+ * The membership record associated with the disputed payment. Null if the
1410
+ * membership no longer exists.
1411
+ */
1412
+ export interface Member {
1413
+ /**
1414
+ * The unique identifier for the extra public member.
1415
+ */
1416
+ id: string;
1417
+ }
1418
+
1419
+ /**
1420
+ * The payment record that is the subject of this resolution case.
1421
+ */
1422
+ export interface Payment {
1423
+ /**
1424
+ * The unique identifier for the payment.
1425
+ */
1426
+ id: string;
1427
+
1428
+ /**
1429
+ * The datetime the payment was created.
1430
+ */
1431
+ created_at: string;
1432
+
1433
+ /**
1434
+ * The available currencies on the platform
1435
+ */
1436
+ currency: Shared.Currency | null;
1437
+
1438
+ /**
1439
+ * The time at which this payment was successfully collected. Null if the payment
1440
+ * has not yet succeeded. As a Unix timestamp.
1441
+ */
1442
+ paid_at: string | null;
1443
+
1444
+ /**
1445
+ * The payment amount before taxes and discounts are applied. In the currency
1446
+ * specified by the currency field.
1447
+ */
1448
+ subtotal: number | null;
1449
+
1450
+ /**
1451
+ * The total amount charged to the customer for this payment, including taxes and
1452
+ * after any discounts. In the currency specified by the currency field.
1453
+ */
1454
+ total: number;
1455
+ }
1456
+
1457
+ /**
1458
+ * A resolution event is a message or action within a resolution case, such as a
1459
+ * response, escalation, or status change.
1460
+ */
1461
+ export interface ResolutionEvent {
1462
+ /**
1463
+ * The unique identifier for the resolution event.
1464
+ */
1465
+ id: string;
1466
+
1467
+ /**
1468
+ * The type of action recorded in this event.
1469
+ */
1470
+ action:
1471
+ | 'created'
1472
+ | 'responded'
1473
+ | 'accepted'
1474
+ | 'denied'
1475
+ | 'appealed'
1476
+ | 'withdrew'
1477
+ | 'requested_more_info'
1478
+ | 'escalated'
1479
+ | 'dispute_opened'
1480
+ | 'dispute_customer_won'
1481
+ | 'dispute_merchant_won';
1482
+
1483
+ /**
1484
+ * The datetime the resolution event was created.
1485
+ */
1486
+ created_at: string;
1487
+
1488
+ /**
1489
+ * The message body or additional context provided with this resolution event. Null
1490
+ * if no details were included.
1491
+ */
1492
+ details: string | null;
1493
+
1494
+ /**
1495
+ * The party who performed this action.
1496
+ */
1497
+ reporter_type: 'merchant' | 'customer' | 'platform' | 'system';
1498
+ }
1499
+
1500
+ /**
1501
+ * The customer (buyer) who filed this resolution case.
1502
+ */
1503
+ export interface User {
1504
+ /**
1505
+ * The unique identifier for the user.
1506
+ */
1507
+ id: string;
1508
+
1509
+ /**
1510
+ * The user's display name shown on their public profile.
1511
+ */
1512
+ name: string | null;
1513
+
1514
+ /**
1515
+ * The user's unique username shown on their public profile.
1516
+ */
1517
+ username: string;
1518
+ }
1519
+ }
1520
+ }
1521
+
1522
+ export interface ResolutionCenterCaseUpdatedWebhookEvent {
1523
+ /**
1524
+ * A unique ID for every single webhook request
1525
+ */
1526
+ id: string;
1527
+
1528
+ /**
1529
+ * The API version for this webhook
1530
+ */
1531
+ api_version: 'v1';
1532
+
1533
+ /**
1534
+ * A resolution center case is a dispute or support case between a user and a
1535
+ * company, tracking the issue, status, and outcome.
1536
+ */
1537
+ data: ResolutionCenterCaseUpdatedWebhookEvent.Data;
1538
+
1539
+ /**
1540
+ * The timestamp in ISO 8601 format that the webhook was sent at on the server
1541
+ */
1542
+ timestamp: string;
1543
+
1544
+ /**
1545
+ * The webhook event type
1546
+ */
1547
+ type: 'resolution_center_case.updated';
1548
+
1549
+ /**
1550
+ * The company ID that this webhook event is associated with
1551
+ */
1552
+ company_id?: string | null;
1553
+ }
1554
+
1555
+ export namespace ResolutionCenterCaseUpdatedWebhookEvent {
1556
+ /**
1557
+ * A resolution center case is a dispute or support case between a user and a
1558
+ * company, tracking the issue, status, and outcome.
1559
+ */
1560
+ export interface Data {
1561
+ /**
1562
+ * The unique identifier for the resolution.
1563
+ */
1564
+ id: string;
1565
+
1566
+ /**
1567
+ * The company involved in this resolution case. Null if the company no longer
1568
+ * exists.
1569
+ */
1570
+ company: Data.Company | null;
1571
+
1572
+ /**
1573
+ * The datetime the resolution was created.
1574
+ */
1575
+ created_at: string;
1576
+
1577
+ /**
1578
+ * Whether the customer has filed an appeal after the initial resolution decision.
1579
+ */
1580
+ customer_appealed: boolean;
1581
+
1582
+ /**
1583
+ * The list of actions currently available to the customer.
1584
+ */
1585
+ customer_response_actions: Array<ResolutionCenterCasesAPI.ResolutionCenterCaseCustomerResponse>;
1586
+
1587
+ /**
1588
+ * The deadline by which the next response is required. Null if no deadline is
1589
+ * currently active. As a Unix timestamp.
1590
+ */
1591
+ due_date: string | null;
1592
+
1593
+ /**
1594
+ * The category of the dispute.
1595
+ */
1596
+ issue: ResolutionCenterCasesAPI.ResolutionCenterCaseIssueType;
1597
+
1598
+ /**
1599
+ * The membership record associated with the disputed payment. Null if the
1600
+ * membership no longer exists.
1601
+ */
1602
+ member: Data.Member | null;
1603
+
1604
+ /**
1605
+ * Whether the merchant has filed an appeal after the initial resolution decision.
1606
+ */
1607
+ merchant_appealed: boolean;
1608
+
1609
+ /**
1610
+ * The list of actions currently available to the merchant.
1611
+ */
1612
+ merchant_response_actions: Array<ResolutionCenterCasesAPI.ResolutionCenterCaseMerchantResponse>;
1613
+
1614
+ /**
1615
+ * The payment record that is the subject of this resolution case.
1616
+ */
1617
+ payment: Data.Payment;
1618
+
1619
+ /**
1620
+ * The list of actions currently available to the Whop platform for moderating this
1621
+ * resolution.
1622
+ */
1623
+ platform_response_actions: Array<ResolutionCenterCasesAPI.ResolutionCenterCasePlatformResponse>;
1624
+
1625
+ /**
1626
+ * The most recent 50 messages, actions, and status changes that have occurred
1627
+ * during this resolution case.
1628
+ */
1629
+ resolution_events: Array<Data.ResolutionEvent>;
1630
+
1631
+ /**
1632
+ * The current status of the resolution case, indicating which party needs to
1633
+ * respond or if the case is closed.
1634
+ */
1635
+ status: ResolutionCenterCasesAPI.ResolutionCenterCaseStatus;
1636
+
1637
+ /**
1638
+ * The datetime the resolution was last updated.
1639
+ */
1640
+ updated_at: string;
1641
+
1642
+ /**
1643
+ * The customer (buyer) who filed this resolution case.
1644
+ */
1645
+ user: Data.User;
1646
+ }
1647
+
1648
+ export namespace Data {
1649
+ /**
1650
+ * The company involved in this resolution case. Null if the company no longer
1651
+ * exists.
1652
+ */
1653
+ export interface Company {
1654
+ /**
1655
+ * The unique identifier for the company.
1656
+ */
1657
+ id: string;
1658
+
1659
+ /**
1660
+ * The display name of the company shown to customers.
1661
+ */
1662
+ title: string;
1663
+ }
1664
+
1665
+ /**
1666
+ * The membership record associated with the disputed payment. Null if the
1667
+ * membership no longer exists.
1668
+ */
1669
+ export interface Member {
1670
+ /**
1671
+ * The unique identifier for the extra public member.
1672
+ */
1673
+ id: string;
1674
+ }
1675
+
1676
+ /**
1677
+ * The payment record that is the subject of this resolution case.
1678
+ */
1679
+ export interface Payment {
1680
+ /**
1681
+ * The unique identifier for the payment.
1682
+ */
1683
+ id: string;
1684
+
1685
+ /**
1686
+ * The datetime the payment was created.
1687
+ */
1688
+ created_at: string;
1689
+
1690
+ /**
1691
+ * The available currencies on the platform
1692
+ */
1693
+ currency: Shared.Currency | null;
1694
+
1695
+ /**
1696
+ * The time at which this payment was successfully collected. Null if the payment
1697
+ * has not yet succeeded. As a Unix timestamp.
1698
+ */
1699
+ paid_at: string | null;
1700
+
1701
+ /**
1702
+ * The payment amount before taxes and discounts are applied. In the currency
1703
+ * specified by the currency field.
1704
+ */
1705
+ subtotal: number | null;
1706
+
1707
+ /**
1708
+ * The total amount charged to the customer for this payment, including taxes and
1709
+ * after any discounts. In the currency specified by the currency field.
1710
+ */
1711
+ total: number;
1712
+ }
1713
+
1714
+ /**
1715
+ * A resolution event is a message or action within a resolution case, such as a
1716
+ * response, escalation, or status change.
1717
+ */
1718
+ export interface ResolutionEvent {
1719
+ /**
1720
+ * The unique identifier for the resolution event.
1721
+ */
1722
+ id: string;
1723
+
1724
+ /**
1725
+ * The type of action recorded in this event.
1726
+ */
1727
+ action:
1728
+ | 'created'
1729
+ | 'responded'
1730
+ | 'accepted'
1731
+ | 'denied'
1732
+ | 'appealed'
1733
+ | 'withdrew'
1734
+ | 'requested_more_info'
1735
+ | 'escalated'
1736
+ | 'dispute_opened'
1737
+ | 'dispute_customer_won'
1738
+ | 'dispute_merchant_won';
1739
+
1740
+ /**
1741
+ * The datetime the resolution event was created.
1742
+ */
1743
+ created_at: string;
1744
+
1745
+ /**
1746
+ * The message body or additional context provided with this resolution event. Null
1747
+ * if no details were included.
1748
+ */
1749
+ details: string | null;
1750
+
1751
+ /**
1752
+ * The party who performed this action.
1753
+ */
1754
+ reporter_type: 'merchant' | 'customer' | 'platform' | 'system';
1755
+ }
1756
+
1757
+ /**
1758
+ * The customer (buyer) who filed this resolution case.
1759
+ */
1760
+ export interface User {
1761
+ /**
1762
+ * The unique identifier for the user.
1763
+ */
1764
+ id: string;
1765
+
1766
+ /**
1767
+ * The user's display name shown on their public profile.
1768
+ */
1769
+ name: string | null;
1770
+
1771
+ /**
1772
+ * The user's unique username shown on their public profile.
1773
+ */
1774
+ username: string;
1775
+ }
1776
+ }
1777
+ }
1778
+
1779
+ export interface ResolutionCenterCaseDecidedWebhookEvent {
1780
+ /**
1781
+ * A unique ID for every single webhook request
1782
+ */
1783
+ id: string;
1784
+
1785
+ /**
1786
+ * The API version for this webhook
1787
+ */
1788
+ api_version: 'v1';
1789
+
1790
+ /**
1791
+ * A resolution center case is a dispute or support case between a user and a
1792
+ * company, tracking the issue, status, and outcome.
1793
+ */
1794
+ data: ResolutionCenterCaseDecidedWebhookEvent.Data;
1795
+
1796
+ /**
1797
+ * The timestamp in ISO 8601 format that the webhook was sent at on the server
1798
+ */
1799
+ timestamp: string;
1800
+
1801
+ /**
1802
+ * The webhook event type
1803
+ */
1804
+ type: 'resolution_center_case.decided';
1805
+
1806
+ /**
1807
+ * The company ID that this webhook event is associated with
1808
+ */
1809
+ company_id?: string | null;
1810
+ }
1811
+
1812
+ export namespace ResolutionCenterCaseDecidedWebhookEvent {
1813
+ /**
1814
+ * A resolution center case is a dispute or support case between a user and a
1815
+ * company, tracking the issue, status, and outcome.
1816
+ */
1817
+ export interface Data {
1818
+ /**
1819
+ * The unique identifier for the resolution.
1820
+ */
1821
+ id: string;
1822
+
1823
+ /**
1824
+ * The company involved in this resolution case. Null if the company no longer
1825
+ * exists.
1826
+ */
1827
+ company: Data.Company | null;
1828
+
1829
+ /**
1830
+ * The datetime the resolution was created.
1831
+ */
1832
+ created_at: string;
1833
+
1834
+ /**
1835
+ * Whether the customer has filed an appeal after the initial resolution decision.
1836
+ */
1837
+ customer_appealed: boolean;
1838
+
1839
+ /**
1840
+ * The list of actions currently available to the customer.
1841
+ */
1842
+ customer_response_actions: Array<ResolutionCenterCasesAPI.ResolutionCenterCaseCustomerResponse>;
1843
+
1844
+ /**
1845
+ * The deadline by which the next response is required. Null if no deadline is
1846
+ * currently active. As a Unix timestamp.
1847
+ */
1848
+ due_date: string | null;
1849
+
1850
+ /**
1851
+ * The category of the dispute.
1852
+ */
1853
+ issue: ResolutionCenterCasesAPI.ResolutionCenterCaseIssueType;
1854
+
1855
+ /**
1856
+ * The membership record associated with the disputed payment. Null if the
1857
+ * membership no longer exists.
1858
+ */
1859
+ member: Data.Member | null;
1860
+
1861
+ /**
1862
+ * Whether the merchant has filed an appeal after the initial resolution decision.
1863
+ */
1864
+ merchant_appealed: boolean;
1865
+
1866
+ /**
1867
+ * The list of actions currently available to the merchant.
1868
+ */
1869
+ merchant_response_actions: Array<ResolutionCenterCasesAPI.ResolutionCenterCaseMerchantResponse>;
1870
+
1871
+ /**
1872
+ * The payment record that is the subject of this resolution case.
1873
+ */
1874
+ payment: Data.Payment;
1875
+
1876
+ /**
1877
+ * The list of actions currently available to the Whop platform for moderating this
1878
+ * resolution.
1879
+ */
1880
+ platform_response_actions: Array<ResolutionCenterCasesAPI.ResolutionCenterCasePlatformResponse>;
1881
+
1882
+ /**
1883
+ * The most recent 50 messages, actions, and status changes that have occurred
1884
+ * during this resolution case.
1885
+ */
1886
+ resolution_events: Array<Data.ResolutionEvent>;
1887
+
1888
+ /**
1889
+ * The current status of the resolution case, indicating which party needs to
1890
+ * respond or if the case is closed.
1891
+ */
1892
+ status: ResolutionCenterCasesAPI.ResolutionCenterCaseStatus;
1893
+
1894
+ /**
1895
+ * The datetime the resolution was last updated.
1896
+ */
1897
+ updated_at: string;
1898
+
1899
+ /**
1900
+ * The customer (buyer) who filed this resolution case.
1901
+ */
1902
+ user: Data.User;
1903
+ }
1904
+
1905
+ export namespace Data {
1906
+ /**
1907
+ * The company involved in this resolution case. Null if the company no longer
1908
+ * exists.
1909
+ */
1910
+ export interface Company {
1911
+ /**
1912
+ * The unique identifier for the company.
1913
+ */
1914
+ id: string;
1915
+
1916
+ /**
1917
+ * The display name of the company shown to customers.
1918
+ */
1919
+ title: string;
1920
+ }
1921
+
1922
+ /**
1923
+ * The membership record associated with the disputed payment. Null if the
1924
+ * membership no longer exists.
1925
+ */
1926
+ export interface Member {
1927
+ /**
1928
+ * The unique identifier for the extra public member.
1929
+ */
1930
+ id: string;
1931
+ }
1932
+
1933
+ /**
1934
+ * The payment record that is the subject of this resolution case.
1935
+ */
1936
+ export interface Payment {
1937
+ /**
1938
+ * The unique identifier for the payment.
1939
+ */
1940
+ id: string;
1941
+
1942
+ /**
1943
+ * The datetime the payment was created.
1944
+ */
1945
+ created_at: string;
1946
+
1947
+ /**
1948
+ * The available currencies on the platform
1949
+ */
1950
+ currency: Shared.Currency | null;
1951
+
1952
+ /**
1953
+ * The time at which this payment was successfully collected. Null if the payment
1954
+ * has not yet succeeded. As a Unix timestamp.
1955
+ */
1956
+ paid_at: string | null;
1957
+
1958
+ /**
1959
+ * The payment amount before taxes and discounts are applied. In the currency
1960
+ * specified by the currency field.
1961
+ */
1962
+ subtotal: number | null;
1963
+
1964
+ /**
1965
+ * The total amount charged to the customer for this payment, including taxes and
1966
+ * after any discounts. In the currency specified by the currency field.
1967
+ */
1968
+ total: number;
1969
+ }
1970
+
1971
+ /**
1972
+ * A resolution event is a message or action within a resolution case, such as a
1973
+ * response, escalation, or status change.
1974
+ */
1975
+ export interface ResolutionEvent {
1976
+ /**
1977
+ * The unique identifier for the resolution event.
1978
+ */
1979
+ id: string;
1980
+
1981
+ /**
1982
+ * The type of action recorded in this event.
1983
+ */
1984
+ action:
1985
+ | 'created'
1986
+ | 'responded'
1987
+ | 'accepted'
1988
+ | 'denied'
1989
+ | 'appealed'
1990
+ | 'withdrew'
1991
+ | 'requested_more_info'
1992
+ | 'escalated'
1993
+ | 'dispute_opened'
1994
+ | 'dispute_customer_won'
1995
+ | 'dispute_merchant_won';
1996
+
1997
+ /**
1998
+ * The datetime the resolution event was created.
1999
+ */
2000
+ created_at: string;
2001
+
2002
+ /**
2003
+ * The message body or additional context provided with this resolution event. Null
2004
+ * if no details were included.
2005
+ */
2006
+ details: string | null;
2007
+
2008
+ /**
2009
+ * The party who performed this action.
2010
+ */
2011
+ reporter_type: 'merchant' | 'customer' | 'platform' | 'system';
2012
+ }
2013
+
2014
+ /**
2015
+ * The customer (buyer) who filed this resolution case.
2016
+ */
2017
+ export interface User {
2018
+ /**
2019
+ * The unique identifier for the user.
2020
+ */
2021
+ id: string;
2022
+
2023
+ /**
2024
+ * The user's display name shown on their public profile.
2025
+ */
2026
+ name: string | null;
2027
+
2028
+ /**
2029
+ * The user's unique username shown on their public profile.
2030
+ */
2031
+ username: string;
2032
+ }
2033
+ }
2034
+ }
2035
+
1226
2036
  export interface PaymentCreatedWebhookEvent {
1227
2037
  /**
1228
2038
  * A unique ID for every single webhook request
@@ -2240,6 +3050,7 @@ export interface MembershipCancelAtPeriodEndChangedWebhookEvent {
2240
3050
 
2241
3051
  export type UnwrapWebhookEvent =
2242
3052
  | InvoiceCreatedWebhookEvent
3053
+ | InvoiceMarkedUncollectibleWebhookEvent
2243
3054
  | InvoicePaidWebhookEvent
2244
3055
  | InvoicePastDueWebhookEvent
2245
3056
  | InvoiceVoidedWebhookEvent
@@ -2258,6 +3069,9 @@ export type UnwrapWebhookEvent =
2258
3069
  | PayoutMethodCreatedWebhookEvent
2259
3070
  | VerificationSucceededWebhookEvent
2260
3071
  | PayoutAccountStatusUpdatedWebhookEvent
3072
+ | ResolutionCenterCaseCreatedWebhookEvent
3073
+ | ResolutionCenterCaseUpdatedWebhookEvent
3074
+ | ResolutionCenterCaseDecidedWebhookEvent
2261
3075
  | PaymentCreatedWebhookEvent
2262
3076
  | PaymentSucceededWebhookEvent
2263
3077
  | PaymentFailedWebhookEvent
@@ -2361,6 +3175,7 @@ export declare namespace Webhooks {
2361
3175
  type WebhookListResponse as WebhookListResponse,
2362
3176
  type WebhookDeleteResponse as WebhookDeleteResponse,
2363
3177
  type InvoiceCreatedWebhookEvent as InvoiceCreatedWebhookEvent,
3178
+ type InvoiceMarkedUncollectibleWebhookEvent as InvoiceMarkedUncollectibleWebhookEvent,
2364
3179
  type InvoicePaidWebhookEvent as InvoicePaidWebhookEvent,
2365
3180
  type InvoicePastDueWebhookEvent as InvoicePastDueWebhookEvent,
2366
3181
  type InvoiceVoidedWebhookEvent as InvoiceVoidedWebhookEvent,
@@ -2379,6 +3194,9 @@ export declare namespace Webhooks {
2379
3194
  type PayoutMethodCreatedWebhookEvent as PayoutMethodCreatedWebhookEvent,
2380
3195
  type VerificationSucceededWebhookEvent as VerificationSucceededWebhookEvent,
2381
3196
  type PayoutAccountStatusUpdatedWebhookEvent as PayoutAccountStatusUpdatedWebhookEvent,
3197
+ type ResolutionCenterCaseCreatedWebhookEvent as ResolutionCenterCaseCreatedWebhookEvent,
3198
+ type ResolutionCenterCaseUpdatedWebhookEvent as ResolutionCenterCaseUpdatedWebhookEvent,
3199
+ type ResolutionCenterCaseDecidedWebhookEvent as ResolutionCenterCaseDecidedWebhookEvent,
2382
3200
  type PaymentCreatedWebhookEvent as PaymentCreatedWebhookEvent,
2383
3201
  type PaymentSucceededWebhookEvent as PaymentSucceededWebhookEvent,
2384
3202
  type PaymentFailedWebhookEvent as PaymentFailedWebhookEvent,