@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.
- package/dist/index.d.mts +2 -2
- package/dist/index.d.ts +2 -2
- 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/promo-codes.md +1 -1
- package/docs/api-reference/subscriptions.md +1 -1
- package/docs/documentation/api-versioning.md +1 -2
- package/docs/documentation/better-auth.md +0 -1
- package/docs/documentation/choose-a-billing-model.md +14 -8
- package/docs/documentation/cli.md +1 -2
- 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 +0 -1
- 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 +0 -1
- package/docs/documentation/plans/configure-features.md +0 -1
- package/docs/documentation/plans/consumption-models.md +0 -1
- 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 +0 -1
- 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 +0 -1
- package/docs/knowledge-base/how-do-monthly-quarterly-and-yearly-billing-work.md +0 -1
- 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 +0 -1
- package/docs/knowledge-base/what-happens-when-a-customer-changes-plans.md +0 -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 +0 -1
- package/docs/manifest.json +72 -157
- package/docs/platform-documentation.md +69 -155
- 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,39 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
lastModified: 2026-06-12
|
|
3
|
-
title: "credits.low"
|
|
4
|
-
description: "Remaining credits dropped below 10% of the period grant."
|
|
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 ID.
|
|
11
|
-
- `customerId` (string) — The customer ID. Returns your externalId if you provided one when creating the customer, otherwise returns the Commet publicId.
|
|
12
|
-
- `remainingCredits` (number) — Total credits remaining (plan plus purchased).
|
|
13
|
-
- `thresholdCredits` (number) — The low-credit threshold that was crossed: 10% of the period's granted plan credits.
|
|
14
|
-
- `periodCredits` (number) — The plan credits granted at the last period reset.
|
|
15
|
-
|
|
16
|
-
```json
|
|
17
|
-
{
|
|
18
|
-
"event": "credits.low",
|
|
19
|
-
"timestamp": "2026-06-23T14:30:00.000Z",
|
|
20
|
-
"organizationId": "8f14e45f-ceea-4e7a-9c3d-1c2b3a4d5e6f",
|
|
21
|
-
"mode": "live",
|
|
22
|
-
"apiVersion": "2026-08-27",
|
|
23
|
-
"data": {
|
|
24
|
-
"subscriptionId": "sub_1a2b3c4d",
|
|
25
|
-
"customerId": "user_123",
|
|
26
|
-
"remainingCredits": 42,
|
|
27
|
-
"thresholdCredits": 50,
|
|
28
|
-
"periodCredits": 500
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
```
|
|
32
|
-
|
|
33
|
-
## When this fires
|
|
34
|
-
|
|
35
|
-
The async usage processor watches every credit deduction. When a batch of usage moves the remaining credits (plan plus purchased) from above to at-or-below 10% of the credits granted at the last period reset, this event fires once. It does not re-fire while the balance stays low, and the next period reset re-arms it.
|
|
36
|
-
|
|
37
|
-
If a single burst of usage jumps straight past zero, only `credits.depleted` fires.
|
|
38
|
-
|
|
39
|
-
Use it to prompt the customer to buy a credit pack before they hit zero.
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
lastModified: 2026-06-12
|
|
3
|
-
title: "credits.purchased"
|
|
4
|
-
description: "A credit pack purchase was completed."
|
|
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 ID.
|
|
11
|
-
- `customerId` (string) — The customer ID. Returns your externalId if you provided one when creating the customer, otherwise returns the Commet publicId.
|
|
12
|
-
- `invoiceId` (string) — The invoice issued for the purchase.
|
|
13
|
-
- `invoiceNumber` (string) — The human-readable invoice number.
|
|
14
|
-
- `creditPackName` (string) — The purchased credit pack's name.
|
|
15
|
-
- `credits` (number) — The number of credits purchased.
|
|
16
|
-
|
|
17
|
-
```json
|
|
18
|
-
{
|
|
19
|
-
"event": "credits.purchased",
|
|
20
|
-
"timestamp": "2026-06-23T14:30:00.000Z",
|
|
21
|
-
"organizationId": "8f14e45f-ceea-4e7a-9c3d-1c2b3a4d5e6f",
|
|
22
|
-
"mode": "live",
|
|
23
|
-
"apiVersion": "2026-08-27",
|
|
24
|
-
"data": {
|
|
25
|
-
"subscriptionId": "sub_1a2b3c4d",
|
|
26
|
-
"customerId": "user_123",
|
|
27
|
-
"invoiceId": "inv_t1u2v3",
|
|
28
|
-
"invoiceNumber": "INV-0051",
|
|
29
|
-
"creditPackName": "Booster 500",
|
|
30
|
-
"credits": 500
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
```
|
|
34
|
-
|
|
35
|
-
## When this fires
|
|
36
|
-
|
|
37
|
-
When a customer buys a credit pack through the customer portal and the payment succeeds. Purchased credits never expire — unlike plan credits, they survive period resets.
|
|
38
|
-
|
|
39
|
-
Plan-included credits granted at each period reset fire `credits.granted` instead.
|
|
40
|
-
|
|
41
|
-
Use it to confirm top-up purchases in your own UI or analytics.
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
lastModified: 2026-06-12
|
|
3
|
-
title: "customer.created"
|
|
4
|
-
description: "Fired when a customer is created. The payload mirrors the customer resource from GET /customers."
|
|
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 Commet customer ID (cus\_...).
|
|
11
|
-
- `externalId` (string | null) — Your own identifier for this customer, if you provided one.
|
|
12
|
-
- `fullName` (string | null) — The customer's full name.
|
|
13
|
-
- `email` (string) — The customer's email.
|
|
14
|
-
- `taxDocument` (string | null) — The customer's tax identification number, if provided.
|
|
15
|
-
- `documentType` (string | null) — The local tax document type label inferred from the customer's country (e.g. CUIT, RFC, RUT), or null when no tax document was provided.
|
|
16
|
-
- `timezone` (string | null) — The customer's timezone.
|
|
17
|
-
- `metadata` (object | null) — Custom key-value metadata you attached to the customer.
|
|
18
|
-
- `createdAt` (string) — ISO 8601 datetime when the customer was created.
|
|
19
|
-
- `updatedAt` (string) — ISO 8601 datetime of the last update.
|
|
20
|
-
|
|
21
|
-
```json
|
|
22
|
-
{
|
|
23
|
-
"event": "customer.created",
|
|
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
|
-
"id": "cus_1a2b3c4d",
|
|
30
|
-
"externalId": "user_123",
|
|
31
|
-
"fullName": "Ada Lovelace",
|
|
32
|
-
"email": "ada@acme.com",
|
|
33
|
-
"taxDocument": "20-12345678-9",
|
|
34
|
-
"documentType": "CUIT",
|
|
35
|
-
"timezone": "UTC",
|
|
36
|
-
"metadata": {
|
|
37
|
-
"plan_intent": "pro"
|
|
38
|
-
},
|
|
39
|
-
"createdAt": "2026-03-25T14:29:00.000Z",
|
|
40
|
-
"updatedAt": "2026-03-25T14:29:00.000Z"
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
```
|
|
44
|
-
|
|
45
|
-
## Resource shape and version pinning
|
|
46
|
-
|
|
47
|
-
The payload is the customer resource exactly as the REST API returns it for your pinned API version. If your endpoint is pinned to a version before `2026-06-07`, the `email` field arrives as `billingEmail` — the same downgrade applied to `GET /customers` responses.
|
|
48
|
-
|
|
49
|
-
The event fires for every creation path: `POST /customers`, batch create, the SDKs, and the dashboard. Creating a customer with an `externalId` that already exists returns the existing customer and does NOT fire this event again.
|
|
@@ -1,134 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
lastModified: 2026-08-17
|
|
3
|
-
title: "customer.state_changed"
|
|
4
|
-
description: "Aggregate entitlement event — what can this customer access right now."
|
|
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
|
-
- `trigger` (string) — What caused the transition. One of: subscription\_created, subscription\_activated, subscription\_canceled, subscription\_paused, subscription\_resumed, plan\_change, past\_due, trial\_started, trial\_converted, trial\_expired, cancellation\_scheduled, cancellation\_revoked, seats\_updated, addon\_activated, addon\_deactivated, credits\_depleted, balance\_depleted, quota\_exceeded, plan\_access\_granted, plan\_access\_ended.
|
|
12
|
-
- `status` (string) — The customer's current subscription status, or "none" when no live subscription exists. Access is granted while trialing, active, or past\_due — past\_due is a permissive grace window during dunning.
|
|
13
|
-
- `subscriptionId` (string | null) — The live subscription ID, or null when status is none.
|
|
14
|
-
- `plan` (WebhookPlanRef | null) — The current plan (id and name), or null when status is none.
|
|
15
|
-
- `billingInterval` (string | null) — The current billing interval.
|
|
16
|
-
- `consumptionModel` (string | null) — The plan's consumption model: metered, credits, or balance.
|
|
17
|
-
- `features` (unknown\[]) — Current feature access, discriminated by type. Boolean features expose enabled; usage features expose model-specific consumption; seats and quota expose usage allowances.
|
|
18
|
-
- `seats` (WebhookSeatSummary\[]) — Summary of seats-type features: code, current, included, remaining, unlimited.
|
|
19
|
-
- `credits` (WebhookCreditsBalance | null) — For credits plans: planCredits, purchasedCredits, totalCredits. Null otherwise.
|
|
20
|
-
- `balance` (WebhookBalance | null) — For balance plans: currentBalance in rate scale (10000 = $1.00). Null otherwise.
|
|
21
|
-
|
|
22
|
-
```json
|
|
23
|
-
{
|
|
24
|
-
"event": "customer.state_changed",
|
|
25
|
-
"timestamp": "2026-06-23T14:30:00.000Z",
|
|
26
|
-
"organizationId": "8f14e45f-ceea-4e7a-9c3d-1c2b3a4d5e6f",
|
|
27
|
-
"mode": "live",
|
|
28
|
-
"apiVersion": "2026-08-27",
|
|
29
|
-
"data": {
|
|
30
|
-
"customerId": "user_123",
|
|
31
|
-
"trigger": "subscription_activated",
|
|
32
|
-
"status": "active",
|
|
33
|
-
"subscriptionId": "sub_1a2b3c4d",
|
|
34
|
-
"plan": {
|
|
35
|
-
"id": "pln_pro_monthly",
|
|
36
|
-
"name": "Pro"
|
|
37
|
-
},
|
|
38
|
-
"billingInterval": "monthly",
|
|
39
|
-
"consumptionModel": "metered",
|
|
40
|
-
"features": [
|
|
41
|
-
{
|
|
42
|
-
"code": "api_calls",
|
|
43
|
-
"name": "API Calls",
|
|
44
|
-
"unitName": "request",
|
|
45
|
-
"type": "usage",
|
|
46
|
-
"allowed": true,
|
|
47
|
-
"consumption": {
|
|
48
|
-
"model": "metered",
|
|
49
|
-
"period": {
|
|
50
|
-
"start": "2026-07-01T00:00:00.000Z",
|
|
51
|
-
"end": "2026-08-01T00:00:00.000Z"
|
|
52
|
-
},
|
|
53
|
-
"unitsUsed": 120,
|
|
54
|
-
"includedUnits": 1000,
|
|
55
|
-
"remainingUnits": 880,
|
|
56
|
-
"unlimited": false,
|
|
57
|
-
"overage": {
|
|
58
|
-
"enabled": true,
|
|
59
|
-
"units": 0,
|
|
60
|
-
"unitPrice": {
|
|
61
|
-
"amount": 50,
|
|
62
|
-
"currency": "usd",
|
|
63
|
-
"scale": 10000
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
},
|
|
68
|
-
{
|
|
69
|
-
"code": "editors",
|
|
70
|
-
"name": "Editors",
|
|
71
|
-
"unitName": "seat",
|
|
72
|
-
"type": "seats",
|
|
73
|
-
"allowed": true,
|
|
74
|
-
"usage": {
|
|
75
|
-
"period": {
|
|
76
|
-
"start": "2026-07-01T00:00:00.000Z",
|
|
77
|
-
"end": "2026-08-01T00:00:00.000Z"
|
|
78
|
-
},
|
|
79
|
-
"unitsUsed": 3,
|
|
80
|
-
"includedUnits": 5,
|
|
81
|
-
"remainingUnits": 2,
|
|
82
|
-
"unlimited": false,
|
|
83
|
-
"overage": {
|
|
84
|
-
"enabled": false,
|
|
85
|
-
"units": 0
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
],
|
|
90
|
-
"seats": [
|
|
91
|
-
{
|
|
92
|
-
"code": "editors",
|
|
93
|
-
"current": 3,
|
|
94
|
-
"included": 5,
|
|
95
|
-
"remaining": 2,
|
|
96
|
-
"unlimited": false
|
|
97
|
-
}
|
|
98
|
-
],
|
|
99
|
-
"credits": null,
|
|
100
|
-
"balance": null
|
|
101
|
-
}
|
|
102
|
-
}
|
|
103
|
-
```
|
|
104
|
-
|
|
105
|
-
## One event to sync access
|
|
106
|
-
|
|
107
|
-
Instead of handling every lifecycle event (`subscription.activated`, `subscription.canceled`, `trial.expired`, ...) to keep your access flags in sync, handle this single event. Every entitlement transition fires it with the customer's **current** state, computed at delivery time:
|
|
108
|
-
|
|
109
|
-
| trigger | When |
|
|
110
|
-
| ------------------------ | ------------------------------------------------------------------------------------------------------------ |
|
|
111
|
-
| `subscription_created` | A subscription was created (status `pending_payment` — no access yet). |
|
|
112
|
-
| `subscription_activated` | A payment confirmed the subscription. |
|
|
113
|
-
| `trial_started` | A trial began. |
|
|
114
|
-
| `trial_converted` | A trialing customer converted to paid via plan change. |
|
|
115
|
-
| `trial_expired` | A trial ran out and regular billing began. |
|
|
116
|
-
| `plan_change` | A plan change executed (immediate or scheduled). |
|
|
117
|
-
| `cancellation_scheduled` | A cancellation was scheduled — access continues until period end. |
|
|
118
|
-
| `cancellation_revoked` | A scheduled cancellation was reverted. |
|
|
119
|
-
| `subscription_canceled` | The subscription terminated — `status` becomes `none`. |
|
|
120
|
-
| `past_due` | A recurring payment failed — a grace window begins: usage and seats keep working, new purchases are blocked. |
|
|
121
|
-
| `seats_updated` | A customer's seat count changed. |
|
|
122
|
-
| `addon_activated` | An add-on was activated on the subscription. |
|
|
123
|
-
| `addon_deactivated` | An add-on was deactivated from the subscription. |
|
|
124
|
-
| `credits_depleted` | The subscription ran out of credits. |
|
|
125
|
-
| `balance_depleted` | The subscription ran out of prepaid balance. |
|
|
126
|
-
| `quota_exceeded` | Usage passed a feature's included quantity. |
|
|
127
|
-
| `plan_access_granted` | A Plan Grant temporarily expanded the customer's access without changing subscription billing. |
|
|
128
|
-
| `plan_access_ended` | A Plan Grant expired or was revoked; the payload contains the resulting current state. |
|
|
129
|
-
|
|
130
|
-
## Handling the payload
|
|
131
|
-
|
|
132
|
-
Use `status` as the access gate (`trialing` and `active` grant access), `features` for per-feature limits, and `credits`/`balance` for consumption headroom on credits/balance plans. The payload reflects the state at delivery time — if two transitions happen back to back, the later event always carries the final state, so processing events in `timestamp` order converges to the correct result.
|
|
133
|
-
|
|
134
|
-
See [Plan Grants](/docs/plan-grants) for the temporary access lifecycle.
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
lastModified: 2026-06-12
|
|
3
|
-
title: "customer.updated"
|
|
4
|
-
description: "Fired when a customer's details change. Carries the full current customer resource."
|
|
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 Commet customer ID (cus\_...).
|
|
11
|
-
- `externalId` (string | null) — Your own identifier for this customer, if you provided one.
|
|
12
|
-
- `fullName` (string | null) — The customer's full name.
|
|
13
|
-
- `email` (string) — The customer's email.
|
|
14
|
-
- `taxDocument` (string | null) — The customer's tax identification number, if provided.
|
|
15
|
-
- `documentType` (string | null) — The local tax document type label inferred from the customer's country (e.g. CUIT, RFC, RUT), or null when no tax document was provided.
|
|
16
|
-
- `timezone` (string | null) — The customer's timezone.
|
|
17
|
-
- `metadata` (object | null) — Custom key-value metadata you attached to the customer.
|
|
18
|
-
- `createdAt` (string) — ISO 8601 datetime when the customer was created.
|
|
19
|
-
- `updatedAt` (string) — ISO 8601 datetime of this update.
|
|
20
|
-
|
|
21
|
-
```json
|
|
22
|
-
{
|
|
23
|
-
"event": "customer.updated",
|
|
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
|
-
"id": "cus_1a2b3c4d",
|
|
30
|
-
"externalId": "user_123",
|
|
31
|
-
"fullName": "Ada Lovelace",
|
|
32
|
-
"email": "ada.lovelace@acme.com",
|
|
33
|
-
"taxDocument": "20-12345678-9",
|
|
34
|
-
"documentType": "CUIT",
|
|
35
|
-
"timezone": "Europe/London",
|
|
36
|
-
"metadata": {
|
|
37
|
-
"plan_intent": "pro"
|
|
38
|
-
},
|
|
39
|
-
"createdAt": "2026-03-25T14:29:00.000Z",
|
|
40
|
-
"updatedAt": "2026-04-02T09:10:00.000Z"
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
```
|
|
44
|
-
|
|
45
|
-
## What counts as an update
|
|
46
|
-
|
|
47
|
-
The event fires when a customer field changes: `email`, `fullName`, `timezone`, `externalId`, or `metadata`. It carries the complete current resource, not a diff — replace your local copy with the payload.
|
|
48
|
-
|
|
49
|
-
Every distinct update delivers its own event, even several in quick succession. Like `customer.created`, the resource shape follows your endpoint's pinned API version.
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
lastModified: 2026-03-28
|
|
3
|
-
title: "invoice.created"
|
|
4
|
-
description: "Fired when a new invoice is generated"
|
|
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 ID.
|
|
11
|
-
- `invoiceNumber` (string) — The human-readable invoice number.
|
|
12
|
-
- `invoiceStatus` (string) — The invoice status (e.g. pending, paid).
|
|
13
|
-
- `periodStart` (string) — ISO 8601 start of the billing period.
|
|
14
|
-
- `periodEnd` (string) — ISO 8601 end of the billing period.
|
|
15
|
-
- `issueDate` (string) — ISO 8601 date the invoice was issued.
|
|
16
|
-
- `dueDate` (string) — ISO 8601 date the invoice is due.
|
|
17
|
-
- `currency` (string) — The invoice currency code.
|
|
18
|
-
- `subtotal` (number) — Subtotal in cents (100 = $1.00).
|
|
19
|
-
- `total` (number) — Total in cents (100 = $1.00).
|
|
20
|
-
- `customerId` (string) — The customer ID. Returns your externalId if you provided one when creating the customer, otherwise returns the Commet publicId.
|
|
21
|
-
- `subscriptionId` (string | null) — The subscription ID, if the invoice is linked to a subscription.
|
|
22
|
-
|
|
23
|
-
```json
|
|
24
|
-
{
|
|
25
|
-
"event": "invoice.created",
|
|
26
|
-
"timestamp": "2026-06-23T14:30:00.000Z",
|
|
27
|
-
"organizationId": "8f14e45f-ceea-4e7a-9c3d-1c2b3a4d5e6f",
|
|
28
|
-
"mode": "live",
|
|
29
|
-
"apiVersion": "2026-08-27",
|
|
30
|
-
"data": {
|
|
31
|
-
"invoiceId": "inv_n4o5p6",
|
|
32
|
-
"invoiceNumber": "INV-0043",
|
|
33
|
-
"invoiceStatus": "pending",
|
|
34
|
-
"periodStart": "2026-04-25T00:00:00.000Z",
|
|
35
|
-
"periodEnd": "2026-05-25T00:00:00.000Z",
|
|
36
|
-
"issueDate": "2026-04-25T00:00:00.000Z",
|
|
37
|
-
"dueDate": "2026-04-25T00:00:00.000Z",
|
|
38
|
-
"currency": "usd",
|
|
39
|
-
"subtotal": 9900,
|
|
40
|
-
"total": 9900,
|
|
41
|
-
"customerId": "user_123",
|
|
42
|
-
"subscriptionId": "sub_1a2b3c4d"
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
```
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
lastModified: 2026-06-12
|
|
3
|
-
title: "invoice.overdue"
|
|
4
|
-
description: "An outstanding invoice passed its due date without 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
|
-
- `invoiceId` (string) — The invoice ID.
|
|
11
|
-
- `invoiceNumber` (string) — The human-readable invoice number.
|
|
12
|
-
- `invoiceStatus` (string) — Always "outstanding" for this event.
|
|
13
|
-
- `periodStart` (string) — ISO 8601 start of the billing period.
|
|
14
|
-
- `periodEnd` (string) — ISO 8601 end of the billing period.
|
|
15
|
-
- `issueDate` (string) — ISO 8601 date the invoice was issued.
|
|
16
|
-
- `dueDate` (string) — ISO 8601 date the invoice was due — now in the past.
|
|
17
|
-
- `currency` (string) — The invoice currency code.
|
|
18
|
-
- `subtotal` (number) — Subtotal in cents (100 = $1.00).
|
|
19
|
-
- `total` (number) — Total in cents (100 = $1.00).
|
|
20
|
-
- `customerId` (string) — The customer ID. Returns your externalId if you provided one when creating the customer, otherwise returns the Commet publicId.
|
|
21
|
-
- `subscriptionId` (string | null) — The subscription ID, if the invoice is linked to a subscription.
|
|
22
|
-
|
|
23
|
-
```json
|
|
24
|
-
{
|
|
25
|
-
"event": "invoice.overdue",
|
|
26
|
-
"timestamp": "2026-06-23T14:30:00.000Z",
|
|
27
|
-
"organizationId": "8f14e45f-ceea-4e7a-9c3d-1c2b3a4d5e6f",
|
|
28
|
-
"mode": "live",
|
|
29
|
-
"apiVersion": "2026-08-27",
|
|
30
|
-
"data": {
|
|
31
|
-
"invoiceId": "inv_n4o5p6",
|
|
32
|
-
"invoiceNumber": "INV-0043",
|
|
33
|
-
"invoiceStatus": "outstanding",
|
|
34
|
-
"periodStart": "2026-04-25T00:00:00.000Z",
|
|
35
|
-
"periodEnd": "2026-05-25T00:00:00.000Z",
|
|
36
|
-
"issueDate": "2026-04-25T00:00:00.000Z",
|
|
37
|
-
"dueDate": "2026-04-25T00:00:00.000Z",
|
|
38
|
-
"currency": "usd",
|
|
39
|
-
"subtotal": 9900,
|
|
40
|
-
"total": 9900,
|
|
41
|
-
"customerId": "user_123",
|
|
42
|
-
"subscriptionId": "sub_1a2b3c4d"
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
```
|
|
46
|
-
|
|
47
|
-
## When this fires
|
|
48
|
-
|
|
49
|
-
A daily scan finds outstanding invoices whose `dueDate` is in the past and emits this event once per invoice. The idempotency key is derived from the invoice, so re-running the scan never sends a duplicate.
|
|
50
|
-
|
|
51
|
-
The invoice keeps its `"outstanding"` status — overdue is a fact about the due date, not a new status. If the invoice is later paid or voided, `payment.received` or `invoice.voided` reflects the outcome.
|
|
52
|
-
|
|
53
|
-
Use it to start your own dunning flow: email the customer, show an in-app banner, or flag the account for follow-up.
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
lastModified: 2026-06-12
|
|
3
|
-
title: "invoice.upcoming"
|
|
4
|
-
description: "Predictive event fired once, 3 days before a subscription renews."
|
|
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 ID.
|
|
11
|
-
- `customerId` (string) — The customer ID. Returns your externalId if you provided one when creating the customer, otherwise returns the Commet publicId.
|
|
12
|
-
- `status` (string) — Always "active" for this event.
|
|
13
|
-
- `planId` (string) — The plan ID.
|
|
14
|
-
- `planName` (string) — The plan name.
|
|
15
|
-
- `billingInterval` (string | null) — The billing interval (monthly, yearly).
|
|
16
|
-
- `currentPeriodEnd` (string) — ISO 8601 datetime when the current period ends and the renewal invoice is issued.
|
|
17
|
-
|
|
18
|
-
```json
|
|
19
|
-
{
|
|
20
|
-
"event": "invoice.upcoming",
|
|
21
|
-
"timestamp": "2026-06-23T14:30:00.000Z",
|
|
22
|
-
"organizationId": "8f14e45f-ceea-4e7a-9c3d-1c2b3a4d5e6f",
|
|
23
|
-
"mode": "live",
|
|
24
|
-
"apiVersion": "2026-08-27",
|
|
25
|
-
"data": {
|
|
26
|
-
"subscriptionId": "sub_1a2b3c4d",
|
|
27
|
-
"customerId": "user_123",
|
|
28
|
-
"status": "active",
|
|
29
|
-
"planId": "pln_pro_monthly",
|
|
30
|
-
"planName": "Pro",
|
|
31
|
-
"billingInterval": "monthly",
|
|
32
|
-
"currentPeriodEnd": "2026-04-25T00:00:00.000Z"
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
```
|
|
36
|
-
|
|
37
|
-
## When this fires
|
|
38
|
-
|
|
39
|
-
A daily scan finds active subscriptions renewing within the next 3 days and emits this event once per renewal. The idempotency key is derived from the subscription and the renewal date, so re-running the scan never sends a duplicate.
|
|
40
|
-
|
|
41
|
-
Subscriptions with a scheduled cancellation are excluded — no renewal invoice will be issued for them.
|
|
42
|
-
|
|
43
|
-
Use it to notify the customer before they are charged. The payload intentionally carries no amount: usage-based charges are only final at renewal time, when `invoice.created` delivers the actual invoice.
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
lastModified: 2026-06-12
|
|
3
|
-
title: "invoice.voided"
|
|
4
|
-
description: "An invoice was voided and will not be collected."
|
|
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 ID.
|
|
11
|
-
- `invoiceNumber` (string) — The human-readable invoice number.
|
|
12
|
-
- `invoiceStatus` (string) — Always "void" for this event.
|
|
13
|
-
- `periodStart` (string) — ISO 8601 start of the billing period.
|
|
14
|
-
- `periodEnd` (string) — ISO 8601 end of the billing period.
|
|
15
|
-
- `issueDate` (string) — ISO 8601 date the invoice was issued.
|
|
16
|
-
- `dueDate` (string) — ISO 8601 date the invoice was due.
|
|
17
|
-
- `currency` (string) — The invoice currency code.
|
|
18
|
-
- `subtotal` (number) — Subtotal in cents (100 = $1.00).
|
|
19
|
-
- `total` (number) — Total in cents (100 = $1.00).
|
|
20
|
-
- `customerId` (string) — The customer ID. Returns your externalId if you provided one when creating the customer, otherwise returns the Commet publicId.
|
|
21
|
-
- `subscriptionId` (string | null) — The subscription ID, if the invoice is linked to a subscription.
|
|
22
|
-
|
|
23
|
-
```json
|
|
24
|
-
{
|
|
25
|
-
"event": "invoice.voided",
|
|
26
|
-
"timestamp": "2026-06-23T14:30:00.000Z",
|
|
27
|
-
"organizationId": "8f14e45f-ceea-4e7a-9c3d-1c2b3a4d5e6f",
|
|
28
|
-
"mode": "live",
|
|
29
|
-
"apiVersion": "2026-08-27",
|
|
30
|
-
"data": {
|
|
31
|
-
"invoiceId": "inv_n4o5p6",
|
|
32
|
-
"invoiceNumber": "INV-0043",
|
|
33
|
-
"invoiceStatus": "void",
|
|
34
|
-
"periodStart": "2026-04-25T00:00:00.000Z",
|
|
35
|
-
"periodEnd": "2026-05-25T00:00:00.000Z",
|
|
36
|
-
"issueDate": "2026-04-25T00:00:00.000Z",
|
|
37
|
-
"dueDate": "2026-04-25T00:00:00.000Z",
|
|
38
|
-
"currency": "usd",
|
|
39
|
-
"subtotal": 9900,
|
|
40
|
-
"total": 9900,
|
|
41
|
-
"customerId": "user_123",
|
|
42
|
-
"subscriptionId": "sub_1a2b3c4d"
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
```
|
|
46
|
-
|
|
47
|
-
## When this fires
|
|
48
|
-
|
|
49
|
-
An invoice is voided when it is nullified before collection: an admin marks it void through the dashboard or the API, or Commet voids unpaid invoices automatically when their subscription is canceled. Voiding is terminal — a void invoice is never retried or collected.
|
|
50
|
-
|
|
51
|
-
The payload carries the same invoice resource shape as `invoice.created`, with `invoiceStatus` set to `"void"`.
|
|
52
|
-
|
|
53
|
-
Use this event to reverse anything you keyed off `invoice.created` for this invoice — pending dunning reminders, accounting entries, or in-app banners about an open invoice.
|
package/docs/webhooks/meta.json
DELETED
|
@@ -1,89 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"title": "Webhooks",
|
|
3
|
-
"description": "Real-time event notifications for subscription, payment, and invoice changes",
|
|
4
|
-
"icon": "Plugs",
|
|
5
|
-
"root": true,
|
|
6
|
-
"pages": [
|
|
7
|
-
"introduction",
|
|
8
|
-
"---Subscription Events---",
|
|
9
|
-
"subscription-created",
|
|
10
|
-
"subscription-activated",
|
|
11
|
-
"subscription-reactivated",
|
|
12
|
-
"subscription-pause-scheduled",
|
|
13
|
-
"subscription-pause-updated",
|
|
14
|
-
"subscription-pause-revoked",
|
|
15
|
-
"subscription-paused",
|
|
16
|
-
"subscription-resumed",
|
|
17
|
-
"subscription-resume-failed",
|
|
18
|
-
"subscription-canceled",
|
|
19
|
-
"subscription-updated",
|
|
20
|
-
"subscription-plan-changed",
|
|
21
|
-
"subscription-cancellation-scheduled",
|
|
22
|
-
"subscription-cancellation-revoked",
|
|
23
|
-
"subscription-plan-change-scheduled",
|
|
24
|
-
"subscription-plan-change-revoked",
|
|
25
|
-
"subscription-past-due",
|
|
26
|
-
"---Trial Events---",
|
|
27
|
-
"trial-started",
|
|
28
|
-
"trial-converted",
|
|
29
|
-
"trial-expired",
|
|
30
|
-
"trial-will-end",
|
|
31
|
-
"trial-checkout-ready",
|
|
32
|
-
"---Checkout Events---",
|
|
33
|
-
"checkout-ready",
|
|
34
|
-
"---Payment Events---",
|
|
35
|
-
"payment-received",
|
|
36
|
-
"payment-failed",
|
|
37
|
-
"payment-recovered",
|
|
38
|
-
"payment-retry-failed",
|
|
39
|
-
"payment-refunded",
|
|
40
|
-
"payment-disputed",
|
|
41
|
-
"payment-dispute-resolved",
|
|
42
|
-
"---Payment Link Events---",
|
|
43
|
-
"payment-link-created",
|
|
44
|
-
"payment-link-completed",
|
|
45
|
-
"payment-link-failed",
|
|
46
|
-
"payment-link-canceled",
|
|
47
|
-
"---Invoice Events---",
|
|
48
|
-
"invoice-created",
|
|
49
|
-
"invoice-upcoming",
|
|
50
|
-
"invoice-overdue",
|
|
51
|
-
"invoice-voided",
|
|
52
|
-
"---Payment Method Events---",
|
|
53
|
-
"payment-method-attached",
|
|
54
|
-
"payment-method-updated",
|
|
55
|
-
"---Customer Events---",
|
|
56
|
-
"customer-created",
|
|
57
|
-
"customer-updated",
|
|
58
|
-
"customer-state-changed",
|
|
59
|
-
"---Plan Grant Events---",
|
|
60
|
-
"plan-grant-created",
|
|
61
|
-
"plan-grant-updated",
|
|
62
|
-
"plan-grant-expired",
|
|
63
|
-
"plan-grant-revoked",
|
|
64
|
-
"---Credits & Balance Events---",
|
|
65
|
-
"credits-granted",
|
|
66
|
-
"credits-purchased",
|
|
67
|
-
"credits-low",
|
|
68
|
-
"credits-depleted",
|
|
69
|
-
"credits-expired",
|
|
70
|
-
"balance-topped-up",
|
|
71
|
-
"balance-low",
|
|
72
|
-
"balance-depleted",
|
|
73
|
-
"---Quota & Usage Events---",
|
|
74
|
-
"quota-threshold-reached",
|
|
75
|
-
"quota-exceeded",
|
|
76
|
-
"usage-recorded",
|
|
77
|
-
"---Seat Events---",
|
|
78
|
-
"seats-updated",
|
|
79
|
-
"seats-limit-reached",
|
|
80
|
-
"---Add-on Events---",
|
|
81
|
-
"addon-activated",
|
|
82
|
-
"addon-deactivated",
|
|
83
|
-
"---Payout Events---",
|
|
84
|
-
"payout-available",
|
|
85
|
-
"payout-created",
|
|
86
|
-
"payout-paid",
|
|
87
|
-
"payout-failed"
|
|
88
|
-
]
|
|
89
|
-
}
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
lastModified: 2026-07-10
|
|
3
|
-
title: "payment.dispute_resolved"
|
|
4
|
-
description: "A payment dispute was resolved as won or lost."
|
|
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, or null when none is given.
|
|
20
|
-
- `outcome` (string) — The resolution: "won" or "lost".
|
|
21
|
-
|
|
22
|
-
```json
|
|
23
|
-
{
|
|
24
|
-
"event": "payment.dispute_resolved",
|
|
25
|
-
"timestamp": "2026-06-23T14:30:00.000Z",
|
|
26
|
-
"organizationId": "8f14e45f-ceea-4e7a-9c3d-1c2b3a4d5e6f",
|
|
27
|
-
"mode": "live",
|
|
28
|
-
"apiVersion": "2026-08-27",
|
|
29
|
-
"data": {
|
|
30
|
-
"paymentTransactionId": "txn_q7r8s9",
|
|
31
|
-
"provider": "stripe",
|
|
32
|
-
"paymentLinkId": "pay_l1m2n3",
|
|
33
|
-
"invoiceId": "inv_n4o5p6",
|
|
34
|
-
"invoiceNumber": "INV-0043",
|
|
35
|
-
"customerId": "user_123",
|
|
36
|
-
"subscriptionId": "sub_1a2b3c4d",
|
|
37
|
-
"disputeAmount": 9900,
|
|
38
|
-
"currency": "usd",
|
|
39
|
-
"disputeReason": "fraudulent",
|
|
40
|
-
"outcome": "won"
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
```
|
|
44
|
-
|
|
45
|
-
## When this fires
|
|
46
|
-
|
|
47
|
-
When the payment provider closes a dispute that previously fired `payment.disputed`. The payload carries the same identifiers plus the `outcome`:
|
|
48
|
-
|
|
49
|
-
- `won` — the dispute was resolved in your favor; the frozen amount is restored to your payout balance and the payment returns to succeeded.
|
|
50
|
-
- `lost` — the chargeback stands; the disputed amount stays deducted.
|
|
51
|
-
|
|
52
|
-
Use it to close the internal flag you opened on `payment.disputed`, and on `lost` to revoke whatever the original payment was funding.
|