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]' },
function (err, res) {
// asynchronously called
});
<?php
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": "34916129",
"email": "[email protected]",
"name": "Example Company",
"address": {
"address_zip": "0185128",
"city": "Nowhereville",
"country": "US",
"state": "Alaska"
},
"mrr": 3000,
"arr": 36000,
"status": "Active",
"customer-since": "2015-06-09T13:16:00-04:00",
"billing-system-url": "https:\/\/dashboard.stripe.com\/customers\/cus_4Z2ZpyJFuQ0XMb",
"chartmogul-url": "https:\/\/app.chartmogul.com\/#customers\/25647-Example_Company",
"billing-system-type": "Stripe",
"currency": "USD",
"currency-sign": "$",
"attributes": {
"custom": {
"CAC": 213,
"utmCampaign": "social media 1",
"convertedAt": "2015-09-08 00:00:00",
"pro": false,
"salesRep": "Gabi"
},
"tags": ["engage", "unit loss", "discountable"],
"stripe": {
"uid": 7,
"coupon": true
},
"clearbit": {
"id": "027b0d40-016c-40ea-8925-a076fa640992",
"name": "Acme",
"legalName": "Acme Inc.",
"domain": "acme.com",
"url": "http://acme.com",
"metrics": {
"raised": 1502450000,
"employees": 1000,
"googleRank": 7,
"alexaGlobalRank": 2319,
"marketCap": null
},
"category": {
"sector": "Information Technology",
"industryGroup": "Software and Services",
"industry": "Software",
"subIndustry": "Application Software"
}
}
}
},
{"...more...": "...entries..."}
],
"has_more":false,
"per_page":200,
"page":1
}
#<ChartMogul::Customers:0x007fd843685d58
@entries=[
#<ChartMogul::Customer:0x007faf03b02d68
@id=25647,
@uuid="cus_de305d54-75b4-431b-adb2-eb6b9e546012",
@external_id="34916129",
@name="Example Company",
@email="[email protected]",
@status="Active",
@customer_since=2015-06-09 13:16:00 -04:00:00,
@attributes={
:tags=>["engage", "unit loss", "discountable"],
:stripe=>{
:uid=>7,
:coupon=>true
},
:clearbit=>{
:id=>"027b0d40-016c-40ea-8925-a076fa640992",
:name=>"Acme",
:legalName=> "Acme Inc.",
:domain=> "acme.com",
:url=> "http://acme.com",
:metrics=> {
:raised=> 1502450000,
:employees=> 1000,
:googleRank=> 7,
:alexaGlobalRank=> 2319,
:marketCap=> null
},
:category=> {
:sector=> "Information Technology",
:industryGroup=> "Software and Services",
:industry=> "Software",
:subIndustry=> "Application Software"
}
},
:custom=> {
:CAC=> 213,
:utmCampaign=> "social media 1",
:convertedAt=> "2015-09-08 00:00:00",
:pro=> false,
:salesRep=> "Gabi"
}
},
@address={
:address_line1=>"First line of address",
:address_line2=>"Second line of address",
:address_zip=>"0185128",
:city=>"Nowhereville",
:state=>"Alaska",
:country=>"US"
},
@mrr=3000,
@arr=36000,
@billing_system_url="https:\/\/dashboard.stripe.com\/customers\/cus_4Z2ZpyJFuQ0XMb",
@chartmogul_url="https:\/\/app.chartmogul.com\/#customers\/25647-Example_Company",
@billing_system_type="Stripe",
@currency="USD",
@currency_sign="$"
>
],
@has_more=false,
@per_page=200,
@page=1
>
{
"entries":[
{
"id": 25647,
"uuid": "cus_de305d54-75b4-431b-adb2-eb6b9e546012",
"external_id": "34916129",
"email": "[email protected]",
"name": "Example Company",
"address": {
"address_line1": "First line of address",
"address_line2": "Second line of address",
"address_zip": "0185128",
"city": "Nowhereville",
"country": "US",
"state": "Alaska"
},
"mrr": 3000,
"arr": 36000,
"status": "Active",
"customer-since": "2015-06-09T13:16:00-04:00",
"billing-system-url": "https:\/\/dashboard.stripe.com\/customers\/cus_4Z2ZpyJFuQ0XMb",
"chartmogul-url": "https:\/\/app.chartmogul.com\/#customers\/25647-Example_Company",
"billing-system-type": "Stripe",
"currency": "USD",
"currency-sign": "$",
"attributes": {
"custom": {
"CAC": 213,
"utmCampaign": "social media 1",
"convertedAt": "2015-09-08 00:00:00",
"pro": false,
"salesRep": "Gabi"
},
"tags": ["engage", "unit loss", "discountable"],
"stripe": {
"uid": 7,
"coupon": true
},
"clearbit": {
"id": "027b0d40-016c-40ea-8925-a076fa640992",
"name": "Acme",
"legalName": "Acme Inc.",
"domain": "acme.com",
"url": "http://acme.com",
"metrics": {
"raised": 1502450000,
"employees": 1000,
"googleRank": 7,
"alexaGlobalRank": 2319,
"marketCap": null
},
"category": {
"sector": "Information Technology",
"industryGroup": "Software and Services",
"industry": "Software",
"subIndustry": "Application Software"
}
}
}
},
{"...more...": "...entries..."}
],
"has_more":false,
"per_page":200,
"page":1
}
<?php
ChartMogul\Customers::__set_state(array(
"current_page" => 1,
"total_pages" => 1,
"has_more" => false,
"per_page" => 200,
"page" => 1,
"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" => "34916129",
"name" => "Example Company",
"email" => "[email protected]",
"status" => "Active",
"customer_since" => "2015-06-09T13:16:00-04:00",
"attributes" =>
array (
"custom" =>
array (
"CAC" => 213,
"utmCampaign" => "social media 1",
"convertedAt" => "2015-09-08 00 =>00 =>00",
"pro" => false,
"salesRep" => "Gabi"
),
"clearbit" =>
array (
"id" => "027b0d40-016c-40ea-8925-a076fa640992",
"name" => "Acme",
"legalName" => "Acme Inc.",
"domain" => "acme.com",
"url" => "http =>//acme.com",
"metrics" => array (
"raised" => 1502450000,
"employees" => 1000,
"googleRank" => 7,
"alexaGlobalRank" => 2319,
"marketCap" => null
),
"category" => array (
"sector" => "Information Technology",
"industryGroup" => "Software and Services",
"industry" => "Software",
"subIndustry" => "Application Software"
)
),
"stripe" =>
array (
"uid" => 7,
"coupon" => true
),
"tags" =>
array (
0 => "engage",
1 => "unit loss",
2 => "discountable"
),
),
"address" =>
array (
"address_line1" => "First line of address",
"address_line2" => "Second line of address",
"address_zip" => "0185128",
"city" => "Nowhereville",
"state" => "Alaska",
"country" => "US"
),
"mrr" => 3000,
"arr" => 36000,
"billing_system_url" => "https:\/\/dashboard.stripe.com\/customers\/cus_4Z2ZpyJFuQ0XMb",
"chartmogul_url" => "https:\/\/app.chartmogul.com\/#customers\/25647-Example_Company",
"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" => "Nowhereville",
"country" => "US",
"state" => "Alaska",
"zip" => "0185128",
"lead_created_at" => "2015-10-14T00:00:00.000Z",
"free_trial_started_at" => "2015-11-01T00:00:00.000Z",
"company" => "",
))
)))
));
?>
(*chartmogul.Customers)(0xc042088b40)({
Entries: ([]*chartmogul.Customer) (len=2) {
(*chartmogul.Customer)(0xc0421c6160)({
ID: (uint32) 4861688,
DataSourceUUID: (string) (len=39) "ds_9bb53a1e-edfd-11e6-bf83-af49e978cb11",
UUID: (string) (len=40) "cus_c0dc8d74-edfd-11e6-a357-832dddba822f",
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) "2015-11-01T00:00:00+00:00",
Attributes: (*chartmogul.Attributes)(0xc0420067b0)({
Tags: ([]string) (len=1) {
(string) (len=10) "high-value"
},
Stripe: (*chartmogul.Stripe)(0xc04200c5b0)({
UID: (uint64) 0,
Coupon: (bool) false
}),
Clearbit: (*chartmogul.Clearbit)(0xc0420da3c0)({
ID: (string) "",
Name: (string) "",
LegalName: (string) "",
Domain: (string) "",
URL: (string) "",
Metrics: (map[string]interface {}) <nil>,
Category: (*chartmogul.Category)(<nil>)
}),
Custom: (map[string]interface {}) (len=2) {
(string) (len=3) "CAC": (float64) 25,
(string) (len=7) "channel": (string) (len=8) "Facebook"
}
}),
Address: (*chartmogul.Address)(0xc0420084c0)({
AddressZIP: (string) "",
City: (string) (len=6) "Juneau",
State: (string) (len=6) "Alaska",
Country: (string) (len=13) "United States"
}),
Mrr: (float64) 4100,
Arr: (float64) 49200,
BillingSystemURL: (string) "",
ChartmogulURL: (string) (len=56) "https://app.chartmogul.com/#customers/4861688-Adam_Smith",
BillingSystemType: (string) (len=10) "Custom",
Currency: (string) (len=3) "USD",
CurrencySign: (string) (len=1) "$",
Company: (string) "",
Country: (string) (len=2) "US",
State: (string) (len=2) "AK",
City: (string) (len=6) "Juneau",
LeadCreatedAt: (string) (len=24) "2015-01-01T00:00:00.000Z",
FreeTrialStartedAt: (string) (len=24) "2015-06-13T15:45:13.000Z",
Errors: (chartmogul.Errors) chartmogul: map[]
}),
(*chartmogul.Customer)(0xc0421c66e0)({
ID: (uint32) 4865413,
DataSourceUUID: (string) (len=39) "ds_9bb53a1e-edfd-11e6-bf83-af49e978cb11",
UUID: (string) (len=40) "cus_b3e32f0e-edff-11e6-8a4b-7f2150c9ba2f",
ExternalID: (string) (len=8) "cus_0004",
Name: (string) (len=10) "Adam Smith",
Email: (string) (len=14) "[email protected]",
Status: (string) (len=4) "Lead",
CustomerSince: (string) "",
Attributes: (*chartmogul.Attributes)(0xc042006a80)({
Tags: ([]string) {
},
Stripe: (*chartmogul.Stripe)(0xc04200c6d0)({
UID: (uint64) 0,
Coupon: (bool) false
}),
Clearbit: (*chartmogul.Clearbit)(0xc0420da420)({
ID: (string) "",
Name: (string) "",
LegalName: (string) "",
Domain: (string) "",
URL: (string) "",
Metrics: (map[string]interface {}) <nil>,
Category: (*chartmogul.Category)(<nil>)
}),
Custom: (map[string]interface {}) {
}
}),
Address: (*chartmogul.Address)(0xc042008540)({
AddressZIP: (string) "",
City: (string) (len=8) "New York",
State: (string) "",
Country: (string) (len=13) "United States"
}),
Mrr: (float64) 0,
Arr: (float64) 0,
BillingSystemURL: (string) "",
ChartmogulURL: (string) (len=56) "https://app.chartmogul.com/#customers/4865413-Adam_Smith",
BillingSystemType: (string) (len=10) "Custom",
Currency: (string) (len=3) "USD",
CurrencySign: (string) (len=1) "$",
Company: (string) "",
Country: (string) (len=2) "US",
State: (string) "",
City: (string) (len=8) "New York",
LeadCreatedAt: (string) (len=24) "2015-10-14T00:00:00.000Z",
FreeTrialStartedAt: (string) (len=24) "2015-11-01T00:00:00.000Z",
Errors: (chartmogul.Errors) chartmogul: map[]
})
},
Page: (uint32) 1,
PerPage: (uint32) 2,
HasMore: (bool) true,
CurrentPage: (int32) 1,
TotalPages: (int32) 0
})
Customers(entries=[
<Customer{
address=<Address{
address_zip=None,
city='Juneau',
country='United States',
state='Alaska'}>,
arr=49200.0,
attributes=<Attributes{
clearbit=<Clearbit{
}>,
custom={
'CAC': 25,
'channel': 'Facebook'},
stripe=<Stripe{
}>,
tags=['high-value']}>,
billing_system_type='Custom',
billing_system_url=None,
chartmogul_url='https://app.chartmogul.com/#customers/4861688-Adam_Smith',
city='Juneau',
company='',
country='US',
currency='USD',
currency_sign='$',
customer_since=datetime.datetime(2015, 11, 1, 0, 0),
data_source_uuid='ds_9bb53a1e-edfd-11e6-bf83-af49e978cb11',
data_source_uuids=['ds_9bb53a1e-edfd-11e6-bf83-af49e978cb11'],
email='[email protected]',
external_id='cus_0001',
external_ids=['cus_0001'],
free_trial_started_at=datetime.datetime(2015, 6, 13, 15, 45, 13),
id=4861688,
lead_created_at=datetime.datetime(2015, 1, 1, 0, 0),
mrr=4100.0,
name='Adam Smith',
state='AK',
status='Active',
uuid='cus_c0dc8d74-edfd-11e6-a357-832dddba822f',
zip=None}>,
<Customer{
address=<Address{
address_zip=None,
city='New York',
country='United States',
state=None}>,
arr=0.0,
attributes=<Attributes{
clearbit=<Clearbit{
}>,
custom={
},
stripe=<Stripe{
}>,
tags=[]}>,
billing_system_type='Custom',
billing_system_url=None,
chartmogul_url='https://app.chartmogul.com/#customers/4865413-Adam_Smith',
city='New York',
company='',
country='US',
currency='USD',
currency_sign='$',
customer_since=None,
data_source_uuid='ds_9bb53a1e-edfd-11e6-bf83-af49e978cb11',
data_source_uuids=['ds_9bb53a1e-edfd-11e6-bf83-af49e978cb11'],
email='[email protected]',
external_id='cus_0004',
external_ids=['cus_0004'],
free_trial_started_at=datetime.datetime(2015, 11, 1, 0, 0),
id=4865413,
lead_created_at=datetime.datetime(2015, 10, 14, 0, 0),
mrr=0.0,
name='Adam Smith',
state=None,
status='Lead',
uuid='cus_b3e32f0e-edff-11e6-8a4b-7f2150c9ba2f',
zip=None}>],
has_more=True,
per_page=2,
page=1,
current_page=1,
total_pages=None)
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
- The name of this customer.email
- This customer's email address.status
- The status of this customer. One ofLead
,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.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
,Chargify
, 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:
has_more
- One oftrue
orfalse
depending on whether there are more pages with results for this request.per_page
- The number of results in this response.page
- The page number of this response.