Skip to main content
POST
/
v1
/
entities.get
Typescript (SDK)
import { Autumn } from 'autumn-js'

const autumn = new Autumn()

const result = await autumn.entities.get({
  entityId: "seat_42",
});
{
  "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

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Headers

x-api-version
string
default:2.1
required

Body

application/json
entity_id
string
required

The ID of the entity.

customer_id
string

The ID of the customer to create the entity for.

Response

200 - application/json

OK

id
string | null
required

The unique identifier of the entity

name
string | null
required

The name of the entity

created_at
number
required

Unix timestamp when the entity was created

env
enum<string>
required

The environment (sandbox/live)

Available options:
sandbox,
live
subscriptions
object[]
required
purchases
object[]
required
balances
object
required
autumn_id
string
customer_id
string | null

The customer ID this entity belongs to

feature_id
string | null

The feature ID this entity belongs to

invoices
object[]

Invoices for this entity (only included when expand=invoices)