Requires the Cost Tracker Extension to be installed and active.
What You’ll Learn
- Listing and filtering cost entries
- Creating and updating cost records
- Associating costs with sites
GET /costs
Returns all cost entries with pagination support. Method: GET (readonly)Parameters
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
page | integer | No | 1 | Page number |
per_page | integer | No | 10 | Items per page |
search | string | No | — | Search in cost name |
include | string | No | — | Comma-separated cost IDs to include |
exclude | string | No | — | Comma-separated cost IDs to exclude |
status | string | No | — | Filter by status |
category | string | No | — | Filter by category |
type | string | No | — | Filter by type |
Response
GET /costs/
Returns details about a specific cost entry. Method: GET (readonly)Parameters
| Name | Type | Required | Description |
|---|---|---|---|
cost | integer | Yes | Cost ID |
Response
PUT /costs/add
Creates a new cost entry. Method: PUTParameters
| Name | Type | Required | Description |
|---|---|---|---|
name | string | Yes | Cost name/description |
amount | number | No | Cost amount |
currency | string | No | Currency code (default: USD) |
type | string | No | one-time, subscription |
category | string | No | hosting, plugin, theme, service, other |
renewal_type | string | No | monthly, yearly, quarterly |
next_renewal | string | No | Next renewal date (Y-m-d) |
sites | string | No | Comma-separated site IDs to associate |
notes | string | No | Internal notes |
Response
PUT /costs//edit
Updates an existing cost entry. Method: PUTParameters
| Name | Type | Required | Description |
|---|---|---|---|
cost | integer | Yes | Cost ID |
name | string | No | Updated name |
amount | number | No | Updated amount |
currency | string | No | Updated currency |
type | string | No | Updated type |
category | string | No | Updated category |
renewal_type | string | No | Updated renewal type |
next_renewal | string | No | Updated next renewal date |
sites | string | No | Updated comma-separated site IDs |
notes | string | No | Updated notes |
Response
Related Resources
- REST API Overview - API basics and authentication
- Cost Tracker Extension - Extension documentation
- Sites Endpoints - Site management