Skip to main content

Update a customer

Update a customer for the authenticated workspace.
1 min read
patch/customers/{id}
Request example
Response
patch/customers/{id}

Authorization

Authorizationstringheaderrequired#
Default authentication mechanism

Path parameters

idstringrequired#
The unique ID of the customer. You may use either the customer's id on Dub (obtained via /customers endpoint) or their externalId (unique ID within your system, prefixed with ext_, e.g. ext_123).

Query parameters

includeExpandedFieldsboolean#
Whether to include expanded fields on the customer (link, partner, discount).

Body

application/json
emailstring#
The customer's email address.

Pattern: ^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$

namestring#
The customer's name. If not provided, the email address will be used, and if email is not provided, a random name will be generated.
avatarstring#
The customer's avatar URL. If not provided, a random avatar will be generated.
externalIdstring#
The customer's unique identifier your database. This is useful for associating subsequent conversion events from Dub's API to your internal systems.
stripeCustomerIdstring#
The customer's Stripe customer ID. This is useful for attributing recurring sale events to the partner who referred the customer.
countrystring#
The customer's country in ISO 3166-1 alpha-2 format. Updating this field will only affect the customer's country in Dub's system (and has no effect on existing conversion events).

Responses

application/json
The customer was updated.
idstringrequired#
The unique ID of the customer. You may use either the customer's id on Dub (obtained via /customers endpoint) or their externalId (unique ID within your system, prefixed with ext_, e.g. ext_123).
namestring#
Name of the customer.
emailstring#
Email of the customer.
avatarstring#
Avatar URL of the customer.
externalIdstringrequired#
Unique identifier for the customer in the client's app.
stripeCustomerIdstring#
The customer's Stripe customer ID. This is useful for attributing recurring sale events to the partner who referred the customer.
countrystring#
Country of the customer.
salesnumber#
Total number of sales for the customer.
saleAmountnumber#
Total amount of sales for the customer.
createdAtstringrequired#
The date the customer was created (usually the signup date or trial start date).
firstSaleAtstring#
The date the customer made their first sale. Useful for calculating the time to first sale and LTV.
subscriptionCanceledAtstring#
The date the customer canceled their subscription. Useful for calculating LTV and churn rate.
programIdstring#
partnerobject#
Show child attributes
idstringrequired#
The partner's unique ID on Dub.
namestringrequired#
The partner's full legal name.

Length: max 190

emailstringrequired#
The partner's email address. Should be a unique value across Dub.

Length: max 190

imagestringrequired#
The partner's avatar image.
discountobject#
Show child attributes
idstringrequired#
amountnumberrequired#
typeenum<string>required#
Options:percentageflat
maxDurationnumberrequired#
couponIdstringrequired#
couponTestIdstringrequired#
descriptionstring#
partnersCountnumber#