TypeScript
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
}
}
}Entities
Create an entity
POST
/
customers
/
{customer_id}
/
entities
TypeScript
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
}
}
}You can create multiple entities at once by passing an array of entities.
Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
Body
application/json
Response
200 - application/json
The unique identifier of the entity.
The name of the entity.
Unix timestamp (in milliseconds) when the entity was created.
Available options:
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
Show child attributes
The features this entity has access to.
Show child attributes
Show child attributes
The invoices for this entity. Returned only if 'invoices' is passed into the expand parameter.
Show child attributes
Show child attributes
⌘I

