Subscription Components

List Allocations

GET
/subscriptions/{subscription_id}/components/{component_id}/allocations.json

Lists the 50 most recent Allocations, ordered by most recent first.

On/Off Components

When a subscription's on/off component has been toggled to on (1) or off (0), usage will be logged in this 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.

component_id*integer

The Advanced Billing id of the component

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

Response Body

application/json

application/json

curl -X GET "https://example.com/subscriptions/0/components/0/allocations.json"
[  {    "allocation": {      "allocation_id": 2370199,      "component_id": 41028,      "subscription_id": 352827,      "quantity": 10,      "previous_quantity": 0,      "memo": "Recoding component allocation",      "timestamp": "2024-02-28T09:31:05Z",      "proration_upgrade_scheme": "full-price-attempt-capture",      "proration_downgrade_scheme": "no-prorate",      "price_point_id": 2957424,      "price_point_handle": "uuid:03190e20-b84a-013c-ca77-0286551bb34f",      "price_point_name": "Original",      "previous_price_point_id": 2957424,      "component_handle": "test-prepaid-component-4982065948",      "accrue_charge": false,      "upgrade_charge": "full",      "downgrade_credit": "none",      "created_at": "2024-02-28T04:31:05-05:00",      "initiate_dunning": false,      "expires_at": "2024-08-03T20:00:00-04:00",      "used_quantity": 5,      "charge_id": 11586076    }  },  {    "allocation": {      "memo": null,      "timestamp": "2012-11-20T21:48:09Z",      "quantity": 3,      "previous_quantity": 0,      "component_id": 11960,      "subscription_id": 2585595,      "proration_upgrade_scheme": "no-prorate",      "proration_downgrade_scheme": "no-prorate"    }  }]

Bulk Reset Subscription Components' Price Points POST

Resets all of a subscription's components to use the current default. **Note**: this will update the price point for all of the subscription's components, even ones that have not been allocated yet.

Allocate Component POST

Creates an allocation, sets the current allocated quantity for the component, and records a memo. Allocations can only be updated for Quantity, On/Off, and Prepaid Components. When creating an allocation via the API, you can pass the `upgrade_charge`, `downgrade_credit`, and `accrue_charge` to be applied. > **Note:** These proration and accrual fields are ignored for Prepaid Components since this component type always generates charges immediately without proration. For information on prorated components and upgrade/downgrade schemes, see [Setting Component Allocations.](https://maxio.zendesk.com/hc/en-us/articles/24251906165133-Component-Allocations-Proration) ### Order of Resolution for upgrade_charge and downgrade_credit 1. Per allocation in API call (within a single allocation of the `allocations` array) 2. [Component-level default value](https://maxio.zendesk.com/hc/en-us/articles/24251883961485-Component-Allocations-Overview) 3. Allocation API call top level (outside of the `allocations` array) 4. [Site-level default value](https://maxio.zendesk.com/hc/en-us/articles/24251906165133-Component-Allocations-Proration#proration-schemes) ### Order of Resolution for accrue charge 1. Allocation API call top level (outside of the `allocations` array) 2. [Site-level default value](https://maxio.zendesk.com/hc/en-us/articles/24251906165133-Component-Allocations-Proration#proration-schemes) > **Note:** Proration uses the current price of the component as well as the current tax rates. Changes to either may cause the prorated charge/credit to be wrong. For more information, see the [Component Allocations](https://maxio.zendesk.com/hc/en-us/articles/24251883961485-Component-Allocations-Overview) product Documentation.