curl --request DELETE \
--url https://go.aiinsurance.io/api/v1/companies/{companyId}/policies/{policyId}/transactions/{transactionId} \
--header 'Authorization: <api-key>'import requests
url = "https://go.aiinsurance.io/api/v1/companies/{companyId}/policies/{policyId}/transactions/{transactionId}"
headers = {"Authorization": "<api-key>"}
response = requests.delete(url, headers=headers)
print(response.text)const options = {method: 'DELETE', headers: {Authorization: '<api-key>'}};
fetch('https://go.aiinsurance.io/api/v1/companies/{companyId}/policies/{policyId}/transactions/{transactionId}', 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://go.aiinsurance.io/api/v1/companies/{companyId}/policies/{policyId}/transactions/{transactionId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://go.aiinsurance.io/api/v1/companies/{companyId}/policies/{policyId}/transactions/{transactionId}"
req, _ := http.NewRequest("DELETE", url, nil)
req.Header.Add("Authorization", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.delete("https://go.aiinsurance.io/api/v1/companies/{companyId}/policies/{policyId}/transactions/{transactionId}")
.header("Authorization", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://go.aiinsurance.io/api/v1/companies/{companyId}/policies/{policyId}/transactions/{transactionId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
request["Authorization"] = '<api-key>'
response = http.request(request)
puts response.read_bodyDelete Policy Transaction
Undoes the latest transaction on a policy, such as an endorsement,
cancellation or reinstatement booked in error, and rolls the policy back to
its previous version. Only the most recent transaction (highest
policyVersion) can be deleted; an older one returns a 400. To remove the
whole policy, use Delete Policy (deletePolicy).
After deletion, the policy’s data, fullTermPricingInfo and
fullTermBillingInfo are those of the version before the deleted
transaction, and its written and earned premium follow that version: the
deleted transaction’s earning entries stay in the ledger, offset by new
entries. Invoices are not rolled back. An invoice the deleted transaction
created stays active, and one it voided stays voided; change them with
Update Policy Invoices
if needed. If the only transaction (NEW_BUSINESS) is deleted, the policy
has no remaining transactions.
The delete is refused with 409 while a Quote or Event still references the
policy (DeleteBlockedByReferences).
Billing. The surviving version’s fullTermBillingInfo
becomes what the policy’s active invoices must add up to. While the policy has
active invoices, a delete that would change that billing (including leaving the
policy with none) is refused with 409 finv2-policy-undo-restates-invoices, and
nothing is deleted. Void those invoices first, or record a new transaction that
changes the billing with an invoice plan. A delete whose surviving billing gives
every line the same amount, or a policy with no active invoices, is unaffected.
Required permission: policy.delete-transaction
curl --request DELETE \
--url https://go.aiinsurance.io/api/v1/companies/{companyId}/policies/{policyId}/transactions/{transactionId} \
--header 'Authorization: <api-key>'import requests
url = "https://go.aiinsurance.io/api/v1/companies/{companyId}/policies/{policyId}/transactions/{transactionId}"
headers = {"Authorization": "<api-key>"}
response = requests.delete(url, headers=headers)
print(response.text)const options = {method: 'DELETE', headers: {Authorization: '<api-key>'}};
fetch('https://go.aiinsurance.io/api/v1/companies/{companyId}/policies/{policyId}/transactions/{transactionId}', 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://go.aiinsurance.io/api/v1/companies/{companyId}/policies/{policyId}/transactions/{transactionId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://go.aiinsurance.io/api/v1/companies/{companyId}/policies/{policyId}/transactions/{transactionId}"
req, _ := http.NewRequest("DELETE", url, nil)
req.Header.Add("Authorization", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.delete("https://go.aiinsurance.io/api/v1/companies/{companyId}/policies/{policyId}/transactions/{transactionId}")
.header("Authorization", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://go.aiinsurance.io/api/v1/companies/{companyId}/policies/{policyId}/transactions/{transactionId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
request["Authorization"] = '<api-key>'
response = http.request(request)
puts response.read_body