List Customer 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"
);
// For chartmogul-php < 2.0.0

ChartMogul\Metrics\Activities::all(
  ["customer_uuid" => "cus_3f6f53d3-bca7-4fcd-ad47-345180ef329b"]
);

// For chartmogul-php >= 2.0.0

ChartMogul\Metrics\Customers\Activities::all(
  ["customer_uuid" => "cus_3f6f53d3-bca7-4fcd-ad47-345180ef329b"]
);
// 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": "2023-06-09T13:16:00-04:00",
      "description": "purchased the Silver Monthly plan (1)",
      "id": 48730,
      "type": "new_biz",
      "plan-external-id": "99_monthly",
      "subscription-external-id": "1"
    }
    // ...and more
  ],
  "per_page": 200, // deprecated
  "page": 1, // deprecated
  "cursor": "AjMx90kC0yMVQwNNwoYToyNC4wMDAwMDAwMDBgks68k",
  "has_more": true
}
#<ChartMogul::Metrics::Activities:0x007faf03bda6f0 
  @entries=[
    #<ChartMogul::Metrics::Activity:0x007faf03bd96b0 
      @activity_arr=24000,
      @activity_mrr=2000,
      @activity_mrr_movement=2000,
      @currency="USD",
      @currency_sign="$",
      @date=2023-06-09 13:16:00 -04:00,
      @description="purchased the Silver Monthly plan (1)", 
      @id=48730,
      @type="new_biz",
      @subscription_external_id="1"
    >, 
    # ...and more
  ], 
  @per_page=200,   # deprecated with version 4.0.0
  @page=1,  # deprecated with version 4.0.0
  @cursor="AjMx90kC0yMVQwNNwoYToyNC4wMDAwMDAwMDBgks68k",
  @has_more=true
>
{
  entries: [
    {
      "activity-arr": 24000,
      "activity-mrr": 2000,
      "activity-mrr-movement": 2000,
      currency: "USD",
      "currency-sign": "$",
      date: "2023-06-09T13:16:00-04:00",
      description: "purchased the Silver Monthly plan (1)",
      id: 48730,
      type: "new_biz",
      "plan-external-id": "99_monthly",
      "subscription-external-id": "1",
    },
    // ...and more
  ],
  per_page: 200, // deprecated
  page: 1, // deprecated
  cursor: "AjMx90kC0yMVQwNNwoYToyNC4wMDAwMDAwMDBgks68k",
  has_more: true,
}
// For chartmogul-php < 2.0.0

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" => "2023-06-09T13:16:00-04:00",
        "description" => "purchased the Silver Monthly plan (1)",
        "id" => 48730,
        "type" => "new_biz",
        "subscription-external-id" => "1"
      ))
    ),
    // ...and more
  )),
  "per_page" => 200,  # deprecated with version 6.0.0
  "page" => 1,  # deprecated with version 6.0.0
  "cursor" => "AjMx90kC0yMVQwNNwoYToyNC4wMDAwMDAwMDBgks68k",
  "has_more" => true
));
// For chartmogul-go < 2.0.0

(*chartmogul.MetricsActivities)(0xc042042f30)({
  Entries: ([]*chartmogul.MetricsActivity) (len=1) {
   (*chartmogul.MetricsActivity)(0xc0421ae1c0)({
    ID: (uint64) 48730,
    Date: (string) (len=25) "2023-06-09T13:16:00-04:00",
    ActivityArr: (float64) 24000,
    ActivityMrr: (float64) 2000,
    ActivityMrrMovement: (float64) 2000,
    Currency: (string) (len=3) "USD",
    CurrencySign: (string) (len=1) "$",
    Description: (string) (len=57) "purchased the Silver Monthly plan (1)",
    Type: (string) (len=7) "new_biz",
     SubscriptionExternalId: (string) (len=1) "1"
   }),
   // ...and more
  },
  PerPage: (uint32) 1,   // deprecated with version v4
  Page: (uint32) 1,   // deprecated with version v4
  Cursor: (string) (len=44) "AjMx90kC0yMVQwNNwoYToyNC4wMDAwMDAwMDBgks68k",
  HasMore: (bool) true
})
Activities(
  entries=[
    <Activity{
      activity_arr=24000.0, 
      activity_mrr=2000.0, 
      activity_mrr_movement=2000.0, 
      currency="USD", 
      currency_sign="$", 
      date=datetime.datetime(2023, 6, 9, 13, 16), 
      description="purchased the Silver Monthly plan (1)", 
      id=8913316, 
      type="new_biz",
      subscription-external-id="1"
    }>,
    # ...and more
  ], 
  per_page=1,  # deprecated with version 4.0.0
  page=1,   # deprecated with version 4.0.0
  cursor="AjMx90kC0yMVQwNNwoYToyNC4wMDAwMDAwMDBgks68k",
  has_more=True
)

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 or EUR
  • 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 activity
  • type - The type of the activity. One of new_biz, churn, expansion,
    contraction or reactivation.
  • 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:

  • cursor - A value that should be used in the next API request to fetch the next page of customer activities. Request for next page should be initiated only if has_more is set to true indicating that there are more customer activities to list.
  • has_more - One of true or false 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.
Language
Credentials
Basic
base64
: