Accept Invoice Deletions
curl --request POST \
--url https://webhooks.nest.vet/api/v1/invoice-deletions \
--header 'Content-Type: application/json' \
--header 'Idempotency-Key: <idempotency-key>' \
--header 'X-Organization-Id: <x-organization-id>' \
--data '
{
"invoices": [
{
"invoice_id": "<string>",
"clinic_id": "<string>",
"client_id": "<string>"
}
],
"invoice_lines": [
{
"invoice_line_id": "<string>",
"invoice_id": "<string>",
"clinic_id": "<string>"
}
]
}
'import requests
url = "https://webhooks.nest.vet/api/v1/invoice-deletions"
payload = {
"invoices": [
{
"invoice_id": "<string>",
"clinic_id": "<string>",
"client_id": "<string>"
}
],
"invoice_lines": [
{
"invoice_line_id": "<string>",
"invoice_id": "<string>",
"clinic_id": "<string>"
}
]
}
headers = {
"Idempotency-Key": "<idempotency-key>",
"X-Organization-Id": "<x-organization-id>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'Idempotency-Key': '<idempotency-key>',
'X-Organization-Id': '<x-organization-id>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
invoices: [{invoice_id: '<string>', clinic_id: '<string>', client_id: '<string>'}],
invoice_lines: [{invoice_line_id: '<string>', invoice_id: '<string>', clinic_id: '<string>'}]
})
};
fetch('https://webhooks.nest.vet/api/v1/invoice-deletions', 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://webhooks.nest.vet/api/v1/invoice-deletions",
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([
'invoices' => [
[
'invoice_id' => '<string>',
'clinic_id' => '<string>',
'client_id' => '<string>'
]
],
'invoice_lines' => [
[
'invoice_line_id' => '<string>',
'invoice_id' => '<string>',
'clinic_id' => '<string>'
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"Idempotency-Key: <idempotency-key>",
"X-Organization-Id: <x-organization-id>"
],
]);
$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://webhooks.nest.vet/api/v1/invoice-deletions"
payload := strings.NewReader("{\n \"invoices\": [\n {\n \"invoice_id\": \"<string>\",\n \"clinic_id\": \"<string>\",\n \"client_id\": \"<string>\"\n }\n ],\n \"invoice_lines\": [\n {\n \"invoice_line_id\": \"<string>\",\n \"invoice_id\": \"<string>\",\n \"clinic_id\": \"<string>\"\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Idempotency-Key", "<idempotency-key>")
req.Header.Add("X-Organization-Id", "<x-organization-id>")
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://webhooks.nest.vet/api/v1/invoice-deletions")
.header("Idempotency-Key", "<idempotency-key>")
.header("X-Organization-Id", "<x-organization-id>")
.header("Content-Type", "application/json")
.body("{\n \"invoices\": [\n {\n \"invoice_id\": \"<string>\",\n \"clinic_id\": \"<string>\",\n \"client_id\": \"<string>\"\n }\n ],\n \"invoice_lines\": [\n {\n \"invoice_line_id\": \"<string>\",\n \"invoice_id\": \"<string>\",\n \"clinic_id\": \"<string>\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://webhooks.nest.vet/api/v1/invoice-deletions")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Idempotency-Key"] = '<idempotency-key>'
request["X-Organization-Id"] = '<x-organization-id>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"invoices\": [\n {\n \"invoice_id\": \"<string>\",\n \"clinic_id\": \"<string>\",\n \"client_id\": \"<string>\"\n }\n ],\n \"invoice_lines\": [\n {\n \"invoice_line_id\": \"<string>\",\n \"invoice_id\": \"<string>\",\n \"clinic_id\": \"<string>\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"status": "scheduled",
"task_id": "<string>",
"scheduled_for": "2023-11-07T05:31:56Z",
"idempotency_key": "<string>",
"invoices_count": 123,
"invoice_lines_count": 123,
"received_at": "2023-11-07T05:31:56Z"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Headers
Unique key for this webhook delivery used to deduplicate scheduling (max 36 chars).
Identifier of the organization/tenant that owns the invoice data.
Body
Collection of invoice-level deletions. When provided, all invoice lines for the invoice will also be marked as deleted.
Show child attributes
Show child attributes
Collection of individual invoice line deletions. May be supplied without invoice-level deletions or alongside them.
Show child attributes
Show child attributes
Response
Successful Response
Scheduling outcome for this deletion webhook delivery; semantics mirror WebhookInvoicesResponse (with 'completed' reserved for future use).
scheduled, duplicate, completed, error Deterministic Cloud Tasks identifier derived from organization and Idempotency-Key.
UTC timestamp when the deletion task is scheduled to run.
Opaque deduplication key supplied via Idempotency-Key header (max 36 chars).
1 - 36Number of invoice records included in the deletion payload.
Number of invoice-line records included in the deletion payload.
UTC timestamp when the webhook was received by the service.
curl --request POST \
--url https://webhooks.nest.vet/api/v1/invoice-deletions \
--header 'Content-Type: application/json' \
--header 'Idempotency-Key: <idempotency-key>' \
--header 'X-Organization-Id: <x-organization-id>' \
--data '
{
"invoices": [
{
"invoice_id": "<string>",
"clinic_id": "<string>",
"client_id": "<string>"
}
],
"invoice_lines": [
{
"invoice_line_id": "<string>",
"invoice_id": "<string>",
"clinic_id": "<string>"
}
]
}
'import requests
url = "https://webhooks.nest.vet/api/v1/invoice-deletions"
payload = {
"invoices": [
{
"invoice_id": "<string>",
"clinic_id": "<string>",
"client_id": "<string>"
}
],
"invoice_lines": [
{
"invoice_line_id": "<string>",
"invoice_id": "<string>",
"clinic_id": "<string>"
}
]
}
headers = {
"Idempotency-Key": "<idempotency-key>",
"X-Organization-Id": "<x-organization-id>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'Idempotency-Key': '<idempotency-key>',
'X-Organization-Id': '<x-organization-id>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
invoices: [{invoice_id: '<string>', clinic_id: '<string>', client_id: '<string>'}],
invoice_lines: [{invoice_line_id: '<string>', invoice_id: '<string>', clinic_id: '<string>'}]
})
};
fetch('https://webhooks.nest.vet/api/v1/invoice-deletions', 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://webhooks.nest.vet/api/v1/invoice-deletions",
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([
'invoices' => [
[
'invoice_id' => '<string>',
'clinic_id' => '<string>',
'client_id' => '<string>'
]
],
'invoice_lines' => [
[
'invoice_line_id' => '<string>',
'invoice_id' => '<string>',
'clinic_id' => '<string>'
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"Idempotency-Key: <idempotency-key>",
"X-Organization-Id: <x-organization-id>"
],
]);
$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://webhooks.nest.vet/api/v1/invoice-deletions"
payload := strings.NewReader("{\n \"invoices\": [\n {\n \"invoice_id\": \"<string>\",\n \"clinic_id\": \"<string>\",\n \"client_id\": \"<string>\"\n }\n ],\n \"invoice_lines\": [\n {\n \"invoice_line_id\": \"<string>\",\n \"invoice_id\": \"<string>\",\n \"clinic_id\": \"<string>\"\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Idempotency-Key", "<idempotency-key>")
req.Header.Add("X-Organization-Id", "<x-organization-id>")
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://webhooks.nest.vet/api/v1/invoice-deletions")
.header("Idempotency-Key", "<idempotency-key>")
.header("X-Organization-Id", "<x-organization-id>")
.header("Content-Type", "application/json")
.body("{\n \"invoices\": [\n {\n \"invoice_id\": \"<string>\",\n \"clinic_id\": \"<string>\",\n \"client_id\": \"<string>\"\n }\n ],\n \"invoice_lines\": [\n {\n \"invoice_line_id\": \"<string>\",\n \"invoice_id\": \"<string>\",\n \"clinic_id\": \"<string>\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://webhooks.nest.vet/api/v1/invoice-deletions")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Idempotency-Key"] = '<idempotency-key>'
request["X-Organization-Id"] = '<x-organization-id>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"invoices\": [\n {\n \"invoice_id\": \"<string>\",\n \"clinic_id\": \"<string>\",\n \"client_id\": \"<string>\"\n }\n ],\n \"invoice_lines\": [\n {\n \"invoice_line_id\": \"<string>\",\n \"invoice_id\": \"<string>\",\n \"clinic_id\": \"<string>\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"status": "scheduled",
"task_id": "<string>",
"scheduled_for": "2023-11-07T05:31:56Z",
"idempotency_key": "<string>",
"invoices_count": 123,
"invoice_lines_count": 123,
"received_at": "2023-11-07T05:31:56Z"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}