@commet/node 9.4.0 → 9.6.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.
- package/dist/index.d.mts +41 -41
- package/dist/index.d.ts +41 -41
- package/dist/index.js +3 -3
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +3 -3
- package/dist/index.mjs.map +1 -1
- package/docs/ai-onboarding/ai-onboarding.md +2 -3
- package/docs/ai-onboarding/billing-best-practices-skill.md +2 -3
- package/docs/ai-onboarding/commet-skill.md +4 -5
- package/docs/ai-onboarding/mcp-server.md +8 -9
- package/docs/ai-onboarding/pricing-models-skill.md +2 -3
- package/docs/ai-onboarding/subscription-patterns-skill.md +2 -3
- package/docs/api-reference/offers.md +2 -2
- package/docs/api-reference/plans.md +1 -1
- package/docs/api-reference/promo-codes.md +3 -3
- package/docs/api-reference/subscriptions.md +4 -4
- package/docs/documentation/api-versioning.md +2 -2
- package/docs/documentation/better-auth.md +0 -1
- package/docs/documentation/choose-a-billing-model.md +14 -8
- package/docs/documentation/cli.md +14 -15
- package/docs/documentation/create-api-key.md +0 -1
- package/docs/documentation/customers/customer-credits.md +0 -1
- package/docs/documentation/customers/customer-portal.md +14 -2
- package/docs/documentation/customers/manage-customers.md +1 -2
- package/docs/documentation/error-handling.md +1 -2
- package/docs/documentation/examples.md +0 -1
- package/docs/documentation/finance/acceptable-use.md +0 -1
- package/docs/documentation/finance/finance-overview.md +0 -1
- package/docs/documentation/finance/local-currency-taxes.md +0 -1
- package/docs/documentation/finance/merchant-of-record.md +0 -1
- package/docs/documentation/finance/payouts-verification.md +6 -3
- package/docs/documentation/finance/payouts.md +0 -1
- package/docs/documentation/finance/supported-countries.md +0 -1
- package/docs/documentation/go/integrate-with-encore.md +7 -8
- package/docs/documentation/go/integrate-with-go.md +8 -9
- package/docs/documentation/introduction.md +3 -4
- package/docs/documentation/invoicing/handle-failed-payments.md +9 -4
- package/docs/documentation/invoicing/invoices-and-billing-cycles.md +10 -10
- package/docs/documentation/invoicing/manage-invoices.md +0 -1
- package/docs/documentation/java/integrate-with-java.md +6 -7
- package/docs/documentation/nodejs/integrate-with-astro.md +6 -7
- package/docs/documentation/nodejs/integrate-with-bun.md +6 -7
- package/docs/documentation/nodejs/integrate-with-express.md +7 -8
- package/docs/documentation/nodejs/integrate-with-hono.md +7 -8
- package/docs/documentation/nodejs/integrate-with-nextjs.md +6 -7
- package/docs/documentation/nodejs/integrate-with-nuxt.md +6 -7
- package/docs/documentation/nodejs/integrate-with-remix.md +6 -7
- package/docs/documentation/nodejs/integrate-with-sveltekit.md +6 -7
- package/docs/documentation/payments/accept-one-time-payments.md +0 -1
- package/docs/documentation/payments/payment-orchestration.md +0 -1
- package/docs/documentation/payments/payment-providers.md +0 -1
- package/docs/documentation/payments/transactions-refunds-and-retries.md +2 -1
- package/docs/documentation/php/integrate-with-laravel.md +8 -9
- package/docs/documentation/php/integrate-with-php.md +6 -7
- package/docs/documentation/php/integrate-with-symfony.md +7 -8
- package/docs/documentation/plans/add-ons.md +0 -1
- package/docs/documentation/plans/balance-and-top-ups.md +1 -2
- package/docs/documentation/plans/configure-features.md +0 -1
- package/docs/documentation/plans/consumption-models.md +7 -8
- package/docs/documentation/plans/create-plans.md +0 -1
- package/docs/documentation/plans/credit-packs.md +0 -1
- package/docs/documentation/plans/one-time-payments.md +0 -1
- package/docs/documentation/plans/plan-groups.md +0 -1
- package/docs/documentation/platform/custom-domains.md +0 -1
- package/docs/documentation/platform/dashboard-metrics-and-events.md +0 -1
- package/docs/documentation/platform/members-and-permissions.md +0 -1
- package/docs/documentation/platform/organization-settings.md +0 -1
- package/docs/documentation/python/integrate-with-django.md +8 -9
- package/docs/documentation/python/integrate-with-fastapi.md +8 -9
- package/docs/documentation/python/integrate-with-flask.md +8 -9
- package/docs/documentation/python/integrate-with-python.md +6 -7
- package/docs/documentation/sales/card-promotions.md +0 -1
- package/docs/documentation/sales/introductory-offers.md +0 -1
- package/docs/documentation/sales/offers.md +0 -1
- package/docs/documentation/sales/promo-codes.md +19 -5
- package/docs/documentation/sales/promotional-offers.md +1 -2
- package/docs/documentation/sales/regional-prices.md +0 -1
- package/docs/documentation/sales/trial-periods.md +8 -8
- package/docs/documentation/sdk-reference.md +1 -2
- package/docs/documentation/subscriptions/manage-subscriptions.md +2 -1
- package/docs/documentation/subscriptions/plan-grants.md +0 -1
- package/docs/documentation/subscriptions/upgrade-and-downgrade-plans.md +0 -1
- package/docs/documentation/testing-sandbox.md +0 -1
- package/docs/documentation/usage/ai-token-billing.md +0 -1
- package/docs/documentation/usage/quota-management.md +0 -1
- package/docs/documentation/usage/seat-management.md +0 -1
- package/docs/documentation/usage/track-usage.md +0 -1
- package/docs/knowledge-base/how-do-balance-and-top-ups-work.md +1 -2
- package/docs/knowledge-base/how-do-credits-credit-packs-and-customer-credits-differ.md +0 -1
- package/docs/knowledge-base/how-do-discounts-work.md +0 -1
- package/docs/knowledge-base/how-do-free-plans-work-without-payment.md +8 -9
- package/docs/knowledge-base/how-do-monthly-quarterly-and-yearly-billing-work.md +6 -7
- package/docs/knowledge-base/how-do-offers-promo-codes-and-card-promotions-work-together.md +0 -1
- package/docs/knowledge-base/how-do-trial-periods-work.md +0 -1
- package/docs/knowledge-base/how-does-billing-work.md +0 -1
- package/docs/knowledge-base/how-does-payment-routing-work.md +0 -1
- package/docs/knowledge-base/how-does-quota-based-billing-work.md +0 -1
- package/docs/knowledge-base/how-does-seat-based-billing-work.md +0 -1
- package/docs/knowledge-base/how-is-proration-calculated-when-changing-plans.md +1 -2
- package/docs/knowledge-base/what-happens-when-a-customer-changes-plans.md +2 -1
- package/docs/knowledge-base/what-happens-when-a-payment-fails.md +0 -1
- package/docs/knowledge-base/what-happens-when-you-change-your-prices.md +0 -1
- package/docs/knowledge-base/what-happens-when-you-refund-or-retry-a-transaction.md +0 -1
- package/docs/knowledge-base/what-invoices-do-customers-receive-and-when.md +13 -14
- package/docs/manifest.json +72 -157
- package/docs/platform-documentation.md +69 -155
- package/docs/schemas.md +10 -9
- package/docs/webhooks/introduction.md +0 -1
- package/docs/webhooks.md +2 -0
- package/docs/webhooks.openapi.json +11058 -0
- package/package.json +1 -1
- package/docs/ai-onboarding/meta.json +0 -17
- package/docs/api-reference/meta.json +0 -7
- package/docs/documentation/customers/meta.json +0 -5
- package/docs/documentation/finance/meta.json +0 -13
- package/docs/documentation/go/meta.json +0 -5
- package/docs/documentation/invoicing/meta.json +0 -9
- package/docs/documentation/java/meta.json +0 -5
- package/docs/documentation/meta.json +0 -36
- package/docs/documentation/nodejs/meta.json +0 -14
- package/docs/documentation/payments/meta.json +0 -10
- package/docs/documentation/php/meta.json +0 -9
- package/docs/documentation/plans/meta.json +0 -14
- package/docs/documentation/platform/meta.json +0 -10
- package/docs/documentation/python/meta.json +0 -10
- package/docs/documentation/sales/meta.json +0 -13
- package/docs/documentation/subscriptions/meta.json +0 -9
- package/docs/documentation/usage/meta.json +0 -10
- package/docs/knowledge-base/meta.json +0 -29
- package/docs/meta.json +0 -11
- package/docs/webhooks/addon-activated.md +0 -44
- package/docs/webhooks/addon-deactivated.md +0 -40
- package/docs/webhooks/balance-depleted.md +0 -37
- package/docs/webhooks/balance-low.md +0 -39
- package/docs/webhooks/balance-topped-up.md +0 -41
- package/docs/webhooks/checkout-ready.md +0 -43
- package/docs/webhooks/credits-depleted.md +0 -35
- package/docs/webhooks/credits-expired.md +0 -35
- package/docs/webhooks/credits-granted.md +0 -37
- package/docs/webhooks/credits-low.md +0 -39
- package/docs/webhooks/credits-purchased.md +0 -41
- package/docs/webhooks/customer-created.md +0 -49
- package/docs/webhooks/customer-state-changed.md +0 -134
- package/docs/webhooks/customer-updated.md +0 -49
- package/docs/webhooks/invoice-created.md +0 -45
- package/docs/webhooks/invoice-overdue.md +0 -53
- package/docs/webhooks/invoice-upcoming.md +0 -43
- package/docs/webhooks/invoice-voided.md +0 -53
- package/docs/webhooks/meta.json +0 -89
- package/docs/webhooks/payment-dispute-resolved.md +0 -52
- package/docs/webhooks/payment-disputed.md +0 -49
- package/docs/webhooks/payment-failed.md +0 -178
- package/docs/webhooks/payment-link-canceled.md +0 -41
- package/docs/webhooks/payment-link-completed.md +0 -89
- package/docs/webhooks/payment-link-created.md +0 -41
- package/docs/webhooks/payment-link-failed.md +0 -87
- package/docs/webhooks/payment-method-attached.md +0 -44
- package/docs/webhooks/payment-method-updated.md +0 -37
- package/docs/webhooks/payment-received.md +0 -202
- package/docs/webhooks/payment-recovered.md +0 -43
- package/docs/webhooks/payment-refunded.md +0 -47
- package/docs/webhooks/payment-retry-failed.md +0 -39
- package/docs/webhooks/payout-available.md +0 -33
- package/docs/webhooks/payout-created.md +0 -48
- package/docs/webhooks/payout-failed.md +0 -52
- package/docs/webhooks/payout-paid.md +0 -48
- package/docs/webhooks/plan-grant-created.md +0 -74
- package/docs/webhooks/plan-grant-expired.md +0 -86
- package/docs/webhooks/plan-grant-revoked.md +0 -86
- package/docs/webhooks/plan-grant-updated.md +0 -86
- package/docs/webhooks/quota-exceeded.md +0 -44
- package/docs/webhooks/quota-threshold-reached.md +0 -41
- package/docs/webhooks/seats-limit-reached.md +0 -39
- package/docs/webhooks/seats-updated.md +0 -39
- package/docs/webhooks/subscription-activated.md +0 -43
- package/docs/webhooks/subscription-canceled.md +0 -58
- package/docs/webhooks/subscription-cancellation-revoked.md +0 -37
- package/docs/webhooks/subscription-cancellation-scheduled.md +0 -45
- package/docs/webhooks/subscription-created.md +0 -35
- package/docs/webhooks/subscription-past-due.md +0 -43
- package/docs/webhooks/subscription-pause-revoked.md +0 -27
- package/docs/webhooks/subscription-pause-scheduled.md +0 -35
- package/docs/webhooks/subscription-pause-updated.md +0 -31
- package/docs/webhooks/subscription-paused.md +0 -35
- package/docs/webhooks/subscription-plan-change-revoked.md +0 -50
- package/docs/webhooks/subscription-plan-change-scheduled.md +0 -55
- package/docs/webhooks/subscription-plan-changed.md +0 -43
- package/docs/webhooks/subscription-reactivated.md +0 -53
- package/docs/webhooks/subscription-resume-failed.md +0 -33
- package/docs/webhooks/subscription-resumed.md +0 -35
- package/docs/webhooks/subscription-updated.md +0 -39
- package/docs/webhooks/trial-checkout-ready.md +0 -39
- package/docs/webhooks/trial-converted.md +0 -39
- package/docs/webhooks/trial-expired.md +0 -39
- package/docs/webhooks/trial-started.md +0 -46
- package/docs/webhooks/trial-will-end.md +0 -41
- package/docs/webhooks/usage-recorded.md +0 -41
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
lastModified: 2026-07-10
|
|
3
|
-
title: "payment.disputed"
|
|
4
|
-
description: "A customer opened a dispute against a payment."
|
|
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 disputed 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
|
-
- `disputeAmount` (number) — The contested amount in cents (100 = $1.00).
|
|
18
|
-
- `currency` (string) — The dispute currency code.
|
|
19
|
-
- `disputeReason` (string | null) — The provider's reason code (e.g. fraudulent, product\_not\_received), or null when none is given.
|
|
20
|
-
|
|
21
|
-
```json
|
|
22
|
-
{
|
|
23
|
-
"event": "payment.disputed",
|
|
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
|
-
"paymentTransactionId": "txn_q7r8s9",
|
|
30
|
-
"provider": "stripe",
|
|
31
|
-
"paymentLinkId": null,
|
|
32
|
-
"invoiceId": "inv_n4o5p6",
|
|
33
|
-
"invoiceNumber": "INV-0043",
|
|
34
|
-
"customerId": "user_123",
|
|
35
|
-
"subscriptionId": "sub_1a2b3c4d",
|
|
36
|
-
"disputeAmount": 9900,
|
|
37
|
-
"currency": "usd",
|
|
38
|
-
"disputeReason": "fraudulent"
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
```
|
|
42
|
-
|
|
43
|
-
## When this fires
|
|
44
|
-
|
|
45
|
-
When the cardholder's bank notifies the payment provider that a charge is being disputed (a chargeback). The disputed amount is frozen from your payout balance while the dispute is open. As the Merchant of Record, Commet handles the evidence and resolution process with the provider.
|
|
46
|
-
|
|
47
|
-
`disputeAmount` is the contested amount in cents; `disputeReason` is the provider's reason code (for example `fraudulent` or `product_not_received`), or `null` when the provider gives none.
|
|
48
|
-
|
|
49
|
-
The resolution fires `payment.dispute_resolved` with the outcome. Use this event to flag the account internally — repeated disputes are a strong fraud signal.
|
|
@@ -1,178 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
lastModified: 2026-09-08
|
|
3
|
-
title: "payment.failed"
|
|
4
|
-
description: "Fired when a subscription charge fails, including resume charges 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, if available.
|
|
12
|
-
- `invoiceNumber` (string) — The human-readable invoice number, if available.
|
|
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") — The payment provider the charge was routed to: stripe, commet, or dlocal.
|
|
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
|
-
- `failureCode` (string) — The failure code from the payment processor.
|
|
19
|
-
- `failureMessage` (string) — A human-readable failure message.
|
|
20
|
-
- `recoveryUrl` (string | null) — 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.
|
|
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.
|
|
53
|
-
|
|
54
|
-
### Initial attempt
|
|
55
|
-
|
|
56
|
-
The original charge attempt, before recovery.
|
|
57
|
-
|
|
58
|
-
```json
|
|
59
|
-
{
|
|
60
|
-
"event": "payment.failed",
|
|
61
|
-
"timestamp": "2026-06-23T14:30:00.000Z",
|
|
62
|
-
"organizationId": "8f14e45f-ceea-4e7a-9c3d-1c2b3a4d5e6f",
|
|
63
|
-
"mode": "live",
|
|
64
|
-
"apiVersion": "2026-08-27",
|
|
65
|
-
"data": {
|
|
66
|
-
"paymentContext": {
|
|
67
|
-
"reason": "recurring_billing",
|
|
68
|
-
"paymentLinkId": null,
|
|
69
|
-
"recovery": null
|
|
70
|
-
},
|
|
71
|
-
"invoiceId": "inv_n4o5p6",
|
|
72
|
-
"invoiceNumber": "INV-0043",
|
|
73
|
-
"customerId": "user_123",
|
|
74
|
-
"subscriptionId": "sub_1a2b3c4d",
|
|
75
|
-
"provider": "stripe",
|
|
76
|
-
"paymentMethod": "card",
|
|
77
|
-
"subPaymentMethod": null,
|
|
78
|
-
"failureCode": "card_declined",
|
|
79
|
-
"failureMessage": "Your card was declined.",
|
|
80
|
-
"recoveryUrl": "https://pay.commet.co/recover/tok_9f8e7d6c"
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
```
|
|
84
|
-
|
|
85
|
-
### Manual recovery
|
|
86
|
-
|
|
87
|
-
The customer recovers an overdue subscription. The original charge reason is preserved.
|
|
88
|
-
|
|
89
|
-
```json
|
|
90
|
-
{
|
|
91
|
-
"event": "payment.failed",
|
|
92
|
-
"timestamp": "2026-06-23T14:30:00.000Z",
|
|
93
|
-
"organizationId": "8f14e45f-ceea-4e7a-9c3d-1c2b3a4d5e6f",
|
|
94
|
-
"mode": "live",
|
|
95
|
-
"apiVersion": "2026-08-27",
|
|
96
|
-
"data": {
|
|
97
|
-
"paymentContext": {
|
|
98
|
-
"reason": "recurring_billing",
|
|
99
|
-
"paymentLinkId": null,
|
|
100
|
-
"recovery": {
|
|
101
|
-
"type": "payment_recovery"
|
|
102
|
-
}
|
|
103
|
-
},
|
|
104
|
-
"invoiceId": "inv_n4o5p6",
|
|
105
|
-
"invoiceNumber": "INV-0043",
|
|
106
|
-
"customerId": "user_123",
|
|
107
|
-
"subscriptionId": "sub_1a2b3c4d",
|
|
108
|
-
"provider": "stripe",
|
|
109
|
-
"paymentMethod": "card",
|
|
110
|
-
"subPaymentMethod": null,
|
|
111
|
-
"failureCode": "card_declined",
|
|
112
|
-
"failureMessage": "Your card was declined.",
|
|
113
|
-
"recoveryUrl": "https://pay.commet.co/recover/tok_9f8e7d6c"
|
|
114
|
-
}
|
|
115
|
-
}
|
|
116
|
-
```
|
|
117
|
-
|
|
118
|
-
### Dunning retries
|
|
119
|
-
|
|
120
|
-
The second automatic retry of a subscription resume charge, out of four allowed retries. The reason remains subscription\_resume.
|
|
121
|
-
|
|
122
|
-
```json
|
|
123
|
-
{
|
|
124
|
-
"event": "payment.failed",
|
|
125
|
-
"timestamp": "2026-06-23T14:30:00.000Z",
|
|
126
|
-
"organizationId": "8f14e45f-ceea-4e7a-9c3d-1c2b3a4d5e6f",
|
|
127
|
-
"mode": "live",
|
|
128
|
-
"apiVersion": "2026-08-27",
|
|
129
|
-
"data": {
|
|
130
|
-
"paymentContext": {
|
|
131
|
-
"reason": "subscription_resume",
|
|
132
|
-
"paymentLinkId": null,
|
|
133
|
-
"recovery": {
|
|
134
|
-
"type": "dunning_retry",
|
|
135
|
-
"attempt": 2,
|
|
136
|
-
"maxAttempts": 4
|
|
137
|
-
}
|
|
138
|
-
},
|
|
139
|
-
"invoiceId": "inv_n4o5p6",
|
|
140
|
-
"invoiceNumber": "INV-0043",
|
|
141
|
-
"customerId": "user_123",
|
|
142
|
-
"subscriptionId": "sub_1a2b3c4d",
|
|
143
|
-
"provider": "stripe",
|
|
144
|
-
"paymentMethod": "card",
|
|
145
|
-
"subPaymentMethod": null,
|
|
146
|
-
"failureCode": "card_declined",
|
|
147
|
-
"failureMessage": "Your card was declined.",
|
|
148
|
-
"recoveryUrl": "https://pay.commet.co/recover/tok_9f8e7d6c"
|
|
149
|
-
}
|
|
150
|
-
}
|
|
151
|
-
```
|
|
152
|
-
|
|
153
|
-
### No context
|
|
154
|
-
|
|
155
|
-
The charge context was not captured. Do not infer the original reason from the subscription's current state.
|
|
156
|
-
|
|
157
|
-
```json
|
|
158
|
-
{
|
|
159
|
-
"event": "payment.failed",
|
|
160
|
-
"timestamp": "2026-06-23T14:30:00.000Z",
|
|
161
|
-
"organizationId": "8f14e45f-ceea-4e7a-9c3d-1c2b3a4d5e6f",
|
|
162
|
-
"mode": "live",
|
|
163
|
-
"apiVersion": "2026-08-27",
|
|
164
|
-
"data": {
|
|
165
|
-
"paymentContext": null,
|
|
166
|
-
"invoiceId": "inv_n4o5p6",
|
|
167
|
-
"invoiceNumber": "INV-0043",
|
|
168
|
-
"customerId": "user_123",
|
|
169
|
-
"subscriptionId": "sub_1a2b3c4d",
|
|
170
|
-
"provider": "stripe",
|
|
171
|
-
"paymentMethod": "card",
|
|
172
|
-
"subPaymentMethod": null,
|
|
173
|
-
"failureCode": "card_declined",
|
|
174
|
-
"failureMessage": "Your card was declined.",
|
|
175
|
-
"recoveryUrl": "https://pay.commet.co/recover/tok_9f8e7d6c"
|
|
176
|
-
}
|
|
177
|
-
}
|
|
178
|
-
```
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
lastModified: 2026-07-10
|
|
3
|
-
title: "payment_link.canceled"
|
|
4
|
-
description: "A payment link was canceled before being paid."
|
|
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
|
-
- `paymentId` (string) — The payment link ID.
|
|
11
|
-
- `status` (string) — The link status. Always "canceled" for this event.
|
|
12
|
-
- `amount` (number) — The total amount of the canceled link in cents (100 = $1.00).
|
|
13
|
-
- `currency` (string) — The payment currency code.
|
|
14
|
-
- `description` (string) — The payment description shown to the customer.
|
|
15
|
-
- `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
|
-
```json
|
|
18
|
-
{
|
|
19
|
-
"event": "payment_link.canceled",
|
|
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
|
-
"paymentId": "pay_l1m2n3",
|
|
26
|
-
"status": "canceled",
|
|
27
|
-
"amount": 5000,
|
|
28
|
-
"currency": "usd",
|
|
29
|
-
"description": "One-time onboarding fee",
|
|
30
|
-
"customerId": "user_123"
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
```
|
|
34
|
-
|
|
35
|
-
## When this fires
|
|
36
|
-
|
|
37
|
-
When a pending [payment link](/docs/accept-one-time-payments) is canceled before the customer pays it. A canceled link can no longer be paid.
|
|
38
|
-
|
|
39
|
-
Payment links never expire on their own — there is no expiry event. A link stays payable until it is paid or explicitly canceled.
|
|
40
|
-
|
|
41
|
-
The event fires the same way regardless of which payment provider processes the charge.
|
|
@@ -1,89 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
lastModified: 2026-07-10
|
|
3
|
-
title: "payment_link.completed"
|
|
4
|
-
description: "A payment link was paid successfully."
|
|
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
|
-
- `paymentId` (string) — The payment link ID.
|
|
12
|
-
- `status` (string) — The link status. Always "succeeded" for this event.
|
|
13
|
-
- `amount` (number) — The collected amount in cents (100 = $1.00).
|
|
14
|
-
- `currency` (string) — The payment currency code.
|
|
15
|
-
- `description` (string) — The payment description shown to the customer.
|
|
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.
|
|
17
|
-
- `invoiceId` (string) — The one-time invoice generated for this payment.
|
|
18
|
-
- `invoiceNumber` (string) — The human-readable invoice number.
|
|
19
|
-
- `paymentTransactionId` (string | null) — The payment transaction ID for the settled charge.
|
|
20
|
-
- `paymentMethod` (PaymentMethod | null) — The payment method: card, oxxo, or mercado\_pago. Null when unknown.
|
|
21
|
-
- `subPaymentMethod` (SubPaymentMethod | null) — The source of funds for this charge, when reported by the provider. Null when unavailable or unknown.
|
|
22
|
-
|
|
23
|
-
### `paymentContext`
|
|
24
|
-
|
|
25
|
-
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.
|
|
26
|
-
|
|
27
|
-
`reason` (string): The original reason, preserved across payment attempts.
|
|
28
|
-
|
|
29
|
-
`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.
|
|
30
|
-
|
|
31
|
-
`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.
|
|
32
|
-
|
|
33
|
-
`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.
|
|
34
|
-
|
|
35
|
-
`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.
|
|
36
|
-
|
|
37
|
-
`first_subscription_payment`: The initial subscription payment.
|
|
38
|
-
|
|
39
|
-
`trial_conversion`: The payment when a free trial ends.
|
|
40
|
-
|
|
41
|
-
`recurring_billing`: A subscription renewal.
|
|
42
|
-
|
|
43
|
-
`plan_change`: A charge caused by a plan change.
|
|
44
|
-
|
|
45
|
-
`reactivation`: A charge to reactivate a canceled subscription.
|
|
46
|
-
|
|
47
|
-
`subscription_resume`: A charge to resume a paused subscription.
|
|
48
|
-
|
|
49
|
-
`one_time_payment`: A one-time payment, including payment links.
|
|
50
|
-
|
|
51
|
-
`overage`: A charge for usage beyond the included allowance.
|
|
52
|
-
|
|
53
|
-
`adjustment`: A charge from an adjustment invoice.
|
|
54
|
-
|
|
55
|
-
```json
|
|
56
|
-
{
|
|
57
|
-
"event": "payment_link.completed",
|
|
58
|
-
"timestamp": "2026-06-23T14:30:00.000Z",
|
|
59
|
-
"organizationId": "8f14e45f-ceea-4e7a-9c3d-1c2b3a4d5e6f",
|
|
60
|
-
"mode": "live",
|
|
61
|
-
"apiVersion": "2026-08-27",
|
|
62
|
-
"data": {
|
|
63
|
-
"paymentContext": {
|
|
64
|
-
"reason": "one_time_payment",
|
|
65
|
-
"paymentLinkId": "pay_l1m2n3",
|
|
66
|
-
"recovery": null
|
|
67
|
-
},
|
|
68
|
-
"paymentId": "pay_l1m2n3",
|
|
69
|
-
"status": "succeeded",
|
|
70
|
-
"amount": 5000,
|
|
71
|
-
"currency": "usd",
|
|
72
|
-
"description": "One-time onboarding fee",
|
|
73
|
-
"customerId": "user_123",
|
|
74
|
-
"invoiceId": "inv_n4o5p6",
|
|
75
|
-
"invoiceNumber": "INV-0044",
|
|
76
|
-
"paymentTransactionId": "txn_q7r8s9",
|
|
77
|
-
"paymentMethod": "card",
|
|
78
|
-
"subPaymentMethod": null
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
```
|
|
82
|
-
|
|
83
|
-
## When this fires
|
|
84
|
-
|
|
85
|
-
When a customer pays a [payment link](/docs/accept-one-time-payments) on the hosted pay page and the charge settles. Commet generates a one-time invoice (`invoiceType: "one_time_payment"`) and a payment transaction at the same time; the payload carries the `invoiceId` and `paymentTransactionId`.
|
|
86
|
-
|
|
87
|
-
This is the event to fulfill the purchase on — the money has been collected.
|
|
88
|
-
|
|
89
|
-
The event fires the same way regardless of which payment provider processes the charge.
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
lastModified: 2026-07-10
|
|
3
|
-
title: "payment_link.created"
|
|
4
|
-
description: "A payment link was created and is ready to be paid."
|
|
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
|
-
- `paymentId` (string) — The payment link ID.
|
|
11
|
-
- `status` (string) — The link status. Always "pending" for this event.
|
|
12
|
-
- `amount` (number) — The total amount to collect in cents (100 = $1.00).
|
|
13
|
-
- `currency` (string) — The payment currency code.
|
|
14
|
-
- `description` (string) — The payment description shown to the customer.
|
|
15
|
-
- `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
|
-
```json
|
|
18
|
-
{
|
|
19
|
-
"event": "payment_link.created",
|
|
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
|
-
"paymentId": "pay_l1m2n3",
|
|
26
|
-
"status": "pending",
|
|
27
|
-
"amount": 5000,
|
|
28
|
-
"currency": "usd",
|
|
29
|
-
"description": "One-time onboarding fee",
|
|
30
|
-
"customerId": "user_123"
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
```
|
|
34
|
-
|
|
35
|
-
## When this fires
|
|
36
|
-
|
|
37
|
-
When a payment link is created with [Commet Pay](/docs/accept-one-time-payments). A payment link is a one-time, customer-present charge — there's no subscription and no plan behind it. The link is `pending`: the customer has not paid yet.
|
|
38
|
-
|
|
39
|
-
Do not fulfill the purchase on this event. Wait for `payment_link.completed`.
|
|
40
|
-
|
|
41
|
-
The event fires the same way regardless of which payment provider processes the charge.
|
|
@@ -1,87 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
lastModified: 2026-07-10
|
|
3
|
-
title: "payment_link.failed"
|
|
4
|
-
description: "A payment link charge attempt 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
|
-
- `paymentContext` (object | null) — Charge context captured for new payments. Null for historical payments with no captured context.
|
|
11
|
-
- `paymentId` (string) — The payment link ID.
|
|
12
|
-
- `status` (string) — The link status. Always "failed" for this event.
|
|
13
|
-
- `amount` (number) — The amount that was attempted in cents (100 = $1.00).
|
|
14
|
-
- `currency` (string) — The payment currency code.
|
|
15
|
-
- `description` (string) — The payment description shown to the customer.
|
|
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.
|
|
17
|
-
- `failureCode` (string) — The failure code from the payment processor.
|
|
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.
|
|
53
|
-
|
|
54
|
-
```json
|
|
55
|
-
{
|
|
56
|
-
"event": "payment_link.failed",
|
|
57
|
-
"timestamp": "2026-06-23T14:30:00.000Z",
|
|
58
|
-
"organizationId": "8f14e45f-ceea-4e7a-9c3d-1c2b3a4d5e6f",
|
|
59
|
-
"mode": "live",
|
|
60
|
-
"apiVersion": "2026-08-27",
|
|
61
|
-
"data": {
|
|
62
|
-
"paymentContext": {
|
|
63
|
-
"reason": "one_time_payment",
|
|
64
|
-
"paymentLinkId": "pay_l1m2n3",
|
|
65
|
-
"recovery": null
|
|
66
|
-
},
|
|
67
|
-
"paymentId": "pay_l1m2n3",
|
|
68
|
-
"status": "failed",
|
|
69
|
-
"amount": 5000,
|
|
70
|
-
"currency": "usd",
|
|
71
|
-
"description": "One-time onboarding fee",
|
|
72
|
-
"customerId": "user_123",
|
|
73
|
-
"failureCode": "card_declined",
|
|
74
|
-
"failureMessage": "Your card was declined.",
|
|
75
|
-
"paymentMethod": "card",
|
|
76
|
-
"subPaymentMethod": null
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
```
|
|
80
|
-
|
|
81
|
-
## When this fires
|
|
82
|
-
|
|
83
|
-
When a charge attempt on a [payment link](/docs/accept-one-time-payments) is declined. The link stays open — a failed link is retryable, and the customer can pay it again. A later successful attempt fires `payment_link.completed`.
|
|
84
|
-
|
|
85
|
-
`failureCode` is the processor's code (for example `card_declined`) and `failureMessage` is the human-readable reason, or `null` when the provider gives none.
|
|
86
|
-
|
|
87
|
-
The event fires the same way regardless of which payment provider processes the charge.
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
lastModified: 2026-09-24
|
|
3
|
-
title: "payment_method.attached"
|
|
4
|
-
description: "A payment method was saved for a customer's subscription."
|
|
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 subscription the payment method was saved for.
|
|
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.
|
|
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.
|
|
14
|
-
|
|
15
|
-
```json
|
|
16
|
-
{
|
|
17
|
-
"event": "payment_method.attached",
|
|
18
|
-
"timestamp": "2026-06-23T14:30:00.000Z",
|
|
19
|
-
"organizationId": "8f14e45f-ceea-4e7a-9c3d-1c2b3a4d5e6f",
|
|
20
|
-
"mode": "live",
|
|
21
|
-
"apiVersion": "2026-08-27",
|
|
22
|
-
"data": {
|
|
23
|
-
"subscriptionId": "sub_1a2b3c4d",
|
|
24
|
-
"customerId": "user_123",
|
|
25
|
-
"paymentMethod": "card",
|
|
26
|
-
"card": {
|
|
27
|
-
"brand": "visa",
|
|
28
|
-
"last4": "4242",
|
|
29
|
-
"expMonth": 12,
|
|
30
|
-
"expYear": 2030
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
```
|
|
35
|
-
|
|
36
|
-
## When this fires
|
|
37
|
-
|
|
38
|
-
Fired when Commet records a payment method for a subscription: after a paid checkout, when a trial starts with a card on file, or when a zero-total checkout completes with a saved payment method.
|
|
39
|
-
|
|
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`.
|
|
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
|
-
|
|
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,37 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
lastModified: 2026-09-24
|
|
3
|
-
title: "payment_method.updated"
|
|
4
|
-
description: "A customer's default payment method was replaced."
|
|
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
|
-
- `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.
|
|
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.
|
|
13
|
-
|
|
14
|
-
```json
|
|
15
|
-
{
|
|
16
|
-
"event": "payment_method.updated",
|
|
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
|
-
"customerId": "user_123",
|
|
23
|
-
"paymentMethod": "mercado_pago",
|
|
24
|
-
"card": null
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
```
|
|
28
|
-
|
|
29
|
-
## When this fires
|
|
30
|
-
|
|
31
|
-
Fired when a customer replaces their default payment method through the customer portal. The new method applies to all of the customer's subscriptions.
|
|
32
|
-
|
|
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`.
|
|
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
|
-
|
|
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.
|