Typescript (SDK)
import { Autumn } from 'autumn-js'
const autumn = new Autumn()
const result = await autumn.entities.update({
customerId: "cus_123",
entityId: "seat_42",
billingControls: {
spendLimits: [
{
featureId: "messages",
enabled: true,
overageLimit: 25,
},
],
},
});{
"id": "seat_42",
"name": "Seat 42",
"customer_id": "cus_123",
"feature_id": "seats",
"created_at": 1771409161016,
"env": "sandbox",
"subscriptions": [
{
"plan_id": "pro_plan",
"auto_enable": true,
"add_on": false,
"status": "active",
"past_due": false,
"canceled_at": null,
"expires_at": null,
"trial_ends_at": null,
"started_at": 1771431921437,
"current_period_start": 1771431921437,
"current_period_end": 1771999921437,
"quantity": 1
}
],
"purchases": [],
"balances": {
"messages": {
"feature_id": "messages",
"granted": 100,
"remaining": 72,
"usage": 28,
"unlimited": false,
"overage_allowed": false,
"max_purchase": null,
"next_reset_at": 1773851121437,
"breakdown": [
{
"id": "cus_ent_39qmLooixXLAqMywgXywjAz96rV",
"plan_id": "pro_plan",
"included_grant": 100,
"prepaid_grant": 0,
"remaining": 72,
"usage": 28,
"unlimited": false,
"reset": {
"interval": "month",
"resets_at": 1773851121437
},
"price": null,
"expires_at": null
}
]
}
},
"invoices": []
}
Entities
Update Entity
Updates an existing entity and returns the refreshed entity object.
Use this to change entity billing controls or other mutable entity fields after the entity has already been created.
POST
/
v1
/
entities.update
Typescript (SDK)
import { Autumn } from 'autumn-js'
const autumn = new Autumn()
const result = await autumn.entities.update({
customerId: "cus_123",
entityId: "seat_42",
billingControls: {
spendLimits: [
{
featureId: "messages",
enabled: true,
overageLimit: 25,
},
],
},
});{
"id": "seat_42",
"name": "Seat 42",
"customer_id": "cus_123",
"feature_id": "seats",
"created_at": 1771409161016,
"env": "sandbox",
"subscriptions": [
{
"plan_id": "pro_plan",
"auto_enable": true,
"add_on": false,
"status": "active",
"past_due": false,
"canceled_at": null,
"expires_at": null,
"trial_ends_at": null,
"started_at": 1771431921437,
"current_period_start": 1771431921437,
"current_period_end": 1771999921437,
"quantity": 1
}
],
"purchases": [],
"balances": {
"messages": {
"feature_id": "messages",
"granted": 100,
"remaining": 72,
"usage": 28,
"unlimited": false,
"overage_allowed": false,
"max_purchase": null,
"next_reset_at": 1773851121437,
"breakdown": [
{
"id": "cus_ent_39qmLooixXLAqMywgXywjAz96rV",
"plan_id": "pro_plan",
"included_grant": 100,
"prepaid_grant": 0,
"remaining": 72,
"usage": 28,
"unlimited": false,
"reset": {
"interval": "month",
"resets_at": 1773851121437
},
"price": null,
"expires_at": null
}
]
}
},
"invoices": []
}
Body Parameters
Response
{
"id": "seat_42",
"name": "Seat 42",
"customer_id": "cus_123",
"feature_id": "seats",
"created_at": 1771409161016,
"env": "sandbox",
"subscriptions": [
{
"plan_id": "pro_plan",
"auto_enable": true,
"add_on": false,
"status": "active",
"past_due": false,
"canceled_at": null,
"expires_at": null,
"trial_ends_at": null,
"started_at": 1771431921437,
"current_period_start": 1771431921437,
"current_period_end": 1771999921437,
"quantity": 1
}
],
"purchases": [],
"balances": {
"messages": {
"feature_id": "messages",
"granted": 100,
"remaining": 72,
"usage": 28,
"unlimited": false,
"overage_allowed": false,
"max_purchase": null,
"next_reset_at": 1773851121437,
"breakdown": [
{
"id": "cus_ent_39qmLooixXLAqMywgXywjAz96rV",
"plan_id": "pro_plan",
"included_grant": 100,
"prepaid_grant": 0,
"remaining": 72,
"usage": 28,
"unlimited": false,
"reset": {
"interval": "month",
"resets_at": 1773851121437
},
"price": null,
"expires_at": null
}
]
}
},
"invoices": []
}
Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Headers
Body
application/json
Response
200 - application/json
OK
The unique identifier of the entity
The name of the entity
Unix timestamp when the entity was created
The environment (sandbox/live)
Available options:
sandbox, live Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
The customer ID this entity belongs to
The feature ID this entity belongs to
Billing controls for the entity.
Show child attributes
Show child attributes
Invoices for this entity (only included when expand=invoices)
Show child attributes
Show child attributes
⌘I