Handle Contract Termination

​

Terminate the contract, or chosen services on it (CRM-11489).

Running recurring services end on their new date with auto-renewal off and their total prorated to the shorter term, so ARR does not inflate. Services that would not have started by then are canceled and keep their dates. One-time services are never touched.

The notice, its per-service snapshot and the service writes are one transaction; the contract figures are recomputed after it commits. A contract with financialOverride keeps its figures. An end date in the past expires the contract straight away and the notice is saved as TERMINATED; otherwise it is SCHEDULED.

Status codes: 400 for a refused request (structured body, same shape as the terms flows), 403 from the Update terms gate, 404 for a missing contract.

Path Parameters

Body·

required
application/json

A termination notice for the whole contract or for chosen services.

  • When notice was given. Not in the future

  • ENTIRE_CONTRACT or PER_SERVICE

    values
    ENTIRE_CONTRACTPER_SERVICE
  • The contract's last active day. Required for ENTIRE_CONTRACT, ignored otherwise

  • Free-text notes

  • Termination reason ID

  • The recurring services to end. Required for PER_SERVICE, ignored otherwise

    Properties: 2

Responses

  • application/json
  • application/json
  • application/json
Request Example for post/{contract_id}/termination
curl 'https://crm.dreamhub.ai/api/v1/contracts/{contract_id}/termination' \
  --request POST \
  --header 'Content-Type: application/json' \
  --header 'Authorization: Bearer YOUR_SECRET_TOKEN' \
  --data '{
  "scope": "ENTIRE_CONTRACT",
  "noticeDate": "2026-11-12T20:58:40.544Z",
  "effectiveEndDate": "2026-11-12T20:58:40.544Z",
  "services": [
    {
      "revenueItemId": "",
      "endDate": "2026-11-12T20:58:40.544Z"
    }
  ],
  "reasonId": 1,
  "notes": ""
}'
{
  "id": "string",
  "contractId": "string",
  "scope": "ENTIRE_CONTRACT",
  "state": "SCHEDULED",
  "noticeDate": "2026-11-12T20:58:40.549Z",
  "effectiveEndDate": "2026-11-12T20:58:40.549Z",
  "reasonId": 1,
  "notes": "string",
  "createdBy": "string",
  "createdAt": "2026-11-12T20:58:40.549Z",
  "items": [
    {
      "revenueItemId": "string",
      "action": "END",
      "newServiceEndDate": "2026-11-12T20:58:40.549Z",
      "newTotalLocal": 1,
      "originalServiceEndDate": "2026-11-12T20:58:40.549Z",
      "originalTotalLocal": 1,
      "originalAutoRenewal": true
    }
  ]
}