Skip to main content
POST
Terminate Contract
A contract can have one termination that is not archived. The request fails when termination_date is before the contract start_date or in a locked period, when the contract has paid invoices after termination_date, or when posted revenue subledger lines exist after that date. Side effects
  • With a termination_date of today or earlier, DualEntry posts this termination and sets the contract status to terminated. DualEntry archives the contract invoices and revenue recognitions dated after termination_date, archives the open milestones after that date, and stops the auto-renewal of the contract obligations.
  • With a termination_date after today, DualEntry saves this termination as draft and posts it on that date.
  • A refund termination moves the remaining deferred revenue to refund_credit_account_id and stores that total in refund_amount.
  • An accelerated_recognition termination recognizes the remaining deferred revenue on termination_date.
  • An early_termination_fee above zero creates an invoice for the fee, dated termination_date.

Authorizations

Authorization
string
header
required

An access token from the DualEntry authorization server, sent as Authorization: Bearer <token>. The token acts as the user who signed in, with that user's roles and company access. Do not send an X-API-KEY header in the same request.

Headers

Idempotency-Key
string

Optional. A unique value (a UUID works well) identifying this operation. If the request is repeated with the same key, the original response is replayed instead of the operation running again, so a retry cannot create a duplicate record. Results are replayable for 48 hours. Reusing a key with a different request body returns 422.

Maximum string length: 255

Path Parameters

contract_id
integer
required

Body

application/json
termination_type
enum<string>
required
Available options:
refund,
accelerated_recognition
termination_date
string<date>
required
memo
string
default:""
Maximum string length: 512
early_termination_fee

The fee that the customer pays for the early termination. A fee above zero requires early_termination_fee_item_id.

Required range: x >= 0
early_termination_fee_item_id
integer | null

The item on the fee invoice.

Required range: x >= 1
refund_credit_account_id
integer | null

The account that DualEntry credits with the refund. A refund termination requires this field. An accelerated_recognition termination ignores it.

Required range: x >= 1

Response

Created

book_ids
integer[]
required
id
integer
required
number
integer
required
company_id
integer
required
company_name
string
required
date
string<date>
required
transaction_date
string<date>
required
memo
string
required
contract_id
integer
required
contract_name
string
required
termination_type
enum<string>
required
Available options:
refund,
accelerated_recognition
termination_date
string<date>
required
transaction_id
integer
required
record_status
enum<string>
required
Available options:
draft,
posted,
archived
created_at
string<date-time>
required

Date and time the record was created

updated_at
string<date-time>
required

Date and time the record was last updated

code
string | null
early_termination_fee
string | null
Pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d{0,2}0*$
early_termination_fee_item_id
integer | null
fee_invoice_id
integer | null
refund_amount
string | null
Pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d{0,2}0*$
refund_credit_account_id
integer | null