dodopayments 2.48.0 → 2.49.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 (134) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/bin/migration-config.json +37 -0
  3. package/client.d.mts +7 -4
  4. package/client.d.mts.map +1 -1
  5. package/client.d.ts +7 -4
  6. package/client.d.ts.map +1 -1
  7. package/client.js +3 -0
  8. package/client.js.map +1 -1
  9. package/client.mjs +3 -0
  10. package/client.mjs.map +1 -1
  11. package/package.json +1 -1
  12. package/resources/balances.d.mts +1 -0
  13. package/resources/balances.d.mts.map +1 -1
  14. package/resources/balances.d.ts +1 -0
  15. package/resources/balances.d.ts.map +1 -1
  16. package/resources/blocklist/blocklist.d.mts +10 -0
  17. package/resources/blocklist/blocklist.d.mts.map +1 -0
  18. package/resources/blocklist/blocklist.d.ts +10 -0
  19. package/resources/blocklist/blocklist.d.ts.map +1 -0
  20. package/resources/blocklist/blocklist.js +17 -0
  21. package/resources/blocklist/blocklist.js.map +1 -0
  22. package/resources/blocklist/blocklist.mjs +12 -0
  23. package/resources/blocklist/blocklist.mjs.map +1 -0
  24. package/resources/blocklist/customers/customers.d.mts +161 -0
  25. package/resources/blocklist/customers/customers.d.mts.map +1 -0
  26. package/resources/blocklist/customers/customers.d.ts +161 -0
  27. package/resources/blocklist/customers/customers.d.ts.map +1 -0
  28. package/resources/blocklist/customers/customers.js +38 -0
  29. package/resources/blocklist/customers/customers.js.map +1 -0
  30. package/resources/blocklist/customers/customers.mjs +33 -0
  31. package/resources/blocklist/customers/customers.mjs.map +1 -0
  32. package/resources/blocklist/customers/index.d.mts +3 -0
  33. package/resources/blocklist/customers/index.d.mts.map +1 -0
  34. package/resources/blocklist/customers/index.d.ts +3 -0
  35. package/resources/blocklist/customers/index.d.ts.map +1 -0
  36. package/resources/blocklist/customers/index.js +9 -0
  37. package/resources/blocklist/customers/index.js.map +1 -0
  38. package/resources/blocklist/customers/index.mjs +4 -0
  39. package/resources/blocklist/customers/index.mjs.map +1 -0
  40. package/resources/blocklist/customers/notes.d.mts +34 -0
  41. package/resources/blocklist/customers/notes.d.mts.map +1 -0
  42. package/resources/blocklist/customers/notes.d.ts +34 -0
  43. package/resources/blocklist/customers/notes.d.ts.map +1 -0
  44. package/resources/blocklist/customers/notes.js +17 -0
  45. package/resources/blocklist/customers/notes.js.map +1 -0
  46. package/resources/blocklist/customers/notes.mjs +13 -0
  47. package/resources/blocklist/customers/notes.mjs.map +1 -0
  48. package/resources/blocklist/customers.d.mts +2 -0
  49. package/resources/blocklist/customers.d.mts.map +1 -0
  50. package/resources/blocklist/customers.d.ts +2 -0
  51. package/resources/blocklist/customers.d.ts.map +1 -0
  52. package/resources/blocklist/customers.js +6 -0
  53. package/resources/blocklist/customers.js.map +1 -0
  54. package/resources/blocklist/customers.mjs +3 -0
  55. package/resources/blocklist/customers.mjs.map +1 -0
  56. package/resources/blocklist/index.d.mts +3 -0
  57. package/resources/blocklist/index.d.mts.map +1 -0
  58. package/resources/blocklist/index.d.ts +3 -0
  59. package/resources/blocklist/index.d.ts.map +1 -0
  60. package/resources/blocklist/index.js +9 -0
  61. package/resources/blocklist/index.js.map +1 -0
  62. package/resources/blocklist/index.mjs +4 -0
  63. package/resources/blocklist/index.mjs.map +1 -0
  64. package/resources/blocklist.d.mts +2 -0
  65. package/resources/blocklist.d.mts.map +1 -0
  66. package/resources/blocklist.d.ts +2 -0
  67. package/resources/blocklist.d.ts.map +1 -0
  68. package/resources/blocklist.js +6 -0
  69. package/resources/blocklist.js.map +1 -0
  70. package/resources/blocklist.mjs +3 -0
  71. package/resources/blocklist.mjs.map +1 -0
  72. package/resources/customers/customers.d.mts +10 -0
  73. package/resources/customers/customers.d.mts.map +1 -1
  74. package/resources/customers/customers.d.ts +10 -0
  75. package/resources/customers/customers.d.ts.map +1 -1
  76. package/resources/customers/customers.js.map +1 -1
  77. package/resources/customers/customers.mjs.map +1 -1
  78. package/resources/index.d.mts +3 -2
  79. package/resources/index.d.mts.map +1 -1
  80. package/resources/index.d.ts +3 -2
  81. package/resources/index.d.ts.map +1 -1
  82. package/resources/index.js +3 -1
  83. package/resources/index.js.map +1 -1
  84. package/resources/index.mjs +1 -0
  85. package/resources/index.mjs.map +1 -1
  86. package/resources/payments.d.mts +64 -1
  87. package/resources/payments.d.mts.map +1 -1
  88. package/resources/payments.d.ts +64 -1
  89. package/resources/payments.d.ts.map +1 -1
  90. package/resources/payments.js +21 -0
  91. package/resources/payments.js.map +1 -1
  92. package/resources/payments.mjs +21 -0
  93. package/resources/payments.mjs.map +1 -1
  94. package/resources/subscriptions.d.mts +3 -3
  95. package/resources/subscriptions.d.mts.map +1 -1
  96. package/resources/subscriptions.d.ts +3 -3
  97. package/resources/subscriptions.d.ts.map +1 -1
  98. package/resources/webhook-events.d.mts +12 -2
  99. package/resources/webhook-events.d.mts.map +1 -1
  100. package/resources/webhook-events.d.ts +12 -2
  101. package/resources/webhook-events.d.ts.map +1 -1
  102. package/resources/webhooks/index.d.mts +1 -1
  103. package/resources/webhooks/index.d.mts.map +1 -1
  104. package/resources/webhooks/index.d.ts +1 -1
  105. package/resources/webhooks/index.d.ts.map +1 -1
  106. package/resources/webhooks/index.js.map +1 -1
  107. package/resources/webhooks/index.mjs.map +1 -1
  108. package/resources/webhooks/webhooks.d.mts +543 -51
  109. package/resources/webhooks/webhooks.d.mts.map +1 -1
  110. package/resources/webhooks/webhooks.d.ts +543 -51
  111. package/resources/webhooks/webhooks.d.ts.map +1 -1
  112. package/resources/webhooks/webhooks.js.map +1 -1
  113. package/resources/webhooks/webhooks.mjs.map +1 -1
  114. package/src/client.ts +11 -0
  115. package/src/resources/balances.ts +2 -0
  116. package/src/resources/blocklist/blocklist.ts +37 -0
  117. package/src/resources/blocklist/customers/customers.ts +254 -0
  118. package/src/resources/blocklist/customers/index.ts +21 -0
  119. package/src/resources/blocklist/customers/notes.ts +62 -0
  120. package/src/resources/blocklist/customers.ts +3 -0
  121. package/src/resources/blocklist/index.ts +15 -0
  122. package/src/resources/blocklist.ts +3 -0
  123. package/src/resources/customers/customers.ts +12 -0
  124. package/src/resources/index.ts +4 -0
  125. package/src/resources/payments.ts +84 -0
  126. package/src/resources/subscriptions.ts +4 -2
  127. package/src/resources/webhook-events.ts +13 -1
  128. package/src/resources/webhooks/index.ts +1 -0
  129. package/src/resources/webhooks/webhooks.ts +575 -48
  130. package/src/version.ts +1 -1
  131. package/version.d.mts +1 -1
  132. package/version.d.ts +1 -1
  133. package/version.js +1 -1
  134. package/version.mjs +1 -1
@@ -525,7 +525,7 @@ export declare namespace DunningRecoveredWebhookEvent {
525
525
  customer_id: string;
526
526
  status: 'recovering' | 'recovered' | 'exhausted';
527
527
  subscription_id: string;
528
- trigger_state: 'on_hold' | 'cancelled';
528
+ trigger_state: 'on_hold' | 'cancelled' | 'past_due';
529
529
  payment_id?: string | null;
530
530
  }
531
531
  }
@@ -560,7 +560,7 @@ export declare namespace DunningStartedWebhookEvent {
560
560
  customer_id: string;
561
561
  status: 'recovering' | 'recovered' | 'exhausted';
562
562
  subscription_id: string;
563
- trigger_state: 'on_hold' | 'cancelled';
563
+ trigger_state: 'on_hold' | 'cancelled' | 'past_due';
564
564
  payment_id?: string | null;
565
565
  }
566
566
  }
@@ -1161,9 +1161,10 @@ export interface SubscriptionActiveWebhookEvent {
1161
1161
  */
1162
1162
  business_id: string;
1163
1163
  /**
1164
- * Response struct representing subscription details
1164
+ * Subscription payload sent on a webhook. It carries every field of
1165
+ * `SubscriptionResponse`, plus the grace-period deadline.
1165
1166
  */
1166
- data: SubscriptionsAPI.Subscription;
1167
+ data: SubscriptionActiveWebhookEvent.Data;
1167
1168
  /**
1168
1169
  * The timestamp of when the event occurred
1169
1170
  */
@@ -1173,15 +1174,34 @@ export interface SubscriptionActiveWebhookEvent {
1173
1174
  */
1174
1175
  type: 'subscription.active';
1175
1176
  }
1177
+ export declare namespace SubscriptionActiveWebhookEvent {
1178
+ /**
1179
+ * Subscription payload sent on a webhook. It carries every field of
1180
+ * `SubscriptionResponse`, plus the grace-period deadline.
1181
+ */
1182
+ interface Data extends SubscriptionsAPI.Subscription {
1183
+ /**
1184
+ * Time when the grace period ends. The subscription moves to `on_hold` or to
1185
+ * `cancelled` at this time.
1186
+ *
1187
+ * Read in the same query as the rest of the payload, so it always comes from the
1188
+ * row snapshot that produced `status`. It is set whenever the subscription sits in
1189
+ * a window at that moment. A delayed event of another type therefore carries the
1190
+ * deadline too, next to a `past_due` status.
1191
+ */
1192
+ past_due_ends_at?: string | null;
1193
+ }
1194
+ }
1176
1195
  export interface SubscriptionCancelledWebhookEvent {
1177
1196
  /**
1178
1197
  * The business identifier
1179
1198
  */
1180
1199
  business_id: string;
1181
1200
  /**
1182
- * Response struct representing subscription details
1201
+ * Subscription payload sent on a webhook. It carries every field of
1202
+ * `SubscriptionResponse`, plus the grace-period deadline.
1183
1203
  */
1184
- data: SubscriptionsAPI.Subscription;
1204
+ data: SubscriptionCancelledWebhookEvent.Data;
1185
1205
  /**
1186
1206
  * The timestamp of when the event occurred
1187
1207
  */
@@ -1191,15 +1211,34 @@ export interface SubscriptionCancelledWebhookEvent {
1191
1211
  */
1192
1212
  type: 'subscription.cancelled';
1193
1213
  }
1214
+ export declare namespace SubscriptionCancelledWebhookEvent {
1215
+ /**
1216
+ * Subscription payload sent on a webhook. It carries every field of
1217
+ * `SubscriptionResponse`, plus the grace-period deadline.
1218
+ */
1219
+ interface Data extends SubscriptionsAPI.Subscription {
1220
+ /**
1221
+ * Time when the grace period ends. The subscription moves to `on_hold` or to
1222
+ * `cancelled` at this time.
1223
+ *
1224
+ * Read in the same query as the rest of the payload, so it always comes from the
1225
+ * row snapshot that produced `status`. It is set whenever the subscription sits in
1226
+ * a window at that moment. A delayed event of another type therefore carries the
1227
+ * deadline too, next to a `past_due` status.
1228
+ */
1229
+ past_due_ends_at?: string | null;
1230
+ }
1231
+ }
1194
1232
  export interface SubscriptionExpiredWebhookEvent {
1195
1233
  /**
1196
1234
  * The business identifier
1197
1235
  */
1198
1236
  business_id: string;
1199
1237
  /**
1200
- * Response struct representing subscription details
1238
+ * Subscription payload sent on a webhook. It carries every field of
1239
+ * `SubscriptionResponse`, plus the grace-period deadline.
1201
1240
  */
1202
- data: SubscriptionsAPI.Subscription;
1241
+ data: SubscriptionExpiredWebhookEvent.Data;
1203
1242
  /**
1204
1243
  * The timestamp of when the event occurred
1205
1244
  */
@@ -1209,15 +1248,34 @@ export interface SubscriptionExpiredWebhookEvent {
1209
1248
  */
1210
1249
  type: 'subscription.expired';
1211
1250
  }
1251
+ export declare namespace SubscriptionExpiredWebhookEvent {
1252
+ /**
1253
+ * Subscription payload sent on a webhook. It carries every field of
1254
+ * `SubscriptionResponse`, plus the grace-period deadline.
1255
+ */
1256
+ interface Data extends SubscriptionsAPI.Subscription {
1257
+ /**
1258
+ * Time when the grace period ends. The subscription moves to `on_hold` or to
1259
+ * `cancelled` at this time.
1260
+ *
1261
+ * Read in the same query as the rest of the payload, so it always comes from the
1262
+ * row snapshot that produced `status`. It is set whenever the subscription sits in
1263
+ * a window at that moment. A delayed event of another type therefore carries the
1264
+ * deadline too, next to a `past_due` status.
1265
+ */
1266
+ past_due_ends_at?: string | null;
1267
+ }
1268
+ }
1212
1269
  export interface SubscriptionFailedWebhookEvent {
1213
1270
  /**
1214
1271
  * The business identifier
1215
1272
  */
1216
1273
  business_id: string;
1217
1274
  /**
1218
- * Response struct representing subscription details
1275
+ * Subscription payload sent on a webhook. It carries every field of
1276
+ * `SubscriptionResponse`, plus the grace-period deadline.
1219
1277
  */
1220
- data: SubscriptionsAPI.Subscription;
1278
+ data: SubscriptionFailedWebhookEvent.Data;
1221
1279
  /**
1222
1280
  * The timestamp of when the event occurred
1223
1281
  */
@@ -1227,15 +1285,34 @@ export interface SubscriptionFailedWebhookEvent {
1227
1285
  */
1228
1286
  type: 'subscription.failed';
1229
1287
  }
1288
+ export declare namespace SubscriptionFailedWebhookEvent {
1289
+ /**
1290
+ * Subscription payload sent on a webhook. It carries every field of
1291
+ * `SubscriptionResponse`, plus the grace-period deadline.
1292
+ */
1293
+ interface Data extends SubscriptionsAPI.Subscription {
1294
+ /**
1295
+ * Time when the grace period ends. The subscription moves to `on_hold` or to
1296
+ * `cancelled` at this time.
1297
+ *
1298
+ * Read in the same query as the rest of the payload, so it always comes from the
1299
+ * row snapshot that produced `status`. It is set whenever the subscription sits in
1300
+ * a window at that moment. A delayed event of another type therefore carries the
1301
+ * deadline too, next to a `past_due` status.
1302
+ */
1303
+ past_due_ends_at?: string | null;
1304
+ }
1305
+ }
1230
1306
  export interface SubscriptionOnHoldWebhookEvent {
1231
1307
  /**
1232
1308
  * The business identifier
1233
1309
  */
1234
1310
  business_id: string;
1235
1311
  /**
1236
- * Response struct representing subscription details
1312
+ * Subscription payload sent on a webhook. It carries every field of
1313
+ * `SubscriptionResponse`, plus the grace-period deadline.
1237
1314
  */
1238
- data: SubscriptionsAPI.Subscription;
1315
+ data: SubscriptionOnHoldWebhookEvent.Data;
1239
1316
  /**
1240
1317
  * The timestamp of when the event occurred
1241
1318
  */
@@ -1245,15 +1322,71 @@ export interface SubscriptionOnHoldWebhookEvent {
1245
1322
  */
1246
1323
  type: 'subscription.on_hold';
1247
1324
  }
1325
+ export declare namespace SubscriptionOnHoldWebhookEvent {
1326
+ /**
1327
+ * Subscription payload sent on a webhook. It carries every field of
1328
+ * `SubscriptionResponse`, plus the grace-period deadline.
1329
+ */
1330
+ interface Data extends SubscriptionsAPI.Subscription {
1331
+ /**
1332
+ * Time when the grace period ends. The subscription moves to `on_hold` or to
1333
+ * `cancelled` at this time.
1334
+ *
1335
+ * Read in the same query as the rest of the payload, so it always comes from the
1336
+ * row snapshot that produced `status`. It is set whenever the subscription sits in
1337
+ * a window at that moment. A delayed event of another type therefore carries the
1338
+ * deadline too, next to a `past_due` status.
1339
+ */
1340
+ past_due_ends_at?: string | null;
1341
+ }
1342
+ }
1343
+ export interface SubscriptionPastDueWebhookEvent {
1344
+ /**
1345
+ * The business identifier
1346
+ */
1347
+ business_id: string;
1348
+ /**
1349
+ * Subscription payload sent on a webhook. It carries every field of
1350
+ * `SubscriptionResponse`, plus the grace-period deadline.
1351
+ */
1352
+ data: SubscriptionPastDueWebhookEvent.Data;
1353
+ /**
1354
+ * The timestamp of when the event occurred
1355
+ */
1356
+ timestamp: string;
1357
+ /**
1358
+ * The event type
1359
+ */
1360
+ type: 'subscription.past_due';
1361
+ }
1362
+ export declare namespace SubscriptionPastDueWebhookEvent {
1363
+ /**
1364
+ * Subscription payload sent on a webhook. It carries every field of
1365
+ * `SubscriptionResponse`, plus the grace-period deadline.
1366
+ */
1367
+ interface Data extends SubscriptionsAPI.Subscription {
1368
+ /**
1369
+ * Time when the grace period ends. The subscription moves to `on_hold` or to
1370
+ * `cancelled` at this time.
1371
+ *
1372
+ * Read in the same query as the rest of the payload, so it always comes from the
1373
+ * row snapshot that produced `status`. It is set whenever the subscription sits in
1374
+ * a window at that moment. A delayed event of another type therefore carries the
1375
+ * deadline too, next to a `past_due` status.
1376
+ */
1377
+ past_due_ends_at?: string | null;
1378
+ }
1379
+ }
1248
1380
  export interface SubscriptionPausedWebhookEvent {
1249
1381
  /**
1250
1382
  * The business identifier
1251
1383
  */
1252
1384
  business_id: string;
1253
1385
  /**
1254
- * Response struct representing subscription details
1386
+ * Subscription payload sent on a webhook. It carries every field of
1387
+ * `SubscriptionResponse`, plus the grace-period deadline.
1255
1388
  */
1256
- data: SubscriptionsAPI.Subscription;
1389
+ data: SubscriptionPausedWebhookEvent.Data;
1257
1390
  /**
1258
1391
  * The timestamp of when the event occurred
1259
1392
  */
@@ -1263,15 +1396,34 @@ export interface SubscriptionPausedWebhookEvent {
1263
1396
  */
1264
1397
  type: 'subscription.paused';
1265
1398
  }
1399
+ export declare namespace SubscriptionPausedWebhookEvent {
1400
+ /**
1401
+ * Subscription payload sent on a webhook. It carries every field of
1402
+ * `SubscriptionResponse`, plus the grace-period deadline.
1403
+ */
1404
+ interface Data extends SubscriptionsAPI.Subscription {
1405
+ /**
1406
+ * Time when the grace period ends. The subscription moves to `on_hold` or to
1407
+ * `cancelled` at this time.
1408
+ *
1409
+ * Read in the same query as the rest of the payload, so it always comes from the
1410
+ * row snapshot that produced `status`. It is set whenever the subscription sits in
1411
+ * a window at that moment. A delayed event of another type therefore carries the
1412
+ * deadline too, next to a `past_due` status.
1413
+ */
1414
+ past_due_ends_at?: string | null;
1415
+ }
1416
+ }
1266
1417
  export interface SubscriptionPlanChangedWebhookEvent {
1267
1418
  /**
1268
1419
  * The business identifier
1269
1420
  */
1270
1421
  business_id: string;
1271
1422
  /**
1272
- * Response struct representing subscription details
1423
+ * Subscription payload sent on a webhook. It carries every field of
1424
+ * `SubscriptionResponse`, plus the grace-period deadline.
1273
1425
  */
1274
- data: SubscriptionsAPI.Subscription;
1426
+ data: SubscriptionPlanChangedWebhookEvent.Data;
1275
1427
  /**
1276
1428
  * The timestamp of when the event occurred
1277
1429
  */
@@ -1281,15 +1433,34 @@ export interface SubscriptionPlanChangedWebhookEvent {
1281
1433
  */
1282
1434
  type: 'subscription.plan_changed';
1283
1435
  }
1436
+ export declare namespace SubscriptionPlanChangedWebhookEvent {
1437
+ /**
1438
+ * Subscription payload sent on a webhook. It carries every field of
1439
+ * `SubscriptionResponse`, plus the grace-period deadline.
1440
+ */
1441
+ interface Data extends SubscriptionsAPI.Subscription {
1442
+ /**
1443
+ * Time when the grace period ends. The subscription moves to `on_hold` or to
1444
+ * `cancelled` at this time.
1445
+ *
1446
+ * Read in the same query as the rest of the payload, so it always comes from the
1447
+ * row snapshot that produced `status`. It is set whenever the subscription sits in
1448
+ * a window at that moment. A delayed event of another type therefore carries the
1449
+ * deadline too, next to a `past_due` status.
1450
+ */
1451
+ past_due_ends_at?: string | null;
1452
+ }
1453
+ }
1284
1454
  export interface SubscriptionRenewedWebhookEvent {
1285
1455
  /**
1286
1456
  * The business identifier
1287
1457
  */
1288
1458
  business_id: string;
1289
1459
  /**
1290
- * Response struct representing subscription details
1460
+ * Subscription payload sent on a webhook. It carries every field of
1461
+ * `SubscriptionResponse`, plus the grace-period deadline.
1291
1462
  */
1292
- data: SubscriptionsAPI.Subscription;
1463
+ data: SubscriptionRenewedWebhookEvent.Data;
1293
1464
  /**
1294
1465
  * The timestamp of when the event occurred
1295
1466
  */
@@ -1299,15 +1470,34 @@ export interface SubscriptionRenewedWebhookEvent {
1299
1470
  */
1300
1471
  type: 'subscription.renewed';
1301
1472
  }
1473
+ export declare namespace SubscriptionRenewedWebhookEvent {
1474
+ /**
1475
+ * Subscription payload sent on a webhook. It carries every field of
1476
+ * `SubscriptionResponse`, plus the grace-period deadline.
1477
+ */
1478
+ interface Data extends SubscriptionsAPI.Subscription {
1479
+ /**
1480
+ * Time when the grace period ends. The subscription moves to `on_hold` or to
1481
+ * `cancelled` at this time.
1482
+ *
1483
+ * Read in the same query as the rest of the payload, so it always comes from the
1484
+ * row snapshot that produced `status`. It is set whenever the subscription sits in
1485
+ * a window at that moment. A delayed event of another type therefore carries the
1486
+ * deadline too, next to a `past_due` status.
1487
+ */
1488
+ past_due_ends_at?: string | null;
1489
+ }
1490
+ }
1302
1491
  export interface SubscriptionUnpausedWebhookEvent {
1303
1492
  /**
1304
1493
  * The business identifier
1305
1494
  */
1306
1495
  business_id: string;
1307
1496
  /**
1308
- * Response struct representing subscription details
1497
+ * Subscription payload sent on a webhook. It carries every field of
1498
+ * `SubscriptionResponse`, plus the grace-period deadline.
1309
1499
  */
1310
- data: SubscriptionsAPI.Subscription;
1500
+ data: SubscriptionUnpausedWebhookEvent.Data;
1311
1501
  /**
1312
1502
  * The timestamp of when the event occurred
1313
1503
  */
@@ -1317,15 +1507,34 @@ export interface SubscriptionUnpausedWebhookEvent {
1317
1507
  */
1318
1508
  type: 'subscription.unpaused';
1319
1509
  }
1510
+ export declare namespace SubscriptionUnpausedWebhookEvent {
1511
+ /**
1512
+ * Subscription payload sent on a webhook. It carries every field of
1513
+ * `SubscriptionResponse`, plus the grace-period deadline.
1514
+ */
1515
+ interface Data extends SubscriptionsAPI.Subscription {
1516
+ /**
1517
+ * Time when the grace period ends. The subscription moves to `on_hold` or to
1518
+ * `cancelled` at this time.
1519
+ *
1520
+ * Read in the same query as the rest of the payload, so it always comes from the
1521
+ * row snapshot that produced `status`. It is set whenever the subscription sits in
1522
+ * a window at that moment. A delayed event of another type therefore carries the
1523
+ * deadline too, next to a `past_due` status.
1524
+ */
1525
+ past_due_ends_at?: string | null;
1526
+ }
1527
+ }
1320
1528
  export interface SubscriptionUpdatePaymentMethodWebhookEvent {
1321
1529
  /**
1322
1530
  * The business identifier
1323
1531
  */
1324
1532
  business_id: string;
1325
1533
  /**
1326
- * Response struct representing subscription details
1534
+ * Subscription payload sent on a webhook. It carries every field of
1535
+ * `SubscriptionResponse`, plus the grace-period deadline.
1327
1536
  */
1328
- data: SubscriptionsAPI.Subscription;
1537
+ data: SubscriptionUpdatePaymentMethodWebhookEvent.Data;
1329
1538
  /**
1330
1539
  * The timestamp of when the event occurred
1331
1540
  */
@@ -1335,15 +1544,34 @@ export interface SubscriptionUpdatePaymentMethodWebhookEvent {
1335
1544
  */
1336
1545
  type: 'subscription.update_payment_method';
1337
1546
  }
1547
+ export declare namespace SubscriptionUpdatePaymentMethodWebhookEvent {
1548
+ /**
1549
+ * Subscription payload sent on a webhook. It carries every field of
1550
+ * `SubscriptionResponse`, plus the grace-period deadline.
1551
+ */
1552
+ interface Data extends SubscriptionsAPI.Subscription {
1553
+ /**
1554
+ * Time when the grace period ends. The subscription moves to `on_hold` or to
1555
+ * `cancelled` at this time.
1556
+ *
1557
+ * Read in the same query as the rest of the payload, so it always comes from the
1558
+ * row snapshot that produced `status`. It is set whenever the subscription sits in
1559
+ * a window at that moment. A delayed event of another type therefore carries the
1560
+ * deadline too, next to a `past_due` status.
1561
+ */
1562
+ past_due_ends_at?: string | null;
1563
+ }
1564
+ }
1338
1565
  export interface SubscriptionUpdatedWebhookEvent {
1339
1566
  /**
1340
1567
  * The business identifier
1341
1568
  */
1342
1569
  business_id: string;
1343
1570
  /**
1344
- * Response struct representing subscription details
1571
+ * Subscription payload sent on a webhook. It carries every field of
1572
+ * `SubscriptionResponse`, plus the grace-period deadline.
1345
1573
  */
1346
- data: SubscriptionsAPI.Subscription;
1574
+ data: SubscriptionUpdatedWebhookEvent.Data;
1347
1575
  /**
1348
1576
  * The timestamp of when the event occurred
1349
1577
  */
@@ -1353,6 +1581,24 @@ export interface SubscriptionUpdatedWebhookEvent {
1353
1581
  */
1354
1582
  type: 'subscription.updated';
1355
1583
  }
1584
+ export declare namespace SubscriptionUpdatedWebhookEvent {
1585
+ /**
1586
+ * Subscription payload sent on a webhook. It carries every field of
1587
+ * `SubscriptionResponse`, plus the grace-period deadline.
1588
+ */
1589
+ interface Data extends SubscriptionsAPI.Subscription {
1590
+ /**
1591
+ * Time when the grace period ends. The subscription moves to `on_hold` or to
1592
+ * `cancelled` at this time.
1593
+ *
1594
+ * Read in the same query as the rest of the payload, so it always comes from the
1595
+ * row snapshot that produced `status`. It is set whenever the subscription sits in
1596
+ * a window at that moment. A delayed event of another type therefore carries the
1597
+ * deadline too, next to a `past_due` status.
1598
+ */
1599
+ past_due_ends_at?: string | null;
1600
+ }
1601
+ }
1356
1602
  export interface AbandonedCheckoutDetectedWebhookEvent {
1357
1603
  /**
1358
1604
  * The business identifier
@@ -1744,7 +1990,7 @@ export declare namespace DunningRecoveredWebhookEvent {
1744
1990
  customer_id: string;
1745
1991
  status: 'recovering' | 'recovered' | 'exhausted';
1746
1992
  subscription_id: string;
1747
- trigger_state: 'on_hold' | 'cancelled';
1993
+ trigger_state: 'on_hold' | 'cancelled' | 'past_due';
1748
1994
  payment_id?: string | null;
1749
1995
  }
1750
1996
  }
@@ -1779,7 +2025,7 @@ export declare namespace DunningStartedWebhookEvent {
1779
2025
  customer_id: string;
1780
2026
  status: 'recovering' | 'recovered' | 'exhausted';
1781
2027
  subscription_id: string;
1782
- trigger_state: 'on_hold' | 'cancelled';
2028
+ trigger_state: 'on_hold' | 'cancelled' | 'past_due';
1783
2029
  payment_id?: string | null;
1784
2030
  }
1785
2031
  }
@@ -2380,9 +2626,10 @@ export interface SubscriptionActiveWebhookEvent {
2380
2626
  */
2381
2627
  business_id: string;
2382
2628
  /**
2383
- * Response struct representing subscription details
2629
+ * Subscription payload sent on a webhook. It carries every field of
2630
+ * `SubscriptionResponse`, plus the grace-period deadline.
2384
2631
  */
2385
- data: SubscriptionsAPI.Subscription;
2632
+ data: SubscriptionActiveWebhookEvent.Data;
2386
2633
  /**
2387
2634
  * The timestamp of when the event occurred
2388
2635
  */
@@ -2392,15 +2639,34 @@ export interface SubscriptionActiveWebhookEvent {
2392
2639
  */
2393
2640
  type: 'subscription.active';
2394
2641
  }
2642
+ export declare namespace SubscriptionActiveWebhookEvent {
2643
+ /**
2644
+ * Subscription payload sent on a webhook. It carries every field of
2645
+ * `SubscriptionResponse`, plus the grace-period deadline.
2646
+ */
2647
+ interface Data extends SubscriptionsAPI.Subscription {
2648
+ /**
2649
+ * Time when the grace period ends. The subscription moves to `on_hold` or to
2650
+ * `cancelled` at this time.
2651
+ *
2652
+ * Read in the same query as the rest of the payload, so it always comes from the
2653
+ * row snapshot that produced `status`. It is set whenever the subscription sits in
2654
+ * a window at that moment. A delayed event of another type therefore carries the
2655
+ * deadline too, next to a `past_due` status.
2656
+ */
2657
+ past_due_ends_at?: string | null;
2658
+ }
2659
+ }
2395
2660
  export interface SubscriptionCancelledWebhookEvent {
2396
2661
  /**
2397
2662
  * The business identifier
2398
2663
  */
2399
2664
  business_id: string;
2400
2665
  /**
2401
- * Response struct representing subscription details
2666
+ * Subscription payload sent on a webhook. It carries every field of
2667
+ * `SubscriptionResponse`, plus the grace-period deadline.
2402
2668
  */
2403
- data: SubscriptionsAPI.Subscription;
2669
+ data: SubscriptionCancelledWebhookEvent.Data;
2404
2670
  /**
2405
2671
  * The timestamp of when the event occurred
2406
2672
  */
@@ -2410,15 +2676,34 @@ export interface SubscriptionCancelledWebhookEvent {
2410
2676
  */
2411
2677
  type: 'subscription.cancelled';
2412
2678
  }
2679
+ export declare namespace SubscriptionCancelledWebhookEvent {
2680
+ /**
2681
+ * Subscription payload sent on a webhook. It carries every field of
2682
+ * `SubscriptionResponse`, plus the grace-period deadline.
2683
+ */
2684
+ interface Data extends SubscriptionsAPI.Subscription {
2685
+ /**
2686
+ * Time when the grace period ends. The subscription moves to `on_hold` or to
2687
+ * `cancelled` at this time.
2688
+ *
2689
+ * Read in the same query as the rest of the payload, so it always comes from the
2690
+ * row snapshot that produced `status`. It is set whenever the subscription sits in
2691
+ * a window at that moment. A delayed event of another type therefore carries the
2692
+ * deadline too, next to a `past_due` status.
2693
+ */
2694
+ past_due_ends_at?: string | null;
2695
+ }
2696
+ }
2413
2697
  export interface SubscriptionExpiredWebhookEvent {
2414
2698
  /**
2415
2699
  * The business identifier
2416
2700
  */
2417
2701
  business_id: string;
2418
2702
  /**
2419
- * Response struct representing subscription details
2703
+ * Subscription payload sent on a webhook. It carries every field of
2704
+ * `SubscriptionResponse`, plus the grace-period deadline.
2420
2705
  */
2421
- data: SubscriptionsAPI.Subscription;
2706
+ data: SubscriptionExpiredWebhookEvent.Data;
2422
2707
  /**
2423
2708
  * The timestamp of when the event occurred
2424
2709
  */
@@ -2428,15 +2713,34 @@ export interface SubscriptionExpiredWebhookEvent {
2428
2713
  */
2429
2714
  type: 'subscription.expired';
2430
2715
  }
2716
+ export declare namespace SubscriptionExpiredWebhookEvent {
2717
+ /**
2718
+ * Subscription payload sent on a webhook. It carries every field of
2719
+ * `SubscriptionResponse`, plus the grace-period deadline.
2720
+ */
2721
+ interface Data extends SubscriptionsAPI.Subscription {
2722
+ /**
2723
+ * Time when the grace period ends. The subscription moves to `on_hold` or to
2724
+ * `cancelled` at this time.
2725
+ *
2726
+ * Read in the same query as the rest of the payload, so it always comes from the
2727
+ * row snapshot that produced `status`. It is set whenever the subscription sits in
2728
+ * a window at that moment. A delayed event of another type therefore carries the
2729
+ * deadline too, next to a `past_due` status.
2730
+ */
2731
+ past_due_ends_at?: string | null;
2732
+ }
2733
+ }
2431
2734
  export interface SubscriptionFailedWebhookEvent {
2432
2735
  /**
2433
2736
  * The business identifier
2434
2737
  */
2435
2738
  business_id: string;
2436
2739
  /**
2437
- * Response struct representing subscription details
2740
+ * Subscription payload sent on a webhook. It carries every field of
2741
+ * `SubscriptionResponse`, plus the grace-period deadline.
2438
2742
  */
2439
- data: SubscriptionsAPI.Subscription;
2743
+ data: SubscriptionFailedWebhookEvent.Data;
2440
2744
  /**
2441
2745
  * The timestamp of when the event occurred
2442
2746
  */
@@ -2446,15 +2750,34 @@ export interface SubscriptionFailedWebhookEvent {
2446
2750
  */
2447
2751
  type: 'subscription.failed';
2448
2752
  }
2753
+ export declare namespace SubscriptionFailedWebhookEvent {
2754
+ /**
2755
+ * Subscription payload sent on a webhook. It carries every field of
2756
+ * `SubscriptionResponse`, plus the grace-period deadline.
2757
+ */
2758
+ interface Data extends SubscriptionsAPI.Subscription {
2759
+ /**
2760
+ * Time when the grace period ends. The subscription moves to `on_hold` or to
2761
+ * `cancelled` at this time.
2762
+ *
2763
+ * Read in the same query as the rest of the payload, so it always comes from the
2764
+ * row snapshot that produced `status`. It is set whenever the subscription sits in
2765
+ * a window at that moment. A delayed event of another type therefore carries the
2766
+ * deadline too, next to a `past_due` status.
2767
+ */
2768
+ past_due_ends_at?: string | null;
2769
+ }
2770
+ }
2449
2771
  export interface SubscriptionOnHoldWebhookEvent {
2450
2772
  /**
2451
2773
  * The business identifier
2452
2774
  */
2453
2775
  business_id: string;
2454
2776
  /**
2455
- * Response struct representing subscription details
2777
+ * Subscription payload sent on a webhook. It carries every field of
2778
+ * `SubscriptionResponse`, plus the grace-period deadline.
2456
2779
  */
2457
- data: SubscriptionsAPI.Subscription;
2780
+ data: SubscriptionOnHoldWebhookEvent.Data;
2458
2781
  /**
2459
2782
  * The timestamp of when the event occurred
2460
2783
  */
@@ -2464,15 +2787,71 @@ export interface SubscriptionOnHoldWebhookEvent {
2464
2787
  */
2465
2788
  type: 'subscription.on_hold';
2466
2789
  }
2790
+ export declare namespace SubscriptionOnHoldWebhookEvent {
2791
+ /**
2792
+ * Subscription payload sent on a webhook. It carries every field of
2793
+ * `SubscriptionResponse`, plus the grace-period deadline.
2794
+ */
2795
+ interface Data extends SubscriptionsAPI.Subscription {
2796
+ /**
2797
+ * Time when the grace period ends. The subscription moves to `on_hold` or to
2798
+ * `cancelled` at this time.
2799
+ *
2800
+ * Read in the same query as the rest of the payload, so it always comes from the
2801
+ * row snapshot that produced `status`. It is set whenever the subscription sits in
2802
+ * a window at that moment. A delayed event of another type therefore carries the
2803
+ * deadline too, next to a `past_due` status.
2804
+ */
2805
+ past_due_ends_at?: string | null;
2806
+ }
2807
+ }
2808
+ export interface SubscriptionPastDueWebhookEvent {
2809
+ /**
2810
+ * The business identifier
2811
+ */
2812
+ business_id: string;
2813
+ /**
2814
+ * Subscription payload sent on a webhook. It carries every field of
2815
+ * `SubscriptionResponse`, plus the grace-period deadline.
2816
+ */
2817
+ data: SubscriptionPastDueWebhookEvent.Data;
2818
+ /**
2819
+ * The timestamp of when the event occurred
2820
+ */
2821
+ timestamp: string;
2822
+ /**
2823
+ * The event type
2824
+ */
2825
+ type: 'subscription.past_due';
2826
+ }
2827
+ export declare namespace SubscriptionPastDueWebhookEvent {
2828
+ /**
2829
+ * Subscription payload sent on a webhook. It carries every field of
2830
+ * `SubscriptionResponse`, plus the grace-period deadline.
2831
+ */
2832
+ interface Data extends SubscriptionsAPI.Subscription {
2833
+ /**
2834
+ * Time when the grace period ends. The subscription moves to `on_hold` or to
2835
+ * `cancelled` at this time.
2836
+ *
2837
+ * Read in the same query as the rest of the payload, so it always comes from the
2838
+ * row snapshot that produced `status`. It is set whenever the subscription sits in
2839
+ * a window at that moment. A delayed event of another type therefore carries the
2840
+ * deadline too, next to a `past_due` status.
2841
+ */
2842
+ past_due_ends_at?: string | null;
2843
+ }
2844
+ }
2467
2845
  export interface SubscriptionPausedWebhookEvent {
2468
2846
  /**
2469
2847
  * The business identifier
2470
2848
  */
2471
2849
  business_id: string;
2472
2850
  /**
2473
- * Response struct representing subscription details
2851
+ * Subscription payload sent on a webhook. It carries every field of
2852
+ * `SubscriptionResponse`, plus the grace-period deadline.
2474
2853
  */
2475
- data: SubscriptionsAPI.Subscription;
2854
+ data: SubscriptionPausedWebhookEvent.Data;
2476
2855
  /**
2477
2856
  * The timestamp of when the event occurred
2478
2857
  */
@@ -2482,15 +2861,34 @@ export interface SubscriptionPausedWebhookEvent {
2482
2861
  */
2483
2862
  type: 'subscription.paused';
2484
2863
  }
2864
+ export declare namespace SubscriptionPausedWebhookEvent {
2865
+ /**
2866
+ * Subscription payload sent on a webhook. It carries every field of
2867
+ * `SubscriptionResponse`, plus the grace-period deadline.
2868
+ */
2869
+ interface Data extends SubscriptionsAPI.Subscription {
2870
+ /**
2871
+ * Time when the grace period ends. The subscription moves to `on_hold` or to
2872
+ * `cancelled` at this time.
2873
+ *
2874
+ * Read in the same query as the rest of the payload, so it always comes from the
2875
+ * row snapshot that produced `status`. It is set whenever the subscription sits in
2876
+ * a window at that moment. A delayed event of another type therefore carries the
2877
+ * deadline too, next to a `past_due` status.
2878
+ */
2879
+ past_due_ends_at?: string | null;
2880
+ }
2881
+ }
2485
2882
  export interface SubscriptionPlanChangedWebhookEvent {
2486
2883
  /**
2487
2884
  * The business identifier
2488
2885
  */
2489
2886
  business_id: string;
2490
2887
  /**
2491
- * Response struct representing subscription details
2888
+ * Subscription payload sent on a webhook. It carries every field of
2889
+ * `SubscriptionResponse`, plus the grace-period deadline.
2492
2890
  */
2493
- data: SubscriptionsAPI.Subscription;
2891
+ data: SubscriptionPlanChangedWebhookEvent.Data;
2494
2892
  /**
2495
2893
  * The timestamp of when the event occurred
2496
2894
  */
@@ -2500,15 +2898,34 @@ export interface SubscriptionPlanChangedWebhookEvent {
2500
2898
  */
2501
2899
  type: 'subscription.plan_changed';
2502
2900
  }
2901
+ export declare namespace SubscriptionPlanChangedWebhookEvent {
2902
+ /**
2903
+ * Subscription payload sent on a webhook. It carries every field of
2904
+ * `SubscriptionResponse`, plus the grace-period deadline.
2905
+ */
2906
+ interface Data extends SubscriptionsAPI.Subscription {
2907
+ /**
2908
+ * Time when the grace period ends. The subscription moves to `on_hold` or to
2909
+ * `cancelled` at this time.
2910
+ *
2911
+ * Read in the same query as the rest of the payload, so it always comes from the
2912
+ * row snapshot that produced `status`. It is set whenever the subscription sits in
2913
+ * a window at that moment. A delayed event of another type therefore carries the
2914
+ * deadline too, next to a `past_due` status.
2915
+ */
2916
+ past_due_ends_at?: string | null;
2917
+ }
2918
+ }
2503
2919
  export interface SubscriptionRenewedWebhookEvent {
2504
2920
  /**
2505
2921
  * The business identifier
2506
2922
  */
2507
2923
  business_id: string;
2508
2924
  /**
2509
- * Response struct representing subscription details
2925
+ * Subscription payload sent on a webhook. It carries every field of
2926
+ * `SubscriptionResponse`, plus the grace-period deadline.
2510
2927
  */
2511
- data: SubscriptionsAPI.Subscription;
2928
+ data: SubscriptionRenewedWebhookEvent.Data;
2512
2929
  /**
2513
2930
  * The timestamp of when the event occurred
2514
2931
  */
@@ -2518,15 +2935,34 @@ export interface SubscriptionRenewedWebhookEvent {
2518
2935
  */
2519
2936
  type: 'subscription.renewed';
2520
2937
  }
2938
+ export declare namespace SubscriptionRenewedWebhookEvent {
2939
+ /**
2940
+ * Subscription payload sent on a webhook. It carries every field of
2941
+ * `SubscriptionResponse`, plus the grace-period deadline.
2942
+ */
2943
+ interface Data extends SubscriptionsAPI.Subscription {
2944
+ /**
2945
+ * Time when the grace period ends. The subscription moves to `on_hold` or to
2946
+ * `cancelled` at this time.
2947
+ *
2948
+ * Read in the same query as the rest of the payload, so it always comes from the
2949
+ * row snapshot that produced `status`. It is set whenever the subscription sits in
2950
+ * a window at that moment. A delayed event of another type therefore carries the
2951
+ * deadline too, next to a `past_due` status.
2952
+ */
2953
+ past_due_ends_at?: string | null;
2954
+ }
2955
+ }
2521
2956
  export interface SubscriptionUnpausedWebhookEvent {
2522
2957
  /**
2523
2958
  * The business identifier
2524
2959
  */
2525
2960
  business_id: string;
2526
2961
  /**
2527
- * Response struct representing subscription details
2962
+ * Subscription payload sent on a webhook. It carries every field of
2963
+ * `SubscriptionResponse`, plus the grace-period deadline.
2528
2964
  */
2529
- data: SubscriptionsAPI.Subscription;
2965
+ data: SubscriptionUnpausedWebhookEvent.Data;
2530
2966
  /**
2531
2967
  * The timestamp of when the event occurred
2532
2968
  */
@@ -2536,15 +2972,34 @@ export interface SubscriptionUnpausedWebhookEvent {
2536
2972
  */
2537
2973
  type: 'subscription.unpaused';
2538
2974
  }
2975
+ export declare namespace SubscriptionUnpausedWebhookEvent {
2976
+ /**
2977
+ * Subscription payload sent on a webhook. It carries every field of
2978
+ * `SubscriptionResponse`, plus the grace-period deadline.
2979
+ */
2980
+ interface Data extends SubscriptionsAPI.Subscription {
2981
+ /**
2982
+ * Time when the grace period ends. The subscription moves to `on_hold` or to
2983
+ * `cancelled` at this time.
2984
+ *
2985
+ * Read in the same query as the rest of the payload, so it always comes from the
2986
+ * row snapshot that produced `status`. It is set whenever the subscription sits in
2987
+ * a window at that moment. A delayed event of another type therefore carries the
2988
+ * deadline too, next to a `past_due` status.
2989
+ */
2990
+ past_due_ends_at?: string | null;
2991
+ }
2992
+ }
2539
2993
  export interface SubscriptionUpdatePaymentMethodWebhookEvent {
2540
2994
  /**
2541
2995
  * The business identifier
2542
2996
  */
2543
2997
  business_id: string;
2544
2998
  /**
2545
- * Response struct representing subscription details
2999
+ * Subscription payload sent on a webhook. It carries every field of
3000
+ * `SubscriptionResponse`, plus the grace-period deadline.
2546
3001
  */
2547
- data: SubscriptionsAPI.Subscription;
3002
+ data: SubscriptionUpdatePaymentMethodWebhookEvent.Data;
2548
3003
  /**
2549
3004
  * The timestamp of when the event occurred
2550
3005
  */
@@ -2554,15 +3009,34 @@ export interface SubscriptionUpdatePaymentMethodWebhookEvent {
2554
3009
  */
2555
3010
  type: 'subscription.update_payment_method';
2556
3011
  }
3012
+ export declare namespace SubscriptionUpdatePaymentMethodWebhookEvent {
3013
+ /**
3014
+ * Subscription payload sent on a webhook. It carries every field of
3015
+ * `SubscriptionResponse`, plus the grace-period deadline.
3016
+ */
3017
+ interface Data extends SubscriptionsAPI.Subscription {
3018
+ /**
3019
+ * Time when the grace period ends. The subscription moves to `on_hold` or to
3020
+ * `cancelled` at this time.
3021
+ *
3022
+ * Read in the same query as the rest of the payload, so it always comes from the
3023
+ * row snapshot that produced `status`. It is set whenever the subscription sits in
3024
+ * a window at that moment. A delayed event of another type therefore carries the
3025
+ * deadline too, next to a `past_due` status.
3026
+ */
3027
+ past_due_ends_at?: string | null;
3028
+ }
3029
+ }
2557
3030
  export interface SubscriptionUpdatedWebhookEvent {
2558
3031
  /**
2559
3032
  * The business identifier
2560
3033
  */
2561
3034
  business_id: string;
2562
3035
  /**
2563
- * Response struct representing subscription details
3036
+ * Subscription payload sent on a webhook. It carries every field of
3037
+ * `SubscriptionResponse`, plus the grace-period deadline.
2564
3038
  */
2565
- data: SubscriptionsAPI.Subscription;
3039
+ data: SubscriptionUpdatedWebhookEvent.Data;
2566
3040
  /**
2567
3041
  * The timestamp of when the event occurred
2568
3042
  */
@@ -2572,8 +3046,26 @@ export interface SubscriptionUpdatedWebhookEvent {
2572
3046
  */
2573
3047
  type: 'subscription.updated';
2574
3048
  }
2575
- export type UnsafeUnwrapWebhookEvent = AbandonedCheckoutDetectedWebhookEvent | AbandonedCheckoutRecoveredWebhookEvent | CreditAddedWebhookEvent | CreditBalanceLowWebhookEvent | CreditDeductedWebhookEvent | CreditExpiredWebhookEvent | CreditManualAdjustmentWebhookEvent | CreditOverageChargedWebhookEvent | CreditOverageResetWebhookEvent | CreditRolledOverWebhookEvent | CreditRolloverForfeitedWebhookEvent | DisputeAcceptedWebhookEvent | DisputeCancelledWebhookEvent | DisputeChallengedWebhookEvent | DisputeExpiredWebhookEvent | DisputeLostWebhookEvent | DisputeOpenedWebhookEvent | DisputeWonWebhookEvent | DunningRecoveredWebhookEvent | DunningStartedWebhookEvent | EntitlementGrantCreatedWebhookEvent | EntitlementGrantDeliveredWebhookEvent | EntitlementGrantFailedWebhookEvent | EntitlementGrantRevokedWebhookEvent | LicenseKeyCreatedWebhookEvent | PaymentCancelledWebhookEvent | PaymentFailedWebhookEvent | PaymentProcessingWebhookEvent | PaymentSucceededWebhookEvent | PayoutCreatedWebhookEvent | PayoutFailedWebhookEvent | PayoutInProgressWebhookEvent | PayoutOnHoldWebhookEvent | PayoutSuccessWebhookEvent | RefundFailedWebhookEvent | RefundSucceededWebhookEvent | SubscriptionActiveWebhookEvent | SubscriptionCancelledWebhookEvent | SubscriptionExpiredWebhookEvent | SubscriptionFailedWebhookEvent | SubscriptionOnHoldWebhookEvent | SubscriptionPausedWebhookEvent | SubscriptionPlanChangedWebhookEvent | SubscriptionRenewedWebhookEvent | SubscriptionUnpausedWebhookEvent | SubscriptionUpdatePaymentMethodWebhookEvent | SubscriptionUpdatedWebhookEvent;
2576
- export type UnwrapWebhookEvent = AbandonedCheckoutDetectedWebhookEvent | AbandonedCheckoutRecoveredWebhookEvent | CreditAddedWebhookEvent | CreditBalanceLowWebhookEvent | CreditDeductedWebhookEvent | CreditExpiredWebhookEvent | CreditManualAdjustmentWebhookEvent | CreditOverageChargedWebhookEvent | CreditOverageResetWebhookEvent | CreditRolledOverWebhookEvent | CreditRolloverForfeitedWebhookEvent | DisputeAcceptedWebhookEvent | DisputeCancelledWebhookEvent | DisputeChallengedWebhookEvent | DisputeExpiredWebhookEvent | DisputeLostWebhookEvent | DisputeOpenedWebhookEvent | DisputeWonWebhookEvent | DunningRecoveredWebhookEvent | DunningStartedWebhookEvent | EntitlementGrantCreatedWebhookEvent | EntitlementGrantDeliveredWebhookEvent | EntitlementGrantFailedWebhookEvent | EntitlementGrantRevokedWebhookEvent | LicenseKeyCreatedWebhookEvent | PaymentCancelledWebhookEvent | PaymentFailedWebhookEvent | PaymentProcessingWebhookEvent | PaymentSucceededWebhookEvent | PayoutCreatedWebhookEvent | PayoutFailedWebhookEvent | PayoutInProgressWebhookEvent | PayoutOnHoldWebhookEvent | PayoutSuccessWebhookEvent | RefundFailedWebhookEvent | RefundSucceededWebhookEvent | SubscriptionActiveWebhookEvent | SubscriptionCancelledWebhookEvent | SubscriptionExpiredWebhookEvent | SubscriptionFailedWebhookEvent | SubscriptionOnHoldWebhookEvent | SubscriptionPausedWebhookEvent | SubscriptionPlanChangedWebhookEvent | SubscriptionRenewedWebhookEvent | SubscriptionUnpausedWebhookEvent | SubscriptionUpdatePaymentMethodWebhookEvent | SubscriptionUpdatedWebhookEvent;
3049
+ export declare namespace SubscriptionUpdatedWebhookEvent {
3050
+ /**
3051
+ * Subscription payload sent on a webhook. It carries every field of
3052
+ * `SubscriptionResponse`, plus the grace-period deadline.
3053
+ */
3054
+ interface Data extends SubscriptionsAPI.Subscription {
3055
+ /**
3056
+ * Time when the grace period ends. The subscription moves to `on_hold` or to
3057
+ * `cancelled` at this time.
3058
+ *
3059
+ * Read in the same query as the rest of the payload, so it always comes from the
3060
+ * row snapshot that produced `status`. It is set whenever the subscription sits in
3061
+ * a window at that moment. A delayed event of another type therefore carries the
3062
+ * deadline too, next to a `past_due` status.
3063
+ */
3064
+ past_due_ends_at?: string | null;
3065
+ }
3066
+ }
3067
+ export type UnsafeUnwrapWebhookEvent = AbandonedCheckoutDetectedWebhookEvent | AbandonedCheckoutRecoveredWebhookEvent | CreditAddedWebhookEvent | CreditBalanceLowWebhookEvent | CreditDeductedWebhookEvent | CreditExpiredWebhookEvent | CreditManualAdjustmentWebhookEvent | CreditOverageChargedWebhookEvent | CreditOverageResetWebhookEvent | CreditRolledOverWebhookEvent | CreditRolloverForfeitedWebhookEvent | DisputeAcceptedWebhookEvent | DisputeCancelledWebhookEvent | DisputeChallengedWebhookEvent | DisputeExpiredWebhookEvent | DisputeLostWebhookEvent | DisputeOpenedWebhookEvent | DisputeWonWebhookEvent | DunningRecoveredWebhookEvent | DunningStartedWebhookEvent | EntitlementGrantCreatedWebhookEvent | EntitlementGrantDeliveredWebhookEvent | EntitlementGrantFailedWebhookEvent | EntitlementGrantRevokedWebhookEvent | LicenseKeyCreatedWebhookEvent | PaymentCancelledWebhookEvent | PaymentFailedWebhookEvent | PaymentProcessingWebhookEvent | PaymentSucceededWebhookEvent | PayoutCreatedWebhookEvent | PayoutFailedWebhookEvent | PayoutInProgressWebhookEvent | PayoutOnHoldWebhookEvent | PayoutSuccessWebhookEvent | RefundFailedWebhookEvent | RefundSucceededWebhookEvent | SubscriptionActiveWebhookEvent | SubscriptionCancelledWebhookEvent | SubscriptionExpiredWebhookEvent | SubscriptionFailedWebhookEvent | SubscriptionOnHoldWebhookEvent | SubscriptionPastDueWebhookEvent | SubscriptionPausedWebhookEvent | SubscriptionPlanChangedWebhookEvent | SubscriptionRenewedWebhookEvent | SubscriptionUnpausedWebhookEvent | SubscriptionUpdatePaymentMethodWebhookEvent | SubscriptionUpdatedWebhookEvent;
3068
+ export type UnwrapWebhookEvent = AbandonedCheckoutDetectedWebhookEvent | AbandonedCheckoutRecoveredWebhookEvent | CreditAddedWebhookEvent | CreditBalanceLowWebhookEvent | CreditDeductedWebhookEvent | CreditExpiredWebhookEvent | CreditManualAdjustmentWebhookEvent | CreditOverageChargedWebhookEvent | CreditOverageResetWebhookEvent | CreditRolledOverWebhookEvent | CreditRolloverForfeitedWebhookEvent | DisputeAcceptedWebhookEvent | DisputeCancelledWebhookEvent | DisputeChallengedWebhookEvent | DisputeExpiredWebhookEvent | DisputeLostWebhookEvent | DisputeOpenedWebhookEvent | DisputeWonWebhookEvent | DunningRecoveredWebhookEvent | DunningStartedWebhookEvent | EntitlementGrantCreatedWebhookEvent | EntitlementGrantDeliveredWebhookEvent | EntitlementGrantFailedWebhookEvent | EntitlementGrantRevokedWebhookEvent | LicenseKeyCreatedWebhookEvent | PaymentCancelledWebhookEvent | PaymentFailedWebhookEvent | PaymentProcessingWebhookEvent | PaymentSucceededWebhookEvent | PayoutCreatedWebhookEvent | PayoutFailedWebhookEvent | PayoutInProgressWebhookEvent | PayoutOnHoldWebhookEvent | PayoutSuccessWebhookEvent | RefundFailedWebhookEvent | RefundSucceededWebhookEvent | SubscriptionActiveWebhookEvent | SubscriptionCancelledWebhookEvent | SubscriptionExpiredWebhookEvent | SubscriptionFailedWebhookEvent | SubscriptionOnHoldWebhookEvent | SubscriptionPastDueWebhookEvent | SubscriptionPausedWebhookEvent | SubscriptionPlanChangedWebhookEvent | SubscriptionRenewedWebhookEvent | SubscriptionUnpausedWebhookEvent | SubscriptionUpdatePaymentMethodWebhookEvent | SubscriptionUpdatedWebhookEvent;
2577
3069
  export interface WebhookListParams extends CursorPagePaginationParams {
2578
3070
  }
2579
3071
  export interface WebhookCreateParams {
@@ -2643,7 +3135,7 @@ export interface WebhookUpdateParams {
2643
3135
  url?: string | null;
2644
3136
  }
2645
3137
  export declare namespace Webhooks {
2646
- export { type WebhookDetails as WebhookDetails, type WebhookRetrieveSecretResponse as WebhookRetrieveSecretResponse, type AbandonedCheckoutDetectedWebhookEvent as AbandonedCheckoutDetectedWebhookEvent, type AbandonedCheckoutRecoveredWebhookEvent as AbandonedCheckoutRecoveredWebhookEvent, type CreditAddedWebhookEvent as CreditAddedWebhookEvent, type CreditBalanceLowWebhookEvent as CreditBalanceLowWebhookEvent, type CreditDeductedWebhookEvent as CreditDeductedWebhookEvent, type CreditExpiredWebhookEvent as CreditExpiredWebhookEvent, type CreditManualAdjustmentWebhookEvent as CreditManualAdjustmentWebhookEvent, type CreditOverageChargedWebhookEvent as CreditOverageChargedWebhookEvent, type CreditOverageResetWebhookEvent as CreditOverageResetWebhookEvent, type CreditRolledOverWebhookEvent as CreditRolledOverWebhookEvent, type CreditRolloverForfeitedWebhookEvent as CreditRolloverForfeitedWebhookEvent, type DisputeAcceptedWebhookEvent as DisputeAcceptedWebhookEvent, type DisputeCancelledWebhookEvent as DisputeCancelledWebhookEvent, type DisputeChallengedWebhookEvent as DisputeChallengedWebhookEvent, type DisputeExpiredWebhookEvent as DisputeExpiredWebhookEvent, type DisputeLostWebhookEvent as DisputeLostWebhookEvent, type DisputeOpenedWebhookEvent as DisputeOpenedWebhookEvent, type DisputeWonWebhookEvent as DisputeWonWebhookEvent, type DunningRecoveredWebhookEvent as DunningRecoveredWebhookEvent, type DunningStartedWebhookEvent as DunningStartedWebhookEvent, type EntitlementGrantCreatedWebhookEvent as EntitlementGrantCreatedWebhookEvent, type EntitlementGrantDeliveredWebhookEvent as EntitlementGrantDeliveredWebhookEvent, type EntitlementGrantFailedWebhookEvent as EntitlementGrantFailedWebhookEvent, type EntitlementGrantRevokedWebhookEvent as EntitlementGrantRevokedWebhookEvent, type LicenseKeyCreatedWebhookEvent as LicenseKeyCreatedWebhookEvent, type PaymentCancelledWebhookEvent as PaymentCancelledWebhookEvent, type PaymentFailedWebhookEvent as PaymentFailedWebhookEvent, type PaymentProcessingWebhookEvent as PaymentProcessingWebhookEvent, type PaymentSucceededWebhookEvent as PaymentSucceededWebhookEvent, type PayoutCreatedWebhookEvent as PayoutCreatedWebhookEvent, type PayoutFailedWebhookEvent as PayoutFailedWebhookEvent, type PayoutInProgressWebhookEvent as PayoutInProgressWebhookEvent, type PayoutOnHoldWebhookEvent as PayoutOnHoldWebhookEvent, type PayoutSuccessWebhookEvent as PayoutSuccessWebhookEvent, type RefundFailedWebhookEvent as RefundFailedWebhookEvent, type RefundSucceededWebhookEvent as RefundSucceededWebhookEvent, type SubscriptionActiveWebhookEvent as SubscriptionActiveWebhookEvent, type SubscriptionCancelledWebhookEvent as SubscriptionCancelledWebhookEvent, type SubscriptionExpiredWebhookEvent as SubscriptionExpiredWebhookEvent, type SubscriptionFailedWebhookEvent as SubscriptionFailedWebhookEvent, type SubscriptionOnHoldWebhookEvent as SubscriptionOnHoldWebhookEvent, type SubscriptionPausedWebhookEvent as SubscriptionPausedWebhookEvent, type SubscriptionPlanChangedWebhookEvent as SubscriptionPlanChangedWebhookEvent, type SubscriptionRenewedWebhookEvent as SubscriptionRenewedWebhookEvent, type SubscriptionUnpausedWebhookEvent as SubscriptionUnpausedWebhookEvent, type SubscriptionUpdatePaymentMethodWebhookEvent as SubscriptionUpdatePaymentMethodWebhookEvent, type SubscriptionUpdatedWebhookEvent as SubscriptionUpdatedWebhookEvent, type UnsafeUnwrapWebhookEvent as UnsafeUnwrapWebhookEvent, type UnwrapWebhookEvent as UnwrapWebhookEvent, type WebhookDetailsCursorPagePagination as WebhookDetailsCursorPagePagination, type WebhookListParams as WebhookListParams, type WebhookCreateParams as WebhookCreateParams, type WebhookUpdateParams as WebhookUpdateParams, };
3138
+ export { type WebhookDetails as WebhookDetails, type WebhookRetrieveSecretResponse as WebhookRetrieveSecretResponse, type AbandonedCheckoutDetectedWebhookEvent as AbandonedCheckoutDetectedWebhookEvent, type AbandonedCheckoutRecoveredWebhookEvent as AbandonedCheckoutRecoveredWebhookEvent, type CreditAddedWebhookEvent as CreditAddedWebhookEvent, type CreditBalanceLowWebhookEvent as CreditBalanceLowWebhookEvent, type CreditDeductedWebhookEvent as CreditDeductedWebhookEvent, type CreditExpiredWebhookEvent as CreditExpiredWebhookEvent, type CreditManualAdjustmentWebhookEvent as CreditManualAdjustmentWebhookEvent, type CreditOverageChargedWebhookEvent as CreditOverageChargedWebhookEvent, type CreditOverageResetWebhookEvent as CreditOverageResetWebhookEvent, type CreditRolledOverWebhookEvent as CreditRolledOverWebhookEvent, type CreditRolloverForfeitedWebhookEvent as CreditRolloverForfeitedWebhookEvent, type DisputeAcceptedWebhookEvent as DisputeAcceptedWebhookEvent, type DisputeCancelledWebhookEvent as DisputeCancelledWebhookEvent, type DisputeChallengedWebhookEvent as DisputeChallengedWebhookEvent, type DisputeExpiredWebhookEvent as DisputeExpiredWebhookEvent, type DisputeLostWebhookEvent as DisputeLostWebhookEvent, type DisputeOpenedWebhookEvent as DisputeOpenedWebhookEvent, type DisputeWonWebhookEvent as DisputeWonWebhookEvent, type DunningRecoveredWebhookEvent as DunningRecoveredWebhookEvent, type DunningStartedWebhookEvent as DunningStartedWebhookEvent, type EntitlementGrantCreatedWebhookEvent as EntitlementGrantCreatedWebhookEvent, type EntitlementGrantDeliveredWebhookEvent as EntitlementGrantDeliveredWebhookEvent, type EntitlementGrantFailedWebhookEvent as EntitlementGrantFailedWebhookEvent, type EntitlementGrantRevokedWebhookEvent as EntitlementGrantRevokedWebhookEvent, type LicenseKeyCreatedWebhookEvent as LicenseKeyCreatedWebhookEvent, type PaymentCancelledWebhookEvent as PaymentCancelledWebhookEvent, type PaymentFailedWebhookEvent as PaymentFailedWebhookEvent, type PaymentProcessingWebhookEvent as PaymentProcessingWebhookEvent, type PaymentSucceededWebhookEvent as PaymentSucceededWebhookEvent, type PayoutCreatedWebhookEvent as PayoutCreatedWebhookEvent, type PayoutFailedWebhookEvent as PayoutFailedWebhookEvent, type PayoutInProgressWebhookEvent as PayoutInProgressWebhookEvent, type PayoutOnHoldWebhookEvent as PayoutOnHoldWebhookEvent, type PayoutSuccessWebhookEvent as PayoutSuccessWebhookEvent, type RefundFailedWebhookEvent as RefundFailedWebhookEvent, type RefundSucceededWebhookEvent as RefundSucceededWebhookEvent, type SubscriptionActiveWebhookEvent as SubscriptionActiveWebhookEvent, type SubscriptionCancelledWebhookEvent as SubscriptionCancelledWebhookEvent, type SubscriptionExpiredWebhookEvent as SubscriptionExpiredWebhookEvent, type SubscriptionFailedWebhookEvent as SubscriptionFailedWebhookEvent, type SubscriptionOnHoldWebhookEvent as SubscriptionOnHoldWebhookEvent, type SubscriptionPastDueWebhookEvent as SubscriptionPastDueWebhookEvent, type SubscriptionPausedWebhookEvent as SubscriptionPausedWebhookEvent, type SubscriptionPlanChangedWebhookEvent as SubscriptionPlanChangedWebhookEvent, type SubscriptionRenewedWebhookEvent as SubscriptionRenewedWebhookEvent, type SubscriptionUnpausedWebhookEvent as SubscriptionUnpausedWebhookEvent, type SubscriptionUpdatePaymentMethodWebhookEvent as SubscriptionUpdatePaymentMethodWebhookEvent, type SubscriptionUpdatedWebhookEvent as SubscriptionUpdatedWebhookEvent, type UnsafeUnwrapWebhookEvent as UnsafeUnwrapWebhookEvent, type UnwrapWebhookEvent as UnwrapWebhookEvent, type WebhookDetailsCursorPagePagination as WebhookDetailsCursorPagePagination, type WebhookListParams as WebhookListParams, type WebhookCreateParams as WebhookCreateParams, type WebhookUpdateParams as WebhookUpdateParams, };
2647
3139
  export { Headers as Headers, type HeaderRetrieveResponse as HeaderRetrieveResponse, type HeaderUpdateParams as HeaderUpdateParams, };
2648
3140
  }
2649
3141
  //# sourceMappingURL=webhooks.d.ts.map