get https://api.chartmogul.com/v1/customers//activities
Returns a list of activities for a given customer.
Examples
curl -X GET "https://api.chartmogul.com/v1/customers/cus_58c7d166-3bd1-4c10-948e-e68bb0fa2478/activities" \
-u YOUR_API_KEY:
# For chartmogul-ruby < 2.0.0
ChartMogul::Metrics::Activity.all('cus_58c7d166-3bd1-4c10-948e-e68bb0fa2478')
# For chartmogul-ruby >= 2.0.0
ChartMogul::Metrics::Customers::Activity.all('cus_58c7d166-3bd1-4c10-948e-e68bb0fa2478')
ChartMogul.Metrics.Customer.activities(config, "cus_3f6f53d3-bca7-4fcd-ad47-345180ef329b", function (err, res) {
// asynchronously called
});
// For chartmogul-php < 2.0.0
<?php
ChartMogul\Metrics\Activities::all(
["customer_uuid" => "cus_3f6f53d3-bca7-4fcd-ad47-345180ef329b"]
);
?>
// For chartmogul-php >= 2.0.0
<?php
ChartMogul\Metrics\Customers\Activities::all([
"customer_uuid" => $cus->uuid
]);
?>
// For chartmogul-go < 2.0.0
api.MetricsListActivities(&cm.Cursor{PerPage: 1},
"cus_922c2672-ee04-11e6-bea8-7fac984477db")
// For chartmogul-go >= 2.0.0
api.MetricsListCustomerActivities(&cm.Cursor{PerPage: 1},
"cus_922c2672-ee04-11e6-bea8-7fac984477db")
# For chartmogul-python < 2.0.0
chartmogul.Activity.all(
config,
uuid="cus_922c2672-ee04-11e6-bea8-7fac984477db",
per_page=1)
# For chartmogul-python >= 2.0.0
chartmogul.CustomerActivity.all(
config,
uuid="cus_922c2672-ee04-11e6-bea8-7fac984477db",
per_page=1)
Result Format
{
"entries":[
{
"activity-arr": 24000,
"activity-mrr": 2000,
"activity-mrr-movement": 2000,
"currency": "USD",
"currency-sign": "$",
"date": "2015-06-09T13:16:00-04:00",
"description": "purchased the Silver Monthly plan (1)",
"id": 48730,
"type": "new_biz",
"subscription-external-id": "1"
},
{"...more...": "...entries..."}
],
"has_more":false,
"per_page":200,
"page":1
}
#<ChartMogul::Metrics::Activities:0x007faf03bda6f0
@entries=[
#<ChartMogul::Metrics::Activity:0x007faf03bd96b0
@activity_arr=24000,
@activity_mrr=2000,
@activity_mrr_movement=2000,
@currency="USD",
@currency_sign="$",
@date=2015-06-09 13:16:00 -04:00,
@description="purchased the Silver Monthly plan (1)",
@id=48730,
@type="new_biz",
@subscription_external_id="1"
>,
<...more entries...>
],
@has_more=false,
@per_page=200,
@page=1
>
{
"entries":[
{
"activity-arr": 24000,
"activity-mrr": 2000,
"activity-mrr-movement": 2000,
"currency": "USD",
"currency-sign": "$",
"date": "2015-06-09T13:16:00-04:00",
"description": "purchased the Silver Monthly plan (1)",
"id": 48730,
"type": "new_biz",
"subscription-external-id": "1"
},
{"...more...": "...entries..."}
],
"has_more":false,
"per_page":200,
"page":1
}
// For chartmogul-php < 2.0.0
<?php
ChartMogul\Metrics\Subscriptions::__set_state(array(
"entries" =>
Doctrine\Common\Collections\ArrayCollection::__set_state(array(
"elements" =>
array (
ChartMogul\Metrics\Activity::__set_state(array(
"activity-arr" => 24000,
"activity-mrr" => 2000,
"activity-mrr-movement" => 2000,
"currency" => "USD",
"currency-sign" => "$",
"date" => "2015-06-09T13:16:00-04:00",
"description" => "purchased the Silver Monthly plan (1)",
"id" => 48730,
"type" => "new_biz",
"subscription-external-id" => "1"
))
),
)),
"has_more" => false,
"per_page" => 200,
"page" => 1,
))
?>
// For chartmogul-go < 2.0.0
(*chartmogul.MetricsActivities)(0xc042042f30)({
Entries: ([]*chartmogul.MetricsActivity) (len=1) {
(*chartmogul.MetricsActivity)(0xc0421ae1c0)({
ID: (uint64) 8913316,
Date: (string) (len=25) "2015-11-01T00:00:00+00:00",
ActivityArr: (float64) 49200,
ActivityMrr: (float64) 4100,
ActivityMrrMovement: (float64) 4100,
Currency: (string) (len=3) "USD",
CurrencySign: (string) (len=1) "$",
Description: (string) (len=57) "purchased the Gold Plan plan with $10.00 discount applied",
Type: (string) (len=7) "new_biz",
SubscriptionExternalId: (string) (len=1) "1"
})
},
HasMore: (bool) false,
PerPage: (uint32) 1,
Page: (uint32) 1
})
Activities(entries=[
<Activity{
activity_arr=49200.0,
activity_mrr=4100.0,
activity_mrr_movement=4100.0,
currency='USD',
currency_sign='$',
date=datetime.datetime(2015, 11, 1, 0, 0),
description='purchased the Gold Plan plan with $10.00 discount applied',
id=8913316,
type='new_biz',
subscription-external-id='1'}>],
has_more=False,
per_page=1,
page=1)
In the response, entries
contains an object for each activity, with the following data:
activity-arr
- The new ARR after the activity has occurred.activity-mrr
- The new MRR after the activity has occurred.activity-mrr-movement
- The change in MRR as a result of the activity. May
be a positive or negative number. All amounts are expressed as an integer number
of cents in your account currency. Divide by 100 to obtain the actual amount.currency
- the code representing your account currency, e.g.USD
orEUR
currency-sign
- textual representation of the currency sign, e.g.$
or€
date
- The timestamp of when the activity occurred.description
- a description of the activity.id
- ChartMogul's identifier for the activitytype
- The type of the activity. One ofnew_biz
,churn
,expansion
,
contraction
orreactivation
.subscription-external-id
- The unique external identifier for the activity's primary subscription. This is usually the subscription identifier from your billing system.
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.