Skip to main content
POST
/
customers
/
{customer_id}
TypeScript
import { Autumn } from 'autumn-js';

const autumn = new Autumn();

const { data, error } = await autumn.customers.update('customer_id');
{
  "id": "customer_123",
  "created_at": 1762971906762,
  "name": "John Doe",
  "email": "john@doe.com",
  "fingerprint": null,
  "stripe_id": "cus_J8A5c31A8tlpwN",
  "env": "sandbox",
  "metadata": {},
  "products": [
    {
      "id": "pro_plan",
      "name": "Pro Plan",
      "group": "product_set_1",
      "status": "active",
      "canceled_at": null,
      "started_at": 1762971923843,
      "is_default": false,
      "is_add_on": false,
      "version": 1,
      "current_period_start": 1762971905000,
      "current_period_end": 1765563905000,
      "items": [
        {
          "type": "feature",
          "feature_id": "dashboard",
          "feature_type": "static",
          "included_usage": 0,
          "interval": null,
          "entity_feature_id": null,
          "display": {
            "primary_text": "Dashboard"
          }
        },
        {
          "type": "feature",
          "feature_id": "messages",
          "feature_type": "single_use",
          "included_usage": 30,
          "interval": "month",
          "reset_usage_when_enabled": true,
          "entity_feature_id": null,
          "display": {
            "primary_text": "10 Messages"
          }
        }
      ],
      "quantity": 1
    }
  ],
  "features": {
    "messages": {
      "id": "messages",
      "type": "single_use",
      "name": "Messages",
      "interval": "month",
      "interval_count": 1,
      "unlimited": false,
      "balance": 10,
      "usage": 0,
      "included_usage": 10,
      "next_reset_at": 1765563905000,
      "overage_allowed": false
    },
    "dashboard": {
      "id": "dashboard",
      "type": "static",
      "name": "Dashboard",
      "interval": null,
      "interval_count": null,
      "unlimited": false,
      "balance": 0,
      "usage": 0,
      "included_usage": 0,
      "next_reset_at": null,
      "overage_allowed": false
    }
  }
}

Authorizations

Authorization
string
header
required

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

Path Parameters

customer_id
string
required

Body

application/json
id
string

New unique identifier for the customer.

name
string | null

The customer's name.

email

The customer's email address.

fingerprint
string | null

Unique identifier (eg, serial number) to detect duplicate customers.

metadata
object | null

Additional metadata for the customer (set individual keys to null to delete them).

stripe_id
string | null

Stripe customer ID.

Response

200 - application/json
id
string | null
required

Your unique identifier for the customer.

created_at
number
required

Timestamp of customer creation in milliseconds since epoch.

name
string | null
required

The name of the customer.

email
string | null
required

The email address of the customer.

fingerprint
string | null
required

A unique identifier (eg. serial number) to de-duplicate customers across devices or browsers. For example: apple device ID.

stripe_id
string | null
required

Stripe customer ID.

env
enum<string>
required

The environment this customer was created in.

Available options:
sandbox,
live
metadata
object
required

The metadata for the customer.

products
object[]
required

The products the customer has access to.

features
object
required

The features a customer has access to as a dictionary of feature IDs to customer feature objects.

invoices
object[]

The invoices for the customer. Returned only if invoices is provided in the expand parameter.

entities
object[]

The entities for the customer. Returned only if entities is provided in the expand parameter.

trials_used
object[]

The trials used for the customer. Returned only if trials_used is provided in the expand parameter.

rewards
object | null

The rewards for the customer. Returned only if rewards is provided in the expand parameter.

referrals
object[]

The referrals for the customer. Returned only if referrals is provided in the expand parameter.

upcoming_invoice
object | null

The upcoming invoice for the customer. Returned only if upcoming_invoice is provided in the expand parameter.

payment_method
any

The payment method for the customer on Stripe. Returned only if payment_method is provided in the expand parameter.