Customers

Customers represent a purchaser or user of your product(s). Use the customer object to save payment and contact information and keep track of transactions belonging to the same customer.

The Customer object

Name
object
Type
"customer",
Description
Literal representing the object’s type.
Name
id
Type
string,
Description
Unique identifier for the object.
Name
live
Type
boolean,
Description
Has the value true if the object exists in a production environment or the value false if the object exists in a sandbox environment.
Name
created_at
Type
integer,
Description
Time at which the object was created. Measured in milliseconds since the Unix epoch.
Name
email
Type
string or null,
Description
The customer’s email address.
Name
metadata
Type
object,
Description
A key-value store that is attached to the object. Useful for storing miscellaneous structured data for your integration’s internal use.
Name
name
Type
string or null,
Description
The customer’s full name or business name.
Name
phone
Type
string or null,
Description
The customer’s phone number.

The Customer object

{
  "object": "customer",
  "id": "cus_aB4DEXqbFGOlpEOxwp0Fx1",
  "live": false,
  "created_at": 1750000000000,
  "name": "John Doe",
  "email": "john@bias.dev",
  "phone": null,
  "metadata": {}
}

Get a customer

Retrieve a customer by their ID.

Returns

Returns the customer object.

Get a customer

const customer = await bias.customers.get("id");

Response example

{
  "object": "customer",
  "id": "cus_aB4DEXqbFGOlpEOxwp0Fx1",
  "live": false,
  "created_at": 1750000000000,
  "name": "John Doe",
  "email": "john@bias.dev",
  "phone": null,
  "metadata": {}
}

List all customers

Retrieve a paginated list of customers.

Optional parameters

Name
ending_before
Type
string,
Description
A cursor for use in pagination. ending_before is an object ID that results will end before. Used to move backward through the list.
Name
starting_after
Type
string,
Description
A cursor for use in pagination. starting_after is an object ID that results will start after. Used to move forward through the list.
Name
limit
Type
number, at least 1, at most 1000, default is 50
Description
Maximum number of objects to return.
Name
filters
Type
,
Description
Filters to apply to the list. Combine multiple conditions with and and or.
Child properties

Returns

Returns a list of customer objects.

List all customers

const customer = await bias.customers.list();

Response example

{
  "object": "list",
  "items": [
    {
      "object": "customer",
      "id": "cus_aB4DEXqbFGOlpEOxwp0Fx1",
      "live": false,
      "created_at": 1750000000000,
      "name": "John Doe",
      "email": "john@bias.dev",
      "phone": null,
      "metadata": {}
    }
  ],
  "has_more": false
}

Create a customer

Create a new customer.

Optional parameters

Name
name
Type
string or null,
Description
The customer’s full name or business name.
Name
email
Type
string or null,
Description
The customer’s email address.
Name
phone
Type
string or null,
Description
The customer’s phone number.
Name
metadata
Type
object or null,

Returns

Returns the customer object.

Create a customer

const customer = await bias.customers.create({
  name: "John Doe",
  email: "john@bias.dev"
});

Response example

{
  "object": "customer",
  "id": "cus_aB4DEXqbFGOlpEOxwp0Fx1",
  "live": false,
  "created_at": 1750000000000,
  "name": "John Doe",
  "email": "john@bias.dev",
  "phone": null,
  "metadata": {}
}

Update a customer

Update a customer’s name, email, or phone number. Values of null will set the field to null. Omit a field to keep its current value.

Optional parameters

Name
name
Type
string or null,
Description
The customer’s full name or business name.
Name
email
Type
string or null,
Description
The customer’s email address.
Name
phone
Type
string or null,
Description
The customer’s phone number.
Name
metadata
Type
object or null,

Returns

Returns the customer object.

Update a customer

const customer = await bias.customers.update("id", {
  email: null,
  phone: "+11234567890"
});

Response example

{
  "object": "customer",
  "id": "cus_aB4DEXqbFGOlpEOxwp0Fx1",
  "live": false,
  "created_at": 1750000000000,
  "name": "John Doe",
  "email": "john@bias.dev",
  "phone": null,
  "metadata": {}
}

Delete a customer

Delete a customer. This action is irreversible and will remove the customer from all ascociated objects.

Returns

Returns the customer object.

Delete a customer

const customer = await bias.customers.delete("id");