Creates a prepaid usage component definition under the specified product family. A prepaid component can then be added and “allocated” for a subscription.
Prepaid components allow customers to pre-purchase units that can be used up over time on their subscription. In a sense, they are the mirror image of metered components; while metered components charge at the end of the period for the amount of units used, prepaid components are charged for at the time of purchase, and we subsequently keep track of the usage against the amount purchased.
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/prepaid_usage_components.json' \ -H 'Accept: application/json' \ -H 'Content-Type: application/json' \ -H 'Authorization: Bearer ACCESS_TOKEN' \ --data-raw '{ "prepaid_usage_component": { "name": "Minutes", "unit_name": "minutes", "pricing_scheme": "per_unit", "unit_price": 2, "overage_pricing": { "pricing_scheme": "stairstep", "prices": [ { "starting_quantity": 1, "ending_quantity": 100, "unit_price": 3 }, { "starting_quantity": 101, "unit_price": 5 } ] }, "rollover_prepaid_remainder": true, "renew_prepaid_allocation": true, "expiration_interval": 15, "expiration_interval_unit": "day" }}'