Events-Based Billing: Segments

Update Single Segment

PUT
/components/{component_id}/price_points/{price_point_id}/segments/{id}.json

Updates a single segment for a component with a segmented metric. You can also update the pricing for the segment.

You can specify component and/or price point by using either the numeric ID or the handle:gold syntax.

Authorization

BasicAuth
AuthorizationBasic <token>

The username is a Maxio Chargify API key. The password is x.

In: header

Path Parameters

component_id*string

ID or Handle of the Component

price_point_id*string

ID or Handle of the Price Point belonging to the Component

id*number

The ID of the Segment

Request Body

application/json

segment*

Response Body

application/json

application/json

curl -X PUT "https://example.com/components/string/price_points/string/segments/0.json" \  -H "Content-Type: application/json" \  -d '{    "segment": {      "pricing_scheme": "stairstep"    }  }'
{  "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      }    ]  }}