@commet/node 9.2.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.
- package/dist/index.d.mts +370 -21
- package/dist/index.d.ts +370 -21
- package/dist/index.js +30 -6
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +30 -6
- package/dist/index.mjs.map +1 -1
- package/docs/api-reference/addons.md +1 -1
- package/docs/api-reference/api-keys.md +3 -2
- package/docs/api-reference/credit-packs.md +1 -1
- package/docs/api-reference/customers.md +2 -2
- package/docs/api-reference/feature-access.md +1 -1
- package/docs/api-reference/features.md +1 -1
- package/docs/api-reference/generated-webhooks.md +3 -3
- package/docs/api-reference/index.md +2 -2
- package/docs/api-reference/invoices.md +1 -1
- package/docs/api-reference/markets.md +1 -1
- package/docs/api-reference/offers.md +1 -1
- package/docs/api-reference/payments.md +1 -1
- package/docs/api-reference/payouts.md +1 -1
- package/docs/api-reference/plan-groups.md +1 -1
- package/docs/api-reference/plans.md +4 -4
- package/docs/api-reference/portal.md +1 -1
- package/docs/api-reference/promo-codes.md +1 -1
- package/docs/api-reference/provisioning.md +1 -1
- package/docs/api-reference/quota.md +1 -1
- package/docs/api-reference/seats.md +1 -1
- package/docs/api-reference/subscriptions.md +81 -2
- package/docs/api-reference/test-clock.md +1 -1
- package/docs/api-reference/transactions.md +1 -1
- package/docs/api-reference/usage.md +1 -1
- package/docs/documentation/api-versioning.md +1 -1
- package/docs/documentation/choose-a-billing-model.md +48 -26
- package/docs/documentation/create-api-key.md +101 -25
- package/docs/documentation/introduction.md +63 -41
- package/docs/documentation/payments/transactions-refunds-and-retries.md +7 -1
- package/docs/documentation/sales/promotional-offers.md +18 -1
- package/docs/documentation/sdk-reference.md +9 -9
- package/docs/documentation/subscriptions/manage-subscriptions.md +113 -12
- package/docs/errors/addon_already_active.md +1 -1
- package/docs/errors/addon_has_activations.md +1 -1
- package/docs/errors/addon_not_active.md +1 -1
- package/docs/errors/addon_not_found.md +1 -1
- package/docs/errors/already_has_active_subscription.md +1 -1
- package/docs/errors/already_scheduled.md +1 -1
- package/docs/errors/api_key_not_found.md +1 -1
- package/docs/errors/card_promotions_not_available.md +1 -1
- package/docs/errors/charge_failed.md +1 -1
- package/docs/errors/charge_in_progress.md +1 -1
- package/docs/errors/claim_not_pending.md +1 -1
- package/docs/errors/credit_pack_not_found.md +1 -1
- package/docs/errors/customer_not_found.md +1 -1
- package/docs/errors/duplicate.md +1 -1
- package/docs/errors/endpoint_deprecated.md +1 -1
- package/docs/errors/endpoint_not_available.md +1 -1
- package/docs/errors/feature_already_exists.md +1 -1
- package/docs/errors/feature_disabled.md +1 -1
- package/docs/errors/feature_in_use.md +1 -1
- package/docs/errors/feature_not_found.md +1 -1
- package/docs/errors/feature_not_in_plan.md +1 -1
- package/docs/errors/forbidden.md +1 -1
- package/docs/errors/free_plan_change_not_supported.md +1 -1
- package/docs/errors/idempotency_in_progress.md +1 -1
- package/docs/errors/idempotency_key_mismatch.md +1 -1
- package/docs/errors/idempotency_unavailable.md +1 -1
- package/docs/errors/included_limit_reached.md +1 -1
- package/docs/errors/index.md +1 -1
- package/docs/errors/insufficient_balance.md +1 -1
- package/docs/errors/insufficient_credits.md +1 -1
- package/docs/errors/insufficient_seats.md +1 -1
- package/docs/errors/internal_error.md +1 -1
- package/docs/errors/invalid_json.md +1 -1
- package/docs/errors/invalid_subscription_status.md +1 -1
- package/docs/errors/invoice_not_found.md +1 -1
- package/docs/errors/market_group_in_use.md +1 -1
- package/docs/errors/market_group_not_found.md +1 -1
- package/docs/errors/market_in_use.md +1 -1
- package/docs/errors/market_not_found.md +1 -1
- package/docs/errors/missing_regional_price.md +1 -1
- package/docs/errors/model_not_found.md +1 -1
- package/docs/errors/no_active_subscription.md +1 -1
- package/docs/errors/no_change_requested.md +1 -1
- package/docs/errors/no_outstanding_invoice.md +1 -1
- package/docs/errors/no_payment_method.md +1 -1
- package/docs/errors/no_prices_configured.md +1 -1
- package/docs/errors/not_found.md +1 -1
- package/docs/errors/not_scheduled_for_cancellation.md +1 -1
- package/docs/errors/offer_not_applicable.md +1 -1
- package/docs/errors/offer_not_found.md +1 -1
- package/docs/errors/one_time_subscription_not_cancelable.md +1 -1
- package/docs/errors/organization_already_claimed.md +1 -1
- package/docs/errors/payment_failed.md +1 -1
- package/docs/errors/payment_method_not_found.md +1 -1
- package/docs/errors/payment_not_cancelable.md +1 -1
- package/docs/errors/payment_not_found.md +1 -1
- package/docs/errors/payouts_not_available_in_sandbox.md +1 -1
- package/docs/errors/plan_change_scheduled.md +1 -1
- package/docs/errors/plan_group_not_found.md +1 -1
- package/docs/errors/plan_not_found.md +1 -1
- package/docs/errors/plan_unavailable.md +1 -1
- package/docs/errors/plans_not_in_same_group.md +1 -1
- package/docs/errors/price_in_use.md +1 -1
- package/docs/errors/price_not_found.md +1 -1
- package/docs/errors/pricing_mode_mismatch.md +1 -1
- package/docs/errors/promo_code_expired.md +1 -1
- package/docs/errors/promo_code_not_found.md +1 -1
- package/docs/errors/provider_unsupported.md +1 -1
- package/docs/errors/rate_limited.md +1 -1
- package/docs/errors/sandbox_only.md +1 -1
- package/docs/errors/seat_limit_exceeded.md +1 -1
- package/docs/errors/subscription_activation_failed.md +1 -1
- package/docs/errors/subscription_already_canceled.md +1 -1
- package/docs/errors/subscription_cancel_failed.md +1 -1
- package/docs/errors/subscription_creation_failed.md +1 -1
- package/docs/errors/subscription_has_open_dispute.md +1 -1
- package/docs/errors/subscription_not_active.md +1 -1
- package/docs/errors/subscription_not_found.md +1 -1
- package/docs/errors/subscription_required.md +1 -1
- package/docs/errors/subscription_uncancel_failed.md +1 -1
- package/docs/errors/transaction_not_found.md +1 -1
- package/docs/errors/unauthorized.md +1 -1
- package/docs/errors/validation_error.md +1 -1
- package/docs/errors/webhook_not_found.md +1 -1
- package/docs/knowledge-base/what-happens-when-you-refund-or-retry-a-transaction.md +2 -2
- package/docs/manifest.json +121 -85
- package/docs/platform-documentation.md +6 -0
- package/docs/schemas.md +35 -1
- package/docs/webhooks/addon-activated.md +1 -1
- package/docs/webhooks/addon-deactivated.md +1 -1
- package/docs/webhooks/balance-depleted.md +1 -1
- package/docs/webhooks/balance-low.md +1 -1
- package/docs/webhooks/balance-topped-up.md +1 -1
- package/docs/webhooks/checkout-ready.md +1 -1
- package/docs/webhooks/credits-depleted.md +1 -1
- package/docs/webhooks/credits-expired.md +1 -1
- package/docs/webhooks/credits-granted.md +1 -1
- package/docs/webhooks/credits-low.md +1 -1
- package/docs/webhooks/credits-purchased.md +1 -1
- package/docs/webhooks/customer-created.md +1 -1
- package/docs/webhooks/customer-state-changed.md +2 -2
- package/docs/webhooks/customer-updated.md +1 -1
- package/docs/webhooks/invoice-created.md +1 -1
- package/docs/webhooks/invoice-overdue.md +1 -1
- package/docs/webhooks/invoice-upcoming.md +1 -1
- package/docs/webhooks/invoice-voided.md +1 -1
- package/docs/webhooks/meta.json +6 -0
- package/docs/webhooks/payment-dispute-resolved.md +1 -1
- package/docs/webhooks/payment-disputed.md +1 -1
- package/docs/webhooks/payment-failed.md +144 -3
- package/docs/webhooks/payment-link-canceled.md +1 -1
- package/docs/webhooks/payment-link-completed.md +44 -2
- package/docs/webhooks/payment-link-created.md +1 -1
- package/docs/webhooks/payment-link-failed.md +44 -2
- package/docs/webhooks/payment-method-attached.md +6 -2
- package/docs/webhooks/payment-method-updated.md +7 -8
- package/docs/webhooks/payment-received.md +160 -3
- package/docs/webhooks/payment-recovered.md +6 -2
- package/docs/webhooks/payment-refunded.md +3 -3
- package/docs/webhooks/payment-retry-failed.md +1 -1
- package/docs/webhooks/payout-available.md +1 -1
- package/docs/webhooks/payout-created.md +1 -1
- package/docs/webhooks/payout-failed.md +1 -1
- package/docs/webhooks/payout-paid.md +1 -1
- package/docs/webhooks/plan-grant-created.md +1 -1
- package/docs/webhooks/plan-grant-expired.md +1 -1
- package/docs/webhooks/plan-grant-revoked.md +1 -1
- package/docs/webhooks/plan-grant-updated.md +1 -1
- package/docs/webhooks/quota-exceeded.md +1 -1
- package/docs/webhooks/quota-threshold-reached.md +1 -1
- package/docs/webhooks/seats-limit-reached.md +1 -1
- package/docs/webhooks/seats-updated.md +1 -1
- package/docs/webhooks/subscription-activated.md +1 -1
- package/docs/webhooks/subscription-canceled.md +5 -4
- package/docs/webhooks/subscription-cancellation-revoked.md +1 -1
- package/docs/webhooks/subscription-cancellation-scheduled.md +1 -1
- package/docs/webhooks/subscription-created.md +1 -1
- package/docs/webhooks/subscription-past-due.md +1 -1
- package/docs/webhooks/subscription-pause-revoked.md +27 -0
- package/docs/webhooks/subscription-pause-scheduled.md +35 -0
- package/docs/webhooks/subscription-pause-updated.md +31 -0
- package/docs/webhooks/subscription-paused.md +35 -0
- package/docs/webhooks/subscription-plan-change-revoked.md +1 -1
- package/docs/webhooks/subscription-plan-change-scheduled.md +1 -1
- package/docs/webhooks/subscription-plan-changed.md +1 -1
- package/docs/webhooks/subscription-reactivated.md +1 -1
- package/docs/webhooks/subscription-resume-failed.md +33 -0
- package/docs/webhooks/subscription-resumed.md +35 -0
- package/docs/webhooks/subscription-updated.md +1 -1
- package/docs/webhooks/trial-checkout-ready.md +1 -1
- package/docs/webhooks/trial-converted.md +1 -1
- package/docs/webhooks/trial-expired.md +1 -1
- package/docs/webhooks/trial-started.md +1 -1
- package/docs/webhooks/trial-will-end.md +1 -1
- package/docs/webhooks/usage-recorded.md +1 -1
- package/docs/webhooks.md +96 -7
- package/package.json +1 -1
|
@@ -166,10 +166,16 @@ This documentation snapshot is serialized from the same Platform source used by
|
|
|
166
166
|
- [webhooks/subscription-cancellation-scheduled.md](./webhooks/subscription-cancellation-scheduled.md)
|
|
167
167
|
- [webhooks/subscription-created.md](./webhooks/subscription-created.md)
|
|
168
168
|
- [webhooks/subscription-past-due.md](./webhooks/subscription-past-due.md)
|
|
169
|
+
- [webhooks/subscription-pause-revoked.md](./webhooks/subscription-pause-revoked.md)
|
|
170
|
+
- [webhooks/subscription-pause-scheduled.md](./webhooks/subscription-pause-scheduled.md)
|
|
171
|
+
- [webhooks/subscription-pause-updated.md](./webhooks/subscription-pause-updated.md)
|
|
172
|
+
- [webhooks/subscription-paused.md](./webhooks/subscription-paused.md)
|
|
169
173
|
- [webhooks/subscription-plan-change-revoked.md](./webhooks/subscription-plan-change-revoked.md)
|
|
170
174
|
- [webhooks/subscription-plan-change-scheduled.md](./webhooks/subscription-plan-change-scheduled.md)
|
|
171
175
|
- [webhooks/subscription-plan-changed.md](./webhooks/subscription-plan-changed.md)
|
|
172
176
|
- [webhooks/subscription-reactivated.md](./webhooks/subscription-reactivated.md)
|
|
177
|
+
- [webhooks/subscription-resume-failed.md](./webhooks/subscription-resume-failed.md)
|
|
178
|
+
- [webhooks/subscription-resumed.md](./webhooks/subscription-resumed.md)
|
|
173
179
|
- [webhooks/subscription-updated.md](./webhooks/subscription-updated.md)
|
|
174
180
|
- [webhooks/trial-checkout-ready.md](./webhooks/trial-checkout-ready.md)
|
|
175
181
|
- [webhooks/trial-converted.md](./webhooks/trial-converted.md)
|
package/docs/schemas.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Schemas
|
|
2
2
|
|
|
3
|
-
Generated from Commet API version `2026-
|
|
3
|
+
Generated from Commet API version `2026-08-27`.
|
|
4
4
|
|
|
5
5
|
## Enums
|
|
6
6
|
|
|
@@ -36,6 +36,13 @@ Generated from Commet API version `2026-07-31`.
|
|
|
36
36
|
- `"addon_activation"`
|
|
37
37
|
- `"one_time_payment"`
|
|
38
38
|
- `"reactivation"`
|
|
39
|
+
- `"resume"`
|
|
40
|
+
|
|
41
|
+
### PaymentMethod
|
|
42
|
+
|
|
43
|
+
- `"card"`
|
|
44
|
+
- `"oxxo"`
|
|
45
|
+
- `"mercado_pago"`
|
|
39
46
|
|
|
40
47
|
### PaymentProvider
|
|
41
48
|
|
|
@@ -43,6 +50,14 @@ Generated from Commet API version `2026-07-31`.
|
|
|
43
50
|
- `"commet"`
|
|
44
51
|
- `"dlocal"`
|
|
45
52
|
|
|
53
|
+
### SubPaymentMethod
|
|
54
|
+
|
|
55
|
+
- `"credit_card"`
|
|
56
|
+
- `"debit_card"`
|
|
57
|
+
- `"prepaid_card"`
|
|
58
|
+
- `"bank_transfer"`
|
|
59
|
+
- `"account_money"`
|
|
60
|
+
|
|
46
61
|
### SubscriptionStatus
|
|
47
62
|
|
|
48
63
|
- `"draft"`
|
|
@@ -50,6 +65,7 @@ Generated from Commet API version `2026-07-31`.
|
|
|
50
65
|
- `"trialing"`
|
|
51
66
|
- `"active"`
|
|
52
67
|
- `"past_due"`
|
|
68
|
+
- `"paused"`
|
|
53
69
|
- `"canceled"`
|
|
54
70
|
|
|
55
71
|
### Timezone
|
|
@@ -188,6 +204,7 @@ Generated from Commet API version `2026-07-31`.
|
|
|
188
204
|
- `createdAt` (`string`, required)
|
|
189
205
|
- `updatedAt` (`string`, required)
|
|
190
206
|
- `offerApplications` (`Array<SubscriptionOfferApplication>`, required)
|
|
207
|
+
- `pause` (`{ status: "scheduled"; mode: "period_end"; requestedAt: string; effectiveAt: string; resumeAt: string | null } | { status: "active"; mode: "immediate" | "period_end"; requestedAt: string; effectiveAt: string; resumeAt: string | null } | null`, required)
|
|
191
208
|
- `checkoutProvider` (`PaymentProvider | null`, required) — Payment provider resolved for this checkout when the subscription response was created. This is an informational snapshot and may differ when the checkout is loaded if its country or the organization's routing changes.
|
|
192
209
|
- `priceId` (`string | null`, required)
|
|
193
210
|
- `object` (`"subscription"`, required)
|
|
@@ -419,6 +436,7 @@ Variants:
|
|
|
419
436
|
|
|
420
437
|
### Payment
|
|
421
438
|
|
|
439
|
+
- `paymentContext` (`{ reason: "first_subscription_payment" | "trial_conversion" | "recurring_billing" | "plan_change" | "reactivation" | "subscription_resume" | "one_time_payment" | "overage" | "adjustment"; paymentLinkId: string | null; recovery: { type: "payment_recovery" } | { type: "dunning_retry"; attempt: number; maxAttempts: number } | null } | null`, required) — Charge context captured for new payments. Null for historical payments with no captured context.
|
|
422
440
|
- `id` (`string`, required)
|
|
423
441
|
- `customerId` (`string | null`, required)
|
|
424
442
|
- `kind` (`"link" | "charge"`, required)
|
|
@@ -735,6 +753,7 @@ Variants:
|
|
|
735
753
|
- `createdAt` (`string`, required)
|
|
736
754
|
- `updatedAt` (`string`, required)
|
|
737
755
|
- `offerApplications` (`Array<SubscriptionOfferApplication>`, required)
|
|
756
|
+
- `pause` (`{ status: "scheduled"; mode: "period_end"; requestedAt: string; effectiveAt: string; resumeAt: string | null } | { status: "active"; mode: "immediate" | "period_end"; requestedAt: string; effectiveAt: string; resumeAt: string | null } | null`, required)
|
|
738
757
|
- `planGrant` (`{ id: string; plan: { id: string; name: string }; expiresAt: string | null }`, optional)
|
|
739
758
|
- `consumptionModel` (`ConsumptionModel | null`, required)
|
|
740
759
|
- `features` (`Array<{ code: string; name: string; type: "boolean"; enabled: boolean; baseAccess?: { enabled: boolean } | null } | { code: string; name: string; type: "usage"; usage?: { current: number; included: number; overageQuantity: number; overageUnitPrice?: number; unlimited?: boolean }; baseAccess?: { included: number; unlimited: boolean } | null } | { code: string; name: string; type: "seats"; usage: { current: number; included: number; overageQuantity: number; overageUnitPrice?: number; unlimited?: boolean }; baseAccess?: { included: number; unlimited: boolean } | null } | { code: string; name: string; type: "quota"; usage?: { current: number; included: number; overageQuantity: number; overageUnitPrice?: number; unlimited?: boolean }; baseAccess?: { included: number; unlimited: boolean } | null }>`, required)
|
|
@@ -778,6 +797,14 @@ Variants:
|
|
|
778
797
|
- `{ type: "amount_off"; durationCycles: number | null; durationInterval: "weekly" | "monthly" | "quarterly" | "yearly" | null; amount: number; startsAt: string | null; endsAt: string | null }`
|
|
779
798
|
- `{ type: "fixed_price"; durationCycles: number | null; durationInterval: "weekly" | "monthly" | "quarterly" | "yearly" | null; price: number; startsAt: string | null; endsAt: string | null }`
|
|
780
799
|
|
|
800
|
+
### SubscriptionResume
|
|
801
|
+
|
|
802
|
+
- `subscriptionId` (`string`, required)
|
|
803
|
+
- `invoiceId` (`string | null`, required)
|
|
804
|
+
- `status` (`"processing" | "succeeded"`, required)
|
|
805
|
+
- `object` (`"subscription_resume"`, required)
|
|
806
|
+
- `livemode` (`boolean`, required)
|
|
807
|
+
|
|
781
808
|
### SubscriptionSummary
|
|
782
809
|
|
|
783
810
|
- `id` (`string`, required)
|
|
@@ -800,6 +827,7 @@ Variants:
|
|
|
800
827
|
- `createdAt` (`string`, required)
|
|
801
828
|
- `updatedAt` (`string`, required)
|
|
802
829
|
- `offerApplications` (`Array<SubscriptionOfferApplication>`, required)
|
|
830
|
+
- `pause` (`{ status: "scheduled"; mode: "period_end"; requestedAt: string; effectiveAt: string; resumeAt: string | null } | { status: "active"; mode: "immediate" | "period_end"; requestedAt: string; effectiveAt: string; resumeAt: string | null } | null`, required)
|
|
803
831
|
- `priceId` (`string | null`, required)
|
|
804
832
|
- `object` (`"subscription"`, required)
|
|
805
833
|
- `livemode` (`boolean`, required)
|
|
@@ -829,6 +857,7 @@ Variants:
|
|
|
829
857
|
|
|
830
858
|
### Transaction
|
|
831
859
|
|
|
860
|
+
- `paymentContext` (`{ reason: "first_subscription_payment" | "trial_conversion" | "recurring_billing" | "plan_change" | "reactivation" | "subscription_resume" | "one_time_payment" | "overage" | "adjustment"; paymentLinkId: string | null; recovery: { type: "payment_recovery" } | { type: "dunning_retry"; attempt: number; maxAttempts: number } | null } | null`, required) — Charge context captured for new payments. Null for historical payments with no captured context.
|
|
832
861
|
- `id` (`string`, required)
|
|
833
862
|
- `invoiceId` (`string | null`, required)
|
|
834
863
|
- `grossAmount` (`number | null`, required) — Gross amount in USD cents. Null when the provider has not reported an honest USD figure; see presentmentAmount.
|
|
@@ -837,6 +866,8 @@ Variants:
|
|
|
837
866
|
- `presentmentAmount` (`number | null`, required) — Amount in the charge currency's smallest unit, as presented to the customer. Set for non-USD charges; null when the charge was made in USD.
|
|
838
867
|
- `currency` (`string`, required)
|
|
839
868
|
- `provider` (`PaymentProvider`, required) — The payment provider the charge was routed to: stripe, commet, or dlocal.
|
|
869
|
+
- `paymentMethod` (`PaymentMethod | null`, required) — The method used for this charge: card, oxxo, or mercado_pago. Null when unknown.
|
|
870
|
+
- `subPaymentMethod` (`SubPaymentMethod | null`, required) — The source of funds for this charge, when reported by the provider. Null when unavailable or unknown.
|
|
840
871
|
- `status` (`TransactionStatus`, required)
|
|
841
872
|
- `customerEmail` (`string | null`, required)
|
|
842
873
|
- `customerName` (`string | null`, required)
|
|
@@ -849,6 +880,7 @@ Variants:
|
|
|
849
880
|
|
|
850
881
|
### TransactionListItem
|
|
851
882
|
|
|
883
|
+
- `paymentContext` (`{ reason: "first_subscription_payment" | "trial_conversion" | "recurring_billing" | "plan_change" | "reactivation" | "subscription_resume" | "one_time_payment" | "overage" | "adjustment"; paymentLinkId: string | null; recovery: { type: "payment_recovery" } | { type: "dunning_retry"; attempt: number; maxAttempts: number } | null } | null`, required) — Charge context captured for new payments. Null for historical payments with no captured context.
|
|
852
884
|
- `id` (`string`, required)
|
|
853
885
|
- `invoiceId` (`string | null`, required)
|
|
854
886
|
- `grossAmount` (`number | null`, required) — Gross amount in USD cents. Null when the provider has not reported an honest USD figure; see presentmentAmount.
|
|
@@ -857,6 +889,8 @@ Variants:
|
|
|
857
889
|
- `presentmentAmount` (`number | null`, required) — Amount in the charge currency's smallest unit, as presented to the customer. Set for non-USD charges; null when the charge was made in USD.
|
|
858
890
|
- `currency` (`string`, required)
|
|
859
891
|
- `provider` (`PaymentProvider`, required) — The payment provider the charge was routed to: stripe, commet, or dlocal.
|
|
892
|
+
- `paymentMethod` (`PaymentMethod | null`, required) — The method used for this charge: card, oxxo, or mercado_pago. Null when unknown.
|
|
893
|
+
- `subPaymentMethod` (`SubPaymentMethod | null`, required) — The source of funds for this charge, when reported by the provider. Null when unavailable or unknown.
|
|
860
894
|
- `status` (`TransactionStatus`, required)
|
|
861
895
|
- `customerEmail` (`string | null`, required)
|
|
862
896
|
- `customerName` (`string | null`, required)
|
|
@@ -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-
|
|
23
|
+
"apiVersion": "2026-08-27",
|
|
24
24
|
"data": {
|
|
25
25
|
"subscriptionId": "sub_1a2b3c4d",
|
|
26
26
|
"customerId": "user_123",
|
|
@@ -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-
|
|
21
|
+
"apiVersion": "2026-08-27",
|
|
22
22
|
"data": {
|
|
23
23
|
"subscriptionId": "sub_1a2b3c4d",
|
|
24
24
|
"customerId": "user_123",
|
|
@@ -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-
|
|
21
|
+
"apiVersion": "2026-08-27",
|
|
22
22
|
"data": {
|
|
23
23
|
"subscriptionId": "sub_1a2b3c4d",
|
|
24
24
|
"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-
|
|
22
|
+
"apiVersion": "2026-08-27",
|
|
23
23
|
"data": {
|
|
24
24
|
"subscriptionId": "sub_1a2b3c4d",
|
|
25
25
|
"customerId": "user_123",
|
|
@@ -20,7 +20,7 @@ All webhook payloads follow a consistent top-level structure with event-specific
|
|
|
20
20
|
"timestamp": "2026-06-23T14:30:00.000Z",
|
|
21
21
|
"organizationId": "8f14e45f-ceea-4e7a-9c3d-1c2b3a4d5e6f",
|
|
22
22
|
"mode": "live",
|
|
23
|
-
"apiVersion": "2026-
|
|
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-
|
|
24
|
+
"apiVersion": "2026-08-27",
|
|
25
25
|
"data": {
|
|
26
26
|
"subscriptionId": "sub_1a2b3c4d",
|
|
27
27
|
"customerId": "user_123",
|
|
@@ -17,7 +17,7 @@ All webhook payloads follow a consistent top-level structure with event-specific
|
|
|
17
17
|
"timestamp": "2026-06-23T14:30:00.000Z",
|
|
18
18
|
"organizationId": "8f14e45f-ceea-4e7a-9c3d-1c2b3a4d5e6f",
|
|
19
19
|
"mode": "live",
|
|
20
|
-
"apiVersion": "2026-
|
|
20
|
+
"apiVersion": "2026-08-27",
|
|
21
21
|
"data": {
|
|
22
22
|
"subscriptionId": "sub_1a2b3c4d",
|
|
23
23
|
"customerId": "user_123",
|
|
@@ -17,7 +17,7 @@ All webhook payloads follow a consistent top-level structure with event-specific
|
|
|
17
17
|
"timestamp": "2026-06-23T14:30:00.000Z",
|
|
18
18
|
"organizationId": "8f14e45f-ceea-4e7a-9c3d-1c2b3a4d5e6f",
|
|
19
19
|
"mode": "live",
|
|
20
|
-
"apiVersion": "2026-
|
|
20
|
+
"apiVersion": "2026-08-27",
|
|
21
21
|
"data": {
|
|
22
22
|
"subscriptionId": "sub_1a2b3c4d",
|
|
23
23
|
"customerId": "user_123",
|
|
@@ -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-
|
|
21
|
+
"apiVersion": "2026-08-27",
|
|
22
22
|
"data": {
|
|
23
23
|
"subscriptionId": "sub_1a2b3c4d",
|
|
24
24
|
"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-
|
|
22
|
+
"apiVersion": "2026-08-27",
|
|
23
23
|
"data": {
|
|
24
24
|
"subscriptionId": "sub_1a2b3c4d",
|
|
25
25
|
"customerId": "user_123",
|
|
@@ -20,7 +20,7 @@ All webhook payloads follow a consistent top-level structure with event-specific
|
|
|
20
20
|
"timestamp": "2026-06-23T14:30:00.000Z",
|
|
21
21
|
"organizationId": "8f14e45f-ceea-4e7a-9c3d-1c2b3a4d5e6f",
|
|
22
22
|
"mode": "live",
|
|
23
|
-
"apiVersion": "2026-
|
|
23
|
+
"apiVersion": "2026-08-27",
|
|
24
24
|
"data": {
|
|
25
25
|
"subscriptionId": "sub_1a2b3c4d",
|
|
26
26
|
"customerId": "user_123",
|
|
@@ -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-
|
|
27
|
+
"apiVersion": "2026-08-27",
|
|
28
28
|
"data": {
|
|
29
29
|
"id": "cus_1a2b3c4d",
|
|
30
30
|
"externalId": "user_123",
|
|
@@ -8,7 +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
|
-
- `trigger` (string) — What caused the transition. One of: subscription\_created, subscription\_activated, subscription\_canceled, plan\_change, past\_due, trial\_started, trial\_converted, trial\_expired, cancellation\_scheduled, cancellation\_revoked, seats\_updated, addon\_activated, addon\_deactivated, credits\_depleted, balance\_depleted, quota\_exceeded, plan\_access\_granted, plan\_access\_ended.
|
|
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
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
13
|
- `subscriptionId` (string | null) — The live subscription ID, or null when status is none.
|
|
14
14
|
- `plan` (WebhookPlanRef | null) — The current plan (id and name), or null when status is none.
|
|
@@ -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-
|
|
28
|
+
"apiVersion": "2026-08-27",
|
|
29
29
|
"data": {
|
|
30
30
|
"customerId": "user_123",
|
|
31
31
|
"trigger": "subscription_activated",
|
|
@@ -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-
|
|
27
|
+
"apiVersion": "2026-08-27",
|
|
28
28
|
"data": {
|
|
29
29
|
"id": "cus_1a2b3c4d",
|
|
30
30
|
"externalId": "user_123",
|
|
@@ -26,7 +26,7 @@ All webhook payloads follow a consistent top-level structure with event-specific
|
|
|
26
26
|
"timestamp": "2026-06-23T14:30:00.000Z",
|
|
27
27
|
"organizationId": "8f14e45f-ceea-4e7a-9c3d-1c2b3a4d5e6f",
|
|
28
28
|
"mode": "live",
|
|
29
|
-
"apiVersion": "2026-
|
|
29
|
+
"apiVersion": "2026-08-27",
|
|
30
30
|
"data": {
|
|
31
31
|
"invoiceId": "inv_n4o5p6",
|
|
32
32
|
"invoiceNumber": "INV-0043",
|
|
@@ -26,7 +26,7 @@ All webhook payloads follow a consistent top-level structure with event-specific
|
|
|
26
26
|
"timestamp": "2026-06-23T14:30:00.000Z",
|
|
27
27
|
"organizationId": "8f14e45f-ceea-4e7a-9c3d-1c2b3a4d5e6f",
|
|
28
28
|
"mode": "live",
|
|
29
|
-
"apiVersion": "2026-
|
|
29
|
+
"apiVersion": "2026-08-27",
|
|
30
30
|
"data": {
|
|
31
31
|
"invoiceId": "inv_n4o5p6",
|
|
32
32
|
"invoiceNumber": "INV-0043",
|
|
@@ -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-
|
|
24
|
+
"apiVersion": "2026-08-27",
|
|
25
25
|
"data": {
|
|
26
26
|
"subscriptionId": "sub_1a2b3c4d",
|
|
27
27
|
"customerId": "user_123",
|
|
@@ -26,7 +26,7 @@ All webhook payloads follow a consistent top-level structure with event-specific
|
|
|
26
26
|
"timestamp": "2026-06-23T14:30:00.000Z",
|
|
27
27
|
"organizationId": "8f14e45f-ceea-4e7a-9c3d-1c2b3a4d5e6f",
|
|
28
28
|
"mode": "live",
|
|
29
|
-
"apiVersion": "2026-
|
|
29
|
+
"apiVersion": "2026-08-27",
|
|
30
30
|
"data": {
|
|
31
31
|
"invoiceId": "inv_n4o5p6",
|
|
32
32
|
"invoiceNumber": "INV-0043",
|
package/docs/webhooks/meta.json
CHANGED
|
@@ -9,6 +9,12 @@
|
|
|
9
9
|
"subscription-created",
|
|
10
10
|
"subscription-activated",
|
|
11
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",
|
|
12
18
|
"subscription-canceled",
|
|
13
19
|
"subscription-updated",
|
|
14
20
|
"subscription-plan-changed",
|
|
@@ -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-
|
|
28
|
+
"apiVersion": "2026-08-27",
|
|
29
29
|
"data": {
|
|
30
30
|
"paymentTransactionId": "txn_q7r8s9",
|
|
31
31
|
"provider": "stripe",
|
|
@@ -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-
|
|
27
|
+
"apiVersion": "2026-08-27",
|
|
28
28
|
"data": {
|
|
29
29
|
"paymentTransactionId": "txn_q7r8s9",
|
|
30
30
|
"provider": "stripe",
|
|
@@ -1,34 +1,175 @@
|
|
|
1
1
|
---
|
|
2
|
-
lastModified: 2026-
|
|
2
|
+
lastModified: 2026-09-08
|
|
3
3
|
title: "payment.failed"
|
|
4
|
-
description: "Fired when a
|
|
4
|
+
description: "Fired when a subscription charge fails, including resume charges 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, if available.
|
|
11
12
|
- `invoiceNumber` (string) — The human-readable invoice number, if available.
|
|
12
13
|
- `customerId` (string) — The customer ID. Returns your externalId if you provided one when creating the customer, otherwise returns the Commet publicId.
|
|
13
14
|
- `subscriptionId` (string | null) — The subscription ID, if the invoice is linked to a subscription.
|
|
14
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.
|
|
15
18
|
- `failureCode` (string) — The failure code from the payment processor.
|
|
16
19
|
- `failureMessage` (string) — A human-readable failure message.
|
|
17
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.
|
|
18
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
|
+
|
|
19
157
|
```json
|
|
20
158
|
{
|
|
21
159
|
"event": "payment.failed",
|
|
22
160
|
"timestamp": "2026-06-23T14:30:00.000Z",
|
|
23
161
|
"organizationId": "8f14e45f-ceea-4e7a-9c3d-1c2b3a4d5e6f",
|
|
24
162
|
"mode": "live",
|
|
25
|
-
"apiVersion": "2026-
|
|
163
|
+
"apiVersion": "2026-08-27",
|
|
26
164
|
"data": {
|
|
165
|
+
"paymentContext": null,
|
|
27
166
|
"invoiceId": "inv_n4o5p6",
|
|
28
167
|
"invoiceNumber": "INV-0043",
|
|
29
168
|
"customerId": "user_123",
|
|
30
169
|
"subscriptionId": "sub_1a2b3c4d",
|
|
31
170
|
"provider": "stripe",
|
|
171
|
+
"paymentMethod": "card",
|
|
172
|
+
"subPaymentMethod": null,
|
|
32
173
|
"failureCode": "card_declined",
|
|
33
174
|
"failureMessage": "Your card was declined.",
|
|
34
175
|
"recoveryUrl": "https://pay.commet.co/recover/tok_9f8e7d6c"
|
|
@@ -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-
|
|
23
|
+
"apiVersion": "2026-08-27",
|
|
24
24
|
"data": {
|
|
25
25
|
"paymentId": "pay_l1m2n3",
|
|
26
26
|
"status": "canceled",
|
|
@@ -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 "succeeded" for this event.
|
|
12
13
|
- `amount` (number) — The collected amount in cents (100 = $1.00).
|
|
@@ -16,6 +17,40 @@ All webhook payloads follow a consistent top-level structure with event-specific
|
|
|
16
17
|
- `invoiceId` (string) — The one-time invoice generated for this payment.
|
|
17
18
|
- `invoiceNumber` (string) — The human-readable invoice number.
|
|
18
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.
|
|
19
54
|
|
|
20
55
|
```json
|
|
21
56
|
{
|
|
@@ -23,8 +58,13 @@ All webhook payloads follow a consistent top-level structure with event-specific
|
|
|
23
58
|
"timestamp": "2026-06-23T14:30:00.000Z",
|
|
24
59
|
"organizationId": "8f14e45f-ceea-4e7a-9c3d-1c2b3a4d5e6f",
|
|
25
60
|
"mode": "live",
|
|
26
|
-
"apiVersion": "2026-
|
|
61
|
+
"apiVersion": "2026-08-27",
|
|
27
62
|
"data": {
|
|
63
|
+
"paymentContext": {
|
|
64
|
+
"reason": "one_time_payment",
|
|
65
|
+
"paymentLinkId": "pay_l1m2n3",
|
|
66
|
+
"recovery": null
|
|
67
|
+
},
|
|
28
68
|
"paymentId": "pay_l1m2n3",
|
|
29
69
|
"status": "succeeded",
|
|
30
70
|
"amount": 5000,
|
|
@@ -33,7 +73,9 @@ All webhook payloads follow a consistent top-level structure with event-specific
|
|
|
33
73
|
"customerId": "user_123",
|
|
34
74
|
"invoiceId": "inv_n4o5p6",
|
|
35
75
|
"invoiceNumber": "INV-0044",
|
|
36
|
-
"paymentTransactionId": "txn_q7r8s9"
|
|
76
|
+
"paymentTransactionId": "txn_q7r8s9",
|
|
77
|
+
"paymentMethod": "card",
|
|
78
|
+
"subPaymentMethod": null
|
|
37
79
|
}
|
|
38
80
|
}
|
|
39
81
|
```
|