Customers

This object represents a customer of your business. Use it to create recurring charges and track payments that belong to the same customer.

The Customer object

Attributes

idstring

Unique identifier for the object.

descriptionnullable string

An arbitrary string attached to the object. Often useful for displaying to users.

addressnullable string

The customer’s address.

emailnullable string

The customer’s email address.

More attributes

objectstring

balanceinteger

createdtimestamp

currencynullable string

THE CUSTOMER OBJECT
{
  "id": "cus_NffrFeUfNV2Hib",
  "object": "customer",
  "address": null,
  "balance": 0,
  "created": 1680893993,
  "currency": null,
  "default_source": null,
  "delinquent": false,
  "description": null,
  "discount": null,
  "email": "jennyrosen@example.com",
  "invoice_prefix": "0759376C",
  "invoice_settings": {
    "custom_fields": null,
    "default_payment_method": null,
    "footer": null,
    "rendering_options": null
  },
  "livemode": false,
  "metadata": {},
  "name": "Jenny Rosen",
  "next_invoice_sequence": 1,
  "phone": null,
  "preferred_locales": [],
  "shipping": null,
  "tax_exempt": "none",
  "test_clock": null
}

Create a customer

Parameters

addressobject

The customer’s address.

descriptionnullable string

An arbitrary string attached to the object. Often useful for displaying to users.

emailnullable string

The customer’s email address.

metadataobject

Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to metadata.

More parameters

balanceinteger

cash_balanceobject

Returns

Returns the Customer object after successful customer creation. Raises an error if create parameters are invalid (for example, specifying an invalid coupon or an invalid source).

POST /v1/customers
const stripe = require("stripe")(
  "sk_test_CGGvfNiIPwLXiDwaOfZ3oX6Y"
)
const customer =
  await stripe.customers.create({
    name: "Jenny Rosen",
    email: "jennyrosen@example.com"
  })
RESPONSE
{
  "id": "cus_NffrFeUfNV2Hib",
  "object": "customer",
  "address": null,
  "balance": 0,
  "created": 1680893993,
  "currency": null,
  "default_source": null,
  "delinquent": false,
  "description": null,
  "discount": null,
  "email": "jennyrosen@example.com",
  "invoice_prefix": "0759376C",
  "invoice_settings": {
    "custom_fields": null,
    "default_payment_method": null,
    "footer": null,
    "rendering_options": null
  },
  "livemode": false,
  "metadata": {},
  "name": "Jenny Rosen",
  "next_invoice_sequence": 1,
  "phone": null
}