This endpoint returns the 50 most recent Allocations, ordered by most recent first.
When a subscription's on/off component has been toggled to on (1
) or off (0
), usage will be logged in this response.
You can also query the current quantity via the official Advanced Billing Gem.
component = Chargify::Subscription::Component.find(1, :params => {:subscription_id => 7}) puts component.allocated_quantity # => 23 # Second way component = Chargify::Subscription.find(7).component(1) puts component.allocated_quantity # => 23
GET /subscriptions/{subscription_id}/components/{component_id}/allocations.json
This endpoint requires BasicAuth
OK
application/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"
}
}
]
curl -X GET -G \
--url 'https://subdomain.chargify.com/subscriptions/222/components/222/allocations.json' \
-H 'Accept: application/json' \
-d 'page=2'