@commet/node 9.3.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 +366 -17
- package/dist/index.d.ts +366 -17
- package/dist/index.js +31 -7
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +31 -7
- 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/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 +1 -1
- 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 +1 -1
- package/docs/api-reference/portal.md +1 -1
- package/docs/api-reference/promo-codes.md +2 -2
- 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 -2
- package/docs/documentation/better-auth.md +0 -1
- package/docs/documentation/choose-a-billing-model.md +54 -26
- package/docs/documentation/cli.md +1 -2
- package/docs/documentation/create-api-key.md +100 -25
- 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 +62 -41
- 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 +8 -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 +9 -10
- package/docs/documentation/subscriptions/manage-subscriptions.md +114 -12
- 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/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/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 +1 -2
- package/docs/knowledge-base/what-invoices-do-customers-receive-and-when.md +0 -1
- package/docs/manifest.json +186 -235
- package/docs/platform-documentation.md +69 -149
- package/docs/schemas.md +35 -1
- package/docs/webhooks/introduction.md +0 -1
- package/docs/webhooks.md +98 -7
- 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 -83
- package/docs/webhooks/payment-dispute-resolved.md +0 -52
- package/docs/webhooks/payment-disputed.md +0 -49
- package/docs/webhooks/payment-failed.md +0 -37
- package/docs/webhooks/payment-link-canceled.md +0 -41
- package/docs/webhooks/payment-link-completed.md +0 -47
- package/docs/webhooks/payment-link-created.md +0 -41
- package/docs/webhooks/payment-link-failed.md +0 -45
- package/docs/webhooks/payment-method-attached.md +0 -40
- package/docs/webhooks/payment-method-updated.md +0 -38
- package/docs/webhooks/payment-received.md +0 -45
- package/docs/webhooks/payment-recovered.md +0 -39
- 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 -57
- 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-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-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,38 +1,66 @@
|
|
|
1
1
|
---
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
description: Choose between a recurring plan, usage, credits, balance, seats, quota, and one-time payments.
|
|
2
|
+
title: Quickstart
|
|
3
|
+
description: Go from a Commet account to your first subscription payment in sandbox.
|
|
5
4
|
---
|
|
6
5
|
|
|
7
|
-
|
|
6
|
+
Commet lets you charge through **subscriptions** and **one-time payments**.
|
|
8
7
|
|
|
9
|
-
|
|
8
|
+
- A **subscription** connects a customer to a plan. The plan defines what they can use and what they pay; Commet manages checkout, invoices, and renewals.
|
|
9
|
+
- A **one-time payment** charges a customer for a single purchase, without a plan or subscription. Follow [Accept One-Time Payments](/docs/accept-one-time-payments) if that is all you need.
|
|
10
10
|
|
|
11
|
-
|
|
12
|
-
| ------------------------------------------ | ---------------- | --------------------------------------- |
|
|
13
|
-
| Access to a product or tier | Recurring plan | $49 per month for Pro |
|
|
14
|
-
| A measurable unit with possible overage | Metered | API calls, storage, messages |
|
|
15
|
-
| Product-specific units | Credits | Generations, exports, analyses |
|
|
16
|
-
| Monetary prepaid spend | Balance | Compute or infrastructure spend |
|
|
17
|
-
| Licensed users or roles | Seats | Editors, agents, workspaces |
|
|
18
|
-
| A hard operational allowance | Quota | Concurrent jobs or provisioned capacity |
|
|
19
|
-
| A single purchase without recurring access | One-time payment | Report, license, setup fee |
|
|
11
|
+
This quickstart walks you through your first paid subscription in sandbox.
|
|
20
12
|
|
|
21
|
-
|
|
13
|
+
## Plans, features, and consumption
|
|
22
14
|
|
|
23
|
-
|
|
15
|
+
A **feature** is something your product provides, such as API calls, seats, or access to a capability. A **plan** groups features and sets their limits and prices.
|
|
24
16
|
|
|
25
|
-
|
|
26
|
-
- Use an **add-on** for an optional recurring capability attached to a subscription.
|
|
27
|
-
- Use a **credit pack** for customer-purchased credits that persist across resets.
|
|
28
|
-
- Use an **Offer** or **Promo Code** to change the price or phases of a sale without cloning the plan.
|
|
29
|
-
- Use a **plan grant** when you want to temporarily expand access without changing the subscription's billing.
|
|
30
|
-
- Use a **customer credit** for a specific monetary adjustment, not as the plan's normal allowance.
|
|
17
|
+
Each plan uses one consumption model to define how its measured usage consumes the included allowance and is charged:
|
|
31
18
|
|
|
32
|
-
|
|
19
|
+
| Model | How it works |
|
|
20
|
+
| ----------- | ----------------------------------------------------------------------------------------------------------------------------- |
|
|
21
|
+
| **Metered** | Count usage per feature. Include a quantity in the plan and optionally charge for usage above it. |
|
|
22
|
+
| **Credits** | Give the customer a pool of credits. Each use deducts the number of credits configured for that feature. |
|
|
23
|
+
| **Balance** | Give the customer a monetary balance. Each use deducts its monetary cost; the plan can block when exhausted or allow overage. |
|
|
33
24
|
|
|
34
|
-
|
|
25
|
+
A fixed monthly price can include features without extra usage charges. You do not need to charge for overage to use a plan.
|
|
35
26
|
|
|
36
|
-
|
|
27
|
+
For this walkthrough, use a **Metered** plan with a monthly price and an included API-call allowance. See [Consumption Models](/docs/consumption-models) when you need to configure a different model.
|
|
37
28
|
|
|
38
|
-
|
|
29
|
+
## Your first subscription payment
|
|
30
|
+
|
|
31
|
+
1. ### Create your account
|
|
32
|
+
[Create a Commet account](https://commet.co/login) and select your **sandbox organization**. Keep every resource in this walkthrough in that organization. Complete its [payment provider setup](/docs/payment-providers) so it can accept sandbox payments.
|
|
33
|
+
|
|
34
|
+
2. ### Create an API key
|
|
35
|
+
[Create a sandbox API key](/docs/create-api-key) and store it on your server. That guide covers the dashboard, CLI, MCP, and SDK initialization.
|
|
36
|
+
|
|
37
|
+
3. ### Create a feature
|
|
38
|
+
In **Features**, create **API Calls** with code `api_calls` and type **Usage**. The code identifies the feature when your application records consumption. You will set its included quantity on the plan.
|
|
39
|
+
|
|
40
|
+
See [Configure Features](/docs/configure-features).
|
|
41
|
+
|
|
42
|
+
4. ### Create a plan
|
|
43
|
+
In **Plans**, create a plan named **Pro**, with code `pro`, and choose **Metered**. Add a **USD 20 monthly price**, include **1,000 API calls**, and leave overage disabled for this first example. Use a paid price without a trial so the next steps lead directly to payment.
|
|
44
|
+
|
|
45
|
+
See [Manage Plans](/docs/create-plans).
|
|
46
|
+
|
|
47
|
+
5. ### Create a customer
|
|
48
|
+
Create a test customer with a billing email and a stable identifier from your application, such as `demo_customer`. The customer represents the person or business you are going to bill.
|
|
49
|
+
|
|
50
|
+
See [Manage Customers](/docs/manage-customers) for the dashboard and SDK flow.
|
|
51
|
+
|
|
52
|
+
6. ### Create the subscription
|
|
53
|
+
Connect that customer to the **Pro** plan using its monthly price. Creating the subscription for this paid plan returns a `checkoutUrl`. Open it or redirect the customer there to enter their billing details and pay.
|
|
54
|
+
|
|
55
|
+
See [Manage Subscriptions](/docs/manage-subscriptions#create) for the request in your SDK.
|
|
56
|
+
|
|
57
|
+
7. ### Complete the payment
|
|
58
|
+
Use the sandbox checkout's **Test Data** panel to fill in test payment details and complete checkout. Confirm that the invoice is paid and the subscription is active in the dashboard.
|
|
59
|
+
|
|
60
|
+
Your first subscription payment is complete. Commet manages subsequent renewals for the monthly plan. See [Testing](/docs/testing-sandbox) for the available test tools.
|
|
61
|
+
|
|
62
|
+
## Connect it to your product
|
|
63
|
+
|
|
64
|
+
With the first payment working, [check feature access](/docs/configure-features#current-feature-state) and [track usage](/docs/track-usage) when your customer uses the product. Use [signed webhooks](/docs/webhooks/introduction) to keep your application in sync with subscription and payment changes; a checkout redirect alone is not payment confirmation.
|
|
65
|
+
|
|
66
|
+
If a coding agent is implementing the flow, connect it through [MCP](/docs/mcp-server) or install the [Commet Skill](/docs/commet-skill). Use the same sandbox organization and the feature, plan, and customer identifiers from this walkthrough.
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
---
|
|
2
|
-
lastModified: 2026-08-16
|
|
3
2
|
title: CLI
|
|
4
3
|
description: The official command-line tool for Commet. Manage billing, forward webhooks, and automate your workflow from the terminal.
|
|
5
4
|
---
|
|
@@ -383,7 +382,7 @@ commet plans add-feature \
|
|
|
383
382
|
| `--overage-enabled <bool>` | No | Enable overage billing |
|
|
384
383
|
| `--overage-unit-price <n>` | No | Overage price per unit (fixed pricing) |
|
|
385
384
|
| `--pricing-mode <mode>` | No | `fixed` or `ai_model` |
|
|
386
|
-
| `--margin <n>` | No | Margin percentage (
|
|
385
|
+
| `--margin <n>` | No | Margin percentage (ai_model pricing) |
|
|
387
386
|
| `--credits-per-unit <n>` | No | Credits per unit |
|
|
388
387
|
|
|
389
388
|
**`commet plans add-price`**
|
|
@@ -1,47 +1,122 @@
|
|
|
1
1
|
---
|
|
2
|
-
lastModified: 2026-08-16
|
|
3
2
|
title: Create an API Key
|
|
4
|
-
description: Create a sandbox key,
|
|
3
|
+
description: Create a sandbox API key from the dashboard, CLI, or MCP, store it on your server, and rotate it safely.
|
|
5
4
|
---
|
|
6
5
|
|
|
7
|
-
|
|
6
|
+
An API key gives your server access to one Commet organization. Start with a **sandbox organization** while building your integration.
|
|
8
7
|
|
|
9
|
-
|
|
8
|
+
New full-access keys start with `ck_sandbox_` or `ck_live_`; new restricted keys start with `rk_sandbox_` or `rk_live_`. Existing `ck_` keys remain valid. The organization that created the key determines which data it can reach. Both environments use `https://commet.co/api/v1`.
|
|
10
9
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
10
|
+
## Create a key
|
|
11
|
+
|
|
12
|
+
Choose the path that fits where you are working. You only need one to get started.
|
|
13
|
+
|
|
14
|
+
### Dashboard
|
|
15
|
+
|
|
16
|
+
1. Select your **sandbox organization** in the dashboard.
|
|
17
|
+
2. Go to **Settings → API Keys** and click **Create API Key**.
|
|
18
|
+
3. Choose **Full Access** for a backend or **AI Agents** to select resource permissions.
|
|
19
|
+
4. Enter a descriptive name, such as `Local development`, and choose **Expires In (Days)**. The dashboard accepts **1–365 days** and defaults to **365**.
|
|
20
|
+
5. Create the key and copy it before closing the dialog. The full secret is shown only once.
|
|
21
|
+
|
|
22
|
+
### CLI
|
|
23
|
+
|
|
24
|
+
Install the [Commet CLI](/docs/cli), sign in through your browser, and link the project to your sandbox organization:
|
|
25
|
+
|
|
26
|
+
```bash
|
|
27
|
+
npm install -g commet
|
|
28
|
+
commet login
|
|
29
|
+
commet link
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
Choose the organization marked **sandbox**. Linking a new organization generates a key for CLI resource commands and saves it in `.commet/config.json`. The CLI adds `.commet/` to `.gitignore`. Keep that directory private.
|
|
33
|
+
|
|
34
|
+
This configures the CLI; it does **not** set `COMMET_API_KEY` for your application. To create a separate application key after linking:
|
|
35
|
+
|
|
36
|
+
```bash
|
|
37
|
+
commet api-keys create --name "Local development" --expires-in-days 365
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
Save the returned `apiKey` as described below. Resource commands use `COMMET_API_KEY` from the environment before the linked project's key, so check which credential is active before creating or deleting keys.
|
|
41
|
+
|
|
42
|
+
### MCP
|
|
43
|
+
|
|
44
|
+
Connect your agent to the [Commet MCP server](/docs/mcp-server) at `https://commet.co/mcp/v2`. With OAuth, you can sign in through your browser and select a **sandbox organization** without an existing API key. The connection stays fixed to that organization.
|
|
45
|
+
|
|
46
|
+
Ask the agent to create an application key using `api_create_api_key` with these arguments:
|
|
47
|
+
|
|
48
|
+
```json
|
|
49
|
+
{
|
|
50
|
+
"body": {
|
|
51
|
+
"name": "Local development",
|
|
52
|
+
"expiresInDays": 365
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
The response contains the full secret only once. Have the agent store it directly in the intended local secret file or secret manager when your tools support that. Do not paste an existing secret into the conversation or ask the agent to repeat it in a message.
|
|
58
|
+
|
|
59
|
+
Already authenticating with a full-access API key? You can create replacements with `POST /api/v1/api-keys`. That request creates another key for the same organization. See [Create API key](/docs/api-reference/api-keys/create-api-key) for the request and response.
|
|
60
|
+
|
|
61
|
+
## Limit key permissions
|
|
62
|
+
|
|
63
|
+
Leave `permissions` out to create a full-access key. Provide resource grants to create a restricted key. For example, a key with `customer: ["read"]` can read customers but cannot change them. Write access requires both `"read"` and `"write"`. An empty object (`{}`) grants no resource access.
|
|
64
|
+
|
|
65
|
+
A restricted key with `api_key: ["read", "write"]` can create restricted keys with the same or fewer permissions. These keys expire no later than the key that creates them. Restricted keys cannot edit or delete API keys.
|
|
66
|
+
|
|
67
|
+
```typescript
|
|
68
|
+
const key = await commet.apiKeys.create({
|
|
69
|
+
name: "Customer reader",
|
|
70
|
+
permissions: { customer: ["read"] },
|
|
71
|
+
})
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
The full secret is returned once. Save it in your secret store before leaving the response.
|
|
75
|
+
|
|
76
|
+
## Store the key on your server
|
|
77
|
+
|
|
78
|
+
For local development, save the key in a git-ignored environment file:
|
|
15
79
|
|
|
16
80
|
```bash title=".env.local"
|
|
17
|
-
COMMET_API_KEY=
|
|
81
|
+
COMMET_API_KEY=ck_replace_with_your_key
|
|
18
82
|
```
|
|
19
83
|
|
|
20
|
-
|
|
84
|
+
Load this variable into your server process using your framework's environment support. For production, use your deployment's secret store. Never expose the key in browser code, public environment variables, logs, screenshots, or source control.
|
|
85
|
+
|
|
86
|
+
Commet stores a hash of the key and cannot show the full secret again. If you lose it, create a replacement.
|
|
87
|
+
|
|
88
|
+
## Use the key in your SDK
|
|
21
89
|
|
|
22
|
-
|
|
90
|
+
For Node.js, install the SDK:
|
|
91
|
+
|
|
92
|
+
```bash
|
|
93
|
+
npm install @commet/node
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
Initialize it in server code after loading the environment:
|
|
23
97
|
|
|
24
98
|
```typescript
|
|
25
99
|
import { Commet } from "@commet/node"
|
|
26
100
|
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
101
|
+
const apiKey = process.env.COMMET_API_KEY
|
|
102
|
+
if (!apiKey) {
|
|
103
|
+
throw new Error("COMMET_API_KEY is required")
|
|
104
|
+
}
|
|
31
105
|
|
|
32
|
-
|
|
106
|
+
export const commet = new Commet({ apiKey })
|
|
107
|
+
```
|
|
33
108
|
|
|
34
|
-
|
|
109
|
+
For other languages, follow the [Python](/docs/integrate-with-python), [Go](/docs/integrate-with-go), [Java](/docs/integrate-with-java), or [PHP](/docs/integrate-with-php) integration guide. Direct REST requests authenticate with the `x-api-key` header.
|
|
35
110
|
|
|
36
|
-
|
|
111
|
+
## Rotate and promote to live
|
|
37
112
|
|
|
38
|
-
|
|
39
|
-
2. Verify checkout, webhooks, and a renewal with the [Test Clock](/docs/testing-sandbox).
|
|
40
|
-
3. Add a live key to the production secret store.
|
|
41
|
-
4. Deploy without copying sandbox IDs into live configuration.
|
|
113
|
+
Use a separate key for each application or deployment that needs independent rotation. To replace a key before it expires:
|
|
42
114
|
|
|
43
|
-
|
|
115
|
+
1. Create a replacement in the **same organization**.
|
|
116
|
+
2. Update the secret in every process using the old key and deploy or restart those processes.
|
|
117
|
+
3. Verify a successful read with the replacement and confirm the application is using it.
|
|
118
|
+
4. Delete the old key from **Settings → API Keys** or through [Delete API key](/docs/api-reference/api-keys/delete-api-key).
|
|
44
119
|
|
|
45
|
-
|
|
120
|
+
For production, create a key in your **live organization** and store it separately from sandbox credentials. Do not copy sandbox customer, plan, or subscription IDs into live configuration. Before switching, verify checkout, webhooks, and a renewal in sandbox with the [Test Clock](/docs/testing-sandbox).
|
|
46
121
|
|
|
47
|
-
|
|
122
|
+
Next, follow the [quickstart](/docs/choose-a-billing-model) to complete your first subscription payment in sandbox.
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
---
|
|
2
|
-
lastModified: 2026-07-28
|
|
3
2
|
title: Customer Portal
|
|
4
3
|
description: Self-service portal for customers to manage their subscriptions.
|
|
5
4
|
---
|
|
@@ -12,12 +11,25 @@ Self-service page where customers manage their subscription, view usage, change
|
|
|
12
11
|
- See usage across all features
|
|
13
12
|
- Upgrade or downgrade plans (requires a [Plan Group](/docs/plan-groups))
|
|
14
13
|
- Purchase [Credit Packs](/docs/credit-packs), balance top-ups, and [Add-ons](/docs/add-ons)
|
|
15
|
-
-
|
|
14
|
+
- Manage saved payment methods and billing details
|
|
16
15
|
- View invoice history
|
|
17
16
|
- Cancel subscription
|
|
18
17
|
|
|
19
18
|
Purchases are available on active, trialing, and free plan subscriptions. Free plan customers are prompted to add a payment method on their first purchase.
|
|
20
19
|
|
|
20
|
+
## Saved payment methods
|
|
21
|
+
|
|
22
|
+
Your customers can save several cards and choose their default payment method. A new card becomes the default unless the customer saves it as an alternative. The first saved card is always the default.
|
|
23
|
+
|
|
24
|
+
While a subscription is open:
|
|
25
|
+
|
|
26
|
+
- Customers must choose another default before removing the current one.
|
|
27
|
+
- They cannot remove the last saved method or the last method usable with the subscription's payment connection.
|
|
28
|
+
|
|
29
|
+
Without an open subscription, customers can remove any saved method. Changing the default or removing methods is blocked while a payment or automatic retry is in progress.
|
|
30
|
+
|
|
31
|
+
Commet can also use saved methods for [automatic payment retries](/docs/handle-failed-payments#saved-payment-methods).
|
|
32
|
+
|
|
21
33
|
## Generate a portal URL
|
|
22
34
|
|
|
23
35
|
Portal URLs are not single-use — the customer can revisit the link while the session is alive. A session expires after **30 minutes** of inactivity, auto-refreshes while the customer is active, and is capped at **2 hours** from creation. Generate a fresh URL on each visit.
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
---
|
|
2
|
-
lastModified: 2026-07-28
|
|
3
2
|
title: Manage Customers
|
|
4
3
|
description: Create and manage customers using the current Commet SDKs and dashboard.
|
|
5
4
|
---
|
|
@@ -343,4 +342,4 @@ See the [Customers API reference](/docs/api-reference/customers/list-customers)
|
|
|
343
342
|
|
|
344
343
|
- [Customer Portal](/docs/customer-portal)
|
|
345
344
|
- [Manage Subscriptions](/docs/manage-subscriptions)
|
|
346
|
-
- [Offers & Pricing changelog and migration checklist](/changelog/offers-and-pricing)
|
|
345
|
+
- [Offers & Pricing changelog and migration checklist](https://commet.co/changelog/offers-and-pricing)
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
---
|
|
2
|
-
lastModified: 2026-07-31
|
|
3
2
|
title: Error Handling
|
|
4
3
|
description: Handle errors with automatic retries and typed error classes
|
|
5
4
|
---
|
|
@@ -106,7 +105,7 @@ Go exposes `*commet.CommetError` and `*commet.ValidationError` as concrete types
|
|
|
106
105
|
|
|
107
106
|
## Error Code Reference
|
|
108
107
|
|
|
109
|
-
Every current API error includes a stable `code` and a version-matched `doc_url` such as [`customer_not_found`](/docs/api-reference/
|
|
108
|
+
Every current API error includes a stable `code` and a version-matched `doc_url` such as [`customer_not_found`](/docs/api-reference/errors/customer_not_found.md). The URL returns a dedicated English Markdown reference with handling and retry guidance for the resolved API version.
|
|
110
109
|
|
|
111
110
|
Keep the `x-request-id` response header when logging or reporting an error. Commet records the same identifier in Platform, allowing the request to be correlated without including credentials or customer data.
|
|
112
111
|
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
---
|
|
2
|
-
lastModified: 2026-08-10
|
|
3
2
|
title: Account Verification
|
|
4
3
|
description: How to get verified for payouts — complete the KYC form in the Commet dashboard.
|
|
5
4
|
---
|
|
6
5
|
|
|
7
6
|
Organizations using their own payment connection can start accepting payments immediately. Commet-managed payment processing remains unavailable until merchant review and identity verification are complete.
|
|
8
7
|
|
|
9
|
-
> **Note
|
|
8
|
+
> **Note**
|
|
9
|
+
>
|
|
10
|
+
> **Live organizations only**
|
|
10
11
|
>
|
|
11
12
|
> Payout verification is unavailable in sandbox. Switch to your live organization before submitting business, identity, document, or bank information.
|
|
12
13
|
|
|
@@ -39,7 +40,9 @@ After completing verification in the Commet dashboard, you can add destination b
|
|
|
39
40
|
|
|
40
41
|
`POST /api/v1/payouts/verification` is deprecated and no longer accepts or processes KYC data. Authenticated requests return `410 Gone` with the `endpoint_deprecated` error code.
|
|
41
42
|
|
|
42
|
-
> **Warning
|
|
43
|
+
> **Warning**
|
|
44
|
+
>
|
|
45
|
+
> **Complete verification in the dashboard**
|
|
43
46
|
>
|
|
44
47
|
> Do not send business, identity, document, or bank information to this endpoint. Use the one-time verification flow in your live organization's finance section.
|
|
45
48
|
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
---
|
|
2
|
-
lastModified: 2026-07-31
|
|
3
2
|
title: Integrate with Encore
|
|
4
3
|
description: Add billing and payments to your Encore application.
|
|
5
4
|
---
|
|
@@ -10,14 +9,14 @@ Install the Commet Skill so your coding agent can integrate the current SDK and
|
|
|
10
9
|
npx skills add commet-labs/skills --skill commet
|
|
11
10
|
```
|
|
12
11
|
|
|
13
|
-
1.
|
|
12
|
+
1. ### Install
|
|
14
13
|
```bash
|
|
15
14
|
encore app create --example=hello-world myapp
|
|
16
15
|
cd myapp
|
|
17
16
|
go get github.com/commet-labs/commet-go/v9
|
|
18
17
|
```
|
|
19
18
|
|
|
20
|
-
2.
|
|
19
|
+
2. ### Configure
|
|
21
20
|
Store secrets using Encore's secret manager instead of environment variables:
|
|
22
21
|
```bash
|
|
23
22
|
encore secret set --type dev,local,pr,prod CommetAPIKey
|
|
@@ -45,7 +44,7 @@ npx skills add commet-labs/skills --skill commet
|
|
|
45
44
|
```
|
|
46
45
|
There is no environment option on the client: sandbox vs live is decided by the organization the API key belongs to.
|
|
47
46
|
|
|
48
|
-
3.
|
|
47
|
+
3. ### Subscribe
|
|
49
48
|
```go title="billing/billing.go"
|
|
50
49
|
import "context"
|
|
51
50
|
|
|
@@ -92,7 +91,7 @@ npx skills add commet-labs/skills --skill commet
|
|
|
92
91
|
}
|
|
93
92
|
```
|
|
94
93
|
|
|
95
|
-
4.
|
|
94
|
+
4. ### Check Access
|
|
96
95
|
```go title="billing/billing.go"
|
|
97
96
|
type SubscriptionResponse struct {
|
|
98
97
|
Status string `json:"status"`
|
|
@@ -143,7 +142,7 @@ npx skills add commet-labs/skills --skill commet
|
|
|
143
142
|
}
|
|
144
143
|
```
|
|
145
144
|
|
|
146
|
-
5.
|
|
145
|
+
5. ### Track Usage
|
|
147
146
|
```go title="billing/billing.go"
|
|
148
147
|
func float64Ptr(value float64) *float64 { return &value }
|
|
149
148
|
|
|
@@ -175,7 +174,7 @@ npx skills add commet-labs/skills --skill commet
|
|
|
175
174
|
```
|
|
176
175
|
Usage is aggregated and billed at end of period.
|
|
177
176
|
|
|
178
|
-
6.
|
|
177
|
+
6. ### Webhooks
|
|
179
178
|
```go title="billing/webhooks.go"
|
|
180
179
|
package billing
|
|
181
180
|
|
|
@@ -216,7 +215,7 @@ npx skills add commet-labs/skills --skill commet
|
|
|
216
215
|
}
|
|
217
216
|
```
|
|
218
217
|
|
|
219
|
-
7.
|
|
218
|
+
7. ### Run
|
|
220
219
|
```bash
|
|
221
220
|
encore run
|
|
222
221
|
```
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
---
|
|
2
|
-
lastModified: 2026-07-31
|
|
3
2
|
title: Integrate with Go
|
|
4
3
|
description: Add billing and payments to your Go application using net/http.
|
|
5
4
|
---
|
|
@@ -10,12 +9,12 @@ Install the Commet Skill so your coding agent can integrate the current SDK and
|
|
|
10
9
|
npx skills add commet-labs/skills --skill commet
|
|
11
10
|
```
|
|
12
11
|
|
|
13
|
-
1.
|
|
12
|
+
1. ### Install
|
|
14
13
|
```bash
|
|
15
14
|
go get github.com/commet-labs/commet-go/v9
|
|
16
15
|
```
|
|
17
16
|
|
|
18
|
-
2.
|
|
17
|
+
2. ### Configure
|
|
19
18
|
```bash title=".env"
|
|
20
19
|
COMMET_API_KEY=ck_sandbox_xxx
|
|
21
20
|
COMMET_WEBHOOK_SECRET=whsec_xxx
|
|
@@ -42,7 +41,7 @@ npx skills add commet-labs/skills --skill commet
|
|
|
42
41
|
```
|
|
43
42
|
There is no environment option on the client: sandbox vs live is decided by the organization the API key belongs to.
|
|
44
43
|
|
|
45
|
-
3.
|
|
44
|
+
3. ### Subscribe
|
|
46
45
|
```go title="billing/handlers.go"
|
|
47
46
|
package billing
|
|
48
47
|
|
|
@@ -94,7 +93,7 @@ npx skills add commet-labs/skills --skill commet
|
|
|
94
93
|
}
|
|
95
94
|
```
|
|
96
95
|
|
|
97
|
-
4.
|
|
96
|
+
4. ### Check Access
|
|
98
97
|
```go title="billing/handlers.go"
|
|
99
98
|
func GetSubscription(w http.ResponseWriter, r *http.Request) {
|
|
100
99
|
customerID := r.PathValue("customerID")
|
|
@@ -133,7 +132,7 @@ npx skills add commet-labs/skills --skill commet
|
|
|
133
132
|
}
|
|
134
133
|
```
|
|
135
134
|
|
|
136
|
-
5.
|
|
135
|
+
5. ### Track Usage
|
|
137
136
|
```go title="billing/handlers.go"
|
|
138
137
|
func float64Ptr(value float64) *float64 { return &value }
|
|
139
138
|
|
|
@@ -164,7 +163,7 @@ npx skills add commet-labs/skills --skill commet
|
|
|
164
163
|
```
|
|
165
164
|
Usage is aggregated and billed at end of period.
|
|
166
165
|
|
|
167
|
-
6.
|
|
166
|
+
6. ### Customer Portal
|
|
168
167
|
```go title="billing/handlers.go"
|
|
169
168
|
func Portal(w http.ResponseWriter, r *http.Request) {
|
|
170
169
|
customerID := "user_123"
|
|
@@ -180,7 +179,7 @@ npx skills add commet-labs/skills --skill commet
|
|
|
180
179
|
}
|
|
181
180
|
```
|
|
182
181
|
|
|
183
|
-
7.
|
|
182
|
+
7. ### Webhooks
|
|
184
183
|
```go title="billing/webhooks.go"
|
|
185
184
|
package billing
|
|
186
185
|
|
|
@@ -220,7 +219,7 @@ npx skills add commet-labs/skills --skill commet
|
|
|
220
219
|
}
|
|
221
220
|
```
|
|
222
221
|
|
|
223
|
-
8.
|
|
222
|
+
8. ### Start Server
|
|
224
223
|
```go title="main.go"
|
|
225
224
|
package main
|
|
226
225
|
|