import { Autumn } from 'autumn-js';
const autumn = new Autumn();
const { data, error } = await autumn.entities.create('customer_id', { id: 'id', feature_id: 'feature_id' });{
"id": "seat_123",
"name": "John Doe's Seat",
"customer_id": "org_123",
"created_at": 1762971906762,
"env": "sandbox",
"products": [
{
"id": "pro_plan",
"name": "Pro Plan",
"group": null,
"status": "active",
"canceled_at": null,
"started_at": 1762971923843,
"is_default": false,
"is_add_on": false,
"version": 1,
"current_period_start": 1762971905000,
"current_period_end": 1765563905000,
"items": [
{
"type": "feature",
"feature_id": "messages",
"feature_type": "single_use",
"included_usage": 30,
"interval": "month",
"reset_usage_when_enabled": true,
"entity_feature_id": null,
"display": {
"primary_text": "10 Messages"
}
}
],
"quantity": 1
}
],
"features": {
"messages": {
"id": "messages",
"type": "single_use",
"name": "Messages",
"interval": "month",
"interval_count": 1,
"unlimited": false,
"balance": 10,
"usage": 0,
"included_usage": 30,
"next_reset_at": 1765563905000,
"overage_allowed": false
}
}
}import { Autumn } from 'autumn-js';
const autumn = new Autumn();
const { data, error } = await autumn.entities.create('customer_id', { id: 'id', feature_id: 'feature_id' });{
"id": "seat_123",
"name": "John Doe's Seat",
"customer_id": "org_123",
"created_at": 1762971906762,
"env": "sandbox",
"products": [
{
"id": "pro_plan",
"name": "Pro Plan",
"group": null,
"status": "active",
"canceled_at": null,
"started_at": 1762971923843,
"is_default": false,
"is_add_on": false,
"version": 1,
"current_period_start": 1762971905000,
"current_period_end": 1765563905000,
"items": [
{
"type": "feature",
"feature_id": "messages",
"feature_type": "single_use",
"included_usage": 30,
"interval": "month",
"reset_usage_when_enabled": true,
"entity_feature_id": null,
"display": {
"primary_text": "10 Messages"
}
}
],
"quantity": 1
}
],
"features": {
"messages": {
"id": "messages",
"type": "single_use",
"name": "Messages",
"interval": "month",
"interval_count": 1,
"unlimited": false,
"balance": 10,
"usage": 0,
"included_usage": 30,
"next_reset_at": 1765563905000,
"overage_allowed": false
}
}
}Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
The ID of the entity
The ID of the feature this entity is associated with
The name of the entity
The unique identifier of the entity.
The name of the entity.
Unix timestamp (in milliseconds) when the entity was created.
sandbox, live The customer ID this entity belongs to.
The feature ID this entity belongs to.
The products this entity has access to.
Show child attributes
The unique identifier for the product
"pro_plan"
The name of the product
"Pro Plan"
The group the product belongs to
"product_set_1"
Current status of the product for this customer
active, expired, scheduled, trialing, past_due "active"
Timestamp when the customer started this product
1700000000000
Whether this product is the default for the customer
true
Whether the product is an add-on
false
Timestamp when the product was canceled for the customer
1717000000
Version of the product
1
List of Stripe subscription IDs associated with this product, if any
["sub_1Nc0JzBAbcxyz", "sub_1Nc0xyBAnopq"]Start of the current billing period
1717000000
End of the current billing period
1719600000
ID of the entity this customer product is attached to, if applicable
"entity_1234abcd"
Array of product items defining the features and pricing
Show child attributes
The type of the product item
feature, priced_feature, price The feature ID of the product item. If the item is a fixed price, should be null
Single use features are used once and then depleted, like API calls or credits. Continuous use features are those being used on an ongoing-basis, like storage or seats.
single_use, continuous_use, boolean, static The amount of usage included for this feature.
The reset or billing interval of the product item. If null, feature will have no reset date, and if there's a price, it will be billed one-off.
minute, hour, day, week, month, quarter, semi_annual, year The interval count of the product item.
The price of the product item. Should be null if tiered pricing is set.
Whether the feature should be prepaid upfront or billed for how much they use end of billing period.
prepaid, pay_per_use The amount per billing unit (eg. $9 / 250 units)
Whether the usage should be reset when the product is enabled.
The entity feature ID of the product item if applicable.
Used in customer context. Quantity of the feature the customer has prepaid for.
Used in customer context. Quantity of the feature the customer will prepay for in the next cycle.
Configuration for rollover and proration behavior of the feature.
Show child attributes
bill_immediately, prorate_immediately, prorate_next_cycle, bill_next_cycle prorate, prorate_immediately, prorate_next_cycle, none, no_prorations [
{
"feature_id": "<string>",
"feature_type": "single_use",
"included_usage": 123,
"interval": "month",
"usage_model": "prepaid",
"price": 123,
"billing_units": 1000,
"entity_feature_id": "<string>",
"reset_usage_when_enabled": true,
"tiers": [{ "to": 100, "amount": 10 }]
}
]The number of units of this product held by the customer, if applicable
1
The features this entity has access to.
Show child attributes
Show child attributes
The ID of the feature
The type of the feature
static, boolean, single_use, continuous_use, credit_system The name of the feature
The billing interval (e.g., 'month', 'year') or 'multiple' if the feature has different intervals across subscriptions
lifetime, minute, hour, day, week, month, quarter, semi_annual, year The number of intervals between usage resets
Whether the feature has unlimited usage with no restrictions or limits
The remaining available balance across all subscriptions for this feature (or all time for allocated features)
The total cumulative usage consumed in the current cycle across all subscriptions (or all time for allocated features)
The total amount of usage included in the customer's plan(s) for this feature
Unix timestamp (in milliseconds) when the usage counter will reset for the next cycle
Whether the customer can continue using the feature beyond the included usage. If false, access is blocked when limit is reached
Detailed breakdown by interval for features with multiple intervals
Show child attributes
The reset interval for this feature breakdown
lifetime, minute, hour, day, week, month, quarter, semi_annual, year The number of intervals between usage resets
The remaining available balance for this interval. Only present for metered features
The total amount of usage consumed in the current cycle
The amount of usage included in the customer's plan for this interval
Unix timestamp (in milliseconds) when the usage counter will reset for the next billing period
The maximum usage allowed for this feature. null if unlimited or no limit is set
Whether the customer can continue using the feature beyond the usage limit. If false, access is blocked when limit is reached
If this feature has a price, the usage limit indicates the maximum amount of usage the customer can use of this feature.
The invoices for this entity. Returned only if 'invoices' is passed into the expand parameter.
Show child attributes
Array of product IDs included in this invoice
["pro_plan", "addon_feature"]The Stripe invoice ID
"in_1A2B3C4D5E6F7G8H"
The status of the invoice
"paid"
The total amount of the invoice
2999
The currency code for the invoice
"usd"
Timestamp when the invoice was created
1759247877000
URL to the Stripe-hosted invoice page
"https://invoice.stripe.com/i/acct_123/test_456"