Subscription
Stored in the subscriptions collection. createdAt and updatedAt are maintained automatically.
Returned by GET /plans, DELETE /subscription/current.
| Field | Type | Notes |
|---|---|---|
company | ObjectId -> Company | required |
coupon | ObjectId -> Coupon | |
discount | number | |
plan | ObjectId -> Plan | required |
trial | boolean | default false |
planDetails.name | string | required |
planDetails.description | string | |
planDetails.billingType | string | required · one of free, paid |
planDetails.currency | string | |
planDetails.countries | string[] | default [] |
planDetails.billingCycles | object[] | default [] |
planDetails.billingCycles.type | string | required · one of Monthly, Quarterly, Half Yearly, Yearly |
planDetails.billingCycles.price | number | required |
planDetails.billingCycles.enableSalePrice | boolean | default false |
planDetails.billingCycles.salePrice | number | |
planDetails.billingCycles.saleDurationType | string | default noDate · one of noDate, custom |
planDetails.billingCycles.saleStartDate | date | |
planDetails.billingCycles.saleEndDate | date | |
planDetails.billingCycles._id | ObjectId | default "6a95712f932657988a91c0d7" |
planDetails.maxUsersAllowed | number | required |
planDetails.features | object[] | default [] |
planDetails.features.feature | ObjectId -> Feature | required |
planDetails.features.quantity | number | |
planDetails.features.billingCycleQuantities | object[] | default [] |
planDetails.features.billingCycleQuantities.billingCycle | string | required · one of Monthly, Quarterly, Half Yearly, Yearly |
planDetails.features.billingCycleQuantities.quantity | number | |
planDetails.features.addOnPricing | object[] | default [] |
planDetails.features.addOnPricing.mode | string | required · one of billing_cycle, custom_duration, one_time |
planDetails.features.addOnPricing.price | number | default 0 |
planDetails.features.addOnPricing.durationUnit | string | default null · one of day, month, billing_cycle, null |
planDetails.features.addOnPricing.defaultDurationValue | number | default null |
planDetails.features.resetOnBillingCycleType | string | default monthly · one of daily, weekly, monthly, custom |
planDetails.features.resetOnBillingCycleCustomDays | number | default 1 |
planDetails.features.lastBaselineSyncAt | date | |
planDetails.enableTrial | boolean | default false |
planDetails.trialDurationType | string | one of 30, 60, 90, custom |
planDetails.trialDurationCustom | number | |
planDetails.enableAllowExtraDuration | boolean | default false |
planDetails.allowExtraDurationType | string | one of 30, 60, 90, custom |
planDetails.extraDurationCustom | number | |
planDetails.isRecommended | boolean | default false |
planDetails.status | string | default inactive · one of active, inactive |
planDetails.company | ObjectId -> Company | |
planDetails.createdBy | ObjectId -> Member | |
planDetails.updatedBy | ObjectId -> Member | |
billingCycle | string | required · one of Monthly, Quarterly, Half Yearly, Yearly |
users | number | required |
usageBaselines.lead | number | default 0 |
usageBaselines.contact | number | default 0 |
usageBaselines.campaign | number | default 0 |
usageBaselines.productService | number | default 0 |
usageBaselines.workflow | number | default 0 |
usageBaselines.enrichment | number | default 0 |
usageBaselines.aiLeads | number | default 0 |
usageBaselines.chatbot-chats | number | default 0 |
payment | ObjectId -> Payment | |
changeRequest | ObjectId -> SubscriptionChange | |
autoPay | boolean | default true |
effectiveAt | date | |
startDate | date | required |
endDate | date | required |
status | string | one of pending, active, queued, scheduled, deactive, superseded |
type | string | one of new, upgraded, downgraded, queue_buy, seat_change, addon_purchase |
reason | string | |
replacesSubscriptions | ObjectId[] -> Subscription | default [] |
supersededBy | ObjectId -> Subscription | |
featureAddOns | object[] | default [] |
featureAddOns.feature | ObjectId -> Feature | |
featureAddOns.quantity | number | default 0 |
featureAddOns.mode | string | one of billing_cycle, custom_duration, one_time |
featureAddOns.startsAt | date | |
featureAddOns.endsAt | date | |
featureAddOns._id | ObjectId | default "6a95712f932657988a91c0d8" |
createdBy | ObjectId -> Member | |
updatedBy | ObjectId -> Member | |
_id | ObjectId | default "6a95712f932657988a91c0d9" |
createdAt | date | set once |
updatedAt | date |