Creates a metered component definition under the specified product family. A metered component can then be added and “allocated” for a subscription.
Metered components are used to bill for any type of unit that resets to 0 at the end of the billing period (think daily Google Ads clicks or monthly cell phone minutes). This is most commonly associated with usage-based billing and many other pricing schemes.
Note that this is different from recurring quantity-based components, which DO NOT reset to zero at the start of every billing period. If you want to bill for a quantity of something that does not change unless you change it, then you want quantity components, instead.
For more information on components, see our documentation here.
If you have the new Catalog experience enabled, taxable components must include a non-blank tax_code. Sending "tax_code": "" returns 422.
The username is a Maxio Chargify API key and the password is x. Basic authentication works only with the US and EU environments, which connect to chargify.com directly. The Maxio API Gateway environment does not accept Basic authentication.
In: header
Either the product family's id or its handle prefixed with handle:
application/json
TypeScript Definitions
Use the request body type in TypeScript.
application/json
application/json
curl -X POST \ --url 'https://subdomain.chargify.com/product_families/PRODUCT_FAMILY_ID/metered_components.json' \ -H 'Accept: application/json' \ -H 'Content-Type: application/json' \ -H 'Authorization: Bearer ACCESS_TOKEN' \ --data-raw '{ "metered_component": { "name": "Text messages", "unit_name": "text message", "taxable": false, "pricing_scheme": "per_unit", "prices": [ { "starting_quantity": 1, "unit_price": 1 } ] }}'