@commet/node 9.3.0 → 9.4.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 (194) hide show
  1. package/dist/index.d.mts +364 -15
  2. package/dist/index.d.ts +364 -15
  3. package/dist/index.js +29 -5
  4. package/dist/index.js.map +1 -1
  5. package/dist/index.mjs +29 -5
  6. package/dist/index.mjs.map +1 -1
  7. package/docs/api-reference/addons.md +1 -1
  8. package/docs/api-reference/api-keys.md +3 -2
  9. package/docs/api-reference/credit-packs.md +1 -1
  10. package/docs/api-reference/customers.md +1 -1
  11. package/docs/api-reference/feature-access.md +1 -1
  12. package/docs/api-reference/features.md +1 -1
  13. package/docs/api-reference/generated-webhooks.md +3 -3
  14. package/docs/api-reference/index.md +2 -2
  15. package/docs/api-reference/invoices.md +1 -1
  16. package/docs/api-reference/markets.md +1 -1
  17. package/docs/api-reference/offers.md +1 -1
  18. package/docs/api-reference/payments.md +1 -1
  19. package/docs/api-reference/payouts.md +1 -1
  20. package/docs/api-reference/plan-groups.md +1 -1
  21. package/docs/api-reference/plans.md +1 -1
  22. package/docs/api-reference/portal.md +1 -1
  23. package/docs/api-reference/promo-codes.md +1 -1
  24. package/docs/api-reference/provisioning.md +1 -1
  25. package/docs/api-reference/quota.md +1 -1
  26. package/docs/api-reference/seats.md +1 -1
  27. package/docs/api-reference/subscriptions.md +80 -1
  28. package/docs/api-reference/test-clock.md +1 -1
  29. package/docs/api-reference/transactions.md +1 -1
  30. package/docs/api-reference/usage.md +1 -1
  31. package/docs/documentation/api-versioning.md +1 -1
  32. package/docs/documentation/choose-a-billing-model.md +48 -26
  33. package/docs/documentation/create-api-key.md +101 -25
  34. package/docs/documentation/introduction.md +63 -41
  35. package/docs/documentation/payments/transactions-refunds-and-retries.md +7 -1
  36. package/docs/documentation/sdk-reference.md +9 -9
  37. package/docs/documentation/subscriptions/manage-subscriptions.md +113 -12
  38. package/docs/errors/addon_already_active.md +1 -1
  39. package/docs/errors/addon_has_activations.md +1 -1
  40. package/docs/errors/addon_not_active.md +1 -1
  41. package/docs/errors/addon_not_found.md +1 -1
  42. package/docs/errors/already_has_active_subscription.md +1 -1
  43. package/docs/errors/already_scheduled.md +1 -1
  44. package/docs/errors/api_key_not_found.md +1 -1
  45. package/docs/errors/card_promotions_not_available.md +1 -1
  46. package/docs/errors/charge_failed.md +1 -1
  47. package/docs/errors/charge_in_progress.md +1 -1
  48. package/docs/errors/claim_not_pending.md +1 -1
  49. package/docs/errors/credit_pack_not_found.md +1 -1
  50. package/docs/errors/customer_not_found.md +1 -1
  51. package/docs/errors/duplicate.md +1 -1
  52. package/docs/errors/endpoint_deprecated.md +1 -1
  53. package/docs/errors/endpoint_not_available.md +1 -1
  54. package/docs/errors/feature_already_exists.md +1 -1
  55. package/docs/errors/feature_disabled.md +1 -1
  56. package/docs/errors/feature_in_use.md +1 -1
  57. package/docs/errors/feature_not_found.md +1 -1
  58. package/docs/errors/feature_not_in_plan.md +1 -1
  59. package/docs/errors/forbidden.md +1 -1
  60. package/docs/errors/free_plan_change_not_supported.md +1 -1
  61. package/docs/errors/idempotency_in_progress.md +1 -1
  62. package/docs/errors/idempotency_key_mismatch.md +1 -1
  63. package/docs/errors/idempotency_unavailable.md +1 -1
  64. package/docs/errors/included_limit_reached.md +1 -1
  65. package/docs/errors/index.md +1 -1
  66. package/docs/errors/insufficient_balance.md +1 -1
  67. package/docs/errors/insufficient_credits.md +1 -1
  68. package/docs/errors/insufficient_seats.md +1 -1
  69. package/docs/errors/internal_error.md +1 -1
  70. package/docs/errors/invalid_json.md +1 -1
  71. package/docs/errors/invalid_subscription_status.md +1 -1
  72. package/docs/errors/invoice_not_found.md +1 -1
  73. package/docs/errors/market_group_in_use.md +1 -1
  74. package/docs/errors/market_group_not_found.md +1 -1
  75. package/docs/errors/market_in_use.md +1 -1
  76. package/docs/errors/market_not_found.md +1 -1
  77. package/docs/errors/missing_regional_price.md +1 -1
  78. package/docs/errors/model_not_found.md +1 -1
  79. package/docs/errors/no_active_subscription.md +1 -1
  80. package/docs/errors/no_change_requested.md +1 -1
  81. package/docs/errors/no_outstanding_invoice.md +1 -1
  82. package/docs/errors/no_payment_method.md +1 -1
  83. package/docs/errors/no_prices_configured.md +1 -1
  84. package/docs/errors/not_found.md +1 -1
  85. package/docs/errors/not_scheduled_for_cancellation.md +1 -1
  86. package/docs/errors/offer_not_applicable.md +1 -1
  87. package/docs/errors/offer_not_found.md +1 -1
  88. package/docs/errors/one_time_subscription_not_cancelable.md +1 -1
  89. package/docs/errors/organization_already_claimed.md +1 -1
  90. package/docs/errors/payment_failed.md +1 -1
  91. package/docs/errors/payment_method_not_found.md +1 -1
  92. package/docs/errors/payment_not_cancelable.md +1 -1
  93. package/docs/errors/payment_not_found.md +1 -1
  94. package/docs/errors/payouts_not_available_in_sandbox.md +1 -1
  95. package/docs/errors/plan_change_scheduled.md +1 -1
  96. package/docs/errors/plan_group_not_found.md +1 -1
  97. package/docs/errors/plan_not_found.md +1 -1
  98. package/docs/errors/plan_unavailable.md +1 -1
  99. package/docs/errors/plans_not_in_same_group.md +1 -1
  100. package/docs/errors/price_in_use.md +1 -1
  101. package/docs/errors/price_not_found.md +1 -1
  102. package/docs/errors/pricing_mode_mismatch.md +1 -1
  103. package/docs/errors/promo_code_expired.md +1 -1
  104. package/docs/errors/promo_code_not_found.md +1 -1
  105. package/docs/errors/provider_unsupported.md +1 -1
  106. package/docs/errors/rate_limited.md +1 -1
  107. package/docs/errors/sandbox_only.md +1 -1
  108. package/docs/errors/seat_limit_exceeded.md +1 -1
  109. package/docs/errors/subscription_activation_failed.md +1 -1
  110. package/docs/errors/subscription_already_canceled.md +1 -1
  111. package/docs/errors/subscription_cancel_failed.md +1 -1
  112. package/docs/errors/subscription_creation_failed.md +1 -1
  113. package/docs/errors/subscription_has_open_dispute.md +1 -1
  114. package/docs/errors/subscription_not_active.md +1 -1
  115. package/docs/errors/subscription_not_found.md +1 -1
  116. package/docs/errors/subscription_required.md +1 -1
  117. package/docs/errors/subscription_uncancel_failed.md +1 -1
  118. package/docs/errors/transaction_not_found.md +1 -1
  119. package/docs/errors/unauthorized.md +1 -1
  120. package/docs/errors/validation_error.md +1 -1
  121. package/docs/errors/webhook_not_found.md +1 -1
  122. package/docs/knowledge-base/what-happens-when-you-refund-or-retry-a-transaction.md +2 -2
  123. package/docs/manifest.json +121 -85
  124. package/docs/platform-documentation.md +6 -0
  125. package/docs/schemas.md +35 -1
  126. package/docs/webhooks/addon-activated.md +1 -1
  127. package/docs/webhooks/addon-deactivated.md +1 -1
  128. package/docs/webhooks/balance-depleted.md +1 -1
  129. package/docs/webhooks/balance-low.md +1 -1
  130. package/docs/webhooks/balance-topped-up.md +1 -1
  131. package/docs/webhooks/checkout-ready.md +1 -1
  132. package/docs/webhooks/credits-depleted.md +1 -1
  133. package/docs/webhooks/credits-expired.md +1 -1
  134. package/docs/webhooks/credits-granted.md +1 -1
  135. package/docs/webhooks/credits-low.md +1 -1
  136. package/docs/webhooks/credits-purchased.md +1 -1
  137. package/docs/webhooks/customer-created.md +1 -1
  138. package/docs/webhooks/customer-state-changed.md +2 -2
  139. package/docs/webhooks/customer-updated.md +1 -1
  140. package/docs/webhooks/invoice-created.md +1 -1
  141. package/docs/webhooks/invoice-overdue.md +1 -1
  142. package/docs/webhooks/invoice-upcoming.md +1 -1
  143. package/docs/webhooks/invoice-voided.md +1 -1
  144. package/docs/webhooks/meta.json +6 -0
  145. package/docs/webhooks/payment-dispute-resolved.md +1 -1
  146. package/docs/webhooks/payment-disputed.md +1 -1
  147. package/docs/webhooks/payment-failed.md +144 -3
  148. package/docs/webhooks/payment-link-canceled.md +1 -1
  149. package/docs/webhooks/payment-link-completed.md +44 -2
  150. package/docs/webhooks/payment-link-created.md +1 -1
  151. package/docs/webhooks/payment-link-failed.md +44 -2
  152. package/docs/webhooks/payment-method-attached.md +6 -2
  153. package/docs/webhooks/payment-method-updated.md +7 -8
  154. package/docs/webhooks/payment-received.md +160 -3
  155. package/docs/webhooks/payment-recovered.md +6 -2
  156. package/docs/webhooks/payment-refunded.md +3 -3
  157. package/docs/webhooks/payment-retry-failed.md +1 -1
  158. package/docs/webhooks/payout-available.md +1 -1
  159. package/docs/webhooks/payout-created.md +1 -1
  160. package/docs/webhooks/payout-failed.md +1 -1
  161. package/docs/webhooks/payout-paid.md +1 -1
  162. package/docs/webhooks/plan-grant-created.md +1 -1
  163. package/docs/webhooks/plan-grant-expired.md +1 -1
  164. package/docs/webhooks/plan-grant-revoked.md +1 -1
  165. package/docs/webhooks/plan-grant-updated.md +1 -1
  166. package/docs/webhooks/quota-exceeded.md +1 -1
  167. package/docs/webhooks/quota-threshold-reached.md +1 -1
  168. package/docs/webhooks/seats-limit-reached.md +1 -1
  169. package/docs/webhooks/seats-updated.md +1 -1
  170. package/docs/webhooks/subscription-activated.md +1 -1
  171. package/docs/webhooks/subscription-canceled.md +5 -4
  172. package/docs/webhooks/subscription-cancellation-revoked.md +1 -1
  173. package/docs/webhooks/subscription-cancellation-scheduled.md +1 -1
  174. package/docs/webhooks/subscription-created.md +1 -1
  175. package/docs/webhooks/subscription-past-due.md +1 -1
  176. package/docs/webhooks/subscription-pause-revoked.md +27 -0
  177. package/docs/webhooks/subscription-pause-scheduled.md +35 -0
  178. package/docs/webhooks/subscription-pause-updated.md +31 -0
  179. package/docs/webhooks/subscription-paused.md +35 -0
  180. package/docs/webhooks/subscription-plan-change-revoked.md +1 -1
  181. package/docs/webhooks/subscription-plan-change-scheduled.md +1 -1
  182. package/docs/webhooks/subscription-plan-changed.md +1 -1
  183. package/docs/webhooks/subscription-reactivated.md +1 -1
  184. package/docs/webhooks/subscription-resume-failed.md +33 -0
  185. package/docs/webhooks/subscription-resumed.md +35 -0
  186. package/docs/webhooks/subscription-updated.md +1 -1
  187. package/docs/webhooks/trial-checkout-ready.md +1 -1
  188. package/docs/webhooks/trial-converted.md +1 -1
  189. package/docs/webhooks/trial-expired.md +1 -1
  190. package/docs/webhooks/trial-started.md +1 -1
  191. package/docs/webhooks/trial-will-end.md +1 -1
  192. package/docs/webhooks/usage-recorded.md +1 -1
  193. package/docs/webhooks.md +96 -7
  194. package/package.json +1 -1
@@ -0,0 +1,27 @@
1
+ ---
2
+ lastModified: 2026-08-27
3
+ title: "subscription.pause_revoked"
4
+ description: "A scheduled pause was revoked before taking effect."
5
+ full: true
6
+ ---
7
+
8
+ All webhook payloads follow a consistent top-level structure with event-specific data nested within the `data` object.
9
+
10
+ - `subscriptionId` (string) — The paused subscription ID.
11
+ - `customerId` (string) — The customer ID for the paused subscription.
12
+ - `status` ("active" | "trialing") — Current subscription status.
13
+
14
+ ```json
15
+ {
16
+ "event": "subscription.pause_revoked",
17
+ "timestamp": "2026-06-23T14:30:00.000Z",
18
+ "organizationId": "8f14e45f-ceea-4e7a-9c3d-1c2b3a4d5e6f",
19
+ "mode": "live",
20
+ "apiVersion": "2026-08-27",
21
+ "data": {
22
+ "subscriptionId": "sub_1a2b3c4d",
23
+ "customerId": "user_123",
24
+ "status": "active"
25
+ }
26
+ }
27
+ ```
@@ -0,0 +1,35 @@
1
+ ---
2
+ lastModified: 2026-08-27
3
+ title: "subscription.pause_scheduled"
4
+ description: "A period-end subscription pause was scheduled."
5
+ full: true
6
+ ---
7
+
8
+ All webhook payloads follow a consistent top-level structure with event-specific data nested within the `data` object.
9
+
10
+ - `subscriptionId` (string) — The paused subscription ID.
11
+ - `customerId` (string) — The customer ID for the paused subscription.
12
+ - `status` ("active" | "trialing") — Current subscription status.
13
+ - `mode` ("period\_end") — The scheduled pause mode.
14
+ - `effectiveAt` (string) — When the pause becomes or became effective.
15
+ - `resumeAt` (string | null) — When automatic resume is scheduled, or null when indefinite.
16
+
17
+ ```json
18
+ {
19
+ "event": "subscription.pause_scheduled",
20
+ "timestamp": "2026-06-23T14:30:00.000Z",
21
+ "organizationId": "8f14e45f-ceea-4e7a-9c3d-1c2b3a4d5e6f",
22
+ "mode": "live",
23
+ "apiVersion": "2026-08-27",
24
+ "data": {
25
+ "subscriptionId": "sub_1a2b3c4d",
26
+ "customerId": "user_123",
27
+ "status": "active",
28
+ "mode": "period_end",
29
+ "effectiveAt": "2026-09-01T00:00:00.000Z",
30
+ "resumeAt": "2026-09-15T00:00:00.000Z"
31
+ }
32
+ }
33
+ ```
34
+
35
+ Keep access enabled until `effectiveAt`.
@@ -0,0 +1,31 @@
1
+ ---
2
+ lastModified: 2026-08-27
3
+ title: "subscription.pause_updated"
4
+ description: "A scheduled or active pause duration changed."
5
+ full: true
6
+ ---
7
+
8
+ All webhook payloads follow a consistent top-level structure with event-specific data nested within the `data` object.
9
+
10
+ - `subscriptionId` (string) — The paused subscription ID.
11
+ - `customerId` (string) — The customer ID for the paused subscription.
12
+ - `status` ("active" | "trialing" | "paused") — Current subscription status.
13
+ - `effectiveAt` (string) — When the pause becomes or became effective.
14
+ - `resumeAt` (string | null) — When automatic resume is scheduled, or null when indefinite.
15
+
16
+ ```json
17
+ {
18
+ "event": "subscription.pause_updated",
19
+ "timestamp": "2026-06-23T14:30:00.000Z",
20
+ "organizationId": "8f14e45f-ceea-4e7a-9c3d-1c2b3a4d5e6f",
21
+ "mode": "live",
22
+ "apiVersion": "2026-08-27",
23
+ "data": {
24
+ "subscriptionId": "sub_1a2b3c4d",
25
+ "customerId": "user_123",
26
+ "status": "active",
27
+ "effectiveAt": "2026-09-01T00:00:00.000Z",
28
+ "resumeAt": null
29
+ }
30
+ }
31
+ ```
@@ -0,0 +1,35 @@
1
+ ---
2
+ lastModified: 2026-08-27
3
+ title: "subscription.paused"
4
+ description: "A subscription pause became effective."
5
+ full: true
6
+ ---
7
+
8
+ All webhook payloads follow a consistent top-level structure with event-specific data nested within the `data` object.
9
+
10
+ - `subscriptionId` (string) — The paused subscription ID.
11
+ - `customerId` (string) — The customer ID for the paused subscription.
12
+ - `status` ("paused") — The subscription status after pausing.
13
+ - `mode` ("immediate" | "period\_end") — How the pause became effective.
14
+ - `effectiveAt` (string) — When the pause becomes or became effective.
15
+ - `resumeAt` (string | null) — When automatic resume is scheduled, or null when indefinite.
16
+
17
+ ```json
18
+ {
19
+ "event": "subscription.paused",
20
+ "timestamp": "2026-06-23T14:30:00.000Z",
21
+ "organizationId": "8f14e45f-ceea-4e7a-9c3d-1c2b3a4d5e6f",
22
+ "mode": "live",
23
+ "apiVersion": "2026-08-27",
24
+ "data": {
25
+ "subscriptionId": "sub_1a2b3c4d",
26
+ "customerId": "user_123",
27
+ "status": "paused",
28
+ "mode": "period_end",
29
+ "effectiveAt": "2026-09-01T00:00:00.000Z",
30
+ "resumeAt": "2026-09-15T00:00:00.000Z"
31
+ }
32
+ }
33
+ ```
34
+
35
+ Revoke access when this event arrives.
@@ -21,7 +21,7 @@ All webhook payloads follow a consistent top-level structure with event-specific
21
21
  "timestamp": "2026-06-23T14:30:00.000Z",
22
22
  "organizationId": "8f14e45f-ceea-4e7a-9c3d-1c2b3a4d5e6f",
23
23
  "mode": "live",
24
- "apiVersion": "2026-07-31",
24
+ "apiVersion": "2026-08-27",
25
25
  "data": {
26
26
  "subscriptionId": "sub_1a2b3c4d",
27
27
  "customerId": "user_123",
@@ -22,7 +22,7 @@ All webhook payloads follow a consistent top-level structure with event-specific
22
22
  "timestamp": "2026-06-23T14:30:00.000Z",
23
23
  "organizationId": "8f14e45f-ceea-4e7a-9c3d-1c2b3a4d5e6f",
24
24
  "mode": "live",
25
- "apiVersion": "2026-07-31",
25
+ "apiVersion": "2026-08-27",
26
26
  "data": {
27
27
  "subscriptionId": "sub_1a2b3c4d",
28
28
  "customerId": "user_123",
@@ -22,7 +22,7 @@ All webhook payloads follow a consistent top-level structure with event-specific
22
22
  "timestamp": "2026-06-23T14:30:00.000Z",
23
23
  "organizationId": "8f14e45f-ceea-4e7a-9c3d-1c2b3a4d5e6f",
24
24
  "mode": "live",
25
- "apiVersion": "2026-07-31",
25
+ "apiVersion": "2026-08-27",
26
26
  "data": {
27
27
  "subscriptionId": "sub_1a2b3c4d",
28
28
  "customerId": "user_123",
@@ -25,7 +25,7 @@ All webhook payloads follow a consistent top-level structure with event-specific
25
25
  "timestamp": "2026-06-23T14:30:00.000Z",
26
26
  "organizationId": "8f14e45f-ceea-4e7a-9c3d-1c2b3a4d5e6f",
27
27
  "mode": "live",
28
- "apiVersion": "2026-07-31",
28
+ "apiVersion": "2026-08-27",
29
29
  "data": {
30
30
  "subscriptionId": "sub_1a2b3c4d",
31
31
  "customerId": "user_123",
@@ -0,0 +1,33 @@
1
+ ---
2
+ lastModified: 2026-08-27
3
+ title: "subscription.resume_failed"
4
+ description: "A period-end resume charge failed."
5
+ full: true
6
+ ---
7
+
8
+ All webhook payloads follow a consistent top-level structure with event-specific data nested within the `data` object.
9
+
10
+ - `subscriptionId` (string) — The paused subscription ID.
11
+ - `customerId` (string) — The customer ID for the paused subscription.
12
+ - `status` ("paused") — The unchanged subscription status.
13
+ - `invoiceId` (string) — The outstanding resume invoice ID.
14
+ - `failedAt` (string) — When the resume charge failed.
15
+
16
+ ```json
17
+ {
18
+ "event": "subscription.resume_failed",
19
+ "timestamp": "2026-06-23T14:30:00.000Z",
20
+ "organizationId": "8f14e45f-ceea-4e7a-9c3d-1c2b3a4d5e6f",
21
+ "mode": "live",
22
+ "apiVersion": "2026-08-27",
23
+ "data": {
24
+ "subscriptionId": "sub_1a2b3c4d",
25
+ "customerId": "user_123",
26
+ "status": "paused",
27
+ "invoiceId": "inv_q7r8s9",
28
+ "failedAt": "2026-09-15T12:30:00.000Z"
29
+ }
30
+ }
31
+ ```
32
+
33
+ The subscription remains paused and without access.
@@ -0,0 +1,35 @@
1
+ ---
2
+ lastModified: 2026-08-27
3
+ title: "subscription.resumed"
4
+ description: "A paused subscription restored access."
5
+ full: true
6
+ ---
7
+
8
+ All webhook payloads follow a consistent top-level structure with event-specific data nested within the `data` object.
9
+
10
+ - `subscriptionId` (string) — The paused subscription ID.
11
+ - `customerId` (string) — The customer ID for the paused subscription.
12
+ - `status` ("active" | "trialing") — The restored subscription status.
13
+ - `mode` ("immediate" | "period\_end") — The completed pause mode.
14
+ - `resumedAt` (string) — When access was restored.
15
+ - `invoiceId` (string | null) — The resume invoice ID, or null when no charge was required.
16
+
17
+ ```json
18
+ {
19
+ "event": "subscription.resumed",
20
+ "timestamp": "2026-06-23T14:30:00.000Z",
21
+ "organizationId": "8f14e45f-ceea-4e7a-9c3d-1c2b3a4d5e6f",
22
+ "mode": "live",
23
+ "apiVersion": "2026-08-27",
24
+ "data": {
25
+ "subscriptionId": "sub_1a2b3c4d",
26
+ "customerId": "user_123",
27
+ "status": "active",
28
+ "mode": "period_end",
29
+ "resumedAt": "2026-09-15T12:30:00.000Z",
30
+ "invoiceId": "inv_q7r8s9"
31
+ }
32
+ }
33
+ ```
34
+
35
+ Restore access only after this event.
@@ -20,7 +20,7 @@ All webhook payloads follow a consistent top-level structure with event-specific
20
20
  "timestamp": "2026-06-23T14:30:00.000Z",
21
21
  "organizationId": "8f14e45f-ceea-4e7a-9c3d-1c2b3a4d5e6f",
22
22
  "mode": "live",
23
- "apiVersion": "2026-07-31",
23
+ "apiVersion": "2026-08-27",
24
24
  "data": {
25
25
  "subscriptionId": "sub_1a2b3c4d",
26
26
  "customerId": "user_123",
@@ -19,7 +19,7 @@ All webhook payloads follow a consistent top-level structure with event-specific
19
19
  "timestamp": "2026-06-23T14:30:00.000Z",
20
20
  "organizationId": "8f14e45f-ceea-4e7a-9c3d-1c2b3a4d5e6f",
21
21
  "mode": "live",
22
- "apiVersion": "2026-07-31",
22
+ "apiVersion": "2026-08-27",
23
23
  "data": {
24
24
  "subscriptionId": "sub_1a2b3c4d",
25
25
  "customerId": "user_123",
@@ -19,7 +19,7 @@ All webhook payloads follow a consistent top-level structure with event-specific
19
19
  "timestamp": "2026-06-23T14:30:00.000Z",
20
20
  "organizationId": "8f14e45f-ceea-4e7a-9c3d-1c2b3a4d5e6f",
21
21
  "mode": "live",
22
- "apiVersion": "2026-07-31",
22
+ "apiVersion": "2026-08-27",
23
23
  "data": {
24
24
  "subscriptionId": "sub_1a2b3c4d",
25
25
  "customerId": "user_123",
@@ -20,7 +20,7 @@ All webhook payloads follow a consistent top-level structure with event-specific
20
20
  "timestamp": "2026-06-23T14:30:00.000Z",
21
21
  "organizationId": "8f14e45f-ceea-4e7a-9c3d-1c2b3a4d5e6f",
22
22
  "mode": "live",
23
- "apiVersion": "2026-07-31",
23
+ "apiVersion": "2026-08-27",
24
24
  "data": {
25
25
  "subscriptionId": "sub_1a2b3c4d",
26
26
  "customerId": "user_123",
@@ -20,7 +20,7 @@ All webhook payloads follow a consistent top-level structure with event-specific
20
20
  "timestamp": "2026-06-23T14:30:00.000Z",
21
21
  "organizationId": "8f14e45f-ceea-4e7a-9c3d-1c2b3a4d5e6f",
22
22
  "mode": "live",
23
- "apiVersion": "2026-07-31",
23
+ "apiVersion": "2026-08-27",
24
24
  "data": {
25
25
  "subscriptionId": "sub_1a2b3c4d",
26
26
  "customerId": "user_123",
@@ -20,7 +20,7 @@ All webhook payloads follow a consistent top-level structure with event-specific
20
20
  "timestamp": "2026-06-23T14:30:00.000Z",
21
21
  "organizationId": "8f14e45f-ceea-4e7a-9c3d-1c2b3a4d5e6f",
22
22
  "mode": "live",
23
- "apiVersion": "2026-07-31",
23
+ "apiVersion": "2026-08-27",
24
24
  "data": {
25
25
  "subscriptionId": "sub_1a2b3c4d",
26
26
  "customerId": "user_123",
@@ -20,7 +20,7 @@ All webhook payloads follow a consistent top-level structure with event-specific
20
20
  "timestamp": "2026-06-23T14:30:00.000Z",
21
21
  "organizationId": "8f14e45f-ceea-4e7a-9c3d-1c2b3a4d5e6f",
22
22
  "mode": "live",
23
- "apiVersion": "2026-07-31",
23
+ "apiVersion": "2026-08-27",
24
24
  "data": {
25
25
  "usageEventId": "evt_9f8e7d6c",
26
26
  "subscriptionId": "sub_1a2b3c4d",
package/docs/webhooks.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Webhooks
2
2
 
3
- Generated from Commet API version `2026-07-31`.
3
+ Generated from Commet API version `2026-08-27`.
4
4
 
5
5
  ## subscription.created
6
6
 
@@ -52,9 +52,82 @@ Fired when a canceled subscription is reactivated and its reactivation charge su
52
52
  - `invoiceCurrency` (`string`, required) — The invoice currency code.
53
53
  - `provider` (`"stripe" | "commet" | "dlocal"`, required) — The payment provider that processed the reactivation charge: stripe, commet, or dlocal.
54
54
 
55
+ ## subscription.pause_scheduled
56
+
57
+ Fired when a period-end pause is scheduled. Access and billing continue until effectiveAt.
58
+
59
+ ### Data
60
+
61
+ - `subscriptionId` (`string`, required) — The paused subscription ID.
62
+ - `customerId` (`string`, required) — The customer ID for the paused subscription.
63
+ - `status` (`"active" | "trialing"`, required) — Current subscription status.
64
+ - `mode` (`"period_end"`, required) — The scheduled pause mode.
65
+ - `effectiveAt` (`string`, required) — When the pause becomes or became effective.
66
+ - `resumeAt` (`string | null`, required) — When automatic resume is scheduled, or null when indefinite.
67
+
68
+ ## subscription.pause_updated
69
+
70
+ Fired when the finite or indefinite pause duration changes.
71
+
72
+ ### Data
73
+
74
+ - `subscriptionId` (`string`, required) — The paused subscription ID.
75
+ - `customerId` (`string`, required) — The customer ID for the paused subscription.
76
+ - `status` (`"active" | "trialing" | "paused"`, required) — Current subscription status.
77
+ - `effectiveAt` (`string`, required) — When the pause becomes or became effective.
78
+ - `resumeAt` (`string | null`, required) — When automatic resume is scheduled, or null when indefinite.
79
+
80
+ ## subscription.pause_revoked
81
+
82
+ Fired when a scheduled pause is revoked before it becomes effective.
83
+
84
+ ### Data
85
+
86
+ - `subscriptionId` (`string`, required) — The paused subscription ID.
87
+ - `customerId` (`string`, required) — The customer ID for the paused subscription.
88
+ - `status` (`"active" | "trialing"`, required) — Current subscription status.
89
+
90
+ ## subscription.paused
91
+
92
+ Fired when a pause becomes effective and access is revoked.
93
+
94
+ ### Data
95
+
96
+ - `subscriptionId` (`string`, required) — The paused subscription ID.
97
+ - `customerId` (`string`, required) — The customer ID for the paused subscription.
98
+ - `status` (`"paused"`, required) — The subscription status after pausing.
99
+ - `mode` (`"immediate" | "period_end"`, required) — How the pause became effective.
100
+ - `effectiveAt` (`string`, required) — When the pause becomes or became effective.
101
+ - `resumeAt` (`string | null`, required) — When automatic resume is scheduled, or null when indefinite.
102
+
103
+ ## subscription.resumed
104
+
105
+ Fired after a paused subscription restores access.
106
+
107
+ ### Data
108
+
109
+ - `subscriptionId` (`string`, required) — The paused subscription ID.
110
+ - `customerId` (`string`, required) — The customer ID for the paused subscription.
111
+ - `status` (`"active" | "trialing"`, required) — The restored subscription status.
112
+ - `mode` (`"immediate" | "period_end"`, required) — The completed pause mode.
113
+ - `resumedAt` (`string`, required) — When access was restored.
114
+ - `invoiceId` (`string | null`, required) — The resume invoice ID, or null when no charge was required.
115
+
116
+ ## subscription.resume_failed
117
+
118
+ Fired when a period-end resume charge fails. The subscription remains paused.
119
+
120
+ ### Data
121
+
122
+ - `subscriptionId` (`string`, required) — The paused subscription ID.
123
+ - `customerId` (`string`, required) — The customer ID for the paused subscription.
124
+ - `status` (`"paused"`, required) — The unchanged subscription status.
125
+ - `invoiceId` (`string`, required) — The outstanding resume invoice ID.
126
+ - `failedAt` (`string`, required) — When the resume charge failed.
127
+
55
128
  ## subscription.canceled
56
129
 
57
- Fired when a subscription is actually terminated. A scheduled cancellation fires it at the end of the billing period; immediate cancellations, full refunds (cancelReason refund), and exhausted dunning retries (cancelReason dunning_exhausted) fire it right away. The status is now canceled and access should be revoked. This event is NOT fired when cancellation is scheduled — that triggers subscription.updated instead. See the cancellation lifecycle below.
130
+ Fired when a subscription is actually terminated. A scheduled cancellation fires it at the end of the billing period; immediate cancellations and exhausted dunning retries (cancelReason dunning_exhausted) fire it right away. Refunds do not terminate subscriptions. The status is now canceled and access should be revoked. This event is NOT fired when cancellation is scheduled — that triggers subscription.updated instead. See the cancellation lifecycle below.
58
131
 
59
132
  ### Data
60
133
 
@@ -62,7 +135,7 @@ Fired when a subscription is actually terminated. A scheduled cancellation fires
62
135
  - `customerId` (`string`, required) — The customer ID. Returns your externalId if you provided one when creating the customer, otherwise returns the Commet publicId.
63
136
  - `status` (`string`, required) — Always "canceled" for this event. Revoke access when you receive this.
64
137
  - `canceledAt` (`string`, optional) — ISO 8601 datetime when the cancellation was requested or triggered.
65
- - `cancelReason` (`string | null`, required) — The reason for cancellation, if provided. Set by Commet on system-initiated terminations: "refund" (full refund of a subscription invoice) or "dunning_exhausted" (all payment retries failed).
138
+ - `cancelReason` (`string | null`, required) — The reason for cancellation, if provided. Set to "dunning_exhausted" when all payment retries fail. Historical refund-triggered cancellations may have "refund".
66
139
  - `endDate` (`string`, optional) — ISO 8601 datetime when the subscription ended. Matches the billing period end for scheduled cancellations; for immediate terminations it is the moment of termination.
67
140
 
68
141
  ## subscription.updated
@@ -241,6 +314,7 @@ Fired every time a payment settles successfully — the first payment and every
241
314
 
242
315
  ### Data
243
316
 
317
+ - `paymentContext` (`{ reason: "first_subscription_payment" | "trial_conversion" | "recurring_billing" | "plan_change" | "reactivation" | "subscription_resume" | "one_time_payment" | "overage" | "adjustment"; paymentLinkId: string | null; recovery: { type: "payment_recovery" } | { type: "dunning_retry"; attempt: number; maxAttempts: number } | null } | null`, required) — Charge context captured for new payments. Null for historical payments with no captured context.
244
318
  - `invoiceId` (`string`, required) — The invoice ID.
245
319
  - `invoiceNumber` (`string`, required) — The human-readable invoice number.
246
320
  - `invoiceTotal` (`number`, required) — Invoice total in cents (100 = $1.00).
@@ -248,6 +322,8 @@ Fired every time a payment settles successfully — the first payment and every
248
322
  - `subscriptionId` (`string | null`, required) — The subscription ID.
249
323
  - `paymentTransactionId` (`string | null`, required) — The payment transaction ID.
250
324
  - `provider` (`"stripe" | "commet" | "dlocal" | null`, required) — The payment provider the charge was routed to: stripe, commet, or dlocal. Null for billing-only charges with no Commet ledger row.
325
+ - `paymentMethod` (`PaymentMethod | null`, required) — The payment method: card, oxxo, or mercado_pago. Null when unknown.
326
+ - `subPaymentMethod` (`SubPaymentMethod | null`, required) — The source of funds for this charge, when reported by the provider. Null when unavailable or unknown.
251
327
  - `grossAmount` (`number | null`, required) — Gross amount in cents before fees.
252
328
  - `currency` (`string | null`, required) — The payment currency code.
253
329
  - `orgNetAmount` (`number | null`, required) — Net amount after fees in cents.
@@ -256,15 +332,18 @@ Fired every time a payment settles successfully — the first payment and every
256
332
 
257
333
  ## payment.failed
258
334
 
259
- Fired when a recurring charge fails. This event is for recurring charge failures only — card declines during initial checkout do not trigger this event.
335
+ Fired when an invoice-linked subscription charge fails.
260
336
 
261
337
  ### Data
262
338
 
339
+ - `paymentContext` (`{ reason: "first_subscription_payment" | "trial_conversion" | "recurring_billing" | "plan_change" | "reactivation" | "subscription_resume" | "one_time_payment" | "overage" | "adjustment"; paymentLinkId: string | null; recovery: { type: "payment_recovery" } | { type: "dunning_retry"; attempt: number; maxAttempts: number } | null } | null`, required) — Charge context captured for new payments. Null for historical payments with no captured context.
263
340
  - `invoiceId` (`string`, required) — The invoice ID, if available.
264
341
  - `invoiceNumber` (`string`, required) — The human-readable invoice number, if available.
265
342
  - `customerId` (`string`, required) — The customer ID. Returns your externalId if you provided one when creating the customer, otherwise returns the Commet publicId.
266
343
  - `subscriptionId` (`string | null`, required) — The subscription ID, if the invoice is linked to a subscription.
267
344
  - `provider` (`"stripe" | "commet" | "dlocal"`, required) — The payment provider the charge was routed to: stripe, commet, or dlocal.
345
+ - `paymentMethod` (`PaymentMethod | null`, required) — The payment method: card, oxxo, or mercado_pago. Null when unknown.
346
+ - `subPaymentMethod` (`SubPaymentMethod | null`, required) — The source of funds for this charge, when reported by the provider. Null when unavailable or unknown.
268
347
  - `failureCode` (`string`, required) — The failure code from the payment processor.
269
348
  - `failureMessage` (`string`, required) — A human-readable failure message.
270
349
  - `recoveryUrl` (`string | null`, required) — 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.
@@ -281,6 +360,8 @@ Fired when an outstanding invoice that previously failed is successfully paid
281
360
  - `customerId` (`string`, required) — The customer ID. Returns your externalId if you provided one when creating the customer, otherwise returns the Commet publicId.
282
361
  - `subscriptionId` (`string | null`, required) — The subscription ID, if the invoice is linked to a subscription.
283
362
  - `provider` (`"stripe" | "commet" | "dlocal" | null`, required) — The payment provider that recovered the payment, or null when the invoice was recovered without a processor charge.
363
+ - `paymentMethod` (`PaymentMethod | null`, required) — The payment method: card, oxxo, or mercado_pago. Null when unknown.
364
+ - `subPaymentMethod` (`SubPaymentMethod | null`, required) — The source of funds for this charge, when reported by the provider. Null when unavailable or unknown.
284
365
 
285
366
  ## payment.retry_failed
286
367
 
@@ -297,7 +378,7 @@ Fired when all dunning retries are exhausted and the subscription is canceled. T
297
378
 
298
379
  ## payment.refunded
299
380
 
300
- Fired when a payment is refunded, fully or partially. A full refund of a subscription invoice also cancels the subscription immediately (subscription.canceled fires with reason refund); partial refunds leave the subscription untouched.
381
+ Fired when a payment is refunded, fully or partially. A refund does not change the subscription. Cancel it separately if it should end.
301
382
 
302
383
  ### Data
303
384
 
@@ -365,6 +446,7 @@ Fired when a payment link is paid. The charge settled and a one-time invoice was
365
446
 
366
447
  ### Data
367
448
 
449
+ - `paymentContext` (`{ reason: "first_subscription_payment" | "trial_conversion" | "recurring_billing" | "plan_change" | "reactivation" | "subscription_resume" | "one_time_payment" | "overage" | "adjustment"; paymentLinkId: string | null; recovery: { type: "payment_recovery" } | { type: "dunning_retry"; attempt: number; maxAttempts: number } | null } | null`, required) — Charge context captured for new payments. Null for historical payments with no captured context.
368
450
  - `paymentId` (`string`, required) — The payment link ID.
369
451
  - `status` (`string`, required) — The link status. Always "succeeded" for this event.
370
452
  - `amount` (`number`, required) — The collected amount in cents (100 = $1.00).
@@ -374,6 +456,8 @@ Fired when a payment link is paid. The charge settled and a one-time invoice was
374
456
  - `invoiceId` (`string`, required) — The one-time invoice generated for this payment.
375
457
  - `invoiceNumber` (`string`, required) — The human-readable invoice number.
376
458
  - `paymentTransactionId` (`string | null`, required) — The payment transaction ID for the settled charge.
459
+ - `paymentMethod` (`PaymentMethod | null`, required) — The payment method: card, oxxo, or mercado_pago. Null when unknown.
460
+ - `subPaymentMethod` (`SubPaymentMethod | null`, required) — The source of funds for this charge, when reported by the provider. Null when unavailable or unknown.
377
461
 
378
462
  ## payment_link.failed
379
463
 
@@ -381,6 +465,7 @@ Fired when a payment link charge attempt is declined. The link stays open and ca
381
465
 
382
466
  ### Data
383
467
 
468
+ - `paymentContext` (`{ reason: "first_subscription_payment" | "trial_conversion" | "recurring_billing" | "plan_change" | "reactivation" | "subscription_resume" | "one_time_payment" | "overage" | "adjustment"; paymentLinkId: string | null; recovery: { type: "payment_recovery" } | { type: "dunning_retry"; attempt: number; maxAttempts: number } | null } | null`, required) — Charge context captured for new payments. Null for historical payments with no captured context.
384
469
  - `paymentId` (`string`, required) — The payment link ID.
385
470
  - `status` (`string`, required) — The link status. Always "failed" for this event.
386
471
  - `amount` (`number`, required) — The amount that was attempted in cents (100 = $1.00).
@@ -389,6 +474,8 @@ Fired when a payment link charge attempt is declined. The link stays open and ca
389
474
  - `customerId` (`string | null`, required) — 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.
390
475
  - `failureCode` (`string`, required) — The failure code from the payment processor.
391
476
  - `failureMessage` (`string`, required) — A human-readable failure message.
477
+ - `paymentMethod` (`PaymentMethod | null`, required) — The payment method: card, oxxo, or mercado_pago. Null when unknown.
478
+ - `subPaymentMethod` (`SubPaymentMethod | null`, required) — The source of funds for this charge, when reported by the provider. Null when unavailable or unknown.
392
479
 
393
480
  ## payment_link.canceled
394
481
 
@@ -482,6 +569,7 @@ Fired when Commet records a payment method for a subscription: after a paid chec
482
569
 
483
570
  - `subscriptionId` (`string`, required) — The subscription the payment method was saved for.
484
571
  - `customerId` (`string`, required) — The customer ID. Returns your externalId if you provided one when creating the customer, otherwise returns the Commet publicId.
572
+ - `paymentMethod` (`PaymentMethod | null`, required) — The payment method: card, oxxo, or mercado_pago. Null when unknown.
485
573
  - `card` (`WebhookCardInfo | null`, required) — Card display metadata: brand, last4, expMonth, expYear. Null when the method is not a card or its details cannot be retrieved.
486
574
 
487
575
  ## payment_method.updated
@@ -491,6 +579,7 @@ Fired when a customer replaces their default payment method through the customer
491
579
  ### Data
492
580
 
493
581
  - `customerId` (`string`, required) — The customer ID. Returns your externalId if you provided one when creating the customer, otherwise returns the Commet publicId.
582
+ - `paymentMethod` (`PaymentMethod | null`, required) — The payment method: card, oxxo, or mercado_pago. Null when unknown.
494
583
  - `card` (`WebhookCardInfo | null`, required) — 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.
495
584
 
496
585
  ## customer.created
@@ -529,12 +618,12 @@ Fired when a customer's details change (email, name, timezone, externalId, or me
529
618
 
530
619
  ## customer.state_changed
531
620
 
532
- Aggregate entitlement event answering one question: what can this customer access right now? Fired on every entitlement transition (subscription lifecycle, plan changes, trials, past due, scheduled cancellations) with the customer's CURRENT subscription, plan, features, seats, and credits or balance. Handle this single event to keep access in sync instead of wiring every lifecycle event.
621
+ Aggregate entitlement event answering one question: what can this customer access right now? Fired on every entitlement transition (subscription lifecycle, pauses, plan changes, trials, past due, scheduled cancellations) with the customer's CURRENT subscription, plan, features, seats, and credits or balance. Handle this single event to keep access in sync instead of wiring every lifecycle event.
533
622
 
534
623
  ### Data
535
624
 
536
625
  - `customerId` (`string`, required) — The customer ID. Returns your externalId if you provided one when creating the customer, otherwise returns the Commet publicId.
537
- - `trigger` (`string`, required) — What caused the transition. One of: subscription_created, subscription_activated, subscription_canceled, plan_change, past_due, trial_started, trial_converted, trial_expired, cancellation_scheduled, cancellation_revoked, seats_updated, addon_activated, addon_deactivated, credits_depleted, balance_depleted, quota_exceeded, plan_access_granted, plan_access_ended.
626
+ - `trigger` (`string`, required) — What caused the transition. One of: subscription_created, subscription_activated, subscription_canceled, subscription_paused, subscription_resumed, plan_change, past_due, trial_started, trial_converted, trial_expired, cancellation_scheduled, cancellation_revoked, seats_updated, addon_activated, addon_deactivated, credits_depleted, balance_depleted, quota_exceeded, plan_access_granted, plan_access_ended.
538
627
  - `status` (`string`, required) — 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.
539
628
  - `subscriptionId` (`string | null`, required) — The live subscription ID, or null when status is none.
540
629
  - `plan` (`WebhookPlanRef | null`, required) — The current plan (id and name), or null when status is none.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@commet/node",
3
- "version": "9.3.0",
3
+ "version": "9.4.0",
4
4
  "description": "Commet SDK for Node.js - Billing and usage tracking",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",