List Allocations

API Docs by APIMATIC
Advanced Billing APIAPI EndpointsSubscription Components

List Allocations
#

This endpoint returns 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.

Querying data via Advanced Billing gem

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
Authentication

This endpoint requires BasicAuth

BasicAuth
BasicAuth
Required

Set authorization parameters for BasicAuth

Required
string

The username to use with basic authentication

  • is a required field
Required
string

The password to use with basic authentication

  • is a required field

API Code Playground

Endpoint Arguments
Parameters
Required
Required
Number
Template

The Chargify id of the subscription

Required
Number
Template

The Advanced Billing id of the component

Number
Query

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.

Default: 1

Constraints: >= 1


Responses

  • 200
  • 404
  • 422

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"
    }
  }
]
  • HTTP
  • Java
  • .NET
  • PHP
  • Python
  • Ruby
  • TypeScript
  • Go
  • Request
  • Response
curl -X GET -G \
  --url 'https://subdomain.chargify.com/subscriptions/222/components/222/allocations.json'  \
  -H 'Accept: application/json' \
  -d 'page=2'