Skip to main content

Endpoint

method
string
GET

Authentication

This endpoint requires authentication using a Bearer token.
Authorization: Bearer DUB_API_KEY

Path Parameters

id
string
required
The unique ID of the customer. You may use either:
  • The customer’s id on Dub (obtained via /customers endpoint)
  • Their externalId (unique ID within your system, prefixed with ext_, e.g. ext_user_123456)

Query Parameters

includeExpandedFields
boolean
Whether to include expanded fields on the customer (link, partner, discount).

Response

id
string
The unique ID of the customer
name
string
Name of the customer
email
string | null
Email of the customer
avatar
string | null
Avatar URL of the customer
externalId
string
Unique identifier for the customer in the client’s app
stripeCustomerId
string | null
The customer’s Stripe customer ID. This is useful for attributing recurring sale events to the partner who referred the customer.
country
string | null
Country of the customer
sales
number | null
Total number of sales for the customer
saleAmount
number | null
Total amount of sales for the customer
createdAt
string
The date the customer was created (usually the signup date or trial start date)
firstSaleAt
string | null
The date the customer made their first sale. Useful for calculating the time to first sale and LTV.
subscriptionCanceledAt
string | null
The date the customer canceled their subscription. Useful for calculating LTV and churn rate.
The referral link information (only included if includeExpandedFields=true)
id
string
Link ID
domain
string
Link domain
key
string
Link key/slug
Full short link URL
url
string
Destination URL
programId
string | null
Associated program ID
programId
string | null
The program ID the customer belongs to
partner
object | null
Partner information (only included if includeExpandedFields=true)
id
string
Partner ID
name
string
Partner name
email
string
Partner email
image
string
Partner image URL
discount
object | null
Discount information (only included if includeExpandedFields=true)

Examples

curl -X GET https://api.dub.co/customers/cus_xyz123 \
  -H "Authorization: Bearer DUB_API_KEY"

Response Example

{
  "id": "cus_xyz123",
  "name": "John Doe",
  "email": "john@example.com",
  "avatar": "https://example.com/avatar.jpg",
  "externalId": "user_123456",
  "stripeCustomerId": "cus_stripe123",
  "country": "US",
  "sales": 3,
  "saleAmount": 14997,
  "createdAt": "2024-01-15T10:30:00.000Z",
  "firstSaleAt": "2024-01-20T14:22:00.000Z",
  "subscriptionCanceledAt": null
}

Build docs developers (and LLMs) love