Skip to main content
Vindicia Knowledge Center

List (all) subscriptions

List (all) subscriptions

Retrieves a list of Subscriptions. This can be used to get a cross-account list of subscriptions, or for a given account using the “account” query parameter (see example).

Route (URL) Parameters

None.

Query Parameters

Parameter Default Description Required
limit 20 A limit on the number of objects to be returned, between 1 and 100. No
starting_after none A cursor for use in pagination. starting_after is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include starting_after=obj_foo in order to fetch the next page of the list. No
ending_before none A cursor for use in pagination. ending_before is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with obj_bar, your subsequent call can include ending_before=obj_bar in order to fetch the previous page of the list. No
include_children false Indicates whether or not to return any existing child accounts’ subscriptions for a given returned Subscription/account combination.  
account none Limit the subscription list to a specified account - if specified, all Subscriptions associated with that Account. No

Accepts

None.

Returns

JSON A list array with a data property that contains an array of up to limit Subscriptions, starting after the specified starting_after Subscription (or ending before the specified ending_before Subscription). Each entry in the array is a full Subscription object. If no more Subscriptions are available, the resulting array will be empty. This request should never throw an error.

A list of Subscription objects matching the query. Also:

  • “total_count”: Integer count of the number of Subscriptions in the returned list.

  • “url”: The query string provided in the request

  • “next”: The route (partial URL) to the next Subscription object (string to select the “next”); included id should match that of the last object returned here

  • “previous”: The route (partial URL) to the previous Subscription object (string to select the “previous”); included id should match that of the first object returned here

  • cURL
  • Java
Example Request
curl -X GET  \
-u acaff38d462f9430d5cbcbaf:a575771fc679b9de \
"https://api.prodtest.vindicia.com/subscriptions?limit=3&account=cust_2234"
The above command returns JSON structured like this:
{
    "object": "List",
    "data": [
        {
            "object": "Subscription",
            "id": "sub_1234",
            "vid": "400dc2e6524e754914d8bd40e495f05f53939ddc",
            "created": "2016-05-27T14:54:45-07:00",
            "account": {`....`},
            "billing_plan": {`...`},
            "payment_method": {`...`},
            "currency": "USD",
            "description": "Subscription_1234",
            "status": "Active",
            "billing_state": "Good Standing",
            "starts": "2016-05-27T05:52:02-07:00",
            "entitled_through": "2016-07-05T00:00:00-07:00",
            "items": {
                "object": "List",
                "data": [
                    {`...SubscriptionItem...`},
                    {`...SubscriptionItem...`}
                ],
                "total_count": 2
            },
            "billing_day": 27,
            "minimum_commitment": 0,
            "notify_on_transition": false,
            "next_billing": {`...`}
        },
        {`...Subscription...`} 
    ],
    "total_count": 2,
    "url": "/subscriptions?limit=3&account=cust_2234",
    "next": "/subscriptions?limit=3&account=cust_2234&starting_after=sub_1234x",
    "previous": "/subscriptions?limit=3&account=cust_2234&ending_before=sub_1234"
}
import com.vindicia.client.CashBox;
CashBox.apiKey = "acaff38d462f9430d5cbcbaf:a575771fc679b9de";
Map<string,> params = new HashMap<string,>();
params.put("limit",  1);
Subscription.list(params);
            
The above command returns JSON structured like this:
{
    "object": "List",
    "data": [
        {
            "object": "Subscription",
            "id": "sub_1234",
            "vid": "400dc2e6524e754914d8bd40e495f05f53939ddc",
            "created": "2016-05-27T14:54:45-07:00",
            "account": {`....`},
            "billing_plan": {`...`},
            "payment_method": {`...`},
            "currency": "USD",
            "description": "Subscription_1234",
            "status": "Active",
            "billing_state": "Good Standing",
            "starts": "2016-05-27T05:52:02-07:00",
            "entitled_through": "2016-07-05T00:00:00-07:00",
            "items": {
                "object": "List",
                "data": [
                    {`...SubscriptionItem...`},
                    {`...SubscriptionItem...`}
                ],
                "total_count": 2
            },
            "billing_day": 27,
            "minimum_commitment": 0,
            "notify_on_transition": false,
            "next_billing": {`...`}
        },
        {`...Subscription...`} 
    ],
    "total_count": 2,
    "url": "/subscriptions?limit=3&account=cust_2234",
    "next": "/subscriptions?limit=3&account=cust_2234&starting_after=sub_1234x",
    "previous": "/subscriptions?limit=3&account=cust_2234&ending_before=sub_1234"
}
            

For Users

Learn More
For Users

Cashbox Features

Learn More
Cashbox Features
Back to Top