get https://api.chartmogul.com/v1/customers/search
Returns a list of all customer
objects with the specified email address in your ChartMogul account.
Examples
curl -X GET "https://api.chartmogul.com/v1/customers/[email protected]" \
-u YOUR_API_KEY:
ChartMogul::Customer.search("[email protected]")
ChartMogul.Customer.search(config, { email: "[email protected]" });
ChartMogul\Customer::search("[email protected]");
api.SearchCustomers(&cm.SearchCustomersParams{
Email: "[email protected]",
Cursor: cm.Cursor{PerPage: 2},
})
chartmogul.Customer.search(config, email="[email protected]", per_page=2)
Result Format
{
"entries": [
{
"id": 25647,
"uuid": "cus_de305d54-75b4-431b-adb2-eb6b9e546012",
"external_id": "cus_0001",
"email": "[email protected]",
"name": "Acme",
"address": {
"address_zip": "10173",
"city": "New York",
"country": "US",
"state": "NY"
},
"mrr": 3000,
"arr": 36000,
"status": "Active",
"customer-since": "2022-06-09T13:16:00-04:00",
"billing-system-url": "https://dashboard.stripe.com/customers/cus_4Z2ZpyJFuQ0XMb",
"chartmogul-url": "https://app.chartmogul.com/#customers/25647-Acme",
"billing-system-type": "Stripe",
"currency": "USD",
"currency-sign": "$",
"attributes": {
"custom": {
"CAC": 213,
"utmCampaign": "social media 1",
"convertedAt": "2022-06-09 00:00:00",
"pro": false,
"salesRep": "Gabi"
},
"tags": ["engage", "unit loss", "discountable"],
"stripe": {
"uid": 7,
"coupon": true
},
"clearbit": {}
}
}
],
"current_page": 1, // deprecated
"total_pages": 3, // deprecated
"per_page": 200, // deprecated
"page": 1, // deprecated
"cursor": "AjMx90kC0yMVQwNNwoYToyNC4wMDAwMDAwMDBgks68k",
"has_more": true
}
#<ChartMogul::Customers:0x007fd843685d58
@entries=[
#<ChartMogul::Customer:0x007faf03b02d68
@id=25647,
@uuid="cus_de305d54-75b4-431b-adb2-eb6b9e546012",
@external_id="cus_0001",
@name="Acme",
@email="[email protected]",
@status="Active",
@customer_since=2022-06-09 13:16:00 -04:00:00,
@attributes={
:tags=>["engage", "unit loss", "discountable"],
:stripe=>{
:uid=>7,
:coupon=>true
},
:clearbit=>{},
:custom=> {
:CAC=> 213,
:utmCampaign=> "social media 1",
:convertedAt=> "2022-06-09 00:00:00",
:pro=> false,
:salesRep=> "Gabi"
}
},
@address={
:address_zip=>"10173",
:city=>"New York",
:state=>"NY",
:country=>"US"
},
@mrr=3000,
@arr=36000,
@billing_system_url="https://dashboard.stripe.com/customers/cus_4Z2ZpyJFuQ0XMb",
@chartmogul_url="https://app.chartmogul.com/#customers/25647-Acme",
@billing_system_type="Stripe",
@currency="USD",
@currency_sign="$"
>
],
@current_page=1, # deprecated with version 4.0.0
@total_pages=3, # deprecated with version 4.0.0
@per_page=200, # deprecated with version 4.0.0
@page=1, # deprecated with version 4.0.0
@cursor="AjMx90kC0yMVQwNNwoYToyNC4wMDAwMDAwMDBgks68k",
@has_more=true
>
{
entries: [
{
id: 25647,
uuid: "cus_de305d54-75b4-431b-adb2-eb6b9e546012",
external_id: "cus_0001",
email: "[email protected]",
name: "Acme",
address: {
address_zip: "10173",
city: "New York",
country: "US",
state: "NY"
},
mrr: 3000,
arr: 36000,
status: "Active",
"customer-since": "2022-06-09T13:16:00-04:00",
"billing-system-url": "https://dashboard.stripe.com/customers/cus_4Z2ZpyJFuQ0XMb",
"chartmogul-url": "https://app.chartmogul.com/#customers/25647-Acme",
"billing-system-type": "Stripe",
currency: "USD",
"currency-sign": "$",
attributes: {
custom: {
CAC: 213,
utmCampaign: "social media 1",
convertedAt: "2022-06-09 00:00:00",
pro: false,
salesRep: "Gabi"
},
tags: ["engage", "unit loss", "discountable"],
stripe: {
uid: 7,
coupon: true
},
clearbit: {}
}
}
],
current_page: 1, // deprecated with version 3.0.0
total_pages: 3, // deprecated with version 3.0.0
per_page: 200, // deprecated with version 3.0.0
page: 1, // deprecated with version 3.0.0
cursor: "AjMx90kC0yMVQwNNwoYToyNC4wMDAwMDAwMDBgks68k",
has_more: true
}
ChartMogul\Customers::__set_state(array(
"current_page" => 1, # deprecated with version 6.0.0
"total_pages" => 3, # deprecated with version 6.0.0
"per_page" => 200, # deprecated with version 6.0.0
"page" => 1, # deprecated with version 6.0.0
"cursor" => "AjMx90kC0yMVQwNNwoYToyNC4wMDAwMDAwMDBgks68k",
"has_more" => true
"entries" => Doctrine\Common\Collections\ArrayCollection::__set_state(array(
"elements" => array (
0 => ChartMogul\Customer::__set_state(array(
"id" => 25647,
"uuid" => "cus_de305d54-75b4-431b-adb2-eb6b9e546012",
"external_id" => "cus_0001",
"name" => "Acme",
"email" => "[email protected]",
"status" => "Active",
"customer_since" => "2022-06-09T13:16:00-04:00",
"attributes" => array (
"custom" => array (
"CAC" => 213,
"utmCampaign" => "social media 1",
"convertedAt" => "2022-06-09 00 =>00 =>00",
"pro" => false,
"salesRep" => "Gabi"
),
"clearbit" => array (),
"stripe" => array (
"uid" => 7,
"coupon" => true
),
"tags" => array (
0 => "engage",
1 => "unit loss",
2 => "discountable"
),
),
"address" => array (
"address_zip" => "10173",
"city" => "New York",
"state" => "NY",
"country" => "US"
),
"mrr" => 3000,
"arr" => 36000,
"billing_system_url" => "https://dashboard.stripe.com/customers/cus_4Z2ZpyJFuQ0XMb",
"chartmogul_url" => "https://app.chartmogul.com/#customers/25647-Acme",
"billing_system_type" => "Stripe",
"currency" => "USD",
"currency_sign" => "$",
"data_source_uuid" => "ds_80686670-cc45-11e6-b9da-ff67b9895fe3",
"data_source_uuids" => array (
0 => "ds_80686670-cc45-11e6-b9da-ff67b9895fe3",
),
"external_ids" => array (
0 => "cus_0001",
),
"city" => "New York",
"country" => "US",
"state" => "NY",
"zip" => "10173",
"lead_created_at" => "2022-03-14T00:00:00.000Z",
"free_trial_started_at" => "2022-05-01T00:00:00.000Z",
"company" => "",
))
))
)));
(*chartmogul.Customers)(0xc042088b40)({
Entries: ([]*chartmogul.Customer) (len=2) {
(*chartmogul.Customer)(0xc0421c6160)({
ID: (uint32) 25647,
DataSourceUUID: (string) (len=39) "ds_80686670-cc45-11e6-b9da-ff67b9895fe3",
UUID: (string) (len=40) "cus_de305d54-75b4-431b-adb2-eb6b9e546012",
ExternalID: (string) (len=8) "cus_0001",
Name: (string) (len=10) "Adam Smith",
Email: (string) (len=14) "[email protected]",
Status: (string) (len=6) "Active",
CustomerSince: (string) (len=25) "2022-06-09T13:16:00-04:00",
Attributes: (*chartmogul.Attributes)(0xc0420067b0)({
Tags: ([]string) (len=3) {
(string) (len=6) "engage",
(string) (len=9) "unit loss",
(string) (len=12) "discountable"
},
Stripe: (*chartmogul.Stripe)(0xc04200c5b0)({
UID: (uint64) 7,
Coupon: (bool) true
}),
Clearbit: (*chartmogul.Clearbit)(0xc0420da3c0)({
}),
Custom: (map[string]interface {}) (len=5) {
(string) (len=3) "CAC": (float64) 213,
(string) (len=11) "utmCampaign": (string) (len=14) "social media 1",
(string) (len=11) "convertedAt": (string) (len=25) "2022-06-09T00:00:00-04:00",
(string) (len=3) "pro": (string) (bool) false,
(string) (len=8) "salesRep": (string) (len=4) "Gabi"
}
}),
Address: (*chartmogul.Address)(0xc0420084c0)({
AddressZIP: (string) (len=5) "10173",
City: (string) (len=8) "New York",
State: (string) (len=2) "NY",
Country: (string) (len=13) "United States"
}),
Mrr: (float64) 300,
Arr: (float64) 36000,
BillingSystemURL: (string) (len=57) "https://dashboard.stripe.com/customers/cus_4Z2ZpyJFuQ0XMb",
ChartmogulURL: (string) (len=56) "https://app.chartmogul.com/#customers/25647-Acme",
BillingSystemType: (string) (len=6) "Stripe",
Currency: (string) (len=3) "USD",
CurrencySign: (string) (len=1) "$",
Company: (string) "",
Country: (string) (len=2) "US",
State: (string) (len=2) "NY",
City: (string) (len=8) "New York",
LeadCreatedAt: (string) (len=24) "2022-01-01T00:00:00.000Z",
FreeTrialStartedAt: (string) (len=24) "2022-05-01T00:00:00.000Z",
Errors: (chartmogul.Errors) chartmogul: map[]
})
},
Page: (uint32) 1, // deprecated with version v4
PerPage: (uint32) 2, // deprecated with version v4
CurrentPage: (int32) 1, // deprecated with version v4
TotalPages: (int32) 0, // deprecated with version v4
Cursor: (string) (len=44) "AjMx90kC0yMVQwNNwoYToyNC4wMDAwMDAwMDBgks68k",
HasMore: (bool) true
})
Customers(
entries=[
<Customer{
address=<Address{
address_zip=None,
city="New York",
country="United States",
state="NY"}>,
arr=49200.0,
attributes=<Attributes{
clearbit=<Clearbit{
}>,
custom={
"CAC": 213,
"utmCampaign": "social media 1",
"convertedAt": "2022-06-09 00:00:00",
"pro": False,
"salesRep": "Gabi"},
stripe=<Stripe{
}>,
tags=["high-value"]}>,
billing_system_type="Stripe",
billing_system_url="https://dashboard.stripe.com/customers/cus_4Z2ZpyJFuQ0XMb",
chartmogul_url="https://app.chartmogul.com/#customers/25647-Acme",
city="New York",
company="",
country="US",
currency="USD",
currency_sign="$",
customer_since=datetime.datetime(2022, 6, 9, 13, 16),
data_source_uuid="ds_80686670-cc45-11e6-b9da-ff67b9895fe3",
data_source_uuids=["ds_80686670-cc45-11e6-b9da-ff67b9895fe3"],
email="[email protected]",
external_id="cus_0001",
external_ids=["cus_0001"],
free_trial_started_at=datetime.datetime(2022, 5, 1, 0, 0, 0),
id=25647,
lead_created_at=datetime.datetime(2022, 3, 14, 0, 0),
mrr=4100.0,
name="Acme",
state="NY",
status="Active",
uuid="cus_de305d54-75b4-431b-adb2-eb6b9e546012",
zip="10173"
}>
],
per_page=2, # deprecated with version 4.0.0
page=1, # deprecated with version 4.0.0
current_page=1, # deprecated with version 4.0.0
total_pages=None, # deprecated with version 4.0.0
cursor="AjMx90kC0yMVQwNNwoYToyNC4wMDAwMDAwMDBgks68k",
has_more=True
)
In the response, entries
contains an array of customer
objects with the following data:
id
- The internal ChartMogul ID of thecustomer
object.uuid
- The UUID of thecustomer
object generated by ChartMogul.external_id
- The unique external identifier for this customer, if any.name
-DEPRECATED
The customer's name. This parameter is getting deprecated. Instead, use thefirst_name
andlast_name
of the contact object when importing data into ChartMogul.email
-DEPRECATED
The customer's email address. This parameter is getting deprecated. Instead, use theemail
of the contact object when importing data into ChartMogul.status
- The status of this customer. One ofNew Lead
,Working Lead
,Qualified Lead
,Unqualified Lead
,Active
,Past Due
, orCancelled
.customer-since
- An RFC3339 formatted datetime attribute indicating when the customer first started paying for a subscription.attributes
- A JSON object representing this customer's attributes containing the following data:tags
- An Array of tags that you have added to this customer.stripe
- A JSON object representing any metadata on this customer object in your Stripe account.clearbit
- A JSON object representing publicly available information about this customer retrieved from Clearbit. This is a legacy field. ChartMogul no longer utilizes Clearbit.custom
- A JSON object representing custom attributes that you have added to this customer.address
- A JSON object representing this customer's address containing the following data:address_zip
- The zip code of this customer's address.city
- The city of this customer's address.state
- The state from this customer's address.country
- The country code of this customer's address as per the ISO-3166 alpha-2 standard.
mrr
- The current monthly recurring revenue for this customer, expressed in the currency selected for your account, as an integer number of cents. Divide by 100 to obtain the actual amount.arr
- The current annual run rate for this customer, also expressed as an integer number of cents in your account's selected currency.billing-system-url
- A URL for this customer's data in your billing system, if available.chartmogul-url
- The URL for this customer's ChartMogul page. This is only accessible to a user logged in to your ChartMogul account.billing-system-type
- The type of the billing system from where the customer was imported to ChartMogul. For example,Stripe
,Recurly
, orCustom
.currency
- The currency of the MRR readings for this customer.currency-sign
- Text representation to display the currency. E.g. $, or €.
The other keys represent pagination attributes:
cursor
- A value that should be used in the next API request to fetch the next page of customers. Request for next page should be initiated only ifhas_more
is set totrue
indicating that there are more customers to list.has_more
- One oftrue
orfalse
depending on whether there are more pages with results for this request.per_page
-DEPRECATED
The number of results in this response.page
-DEPRECATED
The page number of this response.