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

const { data } = await autumn.customers.create({
  id: 'user_123',
  name: 'John Yeo',
  email: 'john@example.com'
});
{
  "autumn_id": "cus_2w5dzidzFD1cESxOGnn9frVuVcm",
  "created_at": 1677649423000,
  "env": "production",
  "id": "user_123",
  "name": "John Yeo",
  "email": "john@example.com",
  "fingerprint": "",
  "stripe_id": "cus_abc123",
  "products": [
    {
      "id": "pro",
      "name": "Pro Plan",
      "group": "",
      "status": "active",
      "started_at": 1677649423000,
      "canceled_at": null,
      "current_period_start": 1677649423000,
      "current_period_end": 1680327823000
    }
  ],
  "features": [
    {
      "feature_id": "messages",
      "unlimited": false,
      "interval": "month",
      "balance": 80,
      "usage": 20,
      "included_usage": 100,
      "next_reset_at": 1680327823000
    }
  ]
}
This endpoint is optional. Customers can be also be created by passing in customer_data in the attach, check or track endpoints.

Authorizations

Authorization
string
header
required

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

Body

application/json
id
string
required

Your unique identifier for the customer

email
string

Customer's email address

name
string

Customer's name

fingerprint
string

Unique identifier (eg, serial number) to detect duplicate customers and prevent free trial abuse

Response

200 - application/json
autumn_id
string

Autumn's internal identifier for the customer

created_at
integer

Timestamp of customer creation in milliseconds since epoch

env
enum<string>

Environment the customer is in

Available options:
production,
sandbox
id
string

Your unique identifier for the customer

name
string

Customer's name

email
string

Customer's email address

fingerprint
string

Unique identifier (eg, serial number) to detect duplicate customers and prevent free trial abuse

stripe_id
string

Stripe customer ID

products
object[]

List of products the customer has access to

features
object[]

List of features the customer has access to

invoices
object[]

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