import { Autumn } from 'autumn-js';
const autumn = new Autumn();
const { data, error } = await autumn.customers.create({ id: 'id' });{
"id": "customer_123",
"created_at": 1762971906762,
"name": "John Doe",
"email": "[email protected]",
"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
}
}
}import { Autumn } from 'autumn-js';
const autumn = new Autumn();
const { data, error } = await autumn.customers.create({ id: 'id' });{
"id": "customer_123",
"created_at": 1762971906762,
"name": "John Doe",
"email": "[email protected]",
"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
}
}
}Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
invoices, trials_used, rewards, entities, referrals, payment_method Your unique identifier for the customer
Customer's name
Customer's email address
Unique identifier (eg, serial number) to detect duplicate customers and prevent free trial abuse
Stripe customer ID if you already have one
Your unique identifier for the customer.
Timestamp of customer creation in milliseconds since epoch.
The name of the customer.
The email address of the customer.
A unique identifier (eg. serial number) to de-duplicate customers across devices or browsers. For example: apple device ID.
Stripe customer ID.
The environment this customer was created in.
sandbox, live The products the customer has access to.
Show child attributes
The unique identifier for the product
"pro_plan"
The name of the product
"Pro Plan"
The group the product belongs to
"product_set_1"
Current status of the product for this customer
active, expired, scheduled, trialing, past_due "active"
Timestamp when the customer started this product
1700000000000
Whether this product is the default for the customer
true
Whether the product is an add-on
false
Timestamp when the product was canceled for the customer
1717000000
Version of the product
1
List of Stripe subscription IDs associated with this product, if any
["sub_1Nc0JzBAbcxyz", "sub_1Nc0xyBAnopq"]Start of the current billing period
1717000000
End of the current billing period
1719600000
ID of the entity this customer product is attached to, if applicable
"entity_1234abcd"
Array of product items defining the features and pricing
Show child attributes
The type of the product item
feature, priced_feature, price The feature ID of the product item. If the item is a fixed price, should be null
Single use features are used once and then depleted, like API calls or credits. Continuous use features are those being used on an ongoing-basis, like storage or seats.
single_use, continuous_use, boolean, static The amount of usage included for this feature.
The reset or billing interval of the product item. If null, feature will have no reset date, and if there's a price, it will be billed one-off.
minute, hour, day, week, month, quarter, semi_annual, year The interval count of the product item.
The price of the product item. Should be null if tiered pricing is set.
Whether the feature should be prepaid upfront or billed for how much they use end of billing period.
prepaid, pay_per_use The amount per billing unit (eg. $9 / 250 units)
Whether the usage should be reset when the product is enabled.
The entity feature ID of the product item if applicable.
Used in customer context. Quantity of the feature the customer has prepaid for.
Used in customer context. Quantity of the feature the customer will prepay for in the next cycle.
Configuration for rollover and proration behavior of the feature.
Show child attributes
bill_immediately, prorate_immediately, prorate_next_cycle, bill_next_cycle prorate, prorate_immediately, prorate_next_cycle, none, no_prorations [
{
"feature_id": "<string>",
"feature_type": "single_use",
"included_usage": 123,
"interval": "month",
"usage_model": "prepaid",
"price": 123,
"billing_units": 1000,
"entity_feature_id": "<string>",
"reset_usage_when_enabled": true,
"tiers": [{ "to": 100, "amount": 10 }]
}
]The number of units of this product held by the customer, if applicable
1
The features a customer has access to as a dictionary of feature IDs to customer feature objects.
Show child attributes
Show child attributes
The ID of the feature
The type of the feature
static, boolean, single_use, continuous_use, credit_system The name of the feature
The billing interval (e.g., 'month', 'year') or 'multiple' if the feature has different intervals across subscriptions
lifetime, minute, hour, day, week, month, quarter, semi_annual, year The number of intervals between usage resets
Whether the feature has unlimited usage with no restrictions or limits
The remaining available balance across all subscriptions for this feature (or all time for allocated features)
The total cumulative usage consumed in the current cycle across all subscriptions (or all time for allocated features)
The total amount of usage included in the customer's plan(s) for this feature
Unix timestamp (in milliseconds) when the usage counter will reset for the next cycle
Whether the customer can continue using the feature beyond the included usage. If false, access is blocked when limit is reached
Detailed breakdown by interval for features with multiple intervals
Show child attributes
The reset interval for this feature breakdown
lifetime, minute, hour, day, week, month, quarter, semi_annual, year The number of intervals between usage resets
The remaining available balance for this interval. Only present for metered features
The total amount of usage consumed in the current cycle
The amount of usage included in the customer's plan for this interval
Unix timestamp (in milliseconds) when the usage counter will reset for the next billing period
The maximum usage allowed for this feature. null if unlimited or no limit is set
Whether the customer can continue using the feature beyond the usage limit. If false, access is blocked when limit is reached
If this feature has a price, the usage limit indicates the maximum amount of usage the customer can use of this feature.
The invoices for the customer. Returned only if invoices is provided in the expand parameter.
Show child attributes
Array of product IDs included in this invoice
["pro_plan", "addon_feature"]The Stripe invoice ID
"in_1A2B3C4D5E6F7G8H"
The status of the invoice
"paid"
The total amount of the invoice
2999
The currency code for the invoice
"usd"
Timestamp when the invoice was created
1759247877000
URL to the Stripe-hosted invoice page
"https://invoice.stripe.com/i/acct_123/test_456"
The entities for the customer. Returned only if entities is provided in the expand parameter.
Show child attributes
The unique identifier of the entity
The name of the entity
Unix timestamp when the entity was created
The environment (sandbox/live)
sandbox, live The customer ID this entity belongs to
The feature ID this entity belongs to
The rewards for the customer. Returned only if rewards is provided in the expand parameter.
Show child attributes
Array of active discounts applied to the customer
Show child attributes
The unique identifier for this discount
"disc_123456"
The name of the discount or coupon
"SUMMER20"
The type of reward
percentage_discount, fixed_discount, free_product, invoice_credits "percentage"
The discount value (percentage or fixed amount)
20
How long the discount lasts
one_off, months, forever "forever"
Number of billing periods the discount applies for repeating durations
3
The currency code for fixed amount discounts
"usd"
Timestamp when the discount becomes active
1759247877000
Timestamp when the discount expires
1761839877000
The Stripe subscription ID this discount is applied to
"sub_1A2B3C4D5E6F7G8H"
Total amount saved from this discount
599
[
{
"id": "disc_123456",
"name": "SUMMER20",
"type": "percentage",
"discount_value": 20
}
]The referrals for the customer. Returned only if referrals is provided in the expand parameter.
The upcoming invoice for the customer. Returned only if upcoming_invoice is provided in the expand parameter.
Show child attributes
Show child attributes
The unique identifier for this discount
"disc_123456"
The name of the discount or coupon
"SUMMER20"
The type of reward
percentage_discount, fixed_discount, free_product, invoice_credits "percentage"
The discount value (percentage or fixed amount)
20
How long the discount lasts
one_off, months, forever "forever"
Number of billing periods the discount applies for repeating durations
3
The currency code for fixed amount discounts
"usd"
Timestamp when the discount becomes active
1759247877000
Timestamp when the discount expires
1761839877000
The Stripe subscription ID this discount is applied to
"sub_1A2B3C4D5E6F7G8H"
Total amount saved from this discount
599
The payment method for the customer on Stripe. Returned only if payment_method is provided in the expand parameter.