0 Tk

Customers

Managing customers

Customer objects allow you to perform recurring charges and track multiple charges that are associated with the same customer. The API allows you to create, delete, and update your customers. You can retrieve individual customers as well as a list of all your customers.

Create a customer

Endpoint: POST /v1/customers

Parameters:

  • email (optional): Customer’s email address.
  • source (optional): The source can either be a token, like the ones returned by Stripe.js, or a dictionary containing a user’s credit card details.
  • description (optional): An arbitrary string that you can attach to a customer object.

Example request:

curl https://api.stripe.com/v1/customers \
  -u sk_test_4eC39HqLyjWDarjtT1zdp7dc: \
  -d email="customer@example.com" \
  -d source=tok_1234567890abcdef \
  -d description="Example customer"

Example response:

{
  "id": "cus_Hh1aJLgbvgUEZJ",
  "object": "customer",
  "address": null,
  "balance": 0,
  "created": 1602688305,
  "currency": null,
  "default_source": "card_1Hh1hMCm4uUe0pYs5trCQMrL",
  "delinquent": false,
  "description": "Example customer",
  "discount": null,
  "email": "customer@example.com",
  "invoice_prefix": "B2D569C",
  "invoice_settings": {
    "custom_fields": null,
    "default_payment_method": null,
    "footer": null
  },
  "livemode": false,
  "metadata": {},
  "name": null,
  "next_invoice_sequence": 1,
  "phone": null,
  "preferred_locales": [],
  "shipping": null,
  "sources": {...},
  "subscriptions": {...},
  "tax_exempt": "none",
  "tax_ids": {...}
}