@commet/node 9.10.0 → 9.12.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 +167 -73
- package/dist/index.d.ts +167 -73
- package/dist/index.js +16 -13
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +16 -13
- package/dist/index.mjs.map +1 -1
- package/docs/api-reference/customers.md +3 -3
- package/docs/api-reference/features.md +1 -1
- package/docs/api-reference/index.md +1 -1
- package/docs/api-reference/invoices.md +4 -3
- package/docs/api-reference/plans.md +8 -4
- package/docs/api-reference/subscriptions.md +10 -6
- package/docs/api-reference/transactions.md +2 -1
- package/docs/documentation/error-handling.md +11 -0
- package/docs/documentation/invoicing/manage-invoices.md +1 -1
- package/docs/documentation/plans/add-ons.md +4 -2
- package/docs/documentation/plans/balance-and-top-ups.md +3 -1
- package/docs/documentation/plans/consumption-models.md +29 -1
- package/docs/documentation/plans/credit-packs.md +28 -8
- package/docs/documentation/plans/plan-versions.md +9 -7
- package/docs/documentation/sales/promotional-offers.md +1 -1
- package/docs/documentation/sales/regional-prices.md +1 -1
- package/docs/documentation/subscriptions/manage-subscriptions.md +1 -1
- package/docs/documentation/subscriptions/plan-grants.md +22 -6
- package/docs/errors/currency_held_by_balance_plan.md +22 -0
- package/docs/errors/currency_held_by_customer_credit.md +22 -0
- package/docs/errors/currency_held_by_fixed_amount_discount.md +22 -0
- package/docs/errors/currency_held_by_payment_method.md +22 -0
- package/docs/errors/currency_held_by_prepaid_period.md +22 -0
- package/docs/errors/currency_held_by_scheduled_pause.md +22 -0
- package/docs/errors/index.md +7 -1
- package/docs/errors/missing_regional_price.md +3 -3
- package/docs/knowledge-base/how-do-discounts-work.md +19 -1
- package/docs/knowledge-base/what-happens-when-you-change-your-prices.md +1 -1
- package/docs/manifest.json +37 -1
- package/docs/schemas.md +30 -16
- package/docs/webhooks.md +18 -17
- package/docs/webhooks.openapi.json +63 -37
- package/package.json +1 -1
|
@@ -304,7 +304,7 @@
|
|
|
304
304
|
"subscription.reactivated": {
|
|
305
305
|
"post": {
|
|
306
306
|
"summary": "subscription.reactivated",
|
|
307
|
-
"description": "Fired when a canceled subscription is reactivated
|
|
307
|
+
"description": "Fired when a canceled subscription is reactivated: its reactivation charge succeeds, or its reactivation invoice totals zero and is paid without a charge. The subscription returns to active with a fresh invoice and a billing period anchored to the reactivation date. Distinct from subscription.activated (first activation) and payment.recovered (past_due recovery, which keeps the original anchor).",
|
|
308
308
|
"tags": [
|
|
309
309
|
"Webhooks"
|
|
310
310
|
],
|
|
@@ -391,7 +391,7 @@
|
|
|
391
391
|
"commet",
|
|
392
392
|
"dlocal"
|
|
393
393
|
],
|
|
394
|
-
"description": "The payment provider
|
|
394
|
+
"description": "The subscription's payment provider, which processed the reactivation charge: stripe, commet, or dlocal. A reactivation whose invoice totals zero runs no charge and still carries the subscription's provider."
|
|
395
395
|
}
|
|
396
396
|
},
|
|
397
397
|
"required": [
|
|
@@ -2290,7 +2290,7 @@
|
|
|
2290
2290
|
},
|
|
2291
2291
|
"reason": {
|
|
2292
2292
|
"type": "string",
|
|
2293
|
-
"description": "Why the move was canceled: canceled_by_merchant, version_change_failed when the move could not be applied at renewal,
|
|
2293
|
+
"description": "Why the move was canceled: canceled_by_merchant, version_change_failed when the move could not be applied at renewal, the code of what the subscription no longer fits (addon_unavailable, seat_limit_exceeded, price_not_found, missing_regional_price), or, for a move that charges it in USD, what keeps it in its currency (currency_held_by_payment_method, currency_held_by_customer_credit, currency_held_by_balance_plan, currency_held_by_fixed_amount_discount, currency_held_by_prepaid_period, currency_held_by_scheduled_pause)."
|
|
2294
2294
|
}
|
|
2295
2295
|
},
|
|
2296
2296
|
"required": [
|
|
@@ -2820,7 +2820,7 @@
|
|
|
2820
2820
|
"trial.will_end": {
|
|
2821
2821
|
"post": {
|
|
2822
2822
|
"summary": "trial.will_end",
|
|
2823
|
-
"description": "Predictive event fired once, 3 days before a trial ends. Use it to remind the customer that billing starts soon. Emitted by a
|
|
2823
|
+
"description": "Predictive event fired once, 3 days before a trial ends. Use it to remind the customer that billing starts soon. Emitted by a recurring scan with a deterministic idempotency key, so it never fires twice for the same trial end date.",
|
|
2824
2824
|
"tags": [
|
|
2825
2825
|
"Webhooks"
|
|
2826
2826
|
],
|
|
@@ -2934,7 +2934,7 @@
|
|
|
2934
2934
|
"description": "Predictive event fired once, 3 days before a trial ends.",
|
|
2935
2935
|
"playground": "none"
|
|
2936
2936
|
},
|
|
2937
|
-
"content": "## When this fires\n\nA
|
|
2937
|
+
"content": "## When this fires\n\nA recurring scan finds trials ending within the next 3 days and emits this event once per trial. The idempotency key is derived from the subscription and the trial end date, so re-running the scan never sends a duplicate.\n\nUse it to remind the customer that billing starts on `trialEndsAt` — the single most effective moment to prevent involuntary churn and surprise charges.\n\nIf the trial end date changes after this event fired (for example, the customer converts early), `trial.converted` or `trial.expired` reflects the final outcome."
|
|
2938
2938
|
}
|
|
2939
2939
|
}
|
|
2940
2940
|
},
|
|
@@ -3370,7 +3370,7 @@
|
|
|
3370
3370
|
"type": "null"
|
|
3371
3371
|
}
|
|
3372
3372
|
],
|
|
3373
|
-
"description": "The payment method: card,
|
|
3373
|
+
"description": "The payment method: card, apple_pay, google_pay, link, smartpix, oxxo or mercado_pago. Null when unknown."
|
|
3374
3374
|
},
|
|
3375
3375
|
"subPaymentMethod": {
|
|
3376
3376
|
"anyOf": [
|
|
@@ -3664,7 +3664,7 @@
|
|
|
3664
3664
|
"type": "null"
|
|
3665
3665
|
}
|
|
3666
3666
|
],
|
|
3667
|
-
"description": "The payment method: card,
|
|
3667
|
+
"description": "The payment method: card, apple_pay, google_pay, link, smartpix, oxxo or mercado_pago. Null when unknown."
|
|
3668
3668
|
},
|
|
3669
3669
|
"subPaymentMethod": {
|
|
3670
3670
|
"anyOf": [
|
|
@@ -3852,7 +3852,7 @@
|
|
|
3852
3852
|
"type": "null"
|
|
3853
3853
|
}
|
|
3854
3854
|
],
|
|
3855
|
-
"description": "The payment method: card,
|
|
3855
|
+
"description": "The payment method: card, apple_pay, google_pay, link, smartpix, oxxo or mercado_pago. Null when unknown."
|
|
3856
3856
|
},
|
|
3857
3857
|
"subPaymentMethod": {
|
|
3858
3858
|
"anyOf": [
|
|
@@ -4140,6 +4140,12 @@
|
|
|
4140
4140
|
"null"
|
|
4141
4141
|
]
|
|
4142
4142
|
},
|
|
4143
|
+
"amountRefunded": {
|
|
4144
|
+
"type": "integer",
|
|
4145
|
+
"minimum": 0,
|
|
4146
|
+
"maximum": 9007199254740991,
|
|
4147
|
+
"description": "Cumulative confirmed refunds in the payment currency’s smallest unit."
|
|
4148
|
+
},
|
|
4143
4149
|
"refundAmount": {
|
|
4144
4150
|
"type": "number",
|
|
4145
4151
|
"description": "The refunded amount in cents (100 = $1.00)."
|
|
@@ -4157,6 +4163,7 @@
|
|
|
4157
4163
|
"invoiceNumber",
|
|
4158
4164
|
"customerId",
|
|
4159
4165
|
"subscriptionId",
|
|
4166
|
+
"amountRefunded",
|
|
4160
4167
|
"refundAmount",
|
|
4161
4168
|
"currency"
|
|
4162
4169
|
],
|
|
@@ -4189,6 +4196,7 @@
|
|
|
4189
4196
|
"customerId": "user_123",
|
|
4190
4197
|
"subscriptionId": "sub_1a2b3c4d",
|
|
4191
4198
|
"refundAmount": 9900,
|
|
4199
|
+
"amountRefunded": 9900,
|
|
4192
4200
|
"currency": "usd"
|
|
4193
4201
|
}
|
|
4194
4202
|
}
|
|
@@ -4862,7 +4870,7 @@
|
|
|
4862
4870
|
"type": "null"
|
|
4863
4871
|
}
|
|
4864
4872
|
],
|
|
4865
|
-
"description": "The payment method: card,
|
|
4873
|
+
"description": "The payment method: card, apple_pay, google_pay, link, smartpix, oxxo or mercado_pago. Null when unknown."
|
|
4866
4874
|
},
|
|
4867
4875
|
"subPaymentMethod": {
|
|
4868
4876
|
"anyOf": [
|
|
@@ -5126,7 +5134,7 @@
|
|
|
5126
5134
|
"type": "null"
|
|
5127
5135
|
}
|
|
5128
5136
|
],
|
|
5129
|
-
"description": "The payment method: card,
|
|
5137
|
+
"description": "The payment method: card, apple_pay, google_pay, link, smartpix, oxxo or mercado_pago. Null when unknown."
|
|
5130
5138
|
},
|
|
5131
5139
|
"subPaymentMethod": {
|
|
5132
5140
|
"anyOf": [
|
|
@@ -5497,7 +5505,7 @@
|
|
|
5497
5505
|
"invoice.voided": {
|
|
5498
5506
|
"post": {
|
|
5499
5507
|
"summary": "invoice.voided",
|
|
5500
|
-
"description": "Fired when an invoice is voided — nullified before collection,
|
|
5508
|
+
"description": "Fired when an invoice is voided — nullified before collection, for example when its subscription is canceled. Voiding is terminal: a void invoice is never retried or collected.",
|
|
5501
5509
|
"tags": [
|
|
5502
5510
|
"Webhooks"
|
|
5503
5511
|
],
|
|
@@ -5657,7 +5665,7 @@
|
|
|
5657
5665
|
"invoice.overdue": {
|
|
5658
5666
|
"post": {
|
|
5659
5667
|
"summary": "invoice.overdue",
|
|
5660
|
-
"description": "Fired once when an outstanding
|
|
5668
|
+
"description": "Fired once when an invoice is still outstanding 24 hours after its due date. The invoice keeps its outstanding status — overdue is a fact about the due date, not a new status. Use it to start your own dunning flow.",
|
|
5661
5669
|
"tags": [
|
|
5662
5670
|
"Webhooks"
|
|
5663
5671
|
],
|
|
@@ -5810,14 +5818,14 @@
|
|
|
5810
5818
|
"description": "An outstanding invoice passed its due date without payment.",
|
|
5811
5819
|
"playground": "none"
|
|
5812
5820
|
},
|
|
5813
|
-
"content": "## When this fires\n\nA
|
|
5821
|
+
"content": "## When this fires\n\nA recurring scan finds invoices that are still outstanding 24 hours after their `dueDate` and emits this event once per invoice. The idempotency key is derived from the invoice, so re-running the scan never sends a duplicate.\n\nThe invoice keeps its `\"outstanding\"` status — overdue is a fact about the due date, not a new status. If the invoice is later paid or voided, `payment.received` or `invoice.voided` reflects the outcome.\n\nUse it to start your own dunning flow: email the customer, show an in-app banner, or flag the account for follow-up."
|
|
5814
5822
|
}
|
|
5815
5823
|
}
|
|
5816
5824
|
},
|
|
5817
5825
|
"invoice.upcoming": {
|
|
5818
5826
|
"post": {
|
|
5819
5827
|
"summary": "invoice.upcoming",
|
|
5820
|
-
"description": "Predictive event fired once, 3 days before an active subscription renews. Use it to notify the customer before they are charged. Carries no amount — usage-based charges are only final at renewal, when invoice.created delivers the actual invoice.",
|
|
5828
|
+
"description": "Predictive event fired once, 3 days before an active subscription renews. A subscription on a free plan issues no renewal invoice and does not fire it. Use it to notify the customer before they are charged. Carries no amount — usage-based charges are only final at renewal, when invoice.created delivers the actual invoice.",
|
|
5821
5829
|
"tags": [
|
|
5822
5830
|
"Webhooks"
|
|
5823
5831
|
],
|
|
@@ -5940,7 +5948,7 @@
|
|
|
5940
5948
|
"description": "Predictive event fired once, 3 days before a subscription renews.",
|
|
5941
5949
|
"playground": "none"
|
|
5942
5950
|
},
|
|
5943
|
-
"content": "## When this fires\n\nA
|
|
5951
|
+
"content": "## When this fires\n\nA recurring scan finds active subscriptions renewing within the next 3 days and emits this event once per renewal. The idempotency key is derived from the subscription and the renewal date, so re-running the scan never sends a duplicate.\n\nSubscriptions with a scheduled cancellation and subscriptions on a free plan are excluded — no renewal invoice will be issued for them.\n\nUse it to notify the customer before they are charged. The payload intentionally carries no amount: usage-based charges are only final at renewal time, when `invoice.created` delivers the actual invoice."
|
|
5944
5952
|
}
|
|
5945
5953
|
}
|
|
5946
5954
|
},
|
|
@@ -6001,7 +6009,7 @@
|
|
|
6001
6009
|
"type": "null"
|
|
6002
6010
|
}
|
|
6003
6011
|
],
|
|
6004
|
-
"description": "The payment method: card,
|
|
6012
|
+
"description": "The payment method: card, apple_pay, google_pay, link, smartpix, oxxo or mercado_pago. Null when unknown."
|
|
6005
6013
|
},
|
|
6006
6014
|
"card": {
|
|
6007
6015
|
"anyOf": [
|
|
@@ -6125,7 +6133,7 @@
|
|
|
6125
6133
|
"type": "null"
|
|
6126
6134
|
}
|
|
6127
6135
|
],
|
|
6128
|
-
"description": "The payment method: card,
|
|
6136
|
+
"description": "The payment method: card, apple_pay, google_pay, link, smartpix, oxxo or mercado_pago. Null when unknown."
|
|
6129
6137
|
},
|
|
6130
6138
|
"card": {
|
|
6131
6139
|
"anyOf": [
|
|
@@ -6242,7 +6250,7 @@
|
|
|
6242
6250
|
"type": "null"
|
|
6243
6251
|
}
|
|
6244
6252
|
],
|
|
6245
|
-
"description": "The payment method: card,
|
|
6253
|
+
"description": "The payment method: card, apple_pay, google_pay, link, smartpix, oxxo or mercado_pago. Null when unknown."
|
|
6246
6254
|
},
|
|
6247
6255
|
"card": {
|
|
6248
6256
|
"anyOf": [
|
|
@@ -7027,11 +7035,15 @@
|
|
|
7027
7035
|
"minimum": 0,
|
|
7028
7036
|
"description": "Actual credits deducted by this feature during the period."
|
|
7029
7037
|
},
|
|
7038
|
+
"unlimited": {
|
|
7039
|
+
"type": "boolean",
|
|
7040
|
+
"description": "Whether the plan credits are unlimited: usage never spends them and only the plan credit limit caps it."
|
|
7041
|
+
},
|
|
7030
7042
|
"availableUnits": {
|
|
7031
7043
|
"type": "integer",
|
|
7032
7044
|
"minimum": 0,
|
|
7033
7045
|
"maximum": 9007199254740991,
|
|
7034
|
-
"description": "Additional product units available from the current shared credit pool at this feature's conversion rate."
|
|
7046
|
+
"description": "Additional product units available from the current shared credit pool at this feature's conversion rate. Absent when unlimited is true."
|
|
7035
7047
|
}
|
|
7036
7048
|
},
|
|
7037
7049
|
"required": [
|
|
@@ -7040,7 +7052,7 @@
|
|
|
7040
7052
|
"unitsUsed",
|
|
7041
7053
|
"creditsPerUnit",
|
|
7042
7054
|
"creditsConsumed",
|
|
7043
|
-
"
|
|
7055
|
+
"unlimited"
|
|
7044
7056
|
],
|
|
7045
7057
|
"additionalProperties": false
|
|
7046
7058
|
},
|
|
@@ -7098,11 +7110,15 @@
|
|
|
7098
7110
|
"additionalProperties": false,
|
|
7099
7111
|
"description": "Actual money deducted for this feature during the period."
|
|
7100
7112
|
},
|
|
7113
|
+
"unlimited": {
|
|
7114
|
+
"type": "boolean",
|
|
7115
|
+
"description": "Whether the plan balance is unlimited: usage never spends it and only the plan balance limit caps it."
|
|
7116
|
+
},
|
|
7101
7117
|
"availableUnits": {
|
|
7102
7118
|
"type": "integer",
|
|
7103
7119
|
"minimum": 0,
|
|
7104
7120
|
"maximum": 9007199254740991,
|
|
7105
|
-
"description": "Estimated additional units available from the current shared balance at this feature's fixed price. Absent for dynamic pricing."
|
|
7121
|
+
"description": "Estimated additional units available from the current shared balance at this feature's fixed price. Absent for dynamic pricing and when unlimited is true."
|
|
7106
7122
|
},
|
|
7107
7123
|
"unitPrice": {
|
|
7108
7124
|
"type": "object",
|
|
@@ -7136,7 +7152,8 @@
|
|
|
7136
7152
|
"model",
|
|
7137
7153
|
"period",
|
|
7138
7154
|
"unitsUsed",
|
|
7139
|
-
"spent"
|
|
7155
|
+
"spent",
|
|
7156
|
+
"unlimited"
|
|
7140
7157
|
],
|
|
7141
7158
|
"additionalProperties": false
|
|
7142
7159
|
}
|
|
@@ -9053,7 +9070,7 @@
|
|
|
9053
9070
|
"credits.expired": {
|
|
9054
9071
|
"post": {
|
|
9055
9072
|
"summary": "credits.expired",
|
|
9056
|
-
"description": "Fired at a reset when unused plan credits are discarded. On a plan whose unused plan credits expire, every unused plan credit expires at each reset. On a plan that rolls them over, a reset keeps them, up to the plan's maxPlanCredits when it has one, and only the excess expires. A change to another credits plan applies the new plan's terms the same way. Purchased credits never expire and are not affected.",
|
|
9073
|
+
"description": "Fired at a reset when unused plan credits are discarded. On a plan whose unused plan credits expire, every unused plan credit expires at each reset. On a plan that rolls them over, a reset keeps them, up to the plan's maxPlanCredits when it has one, and only the excess expires. A change to another credits plan applies the new plan's terms the same way, and an immediate change also discards the credits the previous plan gave for the period it cuts short. Purchased credits never expire and are not affected.",
|
|
9057
9074
|
"tags": [
|
|
9058
9075
|
"Webhooks"
|
|
9059
9076
|
],
|
|
@@ -11130,7 +11147,9 @@
|
|
|
11130
11147
|
"oxxo",
|
|
11131
11148
|
"mercado_pago",
|
|
11132
11149
|
"google_pay",
|
|
11133
|
-
"smartpix"
|
|
11150
|
+
"smartpix",
|
|
11151
|
+
"apple_pay",
|
|
11152
|
+
"link"
|
|
11134
11153
|
]
|
|
11135
11154
|
},
|
|
11136
11155
|
"SubPaymentMethod": {
|
|
@@ -11210,48 +11229,55 @@
|
|
|
11210
11229
|
"WebhookCreditsBalance": {
|
|
11211
11230
|
"type": "object",
|
|
11212
11231
|
"properties": {
|
|
11232
|
+
"unlimited": {
|
|
11233
|
+
"type": "boolean",
|
|
11234
|
+
"description": "true when the plan credits are unlimited: usage never spends them and only the plan credit limit caps it."
|
|
11235
|
+
},
|
|
11213
11236
|
"planCredits": {
|
|
11237
|
+
"description": "Plan credits left. Omitted when unlimited is true.",
|
|
11214
11238
|
"type": "number"
|
|
11215
11239
|
},
|
|
11216
11240
|
"purchasedCredits": {
|
|
11217
11241
|
"type": "number"
|
|
11218
11242
|
},
|
|
11219
11243
|
"totalCredits": {
|
|
11244
|
+
"description": "planCredits plus purchasedCredits. Omitted when unlimited is true.",
|
|
11220
11245
|
"type": "number"
|
|
11221
11246
|
}
|
|
11222
11247
|
},
|
|
11223
11248
|
"required": [
|
|
11224
|
-
"
|
|
11225
|
-
"purchasedCredits"
|
|
11226
|
-
"totalCredits"
|
|
11249
|
+
"unlimited",
|
|
11250
|
+
"purchasedCredits"
|
|
11227
11251
|
],
|
|
11228
11252
|
"additionalProperties": false
|
|
11229
11253
|
},
|
|
11230
11254
|
"WebhookBalance": {
|
|
11231
11255
|
"type": "object",
|
|
11232
11256
|
"properties": {
|
|
11257
|
+
"unlimited": {
|
|
11258
|
+
"type": "boolean",
|
|
11259
|
+
"description": "true when the plan balance is unlimited: usage never spends it and only the plan balance limit caps it."
|
|
11260
|
+
},
|
|
11233
11261
|
"currentBalance": {
|
|
11234
|
-
"
|
|
11235
|
-
"
|
|
11262
|
+
"description": "The available balance, plan plus purchased, in rate scale. Equal to totalBalance. Omitted when unlimited is true.",
|
|
11263
|
+
"type": "number"
|
|
11236
11264
|
},
|
|
11237
11265
|
"planBalance": {
|
|
11238
|
-
"
|
|
11239
|
-
"
|
|
11266
|
+
"description": "The plan part in rate scale: spent first, replaced or rolled over at each reset, negative while overage is owed. Omitted when unlimited is true.",
|
|
11267
|
+
"type": "number"
|
|
11240
11268
|
},
|
|
11241
11269
|
"purchasedBalance": {
|
|
11242
11270
|
"type": "number",
|
|
11243
11271
|
"description": "The purchased part in rate scale: top-ups and manual adjustments, spent after the plan part and kept until the subscription ends."
|
|
11244
11272
|
},
|
|
11245
11273
|
"totalBalance": {
|
|
11246
|
-
"
|
|
11247
|
-
"
|
|
11274
|
+
"description": "planBalance plus purchasedBalance, in rate scale. Omitted when unlimited is true.",
|
|
11275
|
+
"type": "number"
|
|
11248
11276
|
}
|
|
11249
11277
|
},
|
|
11250
11278
|
"required": [
|
|
11251
|
-
"
|
|
11252
|
-
"
|
|
11253
|
-
"purchasedBalance",
|
|
11254
|
-
"totalBalance"
|
|
11279
|
+
"unlimited",
|
|
11280
|
+
"purchasedBalance"
|
|
11255
11281
|
],
|
|
11256
11282
|
"additionalProperties": false
|
|
11257
11283
|
},
|