Create a customer org under your partner account.
Partner (You)
prt_ token
Customer
cust_ token
Each customer gets their own isolated org, their own cust_ token, and their own policies. You manage their lifecycle and can set default policies that apply to all your customers.
const customer = await client.customers.create({
name: 'Acme Corp',
contact_email: 'admin@acme.com',
tier: 'startup',
});
console.log(customer.id);
console.log(customer.token); // cust_...{
"id": "d0ddcd43-...",
"name": "Acme Corp",
"tier": "startup",
"token": "cust_...",
"status": "active"
}// Promote from trial to paid
await client.customers.promote(customer.id, {
tier: 'platform',
});
// Suspend (e.g., non-payment)
await client.customers.suspend(customer.id);
// Reactivate
await client.customers.reactivate(customer.id);
// Check promotion readiness
const ready = await client.customers.promotionReadiness(customer.id);
// Get MGI score
const mgi = await client.customers.mgi(customer.id);