Skip to main content
Revenue entries do not have dedicated PUT/DELETE endpoints. Instead, editing and deleting are exposed as state-machine (FSM) actions on the revenue object type, the same pattern used for invoice line items. You first ask which actions are available for a revenue entry, then perform the chosen action as a transition.
Availability. EDIT and DELETE are only offered for a revenue entry when both conditions hold:
  • the revenue’s parent invoice is in the draft state, and
  • the revenue’s type is not unbilled (i.e. billed or deferred_without_date).
For any other revenue entry the actions endpoint returns an empty list and a transition attempt is rejected. Unbilled revenue is managed through the invoice line item Mark as Unbilled / Mark as Billed flow, not edited directly.
Admin-only. Editing and deleting revenue require admin access — the caller must hold RevenueService:updateRevenue / RevenueService:deleteRevenue (granted to AdminAccess) in addition to FsmService:transition. A SystemUser token can create and read revenue but cannot edit or delete it.The actions endpoint is not role-filtered, so a non-admin caller may still see EDIT / DELETE listed — the transition itself is rejected (Access denied) without the mutation permission.

1. Get available actions

Fetch the actions that can currently be performed on a revenue entry.
curl --request GET \
  --url https://api.getenso.ai/objects/revenue/{revenueId}/actions \
  --header 'Authorization: Bearer <token>'
When editing/deleting is allowed, the response includes the EDIT and DELETE actions (with EDIT’s editable fields); otherwise the list is empty.
[
  {
    "eventType": "EDIT",
    "label": "Edit",
    "fields": [
      { "name": "value", "type": "text", "required": true },
      { "name": "startDate", "type": "date", "required": false },
      { "name": "endDate", "type": "date", "required": false }
    ]
  },
  { "eventType": "DELETE", "label": "Delete" }
]
Required policy action: FsmService:getActions. See Get object actions.

2. Edit a revenue entry

Send an EDIT transition with the new values. value is required; startDate and endDate are optional (omit both for deferred_without_date revenue). When both dates are provided, startDate must be on or before endDate.
curl --request POST \
  --url https://api.getenso.ai/objects/revenue/{revenueId}/transition \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
    "action": "EDIT",
    "value": 1200.00,
    "startDate": "2026-01-01",
    "endDate": "2026-01-31"
  }'
Required policy actions: FsmService:transition and RevenueService:updateRevenue (AdminAccess). See Transition object state.

3. Delete a revenue entry

Send a DELETE transition. No additional fields are required.
curl --request POST \
  --url https://api.getenso.ai/objects/revenue/{revenueId}/transition \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{ "action": "DELETE" }'
Required policy actions: FsmService:transition and RevenueService:deleteRevenue (AdminAccess). See Transition object state.