Subscription Components

List Subscription Components for Site

GET
/subscriptions_components.json

Lists components applied to each subscription.

Authorization

BasicAuth
AuthorizationBasic <token>

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

In: header

Query Parameters

page?integer

Result records are organized in pages. By default, the first page of results is displayed. The page parameter specifies a page number of results to fetch. You can start navigating through the pages to consume the results. You do this by passing in a page parameter. Retrieve the next page by adding ?page=2 to the query string. If there are no results to return, then an empty result set will be returned. Use in query page=1.

Range1 <= value
Default1
per_page?integer

This parameter indicates how many records to fetch in each request. Default value is 20. The maximum allowed values is 200; any per_page value over 200 will be changed to 200. Use in query per_page=200.

Rangevalue <= 200
Default20
sort?List Subscription Components Sort

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

Value in

  • "id"
  • "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 For Site operation

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"
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. Use in query start_date=2011-12-15.

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. Use in query start_datetime=2022-07-01 09:00:05.

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. Use in query end_date=2011-12-16.

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. Use in query end_datetime=2022-07-01 09:00:05.

subscription_ids?array<integer>

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

Length1 <= length <= 200
Items1 <= items <= 200
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.

include?List Subscription Components Include

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

Value in

  • "subscription"
  • "historic_usages"

Response Body

application/json

curl -X GET "https://example.com/subscriptions_components.json"
{  "subscriptions_components": [    {      "id": 0,      "name": "string",      "kind": "metered_component",      "unit_name": "string",      "enabled": true,      "unit_balance": 0,      "currency": "string",      "allocated_quantity": 0,      "pricing_scheme": "stairstep",      "component_id": 0,      "component_handle": "string",      "subscription_id": 0,      "recurring": true,      "upgrade_charge": "full",      "downgrade_credit": "full",      "archived_at": null,      "price_point_id": 0,      "price_point_handle": "string",      "price_point_type": null,      "price_point_name": "string",      "product_family_id": 0,      "product_family_handle": "string",      "created_at": "2019-08-24T14:15:22Z",      "updated_at": "2019-08-24T14:15:22Z",      "use_site_exchange_rate": true,      "description": "string",      "allow_fractional_quantities": true,      "subscription": {        "state": "pending",        "updated_at": "2019-08-24T14:15:22Z"      },      "historic_usages": [        {          "total_usage_quantity": 0,          "billing_period_starts_at": "2019-08-24T14:15:22Z",          "billing_period_ends_at": "2019-08-24T14:15:22Z"        }      ],      "display_on_hosted_page": true,      "interval": 0,      "interval_unit": "day"    }  ]}