Create Single Segment
Creates a new segment for a component with a segmented metric. It allows you to specify properties to bill upon and prices for each Segment. You can only pass as many "property_values" as the related Metric has segmenting properties defined.
You may specify component and/or price point by using either the numeric ID or the handle:gold syntax.
Authorization
BasicAuth The username is a Maxio Chargify API key. The password is x.
In: header
Path Parameters
ID or Handle for the Component
ID or Handle for the Price Point belonging to the Component
Request Body
application/json
Response Body
application/json
application/json
curl -X POST "https://example.com/components/string/price_points/string/segments.json" \ -H "Content-Type: application/json" \ -d '{ "segment": { "segment_property_1_value": "France", "segment_property_2_value": "Spain", "pricing_scheme": "volume", "prices": [ { "starting_quantity": 1, "ending_quantity": 10000, "unit_price": 0.19 }, { "starting_quantity": 10001, "unit_price": 0.09 } ] } }'{ "segment": { "id": 0, "component_id": 0, "price_point_id": 0, "event_based_billing_metric_id": 0, "pricing_scheme": "stairstep", "segment_property_1_value": "string", "segment_property_2_value": "string", "segment_property_3_value": "string", "segment_property_4_value": "string", "created_at": "2019-08-24T14:15:22Z", "updated_at": "2019-08-24T14:15:22Z", "prices": [ { "id": 0, "component_id": 0, "starting_quantity": 0, "ending_quantity": 0, "unit_price": "string", "price_point_id": 0, "formatted_unit_price": "string", "segment_id": 0 } ] }}List Segments for a Price Point GET
Lists segments created for a given price point, in order of creation. You can pass `page` and `per_page` parameters in order to access all of the segments. By default it will return `30` records. You can set `per_page` to `200` at most. You may specify component and/or price point by using either the numeric ID or the `handle:gold` syntax.
Delete Single Segment DELETE
Deletes a segment with the specified ID. You may specify component and/or price point by using either the numeric ID or the `handle:gold` syntax.