POST
/
check
import { Autumn as autumn } from 'autumn-js';

const response = await autumn.check({
  customer_id: 'user_123',
  feature_id: 'messages'
});
{
  "customer_id": "user_123",
  "feature_id": "messages",
  "code": "feature_found",
  "allowed": true,
  "balances": [
    {
      "feature_id": "messages",
      "required_balance": 12,
      "balance": 100
    }
  ]
}

If the customer_id you send doesn’t already exist, Autumn will automatically create a new customer. You can optionally set the properties of this new customer through the customer_data field.

Authorizations

Authorization
string
header
required

You can use your Secret or Publishable key for this endpoint. To include usage events tracking however, you must use your Secret key.

Body

application/json

Response

200 - application/json

The response is of type object.