@commet/node 9.8.0 → 9.10.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 (75) hide show
  1. package/dist/index.d.mts +1021 -30
  2. package/dist/index.d.ts +1021 -30
  3. package/dist/index.js +204 -11
  4. package/dist/index.js.map +1 -1
  5. package/dist/index.mjs +204 -11
  6. package/dist/index.mjs.map +1 -1
  7. package/docs/ai-onboarding/mcp-server.md +2 -0
  8. package/docs/api-reference/addons.md +3 -1
  9. package/docs/api-reference/credit-packs.md +3 -1
  10. package/docs/api-reference/customers.md +2 -0
  11. package/docs/api-reference/generated-webhooks.md +2 -2
  12. package/docs/api-reference/index.md +3 -3
  13. package/docs/api-reference/plans.md +488 -6
  14. package/docs/api-reference/subscriptions.md +50 -8
  15. package/docs/documentation/api-versioning.md +8 -2
  16. package/docs/documentation/cli.md +64 -49
  17. package/docs/documentation/create-api-key.md +3 -1
  18. package/docs/documentation/customers/customer-portal.md +10 -2
  19. package/docs/documentation/customers/manage-customers.md +2 -1
  20. package/docs/documentation/finance/payouts.md +11 -0
  21. package/docs/documentation/finance/supported-countries.md +5 -5
  22. package/docs/documentation/invoicing/handle-failed-payments.md +9 -9
  23. package/docs/documentation/payments/accept-one-time-payments.md +1 -1
  24. package/docs/documentation/payments/payment-orchestration.md +2 -0
  25. package/docs/documentation/payments/payment-providers.md +46 -0
  26. package/docs/documentation/payments/transactions-refunds-and-retries.md +1 -1
  27. package/docs/documentation/plans/add-ons.md +15 -4
  28. package/docs/documentation/plans/consumption-models.md +44 -9
  29. package/docs/documentation/plans/create-plans.md +5 -1
  30. package/docs/documentation/plans/credit-packs.md +61 -3
  31. package/docs/documentation/plans/one-time-payments.md +3 -3
  32. package/docs/documentation/plans/plan-groups.md +46 -10
  33. package/docs/documentation/plans/plan-versions.md +265 -0
  34. package/docs/documentation/platform/dashboard-metrics-and-events.md +40 -9
  35. package/docs/documentation/sales/connect-dub-affiliates.md +52 -0
  36. package/docs/documentation/sales/introductory-offers.md +7 -13
  37. package/docs/documentation/sales/offers.md +10 -6
  38. package/docs/documentation/sales/promo-codes.md +47 -17
  39. package/docs/documentation/sales/promotional-offers.md +6 -7
  40. package/docs/documentation/sales/regional-prices.md +38 -8
  41. package/docs/documentation/sales/trial-periods.md +67 -40
  42. package/docs/documentation/subscriptions/manage-subscriptions.md +114 -14
  43. package/docs/documentation/subscriptions/pay-in-advance.md +4 -7
  44. package/docs/documentation/subscriptions/upgrade-and-downgrade-plans.md +22 -2
  45. package/docs/documentation/testing-sandbox.md +2 -0
  46. package/docs/documentation/usage/track-usage.md +23 -0
  47. package/docs/errors/addon_has_activations.md +2 -2
  48. package/docs/errors/addon_unavailable.md +22 -0
  49. package/docs/errors/credit_pack_unavailable.md +22 -0
  50. package/docs/errors/index.md +9 -2
  51. package/docs/errors/missing_regional_price.md +3 -3
  52. package/docs/errors/plan_balance_limit_reached.md +22 -0
  53. package/docs/errors/plan_experiment_not_found.md +22 -0
  54. package/docs/errors/plan_version_not_found.md +22 -0
  55. package/docs/errors/subscribers_do_not_fit.md +22 -0
  56. package/docs/errors/version_not_newer.md +22 -0
  57. package/docs/knowledge-base/how-do-credits-credit-packs-and-customer-credits-differ.md +8 -8
  58. package/docs/knowledge-base/how-do-discounts-work.md +7 -5
  59. package/docs/knowledge-base/how-do-free-plans-work-without-payment.md +18 -11
  60. package/docs/knowledge-base/how-do-offers-promo-codes-and-card-promotions-work-together.md +1 -1
  61. package/docs/knowledge-base/how-do-trial-periods-work.md +31 -25
  62. package/docs/knowledge-base/how-does-billing-work.md +26 -27
  63. package/docs/knowledge-base/how-does-quota-based-billing-work.md +12 -22
  64. package/docs/knowledge-base/how-does-seat-based-billing-work.md +12 -22
  65. package/docs/knowledge-base/what-happens-when-a-customer-changes-plans.md +11 -8
  66. package/docs/knowledge-base/what-happens-when-a-payment-fails.md +11 -9
  67. package/docs/knowledge-base/what-happens-when-you-change-your-prices.md +34 -29
  68. package/docs/knowledge-base/what-invoices-do-customers-receive-and-when.md +1 -1
  69. package/docs/manifest.json +201 -2
  70. package/docs/platform-documentation.md +2 -0
  71. package/docs/schemas.md +134 -14
  72. package/docs/webhooks/introduction.md +17 -13
  73. package/docs/webhooks.md +66 -6
  74. package/docs/webhooks.openapi.json +1218 -876
  75. package/package.json +1 -1
@@ -9,7 +9,7 @@
9
9
  "subscription.created": {
10
10
  "post": {
11
11
  "summary": "subscription.created",
12
- "description": "Fired when a subscription record is created with status pending_payment. The first charge has not been confirmed yet — do NOT grant access here. Wait for subscription.activated.",
12
+ "description": "Fired when a subscription record is created, usually with status pending_payment: the first charge has not been confirmed yet — do NOT grant access here; wait for subscription.activated. A trial whose price requires no payment method is created already trialing, together with trial.started.",
13
13
  "tags": [
14
14
  "Webhooks"
15
15
  ],
@@ -71,15 +71,11 @@
71
71
  "description": "ISO 8601 datetime when the subscription starts."
72
72
  },
73
73
  "name": {
74
- "anyOf": [
75
- {
76
- "type": "string"
77
- },
78
- {
79
- "type": "null"
80
- }
81
- ],
82
- "description": "Optional custom name for the subscription."
74
+ "description": "Optional custom name for the subscription.",
75
+ "type": [
76
+ "string",
77
+ "null"
78
+ ]
83
79
  }
84
80
  },
85
81
  "required": [
@@ -201,15 +197,11 @@
201
197
  "type": "string"
202
198
  },
203
199
  "name": {
204
- "anyOf": [
205
- {
206
- "type": "string"
207
- },
208
- {
209
- "type": "null"
210
- }
211
- ],
212
- "description": "Optional custom name for the subscription."
200
+ "description": "Optional custom name for the subscription.",
201
+ "type": [
202
+ "string",
203
+ "null"
204
+ ]
213
205
  },
214
206
  "invoiceId": {
215
207
  "type": "string",
@@ -370,15 +362,11 @@
370
362
  "type": "string"
371
363
  },
372
364
  "name": {
373
- "anyOf": [
374
- {
375
- "type": "string"
376
- },
377
- {
378
- "type": "null"
379
- }
380
- ],
381
- "description": "Optional custom name for the subscription."
365
+ "description": "Optional custom name for the subscription.",
366
+ "type": [
367
+ "string",
368
+ "null"
369
+ ]
382
370
  },
383
371
  "invoiceId": {
384
372
  "type": "string",
@@ -466,7 +454,7 @@
466
454
  "description": "Fired when a canceled subscription is reactivated and its reactivation charge succeeds.",
467
455
  "playground": "none"
468
456
  },
469
- "content": "## When this fires\n\nA canceled subscription was reactivated through `reactivate` and the reactivation charge succeeded. Commet generates a fresh invoice, charges the saved payment method, and sets the status back to `active` with a billing period anchored to the reactivation date.\n\nThe subscription returns to `active` at the same time, so `customer.state_changed` also fires. Restore access on either event.\n\nThis is distinct from two similar events. `subscription.activated` fires on a subscription's first activation. `payment.recovered` fires when a `past_due` subscription is recovered — that path keeps the original invoice and billing anchor, while reactivation issues a new invoice and resets the anchor to now.\n\nReactivation requires the plan to still be available in the subscription's currency. If the reactivation charge declines, no event fires and the API returns a `recoveryUrl` the customer can use to add a new card and pay."
457
+ "content": "## When this fires\n\nA canceled subscription was reactivated through `reactivate` and the reactivation charge succeeded. Commet generates a fresh invoice, charges the saved payment method, and sets the status back to `active` with a billing period anchored to the reactivation date.\n\nThe subscription returns to `active` at the same time, so `customer.state_changed` also fires. Restore access on either event.\n\nThis is distinct from two similar events. `subscription.activated` fires on a subscription's first activation. `payment.recovered` fires when a `past_due` subscription is recovered — that path keeps the original invoice and billing anchor, while reactivation issues a new invoice and resets the anchor to now.\n\nThe subscription returns on the latest [version](/plan-versions#reactivate-a-canceled-subscription) of what was bought, which must sell the subscription's currency. If the reactivation charge declines, no event fires and the API returns a `recoveryUrl` the customer can use to add a new card and pay."
470
458
  }
471
459
  }
472
460
  },
@@ -1046,15 +1034,11 @@
1046
1034
  "description": "When access was restored."
1047
1035
  },
1048
1036
  "invoiceId": {
1049
- "anyOf": [
1050
- {
1051
- "type": "string"
1052
- },
1053
- {
1054
- "type": "null"
1055
- }
1056
- ],
1057
- "description": "The resume invoice ID, or null when no charge was required."
1037
+ "description": "The resume invoice ID, or null when no charge was required.",
1038
+ "type": [
1039
+ "string",
1040
+ "null"
1041
+ ]
1058
1042
  }
1059
1043
  },
1060
1044
  "required": [
@@ -1287,15 +1271,11 @@
1287
1271
  "type": "string"
1288
1272
  },
1289
1273
  "cancelReason": {
1290
- "anyOf": [
1291
- {
1292
- "type": "string"
1293
- },
1294
- {
1295
- "type": "null"
1296
- }
1297
- ],
1298
- "description": "The reason for cancellation, if provided. Set to \"dunning_exhausted\" when all payment retries fail. Historical refund-triggered cancellations may have \"refund\"."
1274
+ "description": "The reason for cancellation, if provided. Set to \"dunning_exhausted\" when all payment retries fail, and to \"trial_ended_without_payment_method\" when a trial without a payment method ends with no card and no default plan. Historical refund-triggered cancellations may have \"refund\".",
1275
+ "type": [
1276
+ "string",
1277
+ "null"
1278
+ ]
1299
1279
  },
1300
1280
  "endDate": {
1301
1281
  "description": "ISO 8601 datetime when the subscription ended. Matches the billing period end for scheduled cancellations; for immediate terminations it is the moment of termination.",
@@ -1352,7 +1332,7 @@
1352
1332
  "description": "Fired when a subscription is terminated, at period end or immediately. Revoke access here.",
1353
1333
  "playground": "none"
1354
1334
  },
1355
- "content": "## Cancellation lifecycle\n\nA regular cancellation is scheduled for the end of the current billing period. Two events fire at different moments:\n\n| Moment | Event | status | What to do |\n| --- | --- | --- | --- |\n| Customer requests cancellation | `subscription.updated` | `active` | Show \"ending on \\{endDate\\}\" in your UI. Do NOT revoke access. |\n| Billing period ends | `subscription.canceled` | `canceled` | Revoke access. |\n\n```\nPOST /subscriptions/{id}/cancel\n └→ subscription.updated (status: \"active\", canceledAt: set, endDate: set)\n ... time passes until billing period ends ...\n └→ subscription.canceled (status: \"canceled\")\n```\n\n## Immediate terminations\n\nSome terminations skip the schedule: `subscription.canceled` arrives right away, with no prior `subscription.updated`, and `endDate` is the moment of termination — not a billing period boundary.\n\n- `POST /subscriptions/{id}/cancel` with `immediate: true`. Cancellations of free plans and of subscriptions in `pending_payment` or `past_due` also settle immediately — canceling inside the dunning grace window voids the unpaid renewal.\n- Exhausted dunning retries: fires with `cancelReason: \"dunning_exhausted\"`, alongside `payment.retry_failed`.\n\nRefunding a payment does not cancel its subscription. If you want both outcomes, request a [cancellation](/manage-subscriptions) separately. Older cancellation events triggered by refunds may have `cancelReason: \"refund\"`."
1335
+ "content": "## Cancellation lifecycle\n\nA regular cancellation is scheduled for the end of the current billing period. Two events fire at different moments:\n\n| Moment | Event | status | What to do |\n| --- | --- | --- | --- |\n| Customer requests cancellation | `subscription.updated` | `active` | Show \"ending on \\{endDate\\}\" in your UI. Do NOT revoke access. |\n| Billing period ends | `subscription.canceled` | `canceled` | Revoke access. |\n\n```\nPOST /subscriptions/{id}/cancel\n └→ subscription.updated (status: \"active\", canceledAt: set, endDate: set)\n ... time passes until billing period ends ...\n └→ subscription.canceled (status: \"canceled\")\n```\n\n## Immediate terminations\n\nSome terminations skip the schedule: `subscription.canceled` arrives right away, with no prior `subscription.updated`, and `endDate` is the moment of termination — not a billing period boundary.\n\n- `POST /subscriptions/{id}/cancel` with `immediate: true`. Cancellations of free plans and of subscriptions in `pending_payment` or `past_due` also settle immediately — canceling inside the dunning grace window voids the unpaid renewal.\n- Exhausted dunning retries: fires with `cancelReason: \"dunning_exhausted\"`, alongside `payment.retry_failed`.\n- A trial without a payment method that ends without a card: fires with `cancelReason: \"trial_ended_without_payment_method\"`.\n\nWhen the plan group has a default plan, exhausted dunning retries and a trial that ends without a card move the subscription to that plan instead, and `subscription.plan_changed` fires.\n\nRefunding a payment does not cancel its subscription. If you want both outcomes, request a [cancellation](/manage-subscriptions) separately. Older cancellation events triggered by refunds may have `cancelReason: \"refund\"`."
1356
1336
  }
1357
1337
  }
1358
1338
  },
@@ -1413,15 +1393,11 @@
1413
1393
  "type": "string"
1414
1394
  },
1415
1395
  "cancelReason": {
1416
- "anyOf": [
1417
- {
1418
- "type": "string"
1419
- },
1420
- {
1421
- "type": "null"
1422
- }
1423
- ],
1424
- "description": "The reason for cancellation, if provided."
1396
+ "description": "The reason for cancellation, if provided.",
1397
+ "type": [
1398
+ "string",
1399
+ "null"
1400
+ ]
1425
1401
  },
1426
1402
  "endDate": {
1427
1403
  "description": "ISO 8601 datetime when the subscription will end. Present when cancellation is scheduled — this is the date access should be revoked (via subscription.canceled).",
@@ -1539,15 +1515,11 @@
1539
1515
  "$ref": "#/components/schemas/WebhookPlanRef"
1540
1516
  },
1541
1517
  "billingInterval": {
1542
- "anyOf": [
1543
- {
1544
- "type": "string"
1545
- },
1546
- {
1547
- "type": "null"
1548
- }
1549
- ],
1550
- "description": "The billing interval (monthly, yearly)."
1518
+ "description": "The billing interval (monthly, yearly).",
1519
+ "type": [
1520
+ "string",
1521
+ "null"
1522
+ ]
1551
1523
  },
1552
1524
  "credit": {
1553
1525
  "type": "number",
@@ -1685,15 +1657,11 @@
1685
1657
  "type": "string"
1686
1658
  },
1687
1659
  "cancelReason": {
1688
- "anyOf": [
1689
- {
1690
- "type": "string"
1691
- },
1692
- {
1693
- "type": "null"
1694
- }
1695
- ],
1696
- "description": "The reason for cancellation, if provided."
1660
+ "description": "The reason for cancellation, if provided.",
1661
+ "type": [
1662
+ "string",
1663
+ "null"
1664
+ ]
1697
1665
  },
1698
1666
  "effectiveAt": {
1699
1667
  "type": "string",
@@ -1924,26 +1892,18 @@
1924
1892
  "$ref": "#/components/schemas/WebhookPlanRef"
1925
1893
  },
1926
1894
  "billingInterval": {
1927
- "anyOf": [
1928
- {
1929
- "type": "string"
1930
- },
1931
- {
1932
- "type": "null"
1933
- }
1934
- ],
1935
- "description": "The current billing interval."
1895
+ "description": "The current billing interval.",
1896
+ "type": [
1897
+ "string",
1898
+ "null"
1899
+ ]
1936
1900
  },
1937
1901
  "scheduledBillingInterval": {
1938
- "anyOf": [
1939
- {
1940
- "type": "string"
1941
- },
1942
- {
1943
- "type": "null"
1944
- }
1945
- ],
1946
- "description": "The new billing interval, if the change includes one. Null when only the plan changes."
1902
+ "description": "The new billing interval, if the change includes one. Null when only the plan changes.",
1903
+ "type": [
1904
+ "string",
1905
+ "null"
1906
+ ]
1947
1907
  },
1948
1908
  "effectiveAt": {
1949
1909
  "type": "string",
@@ -2019,7 +1979,7 @@
2019
1979
  "subscription.plan_change_revoked": {
2020
1980
  "post": {
2021
1981
  "summary": "subscription.plan_change_revoked",
2022
- "description": "Fired when a scheduled plan change is replaced by a different one before it executes. The replacement also fires subscription.plan_change_scheduled with the new target plan.",
1982
+ "description": "Fired when a scheduled plan change will no longer take effect: it was revoked through the API, the dashboard or the customer portal, an immediate plan change or an immediate cancellation voided it, or a different change replaced it. A replacement also fires subscription.plan_change_scheduled with the new target plan.",
2023
1983
  "tags": [
2024
1984
  "Webhooks"
2025
1985
  ],
@@ -2077,26 +2037,18 @@
2077
2037
  "$ref": "#/components/schemas/WebhookPlanRef"
2078
2038
  },
2079
2039
  "billingInterval": {
2080
- "anyOf": [
2081
- {
2082
- "type": "string"
2083
- },
2084
- {
2085
- "type": "null"
2086
- }
2087
- ],
2088
- "description": "The current billing interval."
2040
+ "description": "The current billing interval.",
2041
+ "type": [
2042
+ "string",
2043
+ "null"
2044
+ ]
2089
2045
  },
2090
2046
  "revokedBillingInterval": {
2091
- "anyOf": [
2092
- {
2093
- "type": "string"
2094
- },
2095
- {
2096
- "type": "null"
2097
- }
2098
- ],
2099
- "description": "The previously scheduled billing interval, if the revoked change included one."
2047
+ "description": "The previously scheduled billing interval, if the revoked change included one.",
2048
+ "type": [
2049
+ "string",
2050
+ "null"
2051
+ ]
2100
2052
  }
2101
2053
  },
2102
2054
  "required": [
@@ -2163,10 +2115,10 @@
2163
2115
  }
2164
2116
  }
2165
2117
  },
2166
- "subscription.past_due": {
2118
+ "subscription.version_changed": {
2167
2119
  "post": {
2168
- "summary": "subscription.past_due",
2169
- "description": "Fired when a recurring payment fails on a previously paid subscription and its status becomes past_due. past_due is a grace window, not a cutoff: usage and seats keep working while new purchases are blocked, and dunning retries the charge — use this to notify the customer and recover the payment.",
2120
+ "summary": "subscription.version_changed",
2121
+ "description": "Fired when a subscription moves to another version of its plan: a move applied now or a scheduled move that took effect at renewal. Making an experiment current moves nobody, so it sends none. The plan stays the same; the version's prices and features apply from now on.",
2170
2122
  "tags": [
2171
2123
  "Webhooks"
2172
2124
  ],
@@ -2182,7 +2134,7 @@
2182
2134
  },
2183
2135
  "event": {
2184
2136
  "type": "string",
2185
- "const": "subscription.past_due"
2137
+ "const": "subscription.version_changed"
2186
2138
  },
2187
2139
  "timestamp": {
2188
2140
  "type": "string"
@@ -2211,25 +2163,30 @@
2211
2163
  "type": "string",
2212
2164
  "description": "The customer ID. Returns your externalId if you provided one when creating the customer, otherwise returns the Commet publicId."
2213
2165
  },
2214
- "status": {
2166
+ "fromVersionId": {
2215
2167
  "type": "string",
2216
- "description": "Always \"past_due\" for this event."
2168
+ "description": "The version the subscription left."
2217
2169
  },
2218
- "invoiceId": {
2170
+ "toVersionId": {
2219
2171
  "type": "string",
2220
- "description": "The invoice whose payment failure triggered the status."
2172
+ "description": "The version the subscription is on now."
2221
2173
  },
2222
- "invoiceNumber": {
2174
+ "currency": {
2223
2175
  "type": "string",
2224
- "description": "The human-readable invoice number."
2176
+ "description": "The currency the subscription pays in."
2177
+ },
2178
+ "billingInterval": {
2179
+ "type": "string",
2180
+ "description": "The billing interval the subscription pays."
2225
2181
  }
2226
2182
  },
2227
2183
  "required": [
2228
2184
  "subscriptionId",
2229
2185
  "customerId",
2230
- "status",
2231
- "invoiceId",
2232
- "invoiceNumber"
2186
+ "fromVersionId",
2187
+ "toVersionId",
2188
+ "currency",
2189
+ "billingInterval"
2233
2190
  ],
2234
2191
  "additionalProperties": false
2235
2192
  }
@@ -2246,7 +2203,7 @@
2246
2203
  "additionalProperties": false
2247
2204
  },
2248
2205
  "example": {
2249
- "event": "subscription.past_due",
2206
+ "event": "subscription.version_changed",
2250
2207
  "timestamp": "2026-06-23T14:30:00.000Z",
2251
2208
  "organizationId": "8f14e45f-ceea-4e7a-9c3d-1c2b3a4d5e6f",
2252
2209
  "mode": "live",
@@ -2254,9 +2211,10 @@
2254
2211
  "data": {
2255
2212
  "subscriptionId": "sub_1a2b3c4d",
2256
2213
  "customerId": "user_123",
2257
- "status": "past_due",
2258
- "invoiceId": "inv_n4o5p6",
2259
- "invoiceNumber": "INV-0043"
2214
+ "fromVersionId": "plnrel_v3",
2215
+ "toVersionId": "plnrel_v4",
2216
+ "currency": "usd",
2217
+ "billingInterval": "monthly"
2260
2218
  }
2261
2219
  }
2262
2220
  }
@@ -2268,20 +2226,20 @@
2268
2226
  }
2269
2227
  },
2270
2228
  "x-mint": {
2271
- "href": "/webhooks/subscription-past-due",
2229
+ "href": "/webhooks/subscription-version-changed",
2272
2230
  "metadata": {
2273
- "title": "subscription.past_due",
2274
- "description": "Fired when a recurring payment fails and the subscription enters a grace window while Commet retries the charge.",
2231
+ "title": "subscription.version_changed",
2232
+ "description": "Fired when a subscription moves to another version of its plan, now or at its renewal.",
2275
2233
  "playground": "none"
2276
2234
  },
2277
- "content": "## When this fires\n\nA recurring charge failed on a subscription that has been paid before. Commet sets the status to `past_due` and enters dunning.\n\n`past_due` is a permissive grace window — features, usage, and seats keep working. Only purchases and plan changes are blocked. Usage accrues as debt during this window.\n\nCommet retries the charge on day 1, day 3, day 5, and day 7 after the failure (4 retries). If a retry succeeds the subscription returns to `active`. If all 4 retries fail the subscription is canceled.\n\n`payment.failed` fires alongside this event with the charge failure details (`failureCode`, `failureMessage`). Use `subscription.past_due` to drive your access state and `payment.failed` to drive recovery messaging.\n\nFirst-checkout card declines do NOT trigger this event — a subscription that was never paid moves back to `pending_payment` instead."
2235
+ "content": "## When this fires\n\nA subscription moves to another version of the same plan:\n\n- right away, after [Change subscription version](/api-reference/subscriptions/change-subscription-version) or a plan move made now;\n- at its renewal, when a move scheduled for the end of the period takes effect.\n\nFrom this event the subscription has the destination version's features, limits and included credits or balance. A move made now charges the new version's price from the next renewal; a move never creates a proration charge or refund.\n\n`currency` is the subscription's currency, which a move never changes. `billingInterval` is the interval it pays after the move.\n\n| Moment | Event | What to do |\n| --- | --- | --- |\n| Move scheduled for renewal | None. The subscription shows it in `scheduledVersionChange`. | Show the upcoming change if your UI lists plan terms. |\n| Move takes effect | `subscription.version_changed` | Refresh the features and limits you keep for the subscription. |\n| Scheduled move no longer happens | `subscription.version_change_canceled` | Remove the upcoming change. |\n\nA trialing subscription with a pending move moves when its trial ends, so its first charge is already on the destination version. A subscription that ends or changes to another plan instead of renewing on its plan never moves and sends neither event.\n\nOnly endpoints that list this event receive it. New event types are not added to existing endpoints: add it to the endpoint's events in **Settings → Webhooks** or with [Update webhook endpoint](/api-reference/webhooks/update-webhook-endpoint)."
2278
2236
  }
2279
2237
  }
2280
2238
  },
2281
- "trial.started": {
2239
+ "subscription.version_change_canceled": {
2282
2240
  "post": {
2283
- "summary": "trial.started",
2284
- "description": "Fired when a subscription enters its trial period after checkout. Grant access here — trialing subscriptions have full access until trialEndsAt.",
2241
+ "summary": "subscription.version_change_canceled",
2242
+ "description": "Fired when a scheduled move to another plan version will no longer take effect because the subscription no longer fit the version at its renewal, or because the merchant revoked the scheduled version change or canceled the plan move. A new move that replaces it, a move made now, a plan change or an immediate cancellation sends none. The subscription stays on its version; reason says why.",
2285
2243
  "tags": [
2286
2244
  "Webhooks"
2287
2245
  ],
@@ -2297,7 +2255,7 @@
2297
2255
  },
2298
2256
  "event": {
2299
2257
  "type": "string",
2300
- "const": "trial.started"
2258
+ "const": "subscription.version_change_canceled"
2301
2259
  },
2302
2260
  "timestamp": {
2303
2261
  "type": "string"
@@ -2326,30 +2284,20 @@
2326
2284
  "type": "string",
2327
2285
  "description": "The customer ID. Returns your externalId if you provided one when creating the customer, otherwise returns the Commet publicId."
2328
2286
  },
2329
- "status": {
2330
- "type": "string",
2331
- "description": "Always \"trialing\" for this event."
2332
- },
2333
- "planId": {
2334
- "type": "string",
2335
- "description": "The plan ID."
2336
- },
2337
- "planName": {
2287
+ "toVersionId": {
2338
2288
  "type": "string",
2339
- "description": "The plan name."
2289
+ "description": "The version the subscription was going to move to."
2340
2290
  },
2341
- "trialEndsAt": {
2291
+ "reason": {
2342
2292
  "type": "string",
2343
- "description": "ISO 8601 datetime when the trial ends."
2293
+ "description": "Why the move was canceled: canceled_by_merchant, version_change_failed when the move could not be applied at renewal, or the code of what the subscription no longer fits (addon_unavailable, seat_limit_exceeded, price_not_found, missing_regional_price)."
2344
2294
  }
2345
2295
  },
2346
2296
  "required": [
2347
2297
  "subscriptionId",
2348
2298
  "customerId",
2349
- "status",
2350
- "planId",
2351
- "planName",
2352
- "trialEndsAt"
2299
+ "toVersionId",
2300
+ "reason"
2353
2301
  ],
2354
2302
  "additionalProperties": false
2355
2303
  }
@@ -2366,7 +2314,7 @@
2366
2314
  "additionalProperties": false
2367
2315
  },
2368
2316
  "example": {
2369
- "event": "trial.started",
2317
+ "event": "subscription.version_change_canceled",
2370
2318
  "timestamp": "2026-06-23T14:30:00.000Z",
2371
2319
  "organizationId": "8f14e45f-ceea-4e7a-9c3d-1c2b3a4d5e6f",
2372
2320
  "mode": "live",
@@ -2374,10 +2322,8 @@
2374
2322
  "data": {
2375
2323
  "subscriptionId": "sub_1a2b3c4d",
2376
2324
  "customerId": "user_123",
2377
- "status": "trialing",
2378
- "planId": "pln_pro_monthly",
2379
- "planName": "Pro",
2380
- "trialEndsAt": "2026-04-08T00:00:00.000Z"
2325
+ "toVersionId": "plnrel_v4",
2326
+ "reason": "addon_unavailable"
2381
2327
  }
2382
2328
  }
2383
2329
  }
@@ -2389,20 +2335,20 @@
2389
2335
  }
2390
2336
  },
2391
2337
  "x-mint": {
2392
- "href": "/webhooks/trial-started",
2338
+ "href": "/webhooks/subscription-version-change-canceled",
2393
2339
  "metadata": {
2394
- "title": "trial.started",
2395
- "description": "Fired when a subscription enters its trial period. Grant access here.",
2340
+ "title": "subscription.version_change_canceled",
2341
+ "description": "Fired when a move to another plan version scheduled for renewal will no longer happen.",
2396
2342
  "playground": "none"
2397
2343
  },
2398
- "content": "## Trial lifecycle\n\nTrials in Commet collect a payment method at checkout, so every trial has a clear path to revenue:\n\n| Moment | Event | What to do |\n| --- | --- | --- |\n| Checkout completes with trial days | `trial.started` | Grant full access. |\n| 3 days before the trial ends | `trial.will_end` | Remind the customer billing starts soon. |\n| Customer upgrades during the trial | `trial.converted` | Trial ends early, paid plan starts now. |\n| Trial runs out | `trial.expired` | Regular billing begins automatically. |\n\nSubscriptions with `status: \"trialing\"` have full access — treat them like `active` in your entitlement checks."
2344
+ "content": "## When this fires\n\nA move to another version that was waiting for the subscription's renewal will not happen, and the subscription stays on its version. `toVersionId` is the version it was going to move to, and `reason` says why:\n\n| `reason` | What happened |\n| --- | --- |\n| `canceled_by_merchant` | You canceled the move with [Revoke scheduled version change](/api-reference/subscriptions/revoke-scheduled-version-change), or canceled the plan move for every subscriber or for this one. |\n| `addon_unavailable` | At renewal the subscription has an active add-on the destination version does not sell. |\n| `seat_limit_exceeded` | At renewal the subscription has more seats than the destination version allows. |\n| `price_not_found` | The destination version does not sell the price the subscription pays. |\n| `missing_regional_price` | The destination version does not sell the subscription's currency. A move never changes the currency. |\n| `version_change_failed` | The move could not be applied at renewal. |\n\nA move made now has nothing pending, so it never fires this event. Neither does a new move that replaces the pending one, a change to another plan, or a subscription that ends instead of renewing: the pending move is dropped and `scheduledVersionChange` becomes `null`. To move the subscription later, resolve what `reason` names and request the move again.\n\nOnly endpoints that list this event receive it. New event types are not added to existing endpoints: add it to the endpoint's events in **Settings → Webhooks** or with [Update webhook endpoint](/api-reference/webhooks/update-webhook-endpoint)."
2399
2345
  }
2400
2346
  }
2401
2347
  },
2402
- "trial.converted": {
2348
+ "subscription.past_due": {
2403
2349
  "post": {
2404
- "summary": "trial.converted",
2405
- "description": "Fired when a trialing customer converts to a paid subscription before the trial ends — today this happens when they change plan during the trial, which charges the full new plan price immediately. Trials that simply run out fire trial.expired instead.",
2350
+ "summary": "subscription.past_due",
2351
+ "description": "Fired when a recurring payment fails on a previously paid subscription and its status becomes past_due. past_due is a grace window, not a cutoff: usage and seats keep working while new purchases are blocked, and dunning retries the charge — use this to notify the customer and recover the payment.",
2406
2352
  "tags": [
2407
2353
  "Webhooks"
2408
2354
  ],
@@ -2418,7 +2364,7 @@
2418
2364
  },
2419
2365
  "event": {
2420
2366
  "type": "string",
2421
- "const": "trial.converted"
2367
+ "const": "subscription.past_due"
2422
2368
  },
2423
2369
  "timestamp": {
2424
2370
  "type": "string"
@@ -2449,23 +2395,23 @@
2449
2395
  },
2450
2396
  "status": {
2451
2397
  "type": "string",
2452
- "description": "Always \"active\" for this event."
2398
+ "description": "Always \"past_due\" for this event."
2453
2399
  },
2454
- "planId": {
2400
+ "invoiceId": {
2455
2401
  "type": "string",
2456
- "description": "The plan ID the customer converted to."
2402
+ "description": "The invoice whose payment failure triggered the status."
2457
2403
  },
2458
- "planName": {
2404
+ "invoiceNumber": {
2459
2405
  "type": "string",
2460
- "description": "The plan name."
2406
+ "description": "The human-readable invoice number."
2461
2407
  }
2462
2408
  },
2463
2409
  "required": [
2464
2410
  "subscriptionId",
2465
2411
  "customerId",
2466
2412
  "status",
2467
- "planId",
2468
- "planName"
2413
+ "invoiceId",
2414
+ "invoiceNumber"
2469
2415
  ],
2470
2416
  "additionalProperties": false
2471
2417
  }
@@ -2482,7 +2428,7 @@
2482
2428
  "additionalProperties": false
2483
2429
  },
2484
2430
  "example": {
2485
- "event": "trial.converted",
2431
+ "event": "subscription.past_due",
2486
2432
  "timestamp": "2026-06-23T14:30:00.000Z",
2487
2433
  "organizationId": "8f14e45f-ceea-4e7a-9c3d-1c2b3a4d5e6f",
2488
2434
  "mode": "live",
@@ -2490,9 +2436,9 @@
2490
2436
  "data": {
2491
2437
  "subscriptionId": "sub_1a2b3c4d",
2492
2438
  "customerId": "user_123",
2493
- "status": "active",
2494
- "planId": "pln_pro_monthly",
2495
- "planName": "Pro"
2439
+ "status": "past_due",
2440
+ "invoiceId": "inv_n4o5p6",
2441
+ "invoiceNumber": "INV-0043"
2496
2442
  }
2497
2443
  }
2498
2444
  }
@@ -2504,20 +2450,20 @@
2504
2450
  }
2505
2451
  },
2506
2452
  "x-mint": {
2507
- "href": "/webhooks/trial-converted",
2453
+ "href": "/webhooks/subscription-past-due",
2508
2454
  "metadata": {
2509
- "title": "trial.converted",
2510
- "description": "Fired when a trialing customer converts to a paid subscription before the trial ends.",
2455
+ "title": "subscription.past_due",
2456
+ "description": "Fired when a recurring payment fails and the subscription enters a grace window while Commet retries the charge.",
2511
2457
  "playground": "none"
2512
2458
  },
2513
- "content": "## When this fires\n\nA customer on a trial changes plan before the trial runs out. The trial ends immediately, the full new plan price is charged (no proration credit — trials are free), and the subscription becomes `active`.\n\n`subscription.plan_changed` fires alongside this event with the charge details. Use `trial.converted` for conversion analytics and lifecycle messaging; use `subscription.plan_changed` for entitlement updates.\n\nTrials that simply run out fire `trial.expired` instead — that is the natural trial-to-paid transition."
2459
+ "content": "## When this fires\n\nA recurring charge failed on a subscription that has been paid before. Commet sets the status to `past_due` and enters dunning.\n\n`past_due` is a permissive grace window — features, usage, and seats keep working. Only purchases and plan changes are blocked. Usage accrues as debt during this window.\n\nCommet retries the charge on day 1, day 3, day 5, and day 7 after the failure (4 retries). If a retry succeeds the subscription returns to `active`. If all 4 retries fail the subscription is canceled.\n\n`payment.failed` fires alongside this event with the charge failure details (`failureCode`, `failureMessage`). Use `subscription.past_due` to drive your access state and `payment.failed` to drive recovery messaging.\n\nFirst-checkout card declines do NOT trigger this event — a subscription that was never paid moves back to `pending_payment` instead."
2514
2460
  }
2515
2461
  }
2516
2462
  },
2517
- "trial.expired": {
2463
+ "trial.started": {
2518
2464
  "post": {
2519
- "summary": "trial.expired",
2520
- "description": "Fired when a trial period runs out and the billing cycle activates the subscription. The first regular invoice is generated right after — this is the natural trial-to-paid transition.",
2465
+ "summary": "trial.started",
2466
+ "description": "Fired when a subscription enters its trial period: after checkout, or right away when the price's trial requires no payment method. Grant access here — trialing subscriptions have full access until trialEndsAt.",
2521
2467
  "tags": [
2522
2468
  "Webhooks"
2523
2469
  ],
@@ -2533,7 +2479,7 @@
2533
2479
  },
2534
2480
  "event": {
2535
2481
  "type": "string",
2536
- "const": "trial.expired"
2482
+ "const": "trial.started"
2537
2483
  },
2538
2484
  "timestamp": {
2539
2485
  "type": "string"
@@ -2564,7 +2510,7 @@
2564
2510
  },
2565
2511
  "status": {
2566
2512
  "type": "string",
2567
- "description": "Current status — \"active\" once the billing cycle has activated the subscription."
2513
+ "description": "Always \"trialing\" for this event."
2568
2514
  },
2569
2515
  "planId": {
2570
2516
  "type": "string",
@@ -2576,7 +2522,7 @@
2576
2522
  },
2577
2523
  "trialEndsAt": {
2578
2524
  "type": "string",
2579
- "description": "ISO 8601 datetime when the trial ended."
2525
+ "description": "ISO 8601 datetime when the trial ends."
2580
2526
  }
2581
2527
  },
2582
2528
  "required": [
@@ -2602,7 +2548,7 @@
2602
2548
  "additionalProperties": false
2603
2549
  },
2604
2550
  "example": {
2605
- "event": "trial.expired",
2551
+ "event": "trial.started",
2606
2552
  "timestamp": "2026-06-23T14:30:00.000Z",
2607
2553
  "organizationId": "8f14e45f-ceea-4e7a-9c3d-1c2b3a4d5e6f",
2608
2554
  "mode": "live",
@@ -2610,7 +2556,7 @@
2610
2556
  "data": {
2611
2557
  "subscriptionId": "sub_1a2b3c4d",
2612
2558
  "customerId": "user_123",
2613
- "status": "active",
2559
+ "status": "trialing",
2614
2560
  "planId": "pln_pro_monthly",
2615
2561
  "planName": "Pro",
2616
2562
  "trialEndsAt": "2026-04-08T00:00:00.000Z"
@@ -2625,20 +2571,20 @@
2625
2571
  }
2626
2572
  },
2627
2573
  "x-mint": {
2628
- "href": "/webhooks/trial-expired",
2574
+ "href": "/webhooks/trial-started",
2629
2575
  "metadata": {
2630
- "title": "trial.expired",
2631
- "description": "Fired when a trial period runs out and regular billing begins.",
2576
+ "title": "trial.started",
2577
+ "description": "Fired when a subscription enters its trial period, after checkout or at once when the price's trial requires no payment method. Grant access here.",
2632
2578
  "playground": "none"
2633
2579
  },
2634
- "content": "## When this fires\n\nThe trial reached `trialEndsAt`. The billing cycle activates the subscription (`status: \"active\"`), starts the first regular billing period, and generates the first invoice — `invoice.created` and payment events follow as the charge is processed.\n\nAccess does not change at this moment: the customer already had full access while trialing. A retryable first-charge failure moves the subscription to `past_due` recovery; a missing payment method or a customer-action-required outcome leaves it in `pending_payment` until checkout is completed."
2580
+ "content": "## Trial lifecycle\n\nA trial either saves a payment method at checkout or, when the price's trial requires none, starts at once without checkout:\n\n| Moment | Event | What to do |\n| --- | --- | --- |\n| The trial checkout completes, or a trial without a payment method starts | `trial.started` | Grant full access. |\n| 3 days before the trial ends | `trial.will_end` | Remind the customer billing starts soon. |\n| Customer upgrades during the trial | `trial.converted` | Trial ends early, paid plan starts now. |\n| Trial runs out | `trial.expired` | With a payment method, regular billing begins. Without one, the subscription moves to the plan group's default plan or is canceled. |\n\nSubscriptions with `status: \"trialing\"` have full access — treat them like `active` in your entitlement checks. While a trial without a payment method has no card, the subscription's `hasPaymentMethod` is `false`."
2635
2581
  }
2636
2582
  }
2637
2583
  },
2638
- "trial.will_end": {
2584
+ "trial.converted": {
2639
2585
  "post": {
2640
- "summary": "trial.will_end",
2641
- "description": "Predictive event fired once, 3 days before a trial ends. Use it to remind the customer that billing starts soon. Emitted by a daily scan with a deterministic idempotency key, so it never fires twice for the same trial end date.",
2586
+ "summary": "trial.converted",
2587
+ "description": "Fired when a trialing customer converts to a paid subscription before the trial ends — today this happens when they change plan during the trial, which charges the full new plan price immediately. Trials that simply run out fire trial.expired instead.",
2642
2588
  "tags": [
2643
2589
  "Webhooks"
2644
2590
  ],
@@ -2654,7 +2600,7 @@
2654
2600
  },
2655
2601
  "event": {
2656
2602
  "type": "string",
2657
- "const": "trial.will_end"
2603
+ "const": "trial.converted"
2658
2604
  },
2659
2605
  "timestamp": {
2660
2606
  "type": "string"
@@ -2685,19 +2631,15 @@
2685
2631
  },
2686
2632
  "status": {
2687
2633
  "type": "string",
2688
- "description": "Always \"trialing\" for this event."
2634
+ "description": "Always \"active\" for this event."
2689
2635
  },
2690
2636
  "planId": {
2691
2637
  "type": "string",
2692
- "description": "The plan ID."
2638
+ "description": "The plan ID the customer converted to."
2693
2639
  },
2694
2640
  "planName": {
2695
2641
  "type": "string",
2696
2642
  "description": "The plan name."
2697
- },
2698
- "trialEndsAt": {
2699
- "type": "string",
2700
- "description": "ISO 8601 datetime when the trial will end."
2701
2643
  }
2702
2644
  },
2703
2645
  "required": [
@@ -2705,8 +2647,7 @@
2705
2647
  "customerId",
2706
2648
  "status",
2707
2649
  "planId",
2708
- "planName",
2709
- "trialEndsAt"
2650
+ "planName"
2710
2651
  ],
2711
2652
  "additionalProperties": false
2712
2653
  }
@@ -2723,7 +2664,7 @@
2723
2664
  "additionalProperties": false
2724
2665
  },
2725
2666
  "example": {
2726
- "event": "trial.will_end",
2667
+ "event": "trial.converted",
2727
2668
  "timestamp": "2026-06-23T14:30:00.000Z",
2728
2669
  "organizationId": "8f14e45f-ceea-4e7a-9c3d-1c2b3a4d5e6f",
2729
2670
  "mode": "live",
@@ -2731,10 +2672,9 @@
2731
2672
  "data": {
2732
2673
  "subscriptionId": "sub_1a2b3c4d",
2733
2674
  "customerId": "user_123",
2734
- "status": "trialing",
2675
+ "status": "active",
2735
2676
  "planId": "pln_pro_monthly",
2736
- "planName": "Pro",
2737
- "trialEndsAt": "2026-04-08T00:00:00.000Z"
2677
+ "planName": "Pro"
2738
2678
  }
2739
2679
  }
2740
2680
  }
@@ -2746,20 +2686,20 @@
2746
2686
  }
2747
2687
  },
2748
2688
  "x-mint": {
2749
- "href": "/webhooks/trial-will-end",
2689
+ "href": "/webhooks/trial-converted",
2750
2690
  "metadata": {
2751
- "title": "trial.will_end",
2752
- "description": "Predictive event fired once, 3 days before a trial ends.",
2691
+ "title": "trial.converted",
2692
+ "description": "Fired when a trialing customer converts to a paid subscription before the trial ends.",
2753
2693
  "playground": "none"
2754
2694
  },
2755
- "content": "## When this fires\n\nA daily scan finds trials ending within the next 3 days and emits this event once per trial. The idempotency key is derived from the subscription and the trial end date, so re-running the scan never sends a duplicate.\n\nUse it to remind the customer that billing starts on `trialEndsAt` — the single most effective moment to prevent involuntary churn and surprise charges.\n\nIf the trial end date changes after this event fired (for example, the customer converts early), `trial.converted` or `trial.expired` reflects the final outcome."
2695
+ "content": "## When this fires\n\nA customer on a trial changes plan before the trial runs out. The trial ends immediately, the full new plan price is charged (no proration credit — trials are free), and the subscription becomes `active`.\n\n`subscription.plan_changed` fires alongside this event with the charge details. Use `trial.converted` for conversion analytics and lifecycle messaging; use `subscription.plan_changed` for entitlement updates.\n\nTrials that simply run out fire `trial.expired` instead — that is the natural trial-to-paid transition."
2756
2696
  }
2757
2697
  }
2758
2698
  },
2759
- "trial.checkout_ready": {
2699
+ "trial.expired": {
2760
2700
  "post": {
2761
- "summary": "trial.checkout_ready",
2762
- "description": "Fired when a trial checkout link is ready to share with the customer. Completing this checkout saves a payment method and starts the trial (trial.started) — the customer is not charged until the trial ends.",
2701
+ "summary": "trial.expired",
2702
+ "description": "Fired when a trial period runs out. With a payment method the billing cycle activates the subscription and generates the first regular invoice right after — the natural trial-to-paid transition. A trial without a payment method instead moves to the plan group's default plan (subscription.plan_changed) or is canceled with cancelReason trial_ended_without_payment_method (subscription.canceled), without an invoice.",
2763
2703
  "tags": [
2764
2704
  "Webhooks"
2765
2705
  ],
@@ -2775,7 +2715,7 @@
2775
2715
  },
2776
2716
  "event": {
2777
2717
  "type": "string",
2778
- "const": "trial.checkout_ready"
2718
+ "const": "trial.expired"
2779
2719
  },
2780
2720
  "timestamp": {
2781
2721
  "type": "string"
@@ -2804,25 +2744,267 @@
2804
2744
  "type": "string",
2805
2745
  "description": "The customer ID. Returns your externalId if you provided one when creating the customer, otherwise returns the Commet publicId."
2806
2746
  },
2747
+ "status": {
2748
+ "type": "string",
2749
+ "description": "Current status — \"active\" once the billing cycle has activated the subscription."
2750
+ },
2751
+ "planId": {
2752
+ "type": "string",
2753
+ "description": "The plan ID."
2754
+ },
2807
2755
  "planName": {
2808
2756
  "type": "string",
2809
2757
  "description": "The plan name."
2810
2758
  },
2811
- "trialDays": {
2812
- "type": "number",
2813
- "description": "The length of the trial in days."
2814
- },
2815
- "checkoutUrl": {
2759
+ "trialEndsAt": {
2816
2760
  "type": "string",
2817
- "description": "The hosted checkout URL to share with the customer."
2761
+ "description": "ISO 8601 datetime when the trial ended."
2818
2762
  }
2819
2763
  },
2820
2764
  "required": [
2821
2765
  "subscriptionId",
2822
2766
  "customerId",
2767
+ "status",
2768
+ "planId",
2823
2769
  "planName",
2824
- "trialDays",
2825
- "checkoutUrl"
2770
+ "trialEndsAt"
2771
+ ],
2772
+ "additionalProperties": false
2773
+ }
2774
+ },
2775
+ "required": [
2776
+ "id",
2777
+ "event",
2778
+ "timestamp",
2779
+ "organizationId",
2780
+ "mode",
2781
+ "apiVersion",
2782
+ "data"
2783
+ ],
2784
+ "additionalProperties": false
2785
+ },
2786
+ "example": {
2787
+ "event": "trial.expired",
2788
+ "timestamp": "2026-06-23T14:30:00.000Z",
2789
+ "organizationId": "8f14e45f-ceea-4e7a-9c3d-1c2b3a4d5e6f",
2790
+ "mode": "live",
2791
+ "apiVersion": "2026-08-27",
2792
+ "data": {
2793
+ "subscriptionId": "sub_1a2b3c4d",
2794
+ "customerId": "user_123",
2795
+ "status": "active",
2796
+ "planId": "pln_pro_monthly",
2797
+ "planName": "Pro",
2798
+ "trialEndsAt": "2026-04-08T00:00:00.000Z"
2799
+ }
2800
+ }
2801
+ }
2802
+ }
2803
+ },
2804
+ "responses": {
2805
+ "200": {
2806
+ "description": "Return any 2xx status code to acknowledge receipt of the event."
2807
+ }
2808
+ },
2809
+ "x-mint": {
2810
+ "href": "/webhooks/trial-expired",
2811
+ "metadata": {
2812
+ "title": "trial.expired",
2813
+ "description": "Fired when a trial period runs out: regular billing begins, or a trial without a card moves to the default plan or is canceled.",
2814
+ "playground": "none"
2815
+ },
2816
+ "content": "## When this fires\n\nThe trial reached `trialEndsAt`. With a payment method, the billing cycle activates the subscription (`status: \"active\"`), starts the first regular billing period, and generates the first invoice — `invoice.created` and payment events follow as the charge is processed.\n\nAccess does not change at this moment: the customer already had full access while trialing. A retryable first-charge failure moves the subscription to `past_due` recovery; a missing payment method or a customer-action-required outcome leaves it in `pending_payment` until checkout is completed.\n\nA trial without a payment method that ends without a card creates no invoice. The subscription moves to the plan group's default plan (`subscription.plan_changed`) or, without one, is canceled with `cancelReason: \"trial_ended_without_payment_method\"` (`subscription.canceled`)."
2817
+ }
2818
+ }
2819
+ },
2820
+ "trial.will_end": {
2821
+ "post": {
2822
+ "summary": "trial.will_end",
2823
+ "description": "Predictive event fired once, 3 days before a trial ends. Use it to remind the customer that billing starts soon. Emitted by a daily scan with a deterministic idempotency key, so it never fires twice for the same trial end date.",
2824
+ "tags": [
2825
+ "Webhooks"
2826
+ ],
2827
+ "requestBody": {
2828
+ "required": true,
2829
+ "content": {
2830
+ "application/json": {
2831
+ "schema": {
2832
+ "type": "object",
2833
+ "properties": {
2834
+ "id": {
2835
+ "type": "string"
2836
+ },
2837
+ "event": {
2838
+ "type": "string",
2839
+ "const": "trial.will_end"
2840
+ },
2841
+ "timestamp": {
2842
+ "type": "string"
2843
+ },
2844
+ "organizationId": {
2845
+ "type": "string"
2846
+ },
2847
+ "mode": {
2848
+ "type": "string",
2849
+ "enum": [
2850
+ "live",
2851
+ "sandbox"
2852
+ ]
2853
+ },
2854
+ "apiVersion": {
2855
+ "type": "string"
2856
+ },
2857
+ "data": {
2858
+ "type": "object",
2859
+ "properties": {
2860
+ "subscriptionId": {
2861
+ "type": "string",
2862
+ "description": "The subscription ID."
2863
+ },
2864
+ "customerId": {
2865
+ "type": "string",
2866
+ "description": "The customer ID. Returns your externalId if you provided one when creating the customer, otherwise returns the Commet publicId."
2867
+ },
2868
+ "status": {
2869
+ "type": "string",
2870
+ "description": "Always \"trialing\" for this event."
2871
+ },
2872
+ "planId": {
2873
+ "type": "string",
2874
+ "description": "The plan ID."
2875
+ },
2876
+ "planName": {
2877
+ "type": "string",
2878
+ "description": "The plan name."
2879
+ },
2880
+ "trialEndsAt": {
2881
+ "type": "string",
2882
+ "description": "ISO 8601 datetime when the trial will end."
2883
+ }
2884
+ },
2885
+ "required": [
2886
+ "subscriptionId",
2887
+ "customerId",
2888
+ "status",
2889
+ "planId",
2890
+ "planName",
2891
+ "trialEndsAt"
2892
+ ],
2893
+ "additionalProperties": false
2894
+ }
2895
+ },
2896
+ "required": [
2897
+ "id",
2898
+ "event",
2899
+ "timestamp",
2900
+ "organizationId",
2901
+ "mode",
2902
+ "apiVersion",
2903
+ "data"
2904
+ ],
2905
+ "additionalProperties": false
2906
+ },
2907
+ "example": {
2908
+ "event": "trial.will_end",
2909
+ "timestamp": "2026-06-23T14:30:00.000Z",
2910
+ "organizationId": "8f14e45f-ceea-4e7a-9c3d-1c2b3a4d5e6f",
2911
+ "mode": "live",
2912
+ "apiVersion": "2026-08-27",
2913
+ "data": {
2914
+ "subscriptionId": "sub_1a2b3c4d",
2915
+ "customerId": "user_123",
2916
+ "status": "trialing",
2917
+ "planId": "pln_pro_monthly",
2918
+ "planName": "Pro",
2919
+ "trialEndsAt": "2026-04-08T00:00:00.000Z"
2920
+ }
2921
+ }
2922
+ }
2923
+ }
2924
+ },
2925
+ "responses": {
2926
+ "200": {
2927
+ "description": "Return any 2xx status code to acknowledge receipt of the event."
2928
+ }
2929
+ },
2930
+ "x-mint": {
2931
+ "href": "/webhooks/trial-will-end",
2932
+ "metadata": {
2933
+ "title": "trial.will_end",
2934
+ "description": "Predictive event fired once, 3 days before a trial ends.",
2935
+ "playground": "none"
2936
+ },
2937
+ "content": "## When this fires\n\nA daily scan finds trials ending within the next 3 days and emits this event once per trial. The idempotency key is derived from the subscription and the trial end date, so re-running the scan never sends a duplicate.\n\nUse it to remind the customer that billing starts on `trialEndsAt` — the single most effective moment to prevent involuntary churn and surprise charges.\n\nIf the trial end date changes after this event fired (for example, the customer converts early), `trial.converted` or `trial.expired` reflects the final outcome."
2938
+ }
2939
+ }
2940
+ },
2941
+ "trial.checkout_ready": {
2942
+ "post": {
2943
+ "summary": "trial.checkout_ready",
2944
+ "description": "Fired when a trial checkout link is ready to share with the customer. Completing this checkout saves a payment method and starts the trial (trial.started) — the customer is not charged until the trial ends. Not fired for a trial whose price requires no payment method, which starts without checkout.",
2945
+ "tags": [
2946
+ "Webhooks"
2947
+ ],
2948
+ "requestBody": {
2949
+ "required": true,
2950
+ "content": {
2951
+ "application/json": {
2952
+ "schema": {
2953
+ "type": "object",
2954
+ "properties": {
2955
+ "id": {
2956
+ "type": "string"
2957
+ },
2958
+ "event": {
2959
+ "type": "string",
2960
+ "const": "trial.checkout_ready"
2961
+ },
2962
+ "timestamp": {
2963
+ "type": "string"
2964
+ },
2965
+ "organizationId": {
2966
+ "type": "string"
2967
+ },
2968
+ "mode": {
2969
+ "type": "string",
2970
+ "enum": [
2971
+ "live",
2972
+ "sandbox"
2973
+ ]
2974
+ },
2975
+ "apiVersion": {
2976
+ "type": "string"
2977
+ },
2978
+ "data": {
2979
+ "type": "object",
2980
+ "properties": {
2981
+ "subscriptionId": {
2982
+ "type": "string",
2983
+ "description": "The subscription ID."
2984
+ },
2985
+ "customerId": {
2986
+ "type": "string",
2987
+ "description": "The customer ID. Returns your externalId if you provided one when creating the customer, otherwise returns the Commet publicId."
2988
+ },
2989
+ "planName": {
2990
+ "type": "string",
2991
+ "description": "The plan name."
2992
+ },
2993
+ "trialDays": {
2994
+ "type": "number",
2995
+ "description": "The length of the trial in days."
2996
+ },
2997
+ "checkoutUrl": {
2998
+ "type": "string",
2999
+ "description": "The hosted checkout URL to share with the customer."
3000
+ }
3001
+ },
3002
+ "required": [
3003
+ "subscriptionId",
3004
+ "customerId",
3005
+ "planName",
3006
+ "trialDays",
3007
+ "checkoutUrl"
2826
3008
  ],
2827
3009
  "additionalProperties": false
2828
3010
  }
@@ -3061,15 +3243,11 @@
3061
3243
  "description": "The original reason for the charge. Recovery never replaces this reason."
3062
3244
  },
3063
3245
  "paymentLinkId": {
3064
- "anyOf": [
3065
- {
3066
- "type": "string"
3067
- },
3068
- {
3069
- "type": "null"
3070
- }
3071
- ],
3072
- "description": "The public payment link ID, independently of the reason, or null when no payment link originated the charge."
3246
+ "description": "The public payment link ID, independently of the reason, or null when no payment link originated the charge.",
3247
+ "type": [
3248
+ "string",
3249
+ "null"
3250
+ ]
3073
3251
  },
3074
3252
  "recovery": {
3075
3253
  "anyOf": [
@@ -3153,26 +3331,18 @@
3153
3331
  "description": "The customer ID. Returns your externalId if you provided one when creating the customer, otherwise returns the Commet publicId."
3154
3332
  },
3155
3333
  "subscriptionId": {
3156
- "anyOf": [
3157
- {
3158
- "type": "string"
3159
- },
3160
- {
3161
- "type": "null"
3162
- }
3163
- ],
3164
- "description": "The subscription ID."
3334
+ "description": "The subscription ID.",
3335
+ "type": [
3336
+ "string",
3337
+ "null"
3338
+ ]
3165
3339
  },
3166
3340
  "paymentTransactionId": {
3167
- "anyOf": [
3168
- {
3169
- "type": "string"
3170
- },
3171
- {
3172
- "type": "null"
3173
- }
3174
- ],
3175
- "description": "The payment transaction ID."
3341
+ "description": "The payment transaction ID.",
3342
+ "type": [
3343
+ "string",
3344
+ "null"
3345
+ ]
3176
3346
  },
3177
3347
  "provider": {
3178
3348
  "anyOf": [
@@ -3214,48 +3384,32 @@
3214
3384
  "description": "The source of funds for this charge, when reported by the provider. Null when unavailable or unknown."
3215
3385
  },
3216
3386
  "grossAmount": {
3217
- "anyOf": [
3218
- {
3219
- "type": "number"
3220
- },
3221
- {
3222
- "type": "null"
3223
- }
3224
- ],
3225
- "description": "Gross amount in cents before fees."
3387
+ "description": "Gross amount in cents before fees.",
3388
+ "type": [
3389
+ "number",
3390
+ "null"
3391
+ ]
3226
3392
  },
3227
3393
  "currency": {
3228
- "anyOf": [
3229
- {
3230
- "type": "string"
3231
- },
3232
- {
3233
- "type": "null"
3234
- }
3235
- ],
3236
- "description": "The payment currency code."
3394
+ "description": "The payment currency code.",
3395
+ "type": [
3396
+ "string",
3397
+ "null"
3398
+ ]
3237
3399
  },
3238
3400
  "orgNetAmount": {
3239
- "anyOf": [
3240
- {
3241
- "type": "number"
3242
- },
3243
- {
3244
- "type": "null"
3245
- }
3246
- ],
3247
- "description": "Net amount after fees in cents."
3401
+ "description": "Net amount after fees in cents.",
3402
+ "type": [
3403
+ "number",
3404
+ "null"
3405
+ ]
3248
3406
  },
3249
3407
  "customerEmail": {
3250
- "anyOf": [
3251
- {
3252
- "type": "string"
3253
- },
3254
- {
3255
- "type": "null"
3256
- }
3257
- ],
3258
- "description": "The customer email used for this payment."
3408
+ "description": "The customer email used for this payment.",
3409
+ "type": [
3410
+ "string",
3411
+ "null"
3412
+ ]
3259
3413
  },
3260
3414
  "paidAt": {
3261
3415
  "description": "ISO 8601 datetime when the payment was received.",
@@ -3402,15 +3556,11 @@
3402
3556
  "description": "The original reason for the charge. Recovery never replaces this reason."
3403
3557
  },
3404
3558
  "paymentLinkId": {
3405
- "anyOf": [
3406
- {
3407
- "type": "string"
3408
- },
3409
- {
3410
- "type": "null"
3411
- }
3412
- ],
3413
- "description": "The public payment link ID, independently of the reason, or null when no payment link originated the charge."
3559
+ "description": "The public payment link ID, independently of the reason, or null when no payment link originated the charge.",
3560
+ "type": [
3561
+ "string",
3562
+ "null"
3563
+ ]
3414
3564
  },
3415
3565
  "recovery": {
3416
3566
  "anyOf": [
@@ -3490,15 +3640,11 @@
3490
3640
  "description": "The customer ID. Returns your externalId if you provided one when creating the customer, otherwise returns the Commet publicId."
3491
3641
  },
3492
3642
  "subscriptionId": {
3493
- "anyOf": [
3494
- {
3495
- "type": "string"
3496
- },
3497
- {
3498
- "type": "null"
3499
- }
3500
- ],
3501
- "description": "The subscription ID, if the invoice is linked to a subscription."
3643
+ "description": "The subscription ID, if the invoice is linked to a subscription.",
3644
+ "type": [
3645
+ "string",
3646
+ "null"
3647
+ ]
3502
3648
  },
3503
3649
  "provider": {
3504
3650
  "type": "string",
@@ -3540,15 +3686,11 @@
3540
3686
  "description": "A human-readable failure message."
3541
3687
  },
3542
3688
  "recoveryUrl": {
3543
- "anyOf": [
3544
- {
3545
- "type": "string"
3546
- },
3547
- {
3548
- "type": "null"
3549
- }
3550
- ],
3551
- "description": "A ready-to-use link the customer can follow to retry this payment, or null when no recovery path applies. For a first failed charge (pending_payment) it is the checkout URL; for a failed renewal (past_due) it is a signed recovery link — no separate createRecoveryLink call needed."
3689
+ "description": "A ready-to-use link the customer can follow to retry this payment, or null when no recovery path applies. For a first failed charge (pending_payment) it is the checkout URL; for a failed renewal (past_due) it is a signed recovery link — no separate createRecoveryLink call needed.",
3690
+ "type": [
3691
+ "string",
3692
+ "null"
3693
+ ]
3552
3694
  }
3553
3695
  },
3554
3696
  "required": [
@@ -3678,15 +3820,11 @@
3678
3820
  "description": "The customer ID. Returns your externalId if you provided one when creating the customer, otherwise returns the Commet publicId."
3679
3821
  },
3680
3822
  "subscriptionId": {
3681
- "anyOf": [
3682
- {
3683
- "type": "string"
3684
- },
3685
- {
3686
- "type": "null"
3687
- }
3688
- ],
3689
- "description": "The subscription ID, if the invoice is linked to a subscription."
3823
+ "description": "The subscription ID, if the invoice is linked to a subscription.",
3824
+ "type": [
3825
+ "string",
3826
+ "null"
3827
+ ]
3690
3828
  },
3691
3829
  "provider": {
3692
3830
  "anyOf": [
@@ -3968,59 +4106,39 @@
3968
4106
  "description": "The payment provider the charge was routed to: stripe, commet, or dlocal."
3969
4107
  },
3970
4108
  "paymentLinkId": {
3971
- "anyOf": [
3972
- {
3973
- "type": "string"
3974
- },
3975
- {
3976
- "type": "null"
3977
- }
3978
- ],
3979
- "description": "The payment link the payment originated from, or null when the payment did not come from a payment link."
4109
+ "description": "The payment link the payment originated from, or null when the payment did not come from a payment link.",
4110
+ "type": [
4111
+ "string",
4112
+ "null"
4113
+ ]
3980
4114
  },
3981
4115
  "invoiceId": {
3982
- "anyOf": [
3983
- {
3984
- "type": "string"
3985
- },
3986
- {
3987
- "type": "null"
3988
- }
3989
- ],
3990
- "description": "The invoice the payment collected, or null for payments without an invoice."
4116
+ "description": "The invoice the payment collected, or null for payments without an invoice.",
4117
+ "type": [
4118
+ "string",
4119
+ "null"
4120
+ ]
3991
4121
  },
3992
4122
  "invoiceNumber": {
3993
- "anyOf": [
3994
- {
3995
- "type": "string"
3996
- },
3997
- {
3998
- "type": "null"
3999
- }
4000
- ],
4001
- "description": "The human-readable invoice number, if available."
4123
+ "description": "The human-readable invoice number, if available.",
4124
+ "type": [
4125
+ "string",
4126
+ "null"
4127
+ ]
4002
4128
  },
4003
4129
  "customerId": {
4004
- "anyOf": [
4005
- {
4006
- "type": "string"
4007
- },
4008
- {
4009
- "type": "null"
4010
- }
4011
- ],
4012
- "description": "The customer ID, when the payment is linked to an invoice. Returns your externalId if you provided one when creating the customer, otherwise returns the Commet publicId."
4130
+ "description": "The customer ID, when the payment is linked to an invoice. Returns your externalId if you provided one when creating the customer, otherwise returns the Commet publicId.",
4131
+ "type": [
4132
+ "string",
4133
+ "null"
4134
+ ]
4013
4135
  },
4014
4136
  "subscriptionId": {
4015
- "anyOf": [
4016
- {
4017
- "type": "string"
4018
- },
4019
- {
4020
- "type": "null"
4021
- }
4022
- ],
4023
- "description": "The subscription ID, if the invoice is linked to a subscription."
4137
+ "description": "The subscription ID, if the invoice is linked to a subscription.",
4138
+ "type": [
4139
+ "string",
4140
+ "null"
4141
+ ]
4024
4142
  },
4025
4143
  "refundAmount": {
4026
4144
  "type": "number",
@@ -4147,59 +4265,39 @@
4147
4265
  "description": "The payment provider the charge was routed to: stripe, commet, or dlocal."
4148
4266
  },
4149
4267
  "paymentLinkId": {
4150
- "anyOf": [
4151
- {
4152
- "type": "string"
4153
- },
4154
- {
4155
- "type": "null"
4156
- }
4157
- ],
4158
- "description": "The payment link the payment originated from, or null when the payment did not come from a payment link."
4268
+ "description": "The payment link the payment originated from, or null when the payment did not come from a payment link.",
4269
+ "type": [
4270
+ "string",
4271
+ "null"
4272
+ ]
4159
4273
  },
4160
4274
  "invoiceId": {
4161
- "anyOf": [
4162
- {
4163
- "type": "string"
4164
- },
4165
- {
4166
- "type": "null"
4167
- }
4168
- ],
4169
- "description": "The invoice the payment collected, or null for payments without an invoice."
4170
- },
4171
- "invoiceNumber": {
4172
- "anyOf": [
4173
- {
4174
- "type": "string"
4175
- },
4176
- {
4177
- "type": "null"
4178
- }
4179
- ],
4180
- "description": "The human-readable invoice number, if available."
4181
- },
4182
- "customerId": {
4183
- "anyOf": [
4184
- {
4185
- "type": "string"
4186
- },
4187
- {
4188
- "type": "null"
4189
- }
4190
- ],
4191
- "description": "The customer ID, when the payment is linked to an invoice. Returns your externalId if you provided one when creating the customer, otherwise returns the Commet publicId."
4275
+ "description": "The invoice the payment collected, or null for payments without an invoice.",
4276
+ "type": [
4277
+ "string",
4278
+ "null"
4279
+ ]
4280
+ },
4281
+ "invoiceNumber": {
4282
+ "description": "The human-readable invoice number, if available.",
4283
+ "type": [
4284
+ "string",
4285
+ "null"
4286
+ ]
4287
+ },
4288
+ "customerId": {
4289
+ "description": "The customer ID, when the payment is linked to an invoice. Returns your externalId if you provided one when creating the customer, otherwise returns the Commet publicId.",
4290
+ "type": [
4291
+ "string",
4292
+ "null"
4293
+ ]
4192
4294
  },
4193
4295
  "subscriptionId": {
4194
- "anyOf": [
4195
- {
4196
- "type": "string"
4197
- },
4198
- {
4199
- "type": "null"
4200
- }
4201
- ],
4202
- "description": "The subscription ID, if the invoice is linked to a subscription."
4296
+ "description": "The subscription ID, if the invoice is linked to a subscription.",
4297
+ "type": [
4298
+ "string",
4299
+ "null"
4300
+ ]
4203
4301
  },
4204
4302
  "disputeAmount": {
4205
4303
  "type": "number",
@@ -4210,15 +4308,11 @@
4210
4308
  "description": "The dispute currency code."
4211
4309
  },
4212
4310
  "disputeReason": {
4213
- "anyOf": [
4214
- {
4215
- "type": "string"
4216
- },
4217
- {
4218
- "type": "null"
4219
- }
4220
- ],
4221
- "description": "The provider's reason code (e.g. fraudulent, product_not_received), or null when none is given."
4311
+ "description": "The provider's reason code (e.g. fraudulent, product_not_received), or null when none is given.",
4312
+ "type": [
4313
+ "string",
4314
+ "null"
4315
+ ]
4222
4316
  }
4223
4317
  },
4224
4318
  "required": [
@@ -4339,59 +4433,39 @@
4339
4433
  "description": "The payment provider the charge was routed to: stripe, commet, or dlocal."
4340
4434
  },
4341
4435
  "paymentLinkId": {
4342
- "anyOf": [
4343
- {
4344
- "type": "string"
4345
- },
4346
- {
4347
- "type": "null"
4348
- }
4349
- ],
4350
- "description": "The payment link the payment originated from, or null when the payment did not come from a payment link."
4436
+ "description": "The payment link the payment originated from, or null when the payment did not come from a payment link.",
4437
+ "type": [
4438
+ "string",
4439
+ "null"
4440
+ ]
4351
4441
  },
4352
4442
  "invoiceId": {
4353
- "anyOf": [
4354
- {
4355
- "type": "string"
4356
- },
4357
- {
4358
- "type": "null"
4359
- }
4360
- ],
4361
- "description": "The invoice the payment collected, or null for payments without an invoice."
4443
+ "description": "The invoice the payment collected, or null for payments without an invoice.",
4444
+ "type": [
4445
+ "string",
4446
+ "null"
4447
+ ]
4362
4448
  },
4363
4449
  "invoiceNumber": {
4364
- "anyOf": [
4365
- {
4366
- "type": "string"
4367
- },
4368
- {
4369
- "type": "null"
4370
- }
4371
- ],
4372
- "description": "The human-readable invoice number, if available."
4450
+ "description": "The human-readable invoice number, if available.",
4451
+ "type": [
4452
+ "string",
4453
+ "null"
4454
+ ]
4373
4455
  },
4374
4456
  "customerId": {
4375
- "anyOf": [
4376
- {
4377
- "type": "string"
4378
- },
4379
- {
4380
- "type": "null"
4381
- }
4382
- ],
4383
- "description": "The customer ID, when the payment is linked to an invoice. Returns your externalId if you provided one when creating the customer, otherwise returns the Commet publicId."
4457
+ "description": "The customer ID, when the payment is linked to an invoice. Returns your externalId if you provided one when creating the customer, otherwise returns the Commet publicId.",
4458
+ "type": [
4459
+ "string",
4460
+ "null"
4461
+ ]
4384
4462
  },
4385
4463
  "subscriptionId": {
4386
- "anyOf": [
4387
- {
4388
- "type": "string"
4389
- },
4390
- {
4391
- "type": "null"
4392
- }
4393
- ],
4394
- "description": "The subscription ID, if the invoice is linked to a subscription."
4464
+ "description": "The subscription ID, if the invoice is linked to a subscription.",
4465
+ "type": [
4466
+ "string",
4467
+ "null"
4468
+ ]
4395
4469
  },
4396
4470
  "disputeAmount": {
4397
4471
  "type": "number",
@@ -4402,15 +4476,11 @@
4402
4476
  "description": "The dispute currency code."
4403
4477
  },
4404
4478
  "disputeReason": {
4405
- "anyOf": [
4406
- {
4407
- "type": "string"
4408
- },
4409
- {
4410
- "type": "null"
4411
- }
4412
- ],
4413
- "description": "The provider's reason code, or null when none is given."
4479
+ "description": "The provider's reason code, or null when none is given.",
4480
+ "type": [
4481
+ "string",
4482
+ "null"
4483
+ ]
4414
4484
  },
4415
4485
  "outcome": {
4416
4486
  "type": "string",
@@ -4544,15 +4614,11 @@
4544
4614
  "description": "The payment description shown to the customer."
4545
4615
  },
4546
4616
  "customerId": {
4547
- "anyOf": [
4548
- {
4549
- "type": "string"
4550
- },
4551
- {
4552
- "type": "null"
4553
- }
4554
- ],
4555
- "description": "The customer ID, or null when the link is not tied to a customer. Returns your externalId if you provided one when creating the customer, otherwise returns the Commet publicId."
4617
+ "description": "The customer ID, or null when the link is not tied to a customer. Returns your externalId if you provided one when creating the customer, otherwise returns the Commet publicId.",
4618
+ "type": [
4619
+ "string",
4620
+ "null"
4621
+ ]
4556
4622
  }
4557
4623
  },
4558
4624
  "required": [
@@ -4674,15 +4740,11 @@
4674
4740
  "description": "The original reason for the charge. Recovery never replaces this reason."
4675
4741
  },
4676
4742
  "paymentLinkId": {
4677
- "anyOf": [
4678
- {
4679
- "type": "string"
4680
- },
4681
- {
4682
- "type": "null"
4683
- }
4684
- ],
4685
- "description": "The public payment link ID, independently of the reason, or null when no payment link originated the charge."
4743
+ "description": "The public payment link ID, independently of the reason, or null when no payment link originated the charge.",
4744
+ "type": [
4745
+ "string",
4746
+ "null"
4747
+ ]
4686
4748
  },
4687
4749
  "recovery": {
4688
4750
  "anyOf": [
@@ -4770,15 +4832,11 @@
4770
4832
  "description": "The payment description shown to the customer."
4771
4833
  },
4772
4834
  "customerId": {
4773
- "anyOf": [
4774
- {
4775
- "type": "string"
4776
- },
4777
- {
4778
- "type": "null"
4779
- }
4780
- ],
4781
- "description": "The customer ID, or null when the link is not tied to a customer. Returns your externalId if you provided one when creating the customer, otherwise returns the Commet publicId."
4835
+ "description": "The customer ID, or null when the link is not tied to a customer. Returns your externalId if you provided one when creating the customer, otherwise returns the Commet publicId.",
4836
+ "type": [
4837
+ "string",
4838
+ "null"
4839
+ ]
4782
4840
  },
4783
4841
  "invoiceId": {
4784
4842
  "type": "string",
@@ -4789,15 +4847,11 @@
4789
4847
  "description": "The human-readable invoice number."
4790
4848
  },
4791
4849
  "paymentTransactionId": {
4792
- "anyOf": [
4793
- {
4794
- "type": "string"
4795
- },
4796
- {
4797
- "type": "null"
4798
- }
4799
- ],
4800
- "description": "The payment transaction ID for the settled charge."
4850
+ "description": "The payment transaction ID for the settled charge.",
4851
+ "type": [
4852
+ "string",
4853
+ "null"
4854
+ ]
4801
4855
  },
4802
4856
  "paymentMethod": {
4803
4857
  "anyOf": [
@@ -4957,15 +5011,11 @@
4957
5011
  "description": "The original reason for the charge. Recovery never replaces this reason."
4958
5012
  },
4959
5013
  "paymentLinkId": {
4960
- "anyOf": [
4961
- {
4962
- "type": "string"
4963
- },
4964
- {
4965
- "type": "null"
4966
- }
4967
- ],
4968
- "description": "The public payment link ID, independently of the reason, or null when no payment link originated the charge."
5014
+ "description": "The public payment link ID, independently of the reason, or null when no payment link originated the charge.",
5015
+ "type": [
5016
+ "string",
5017
+ "null"
5018
+ ]
4969
5019
  },
4970
5020
  "recovery": {
4971
5021
  "anyOf": [
@@ -5053,15 +5103,11 @@
5053
5103
  "description": "The payment description shown to the customer."
5054
5104
  },
5055
5105
  "customerId": {
5056
- "anyOf": [
5057
- {
5058
- "type": "string"
5059
- },
5060
- {
5061
- "type": "null"
5062
- }
5063
- ],
5064
- "description": "The customer ID, or null when the link is not tied to a customer. Returns your externalId if you provided one when creating the customer, otherwise returns the Commet publicId."
5106
+ "description": "The customer ID, or null when the link is not tied to a customer. Returns your externalId if you provided one when creating the customer, otherwise returns the Commet publicId.",
5107
+ "type": [
5108
+ "string",
5109
+ "null"
5110
+ ]
5065
5111
  },
5066
5112
  "failureCode": {
5067
5113
  "type": "string",
@@ -5225,15 +5271,11 @@
5225
5271
  "description": "The payment description shown to the customer."
5226
5272
  },
5227
5273
  "customerId": {
5228
- "anyOf": [
5229
- {
5230
- "type": "string"
5231
- },
5232
- {
5233
- "type": "null"
5234
- }
5235
- ],
5236
- "description": "The customer ID, or null when the link is not tied to a customer. Returns your externalId if you provided one when creating the customer, otherwise returns the Commet publicId."
5274
+ "description": "The customer ID, or null when the link is not tied to a customer. Returns your externalId if you provided one when creating the customer, otherwise returns the Commet publicId.",
5275
+ "type": [
5276
+ "string",
5277
+ "null"
5278
+ ]
5237
5279
  }
5238
5280
  },
5239
5281
  "required": [
@@ -5377,15 +5419,11 @@
5377
5419
  "description": "The customer ID. Returns your externalId if you provided one when creating the customer, otherwise returns the Commet publicId."
5378
5420
  },
5379
5421
  "subscriptionId": {
5380
- "anyOf": [
5381
- {
5382
- "type": "string"
5383
- },
5384
- {
5385
- "type": "null"
5386
- }
5387
- ],
5388
- "description": "The subscription ID, if the invoice is linked to a subscription."
5422
+ "description": "The subscription ID, if the invoice is linked to a subscription.",
5423
+ "type": [
5424
+ "string",
5425
+ "null"
5426
+ ]
5389
5427
  }
5390
5428
  },
5391
5429
  "required": [
@@ -5541,15 +5579,11 @@
5541
5579
  "description": "The customer ID. Returns your externalId if you provided one when creating the customer, otherwise returns the Commet publicId."
5542
5580
  },
5543
5581
  "subscriptionId": {
5544
- "anyOf": [
5545
- {
5546
- "type": "string"
5547
- },
5548
- {
5549
- "type": "null"
5550
- }
5551
- ],
5552
- "description": "The subscription ID, if the invoice is linked to a subscription."
5582
+ "description": "The subscription ID, if the invoice is linked to a subscription.",
5583
+ "type": [
5584
+ "string",
5585
+ "null"
5586
+ ]
5553
5587
  }
5554
5588
  },
5555
5589
  "required": [
@@ -5705,15 +5739,11 @@
5705
5739
  "description": "The customer ID. Returns your externalId if you provided one when creating the customer, otherwise returns the Commet publicId."
5706
5740
  },
5707
5741
  "subscriptionId": {
5708
- "anyOf": [
5709
- {
5710
- "type": "string"
5711
- },
5712
- {
5713
- "type": "null"
5714
- }
5715
- ],
5716
- "description": "The subscription ID, if the invoice is linked to a subscription."
5742
+ "description": "The subscription ID, if the invoice is linked to a subscription.",
5743
+ "type": [
5744
+ "string",
5745
+ "null"
5746
+ ]
5717
5747
  }
5718
5748
  },
5719
5749
  "required": [
@@ -5845,15 +5875,11 @@
5845
5875
  "description": "The plan name."
5846
5876
  },
5847
5877
  "billingInterval": {
5848
- "anyOf": [
5849
- {
5850
- "type": "string"
5851
- },
5852
- {
5853
- "type": "null"
5854
- }
5855
- ],
5856
- "description": "The billing interval (monthly, yearly)."
5878
+ "description": "The billing interval (monthly, yearly).",
5879
+ "type": [
5880
+ "string",
5881
+ "null"
5882
+ ]
5857
5883
  },
5858
5884
  "currentPeriodEnd": {
5859
5885
  "type": "string",
@@ -6042,14 +6068,131 @@
6042
6068
  "description": "A payment method was saved for a customer's subscription.",
6043
6069
  "playground": "none"
6044
6070
  },
6045
- "content": "## When this fires\n\nFired when Commet records a payment method for a subscription: after a paid checkout, when a trial starts with a card on file, or when a zero-total checkout completes with a saved payment method.\n\nThe `card` object carries display metadata only — brand, last 4 digits, and expiration. Full card numbers never leave the payment provider. When the saved method is not a card or its details cannot be retrieved, `card` is `null`.\n\n`paymentMethod` identifies the saved instrument (`card` or `mercado_pago`; OXXO never leaves a saved instrument). A `null` `card` object does not identify its type.\n\nUse it to show the saved card in your own billing UI or confirm to the customer that their payment method is on file."
6071
+ "content": "## When this fires\n\nFired when Commet records a payment method for a subscription: after a paid checkout, when a trial starts with a card on file, or when a zero-total checkout completes with a saved payment method.\n\nThe `card` object carries display metadata only — brand, last 4 digits, and expiration. Full card numbers never leave the payment provider. When the saved method is not a card or its details cannot be retrieved, `card` is `null`.\n\n`paymentMethod` identifies the saved instrument (`card` or `mercado_pago`; OXXO never leaves a saved instrument). A `null` `card` object does not identify its type.\n\nUse it to show the saved card in your own billing UI or confirm to the customer that their payment method is on file."
6072
+ }
6073
+ }
6074
+ },
6075
+ "payment_method.updated": {
6076
+ "post": {
6077
+ "summary": "payment_method.updated",
6078
+ "description": "Fired when a customer replaces their default payment method through the customer portal. The new method applies to all of the customer's subscriptions. A payment method update is also a strong recovery signal for past-due subscriptions.",
6079
+ "tags": [
6080
+ "Webhooks"
6081
+ ],
6082
+ "requestBody": {
6083
+ "required": true,
6084
+ "content": {
6085
+ "application/json": {
6086
+ "schema": {
6087
+ "type": "object",
6088
+ "properties": {
6089
+ "id": {
6090
+ "type": "string"
6091
+ },
6092
+ "event": {
6093
+ "type": "string",
6094
+ "const": "payment_method.updated"
6095
+ },
6096
+ "timestamp": {
6097
+ "type": "string"
6098
+ },
6099
+ "organizationId": {
6100
+ "type": "string"
6101
+ },
6102
+ "mode": {
6103
+ "type": "string",
6104
+ "enum": [
6105
+ "live",
6106
+ "sandbox"
6107
+ ]
6108
+ },
6109
+ "apiVersion": {
6110
+ "type": "string"
6111
+ },
6112
+ "data": {
6113
+ "type": "object",
6114
+ "properties": {
6115
+ "customerId": {
6116
+ "type": "string",
6117
+ "description": "The customer ID. Returns your externalId if you provided one when creating the customer, otherwise returns the Commet publicId."
6118
+ },
6119
+ "paymentMethod": {
6120
+ "anyOf": [
6121
+ {
6122
+ "$ref": "#/components/schemas/PaymentMethod"
6123
+ },
6124
+ {
6125
+ "type": "null"
6126
+ }
6127
+ ],
6128
+ "description": "The payment method: card, oxxo, or mercado_pago. Null when unknown."
6129
+ },
6130
+ "card": {
6131
+ "anyOf": [
6132
+ {
6133
+ "$ref": "#/components/schemas/WebhookCardInfo"
6134
+ },
6135
+ {
6136
+ "type": "null"
6137
+ }
6138
+ ],
6139
+ "description": "Card display metadata for the new method: brand, last4, expMonth, expYear. Null when the method is not a card or its details cannot be retrieved."
6140
+ }
6141
+ },
6142
+ "required": [
6143
+ "customerId",
6144
+ "paymentMethod",
6145
+ "card"
6146
+ ],
6147
+ "additionalProperties": false
6148
+ }
6149
+ },
6150
+ "required": [
6151
+ "id",
6152
+ "event",
6153
+ "timestamp",
6154
+ "organizationId",
6155
+ "mode",
6156
+ "apiVersion",
6157
+ "data"
6158
+ ],
6159
+ "additionalProperties": false
6160
+ },
6161
+ "example": {
6162
+ "event": "payment_method.updated",
6163
+ "timestamp": "2026-06-23T14:30:00.000Z",
6164
+ "organizationId": "8f14e45f-ceea-4e7a-9c3d-1c2b3a4d5e6f",
6165
+ "mode": "live",
6166
+ "apiVersion": "2026-08-27",
6167
+ "data": {
6168
+ "customerId": "user_123",
6169
+ "paymentMethod": "mercado_pago",
6170
+ "card": null
6171
+ }
6172
+ }
6173
+ }
6174
+ }
6175
+ },
6176
+ "responses": {
6177
+ "200": {
6178
+ "description": "Return any 2xx status code to acknowledge receipt of the event."
6179
+ }
6180
+ },
6181
+ "x-mint": {
6182
+ "href": "/webhooks/payment-method-updated",
6183
+ "metadata": {
6184
+ "title": "payment_method.updated",
6185
+ "description": "A customer's default payment method was replaced.",
6186
+ "playground": "none"
6187
+ },
6188
+ "content": "## When this fires\n\nFired when a customer replaces their default payment method through the customer portal. The new method applies to all of the customer's subscriptions.\n\nThe `card` object carries display metadata only — brand, last 4 digits, and expiration. Full card numbers never leave the payment provider. When the new method is not a card or its details cannot be retrieved, `card` is `null`.\n\n`paymentMethod` identifies the newly saved instrument (`card` or `mercado_pago`; OXXO never leaves a saved instrument). It does not describe which method paid an earlier transaction.\n\nUse it to refresh the card shown in your billing UI. A payment method update is also a strong recovery signal for past-due subscriptions — the customer typically updates their card to fix a failed payment."
6046
6189
  }
6047
6190
  }
6048
6191
  },
6049
- "payment_method.updated": {
6192
+ "payment_method.detached": {
6050
6193
  "post": {
6051
- "summary": "payment_method.updated",
6052
- "description": "Fired when a customer replaces their default payment method through the customer portal. The new method applies to all of the customer's subscriptions. A payment method update is also a strong recovery signal for past-due subscriptions.",
6194
+ "summary": "payment_method.detached",
6195
+ "description": "Fired when a saved payment method is removed from a customer: the customer unlinked it at the payment provider (for example, revoking a Mercado Pago authorization), or removed it through the customer portal. Removing a method never changes the customer's subscriptions; a renewal that finds no usable method follows the usual failed-payment recovery.",
6053
6196
  "tags": [
6054
6197
  "Webhooks"
6055
6198
  ],
@@ -6065,7 +6208,7 @@
6065
6208
  },
6066
6209
  "event": {
6067
6210
  "type": "string",
6068
- "const": "payment_method.updated"
6211
+ "const": "payment_method.detached"
6069
6212
  },
6070
6213
  "timestamp": {
6071
6214
  "type": "string"
@@ -6110,13 +6253,22 @@
6110
6253
  "type": "null"
6111
6254
  }
6112
6255
  ],
6113
- "description": "Card display metadata for the new method: brand, last4, expMonth, expYear. Null when the method is not a card or its details cannot be retrieved."
6256
+ "description": "Card display metadata of the removed method: brand, last4, expMonth, expYear. Null when the method is not a card or its details cannot be retrieved."
6257
+ },
6258
+ "reason": {
6259
+ "type": "string",
6260
+ "enum": [
6261
+ "unlinked_at_provider",
6262
+ "removed_by_customer"
6263
+ ],
6264
+ "description": "Why the method was removed: `unlinked_at_provider` when the customer revoked it at the payment provider, `removed_by_customer` when the customer removed it through the customer portal."
6114
6265
  }
6115
6266
  },
6116
6267
  "required": [
6117
6268
  "customerId",
6118
6269
  "paymentMethod",
6119
- "card"
6270
+ "card",
6271
+ "reason"
6120
6272
  ],
6121
6273
  "additionalProperties": false
6122
6274
  }
@@ -6133,7 +6285,7 @@
6133
6285
  "additionalProperties": false
6134
6286
  },
6135
6287
  "example": {
6136
- "event": "payment_method.updated",
6288
+ "event": "payment_method.detached",
6137
6289
  "timestamp": "2026-06-23T14:30:00.000Z",
6138
6290
  "organizationId": "8f14e45f-ceea-4e7a-9c3d-1c2b3a4d5e6f",
6139
6291
  "mode": "live",
@@ -6141,7 +6293,8 @@
6141
6293
  "data": {
6142
6294
  "customerId": "user_123",
6143
6295
  "paymentMethod": "mercado_pago",
6144
- "card": null
6296
+ "card": null,
6297
+ "reason": "unlinked_at_provider"
6145
6298
  }
6146
6299
  }
6147
6300
  }
@@ -6153,13 +6306,10 @@
6153
6306
  }
6154
6307
  },
6155
6308
  "x-mint": {
6156
- "href": "/webhooks/payment-method-updated",
6309
+ "href": "/webhooks/payment-method-detached",
6157
6310
  "metadata": {
6158
- "title": "payment_method.updated",
6159
- "description": "A customer's default payment method was replaced.",
6160
6311
  "playground": "none"
6161
- },
6162
- "content": "## When this fires\n\nFired when a customer replaces their default payment method through the customer portal. The new method applies to all of the customer's subscriptions.\n\nThe `card` object carries display metadata only — brand, last 4 digits, and expiration. Full card numbers never leave the payment provider. When the new method is not a card or its details cannot be retrieved, `card` is `null`.\n\n`paymentMethod` identifies the newly saved instrument (`card` or `mercado_pago`; OXXO never leaves a saved instrument). It does not describe which method paid an earlier transaction.\n\nUse it to refresh the card shown in your billing UI. A payment method update is also a strong recovery signal for past-due subscriptions — the customer typically updates their card to fix a failed payment."
6312
+ }
6163
6313
  }
6164
6314
  }
6165
6315
  },
@@ -6208,63 +6358,74 @@
6208
6358
  "description": "The Commet customer ID (cus_...)."
6209
6359
  },
6210
6360
  "externalId": {
6211
- "anyOf": [
6212
- {
6213
- "type": "string"
6214
- },
6215
- {
6216
- "type": "null"
6217
- }
6218
- ],
6219
- "description": "Your own identifier for this customer, if you provided one."
6361
+ "description": "Your own identifier for this customer, if you provided one.",
6362
+ "type": [
6363
+ "string",
6364
+ "null"
6365
+ ]
6220
6366
  },
6221
6367
  "fullName": {
6222
- "anyOf": [
6223
- {
6224
- "type": "string"
6225
- },
6226
- {
6227
- "type": "null"
6228
- }
6229
- ],
6230
- "description": "The customer's full name."
6368
+ "description": "The customer's full name.",
6369
+ "type": [
6370
+ "string",
6371
+ "null"
6372
+ ]
6231
6373
  },
6232
6374
  "email": {
6233
6375
  "type": "string",
6234
6376
  "description": "The customer's email."
6235
6377
  },
6236
6378
  "taxDocument": {
6237
- "anyOf": [
6238
- {
6239
- "type": "string"
6240
- },
6241
- {
6242
- "type": "null"
6243
- }
6244
- ],
6245
- "description": "The customer's tax identification number, if provided."
6379
+ "description": "The customer's tax identification number, if provided.",
6380
+ "type": [
6381
+ "string",
6382
+ "null"
6383
+ ]
6246
6384
  },
6247
6385
  "documentType": {
6386
+ "description": "The local tax document type label inferred from the customer's country (e.g. CUIT, RFC, RUT), or null when no tax document was provided.",
6387
+ "type": [
6388
+ "string",
6389
+ "null"
6390
+ ]
6391
+ },
6392
+ "businessTaxId": {
6248
6393
  "anyOf": [
6249
6394
  {
6250
- "type": "string"
6395
+ "type": "object",
6396
+ "properties": {
6397
+ "country": {
6398
+ "type": "string",
6399
+ "description": "ISO-2 country the tax ID belongs to."
6400
+ },
6401
+ "type": {
6402
+ "type": "string",
6403
+ "description": "Tax ID type (e.g. eu_vat, pe_ruc)."
6404
+ },
6405
+ "value": {
6406
+ "type": "string",
6407
+ "description": "The normalized tax ID."
6408
+ }
6409
+ },
6410
+ "required": [
6411
+ "country",
6412
+ "type",
6413
+ "value"
6414
+ ],
6415
+ "additionalProperties": false
6251
6416
  },
6252
6417
  {
6253
6418
  "type": "null"
6254
6419
  }
6255
6420
  ],
6256
- "description": "The local tax document type label inferred from the customer's country (e.g. CUIT, RFC, RUT), or null when no tax document was provided."
6421
+ "description": "The business tax ID saved for the customer (EU VAT number, Peruvian RUC), or null when the customer has none."
6257
6422
  },
6258
6423
  "timezone": {
6259
- "anyOf": [
6260
- {
6261
- "type": "string"
6262
- },
6263
- {
6264
- "type": "null"
6265
- }
6266
- ],
6267
- "description": "The customer's timezone."
6424
+ "description": "The customer's timezone.",
6425
+ "type": [
6426
+ "string",
6427
+ "null"
6428
+ ]
6268
6429
  },
6269
6430
  "metadata": {
6270
6431
  "anyOf": [
@@ -6297,6 +6458,7 @@
6297
6458
  "email",
6298
6459
  "taxDocument",
6299
6460
  "documentType",
6461
+ "businessTaxId",
6300
6462
  "timezone",
6301
6463
  "metadata",
6302
6464
  "createdAt",
@@ -6329,6 +6491,7 @@
6329
6491
  "email": "ada@acme.com",
6330
6492
  "taxDocument": "20-12345678-9",
6331
6493
  "documentType": "CUIT",
6494
+ "businessTaxId": null,
6332
6495
  "timezone": "UTC",
6333
6496
  "metadata": {
6334
6497
  "plan_intent": "pro"
@@ -6401,63 +6564,74 @@
6401
6564
  "description": "The Commet customer ID (cus_...)."
6402
6565
  },
6403
6566
  "externalId": {
6404
- "anyOf": [
6405
- {
6406
- "type": "string"
6407
- },
6408
- {
6409
- "type": "null"
6410
- }
6411
- ],
6412
- "description": "Your own identifier for this customer, if you provided one."
6567
+ "description": "Your own identifier for this customer, if you provided one.",
6568
+ "type": [
6569
+ "string",
6570
+ "null"
6571
+ ]
6413
6572
  },
6414
6573
  "fullName": {
6415
- "anyOf": [
6416
- {
6417
- "type": "string"
6418
- },
6419
- {
6420
- "type": "null"
6421
- }
6422
- ],
6423
- "description": "The customer's full name."
6574
+ "description": "The customer's full name.",
6575
+ "type": [
6576
+ "string",
6577
+ "null"
6578
+ ]
6424
6579
  },
6425
6580
  "email": {
6426
6581
  "type": "string",
6427
6582
  "description": "The customer's email."
6428
6583
  },
6429
6584
  "taxDocument": {
6430
- "anyOf": [
6431
- {
6432
- "type": "string"
6433
- },
6434
- {
6435
- "type": "null"
6436
- }
6437
- ],
6438
- "description": "The customer's tax identification number, if provided."
6585
+ "description": "The customer's tax identification number, if provided.",
6586
+ "type": [
6587
+ "string",
6588
+ "null"
6589
+ ]
6439
6590
  },
6440
6591
  "documentType": {
6592
+ "description": "The local tax document type label inferred from the customer's country (e.g. CUIT, RFC, RUT), or null when no tax document was provided.",
6593
+ "type": [
6594
+ "string",
6595
+ "null"
6596
+ ]
6597
+ },
6598
+ "businessTaxId": {
6441
6599
  "anyOf": [
6442
6600
  {
6443
- "type": "string"
6601
+ "type": "object",
6602
+ "properties": {
6603
+ "country": {
6604
+ "type": "string",
6605
+ "description": "ISO-2 country the tax ID belongs to."
6606
+ },
6607
+ "type": {
6608
+ "type": "string",
6609
+ "description": "Tax ID type (e.g. eu_vat, pe_ruc)."
6610
+ },
6611
+ "value": {
6612
+ "type": "string",
6613
+ "description": "The normalized tax ID."
6614
+ }
6615
+ },
6616
+ "required": [
6617
+ "country",
6618
+ "type",
6619
+ "value"
6620
+ ],
6621
+ "additionalProperties": false
6444
6622
  },
6445
6623
  {
6446
6624
  "type": "null"
6447
6625
  }
6448
6626
  ],
6449
- "description": "The local tax document type label inferred from the customer's country (e.g. CUIT, RFC, RUT), or null when no tax document was provided."
6627
+ "description": "The business tax ID saved for the customer (EU VAT number, Peruvian RUC), or null when the customer has none."
6450
6628
  },
6451
6629
  "timezone": {
6452
- "anyOf": [
6453
- {
6454
- "type": "string"
6455
- },
6456
- {
6457
- "type": "null"
6458
- }
6459
- ],
6460
- "description": "The customer's timezone."
6630
+ "description": "The customer's timezone.",
6631
+ "type": [
6632
+ "string",
6633
+ "null"
6634
+ ]
6461
6635
  },
6462
6636
  "metadata": {
6463
6637
  "anyOf": [
@@ -6490,6 +6664,7 @@
6490
6664
  "email",
6491
6665
  "taxDocument",
6492
6666
  "documentType",
6667
+ "businessTaxId",
6493
6668
  "timezone",
6494
6669
  "metadata",
6495
6670
  "createdAt",
@@ -6522,6 +6697,7 @@
6522
6697
  "email": "ada.lovelace@acme.com",
6523
6698
  "taxDocument": "20-12345678-9",
6524
6699
  "documentType": "CUIT",
6700
+ "businessTaxId": null,
6525
6701
  "timezone": "Europe/London",
6526
6702
  "metadata": {
6527
6703
  "plan_intent": "pro"
@@ -6602,15 +6778,11 @@
6602
6778
  "description": "The customer's current subscription status, or \"none\" when no live subscription exists. Access is granted while trialing, active, or past_due — past_due is a permissive grace window during dunning."
6603
6779
  },
6604
6780
  "subscriptionId": {
6605
- "anyOf": [
6606
- {
6607
- "type": "string"
6608
- },
6609
- {
6610
- "type": "null"
6611
- }
6612
- ],
6613
- "description": "The live subscription ID, or null when status is none."
6781
+ "description": "The live subscription ID, or null when status is none.",
6782
+ "type": [
6783
+ "string",
6784
+ "null"
6785
+ ]
6614
6786
  },
6615
6787
  "plan": {
6616
6788
  "anyOf": [
@@ -6624,26 +6796,18 @@
6624
6796
  "description": "The current plan (id and name), or null when status is none."
6625
6797
  },
6626
6798
  "billingInterval": {
6627
- "anyOf": [
6628
- {
6629
- "type": "string"
6630
- },
6631
- {
6632
- "type": "null"
6633
- }
6634
- ],
6635
- "description": "The current billing interval."
6799
+ "description": "The current billing interval.",
6800
+ "type": [
6801
+ "string",
6802
+ "null"
6803
+ ]
6636
6804
  },
6637
6805
  "consumptionModel": {
6638
- "anyOf": [
6639
- {
6640
- "type": "string"
6641
- },
6642
- {
6643
- "type": "null"
6644
- }
6645
- ],
6646
- "description": "The plan's consumption model: metered, credits, or balance."
6806
+ "description": "The plan's consumption model: metered, credits, or balance.",
6807
+ "type": [
6808
+ "string",
6809
+ "null"
6810
+ ]
6647
6811
  },
6648
6812
  "features": {
6649
6813
  "type": "array",
@@ -6661,15 +6825,11 @@
6661
6825
  "description": "Display name of the feature."
6662
6826
  },
6663
6827
  "unitName": {
6664
- "anyOf": [
6665
- {
6666
- "type": "string"
6667
- },
6668
- {
6669
- "type": "null"
6670
- }
6671
- ],
6672
- "description": "Display name for one product unit, or null when not applicable."
6828
+ "description": "Display name for one product unit, or null when not applicable.",
6829
+ "type": [
6830
+ "string",
6831
+ "null"
6832
+ ]
6673
6833
  },
6674
6834
  "allowed": {
6675
6835
  "type": "boolean",
@@ -6706,15 +6866,11 @@
6706
6866
  "description": "Display name of the feature."
6707
6867
  },
6708
6868
  "unitName": {
6709
- "anyOf": [
6710
- {
6711
- "type": "string"
6712
- },
6713
- {
6714
- "type": "null"
6715
- }
6716
- ],
6717
- "description": "Display name for one product unit, or null when not applicable."
6869
+ "description": "Display name for one product unit, or null when not applicable.",
6870
+ "type": [
6871
+ "string",
6872
+ "null"
6873
+ ]
6718
6874
  },
6719
6875
  "allowed": {
6720
6876
  "type": "boolean",
@@ -7009,15 +7165,11 @@
7009
7165
  "description": "Display name of the feature."
7010
7166
  },
7011
7167
  "unitName": {
7012
- "anyOf": [
7013
- {
7014
- "type": "string"
7015
- },
7016
- {
7017
- "type": "null"
7018
- }
7019
- ],
7020
- "description": "Display name for one product unit, or null when not applicable."
7168
+ "description": "Display name for one product unit, or null when not applicable.",
7169
+ "type": [
7170
+ "string",
7171
+ "null"
7172
+ ]
7021
7173
  },
7022
7174
  "allowed": {
7023
7175
  "type": "boolean",
@@ -7145,15 +7297,11 @@
7145
7297
  "description": "Display name of the feature."
7146
7298
  },
7147
7299
  "unitName": {
7148
- "anyOf": [
7149
- {
7150
- "type": "string"
7151
- },
7152
- {
7153
- "type": "null"
7154
- }
7155
- ],
7156
- "description": "Display name for one product unit, or null when not applicable."
7300
+ "description": "Display name for one product unit, or null when not applicable.",
7301
+ "type": [
7302
+ "string",
7303
+ "null"
7304
+ ]
7157
7305
  },
7158
7306
  "allowed": {
7159
7307
  "type": "boolean",
@@ -7305,7 +7453,7 @@
7305
7453
  "type": "null"
7306
7454
  }
7307
7455
  ],
7308
- "description": "For balance plans: currentBalance in rate scale (10000 = $1.00). Null otherwise."
7456
+ "description": "For balance plans, in rate scale (10000 = 1.00 of the subscription currency): currentBalance (the available total), planBalance, purchasedBalance and totalBalance. Null otherwise."
7309
7457
  }
7310
7458
  },
7311
7459
  "required": [
@@ -8457,7 +8605,7 @@
8457
8605
  "credits.granted": {
8458
8606
  "post": {
8459
8607
  "summary": "credits.granted",
8460
- "description": "Fired when non-purchase credits are granted to a subscription: plan-included credits at the start of each billing period, or a manual adjustment from the dashboard. Credit pack purchases fire credits.purchased instead.",
8608
+ "description": "Fired when non-purchase credits are granted to a subscription: plan-included credits at the start of each billing period, or a manual adjustment from the dashboard. Credit purchases through the API, automatic top-ups, or the customer portal fire credits.purchased instead.",
8461
8609
  "tags": [
8462
8610
  "Webhooks"
8463
8611
  ],
@@ -8559,14 +8707,14 @@
8559
8707
  "description": "Non-purchase credits were granted to a subscription.",
8560
8708
  "playground": "none"
8561
8709
  },
8562
- "content": "## When this fires\n\nPlan-included credits are granted at the start of every billing period (`reason: \"period_reset\"`), and manual adjustments from the dashboard grant purchased credits (`reason: \"manual_adjustment\"`). Credit pack purchases are a separate flow and fire `credits.purchased` instead.\n\nThe idempotency key is derived from the billing operation that granted the credits, so engine retries never send a duplicate.\n\nUse it to reset in-app usage meters at the start of a period or to confirm a support-driven credit grant reached the customer."
8710
+ "content": "## When this fires\n\nPlan-included credits are granted at the start of every billing period (`reason: \"period_reset\"`), and manual adjustments from the dashboard grant purchased credits (`reason: \"manual_adjustment\"`). Purchases through the API, automatic top-ups, or the customer portal fire `credits.purchased` instead.\n\nThe idempotency key is derived from the billing operation that granted the credits, so engine retries never send a duplicate.\n\nUse it to reset in-app usage meters at the start of a period or to confirm a support-driven credit grant reached the customer."
8563
8711
  }
8564
8712
  }
8565
8713
  },
8566
8714
  "credits.purchased": {
8567
8715
  "post": {
8568
8716
  "summary": "credits.purchased",
8569
- "description": "Fired when a customer buys a credit pack through the customer portal and the payment succeeds. Purchased credits never expire — unlike plan credits, they survive period resets. Plan-included credit grants fire credits.granted instead.",
8717
+ "description": "Fired when a customer buys a credit pack or a chosen quantity of credits through the API, an automatic top-up, or the customer portal and the payment succeeds. Purchased credits never expire — unlike plan credits, they survive period resets. Plan-included credit grants fire credits.granted instead.",
8570
8718
  "tags": [
8571
8719
  "Webhooks"
8572
8720
  ],
@@ -8621,7 +8769,7 @@
8621
8769
  },
8622
8770
  "creditPackName": {
8623
8771
  "type": "string",
8624
- "description": "The purchased credit pack's name."
8772
+ "description": "The purchased credit pack's name, or Credit purchase for a chosen quantity of credits."
8625
8773
  },
8626
8774
  "credits": {
8627
8775
  "type": "number",
@@ -8674,20 +8822,135 @@
8674
8822
  }
8675
8823
  },
8676
8824
  "x-mint": {
8677
- "href": "/webhooks/credits-purchased",
8825
+ "href": "/webhooks/credits-purchased",
8826
+ "metadata": {
8827
+ "title": "credits.purchased",
8828
+ "description": "A credit pack or a chosen quantity of credits was purchased.",
8829
+ "playground": "none"
8830
+ },
8831
+ "content": "## When this fires\n\nWhen a customer buys a credit pack or a chosen quantity of credits through the API, an automatic top-up, or the customer portal, and the payment succeeds. Purchased credits never expire — unlike plan credits, they survive period resets.\n\nPlan-included credits granted at each period reset fire `credits.granted` instead.\n\nUse it to confirm top-up purchases in your own UI or analytics."
8832
+ }
8833
+ }
8834
+ },
8835
+ "credits.low": {
8836
+ "post": {
8837
+ "summary": "credits.low",
8838
+ "description": "Fired when a subscription's available credits (plan plus purchased) cross below 10% of their last refill: a period reset, a purchase or a manual adjustment. Emitted once per crossing, the same rule as balance.low.",
8839
+ "tags": [
8840
+ "Webhooks"
8841
+ ],
8842
+ "requestBody": {
8843
+ "required": true,
8844
+ "content": {
8845
+ "application/json": {
8846
+ "schema": {
8847
+ "type": "object",
8848
+ "properties": {
8849
+ "id": {
8850
+ "type": "string"
8851
+ },
8852
+ "event": {
8853
+ "type": "string",
8854
+ "const": "credits.low"
8855
+ },
8856
+ "timestamp": {
8857
+ "type": "string"
8858
+ },
8859
+ "organizationId": {
8860
+ "type": "string"
8861
+ },
8862
+ "mode": {
8863
+ "type": "string",
8864
+ "enum": [
8865
+ "live",
8866
+ "sandbox"
8867
+ ]
8868
+ },
8869
+ "apiVersion": {
8870
+ "type": "string"
8871
+ },
8872
+ "data": {
8873
+ "type": "object",
8874
+ "properties": {
8875
+ "subscriptionId": {
8876
+ "type": "string",
8877
+ "description": "The subscription ID."
8878
+ },
8879
+ "customerId": {
8880
+ "type": "string",
8881
+ "description": "The customer ID. Returns your externalId if you provided one when creating the customer, otherwise returns the Commet publicId."
8882
+ },
8883
+ "remainingCredits": {
8884
+ "type": "number",
8885
+ "description": "Total credits remaining (plan plus purchased)."
8886
+ },
8887
+ "thresholdCredits": {
8888
+ "type": "number",
8889
+ "description": "The low-credit threshold that was crossed: 10% of the last refill."
8890
+ },
8891
+ "periodCredits": {
8892
+ "type": "number",
8893
+ "description": "The credits added by the last refill: a period reset, a purchase or a manual adjustment."
8894
+ }
8895
+ },
8896
+ "required": [
8897
+ "subscriptionId",
8898
+ "customerId",
8899
+ "remainingCredits",
8900
+ "thresholdCredits",
8901
+ "periodCredits"
8902
+ ],
8903
+ "additionalProperties": false
8904
+ }
8905
+ },
8906
+ "required": [
8907
+ "id",
8908
+ "event",
8909
+ "timestamp",
8910
+ "organizationId",
8911
+ "mode",
8912
+ "apiVersion",
8913
+ "data"
8914
+ ],
8915
+ "additionalProperties": false
8916
+ },
8917
+ "example": {
8918
+ "event": "credits.low",
8919
+ "timestamp": "2026-06-23T14:30:00.000Z",
8920
+ "organizationId": "8f14e45f-ceea-4e7a-9c3d-1c2b3a4d5e6f",
8921
+ "mode": "live",
8922
+ "apiVersion": "2026-08-27",
8923
+ "data": {
8924
+ "subscriptionId": "sub_1a2b3c4d",
8925
+ "customerId": "user_123",
8926
+ "remainingCredits": 42,
8927
+ "thresholdCredits": 50,
8928
+ "periodCredits": 500
8929
+ }
8930
+ }
8931
+ }
8932
+ }
8933
+ },
8934
+ "responses": {
8935
+ "200": {
8936
+ "description": "Return any 2xx status code to acknowledge receipt of the event."
8937
+ }
8938
+ },
8939
+ "x-mint": {
8940
+ "href": "/webhooks/credits-low",
8678
8941
  "metadata": {
8679
- "title": "credits.purchased",
8680
- "description": "A credit pack purchase was completed.",
8942
+ "title": "credits.low",
8943
+ "description": "Remaining credits dropped below 10% of the period grant.",
8681
8944
  "playground": "none"
8682
8945
  },
8683
- "content": "## When this fires\n\nWhen a customer buys a credit pack through the customer portal and the payment succeeds. Purchased credits never expire — unlike plan credits, they survive period resets.\n\nPlan-included credits granted at each period reset fire `credits.granted` instead.\n\nUse it to confirm top-up purchases in your own UI or analytics."
8946
+ "content": "## When this fires\n\nThe async usage processor watches every credit deduction. When a batch of usage moves the remaining credits (plan plus purchased) from above to at-or-below 10% of the credits granted at the last period reset, this event fires once. It does not re-fire while the balance stays low, and the next period reset re-arms it.\n\nIf a single burst of usage jumps straight past zero, only `credits.depleted` fires.\n\nUse it to prompt the customer to buy a credit pack before they hit zero."
8684
8947
  }
8685
8948
  }
8686
8949
  },
8687
- "credits.low": {
8950
+ "credits.depleted": {
8688
8951
  "post": {
8689
- "summary": "credits.low",
8690
- "description": "Fired when a subscription's remaining credits cross below 10% of the credits granted for the current period. Emitted once per billing period, when the crossing happens.",
8952
+ "summary": "credits.depleted",
8953
+ "description": "Fired each time a subscription's available credits cross to zero or below. Usage that needs more credits than remain is rejected from this point, unless the plan allows overage, which is billed at its price per credit at the next renewal. Also fires customer.state_changed with trigger credits_depleted.",
8691
8954
  "tags": [
8692
8955
  "Webhooks"
8693
8956
  ],
@@ -8703,7 +8966,7 @@
8703
8966
  },
8704
8967
  "event": {
8705
8968
  "type": "string",
8706
- "const": "credits.low"
8969
+ "const": "credits.depleted"
8707
8970
  },
8708
8971
  "timestamp": {
8709
8972
  "type": "string"
@@ -8734,23 +8997,13 @@
8734
8997
  },
8735
8998
  "remainingCredits": {
8736
8999
  "type": "number",
8737
- "description": "Total credits remaining (plan plus purchased)."
8738
- },
8739
- "thresholdCredits": {
8740
- "type": "number",
8741
- "description": "The low-credit threshold that was crossed: 10% of the period's granted plan credits."
8742
- },
8743
- "periodCredits": {
8744
- "type": "number",
8745
- "description": "The plan credits granted at the last period reset."
9000
+ "description": "Credits remaining after depletion. Always 0."
8746
9001
  }
8747
9002
  },
8748
9003
  "required": [
8749
9004
  "subscriptionId",
8750
9005
  "customerId",
8751
- "remainingCredits",
8752
- "thresholdCredits",
8753
- "periodCredits"
9006
+ "remainingCredits"
8754
9007
  ],
8755
9008
  "additionalProperties": false
8756
9009
  }
@@ -8767,7 +9020,7 @@
8767
9020
  "additionalProperties": false
8768
9021
  },
8769
9022
  "example": {
8770
- "event": "credits.low",
9023
+ "event": "credits.depleted",
8771
9024
  "timestamp": "2026-06-23T14:30:00.000Z",
8772
9025
  "organizationId": "8f14e45f-ceea-4e7a-9c3d-1c2b3a4d5e6f",
8773
9026
  "mode": "live",
@@ -8775,9 +9028,7 @@
8775
9028
  "data": {
8776
9029
  "subscriptionId": "sub_1a2b3c4d",
8777
9030
  "customerId": "user_123",
8778
- "remainingCredits": 42,
8779
- "thresholdCredits": 50,
8780
- "periodCredits": 500
9031
+ "remainingCredits": 0
8781
9032
  }
8782
9033
  }
8783
9034
  }
@@ -8789,20 +9040,20 @@
8789
9040
  }
8790
9041
  },
8791
9042
  "x-mint": {
8792
- "href": "/webhooks/credits-low",
9043
+ "href": "/webhooks/credits-depleted",
8793
9044
  "metadata": {
8794
- "title": "credits.low",
8795
- "description": "Remaining credits dropped below 10% of the period grant.",
9045
+ "title": "credits.depleted",
9046
+ "description": "A subscription ran out of credits.",
8796
9047
  "playground": "none"
8797
9048
  },
8798
- "content": "## When this fires\n\nThe async usage processor watches every credit deduction. When a batch of usage moves the remaining credits (plan plus purchased) from above to at-or-below 10% of the credits granted at the last period reset, this event fires once. It does not re-fire while the balance stays low, and the next period reset re-arms it.\n\nIf a single burst of usage jumps straight past zero, only `credits.depleted` fires.\n\nUse it to prompt the customer to buy a credit pack before they hit zero."
9049
+ "content": "## When this fires\n\nThe async usage processor fires this once when a deduction moves the credit balance from positive to zero. From this point, usage requests that need more credits than remain are rejected with `insufficient_credits`.\n\n`customer.state_changed` fires alongside it with trigger `credits_depleted`, carrying the customer's full current entitlement state.\n\nUse it to block gated features in your app and drive the customer to a credit pack purchase."
8799
9050
  }
8800
9051
  }
8801
9052
  },
8802
- "credits.depleted": {
9053
+ "credits.expired": {
8803
9054
  "post": {
8804
- "summary": "credits.depleted",
8805
- "description": "Fired when a subscription's credits hit zero. Usage requests that need more credits than remain are rejected from this point. Also fires customer.state_changed with trigger credits_depleted.",
9055
+ "summary": "credits.expired",
9056
+ "description": "Fired at a reset when unused plan credits are discarded. On a plan whose unused plan credits expire, every unused plan credit expires at each reset. On a plan that rolls them over, a reset keeps them, up to the plan's maxPlanCredits when it has one, and only the excess expires. A change to another credits plan applies the new plan's terms the same way. Purchased credits never expire and are not affected.",
8806
9057
  "tags": [
8807
9058
  "Webhooks"
8808
9059
  ],
@@ -8818,7 +9069,7 @@
8818
9069
  },
8819
9070
  "event": {
8820
9071
  "type": "string",
8821
- "const": "credits.depleted"
9072
+ "const": "credits.expired"
8822
9073
  },
8823
9074
  "timestamp": {
8824
9075
  "type": "string"
@@ -8847,15 +9098,15 @@
8847
9098
  "type": "string",
8848
9099
  "description": "The customer ID. Returns your externalId if you provided one when creating the customer, otherwise returns the Commet publicId."
8849
9100
  },
8850
- "remainingCredits": {
9101
+ "expiredCredits": {
8851
9102
  "type": "number",
8852
- "description": "Credits remaining after depletion. Always 0."
9103
+ "description": "The plan credits that were discarded."
8853
9104
  }
8854
9105
  },
8855
9106
  "required": [
8856
9107
  "subscriptionId",
8857
9108
  "customerId",
8858
- "remainingCredits"
9109
+ "expiredCredits"
8859
9110
  ],
8860
9111
  "additionalProperties": false
8861
9112
  }
@@ -8872,7 +9123,7 @@
8872
9123
  "additionalProperties": false
8873
9124
  },
8874
9125
  "example": {
8875
- "event": "credits.depleted",
9126
+ "event": "credits.expired",
8876
9127
  "timestamp": "2026-06-23T14:30:00.000Z",
8877
9128
  "organizationId": "8f14e45f-ceea-4e7a-9c3d-1c2b3a4d5e6f",
8878
9129
  "mode": "live",
@@ -8880,7 +9131,7 @@
8880
9131
  "data": {
8881
9132
  "subscriptionId": "sub_1a2b3c4d",
8882
9133
  "customerId": "user_123",
8883
- "remainingCredits": 0
9134
+ "expiredCredits": 120
8884
9135
  }
8885
9136
  }
8886
9137
  }
@@ -8892,20 +9143,20 @@
8892
9143
  }
8893
9144
  },
8894
9145
  "x-mint": {
8895
- "href": "/webhooks/credits-depleted",
9146
+ "href": "/webhooks/credits-expired",
8896
9147
  "metadata": {
8897
- "title": "credits.depleted",
8898
- "description": "A subscription ran out of credits.",
9148
+ "title": "credits.expired",
9149
+ "description": "Unused plan credits expired at the period reset.",
8899
9150
  "playground": "none"
8900
9151
  },
8901
- "content": "## When this fires\n\nThe async usage processor fires this once when a deduction moves the credit balance from positive to zero. From this point, usage requests that need more credits than remain are rejected with `insufficient_credits`.\n\n`customer.state_changed` fires alongside it with trigger `credits_depleted`, carrying the customer's full current entitlement state.\n\nUse it to block gated features in your app and drive the customer to a credit pack purchase."
9152
+ "content": "## When this fires\n\nPlan credits expire at the end of each billing period: the period reset discards whatever remained and grants the new period's credits (which fires `credits.granted`). This event reports the discarded amount. Purchased credits never expire and are not affected.\n\nIt only fires when there was something to discard — a customer who used all plan credits gets no `credits.expired`.\n\nUse it for end-of-period usage summaries (\"you left 120 credits on the table\")."
8902
9153
  }
8903
9154
  }
8904
9155
  },
8905
- "credits.expired": {
9156
+ "balance.granted": {
8906
9157
  "post": {
8907
- "summary": "credits.expired",
8908
- "description": "Fired at the period reset when unused plan credits from the previous period are discarded. Plan credits expire at period end; purchased credits never expire and are not affected.",
9158
+ "summary": "balance.granted",
9159
+ "description": "Fired when non-purchase balance is granted to a subscription: the plan balance at the start of each billing period, or a manual adjustment from the dashboard or the API, which goes to the purchased balance. Balance top-ups fire balance.topped_up instead.",
8909
9160
  "tags": [
8910
9161
  "Webhooks"
8911
9162
  ],
@@ -8921,7 +9172,7 @@
8921
9172
  },
8922
9173
  "event": {
8923
9174
  "type": "string",
8924
- "const": "credits.expired"
9175
+ "const": "balance.granted"
8925
9176
  },
8926
9177
  "timestamp": {
8927
9178
  "type": "string"
@@ -8950,15 +9201,25 @@
8950
9201
  "type": "string",
8951
9202
  "description": "The customer ID. Returns your externalId if you provided one when creating the customer, otherwise returns the Commet publicId."
8952
9203
  },
8953
- "expiredCredits": {
9204
+ "amount": {
8954
9205
  "type": "number",
8955
- "description": "The unused plan credits that were discarded."
9206
+ "description": "The balance granted in rate scale (10000 = 1.00 of the subscription currency)."
9207
+ },
9208
+ "currency": {
9209
+ "type": "string",
9210
+ "description": "The subscription currency."
9211
+ },
9212
+ "reason": {
9213
+ "type": "string",
9214
+ "description": "Why the balance was granted: period_reset or manual_adjustment."
8956
9215
  }
8957
9216
  },
8958
9217
  "required": [
8959
9218
  "subscriptionId",
8960
9219
  "customerId",
8961
- "expiredCredits"
9220
+ "amount",
9221
+ "currency",
9222
+ "reason"
8962
9223
  ],
8963
9224
  "additionalProperties": false
8964
9225
  }
@@ -8975,7 +9236,7 @@
8975
9236
  "additionalProperties": false
8976
9237
  },
8977
9238
  "example": {
8978
- "event": "credits.expired",
9239
+ "event": "balance.granted",
8979
9240
  "timestamp": "2026-06-23T14:30:00.000Z",
8980
9241
  "organizationId": "8f14e45f-ceea-4e7a-9c3d-1c2b3a4d5e6f",
8981
9242
  "mode": "live",
@@ -8983,7 +9244,9 @@
8983
9244
  "data": {
8984
9245
  "subscriptionId": "sub_1a2b3c4d",
8985
9246
  "customerId": "user_123",
8986
- "expiredCredits": 120
9247
+ "amount": 100000,
9248
+ "currency": "usd",
9249
+ "reason": "period_reset"
8987
9250
  }
8988
9251
  }
8989
9252
  }
@@ -8995,20 +9258,17 @@
8995
9258
  }
8996
9259
  },
8997
9260
  "x-mint": {
8998
- "href": "/webhooks/credits-expired",
9261
+ "href": "/webhooks/balance-granted",
8999
9262
  "metadata": {
9000
- "title": "credits.expired",
9001
- "description": "Unused plan credits expired at the period reset.",
9002
9263
  "playground": "none"
9003
- },
9004
- "content": "## When this fires\n\nPlan credits expire at the end of each billing period: the period reset discards whatever remained and grants the new period's credits (which fires `credits.granted`). This event reports the discarded amount. Purchased credits never expire and are not affected.\n\nIt only fires when there was something to discard — a customer who used all plan credits gets no `credits.expired`.\n\nUse it for end-of-period usage summaries (\"you left 120 credits on the table\")."
9264
+ }
9005
9265
  }
9006
9266
  }
9007
9267
  },
9008
9268
  "balance.topped_up": {
9009
9269
  "post": {
9010
9270
  "summary": "balance.topped_up",
9011
- "description": "Fired when a customer on a balance plan tops up their prepaid balance through the customer portal and the payment succeeds.",
9271
+ "description": "Fired when a balance top-up succeeds: through the API, an automatic top-up or the customer portal. The amount goes to the purchased balance, which is spent after the plan balance and kept until the subscription ends.",
9012
9272
  "tags": [
9013
9273
  "Webhooks"
9014
9274
  ],
@@ -9350,6 +9610,112 @@
9350
9610
  }
9351
9611
  }
9352
9612
  },
9613
+ "balance.expired": {
9614
+ "post": {
9615
+ "summary": "balance.expired",
9616
+ "description": "Fired at a reset when unused plan balance is discarded. On a plan whose unused plan balance expires, all of it expires at each reset. On a plan that rolls it over, a reset keeps it, up to the plan's maxPlanBalance when it has one, and only the excess expires. An overage debt invoiced at the renewal counts as nothing left over. Purchased balance never expires and is not affected.",
9617
+ "tags": [
9618
+ "Webhooks"
9619
+ ],
9620
+ "requestBody": {
9621
+ "required": true,
9622
+ "content": {
9623
+ "application/json": {
9624
+ "schema": {
9625
+ "type": "object",
9626
+ "properties": {
9627
+ "id": {
9628
+ "type": "string"
9629
+ },
9630
+ "event": {
9631
+ "type": "string",
9632
+ "const": "balance.expired"
9633
+ },
9634
+ "timestamp": {
9635
+ "type": "string"
9636
+ },
9637
+ "organizationId": {
9638
+ "type": "string"
9639
+ },
9640
+ "mode": {
9641
+ "type": "string",
9642
+ "enum": [
9643
+ "live",
9644
+ "sandbox"
9645
+ ]
9646
+ },
9647
+ "apiVersion": {
9648
+ "type": "string"
9649
+ },
9650
+ "data": {
9651
+ "type": "object",
9652
+ "properties": {
9653
+ "subscriptionId": {
9654
+ "type": "string",
9655
+ "description": "The subscription ID."
9656
+ },
9657
+ "customerId": {
9658
+ "type": "string",
9659
+ "description": "The customer ID. Returns your externalId if you provided one when creating the customer, otherwise returns the Commet publicId."
9660
+ },
9661
+ "expiredAmount": {
9662
+ "type": "number",
9663
+ "description": "The plan balance that was discarded, in rate scale (10000 = 1.00 of the subscription currency)."
9664
+ },
9665
+ "currency": {
9666
+ "type": "string",
9667
+ "description": "The subscription currency."
9668
+ }
9669
+ },
9670
+ "required": [
9671
+ "subscriptionId",
9672
+ "customerId",
9673
+ "expiredAmount",
9674
+ "currency"
9675
+ ],
9676
+ "additionalProperties": false
9677
+ }
9678
+ },
9679
+ "required": [
9680
+ "id",
9681
+ "event",
9682
+ "timestamp",
9683
+ "organizationId",
9684
+ "mode",
9685
+ "apiVersion",
9686
+ "data"
9687
+ ],
9688
+ "additionalProperties": false
9689
+ },
9690
+ "example": {
9691
+ "event": "balance.expired",
9692
+ "timestamp": "2026-06-23T14:30:00.000Z",
9693
+ "organizationId": "8f14e45f-ceea-4e7a-9c3d-1c2b3a4d5e6f",
9694
+ "mode": "live",
9695
+ "apiVersion": "2026-08-27",
9696
+ "data": {
9697
+ "subscriptionId": "sub_1a2b3c4d",
9698
+ "customerId": "user_123",
9699
+ "expiredAmount": 40000,
9700
+ "currency": "usd"
9701
+ }
9702
+ }
9703
+ }
9704
+ }
9705
+ },
9706
+ "responses": {
9707
+ "200": {
9708
+ "description": "Return any 2xx status code to acknowledge receipt of the event."
9709
+ }
9710
+ },
9711
+ "x-mint": {
9712
+ "href": "/webhooks/balance-expired",
9713
+ "metadata": {
9714
+ "playground": "none"
9715
+ }
9716
+ }
9717
+ }
9718
+ },
9353
9719
  "quota.threshold_reached": {
9354
9720
  "post": {
9355
9721
  "summary": "quota.threshold_reached",
@@ -9643,15 +10009,11 @@
9643
10009
  "description": "The customer ID. Returns your externalId if you provided one when creating the customer, otherwise returns the Commet publicId."
9644
10010
  },
9645
10011
  "subscriptionId": {
9646
- "anyOf": [
9647
- {
9648
- "type": "string"
9649
- },
9650
- {
9651
- "type": "null"
9652
- }
9653
- ],
9654
- "description": "The live subscription ID, or null when the customer has no live subscription."
10012
+ "description": "The live subscription ID, or null when the customer has no live subscription.",
10013
+ "type": [
10014
+ "string",
10015
+ "null"
10016
+ ]
9655
10017
  },
9656
10018
  "featureCode": {
9657
10019
  "type": "string",
@@ -10508,15 +10870,11 @@
10508
10870
  "description": "Destination bank display metadata: bankName and last4."
10509
10871
  },
10510
10872
  "paidAt": {
10511
- "anyOf": [
10512
- {
10513
- "type": "string"
10514
- },
10515
- {
10516
- "type": "null"
10517
- }
10518
- ],
10519
- "description": "ISO 8601 datetime when the provider confirmed the deposit arrived."
10873
+ "description": "ISO 8601 datetime when the provider confirmed the deposit arrived.",
10874
+ "type": [
10875
+ "string",
10876
+ "null"
10877
+ ]
10520
10878
  }
10521
10879
  },
10522
10880
  "required": [
@@ -10658,37 +11016,25 @@
10658
11016
  "description": "Destination bank display metadata: bankName and last4."
10659
11017
  },
10660
11018
  "failedAt": {
10661
- "anyOf": [
10662
- {
10663
- "type": "string"
10664
- },
10665
- {
10666
- "type": "null"
10667
- }
10668
- ],
10669
- "description": "ISO 8601 datetime when the failure was recorded."
11019
+ "description": "ISO 8601 datetime when the failure was recorded.",
11020
+ "type": [
11021
+ "string",
11022
+ "null"
11023
+ ]
10670
11024
  },
10671
11025
  "failureCode": {
10672
- "anyOf": [
10673
- {
10674
- "type": "string"
10675
- },
10676
- {
10677
- "type": "null"
10678
- }
10679
- ],
10680
- "description": "The provider's failure code, when available."
11026
+ "description": "The provider's failure code, when available.",
11027
+ "type": [
11028
+ "string",
11029
+ "null"
11030
+ ]
10681
11031
  },
10682
11032
  "failureMessage": {
10683
- "anyOf": [
10684
- {
10685
- "type": "string"
10686
- },
10687
- {
10688
- "type": "null"
10689
- }
10690
- ],
10691
- "description": "A human-readable failure message, when available."
11033
+ "description": "A human-readable failure message, when available.",
11034
+ "type": [
11035
+ "string",
11036
+ "null"
11037
+ ]
10692
11038
  }
10693
11039
  },
10694
11040
  "required": [
@@ -10828,43 +11174,27 @@
10828
11174
  "type": "string"
10829
11175
  },
10830
11176
  "current": {
10831
- "anyOf": [
10832
- {
10833
- "type": "number"
10834
- },
10835
- {
10836
- "type": "null"
10837
- }
11177
+ "type": [
11178
+ "number",
11179
+ "null"
10838
11180
  ]
10839
11181
  },
10840
11182
  "included": {
10841
- "anyOf": [
10842
- {
10843
- "type": "number"
10844
- },
10845
- {
10846
- "type": "null"
10847
- }
11183
+ "type": [
11184
+ "number",
11185
+ "null"
10848
11186
  ]
10849
11187
  },
10850
11188
  "remaining": {
10851
- "anyOf": [
10852
- {
10853
- "type": "number"
10854
- },
10855
- {
10856
- "type": "null"
10857
- }
11189
+ "type": [
11190
+ "number",
11191
+ "null"
10858
11192
  ]
10859
11193
  },
10860
11194
  "unlimited": {
10861
- "anyOf": [
10862
- {
10863
- "type": "boolean"
10864
- },
10865
- {
10866
- "type": "null"
10867
- }
11195
+ "type": [
11196
+ "boolean",
11197
+ "null"
10868
11198
  ]
10869
11199
  }
10870
11200
  },
@@ -10901,11 +11231,27 @@
10901
11231
  "type": "object",
10902
11232
  "properties": {
10903
11233
  "currentBalance": {
10904
- "type": "number"
11234
+ "type": "number",
11235
+ "description": "The available balance, plan plus purchased, in rate scale. Equal to totalBalance."
11236
+ },
11237
+ "planBalance": {
11238
+ "type": "number",
11239
+ "description": "The plan part in rate scale: spent first, replaced or rolled over at each reset, negative while overage is owed."
11240
+ },
11241
+ "purchasedBalance": {
11242
+ "type": "number",
11243
+ "description": "The purchased part in rate scale: top-ups and manual adjustments, spent after the plan part and kept until the subscription ends."
11244
+ },
11245
+ "totalBalance": {
11246
+ "type": "number",
11247
+ "description": "planBalance plus purchasedBalance, in rate scale."
10905
11248
  }
10906
11249
  },
10907
11250
  "required": [
10908
- "currentBalance"
11251
+ "currentBalance",
11252
+ "planBalance",
11253
+ "purchasedBalance",
11254
+ "totalBalance"
10909
11255
  ],
10910
11256
  "additionalProperties": false
10911
11257
  },
@@ -11044,13 +11390,9 @@
11044
11390
  "type": "object",
11045
11391
  "properties": {
11046
11392
  "bankName": {
11047
- "anyOf": [
11048
- {
11049
- "type": "string"
11050
- },
11051
- {
11052
- "type": "null"
11053
- }
11393
+ "type": [
11394
+ "string",
11395
+ "null"
11054
11396
  ]
11055
11397
  },
11056
11398
  "last4": {