Subscription Components

List Subscription Components

GET
/subscriptions/{subscription_id}/components.json

Lists a subscription's applied components.

Archived Components

When requesting to list components for a given subscription, if the subscription contains archived components they will be listed in the server response.

Authorization

BasicAuth
AuthorizationBasic <token>

The username is a Maxio Chargify API key. The password is x.

In: header

Path Parameters

subscription_id*integer

The Chargify id of the subscription.

Query Parameters

date_field?"updated_at"

The type of filter you'd like to apply to your search. Use in query date_field=updated_at.

Value in

  • "updated_at"
direction?Sorting direction

Controls the order in which results are returned. Use in query direction=asc.

Value in

  • "asc"
  • "desc"
filter?

Filter to use for List Subscription Components operation

end_date?string

The end date (format YYYY-MM-DD) with which to filter the date_field. Returns components with a timestamp up to and including 11:59:59PM in your site’s time zone on the date specified.

end_datetime?string

The end date and time (format YYYY-MM-DD HH:MM:SS) with which to filter the date_field. Returns components with a timestamp at or before exact time provided in query. You can specify timezone in query - otherwise your site''s time zone will be used. If provided, this parameter will be used instead of end_date.

price_point_ids?"not_null"

Allows fetching components allocation only if price point id is present. Use in query price_point_ids=not_null.

Value in

  • "not_null"
product_family_ids?array<integer>

Allows fetching components allocation with matching product family id based on provided ids. Use in query product_family_ids=1,2,3.

sort?List Subscription Components Sort

The attribute by which to sort. Use in query sort=updated_at.

Value in

  • "id"
  • "updated_at"
start_date?string

The start date (format YYYY-MM-DD) with which to filter the date_field. Returns components with a timestamp at or after midnight (12:00:00 AM) in your site’s time zone on the date specified.

start_datetime?string

The start date and time (format YYYY-MM-DD HH:MM:SS) with which to filter the date_field. Returns components with a timestamp at or after exact time provided in query. You can specify timezone in query - otherwise your site''s time zone will be used. If provided, this parameter will be used instead of start_date.

include?array<>

Allows including additional data in the response. Use in query include=subscription,historic_usages.

in_use?boolean

If in_use is set to true, it returns only components that are currently in use. However, if it's set to false or not provided, it returns all components connected with the subscription.

Response Body

application/json

curl -X GET "https://example.com/subscriptions/0/components.json?in_use=true"
[  {    "component": {      "component_id": 0,      "subscription_id": 0,      "allocated_quantity": 0,      "pricing_scheme": "per_unit",      "name": "string",      "kind": "quantity_based_component",      "unit_name": "string",      "price_point_id": 0,      "price_point_handle": "string",      "price_point_type": "default",      "price_point_name": "string",      "enabled": true,      "unit_balance": 0,      "id": 0,      "created_at": "2022-02-22T14:07:00-05:00",      "updated_at": "2022-02-22T14:07:00-05:00",      "component_handle": "string",      "archived_at": null    }  }]