@commet/node 9.5.0 → 9.7.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 +90 -51
- package/dist/index.d.ts +90 -51
- package/dist/index.js +11 -2
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +11 -2
- package/dist/index.mjs.map +1 -1
- package/docs/ai-onboarding/commet-skill.md +1 -1
- package/docs/ai-onboarding/mcp-server.md +1 -1
- package/docs/api-reference/index.md +1 -1
- package/docs/api-reference/offers.md +2 -2
- package/docs/api-reference/plans.md +1 -1
- package/docs/api-reference/promo-codes.md +2 -2
- package/docs/api-reference/subscriptions.md +29 -4
- package/docs/documentation/api-versioning.md +1 -0
- package/docs/documentation/better-auth.md +1 -8
- package/docs/documentation/cli.md +13 -13
- package/docs/documentation/customers/customer-portal.md +1 -7
- package/docs/documentation/customers/manage-customers.md +0 -6
- package/docs/documentation/error-handling.md +1 -1
- package/docs/documentation/finance/acceptable-use.md +1 -6
- package/docs/documentation/finance/finance-overview.md +0 -5
- package/docs/documentation/finance/local-currency-taxes.md +0 -6
- package/docs/documentation/finance/merchant-of-record.md +0 -7
- package/docs/documentation/finance/payouts-verification.md +0 -5
- package/docs/documentation/finance/payouts.md +0 -6
- package/docs/documentation/finance/supported-countries.md +1 -6
- package/docs/documentation/go/integrate-with-encore.md +1 -8
- package/docs/documentation/go/integrate-with-go.md +1 -8
- package/docs/documentation/invoicing/handle-failed-payments.md +3 -9
- package/docs/documentation/invoicing/invoices-and-billing-cycles.md +10 -15
- package/docs/documentation/java/integrate-with-java.md +1 -5
- package/docs/documentation/nodejs/integrate-with-astro.md +1 -8
- package/docs/documentation/nodejs/integrate-with-bun.md +1 -8
- package/docs/documentation/nodejs/integrate-with-express.md +1 -8
- package/docs/documentation/nodejs/integrate-with-hono.md +1 -8
- package/docs/documentation/nodejs/integrate-with-nextjs.md +1 -8
- package/docs/documentation/nodejs/integrate-with-nuxt.md +1 -8
- package/docs/documentation/nodejs/integrate-with-remix.md +1 -8
- package/docs/documentation/nodejs/integrate-with-sveltekit.md +1 -8
- package/docs/documentation/payments/accept-one-time-payments.md +0 -8
- package/docs/documentation/payments/payment-orchestration.md +0 -6
- package/docs/documentation/payments/payment-providers.md +0 -6
- package/docs/documentation/php/integrate-with-laravel.md +1 -8
- package/docs/documentation/php/integrate-with-php.md +1 -7
- package/docs/documentation/php/integrate-with-symfony.md +1 -8
- package/docs/documentation/plans/add-ons.md +0 -8
- package/docs/documentation/plans/balance-and-top-ups.md +1 -1
- package/docs/documentation/plans/configure-features.md +1 -8
- package/docs/documentation/plans/consumption-models.md +7 -14
- package/docs/documentation/plans/create-plans.md +0 -9
- package/docs/documentation/plans/credit-packs.md +0 -7
- package/docs/documentation/plans/one-time-payments.md +36 -7
- package/docs/documentation/plans/plan-groups.md +0 -6
- package/docs/documentation/python/integrate-with-django.md +1 -8
- package/docs/documentation/python/integrate-with-fastapi.md +1 -8
- package/docs/documentation/python/integrate-with-flask.md +1 -8
- package/docs/documentation/python/integrate-with-python.md +1 -8
- package/docs/documentation/sales/introductory-offers.md +1 -9
- package/docs/documentation/sales/offers.md +0 -8
- package/docs/documentation/sales/promo-codes.md +0 -7
- package/docs/documentation/sales/promotional-offers.md +0 -7
- package/docs/documentation/sales/regional-prices.md +0 -7
- package/docs/documentation/sales/trial-periods.md +0 -8
- package/docs/documentation/sdk-reference.md +1 -1
- package/docs/documentation/subscriptions/manage-subscriptions.md +2 -9
- package/docs/documentation/subscriptions/pay-in-advance.md +161 -0
- package/docs/documentation/subscriptions/plan-grants.md +0 -6
- package/docs/documentation/subscriptions/upgrade-and-downgrade-plans.md +1 -7
- package/docs/documentation/testing-sandbox.md +1 -1
- package/docs/documentation/usage/ai-token-billing.md +0 -6
- package/docs/documentation/usage/quota-management.md +1 -7
- package/docs/documentation/usage/seat-management.md +1 -7
- package/docs/documentation/usage/track-usage.md +1 -7
- package/docs/knowledge-base/how-do-balance-and-top-ups-work.md +1 -1
- package/docs/knowledge-base/how-do-discounts-work.md +0 -8
- package/docs/knowledge-base/how-do-free-plans-work-without-payment.md +9 -15
- package/docs/knowledge-base/how-do-monthly-quarterly-and-yearly-billing-work.md +6 -12
- package/docs/knowledge-base/how-do-trial-periods-work.md +1 -8
- package/docs/knowledge-base/how-does-billing-work.md +1 -1
- package/docs/knowledge-base/how-does-quota-based-billing-work.md +1 -7
- package/docs/knowledge-base/how-does-seat-based-billing-work.md +1 -7
- package/docs/knowledge-base/how-is-proration-calculated-when-changing-plans.md +1 -7
- package/docs/knowledge-base/what-happens-when-a-customer-changes-plans.md +2 -6
- package/docs/knowledge-base/what-happens-when-a-payment-fails.md +1 -7
- package/docs/knowledge-base/what-happens-when-you-change-your-prices.md +1 -7
- package/docs/knowledge-base/what-invoices-do-customers-receive-and-when.md +13 -19
- package/docs/manifest.json +8 -1
- package/docs/platform-documentation.md +1 -0
- package/docs/schemas.md +23 -13
- package/docs/webhooks/introduction.md +3 -3
- package/docs/webhooks.md +4 -4
- package/docs/webhooks.openapi.json +15 -5
- package/package.json +1 -1
package/docs/schemas.md
CHANGED
|
@@ -9,6 +9,7 @@ Generated from Commet API version `2026-08-27`.
|
|
|
9
9
|
- `"weekly"`
|
|
10
10
|
- `"monthly"`
|
|
11
11
|
- `"quarterly"`
|
|
12
|
+
- `"semiannual"`
|
|
12
13
|
- `"yearly"`
|
|
13
14
|
- `"one_time"`
|
|
14
15
|
|
|
@@ -37,12 +38,15 @@ Generated from Commet API version `2026-08-27`.
|
|
|
37
38
|
- `"one_time_payment"`
|
|
38
39
|
- `"reactivation"`
|
|
39
40
|
- `"resume"`
|
|
41
|
+
- `"prepayment"`
|
|
40
42
|
|
|
41
43
|
### PaymentMethod
|
|
42
44
|
|
|
43
45
|
- `"card"`
|
|
44
46
|
- `"oxxo"`
|
|
45
47
|
- `"mercado_pago"`
|
|
48
|
+
- `"google_pay"`
|
|
49
|
+
- `"smartpix"`
|
|
46
50
|
|
|
47
51
|
### PaymentProvider
|
|
48
52
|
|
|
@@ -374,7 +378,7 @@ Variants:
|
|
|
374
378
|
- `planName` (`string | null`, required)
|
|
375
379
|
- `poNumber` (`string | null`, required)
|
|
376
380
|
- `reference` (`string | null`, required)
|
|
377
|
-
- `lineItems` (`Array<{ lineType: "plan_base" | "feature_overage" | "feature_seats" | "feature_quota" | "discount" | "promo_code_discount" | "credit" | "balance_overage" | "addon_base" | "one_time"; featureName: string | null; description: string; quantity: number; unitAmount: number; amount: number; includedAmount: number | null; usedAmount: number | null; overageAmount: number | null; discountType: string | null; discountValue: number | null; discountName: string | null; chargeType: "standard" | "advance" | "true_up" }>`, required)
|
|
381
|
+
- `lineItems` (`Array<{ lineType: "plan_base" | "feature_overage" | "feature_seats" | "feature_quota" | "discount" | "promo_code_discount" | "credit" | "balance_overage" | "addon_base" | "one_time" | "prepaid_period"; featureName: string | null; description: string; quantity: number; unitAmount: number; amount: number; includedAmount: number | null; usedAmount: number | null; overageAmount: number | null; discountType: string | null; discountValue: number | null; discountName: string | null; chargeType: "standard" | "advance" | "true_up" }>`, required)
|
|
378
382
|
- `object` (`"invoice"`, required)
|
|
379
383
|
- `livemode` (`boolean`, required)
|
|
380
384
|
|
|
@@ -424,7 +428,7 @@ Variants:
|
|
|
424
428
|
|
|
425
429
|
- `id` (`string`, required)
|
|
426
430
|
- `name` (`string`, required)
|
|
427
|
-
- `phases` (`Array<{ type: "free_trial"; durationDays: number } | { type: "percentage"; durationCycles: number | null; durationInterval: "weekly" | "monthly" | "quarterly" | "yearly" | null; percentage: number } | { type: "amount_off"; durationCycles: number | null; durationInterval: "weekly" | "monthly" | "quarterly" | "yearly" | null; amounts: Array<{ currency: string; amount: number }> } | { type: "fixed_price"; durationCycles: number | null; durationInterval: "weekly" | "monthly" | "quarterly" | "yearly" | null; prices: Array<{ currency: string; amount: number }> }>`, required)
|
|
431
|
+
- `phases` (`Array<{ type: "free_trial"; durationDays: number } | { type: "percentage"; durationCycles: number | null; durationInterval: "weekly" | "monthly" | "quarterly" | "semiannual" | "yearly" | null; percentage: number } | { type: "amount_off"; durationCycles: number | null; durationInterval: "weekly" | "monthly" | "quarterly" | "semiannual" | "yearly" | null; amounts: Array<{ currency: string; amount: number }> } | { type: "fixed_price"; durationCycles: number | null; durationInterval: "weekly" | "monthly" | "quarterly" | "semiannual" | "yearly" | null; prices: Array<{ currency: string; amount: number }> }>`, required)
|
|
428
432
|
- `metadata` (`Record<string, unknown>`, required)
|
|
429
433
|
- `startsAt` (`string | null`, required)
|
|
430
434
|
- `endsAt` (`string | null`, required)
|
|
@@ -436,7 +440,7 @@ Variants:
|
|
|
436
440
|
|
|
437
441
|
### Payment
|
|
438
442
|
|
|
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.
|
|
443
|
+
- `paymentContext` (`{ reason: "first_subscription_payment" | "trial_conversion" | "recurring_billing" | "plan_change" | "reactivation" | "subscription_resume" | "one_time_payment" | "overage" | "adjustment" | "addon_activation" | "prepayment"; 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.
|
|
440
444
|
- `id` (`string`, required)
|
|
441
445
|
- `customerId` (`string | null`, required)
|
|
442
446
|
- `kind` (`"link" | "charge"`, required)
|
|
@@ -517,9 +521,9 @@ Variants:
|
|
|
517
521
|
|
|
518
522
|
Variants:
|
|
519
523
|
|
|
520
|
-
- `{ outcome: "requires_checkout"; requiresCheckout: true; checkoutUrl: string; offerApplication?: { id: string; offerId: string; name: string; currency: string; subtotal: number; discountAmount: number; total: number; phases: Array<{ type: "free_trial"; durationDays: number; startsAt: string | null; endsAt: string | null } | { type: "percentage"; durationCycles: number | null; durationInterval: "weekly" | "monthly" | "quarterly" | "yearly" | null; startsAt: string | null; endsAt: string | null; percentage: number } | { type: "amount_off"; durationCycles: number | null; durationInterval: "weekly" | "monthly" | "quarterly" | "yearly" | null; startsAt: string | null; endsAt: string | null; amount: number } | { type: "fixed_price"; durationCycles: number | null; durationInterval: "weekly" | "monthly" | "quarterly" | "yearly" | null; startsAt: string | null; endsAt: string | null; price: number }>; appliesTo: { type: "plan_price"; id: string } | { type: "addon"; id: string } | { type: "credit_pack"; id: string } }; object: "plan_change"; livemode: boolean }`
|
|
524
|
+
- `{ outcome: "requires_checkout"; requiresCheckout: true; checkoutUrl: string; offerApplication?: { id: string; offerId: string; name: string; currency: string; subtotal: number; discountAmount: number; total: number; phases: Array<{ type: "free_trial"; durationDays: number; startsAt: string | null; endsAt: string | null } | { type: "percentage"; durationCycles: number | null; durationInterval: "weekly" | "monthly" | "quarterly" | "semiannual" | "yearly" | null; startsAt: string | null; endsAt: string | null; percentage: number } | { type: "amount_off"; durationCycles: number | null; durationInterval: "weekly" | "monthly" | "quarterly" | "semiannual" | "yearly" | null; startsAt: string | null; endsAt: string | null; amount: number } | { type: "fixed_price"; durationCycles: number | null; durationInterval: "weekly" | "monthly" | "quarterly" | "semiannual" | "yearly" | null; startsAt: string | null; endsAt: string | null; price: number }>; appliesTo: { type: "plan_price"; id: string } | { type: "addon"; id: string } | { type: "credit_pack"; id: string } }; object: "plan_change"; livemode: boolean }`
|
|
521
525
|
- `{ outcome: "scheduled"; id: string; scheduled: true; scheduledFor: string; changeType: "subscription.plan_downgrade" | "subscription.interval_change" | "subscription.cancel"; customerId: string; newPlanId?: string; newPlanName?: string; newBillingInterval?: string; seatLimitWarning?: { featureCode: string; featureName: string; currentSeats: number; included: number; newPlanName: string; effectiveDate: string }; object: "plan_change"; livemode: boolean }`
|
|
522
|
-
- `{ outcome: "completed"; id: string; scheduled: false; customerId: string; previousPlan: { id: string; name: string }; currentPlan: { id: string; name: string; price: number }; billingInterval: string; billing: { credit: number; creditsApplied: number; charge: number; taxAmount: number; netAmount: number; totalCharged: number; remainingCreditBalance: number }; invoiceId?: string; offerApplication?: { id: string; offerId: string; name: string; currency: string; subtotal: number; discountAmount: number; total: number; phases: Array<{ type: "free_trial"; durationDays: number; startsAt: string | null; endsAt: string | null } | { type: "percentage"; durationCycles: number | null; durationInterval: "weekly" | "monthly" | "quarterly" | "yearly" | null; startsAt: string | null; endsAt: string | null; percentage: number } | { type: "amount_off"; durationCycles: number | null; durationInterval: "weekly" | "monthly" | "quarterly" | "yearly" | null; startsAt: string | null; endsAt: string | null; amount: number } | { type: "fixed_price"; durationCycles: number | null; durationInterval: "weekly" | "monthly" | "quarterly" | "yearly" | null; startsAt: string | null; endsAt: string | null; price: number }>; appliesTo: { type: "plan_price"; id: string } | { type: "addon"; id: string } | { type: "credit_pack"; id: string } }; object: "plan_change"; livemode: boolean }`
|
|
526
|
+
- `{ outcome: "completed"; id: string; scheduled: false; customerId: string; previousPlan: { id: string; name: string }; currentPlan: { id: string; name: string; price: number }; billingInterval: string; billing: { credit: number; creditsApplied: number; charge: number; taxAmount: number; netAmount: number; totalCharged: number; remainingCreditBalance: number }; invoiceId?: string; offerApplication?: { id: string; offerId: string; name: string; currency: string; subtotal: number; discountAmount: number; total: number; phases: Array<{ type: "free_trial"; durationDays: number; startsAt: string | null; endsAt: string | null } | { type: "percentage"; durationCycles: number | null; durationInterval: "weekly" | "monthly" | "quarterly" | "semiannual" | "yearly" | null; startsAt: string | null; endsAt: string | null; percentage: number } | { type: "amount_off"; durationCycles: number | null; durationInterval: "weekly" | "monthly" | "quarterly" | "semiannual" | "yearly" | null; startsAt: string | null; endsAt: string | null; amount: number } | { type: "fixed_price"; durationCycles: number | null; durationInterval: "weekly" | "monthly" | "quarterly" | "semiannual" | "yearly" | null; startsAt: string | null; endsAt: string | null; price: number }>; appliesTo: { type: "plan_price"; id: string } | { type: "addon"; id: string } | { type: "credit_pack"; id: string } }; object: "plan_change"; livemode: boolean }`
|
|
523
527
|
|
|
524
528
|
### PlanFeature
|
|
525
529
|
|
|
@@ -622,6 +626,12 @@ Variants:
|
|
|
622
626
|
- `object` (`"portal_session"`, required)
|
|
623
627
|
- `livemode` (`boolean`, required)
|
|
624
628
|
|
|
629
|
+
### PrepaidPeriodsCheckout
|
|
630
|
+
|
|
631
|
+
- `checkoutUrl` (`string`, required)
|
|
632
|
+
- `object` (`"checkout_session"`, required)
|
|
633
|
+
- `livemode` (`boolean`, required)
|
|
634
|
+
|
|
625
635
|
### PreviewChange
|
|
626
636
|
|
|
627
637
|
- `currency` (`string`, required)
|
|
@@ -632,7 +642,7 @@ Variants:
|
|
|
632
642
|
- `daysRemaining` (`number`, required)
|
|
633
643
|
- `totalDays` (`number`, required)
|
|
634
644
|
- `isUpgrade` (`boolean`, required)
|
|
635
|
-
- `offerApplication` (`{ id: string; offerId: string; name: string; currency: string; subtotal: number; discountAmount: number; total: number; phases: Array<{ type: "free_trial"; durationDays: number; startsAt: string | null; endsAt: string | null } | { type: "percentage"; durationCycles: number | null; durationInterval: "weekly" | "monthly" | "quarterly" | "yearly" | null; startsAt: string | null; endsAt: string | null; percentage: number } | { type: "amount_off"; durationCycles: number | null; durationInterval: "weekly" | "monthly" | "quarterly" | "yearly" | null; startsAt: string | null; endsAt: string | null; amount: number } | { type: "fixed_price"; durationCycles: number | null; durationInterval: "weekly" | "monthly" | "quarterly" | "yearly" | null; startsAt: string | null; endsAt: string | null; price: number }>; appliesTo: { type: "plan_price"; id: string } | { type: "addon"; id: string } | { type: "credit_pack"; id: string } }`, optional)
|
|
645
|
+
- `offerApplication` (`{ id: string; offerId: string; name: string; currency: string; subtotal: number; discountAmount: number; total: number; phases: Array<{ type: "free_trial"; durationDays: number; startsAt: string | null; endsAt: string | null } | { type: "percentage"; durationCycles: number | null; durationInterval: "weekly" | "monthly" | "quarterly" | "semiannual" | "yearly" | null; startsAt: string | null; endsAt: string | null; percentage: number } | { type: "amount_off"; durationCycles: number | null; durationInterval: "weekly" | "monthly" | "quarterly" | "semiannual" | "yearly" | null; startsAt: string | null; endsAt: string | null; amount: number } | { type: "fixed_price"; durationCycles: number | null; durationInterval: "weekly" | "monthly" | "quarterly" | "semiannual" | "yearly" | null; startsAt: string | null; endsAt: string | null; price: number }>; appliesTo: { type: "plan_price"; id: string } | { type: "addon"; id: string } | { type: "credit_pack"; id: string } }`, optional)
|
|
636
646
|
- `object` (`"plan_change_preview"`, required)
|
|
637
647
|
- `livemode` (`boolean`, required)
|
|
638
648
|
|
|
@@ -656,7 +666,7 @@ Variants:
|
|
|
656
666
|
- `subscriptionId` (`string`, required)
|
|
657
667
|
- `invoiceId` (`string`, required)
|
|
658
668
|
- `status` (`"processing" | "succeeded"`, required)
|
|
659
|
-
- `offerApplication` (`{ id: string; offerId: string; name: string; currency: string; subtotal: number; discountAmount: number; total: number; phases: Array<{ type: "free_trial"; durationDays: number; startsAt: string | null; endsAt: string | null } | { type: "percentage"; durationCycles: number | null; durationInterval: "weekly" | "monthly" | "quarterly" | "yearly" | null; startsAt: string | null; endsAt: string | null; percentage: number } | { type: "amount_off"; durationCycles: number | null; durationInterval: "weekly" | "monthly" | "quarterly" | "yearly" | null; startsAt: string | null; endsAt: string | null; amount: number } | { type: "fixed_price"; durationCycles: number | null; durationInterval: "weekly" | "monthly" | "quarterly" | "yearly" | null; startsAt: string | null; endsAt: string | null; price: number }>; appliesTo: { type: "plan_price"; id: string } | { type: "addon"; id: string } | { type: "credit_pack"; id: string } }`, optional)
|
|
669
|
+
- `offerApplication` (`{ id: string; offerId: string; name: string; currency: string; subtotal: number; discountAmount: number; total: number; phases: Array<{ type: "free_trial"; durationDays: number; startsAt: string | null; endsAt: string | null } | { type: "percentage"; durationCycles: number | null; durationInterval: "weekly" | "monthly" | "quarterly" | "semiannual" | "yearly" | null; startsAt: string | null; endsAt: string | null; percentage: number } | { type: "amount_off"; durationCycles: number | null; durationInterval: "weekly" | "monthly" | "quarterly" | "semiannual" | "yearly" | null; startsAt: string | null; endsAt: string | null; amount: number } | { type: "fixed_price"; durationCycles: number | null; durationInterval: "weekly" | "monthly" | "quarterly" | "semiannual" | "yearly" | null; startsAt: string | null; endsAt: string | null; price: number }>; appliesTo: { type: "plan_price"; id: string } | { type: "addon"; id: string } | { type: "credit_pack"; id: string } }`, optional)
|
|
660
670
|
- `object` (`"subscription_reactivation"`, required)
|
|
661
671
|
- `livemode` (`boolean`, required)
|
|
662
672
|
|
|
@@ -792,10 +802,10 @@ Variants:
|
|
|
792
802
|
|
|
793
803
|
Variants:
|
|
794
804
|
|
|
795
|
-
- `{ type: "free_trial"; durationDays: number; durationInterval: "weekly" | "monthly" | "quarterly" | "yearly" | null; startsAt: string | null; endsAt: string | null }`
|
|
796
|
-
- `{ type: "percentage"; durationCycles: number | null; durationInterval: "weekly" | "monthly" | "quarterly" | "yearly" | null; percentage: number; startsAt: string | null; endsAt: string | null }`
|
|
797
|
-
- `{ type: "amount_off"; durationCycles: number | null; durationInterval: "weekly" | "monthly" | "quarterly" | "yearly" | null; amount: number; startsAt: string | null; endsAt: string | null }`
|
|
798
|
-
- `{ type: "fixed_price"; durationCycles: number | null; durationInterval: "weekly" | "monthly" | "quarterly" | "yearly" | null; price: number; startsAt: string | null; endsAt: string | null }`
|
|
805
|
+
- `{ type: "free_trial"; durationDays: number; durationInterval: "weekly" | "monthly" | "quarterly" | "semiannual" | "yearly" | null; startsAt: string | null; endsAt: string | null }`
|
|
806
|
+
- `{ type: "percentage"; durationCycles: number | null; durationInterval: "weekly" | "monthly" | "quarterly" | "semiannual" | "yearly" | null; percentage: number; startsAt: string | null; endsAt: string | null }`
|
|
807
|
+
- `{ type: "amount_off"; durationCycles: number | null; durationInterval: "weekly" | "monthly" | "quarterly" | "semiannual" | "yearly" | null; amount: number; startsAt: string | null; endsAt: string | null }`
|
|
808
|
+
- `{ type: "fixed_price"; durationCycles: number | null; durationInterval: "weekly" | "monthly" | "quarterly" | "semiannual" | "yearly" | null; price: number; startsAt: string | null; endsAt: string | null }`
|
|
799
809
|
|
|
800
810
|
### SubscriptionResume
|
|
801
811
|
|
|
@@ -857,7 +867,7 @@ Variants:
|
|
|
857
867
|
|
|
858
868
|
### Transaction
|
|
859
869
|
|
|
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.
|
|
870
|
+
- `paymentContext` (`{ reason: "first_subscription_payment" | "trial_conversion" | "recurring_billing" | "plan_change" | "reactivation" | "subscription_resume" | "one_time_payment" | "overage" | "adjustment" | "addon_activation" | "prepayment"; 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.
|
|
861
871
|
- `id` (`string`, required)
|
|
862
872
|
- `invoiceId` (`string | null`, required)
|
|
863
873
|
- `grossAmount` (`number | null`, required) — Gross amount in USD cents. Null when the provider has not reported an honest USD figure; see presentmentAmount.
|
|
@@ -880,7 +890,7 @@ Variants:
|
|
|
880
890
|
|
|
881
891
|
### TransactionListItem
|
|
882
892
|
|
|
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.
|
|
893
|
+
- `paymentContext` (`{ reason: "first_subscription_payment" | "trial_conversion" | "recurring_billing" | "plan_change" | "reactivation" | "subscription_resume" | "one_time_payment" | "overage" | "adjustment" | "addon_activation" | "prepayment"; 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.
|
|
884
894
|
- `id` (`string`, required)
|
|
885
895
|
- `invoiceId` (`string | null`, required)
|
|
886
896
|
- `grossAmount` (`number | null`, required) — Gross amount in USD cents. Null when the provider has not reported an honest USD figure; see presentmentAmount.
|
|
@@ -446,7 +446,7 @@ Commet sends these headers with every webhook request:
|
|
|
446
446
|
|
|
447
447
|
## Retry policy
|
|
448
448
|
|
|
449
|
-
If your endpoint returns a non-2xx status or times out (10 seconds), Commet retries with exponential backoff. The initial delivery counts as the first attempt, followed by up to 7 retries — 8 attempts in total over a window of roughly
|
|
449
|
+
If your endpoint returns a non-2xx status or times out (10 seconds), Commet retries with exponential backoff capped at 1 hour. The initial delivery counts as the first attempt, followed by up to 7 retries — 8 attempts in total over a window of roughly 4 hours:
|
|
450
450
|
|
|
451
451
|
| Retry | Delay after previous attempt |
|
|
452
452
|
| --------- | ---------------------------- |
|
|
@@ -455,8 +455,8 @@ If your endpoint returns a non-2xx status or times out (10 seconds), Commet retr
|
|
|
455
455
|
| 3rd retry | 15 minutes |
|
|
456
456
|
| 4th retry | 30 minutes |
|
|
457
457
|
| 5th retry | 1 hour |
|
|
458
|
-
| 6th retry |
|
|
459
|
-
| 7th retry |
|
|
458
|
+
| 6th retry | 1 hour |
|
|
459
|
+
| 7th retry | 1 hour |
|
|
460
460
|
|
|
461
461
|
After 8 failed attempts (the initial delivery plus 7 retries), the delivery is marked as failed and we email your organization's notification recipient with the endpoint URL, event type, and the last response we received (HTTP status or error code).
|
|
462
462
|
|
package/docs/webhooks.md
CHANGED
|
@@ -316,7 +316,7 @@ Fired every time a payment settles successfully — the first payment and every
|
|
|
316
316
|
|
|
317
317
|
### Data
|
|
318
318
|
|
|
319
|
-
- `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.
|
|
319
|
+
- `paymentContext` (`{ reason: "first_subscription_payment" | "trial_conversion" | "recurring_billing" | "plan_change" | "reactivation" | "subscription_resume" | "one_time_payment" | "overage" | "adjustment" | "addon_activation" | "prepayment"; 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.
|
|
320
320
|
- `invoiceId` (`string`, required) — The invoice ID.
|
|
321
321
|
- `invoiceNumber` (`string`, required) — The human-readable invoice number.
|
|
322
322
|
- `invoiceTotal` (`number`, required) — Invoice total in cents (100 = $1.00).
|
|
@@ -338,7 +338,7 @@ Fired when an invoice-linked subscription charge fails.
|
|
|
338
338
|
|
|
339
339
|
### Data
|
|
340
340
|
|
|
341
|
-
- `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.
|
|
341
|
+
- `paymentContext` (`{ reason: "first_subscription_payment" | "trial_conversion" | "recurring_billing" | "plan_change" | "reactivation" | "subscription_resume" | "one_time_payment" | "overage" | "adjustment" | "addon_activation" | "prepayment"; 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.
|
|
342
342
|
- `invoiceId` (`string`, required) — The invoice ID, if available.
|
|
343
343
|
- `invoiceNumber` (`string`, required) — The human-readable invoice number, if available.
|
|
344
344
|
- `customerId` (`string`, required) — The customer ID. Returns your externalId if you provided one when creating the customer, otherwise returns the Commet publicId.
|
|
@@ -448,7 +448,7 @@ Fired when a payment link is paid. The charge settled and a one-time invoice was
|
|
|
448
448
|
|
|
449
449
|
### Data
|
|
450
450
|
|
|
451
|
-
- `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.
|
|
451
|
+
- `paymentContext` (`{ reason: "first_subscription_payment" | "trial_conversion" | "recurring_billing" | "plan_change" | "reactivation" | "subscription_resume" | "one_time_payment" | "overage" | "adjustment" | "addon_activation" | "prepayment"; 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.
|
|
452
452
|
- `paymentId` (`string`, required) — The payment link ID.
|
|
453
453
|
- `status` (`string`, required) — The link status. Always "succeeded" for this event.
|
|
454
454
|
- `amount` (`number`, required) — The collected amount in cents (100 = $1.00).
|
|
@@ -467,7 +467,7 @@ Fired when a payment link charge attempt is declined. The link stays open and ca
|
|
|
467
467
|
|
|
468
468
|
### Data
|
|
469
469
|
|
|
470
|
-
- `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.
|
|
470
|
+
- `paymentContext` (`{ reason: "first_subscription_payment" | "trial_conversion" | "recurring_billing" | "plan_change" | "reactivation" | "subscription_resume" | "one_time_payment" | "overage" | "adjustment" | "addon_activation" | "prepayment"; 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.
|
|
471
471
|
- `paymentId` (`string`, required) — The payment link ID.
|
|
472
472
|
- `status` (`string`, required) — The link status. Always "failed" for this event.
|
|
473
473
|
- `amount` (`number`, required) — The amount that was attempted in cents (100 = $1.00).
|
|
@@ -3054,7 +3054,9 @@
|
|
|
3054
3054
|
"subscription_resume",
|
|
3055
3055
|
"one_time_payment",
|
|
3056
3056
|
"overage",
|
|
3057
|
-
"adjustment"
|
|
3057
|
+
"adjustment",
|
|
3058
|
+
"addon_activation",
|
|
3059
|
+
"prepayment"
|
|
3058
3060
|
],
|
|
3059
3061
|
"description": "The original reason for the charge. Recovery never replaces this reason."
|
|
3060
3062
|
},
|
|
@@ -3393,7 +3395,9 @@
|
|
|
3393
3395
|
"subscription_resume",
|
|
3394
3396
|
"one_time_payment",
|
|
3395
3397
|
"overage",
|
|
3396
|
-
"adjustment"
|
|
3398
|
+
"adjustment",
|
|
3399
|
+
"addon_activation",
|
|
3400
|
+
"prepayment"
|
|
3397
3401
|
],
|
|
3398
3402
|
"description": "The original reason for the charge. Recovery never replaces this reason."
|
|
3399
3403
|
},
|
|
@@ -4663,7 +4667,9 @@
|
|
|
4663
4667
|
"subscription_resume",
|
|
4664
4668
|
"one_time_payment",
|
|
4665
4669
|
"overage",
|
|
4666
|
-
"adjustment"
|
|
4670
|
+
"adjustment",
|
|
4671
|
+
"addon_activation",
|
|
4672
|
+
"prepayment"
|
|
4667
4673
|
],
|
|
4668
4674
|
"description": "The original reason for the charge. Recovery never replaces this reason."
|
|
4669
4675
|
},
|
|
@@ -4944,7 +4950,9 @@
|
|
|
4944
4950
|
"subscription_resume",
|
|
4945
4951
|
"one_time_payment",
|
|
4946
4952
|
"overage",
|
|
4947
|
-
"adjustment"
|
|
4953
|
+
"adjustment",
|
|
4954
|
+
"addon_activation",
|
|
4955
|
+
"prepayment"
|
|
4948
4956
|
],
|
|
4949
4957
|
"description": "The original reason for the charge. Recovery never replaces this reason."
|
|
4950
4958
|
},
|
|
@@ -10774,7 +10782,9 @@
|
|
|
10774
10782
|
"enum": [
|
|
10775
10783
|
"card",
|
|
10776
10784
|
"oxxo",
|
|
10777
|
-
"mercado_pago"
|
|
10785
|
+
"mercado_pago",
|
|
10786
|
+
"google_pay",
|
|
10787
|
+
"smartpix"
|
|
10778
10788
|
]
|
|
10779
10789
|
},
|
|
10780
10790
|
"SubPaymentMethod": {
|