List Customer Subscriptions (grandfathered)

Returns a list of subscription objects for a given customer. Subscriptions are auto-generated from invoice objects created using the Import API.

Examples
curl -X GET "https://api.chartmogul.com/v1/import/customers/cus_f466e33d-ff2b-4a11-8f85-417eb02157a7/subscriptions" \ -u YOUR_API_KEY: \ -H "Content-Type: application/json"
ChartMogul::Subscription.all('cus_f466e33d-ff2b-4a11-8f85-417eb02157a7')
ChartMogul.Subscription.all(config, "cus_f466e33d-ff2b-4a11-8f85-417eb02157a7");
<?php ChartMogul\Subscription::all([ "customer_uuid" => "cus_f466e33d-ff2b-4a11-8f85-417eb02157a7" ]); ?>
api.ListSubscriptions(&cm.Cursor{PerPage: 2}, "cus_f466e33d-ff2b-4a11-8f85-417eb02157a7")
chartmogul.Subscription.list_imported( config, uuid="cus_f466e33d-ff2b-4a11-8f85-417eb02157a7", per_page=2)
Result Format
{ "customer_uuid": "cus_f466e33d-ff2b-4a11-8f85-417eb02157a7", "subscriptions":[ { "uuid": "sub_e6bc5407-e258-4de0-bb43-61faaf062035", "external_id": "sub_0001", "subscription_set_external_id": "set_0001", "plan_uuid": "pl_8da1caec-ee0b-11e6-a4d9-dbe62a1a1694", "data_source_uuid": "ds_fef05d54-47b4-431b-aed2-eb6b9e545430", "cancellation_dates":[] }, { "uuid": "sub_00fbccd1-084d-4eec-9805-685ddafcd399", "external_id": "sub_0002", "subscription_set_external_id": "set_0001", "plan_uuid": "pl_8da1caec-ee0b-11e6-a4d9-dbe62a1a1694", "data_source_uuid": "ds_fef05d54-47b4-431b-aed2-eb6b9e545430", "cancellation_dates":[] } ], "current_page": 1, // deprecated "total_pages": 1, // deprecated "cursor":"AjMx90kC0yMVQwNNwoYToyNC4wMDAwMDAwMDBgks68k", "has_more": true }
#<ChartMogul::Subscriptions:0x00007fc5aa9dc840 @customer_uuid="cus_f466e33d-ff2b-4a11-8f85-417eb02157a7", @subscriptions= [ #<ChartMogul::Subscription:0x00007fc5aa9dc1b0 @uuid="sub_e6bc5407-e258-4de0-bb43-61faaf062035", @external_id="sub_0001", @subscription_set_external_id="set_0001", @plan_uuid="pl_8da1caec-ee0b-11e6-a4d9-dbe62a1a1694", @data_source_uuid="ds_fef05d54-47b4-431b-aed2-eb6b9e545430", @cancellation_dates=[] > ], [ #<ChartMogul::Subscription:0x00007fc5a98c39f0 @uuid="sub_00fbccd1-084d-4eec-9805-685ddafcd399", @external_id="sub_0002", @subscription_set_external_id="set_0001", @plan_uuid="pl_8da1caec-ee0b-11e6-a4d9-dbe62a1a1694", @data_source_uuid="ds_fef05d54-47b4-431b-aed2-eb6b9e545430", @cancellation_dates=[] > ], @current_page=1, # deprecated with version 4.0.0 @total_pages=1, # deprecated with version 4.0.0 @cursor="AjMx90kC0yMVQwNNwoYToyNC4wMDAwMDAwMDBgks68k", @has_more=true >
{ "customer_uuid": "cus_f466e33d-ff2b-4a11-8f85-417eb02157a7", "subscriptions":[ { "uuid": "sub_e6bc5407-e258-4de0-bb43-61faaf062035", "external_id": "sub_0001", "subscription_set_external_id": "set_0001", "plan_uuid": "pl_8da1caec-ee0b-11e6-a4d9-dbe62a1a1694", "data_source_uuid": "ds_fef05d54-47b4-431b-aed2-eb6b9e545430", "cancellation_dates":[] }, { "uuid": "sub_00fbccd1-084d-4eec-9805-685ddafcd399", "external_id": "sub_0002", "subscription_set_external_id": "set_0001", "plan_uuid": "pl_8da1caec-ee0b-11e6-a4d9-dbe62a1a1694", "data_source_uuid": "ds_fef05d54-47b4-431b-aed2-eb6b9e545430", "cancellation_dates":[] } ], "current_page": 1, // deprecated with version 3.0.0 "total_pages": 2, // deprecated with version 3.0.0 "cursor":"AjMx90kC0yMVQwNNwoYToyNC4wMDAwMDAwMDBgks68k", "has_more": true }
<?php Doctrine\Common\Collections\ArrayCollection::__set_state(array( "elements" => array ( 0 => ChartMogul\Subscription::__set_state(array( "uuid" => "sub_e6bc5407-e258-4de0-bb43-61faaf062035", "external_id" => "sub_0001", "subscription_set_external_id" => "set_001", "cancellation_dates" => array ( ), "plan_uuid" => "pl_8da1caec-ee0b-11e6-a4d9-dbe62a1a1694", "data_source_uuid" => "ds_fef05d54-47b4-431b-aed2-eb6b9e545430", )), 1 => ChartMogul\Subscription::__set_state(array( "uuid" => "sub_00fbccd1-084d-4eec-9805-685ddafcd399", "external_id" => "sub_0002", "subscription_set_external_id" => "set_001", "cancellation_dates" => array ( ), "plan_uuid" => "pl_8da1caec-ee0b-11e6-a4d9-dbe62a1a1694", "data_source_uuid" => "ds_fef05d54-47b4-431b-aed2-eb6b9e545430", )), ), "customer_uuid" => "cus_f466e33d-ff2b-4a11-8f85-417eb02157a7", "current_page" => 1, # deprecated with version 6.0.0 "total_pages" => 2, # deprecated with version 6.0.0 "cursor" => "AjMx90kC0yMVQwNNwoYToyNC4wMDAwMDAwMDBgks68k", "has_more" => true )); ?>
(*chartmogul.Subscriptions)(0xc042088b40)({ Subscriptions: ([]chartmogul.Subscription) (len=2) { (chartmogul.Subscription) { UUID: (string) (len=40) "sub_e6bc5407-e258-4de0-bb43-61faaf062035", ExternalID: (string) (len=8) "sub_0001", SubscriptionSetExternalID: (string) (len=8) "set_0001", PlanUUID: (string) (len=39) "pl_8da1caec-ee0b-11e6-a4d9-dbe62a1a1694", CustomerUUID: (string) "", DataSourceUUID: (string) (len=39) "ds_fef05d54-47b4-431b-aed2-eb6b9e545430", CancellationDates: ([]string) { } }, (chartmogul.Subscription) { UUID: (string) (len=40) "sub_00fbccd1-084d-4eec-9805-685ddafcd399", ExternalID: (string) (len=8) "sub_0002", SubscriptionSetExternalID: (string) (len=8) "set_0001", PlanUUID: (string) (len=39) "pl_8da1caec-ee0b-11e6-a4d9-dbe62a1a1694", CustomerUUID: (string) "", DataSourceUUID: (string) (len=39) "ds_fef05d54-47b4-431b-aed2-eb6b9e545430", CancellationDates: ([]string) { } } }, CustomerUUID: (string) (len=40) "cus_f466e33d-ff2b-4a11-8f85-417eb02157a7", TotalPages: (uint32) 1, // deprecated with version v4 CurrentPage: (uint32) 1, // deprecated with version v4 Cursor: (string) (len=44) "AjMx90kC0yMVQwNNwoYToyNC4wMDAwMDAwMDBgks68k", HasMore: (bool) true })
Subscriptions(subscriptions=[ <Subscription{ cancellation_dates=[], data_source_uuid='ds_fef05d54-47b4-431b-aed2-eb6b9e545430', external_id='sub_0001', subscription_set_external_id='set_001', plan_uuid='pl_8da1caec-ee0b-11e6-a4d9-dbe62a1a1694', uuid='sub_e6bc5407-e258-4de0-bb43-61faaf062035'}>, <Subscription{ cancellation_dates=[], data_source_uuid='ds_fef05d54-47b4-431b-aed2-eb6b9e545430', external_id='sub_0002', subscription_set_external_id='set_001', plan_uuid='pl_8da1caec-ee0b-11e6-a4d9-dbe62a1a1694', uuid='sub_00fbccd1-084d-4eec-9805-685ddafcd399'}>], customer_uuid='cus_f466e33d-ff2b-4a11-8f85-417eb02157a7', current_page=1, # deprecated with version 4.0.0 total_pages=1, # deprecated with version 4.0.0 cursor='AjMx90kC0yMVQwNNwoYToyNC4wMDAwMDAwMDBgks68k', has_more=True)

In the response, the customer_uuid is the UUID of the customer whose subscriptions are listed.

subscriptions contains an array of subscription objects with the following data:

  • uuid - The UUID of the subscription object generated by ChartMogul.
  • external_id - The unique external identifier for this subscription, as specified by you.
  • subscription_set_external_id - An optional unique external identifier for the subscription set to which this subscription belongs, as specified by you.
  • plan_uuid - The UUID of the plan object generated by ChartMogul.
  • data_source_uuid - The UUID of the data source that this subscription plan belongs to.
  • cancellation_dates - An array of cancelled_at attributes specified by you. This is an array because a subscription may be re-activated and cancelled several times.

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 subscriptions. Request for next page should be initiated only if has_more is set to true indicating that there are more customer subscriptions to list.
  • has_more - One of true or false depending on whether there are more pages with results for this request.
  • total_pages - DEPRECATED The total number of pages with results for this request.
  • current_page - DEPRECATED The page number of this response.
Path Params
string
required

The ChartMogul UUID of the Customer whose subscriptions are requested.

Query Params
string

A value that fetches the next page of Customer Subscriptions. To fetch the next page of Customer Subscriptions, set cursor to the value received in the previous page response.

int32
Defaults to 200

A limit on number of subscriptions to return per page. The default and maximum value is 200.

int32
Defaults to 1

DEPRECATED The page number for pagination of results.

Language
Credentials
: