curl --request POST \
--url https://api.meetcampfire.com/rr/api/v1/contracts/{id}/terminate \
--header 'Content-Type: application/json' \
--data '
{
"termination_date": "2023-12-25",
"void_invoice_ids": [
123
],
"void_date": "2023-12-25",
"reverse_remaining_revenue": false
}
'import requests
url = "https://api.meetcampfire.com/rr/api/v1/contracts/{id}/terminate"
payload = {
"termination_date": "2023-12-25",
"void_invoice_ids": [123],
"void_date": "2023-12-25",
"reverse_remaining_revenue": False
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
termination_date: '2023-12-25',
void_invoice_ids: [123],
void_date: '2023-12-25',
reverse_remaining_revenue: false
})
};
fetch('https://api.meetcampfire.com/rr/api/v1/contracts/{id}/terminate', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.meetcampfire.com/rr/api/v1/contracts/{id}/terminate",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'termination_date' => '2023-12-25',
'void_invoice_ids' => [
123
],
'void_date' => '2023-12-25',
'reverse_remaining_revenue' => false
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.meetcampfire.com/rr/api/v1/contracts/{id}/terminate"
payload := strings.NewReader("{\n \"termination_date\": \"2023-12-25\",\n \"void_invoice_ids\": [\n 123\n ],\n \"void_date\": \"2023-12-25\",\n \"reverse_remaining_revenue\": false\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.meetcampfire.com/rr/api/v1/contracts/{id}/terminate")
.header("Content-Type", "application/json")
.body("{\n \"termination_date\": \"2023-12-25\",\n \"void_invoice_ids\": [\n 123\n ],\n \"void_date\": \"2023-12-25\",\n \"reverse_remaining_revenue\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.meetcampfire.com/rr/api/v1/contracts/{id}/terminate")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"termination_date\": \"2023-12-25\",\n \"void_invoice_ids\": [\n 123\n ],\n \"void_date\": \"2023-12-25\",\n \"reverse_remaining_revenue\": false\n}"
response = http.request(request)
puts response.read_body{
"contract_terminated": true,
"contract_draft_id": 123,
"voided_invoice_ids": [
123
],
"drafted_invoice_ids": [
123
],
"credit_memo_id": 123,
"reversal_transaction_count": 0
}Terminate Contract
Terminate a contract and optionally void associated invoices.
If the user has permission to terminate contracts and void invoices, both operations are performed atomically. If the user lacks permission for either operation, a draft is created instead, and the response indicates which operations were drafted.
Returns 400 if any of the provided void_invoice_ids are invalid (not found, already voided, has payments, void date is before the invoice date, or in a closed period).
curl --request POST \
--url https://api.meetcampfire.com/rr/api/v1/contracts/{id}/terminate \
--header 'Content-Type: application/json' \
--data '
{
"termination_date": "2023-12-25",
"void_invoice_ids": [
123
],
"void_date": "2023-12-25",
"reverse_remaining_revenue": false
}
'import requests
url = "https://api.meetcampfire.com/rr/api/v1/contracts/{id}/terminate"
payload = {
"termination_date": "2023-12-25",
"void_invoice_ids": [123],
"void_date": "2023-12-25",
"reverse_remaining_revenue": False
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
termination_date: '2023-12-25',
void_invoice_ids: [123],
void_date: '2023-12-25',
reverse_remaining_revenue: false
})
};
fetch('https://api.meetcampfire.com/rr/api/v1/contracts/{id}/terminate', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.meetcampfire.com/rr/api/v1/contracts/{id}/terminate",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'termination_date' => '2023-12-25',
'void_invoice_ids' => [
123
],
'void_date' => '2023-12-25',
'reverse_remaining_revenue' => false
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.meetcampfire.com/rr/api/v1/contracts/{id}/terminate"
payload := strings.NewReader("{\n \"termination_date\": \"2023-12-25\",\n \"void_invoice_ids\": [\n 123\n ],\n \"void_date\": \"2023-12-25\",\n \"reverse_remaining_revenue\": false\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.meetcampfire.com/rr/api/v1/contracts/{id}/terminate")
.header("Content-Type", "application/json")
.body("{\n \"termination_date\": \"2023-12-25\",\n \"void_invoice_ids\": [\n 123\n ],\n \"void_date\": \"2023-12-25\",\n \"reverse_remaining_revenue\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.meetcampfire.com/rr/api/v1/contracts/{id}/terminate")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"termination_date\": \"2023-12-25\",\n \"void_invoice_ids\": [\n 123\n ],\n \"void_date\": \"2023-12-25\",\n \"reverse_remaining_revenue\": false\n}"
response = http.request(request)
puts response.read_body{
"contract_terminated": true,
"contract_draft_id": 123,
"voided_invoice_ids": [
123
],
"drafted_invoice_ids": [
123
],
"credit_memo_id": 123,
"reversal_transaction_count": 0
}Path Parameters
Body
List of invoice IDs to void atomically when terminating the contract.
Date to use when voiding invoices. Required when void_invoice_ids is provided.
When true, the remaining subscription schedule after the termination date is cancelled with offsetting negative revenue transactions instead of being deleted, and a credit memo is created if the contract carries deferred revenue. Not supported for evergreen contracts.
Response
Response serializer for contract termination with hints about drafted operations.
Whether the contract was terminated directly (True) or drafted (False).
Draft queue ID if contract termination was drafted instead of executed.
List of invoice IDs that were voided directly.
List of invoice IDs that were drafted for voiding (user lacks void permission).
ID of the credit memo created for deferred revenue when remaining revenue was reversed.
Number of negative revenue transactions written to cancel the remaining schedule.