Use the MainWP Postman collection as the source of truth for request and response schemas.
Cost endpoints require the built-in Cost Tracker module to be enabled.
Route Matrix
Key Request Fields
Common write fields (create/edit):name,price,payment_type,license_type,product_type,product_slugrenewal_type,last_renewal,payment_method,cost_tracker_statusurl,note, visual fields likeproduct_color,icon_hidden- Relationship selectors:
sites,groups(tag IDs), andclients, each as a JSON array of integer IDs
sites, groups, and clients in the same request; all supplied selectors are saved and their linked sites are combined.
/costs/{id} routes, the URL identifies the cost. A conflicting id in the body or query string does not redirect the operation to another cost. /costs/add always creates a new cost rather than updating a body-supplied id; batch updates identify their target through each item’s id.
