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

const customer = 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,
      "subscription_ids": [
        "sub_123"
      ],
      "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

Response

200 - application/json

The response is of type object.