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
| Method | Path | Purpose | Key Params |
|---|---|---|---|
| GET | /costs | List costs | page, per_page, search, include, exclude, status, category, type |
| POST, PUT, PATCH | /costs/add | Create a cost | name, price, payment_type, product_type, renewal_type, one of sites/groups/clients |
| GET | /costs/{id} | Get one cost | id |
| POST, PUT, PATCH | /costs/{id}/edit | Edit a cost | Same fields as add |
| DELETE | /costs/{id}/remove | Remove a cost | id |
| GET | /costs/{id}/sites | List sites linked to a cost | id |
| GET | /costs/{id}/clients | List clients linked to a cost | id |
| POST | /costs/batch | Batch cost create/update/delete | create[], update[], delete[] |
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[], orclients[]
sites, groups, or clients) is required.