@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
@@ -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
  "paymentId": "pay_l1m2n3",
26
26
  "status": "pending",
@@ -7,6 +7,7 @@ full: true
7
7
 
8
8
  All webhook payloads follow a consistent top-level structure with event-specific data nested within the `data` object.
9
9
 
10
+ - `paymentContext` (object | null) — Charge context captured for new payments. Null for historical payments with no captured context.
10
11
  - `paymentId` (string) — The payment link ID.
11
12
  - `status` (string) — The link status. Always "failed" for this event.
12
13
  - `amount` (number) — The amount that was attempted in cents (100 = $1.00).
@@ -15,6 +16,40 @@ All webhook payloads follow a consistent top-level structure with event-specific
15
16
  - `customerId` (string | null) — 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.
16
17
  - `failureCode` (string) — The failure code from the payment processor.
17
18
  - `failureMessage` (string) — A human-readable failure message.
19
+ - `paymentMethod` (PaymentMethod | null) — The payment method: card, oxxo, or mercado\_pago. Null when unknown.
20
+ - `subPaymentMethod` (SubPaymentMethod | null) — The source of funds for this charge, when reported by the provider. Null when unavailable or unknown.
21
+
22
+ ### `paymentContext`
23
+
24
+ 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.
25
+
26
+ `reason` (string): The original reason, preserved across payment attempts.
27
+
28
+ `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.
29
+
30
+ `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.
31
+
32
+ `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.
33
+
34
+ `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.
35
+
36
+ `first_subscription_payment`: The initial subscription payment.
37
+
38
+ `trial_conversion`: The payment when a free trial ends.
39
+
40
+ `recurring_billing`: A subscription renewal.
41
+
42
+ `plan_change`: A charge caused by a plan change.
43
+
44
+ `reactivation`: A charge to reactivate a canceled subscription.
45
+
46
+ `subscription_resume`: A charge to resume a paused subscription.
47
+
48
+ `one_time_payment`: A one-time payment, including payment links.
49
+
50
+ `overage`: A charge for usage beyond the included allowance.
51
+
52
+ `adjustment`: A charge from an adjustment invoice.
18
53
 
19
54
  ```json
20
55
  {
@@ -22,8 +57,13 @@ All webhook payloads follow a consistent top-level structure with event-specific
22
57
  "timestamp": "2026-06-23T14:30:00.000Z",
23
58
  "organizationId": "8f14e45f-ceea-4e7a-9c3d-1c2b3a4d5e6f",
24
59
  "mode": "live",
25
- "apiVersion": "2026-07-31",
60
+ "apiVersion": "2026-08-27",
26
61
  "data": {
62
+ "paymentContext": {
63
+ "reason": "one_time_payment",
64
+ "paymentLinkId": "pay_l1m2n3",
65
+ "recovery": null
66
+ },
27
67
  "paymentId": "pay_l1m2n3",
28
68
  "status": "failed",
29
69
  "amount": 5000,
@@ -31,7 +71,9 @@ All webhook payloads follow a consistent top-level structure with event-specific
31
71
  "description": "One-time onboarding fee",
32
72
  "customerId": "user_123",
33
73
  "failureCode": "card_declined",
34
- "failureMessage": "Your card was declined."
74
+ "failureMessage": "Your card was declined.",
75
+ "paymentMethod": "card",
76
+ "subPaymentMethod": null
35
77
  }
36
78
  }
37
79
  ```
@@ -1,5 +1,5 @@
1
1
  ---
2
- lastModified: 2026-06-12
2
+ lastModified: 2026-09-24
3
3
  title: "payment_method.attached"
4
4
  description: "A payment method was saved for a customer's subscription."
5
5
  full: true
@@ -9,6 +9,7 @@ All webhook payloads follow a consistent top-level structure with event-specific
9
9
 
10
10
  - `subscriptionId` (string) — The subscription the payment method was saved for.
11
11
  - `customerId` (string) — The customer ID. Returns your externalId if you provided one when creating the customer, otherwise returns the Commet publicId.
12
+ - `paymentMethod` (PaymentMethod | null) — The payment method: card, oxxo, or mercado\_pago. Null when unknown.
12
13
  - `card` (WebhookCardInfo | null) — Card display metadata: brand, last4, expMonth, expYear. Null when the method is not a card or its details cannot be retrieved.
13
14
 
14
15
  ```json
@@ -17,10 +18,11 @@ All webhook payloads follow a consistent top-level structure with event-specific
17
18
  "timestamp": "2026-06-23T14:30:00.000Z",
18
19
  "organizationId": "8f14e45f-ceea-4e7a-9c3d-1c2b3a4d5e6f",
19
20
  "mode": "live",
20
- "apiVersion": "2026-07-31",
21
+ "apiVersion": "2026-08-27",
21
22
  "data": {
22
23
  "subscriptionId": "sub_1a2b3c4d",
23
24
  "customerId": "user_123",
25
+ "paymentMethod": "card",
24
26
  "card": {
25
27
  "brand": "visa",
26
28
  "last4": "4242",
@@ -37,4 +39,6 @@ Fired when Commet records a payment method for a subscription: after a paid chec
37
39
 
38
40
  The `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`.
39
41
 
42
+ `paymentMethod` identifies the saved instrument (`card` or `mercado_pago`; OXXO never leaves a saved instrument). A `null` `card` object does not identify its type.
43
+
40
44
  Use it to show the saved card in your own billing UI or confirm to the customer that their payment method is on file.
@@ -1,5 +1,5 @@
1
1
  ---
2
- lastModified: 2026-06-12
2
+ lastModified: 2026-09-24
3
3
  title: "payment_method.updated"
4
4
  description: "A customer's default payment method was replaced."
5
5
  full: true
@@ -8,6 +8,7 @@ full: true
8
8
  All webhook payloads follow a consistent top-level structure with event-specific data nested within the `data` object.
9
9
 
10
10
  - `customerId` (string) — The customer ID. Returns your externalId if you provided one when creating the customer, otherwise returns the Commet publicId.
11
+ - `paymentMethod` (PaymentMethod | null) — The payment method: card, oxxo, or mercado\_pago. Null when unknown.
11
12
  - `card` (WebhookCardInfo | null) — 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.
12
13
 
13
14
  ```json
@@ -16,15 +17,11 @@ All webhook payloads follow a consistent top-level structure with event-specific
16
17
  "timestamp": "2026-06-23T14:30:00.000Z",
17
18
  "organizationId": "8f14e45f-ceea-4e7a-9c3d-1c2b3a4d5e6f",
18
19
  "mode": "live",
19
- "apiVersion": "2026-07-31",
20
+ "apiVersion": "2026-08-27",
20
21
  "data": {
21
22
  "customerId": "user_123",
22
- "card": {
23
- "brand": "mastercard",
24
- "last4": "5100",
25
- "expMonth": 8,
26
- "expYear": 2031
27
- }
23
+ "paymentMethod": "mercado_pago",
24
+ "card": null
28
25
  }
29
26
  }
30
27
  ```
@@ -35,4 +32,6 @@ Fired when a customer replaces their default payment method through the customer
35
32
 
36
33
  The `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`.
37
34
 
35
+ `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.
36
+
38
37
  Use 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.
@@ -1,12 +1,13 @@
1
1
  ---
2
- lastModified: 2026-07-10
2
+ lastModified: 2026-09-24
3
3
  title: "payment.received"
4
- description: "Fired every time a payment settles successfully — the first payment and every renewal alike"
4
+ description: "Fired when a payment settles successfully, including initial charges, renewals and recovery attempts"
5
5
  full: true
6
6
  ---
7
7
 
8
8
  All webhook payloads follow a consistent top-level structure with event-specific data nested within the `data` object.
9
9
 
10
+ - `paymentContext` (object | null) — Charge context captured for new payments. Null for historical payments with no captured context.
10
11
  - `invoiceId` (string) — The invoice ID.
11
12
  - `invoiceNumber` (string) — The human-readable invoice number.
12
13
  - `invoiceTotal` (number) — Invoice total in cents (100 = $1.00).
@@ -14,20 +15,100 @@ All webhook payloads follow a consistent top-level structure with event-specific
14
15
  - `subscriptionId` (string | null) — The subscription ID.
15
16
  - `paymentTransactionId` (string | null) — The payment transaction ID.
16
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.
17
20
  - `grossAmount` (number | null) — Gross amount in cents before fees.
18
21
  - `currency` (string | null) — The payment currency code.
19
22
  - `orgNetAmount` (number | null) — Net amount after fees in cents.
20
23
  - `customerEmail` (string | null) — The customer email used for this payment.
21
24
  - `paidAt` (string, optional) — ISO 8601 datetime when the payment was received.
22
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
+
23
97
  ```json
24
98
  {
25
99
  "event": "payment.received",
26
100
  "timestamp": "2026-06-23T14:30:00.000Z",
27
101
  "organizationId": "8f14e45f-ceea-4e7a-9c3d-1c2b3a4d5e6f",
28
102
  "mode": "live",
29
- "apiVersion": "2026-07-31",
103
+ "apiVersion": "2026-08-27",
30
104
  "data": {
105
+ "paymentContext": {
106
+ "reason": "recurring_billing",
107
+ "paymentLinkId": null,
108
+ "recovery": {
109
+ "type": "payment_recovery"
110
+ }
111
+ },
31
112
  "invoiceId": "inv_n4o5p6",
32
113
  "invoiceNumber": "INV-0043",
33
114
  "invoiceTotal": 9900,
@@ -35,6 +116,8 @@ All webhook payloads follow a consistent top-level structure with event-specific
35
116
  "subscriptionId": "sub_1a2b3c4d",
36
117
  "paymentTransactionId": "txn_q7r8s9",
37
118
  "provider": "stripe",
119
+ "paymentMethod": "card",
120
+ "subPaymentMethod": null,
38
121
  "grossAmount": 9900,
39
122
  "currency": "usd",
40
123
  "orgNetAmount": 9200,
@@ -43,3 +126,77 @@ All webhook payloads follow a consistent top-level structure with event-specific
43
126
  }
44
127
  }
45
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.
@@ -13,6 +13,8 @@ All webhook payloads follow a consistent top-level structure with event-specific
13
13
  - `customerId` (string) — The customer ID. Returns your externalId if you provided one when creating the customer, otherwise returns the Commet publicId.
14
14
  - `subscriptionId` (string | null) — The subscription ID, if the invoice is linked to a subscription.
15
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.
16
18
 
17
19
  ```json
18
20
  {
@@ -20,14 +22,16 @@ All webhook payloads follow a consistent top-level structure with event-specific
20
22
  "timestamp": "2026-06-23T14:30:00.000Z",
21
23
  "organizationId": "8f14e45f-ceea-4e7a-9c3d-1c2b3a4d5e6f",
22
24
  "mode": "live",
23
- "apiVersion": "2026-07-31",
25
+ "apiVersion": "2026-08-27",
24
26
  "data": {
25
27
  "invoiceId": "inv_n4o5p6",
26
28
  "invoiceNumber": "INV-0043",
27
29
  "invoiceTotal": 9900,
28
30
  "customerId": "user_123",
29
31
  "subscriptionId": "sub_1a2b3c4d",
30
- "provider": "stripe"
32
+ "provider": "stripe",
33
+ "paymentMethod": "card",
34
+ "subPaymentMethod": null
31
35
  }
32
36
  }
33
37
  ```
@@ -1,5 +1,5 @@
1
1
  ---
2
- lastModified: 2026-07-10
2
+ lastModified: 2026-09-22
3
3
  title: "payment.refunded"
4
4
  description: "A payment was refunded to the customer."
5
5
  full: true
@@ -23,7 +23,7 @@ All webhook payloads follow a consistent top-level structure with event-specific
23
23
  "timestamp": "2026-06-23T14:30:00.000Z",
24
24
  "organizationId": "8f14e45f-ceea-4e7a-9c3d-1c2b3a4d5e6f",
25
25
  "mode": "live",
26
- "apiVersion": "2026-07-31",
26
+ "apiVersion": "2026-08-27",
27
27
  "data": {
28
28
  "paymentTransactionId": "txn_q7r8s9",
29
29
  "provider": "stripe",
@@ -40,7 +40,7 @@ All webhook payloads follow a consistent top-level structure with event-specific
40
40
 
41
41
  ## When this fires
42
42
 
43
- When a refund is issued for a payment — full or partial — and the payment provider confirms it. A full refund of a subscription invoice also cancels the subscription immediately (`subscription.canceled` fires with reason `refund`); a partial refund leaves the subscription untouched.
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
44
 
45
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
46
 
@@ -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
  "invoiceId": "inv_n4o5p6",
26
26
  "invoiceNumber": "INV-0043",
@@ -16,7 +16,7 @@ All webhook payloads follow a consistent top-level structure with event-specific
16
16
  "timestamp": "2026-06-23T14:30:00.000Z",
17
17
  "organizationId": "8f14e45f-ceea-4e7a-9c3d-1c2b3a4d5e6f",
18
18
  "mode": "live",
19
- "apiVersion": "2026-07-31",
19
+ "apiVersion": "2026-08-27",
20
20
  "data": {
21
21
  "availableAmount": 125000,
22
22
  "currency": "usd"
@@ -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
  "payoutId": "8b6f2a1c-4d3e-4f5a-9b8c-7d6e5f4a3b2c",
28
28
  "amount": 20000,
@@ -24,7 +24,7 @@ All webhook payloads follow a consistent top-level structure with event-specific
24
24
  "timestamp": "2026-06-23T14:30:00.000Z",
25
25
  "organizationId": "8f14e45f-ceea-4e7a-9c3d-1c2b3a4d5e6f",
26
26
  "mode": "live",
27
- "apiVersion": "2026-07-31",
27
+ "apiVersion": "2026-08-27",
28
28
  "data": {
29
29
  "payoutId": "8b6f2a1c-4d3e-4f5a-9b8c-7d6e5f4a3b2c",
30
30
  "amount": 20000,
@@ -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
  "payoutId": "8b6f2a1c-4d3e-4f5a-9b8c-7d6e5f4a3b2c",
28
28
  "amount": 20000,
@@ -31,7 +31,7 @@ All webhook payloads follow a consistent top-level structure with event-specific
31
31
  "timestamp": "2026-06-23T14:30:00.000Z",
32
32
  "organizationId": "8f14e45f-ceea-4e7a-9c3d-1c2b3a4d5e6f",
33
33
  "mode": "live",
34
- "apiVersion": "2026-07-31",
34
+ "apiVersion": "2026-08-27",
35
35
  "data": {
36
36
  "id": "pgr_1a2b3c4d",
37
37
  "customerId": "user_123",
@@ -31,7 +31,7 @@ All webhook payloads follow a consistent top-level structure with event-specific
31
31
  "timestamp": "2026-06-23T14:30:00.000Z",
32
32
  "organizationId": "8f14e45f-ceea-4e7a-9c3d-1c2b3a4d5e6f",
33
33
  "mode": "live",
34
- "apiVersion": "2026-07-31",
34
+ "apiVersion": "2026-08-27",
35
35
  "data": {
36
36
  "id": "pgr_1a2b3c4d",
37
37
  "customerId": "user_123",
@@ -31,7 +31,7 @@ All webhook payloads follow a consistent top-level structure with event-specific
31
31
  "timestamp": "2026-06-23T14:30:00.000Z",
32
32
  "organizationId": "8f14e45f-ceea-4e7a-9c3d-1c2b3a4d5e6f",
33
33
  "mode": "live",
34
- "apiVersion": "2026-07-31",
34
+ "apiVersion": "2026-08-27",
35
35
  "data": {
36
36
  "id": "pgr_1a2b3c4d",
37
37
  "customerId": "user_123",
@@ -31,7 +31,7 @@ All webhook payloads follow a consistent top-level structure with event-specific
31
31
  "timestamp": "2026-06-23T14:30:00.000Z",
32
32
  "organizationId": "8f14e45f-ceea-4e7a-9c3d-1c2b3a4d5e6f",
33
33
  "mode": "live",
34
- "apiVersion": "2026-07-31",
34
+ "apiVersion": "2026-08-27",
35
35
  "data": {
36
36
  "id": "pgr_1a2b3c4d",
37
37
  "customerId": "user_123",
@@ -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",
@@ -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
  "customerId": "user_123",
25
25
  "subscriptionId": "sub_1a2b3c4d",
@@ -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
  "customerId": "user_123",
25
25
  "subscriptionId": "sub_1a2b3c4d",
@@ -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",
@@ -1,5 +1,5 @@
1
1
  ---
2
- lastModified: 2026-07-16
2
+ lastModified: 2026-09-22
3
3
  title: "subscription.canceled"
4
4
  description: "Fired when a subscription is terminated, at period end or immediately. Revoke access here."
5
5
  full: true
@@ -11,7 +11,7 @@ All webhook payloads follow a consistent top-level structure with event-specific
11
11
  - `customerId` (string) — The customer ID. Returns your externalId if you provided one when creating the customer, otherwise returns the Commet publicId.
12
12
  - `status` (string) — Always "canceled" for this event. Revoke access when you receive this.
13
13
  - `canceledAt` (string, optional) — ISO 8601 datetime when the cancellation was requested or triggered.
14
- - `cancelReason` (string | null) — 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).
14
+ - `cancelReason` (string | null) — The reason for cancellation, if provided. Set to "dunning\_exhausted" when all payment retries fail. Historical refund-triggered cancellations may have "refund".
15
15
  - `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.
16
16
 
17
17
  ```json
@@ -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",
@@ -53,5 +53,6 @@ POST /subscriptions/{id}/cancel
53
53
  Some 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.
54
54
 
55
55
  - `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.
56
- - A full refund of a subscription invoice: fires with `cancelReason: "refund"`, alongside `payment.refunded`.
57
56
  - Exhausted dunning retries: fires with `cancelReason: "dunning_exhausted"`, alongside `payment.retry_failed`.
57
+
58
+ Refunding a payment does not cancel its subscription. If you want both outcomes, request a [cancellation](/docs/manage-subscriptions) separately. Older cancellation events triggered by refunds may have `cancelReason: "refund"`.
@@ -18,7 +18,7 @@ All webhook payloads follow a consistent top-level structure with event-specific
18
18
  "timestamp": "2026-06-23T14:30:00.000Z",
19
19
  "organizationId": "8f14e45f-ceea-4e7a-9c3d-1c2b3a4d5e6f",
20
20
  "mode": "live",
21
- "apiVersion": "2026-07-31",
21
+ "apiVersion": "2026-08-27",
22
22
  "data": {
23
23
  "subscriptionId": "sub_1a2b3c4d",
24
24
  "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",
@@ -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",
@@ -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",