@commet/node 9.4.0 → 9.5.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 +2 -2
  2. package/dist/index.d.ts +2 -2
  3. package/dist/index.js +3 -3
  4. package/dist/index.js.map +1 -1
  5. package/dist/index.mjs +3 -3
  6. package/dist/index.mjs.map +1 -1
  7. package/docs/ai-onboarding/ai-onboarding.md +2 -3
  8. package/docs/ai-onboarding/billing-best-practices-skill.md +2 -3
  9. package/docs/ai-onboarding/commet-skill.md +4 -5
  10. package/docs/ai-onboarding/mcp-server.md +8 -9
  11. package/docs/ai-onboarding/pricing-models-skill.md +2 -3
  12. package/docs/ai-onboarding/subscription-patterns-skill.md +2 -3
  13. package/docs/api-reference/promo-codes.md +1 -1
  14. package/docs/api-reference/subscriptions.md +1 -1
  15. package/docs/documentation/api-versioning.md +1 -2
  16. package/docs/documentation/better-auth.md +0 -1
  17. package/docs/documentation/choose-a-billing-model.md +14 -8
  18. package/docs/documentation/cli.md +1 -2
  19. package/docs/documentation/create-api-key.md +0 -1
  20. package/docs/documentation/customers/customer-credits.md +0 -1
  21. package/docs/documentation/customers/customer-portal.md +14 -2
  22. package/docs/documentation/customers/manage-customers.md +1 -2
  23. package/docs/documentation/error-handling.md +1 -2
  24. package/docs/documentation/examples.md +0 -1
  25. package/docs/documentation/finance/acceptable-use.md +0 -1
  26. package/docs/documentation/finance/finance-overview.md +0 -1
  27. package/docs/documentation/finance/local-currency-taxes.md +0 -1
  28. package/docs/documentation/finance/merchant-of-record.md +0 -1
  29. package/docs/documentation/finance/payouts-verification.md +6 -3
  30. package/docs/documentation/finance/payouts.md +0 -1
  31. package/docs/documentation/finance/supported-countries.md +0 -1
  32. package/docs/documentation/go/integrate-with-encore.md +7 -8
  33. package/docs/documentation/go/integrate-with-go.md +8 -9
  34. package/docs/documentation/introduction.md +3 -4
  35. package/docs/documentation/invoicing/handle-failed-payments.md +9 -4
  36. package/docs/documentation/invoicing/invoices-and-billing-cycles.md +0 -1
  37. package/docs/documentation/invoicing/manage-invoices.md +0 -1
  38. package/docs/documentation/java/integrate-with-java.md +6 -7
  39. package/docs/documentation/nodejs/integrate-with-astro.md +6 -7
  40. package/docs/documentation/nodejs/integrate-with-bun.md +6 -7
  41. package/docs/documentation/nodejs/integrate-with-express.md +7 -8
  42. package/docs/documentation/nodejs/integrate-with-hono.md +7 -8
  43. package/docs/documentation/nodejs/integrate-with-nextjs.md +6 -7
  44. package/docs/documentation/nodejs/integrate-with-nuxt.md +6 -7
  45. package/docs/documentation/nodejs/integrate-with-remix.md +6 -7
  46. package/docs/documentation/nodejs/integrate-with-sveltekit.md +6 -7
  47. package/docs/documentation/payments/accept-one-time-payments.md +0 -1
  48. package/docs/documentation/payments/payment-orchestration.md +0 -1
  49. package/docs/documentation/payments/payment-providers.md +0 -1
  50. package/docs/documentation/payments/transactions-refunds-and-retries.md +2 -1
  51. package/docs/documentation/php/integrate-with-laravel.md +8 -9
  52. package/docs/documentation/php/integrate-with-php.md +6 -7
  53. package/docs/documentation/php/integrate-with-symfony.md +7 -8
  54. package/docs/documentation/plans/add-ons.md +0 -1
  55. package/docs/documentation/plans/balance-and-top-ups.md +0 -1
  56. package/docs/documentation/plans/configure-features.md +0 -1
  57. package/docs/documentation/plans/consumption-models.md +0 -1
  58. package/docs/documentation/plans/create-plans.md +0 -1
  59. package/docs/documentation/plans/credit-packs.md +0 -1
  60. package/docs/documentation/plans/one-time-payments.md +0 -1
  61. package/docs/documentation/plans/plan-groups.md +0 -1
  62. package/docs/documentation/platform/custom-domains.md +0 -1
  63. package/docs/documentation/platform/dashboard-metrics-and-events.md +0 -1
  64. package/docs/documentation/platform/members-and-permissions.md +0 -1
  65. package/docs/documentation/platform/organization-settings.md +0 -1
  66. package/docs/documentation/python/integrate-with-django.md +8 -9
  67. package/docs/documentation/python/integrate-with-fastapi.md +8 -9
  68. package/docs/documentation/python/integrate-with-flask.md +8 -9
  69. package/docs/documentation/python/integrate-with-python.md +6 -7
  70. package/docs/documentation/sales/card-promotions.md +0 -1
  71. package/docs/documentation/sales/introductory-offers.md +0 -1
  72. package/docs/documentation/sales/offers.md +0 -1
  73. package/docs/documentation/sales/promo-codes.md +19 -5
  74. package/docs/documentation/sales/promotional-offers.md +1 -2
  75. package/docs/documentation/sales/regional-prices.md +0 -1
  76. package/docs/documentation/sales/trial-periods.md +8 -8
  77. package/docs/documentation/sdk-reference.md +1 -2
  78. package/docs/documentation/subscriptions/manage-subscriptions.md +2 -1
  79. package/docs/documentation/subscriptions/plan-grants.md +0 -1
  80. package/docs/documentation/subscriptions/upgrade-and-downgrade-plans.md +0 -1
  81. package/docs/documentation/testing-sandbox.md +0 -1
  82. package/docs/documentation/usage/ai-token-billing.md +0 -1
  83. package/docs/documentation/usage/quota-management.md +0 -1
  84. package/docs/documentation/usage/seat-management.md +0 -1
  85. package/docs/documentation/usage/track-usage.md +0 -1
  86. package/docs/knowledge-base/how-do-balance-and-top-ups-work.md +0 -1
  87. package/docs/knowledge-base/how-do-credits-credit-packs-and-customer-credits-differ.md +0 -1
  88. package/docs/knowledge-base/how-do-discounts-work.md +0 -1
  89. package/docs/knowledge-base/how-do-free-plans-work-without-payment.md +0 -1
  90. package/docs/knowledge-base/how-do-monthly-quarterly-and-yearly-billing-work.md +0 -1
  91. package/docs/knowledge-base/how-do-offers-promo-codes-and-card-promotions-work-together.md +0 -1
  92. package/docs/knowledge-base/how-do-trial-periods-work.md +0 -1
  93. package/docs/knowledge-base/how-does-billing-work.md +0 -1
  94. package/docs/knowledge-base/how-does-payment-routing-work.md +0 -1
  95. package/docs/knowledge-base/how-does-quota-based-billing-work.md +0 -1
  96. package/docs/knowledge-base/how-does-seat-based-billing-work.md +0 -1
  97. package/docs/knowledge-base/how-is-proration-calculated-when-changing-plans.md +0 -1
  98. package/docs/knowledge-base/what-happens-when-a-customer-changes-plans.md +0 -1
  99. package/docs/knowledge-base/what-happens-when-a-payment-fails.md +0 -1
  100. package/docs/knowledge-base/what-happens-when-you-change-your-prices.md +0 -1
  101. package/docs/knowledge-base/what-happens-when-you-refund-or-retry-a-transaction.md +0 -1
  102. package/docs/knowledge-base/what-invoices-do-customers-receive-and-when.md +0 -1
  103. package/docs/manifest.json +72 -157
  104. package/docs/platform-documentation.md +69 -155
  105. package/docs/webhooks/introduction.md +0 -1
  106. package/docs/webhooks.md +2 -0
  107. package/docs/webhooks.openapi.json +11058 -0
  108. package/package.json +1 -1
  109. package/docs/ai-onboarding/meta.json +0 -17
  110. package/docs/api-reference/meta.json +0 -7
  111. package/docs/documentation/customers/meta.json +0 -5
  112. package/docs/documentation/finance/meta.json +0 -13
  113. package/docs/documentation/go/meta.json +0 -5
  114. package/docs/documentation/invoicing/meta.json +0 -9
  115. package/docs/documentation/java/meta.json +0 -5
  116. package/docs/documentation/meta.json +0 -36
  117. package/docs/documentation/nodejs/meta.json +0 -14
  118. package/docs/documentation/payments/meta.json +0 -10
  119. package/docs/documentation/php/meta.json +0 -9
  120. package/docs/documentation/plans/meta.json +0 -14
  121. package/docs/documentation/platform/meta.json +0 -10
  122. package/docs/documentation/python/meta.json +0 -10
  123. package/docs/documentation/sales/meta.json +0 -13
  124. package/docs/documentation/subscriptions/meta.json +0 -9
  125. package/docs/documentation/usage/meta.json +0 -10
  126. package/docs/knowledge-base/meta.json +0 -29
  127. package/docs/meta.json +0 -11
  128. package/docs/webhooks/addon-activated.md +0 -44
  129. package/docs/webhooks/addon-deactivated.md +0 -40
  130. package/docs/webhooks/balance-depleted.md +0 -37
  131. package/docs/webhooks/balance-low.md +0 -39
  132. package/docs/webhooks/balance-topped-up.md +0 -41
  133. package/docs/webhooks/checkout-ready.md +0 -43
  134. package/docs/webhooks/credits-depleted.md +0 -35
  135. package/docs/webhooks/credits-expired.md +0 -35
  136. package/docs/webhooks/credits-granted.md +0 -37
  137. package/docs/webhooks/credits-low.md +0 -39
  138. package/docs/webhooks/credits-purchased.md +0 -41
  139. package/docs/webhooks/customer-created.md +0 -49
  140. package/docs/webhooks/customer-state-changed.md +0 -134
  141. package/docs/webhooks/customer-updated.md +0 -49
  142. package/docs/webhooks/invoice-created.md +0 -45
  143. package/docs/webhooks/invoice-overdue.md +0 -53
  144. package/docs/webhooks/invoice-upcoming.md +0 -43
  145. package/docs/webhooks/invoice-voided.md +0 -53
  146. package/docs/webhooks/meta.json +0 -89
  147. package/docs/webhooks/payment-dispute-resolved.md +0 -52
  148. package/docs/webhooks/payment-disputed.md +0 -49
  149. package/docs/webhooks/payment-failed.md +0 -178
  150. package/docs/webhooks/payment-link-canceled.md +0 -41
  151. package/docs/webhooks/payment-link-completed.md +0 -89
  152. package/docs/webhooks/payment-link-created.md +0 -41
  153. package/docs/webhooks/payment-link-failed.md +0 -87
  154. package/docs/webhooks/payment-method-attached.md +0 -44
  155. package/docs/webhooks/payment-method-updated.md +0 -37
  156. package/docs/webhooks/payment-received.md +0 -202
  157. package/docs/webhooks/payment-recovered.md +0 -43
  158. package/docs/webhooks/payment-refunded.md +0 -47
  159. package/docs/webhooks/payment-retry-failed.md +0 -39
  160. package/docs/webhooks/payout-available.md +0 -33
  161. package/docs/webhooks/payout-created.md +0 -48
  162. package/docs/webhooks/payout-failed.md +0 -52
  163. package/docs/webhooks/payout-paid.md +0 -48
  164. package/docs/webhooks/plan-grant-created.md +0 -74
  165. package/docs/webhooks/plan-grant-expired.md +0 -86
  166. package/docs/webhooks/plan-grant-revoked.md +0 -86
  167. package/docs/webhooks/plan-grant-updated.md +0 -86
  168. package/docs/webhooks/quota-exceeded.md +0 -44
  169. package/docs/webhooks/quota-threshold-reached.md +0 -41
  170. package/docs/webhooks/seats-limit-reached.md +0 -39
  171. package/docs/webhooks/seats-updated.md +0 -39
  172. package/docs/webhooks/subscription-activated.md +0 -43
  173. package/docs/webhooks/subscription-canceled.md +0 -58
  174. package/docs/webhooks/subscription-cancellation-revoked.md +0 -37
  175. package/docs/webhooks/subscription-cancellation-scheduled.md +0 -45
  176. package/docs/webhooks/subscription-created.md +0 -35
  177. package/docs/webhooks/subscription-past-due.md +0 -43
  178. package/docs/webhooks/subscription-pause-revoked.md +0 -27
  179. package/docs/webhooks/subscription-pause-scheduled.md +0 -35
  180. package/docs/webhooks/subscription-pause-updated.md +0 -31
  181. package/docs/webhooks/subscription-paused.md +0 -35
  182. package/docs/webhooks/subscription-plan-change-revoked.md +0 -50
  183. package/docs/webhooks/subscription-plan-change-scheduled.md +0 -55
  184. package/docs/webhooks/subscription-plan-changed.md +0 -43
  185. package/docs/webhooks/subscription-reactivated.md +0 -53
  186. package/docs/webhooks/subscription-resume-failed.md +0 -33
  187. package/docs/webhooks/subscription-resumed.md +0 -35
  188. package/docs/webhooks/subscription-updated.md +0 -39
  189. package/docs/webhooks/trial-checkout-ready.md +0 -39
  190. package/docs/webhooks/trial-converted.md +0 -39
  191. package/docs/webhooks/trial-expired.md +0 -39
  192. package/docs/webhooks/trial-started.md +0 -46
  193. package/docs/webhooks/trial-will-end.md +0 -41
  194. package/docs/webhooks/usage-recorded.md +0 -41
@@ -1,202 +0,0 @@
1
- ---
2
- lastModified: 2026-09-24
3
- title: "payment.received"
4
- description: "Fired when a payment settles successfully, including initial charges, renewals and recovery attempts"
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
- - `paymentContext` (object | null) — Charge context captured for new payments. Null for historical payments with no captured context.
11
- - `invoiceId` (string) — The invoice ID.
12
- - `invoiceNumber` (string) — The human-readable invoice number.
13
- - `invoiceTotal` (number) — Invoice total in cents (100 = $1.00).
14
- - `customerId` (string) — The customer ID. Returns your externalId if you provided one when creating the customer, otherwise returns the Commet publicId.
15
- - `subscriptionId` (string | null) — The subscription ID.
16
- - `paymentTransactionId` (string | null) — The payment transaction ID.
17
- - `provider` ("stripe" | "commet" | "dlocal" | null) — The payment provider the charge was routed to: stripe, commet, or dlocal. Null for billing-only charges with no Commet ledger row.
18
- - `paymentMethod` (PaymentMethod | null) — The payment method: card, oxxo, or mercado\_pago. Null when unknown.
19
- - `subPaymentMethod` (SubPaymentMethod | null) — The source of funds for this charge, when reported by the provider. Null when unavailable or unknown.
20
- - `grossAmount` (number | null) — Gross amount in cents before fees.
21
- - `currency` (string | null) — The payment currency code.
22
- - `orgNetAmount` (number | null) — Net amount after fees in cents.
23
- - `customerEmail` (string | null) — The customer email used for this payment.
24
- - `paidAt` (string, optional) — ISO 8601 datetime when the payment was received.
25
-
26
- ### `paymentContext`
27
-
28
- The original reason for a charge and how this attempt was initiated. Recovery never replaces the original reason. Context can be null when it was not captured, including retries of historical invoices.
29
-
30
- `reason` (string): The original reason, preserved across payment attempts.
31
-
32
- `paymentLinkId` (string | null): The public payment link ID, or null when the charge did not originate from a payment link. This is independent of the reason and recovery method.
33
-
34
- `recovery` (object | null): Null when the charge does not recover a subscription. payment\_recovery identifies a manually recovered overdue subscription, a return after cancellation for non-payment, or a retry of a failed subscription resume. Initial checkout and one-time payment retries are not recovery. dunning\_retry identifies an automatic charge retry, not a webhook delivery retry.
35
-
36
- `recovery.attempt` (integer): The charge retry position in the dunning schedule, starting at 1. The original failed charge is not a retry. Present only for dunning\_retry.
37
-
38
- `recovery.maxAttempts` (integer): The total automatic retries applicable to this charge when the attempt began. It is not the number of retries remaining. Present only for dunning\_retry.
39
-
40
- `first_subscription_payment`: The initial subscription payment.
41
-
42
- `trial_conversion`: The payment when a free trial ends.
43
-
44
- `recurring_billing`: A subscription renewal.
45
-
46
- `plan_change`: A charge caused by a plan change.
47
-
48
- `reactivation`: A charge to reactivate a canceled subscription.
49
-
50
- `subscription_resume`: A charge to resume a paused subscription.
51
-
52
- `one_time_payment`: A one-time payment, including payment links.
53
-
54
- `overage`: A charge for usage beyond the included allowance.
55
-
56
- `adjustment`: A charge from an adjustment invoice.
57
-
58
- ### Initial attempt
59
-
60
- The original charge attempt, before recovery.
61
-
62
- ```json
63
- {
64
- "event": "payment.received",
65
- "timestamp": "2026-06-23T14:30:00.000Z",
66
- "organizationId": "8f14e45f-ceea-4e7a-9c3d-1c2b3a4d5e6f",
67
- "mode": "live",
68
- "apiVersion": "2026-08-27",
69
- "data": {
70
- "paymentContext": {
71
- "reason": "first_subscription_payment",
72
- "paymentLinkId": null,
73
- "recovery": null
74
- },
75
- "invoiceId": "inv_n4o5p6",
76
- "invoiceNumber": "INV-0043",
77
- "invoiceTotal": 9900,
78
- "customerId": "user_123",
79
- "subscriptionId": "sub_1a2b3c4d",
80
- "paymentTransactionId": "txn_q7r8s9",
81
- "provider": "stripe",
82
- "paymentMethod": "card",
83
- "subPaymentMethod": null,
84
- "grossAmount": 9900,
85
- "currency": "usd",
86
- "orgNetAmount": 9200,
87
- "customerEmail": "billing@acme.com",
88
- "paidAt": "2026-04-25T00:05:00.000Z"
89
- }
90
- }
91
- ```
92
-
93
- ### Manual recovery
94
-
95
- The customer recovers an overdue subscription. The original charge reason is preserved.
96
-
97
- ```json
98
- {
99
- "event": "payment.received",
100
- "timestamp": "2026-06-23T14:30:00.000Z",
101
- "organizationId": "8f14e45f-ceea-4e7a-9c3d-1c2b3a4d5e6f",
102
- "mode": "live",
103
- "apiVersion": "2026-08-27",
104
- "data": {
105
- "paymentContext": {
106
- "reason": "recurring_billing",
107
- "paymentLinkId": null,
108
- "recovery": {
109
- "type": "payment_recovery"
110
- }
111
- },
112
- "invoiceId": "inv_n4o5p6",
113
- "invoiceNumber": "INV-0043",
114
- "invoiceTotal": 9900,
115
- "customerId": "user_123",
116
- "subscriptionId": "sub_1a2b3c4d",
117
- "paymentTransactionId": "txn_q7r8s9",
118
- "provider": "stripe",
119
- "paymentMethod": "card",
120
- "subPaymentMethod": null,
121
- "grossAmount": 9900,
122
- "currency": "usd",
123
- "orgNetAmount": 9200,
124
- "customerEmail": "billing@acme.com",
125
- "paidAt": "2026-04-25T00:05:00.000Z"
126
- }
127
- }
128
- ```
129
-
130
- ### Dunning retries
131
-
132
- The second automatic retry of a subscription resume charge, out of four allowed retries. The reason remains subscription\_resume.
133
-
134
- ```json
135
- {
136
- "event": "payment.received",
137
- "timestamp": "2026-06-23T14:30:00.000Z",
138
- "organizationId": "8f14e45f-ceea-4e7a-9c3d-1c2b3a4d5e6f",
139
- "mode": "live",
140
- "apiVersion": "2026-08-27",
141
- "data": {
142
- "paymentContext": {
143
- "reason": "subscription_resume",
144
- "paymentLinkId": null,
145
- "recovery": {
146
- "type": "dunning_retry",
147
- "attempt": 2,
148
- "maxAttempts": 4
149
- }
150
- },
151
- "invoiceId": "inv_n4o5p6",
152
- "invoiceNumber": "INV-0043",
153
- "invoiceTotal": 9900,
154
- "customerId": "user_123",
155
- "subscriptionId": "sub_1a2b3c4d",
156
- "paymentTransactionId": "txn_q7r8s9",
157
- "provider": "stripe",
158
- "paymentMethod": "card",
159
- "subPaymentMethod": null,
160
- "grossAmount": 9900,
161
- "currency": "usd",
162
- "orgNetAmount": 9200,
163
- "customerEmail": "billing@acme.com",
164
- "paidAt": "2026-04-25T00:05:00.000Z"
165
- }
166
- }
167
- ```
168
-
169
- ### No context
170
-
171
- The charge context was not captured. Do not infer the original reason from the subscription's current state.
172
-
173
- ```json
174
- {
175
- "event": "payment.received",
176
- "timestamp": "2026-06-23T14:30:00.000Z",
177
- "organizationId": "8f14e45f-ceea-4e7a-9c3d-1c2b3a4d5e6f",
178
- "mode": "live",
179
- "apiVersion": "2026-08-27",
180
- "data": {
181
- "paymentContext": null,
182
- "invoiceId": "inv_n4o5p6",
183
- "invoiceNumber": "INV-0043",
184
- "invoiceTotal": 9900,
185
- "customerId": "user_123",
186
- "subscriptionId": "sub_1a2b3c4d",
187
- "paymentTransactionId": "txn_q7r8s9",
188
- "provider": "stripe",
189
- "paymentMethod": "card",
190
- "subPaymentMethod": null,
191
- "grossAmount": 9900,
192
- "currency": "usd",
193
- "orgNetAmount": 9200,
194
- "customerEmail": "billing@acme.com",
195
- "paidAt": "2026-04-25T00:05:00.000Z"
196
- }
197
- }
198
- ```
199
-
200
- `paymentMethod` identifies the method used for this charge, independently of `provider`. It is `null` when the payment attempt has no known method, and does not change when the customer updates their saved method later.
201
-
202
- `subPaymentMethod` is the source of funds reported for this charge, such as `account_money` or `credit_card` within Mercado Pago. It is `null` when unavailable or unknown.
@@ -1,43 +0,0 @@
1
- ---
2
- lastModified: 2026-06-12
3
- title: "payment.recovered"
4
- description: "A previously failed payment was recovered."
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
- - `invoiceId` (string) — The recovered invoice ID.
11
- - `invoiceNumber` (string) — The human-readable invoice number.
12
- - `invoiceTotal` (number) — Invoice total in cents (100 = $1.00).
13
- - `customerId` (string) — The customer ID. Returns your externalId if you provided one when creating the customer, otherwise returns the Commet publicId.
14
- - `subscriptionId` (string | null) — The subscription ID, if the invoice is linked to a subscription.
15
- - `provider` ("stripe" | "commet" | "dlocal" | null) — The payment provider that recovered the payment, or null when the invoice was recovered without a processor charge.
16
- - `paymentMethod` (PaymentMethod | null) — The payment method: card, oxxo, or mercado\_pago. Null when unknown.
17
- - `subPaymentMethod` (SubPaymentMethod | null) — The source of funds for this charge, when reported by the provider. Null when unavailable or unknown.
18
-
19
- ```json
20
- {
21
- "event": "payment.recovered",
22
- "timestamp": "2026-06-23T14:30:00.000Z",
23
- "organizationId": "8f14e45f-ceea-4e7a-9c3d-1c2b3a4d5e6f",
24
- "mode": "live",
25
- "apiVersion": "2026-08-27",
26
- "data": {
27
- "invoiceId": "inv_n4o5p6",
28
- "invoiceNumber": "INV-0043",
29
- "invoiceTotal": 9900,
30
- "customerId": "user_123",
31
- "subscriptionId": "sub_1a2b3c4d",
32
- "provider": "stripe",
33
- "paymentMethod": "card",
34
- "subPaymentMethod": null
35
- }
36
- }
37
- ```
38
-
39
- ## When this fires
40
-
41
- After a payment failure put a subscription in `past_due`, a successful retry of the outstanding invoice fires this event — whether the charge succeeded automatically or the customer paid through the portal after updating their card.
42
-
43
- The subscription returns to `active` at the same time, so `customer.state_changed` also fires. Restore access on either event; use this one specifically to close dunning flows you opened on `payment.failed`.
@@ -1,47 +0,0 @@
1
- ---
2
- lastModified: 2026-09-22
3
- title: "payment.refunded"
4
- description: "A payment was refunded to the customer."
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
- - `paymentTransactionId` (string) — The refunded payment transaction ID.
11
- - `provider` ("stripe" | "commet" | "dlocal") — The payment provider the charge was routed to: stripe, commet, or dlocal.
12
- - `paymentLinkId` (string | null) — The payment link the payment originated from, or null when the payment did not come from a payment link.
13
- - `invoiceId` (string | null) — The invoice the payment collected, or null for payments without an invoice.
14
- - `invoiceNumber` (string | null) — The human-readable invoice number, if available.
15
- - `customerId` (string | null) — 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.
16
- - `subscriptionId` (string | null) — The subscription ID, if the invoice is linked to a subscription.
17
- - `refundAmount` (number) — The refunded amount in cents (100 = $1.00).
18
- - `currency` (string) — The refund currency code.
19
-
20
- ```json
21
- {
22
- "event": "payment.refunded",
23
- "timestamp": "2026-06-23T14:30:00.000Z",
24
- "organizationId": "8f14e45f-ceea-4e7a-9c3d-1c2b3a4d5e6f",
25
- "mode": "live",
26
- "apiVersion": "2026-08-27",
27
- "data": {
28
- "paymentTransactionId": "txn_q7r8s9",
29
- "provider": "stripe",
30
- "paymentLinkId": null,
31
- "invoiceId": "inv_n4o5p6",
32
- "invoiceNumber": "INV-0043",
33
- "customerId": "user_123",
34
- "subscriptionId": "sub_1a2b3c4d",
35
- "refundAmount": 9900,
36
- "currency": "usd"
37
- }
38
- }
39
- ```
40
-
41
- ## When this fires
42
-
43
- When a refund is issued for a payment — full or partial — and the payment provider confirms it. A refund does not change the subscription. If it should end, [cancel it separately](/docs/manage-subscriptions).
44
-
45
- `refundAmount` is the refunded amount in cents (100 = $1.00). The invoice fields are `null` for payments that were not tied to an invoice.
46
-
47
- Use it to mirror the refund in your own books or to notify the customer through your channels.
@@ -1,39 +0,0 @@
1
- ---
2
- lastModified: 2026-07-06
3
- title: "payment.retry_failed"
4
- description: "All dunning retries were exhausted; the subscription was canceled."
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
- - `invoiceId` (string) — The invoice whose retries were exhausted.
11
- - `invoiceNumber` (string) — The human-readable invoice number.
12
- - `customerId` (string) — The customer ID. Returns your externalId if you provided one when creating the customer, otherwise returns the Commet publicId.
13
- - `subscriptionId` (string) — The subscription ID.
14
- - `provider` ("stripe" | "commet" | "dlocal") — The payment provider the charge was routed to: stripe, commet, or dlocal.
15
- - `reason` (string) — Terminal dunning reason, usually the last processor decline code or "dunning\_exhausted".
16
-
17
- ```json
18
- {
19
- "event": "payment.retry_failed",
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
- "invoiceId": "inv_n4o5p6",
26
- "invoiceNumber": "INV-0043",
27
- "customerId": "user_123",
28
- "subscriptionId": "sub_1a2b3c4d",
29
- "provider": "stripe",
30
- "reason": "card_declined"
31
- }
32
- }
33
- ```
34
-
35
- ## When this fires
36
-
37
- After a payment failure puts a subscription in `past_due`, Commet retries the outstanding invoice on the dunning schedule. When the final retry fails, the invoice is marked uncollectible and the subscription is canceled — this event marks that terminal outcome.
38
-
39
- It is the end of the dunning flow: `payment.recovered` will not follow, and `subscription.canceled` fires alongside it. Revoke access when you receive this event.
@@ -1,33 +0,0 @@
1
- ---
2
- lastModified: 2026-06-12
3
- title: "payout.available"
4
- description: "Funds became available to pay out to your bank."
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
- - `availableAmount` (number) — Your full available payout balance in cents (100 = $1.00) at the time of the event — not just the newly released funds.
11
- - `currency` (string) — The payout balance currency. Always "usd".
12
-
13
- ```json
14
- {
15
- "event": "payout.available",
16
- "timestamp": "2026-06-23T14:30:00.000Z",
17
- "organizationId": "8f14e45f-ceea-4e7a-9c3d-1c2b3a4d5e6f",
18
- "mode": "live",
19
- "apiVersion": "2026-08-27",
20
- "data": {
21
- "availableAmount": 125000,
22
- "currency": "usd"
23
- }
24
- }
25
- ```
26
-
27
- ## When this fires
28
-
29
- This is an organization-level event about YOUR money as the merchant, not about a customer. Payment funds start as pending while the provider holds them; a periodic check marks them available once the provider releases them, and this event fires when new funds become available.
30
-
31
- `availableAmount` is your full available payout balance in cents at that moment — not just the newly released funds.
32
-
33
- Use it to know when requesting a payout is worthwhile, or to drive your own treasury automation.
@@ -1,48 +0,0 @@
1
- ---
2
- lastModified: 2026-06-12
3
- title: "payout.created"
4
- description: "A payout to your bank account was initiated."
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
- - `payoutId` (string) — The payout ID.
11
- - `amount` (number) — Gross payout amount in cents (100 = $1.00).
12
- - `fee` (number) — Provider transfer fee in cents.
13
- - `netAmount` (number) — What reaches your bank in cents (amount minus fee).
14
- - `currency` (string) — The payout currency. Always "usd".
15
- - `status` (string) — The payout status. "pending" at creation.
16
- - `destinationBank` (WebhookBankRef | null) — Destination bank display metadata: bankName and last4. Full account numbers never appear in webhook payloads.
17
- - `createdAt` (string) — ISO 8601 datetime when the payout was created.
18
-
19
- ```json
20
- {
21
- "event": "payout.created",
22
- "timestamp": "2026-06-23T14:30:00.000Z",
23
- "organizationId": "8f14e45f-ceea-4e7a-9c3d-1c2b3a4d5e6f",
24
- "mode": "live",
25
- "apiVersion": "2026-08-27",
26
- "data": {
27
- "payoutId": "8b6f2a1c-4d3e-4f5a-9b8c-7d6e5f4a3b2c",
28
- "amount": 20000,
29
- "fee": 0,
30
- "netAmount": 20000,
31
- "currency": "usd",
32
- "status": "pending",
33
- "destinationBank": {
34
- "bankName": "CHASE",
35
- "last4": "6789"
36
- },
37
- "createdAt": "2026-06-12T10:00:00.000Z"
38
- }
39
- }
40
- ```
41
-
42
- ## When this fires
43
-
44
- When a payout of your available balance is requested and the transfer toward your bank is initiated. The payout starts in `pending` and moves through the transfer and bank settlement legs from there.
45
-
46
- `destinationBank` carries display metadata only (bank name and last4); full account numbers never appear in webhook payloads.
47
-
48
- The lifecycle continues with `payout.paid` when the money lands, or `payout.failed` if the bank rejects it.
@@ -1,52 +0,0 @@
1
- ---
2
- lastModified: 2026-06-12
3
- title: "payout.failed"
4
- description: "A payout to your bank account 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
- - `payoutId` (string) — The payout ID.
11
- - `amount` (number) — Gross payout amount in cents (100 = $1.00).
12
- - `fee` (number) — Provider transfer fee in cents.
13
- - `netAmount` (number) — What would have reached your bank in cents.
14
- - `currency` (string) — The payout currency. Always "usd".
15
- - `status` (string) — Always "failed" for this event.
16
- - `destinationBank` (WebhookBankRef | null) — Destination bank display metadata: bankName and last4.
17
- - `failedAt` (string | null) — ISO 8601 datetime when the failure was recorded.
18
- - `failureCode` (string | null) — The provider's failure code, when available.
19
- - `failureMessage` (string | null) — A human-readable failure message, when available.
20
-
21
- ```json
22
- {
23
- "event": "payout.failed",
24
- "timestamp": "2026-06-23T14:30:00.000Z",
25
- "organizationId": "8f14e45f-ceea-4e7a-9c3d-1c2b3a4d5e6f",
26
- "mode": "live",
27
- "apiVersion": "2026-08-27",
28
- "data": {
29
- "payoutId": "8b6f2a1c-4d3e-4f5a-9b8c-7d6e5f4a3b2c",
30
- "amount": 20000,
31
- "fee": 0,
32
- "netAmount": 20000,
33
- "currency": "usd",
34
- "status": "failed",
35
- "destinationBank": {
36
- "bankName": "CHASE",
37
- "last4": "6789"
38
- },
39
- "failedAt": "2026-06-14T09:00:00.000Z",
40
- "failureCode": "account_closed",
41
- "failureMessage": "The bank account has been closed"
42
- }
43
- }
44
- ```
45
-
46
- ## When this fires
47
-
48
- When the provider reports that a payout could not be completed — at either leg of the lifecycle, most commonly when the bank rejects the deposit (closed account, invalid details). The funds return to your available balance.
49
-
50
- `failureCode` and `failureMessage` carry the provider's reason when available.
51
-
52
- Use it to alert your finance contact and to fix the bank account before requesting the payout again.
@@ -1,48 +0,0 @@
1
- ---
2
- lastModified: 2026-06-12
3
- title: "payout.paid"
4
- description: "A payout landed in your bank account."
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
- - `payoutId` (string) — The payout ID.
11
- - `amount` (number) — Gross payout amount in cents (100 = $1.00).
12
- - `fee` (number) — Provider transfer fee in cents.
13
- - `netAmount` (number) — What reached your bank in cents (amount minus fee).
14
- - `currency` (string) — The payout currency. Always "usd".
15
- - `status` (string) — Always "paid" for this event.
16
- - `destinationBank` (WebhookBankRef | null) — Destination bank display metadata: bankName and last4.
17
- - `paidAt` (string | null) — ISO 8601 datetime when the provider confirmed the deposit arrived.
18
-
19
- ```json
20
- {
21
- "event": "payout.paid",
22
- "timestamp": "2026-06-23T14:30:00.000Z",
23
- "organizationId": "8f14e45f-ceea-4e7a-9c3d-1c2b3a4d5e6f",
24
- "mode": "live",
25
- "apiVersion": "2026-08-27",
26
- "data": {
27
- "payoutId": "8b6f2a1c-4d3e-4f5a-9b8c-7d6e5f4a3b2c",
28
- "amount": 20000,
29
- "fee": 0,
30
- "netAmount": 20000,
31
- "currency": "usd",
32
- "status": "paid",
33
- "destinationBank": {
34
- "bankName": "CHASE",
35
- "last4": "6789"
36
- },
37
- "paidAt": "2026-06-14T09:00:00.000Z"
38
- }
39
- }
40
- ```
41
-
42
- ## When this fires
43
-
44
- When the bank settlement of a payout completes — the moment the money actually reaches your bank account, confirmed by the payment provider. This is the terminal success state of the payout lifecycle started by `payout.created`.
45
-
46
- `paidAt` is the provider-confirmed arrival time. Fires exactly once per payout.
47
-
48
- Use it to reconcile bank deposits against the payouts that produced them.
@@ -1,74 +0,0 @@
1
- ---
2
- lastModified: 2026-08-18
3
- title: "plan_grant.created"
4
- description: "A plan grant was created."
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
- - `id` (string) — The public plan grant ID.
11
- - `customerId` (string) — The public customer ID.
12
- - `subscriptionId` (string) — The public subscription ID.
13
- - `basePlanId` (string) — The public ID of the subscribed base plan.
14
- - `targetPlanId` (string) — The public ID of the plan whose access was granted.
15
- - `targetPlanReleaseId` (string) — The public ID of the immutable target plan release.
16
- - `status` ("active" | "expired" | "revoked") — The plan grant status at this transition.
17
- - `duration` ("cycles" | "until\_date" | "until\_revoked") — How the plan grant duration is defined at this transition.
18
- - `durationCycles` (integer | null) — The cycle count when duration is cycles.
19
- - `startsAt` (string) — When the plan grant started.
20
- - `expiresAt` (string | null) — The effective expiration deadline, if any.
21
- - `reason` (string) — The reason recorded for this transition.
22
- - `source` ("dashboard" | "api" | "system") — Where this transition originated.
23
- - `revokedAt` (string | null) — When the plan grant was revoked, otherwise null.
24
- - `createdAt` (string) — When the plan grant was created.
25
- - `updatedAt` (string) — When the represented transition occurred.
26
- - `events` (WebhookPlanGrantTimelineEvent\[]) — The grant timeline through the represented transition.
27
-
28
- ```json
29
- {
30
- "event": "plan_grant.created",
31
- "timestamp": "2026-06-23T14:30:00.000Z",
32
- "organizationId": "8f14e45f-ceea-4e7a-9c3d-1c2b3a4d5e6f",
33
- "mode": "live",
34
- "apiVersion": "2026-08-27",
35
- "data": {
36
- "id": "pgr_1a2b3c4d",
37
- "customerId": "user_123",
38
- "subscriptionId": "sub_1a2b3c4d",
39
- "basePlanId": "pln_starter",
40
- "targetPlanId": "pln_pro",
41
- "targetPlanReleaseId": "plr_1a2b3c4d",
42
- "status": "active",
43
- "duration": "cycles",
44
- "durationCycles": 2,
45
- "startsAt": "2026-08-01T00:00:00.000Z",
46
- "expiresAt": "2026-10-01T00:00:00.000Z",
47
- "reason": "Two-month product evaluation",
48
- "source": "api",
49
- "revokedAt": null,
50
- "createdAt": "2026-08-01T00:00:00.000Z",
51
- "updatedAt": "2026-08-01T00:00:00.000Z",
52
- "events": [
53
- {
54
- "id": "gre_1a2b3c4d",
55
- "type": "created",
56
- "reason": "Two-month product evaluation",
57
- "source": "api",
58
- "previousExpiresAt": null,
59
- "expiresAt": "2026-10-01T00:00:00.000Z",
60
- "duration": "cycles",
61
- "durationCycles": 2,
62
- "requestedExpiresAt": null,
63
- "createdAt": "2026-08-01T00:00:00.000Z"
64
- }
65
- ]
66
- }
67
- }
68
- ```
69
-
70
- ## When this fires
71
-
72
- After a Plan Grant is committed through the API or dashboard. The payload is the grant as it existed at creation, and its last timeline event is `created`.
73
-
74
- `customer.state_changed` also fires with trigger `plan_access_granted`.