Skip to main content
POST
/
customers
JavaScript
import Limitry from '@limitry/sdk';

const client = new Limitry({
  apiKey: process.env['LIMITRY_API_KEY'], // This is the default and can be omitted
});

const customer = await client.customers.create({ externalId: 'x' });

console.log(customer.id);
{
  "id": "cust_abc123",
  "projectId": "proj_xyz",
  "externalId": "user_456",
  "name": "Acme Corp",
  "email": "billing@acme.com",
  "metadata": {
    "plan": "pro",
    "stripeId": "cus_xxx"
  },
  "createdAt": "2024-01-15T10:30:00Z",
  "updatedAt": "2024-01-15T10:30:00Z"
}

Authorizations

Authorization
string
header
required

API Key or Personal Access Token (PAT). When using PAT, include X-Project header.

Body

application/json
externalId
string
required

Your customer identifier

Minimum string length: 1
name
string

Customer name

email
string<email>

Customer email

billingCycleStart
string<date-time>

Billing cycle start date. Defaults to now if not provided.

timezone
string

IANA timezone (e.g., America/New_York). Falls back to project timezone if not set.

metadata
object

Custom metadata

Response

Customer created

id
string
required

Internal customer ID

projectId
string
required

Project ID

externalId
string
required

Your customer identifier

name
string | null
required

Customer name

email
string | null
required

Customer email

billingCycleStart
string<date-time>
required

Billing cycle start date (ISO 8601). Period boundaries are calculated from this date.

timezone
string | null
required

IANA timezone for billing calculations (e.g., America/New_York). Falls back to project default.

metadata
object
required

Custom metadata

createdAt
string<date-time>
required

Created timestamp

updatedAt
string<date-time>
required

Updated timestamp