Update an Invoice by ID
curl --request PATCH \
--url https://api.zivio.net/api/v3/invoices/{id} \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--header 'zivio-tenant-id: <api-key>' \
--data '
{
"id": "1",
"status": "draft",
"job_id": "23",
"job_summary": "Some text about the project",
"net_total": "16000.00",
"tax_total": "2000.00",
"total": "18000.00",
"ccy": "GBP",
"due_on": "2023-11-07T05:31:56Z",
"milestone_id": "435",
"line_item_sheet_id": "234",
"credit_note_id": "124",
"is_credit_note": "null",
"credit_note_reason": "invoice paid in error",
"invoice_items": [
{
"id": "1",
"invoice_id": "123",
"milestone_id": "3654",
"line_item_sheet_id": "3645",
"purchase_order_line_id": "284",
"description": "Some text about the item",
"quantity": "10.0",
"unit_type": "milestone",
"billing_start": "YYYY-MM-DD",
"billing_end": "YYYY-MM-DD",
"ccy": "GBP",
"unit_cost": "30000.00",
"net_total_price": "30000.00",
"tax_rate": "20.0",
"tax_total": "6000.00",
"total_price": "36000.00",
"tax_type": {
"id": "123",
"label": "UK VAT",
"key": "cis_registered_contractors_deduction",
"rate": "20.0",
"country_code": "GB",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"archived": "false",
"custom_fields": {
"key": "value"
}
}
}
],
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"approved_at": "2023-11-07T05:31:56Z",
"approved_by": {
"id": "7158",
"first_name": "Jack",
"last_name": "Jones",
"email": "jack_jones@example.com",
"org_name": "Organisation Ltd",
"org_id": "567",
"business_unit": "Public Private Partnerships",
"division": "Infastructure",
"department": "Bridges",
"vetting_status": "PASSED",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"custom_fields": {
"key": "value"
},
"has_oversight": "<string>"
},
"client": {
"id": "7158",
"first_name": "Jack",
"last_name": "Jones",
"email": "jack_jones@example.com",
"org_name": "Organisation Ltd",
"org_id": "567",
"business_unit": "Public Private Partnerships",
"division": "Infastructure",
"department": "Bridge Building",
"vetting_status": "PASSED",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"custom_fields": {
"key": "value"
},
"has_oversight": "<string>"
},
"client_org": {
"id": "7158",
"name": "Company Ltd",
"is_external_client": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
},
"supplier": {
"id": "77",
"name": "Company Inc",
"email": "jack_jones@companyinc.com",
"vetting_status": "PASSED",
"tax_number": "9876543234",
"tax_registered": "true",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}
}
'import requests
url = "https://api.zivio.net/api/v3/invoices/{id}"
payload = {
"id": "1",
"status": "draft",
"job_id": "23",
"job_summary": "Some text about the project",
"net_total": "16000.00",
"tax_total": "2000.00",
"total": "18000.00",
"ccy": "GBP",
"due_on": "2023-11-07T05:31:56Z",
"milestone_id": "435",
"line_item_sheet_id": "234",
"credit_note_id": "124",
"is_credit_note": "null",
"credit_note_reason": "invoice paid in error",
"invoice_items": [
{
"id": "1",
"invoice_id": "123",
"milestone_id": "3654",
"line_item_sheet_id": "3645",
"purchase_order_line_id": "284",
"description": "Some text about the item",
"quantity": "10.0",
"unit_type": "milestone",
"billing_start": "YYYY-MM-DD",
"billing_end": "YYYY-MM-DD",
"ccy": "GBP",
"unit_cost": "30000.00",
"net_total_price": "30000.00",
"tax_rate": "20.0",
"tax_total": "6000.00",
"total_price": "36000.00",
"tax_type": {
"id": "123",
"label": "UK VAT",
"key": "cis_registered_contractors_deduction",
"rate": "20.0",
"country_code": "GB",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"archived": "false",
"custom_fields": { "key": "value" }
}
}
],
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"approved_at": "2023-11-07T05:31:56Z",
"approved_by": {
"id": "7158",
"first_name": "Jack",
"last_name": "Jones",
"email": "jack_jones@example.com",
"org_name": "Organisation Ltd",
"org_id": "567",
"business_unit": "Public Private Partnerships",
"division": "Infastructure",
"department": "Bridges",
"vetting_status": "PASSED",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"custom_fields": { "key": "value" },
"has_oversight": "<string>"
},
"client": {
"id": "7158",
"first_name": "Jack",
"last_name": "Jones",
"email": "jack_jones@example.com",
"org_name": "Organisation Ltd",
"org_id": "567",
"business_unit": "Public Private Partnerships",
"division": "Infastructure",
"department": "Bridge Building",
"vetting_status": "PASSED",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"custom_fields": { "key": "value" },
"has_oversight": "<string>"
},
"client_org": {
"id": "7158",
"name": "Company Ltd",
"is_external_client": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
},
"supplier": {
"id": "77",
"name": "Company Inc",
"email": "jack_jones@companyinc.com",
"vetting_status": "PASSED",
"tax_number": "9876543234",
"tax_registered": "true",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}
}
headers = {
"X-API-Key": "<api-key>",
"zivio-tenant-id": "<api-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {
'X-API-Key': '<api-key>',
'zivio-tenant-id': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
id: '1',
status: 'draft',
job_id: '23',
job_summary: 'Some text about the project',
net_total: '16000.00',
tax_total: '2000.00',
total: '18000.00',
ccy: 'GBP',
due_on: '2023-11-07T05:31:56Z',
milestone_id: '435',
line_item_sheet_id: '234',
credit_note_id: '124',
is_credit_note: 'null',
credit_note_reason: 'invoice paid in error',
invoice_items: [
{
id: '1',
invoice_id: '123',
milestone_id: '3654',
line_item_sheet_id: '3645',
purchase_order_line_id: '284',
description: 'Some text about the item',
quantity: '10.0',
unit_type: 'milestone',
billing_start: 'YYYY-MM-DD',
billing_end: 'YYYY-MM-DD',
ccy: 'GBP',
unit_cost: '30000.00',
net_total_price: '30000.00',
tax_rate: '20.0',
tax_total: '6000.00',
total_price: '36000.00',
tax_type: {
id: '123',
label: 'UK VAT',
key: 'cis_registered_contractors_deduction',
rate: '20.0',
country_code: 'GB',
created_at: '2023-11-07T05:31:56Z',
updated_at: '2023-11-07T05:31:56Z',
archived: 'false',
custom_fields: {key: 'value'}
}
}
],
created_at: '2023-11-07T05:31:56Z',
updated_at: '2023-11-07T05:31:56Z',
approved_at: '2023-11-07T05:31:56Z',
approved_by: {
id: '7158',
first_name: 'Jack',
last_name: 'Jones',
email: 'jack_jones@example.com',
org_name: 'Organisation Ltd',
org_id: '567',
business_unit: 'Public Private Partnerships',
division: 'Infastructure',
department: 'Bridges',
vetting_status: 'PASSED',
created_at: '2023-11-07T05:31:56Z',
updated_at: '2023-11-07T05:31:56Z',
custom_fields: {key: 'value'},
has_oversight: '<string>'
},
client: {
id: '7158',
first_name: 'Jack',
last_name: 'Jones',
email: 'jack_jones@example.com',
org_name: 'Organisation Ltd',
org_id: '567',
business_unit: 'Public Private Partnerships',
division: 'Infastructure',
department: 'Bridge Building',
vetting_status: 'PASSED',
created_at: '2023-11-07T05:31:56Z',
updated_at: '2023-11-07T05:31:56Z',
custom_fields: {key: 'value'},
has_oversight: '<string>'
},
client_org: {
id: '7158',
name: 'Company Ltd',
is_external_client: '<string>',
created_at: '2023-11-07T05:31:56Z',
updated_at: '2023-11-07T05:31:56Z'
},
supplier: {
id: '77',
name: 'Company Inc',
email: 'jack_jones@companyinc.com',
vetting_status: 'PASSED',
tax_number: '9876543234',
tax_registered: 'true',
created_at: '2023-11-07T05:31:56Z',
updated_at: '2023-11-07T05:31:56Z'
}
})
};
fetch('https://api.zivio.net/api/v3/invoices/{id}', 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.zivio.net/api/v3/invoices/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'id' => '1',
'status' => 'draft',
'job_id' => '23',
'job_summary' => 'Some text about the project',
'net_total' => '16000.00',
'tax_total' => '2000.00',
'total' => '18000.00',
'ccy' => 'GBP',
'due_on' => '2023-11-07T05:31:56Z',
'milestone_id' => '435',
'line_item_sheet_id' => '234',
'credit_note_id' => '124',
'is_credit_note' => 'null',
'credit_note_reason' => 'invoice paid in error',
'invoice_items' => [
[
'id' => '1',
'invoice_id' => '123',
'milestone_id' => '3654',
'line_item_sheet_id' => '3645',
'purchase_order_line_id' => '284',
'description' => 'Some text about the item',
'quantity' => '10.0',
'unit_type' => 'milestone',
'billing_start' => 'YYYY-MM-DD',
'billing_end' => 'YYYY-MM-DD',
'ccy' => 'GBP',
'unit_cost' => '30000.00',
'net_total_price' => '30000.00',
'tax_rate' => '20.0',
'tax_total' => '6000.00',
'total_price' => '36000.00',
'tax_type' => [
'id' => '123',
'label' => 'UK VAT',
'key' => 'cis_registered_contractors_deduction',
'rate' => '20.0',
'country_code' => 'GB',
'created_at' => '2023-11-07T05:31:56Z',
'updated_at' => '2023-11-07T05:31:56Z',
'archived' => 'false',
'custom_fields' => [
'key' => 'value'
]
]
]
],
'created_at' => '2023-11-07T05:31:56Z',
'updated_at' => '2023-11-07T05:31:56Z',
'approved_at' => '2023-11-07T05:31:56Z',
'approved_by' => [
'id' => '7158',
'first_name' => 'Jack',
'last_name' => 'Jones',
'email' => 'jack_jones@example.com',
'org_name' => 'Organisation Ltd',
'org_id' => '567',
'business_unit' => 'Public Private Partnerships',
'division' => 'Infastructure',
'department' => 'Bridges',
'vetting_status' => 'PASSED',
'created_at' => '2023-11-07T05:31:56Z',
'updated_at' => '2023-11-07T05:31:56Z',
'custom_fields' => [
'key' => 'value'
],
'has_oversight' => '<string>'
],
'client' => [
'id' => '7158',
'first_name' => 'Jack',
'last_name' => 'Jones',
'email' => 'jack_jones@example.com',
'org_name' => 'Organisation Ltd',
'org_id' => '567',
'business_unit' => 'Public Private Partnerships',
'division' => 'Infastructure',
'department' => 'Bridge Building',
'vetting_status' => 'PASSED',
'created_at' => '2023-11-07T05:31:56Z',
'updated_at' => '2023-11-07T05:31:56Z',
'custom_fields' => [
'key' => 'value'
],
'has_oversight' => '<string>'
],
'client_org' => [
'id' => '7158',
'name' => 'Company Ltd',
'is_external_client' => '<string>',
'created_at' => '2023-11-07T05:31:56Z',
'updated_at' => '2023-11-07T05:31:56Z'
],
'supplier' => [
'id' => '77',
'name' => 'Company Inc',
'email' => 'jack_jones@companyinc.com',
'vetting_status' => 'PASSED',
'tax_number' => '9876543234',
'tax_registered' => 'true',
'created_at' => '2023-11-07T05:31:56Z',
'updated_at' => '2023-11-07T05:31:56Z'
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-Key: <api-key>",
"zivio-tenant-id: <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"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.zivio.net/api/v3/invoices/{id}"
payload := strings.NewReader("{\n \"id\": \"1\",\n \"status\": \"draft\",\n \"job_id\": \"23\",\n \"job_summary\": \"Some text about the project\",\n \"net_total\": \"16000.00\",\n \"tax_total\": \"2000.00\",\n \"total\": \"18000.00\",\n \"ccy\": \"GBP\",\n \"due_on\": \"2023-11-07T05:31:56Z\",\n \"milestone_id\": \"435\",\n \"line_item_sheet_id\": \"234\",\n \"credit_note_id\": \"124\",\n \"is_credit_note\": \"null\",\n \"credit_note_reason\": \"invoice paid in error\",\n \"invoice_items\": [\n {\n \"id\": \"1\",\n \"invoice_id\": \"123\",\n \"milestone_id\": \"3654\",\n \"line_item_sheet_id\": \"3645\",\n \"purchase_order_line_id\": \"284\",\n \"description\": \"Some text about the item\",\n \"quantity\": \"10.0\",\n \"unit_type\": \"milestone\",\n \"billing_start\": \"YYYY-MM-DD\",\n \"billing_end\": \"YYYY-MM-DD\",\n \"ccy\": \"GBP\",\n \"unit_cost\": \"30000.00\",\n \"net_total_price\": \"30000.00\",\n \"tax_rate\": \"20.0\",\n \"tax_total\": \"6000.00\",\n \"total_price\": \"36000.00\",\n \"tax_type\": {\n \"id\": \"123\",\n \"label\": \"UK VAT\",\n \"key\": \"cis_registered_contractors_deduction\",\n \"rate\": \"20.0\",\n \"country_code\": \"GB\",\n \"created_at\": \"2023-11-07T05:31:56Z\",\n \"updated_at\": \"2023-11-07T05:31:56Z\",\n \"archived\": \"false\",\n \"custom_fields\": {\n \"key\": \"value\"\n }\n }\n }\n ],\n \"created_at\": \"2023-11-07T05:31:56Z\",\n \"updated_at\": \"2023-11-07T05:31:56Z\",\n \"approved_at\": \"2023-11-07T05:31:56Z\",\n \"approved_by\": {\n \"id\": \"7158\",\n \"first_name\": \"Jack\",\n \"last_name\": \"Jones\",\n \"email\": \"jack_jones@example.com\",\n \"org_name\": \"Organisation Ltd\",\n \"org_id\": \"567\",\n \"business_unit\": \"Public Private Partnerships\",\n \"division\": \"Infastructure\",\n \"department\": \"Bridges\",\n \"vetting_status\": \"PASSED\",\n \"created_at\": \"2023-11-07T05:31:56Z\",\n \"updated_at\": \"2023-11-07T05:31:56Z\",\n \"custom_fields\": {\n \"key\": \"value\"\n },\n \"has_oversight\": \"<string>\"\n },\n \"client\": {\n \"id\": \"7158\",\n \"first_name\": \"Jack\",\n \"last_name\": \"Jones\",\n \"email\": \"jack_jones@example.com\",\n \"org_name\": \"Organisation Ltd\",\n \"org_id\": \"567\",\n \"business_unit\": \"Public Private Partnerships\",\n \"division\": \"Infastructure\",\n \"department\": \"Bridge Building\",\n \"vetting_status\": \"PASSED\",\n \"created_at\": \"2023-11-07T05:31:56Z\",\n \"updated_at\": \"2023-11-07T05:31:56Z\",\n \"custom_fields\": {\n \"key\": \"value\"\n },\n \"has_oversight\": \"<string>\"\n },\n \"client_org\": {\n \"id\": \"7158\",\n \"name\": \"Company Ltd\",\n \"is_external_client\": \"<string>\",\n \"created_at\": \"2023-11-07T05:31:56Z\",\n \"updated_at\": \"2023-11-07T05:31:56Z\"\n },\n \"supplier\": {\n \"id\": \"77\",\n \"name\": \"Company Inc\",\n \"email\": \"jack_jones@companyinc.com\",\n \"vetting_status\": \"PASSED\",\n \"tax_number\": \"9876543234\",\n \"tax_registered\": \"true\",\n \"created_at\": \"2023-11-07T05:31:56Z\",\n \"updated_at\": \"2023-11-07T05:31:56Z\"\n }\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("X-API-Key", "<api-key>")
req.Header.Add("zivio-tenant-id", "<api-key>")
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.patch("https://api.zivio.net/api/v3/invoices/{id}")
.header("X-API-Key", "<api-key>")
.header("zivio-tenant-id", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"id\": \"1\",\n \"status\": \"draft\",\n \"job_id\": \"23\",\n \"job_summary\": \"Some text about the project\",\n \"net_total\": \"16000.00\",\n \"tax_total\": \"2000.00\",\n \"total\": \"18000.00\",\n \"ccy\": \"GBP\",\n \"due_on\": \"2023-11-07T05:31:56Z\",\n \"milestone_id\": \"435\",\n \"line_item_sheet_id\": \"234\",\n \"credit_note_id\": \"124\",\n \"is_credit_note\": \"null\",\n \"credit_note_reason\": \"invoice paid in error\",\n \"invoice_items\": [\n {\n \"id\": \"1\",\n \"invoice_id\": \"123\",\n \"milestone_id\": \"3654\",\n \"line_item_sheet_id\": \"3645\",\n \"purchase_order_line_id\": \"284\",\n \"description\": \"Some text about the item\",\n \"quantity\": \"10.0\",\n \"unit_type\": \"milestone\",\n \"billing_start\": \"YYYY-MM-DD\",\n \"billing_end\": \"YYYY-MM-DD\",\n \"ccy\": \"GBP\",\n \"unit_cost\": \"30000.00\",\n \"net_total_price\": \"30000.00\",\n \"tax_rate\": \"20.0\",\n \"tax_total\": \"6000.00\",\n \"total_price\": \"36000.00\",\n \"tax_type\": {\n \"id\": \"123\",\n \"label\": \"UK VAT\",\n \"key\": \"cis_registered_contractors_deduction\",\n \"rate\": \"20.0\",\n \"country_code\": \"GB\",\n \"created_at\": \"2023-11-07T05:31:56Z\",\n \"updated_at\": \"2023-11-07T05:31:56Z\",\n \"archived\": \"false\",\n \"custom_fields\": {\n \"key\": \"value\"\n }\n }\n }\n ],\n \"created_at\": \"2023-11-07T05:31:56Z\",\n \"updated_at\": \"2023-11-07T05:31:56Z\",\n \"approved_at\": \"2023-11-07T05:31:56Z\",\n \"approved_by\": {\n \"id\": \"7158\",\n \"first_name\": \"Jack\",\n \"last_name\": \"Jones\",\n \"email\": \"jack_jones@example.com\",\n \"org_name\": \"Organisation Ltd\",\n \"org_id\": \"567\",\n \"business_unit\": \"Public Private Partnerships\",\n \"division\": \"Infastructure\",\n \"department\": \"Bridges\",\n \"vetting_status\": \"PASSED\",\n \"created_at\": \"2023-11-07T05:31:56Z\",\n \"updated_at\": \"2023-11-07T05:31:56Z\",\n \"custom_fields\": {\n \"key\": \"value\"\n },\n \"has_oversight\": \"<string>\"\n },\n \"client\": {\n \"id\": \"7158\",\n \"first_name\": \"Jack\",\n \"last_name\": \"Jones\",\n \"email\": \"jack_jones@example.com\",\n \"org_name\": \"Organisation Ltd\",\n \"org_id\": \"567\",\n \"business_unit\": \"Public Private Partnerships\",\n \"division\": \"Infastructure\",\n \"department\": \"Bridge Building\",\n \"vetting_status\": \"PASSED\",\n \"created_at\": \"2023-11-07T05:31:56Z\",\n \"updated_at\": \"2023-11-07T05:31:56Z\",\n \"custom_fields\": {\n \"key\": \"value\"\n },\n \"has_oversight\": \"<string>\"\n },\n \"client_org\": {\n \"id\": \"7158\",\n \"name\": \"Company Ltd\",\n \"is_external_client\": \"<string>\",\n \"created_at\": \"2023-11-07T05:31:56Z\",\n \"updated_at\": \"2023-11-07T05:31:56Z\"\n },\n \"supplier\": {\n \"id\": \"77\",\n \"name\": \"Company Inc\",\n \"email\": \"jack_jones@companyinc.com\",\n \"vetting_status\": \"PASSED\",\n \"tax_number\": \"9876543234\",\n \"tax_registered\": \"true\",\n \"created_at\": \"2023-11-07T05:31:56Z\",\n \"updated_at\": \"2023-11-07T05:31:56Z\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.zivio.net/api/v3/invoices/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["X-API-Key"] = '<api-key>'
request["zivio-tenant-id"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"id\": \"1\",\n \"status\": \"draft\",\n \"job_id\": \"23\",\n \"job_summary\": \"Some text about the project\",\n \"net_total\": \"16000.00\",\n \"tax_total\": \"2000.00\",\n \"total\": \"18000.00\",\n \"ccy\": \"GBP\",\n \"due_on\": \"2023-11-07T05:31:56Z\",\n \"milestone_id\": \"435\",\n \"line_item_sheet_id\": \"234\",\n \"credit_note_id\": \"124\",\n \"is_credit_note\": \"null\",\n \"credit_note_reason\": \"invoice paid in error\",\n \"invoice_items\": [\n {\n \"id\": \"1\",\n \"invoice_id\": \"123\",\n \"milestone_id\": \"3654\",\n \"line_item_sheet_id\": \"3645\",\n \"purchase_order_line_id\": \"284\",\n \"description\": \"Some text about the item\",\n \"quantity\": \"10.0\",\n \"unit_type\": \"milestone\",\n \"billing_start\": \"YYYY-MM-DD\",\n \"billing_end\": \"YYYY-MM-DD\",\n \"ccy\": \"GBP\",\n \"unit_cost\": \"30000.00\",\n \"net_total_price\": \"30000.00\",\n \"tax_rate\": \"20.0\",\n \"tax_total\": \"6000.00\",\n \"total_price\": \"36000.00\",\n \"tax_type\": {\n \"id\": \"123\",\n \"label\": \"UK VAT\",\n \"key\": \"cis_registered_contractors_deduction\",\n \"rate\": \"20.0\",\n \"country_code\": \"GB\",\n \"created_at\": \"2023-11-07T05:31:56Z\",\n \"updated_at\": \"2023-11-07T05:31:56Z\",\n \"archived\": \"false\",\n \"custom_fields\": {\n \"key\": \"value\"\n }\n }\n }\n ],\n \"created_at\": \"2023-11-07T05:31:56Z\",\n \"updated_at\": \"2023-11-07T05:31:56Z\",\n \"approved_at\": \"2023-11-07T05:31:56Z\",\n \"approved_by\": {\n \"id\": \"7158\",\n \"first_name\": \"Jack\",\n \"last_name\": \"Jones\",\n \"email\": \"jack_jones@example.com\",\n \"org_name\": \"Organisation Ltd\",\n \"org_id\": \"567\",\n \"business_unit\": \"Public Private Partnerships\",\n \"division\": \"Infastructure\",\n \"department\": \"Bridges\",\n \"vetting_status\": \"PASSED\",\n \"created_at\": \"2023-11-07T05:31:56Z\",\n \"updated_at\": \"2023-11-07T05:31:56Z\",\n \"custom_fields\": {\n \"key\": \"value\"\n },\n \"has_oversight\": \"<string>\"\n },\n \"client\": {\n \"id\": \"7158\",\n \"first_name\": \"Jack\",\n \"last_name\": \"Jones\",\n \"email\": \"jack_jones@example.com\",\n \"org_name\": \"Organisation Ltd\",\n \"org_id\": \"567\",\n \"business_unit\": \"Public Private Partnerships\",\n \"division\": \"Infastructure\",\n \"department\": \"Bridge Building\",\n \"vetting_status\": \"PASSED\",\n \"created_at\": \"2023-11-07T05:31:56Z\",\n \"updated_at\": \"2023-11-07T05:31:56Z\",\n \"custom_fields\": {\n \"key\": \"value\"\n },\n \"has_oversight\": \"<string>\"\n },\n \"client_org\": {\n \"id\": \"7158\",\n \"name\": \"Company Ltd\",\n \"is_external_client\": \"<string>\",\n \"created_at\": \"2023-11-07T05:31:56Z\",\n \"updated_at\": \"2023-11-07T05:31:56Z\"\n },\n \"supplier\": {\n \"id\": \"77\",\n \"name\": \"Company Inc\",\n \"email\": \"jack_jones@companyinc.com\",\n \"vetting_status\": \"PASSED\",\n \"tax_number\": \"9876543234\",\n \"tax_registered\": \"true\",\n \"created_at\": \"2023-11-07T05:31:56Z\",\n \"updated_at\": \"2023-11-07T05:31:56Z\"\n }\n}"
response = http.request(request)
puts response.read_body{
"id": "1",
"status": "draft",
"job_id": "23",
"job_summary": "Some text about the project",
"net_total": "16000.00",
"tax_total": "2000.00",
"total": "18000.00",
"ccy": "GBP",
"due_on": "2023-11-07T05:31:56Z",
"dated_on": "2023-11-07T05:31:56Z",
"milestone_id": "435",
"line_item_sheet_id": "234",
"credit_note_id": "124",
"is_credit_note": "null",
"credit_note_reason": "invoice paid in error",
"invoice_items": [
{
"id": "1",
"invoice_id": "123",
"milestone_id": "3654",
"line_item_sheet_id": "3645",
"purchase_order_line_id": "284",
"description": "Some text about the item",
"quantity": "10.0",
"unit_type": "milestone",
"billing_start": "YYYY-MM-DD",
"billing_end": "YYYY-MM-DD",
"ccy": "GBP",
"unit_cost": "30000.00",
"net_total_price": "30000.00",
"tax_rate": "20.0",
"tax_total": "6000.00",
"total_price": "36000.00",
"tax_type": {
"id": "123",
"label": "UK VAT",
"key": "cis_registered_contractors_deduction",
"rate": "20.0",
"country_code": "GB",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"archived": "false",
"custom_fields": {
"key": "value"
}
}
}
],
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"approved_at": "2023-11-07T05:31:56Z",
"approved_by": {
"id": "7158",
"first_name": "Jack",
"last_name": "Jones",
"email": "jack_jones@example.com",
"org_name": "Organisation Ltd",
"org_id": "567",
"business_unit": "Public Private Partnerships",
"division": "Infastructure",
"department": "Bridges",
"vetting_status": "PASSED",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"custom_fields": {
"key": "value"
},
"has_oversight": "<string>"
},
"client": {
"id": "7158",
"first_name": "Jack",
"last_name": "Jones",
"email": "jack_jones@example.com",
"org_name": "Organisation Ltd",
"org_id": "567",
"business_unit": "Public Private Partnerships",
"division": "Infastructure",
"department": "Bridge Building",
"vetting_status": "PASSED",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"custom_fields": {
"key": "value"
},
"has_oversight": "<string>"
},
"client_org": {
"id": "7158",
"name": "Company Ltd",
"is_external_client": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
},
"supplier": {
"id": "77",
"name": "Company Inc",
"email": "jack_jones@companyinc.com",
"vetting_status": "PASSED",
"tax_number": "9876543234",
"tax_registered": "true",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}
}Invoices
Update an Invoice by ID
PATCH
/
invoices
/
{id}
Update an Invoice by ID
curl --request PATCH \
--url https://api.zivio.net/api/v3/invoices/{id} \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--header 'zivio-tenant-id: <api-key>' \
--data '
{
"id": "1",
"status": "draft",
"job_id": "23",
"job_summary": "Some text about the project",
"net_total": "16000.00",
"tax_total": "2000.00",
"total": "18000.00",
"ccy": "GBP",
"due_on": "2023-11-07T05:31:56Z",
"milestone_id": "435",
"line_item_sheet_id": "234",
"credit_note_id": "124",
"is_credit_note": "null",
"credit_note_reason": "invoice paid in error",
"invoice_items": [
{
"id": "1",
"invoice_id": "123",
"milestone_id": "3654",
"line_item_sheet_id": "3645",
"purchase_order_line_id": "284",
"description": "Some text about the item",
"quantity": "10.0",
"unit_type": "milestone",
"billing_start": "YYYY-MM-DD",
"billing_end": "YYYY-MM-DD",
"ccy": "GBP",
"unit_cost": "30000.00",
"net_total_price": "30000.00",
"tax_rate": "20.0",
"tax_total": "6000.00",
"total_price": "36000.00",
"tax_type": {
"id": "123",
"label": "UK VAT",
"key": "cis_registered_contractors_deduction",
"rate": "20.0",
"country_code": "GB",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"archived": "false",
"custom_fields": {
"key": "value"
}
}
}
],
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"approved_at": "2023-11-07T05:31:56Z",
"approved_by": {
"id": "7158",
"first_name": "Jack",
"last_name": "Jones",
"email": "jack_jones@example.com",
"org_name": "Organisation Ltd",
"org_id": "567",
"business_unit": "Public Private Partnerships",
"division": "Infastructure",
"department": "Bridges",
"vetting_status": "PASSED",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"custom_fields": {
"key": "value"
},
"has_oversight": "<string>"
},
"client": {
"id": "7158",
"first_name": "Jack",
"last_name": "Jones",
"email": "jack_jones@example.com",
"org_name": "Organisation Ltd",
"org_id": "567",
"business_unit": "Public Private Partnerships",
"division": "Infastructure",
"department": "Bridge Building",
"vetting_status": "PASSED",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"custom_fields": {
"key": "value"
},
"has_oversight": "<string>"
},
"client_org": {
"id": "7158",
"name": "Company Ltd",
"is_external_client": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
},
"supplier": {
"id": "77",
"name": "Company Inc",
"email": "jack_jones@companyinc.com",
"vetting_status": "PASSED",
"tax_number": "9876543234",
"tax_registered": "true",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}
}
'import requests
url = "https://api.zivio.net/api/v3/invoices/{id}"
payload = {
"id": "1",
"status": "draft",
"job_id": "23",
"job_summary": "Some text about the project",
"net_total": "16000.00",
"tax_total": "2000.00",
"total": "18000.00",
"ccy": "GBP",
"due_on": "2023-11-07T05:31:56Z",
"milestone_id": "435",
"line_item_sheet_id": "234",
"credit_note_id": "124",
"is_credit_note": "null",
"credit_note_reason": "invoice paid in error",
"invoice_items": [
{
"id": "1",
"invoice_id": "123",
"milestone_id": "3654",
"line_item_sheet_id": "3645",
"purchase_order_line_id": "284",
"description": "Some text about the item",
"quantity": "10.0",
"unit_type": "milestone",
"billing_start": "YYYY-MM-DD",
"billing_end": "YYYY-MM-DD",
"ccy": "GBP",
"unit_cost": "30000.00",
"net_total_price": "30000.00",
"tax_rate": "20.0",
"tax_total": "6000.00",
"total_price": "36000.00",
"tax_type": {
"id": "123",
"label": "UK VAT",
"key": "cis_registered_contractors_deduction",
"rate": "20.0",
"country_code": "GB",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"archived": "false",
"custom_fields": { "key": "value" }
}
}
],
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"approved_at": "2023-11-07T05:31:56Z",
"approved_by": {
"id": "7158",
"first_name": "Jack",
"last_name": "Jones",
"email": "jack_jones@example.com",
"org_name": "Organisation Ltd",
"org_id": "567",
"business_unit": "Public Private Partnerships",
"division": "Infastructure",
"department": "Bridges",
"vetting_status": "PASSED",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"custom_fields": { "key": "value" },
"has_oversight": "<string>"
},
"client": {
"id": "7158",
"first_name": "Jack",
"last_name": "Jones",
"email": "jack_jones@example.com",
"org_name": "Organisation Ltd",
"org_id": "567",
"business_unit": "Public Private Partnerships",
"division": "Infastructure",
"department": "Bridge Building",
"vetting_status": "PASSED",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"custom_fields": { "key": "value" },
"has_oversight": "<string>"
},
"client_org": {
"id": "7158",
"name": "Company Ltd",
"is_external_client": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
},
"supplier": {
"id": "77",
"name": "Company Inc",
"email": "jack_jones@companyinc.com",
"vetting_status": "PASSED",
"tax_number": "9876543234",
"tax_registered": "true",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}
}
headers = {
"X-API-Key": "<api-key>",
"zivio-tenant-id": "<api-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {
'X-API-Key': '<api-key>',
'zivio-tenant-id': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
id: '1',
status: 'draft',
job_id: '23',
job_summary: 'Some text about the project',
net_total: '16000.00',
tax_total: '2000.00',
total: '18000.00',
ccy: 'GBP',
due_on: '2023-11-07T05:31:56Z',
milestone_id: '435',
line_item_sheet_id: '234',
credit_note_id: '124',
is_credit_note: 'null',
credit_note_reason: 'invoice paid in error',
invoice_items: [
{
id: '1',
invoice_id: '123',
milestone_id: '3654',
line_item_sheet_id: '3645',
purchase_order_line_id: '284',
description: 'Some text about the item',
quantity: '10.0',
unit_type: 'milestone',
billing_start: 'YYYY-MM-DD',
billing_end: 'YYYY-MM-DD',
ccy: 'GBP',
unit_cost: '30000.00',
net_total_price: '30000.00',
tax_rate: '20.0',
tax_total: '6000.00',
total_price: '36000.00',
tax_type: {
id: '123',
label: 'UK VAT',
key: 'cis_registered_contractors_deduction',
rate: '20.0',
country_code: 'GB',
created_at: '2023-11-07T05:31:56Z',
updated_at: '2023-11-07T05:31:56Z',
archived: 'false',
custom_fields: {key: 'value'}
}
}
],
created_at: '2023-11-07T05:31:56Z',
updated_at: '2023-11-07T05:31:56Z',
approved_at: '2023-11-07T05:31:56Z',
approved_by: {
id: '7158',
first_name: 'Jack',
last_name: 'Jones',
email: 'jack_jones@example.com',
org_name: 'Organisation Ltd',
org_id: '567',
business_unit: 'Public Private Partnerships',
division: 'Infastructure',
department: 'Bridges',
vetting_status: 'PASSED',
created_at: '2023-11-07T05:31:56Z',
updated_at: '2023-11-07T05:31:56Z',
custom_fields: {key: 'value'},
has_oversight: '<string>'
},
client: {
id: '7158',
first_name: 'Jack',
last_name: 'Jones',
email: 'jack_jones@example.com',
org_name: 'Organisation Ltd',
org_id: '567',
business_unit: 'Public Private Partnerships',
division: 'Infastructure',
department: 'Bridge Building',
vetting_status: 'PASSED',
created_at: '2023-11-07T05:31:56Z',
updated_at: '2023-11-07T05:31:56Z',
custom_fields: {key: 'value'},
has_oversight: '<string>'
},
client_org: {
id: '7158',
name: 'Company Ltd',
is_external_client: '<string>',
created_at: '2023-11-07T05:31:56Z',
updated_at: '2023-11-07T05:31:56Z'
},
supplier: {
id: '77',
name: 'Company Inc',
email: 'jack_jones@companyinc.com',
vetting_status: 'PASSED',
tax_number: '9876543234',
tax_registered: 'true',
created_at: '2023-11-07T05:31:56Z',
updated_at: '2023-11-07T05:31:56Z'
}
})
};
fetch('https://api.zivio.net/api/v3/invoices/{id}', 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.zivio.net/api/v3/invoices/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'id' => '1',
'status' => 'draft',
'job_id' => '23',
'job_summary' => 'Some text about the project',
'net_total' => '16000.00',
'tax_total' => '2000.00',
'total' => '18000.00',
'ccy' => 'GBP',
'due_on' => '2023-11-07T05:31:56Z',
'milestone_id' => '435',
'line_item_sheet_id' => '234',
'credit_note_id' => '124',
'is_credit_note' => 'null',
'credit_note_reason' => 'invoice paid in error',
'invoice_items' => [
[
'id' => '1',
'invoice_id' => '123',
'milestone_id' => '3654',
'line_item_sheet_id' => '3645',
'purchase_order_line_id' => '284',
'description' => 'Some text about the item',
'quantity' => '10.0',
'unit_type' => 'milestone',
'billing_start' => 'YYYY-MM-DD',
'billing_end' => 'YYYY-MM-DD',
'ccy' => 'GBP',
'unit_cost' => '30000.00',
'net_total_price' => '30000.00',
'tax_rate' => '20.0',
'tax_total' => '6000.00',
'total_price' => '36000.00',
'tax_type' => [
'id' => '123',
'label' => 'UK VAT',
'key' => 'cis_registered_contractors_deduction',
'rate' => '20.0',
'country_code' => 'GB',
'created_at' => '2023-11-07T05:31:56Z',
'updated_at' => '2023-11-07T05:31:56Z',
'archived' => 'false',
'custom_fields' => [
'key' => 'value'
]
]
]
],
'created_at' => '2023-11-07T05:31:56Z',
'updated_at' => '2023-11-07T05:31:56Z',
'approved_at' => '2023-11-07T05:31:56Z',
'approved_by' => [
'id' => '7158',
'first_name' => 'Jack',
'last_name' => 'Jones',
'email' => 'jack_jones@example.com',
'org_name' => 'Organisation Ltd',
'org_id' => '567',
'business_unit' => 'Public Private Partnerships',
'division' => 'Infastructure',
'department' => 'Bridges',
'vetting_status' => 'PASSED',
'created_at' => '2023-11-07T05:31:56Z',
'updated_at' => '2023-11-07T05:31:56Z',
'custom_fields' => [
'key' => 'value'
],
'has_oversight' => '<string>'
],
'client' => [
'id' => '7158',
'first_name' => 'Jack',
'last_name' => 'Jones',
'email' => 'jack_jones@example.com',
'org_name' => 'Organisation Ltd',
'org_id' => '567',
'business_unit' => 'Public Private Partnerships',
'division' => 'Infastructure',
'department' => 'Bridge Building',
'vetting_status' => 'PASSED',
'created_at' => '2023-11-07T05:31:56Z',
'updated_at' => '2023-11-07T05:31:56Z',
'custom_fields' => [
'key' => 'value'
],
'has_oversight' => '<string>'
],
'client_org' => [
'id' => '7158',
'name' => 'Company Ltd',
'is_external_client' => '<string>',
'created_at' => '2023-11-07T05:31:56Z',
'updated_at' => '2023-11-07T05:31:56Z'
],
'supplier' => [
'id' => '77',
'name' => 'Company Inc',
'email' => 'jack_jones@companyinc.com',
'vetting_status' => 'PASSED',
'tax_number' => '9876543234',
'tax_registered' => 'true',
'created_at' => '2023-11-07T05:31:56Z',
'updated_at' => '2023-11-07T05:31:56Z'
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-Key: <api-key>",
"zivio-tenant-id: <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"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.zivio.net/api/v3/invoices/{id}"
payload := strings.NewReader("{\n \"id\": \"1\",\n \"status\": \"draft\",\n \"job_id\": \"23\",\n \"job_summary\": \"Some text about the project\",\n \"net_total\": \"16000.00\",\n \"tax_total\": \"2000.00\",\n \"total\": \"18000.00\",\n \"ccy\": \"GBP\",\n \"due_on\": \"2023-11-07T05:31:56Z\",\n \"milestone_id\": \"435\",\n \"line_item_sheet_id\": \"234\",\n \"credit_note_id\": \"124\",\n \"is_credit_note\": \"null\",\n \"credit_note_reason\": \"invoice paid in error\",\n \"invoice_items\": [\n {\n \"id\": \"1\",\n \"invoice_id\": \"123\",\n \"milestone_id\": \"3654\",\n \"line_item_sheet_id\": \"3645\",\n \"purchase_order_line_id\": \"284\",\n \"description\": \"Some text about the item\",\n \"quantity\": \"10.0\",\n \"unit_type\": \"milestone\",\n \"billing_start\": \"YYYY-MM-DD\",\n \"billing_end\": \"YYYY-MM-DD\",\n \"ccy\": \"GBP\",\n \"unit_cost\": \"30000.00\",\n \"net_total_price\": \"30000.00\",\n \"tax_rate\": \"20.0\",\n \"tax_total\": \"6000.00\",\n \"total_price\": \"36000.00\",\n \"tax_type\": {\n \"id\": \"123\",\n \"label\": \"UK VAT\",\n \"key\": \"cis_registered_contractors_deduction\",\n \"rate\": \"20.0\",\n \"country_code\": \"GB\",\n \"created_at\": \"2023-11-07T05:31:56Z\",\n \"updated_at\": \"2023-11-07T05:31:56Z\",\n \"archived\": \"false\",\n \"custom_fields\": {\n \"key\": \"value\"\n }\n }\n }\n ],\n \"created_at\": \"2023-11-07T05:31:56Z\",\n \"updated_at\": \"2023-11-07T05:31:56Z\",\n \"approved_at\": \"2023-11-07T05:31:56Z\",\n \"approved_by\": {\n \"id\": \"7158\",\n \"first_name\": \"Jack\",\n \"last_name\": \"Jones\",\n \"email\": \"jack_jones@example.com\",\n \"org_name\": \"Organisation Ltd\",\n \"org_id\": \"567\",\n \"business_unit\": \"Public Private Partnerships\",\n \"division\": \"Infastructure\",\n \"department\": \"Bridges\",\n \"vetting_status\": \"PASSED\",\n \"created_at\": \"2023-11-07T05:31:56Z\",\n \"updated_at\": \"2023-11-07T05:31:56Z\",\n \"custom_fields\": {\n \"key\": \"value\"\n },\n \"has_oversight\": \"<string>\"\n },\n \"client\": {\n \"id\": \"7158\",\n \"first_name\": \"Jack\",\n \"last_name\": \"Jones\",\n \"email\": \"jack_jones@example.com\",\n \"org_name\": \"Organisation Ltd\",\n \"org_id\": \"567\",\n \"business_unit\": \"Public Private Partnerships\",\n \"division\": \"Infastructure\",\n \"department\": \"Bridge Building\",\n \"vetting_status\": \"PASSED\",\n \"created_at\": \"2023-11-07T05:31:56Z\",\n \"updated_at\": \"2023-11-07T05:31:56Z\",\n \"custom_fields\": {\n \"key\": \"value\"\n },\n \"has_oversight\": \"<string>\"\n },\n \"client_org\": {\n \"id\": \"7158\",\n \"name\": \"Company Ltd\",\n \"is_external_client\": \"<string>\",\n \"created_at\": \"2023-11-07T05:31:56Z\",\n \"updated_at\": \"2023-11-07T05:31:56Z\"\n },\n \"supplier\": {\n \"id\": \"77\",\n \"name\": \"Company Inc\",\n \"email\": \"jack_jones@companyinc.com\",\n \"vetting_status\": \"PASSED\",\n \"tax_number\": \"9876543234\",\n \"tax_registered\": \"true\",\n \"created_at\": \"2023-11-07T05:31:56Z\",\n \"updated_at\": \"2023-11-07T05:31:56Z\"\n }\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("X-API-Key", "<api-key>")
req.Header.Add("zivio-tenant-id", "<api-key>")
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.patch("https://api.zivio.net/api/v3/invoices/{id}")
.header("X-API-Key", "<api-key>")
.header("zivio-tenant-id", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"id\": \"1\",\n \"status\": \"draft\",\n \"job_id\": \"23\",\n \"job_summary\": \"Some text about the project\",\n \"net_total\": \"16000.00\",\n \"tax_total\": \"2000.00\",\n \"total\": \"18000.00\",\n \"ccy\": \"GBP\",\n \"due_on\": \"2023-11-07T05:31:56Z\",\n \"milestone_id\": \"435\",\n \"line_item_sheet_id\": \"234\",\n \"credit_note_id\": \"124\",\n \"is_credit_note\": \"null\",\n \"credit_note_reason\": \"invoice paid in error\",\n \"invoice_items\": [\n {\n \"id\": \"1\",\n \"invoice_id\": \"123\",\n \"milestone_id\": \"3654\",\n \"line_item_sheet_id\": \"3645\",\n \"purchase_order_line_id\": \"284\",\n \"description\": \"Some text about the item\",\n \"quantity\": \"10.0\",\n \"unit_type\": \"milestone\",\n \"billing_start\": \"YYYY-MM-DD\",\n \"billing_end\": \"YYYY-MM-DD\",\n \"ccy\": \"GBP\",\n \"unit_cost\": \"30000.00\",\n \"net_total_price\": \"30000.00\",\n \"tax_rate\": \"20.0\",\n \"tax_total\": \"6000.00\",\n \"total_price\": \"36000.00\",\n \"tax_type\": {\n \"id\": \"123\",\n \"label\": \"UK VAT\",\n \"key\": \"cis_registered_contractors_deduction\",\n \"rate\": \"20.0\",\n \"country_code\": \"GB\",\n \"created_at\": \"2023-11-07T05:31:56Z\",\n \"updated_at\": \"2023-11-07T05:31:56Z\",\n \"archived\": \"false\",\n \"custom_fields\": {\n \"key\": \"value\"\n }\n }\n }\n ],\n \"created_at\": \"2023-11-07T05:31:56Z\",\n \"updated_at\": \"2023-11-07T05:31:56Z\",\n \"approved_at\": \"2023-11-07T05:31:56Z\",\n \"approved_by\": {\n \"id\": \"7158\",\n \"first_name\": \"Jack\",\n \"last_name\": \"Jones\",\n \"email\": \"jack_jones@example.com\",\n \"org_name\": \"Organisation Ltd\",\n \"org_id\": \"567\",\n \"business_unit\": \"Public Private Partnerships\",\n \"division\": \"Infastructure\",\n \"department\": \"Bridges\",\n \"vetting_status\": \"PASSED\",\n \"created_at\": \"2023-11-07T05:31:56Z\",\n \"updated_at\": \"2023-11-07T05:31:56Z\",\n \"custom_fields\": {\n \"key\": \"value\"\n },\n \"has_oversight\": \"<string>\"\n },\n \"client\": {\n \"id\": \"7158\",\n \"first_name\": \"Jack\",\n \"last_name\": \"Jones\",\n \"email\": \"jack_jones@example.com\",\n \"org_name\": \"Organisation Ltd\",\n \"org_id\": \"567\",\n \"business_unit\": \"Public Private Partnerships\",\n \"division\": \"Infastructure\",\n \"department\": \"Bridge Building\",\n \"vetting_status\": \"PASSED\",\n \"created_at\": \"2023-11-07T05:31:56Z\",\n \"updated_at\": \"2023-11-07T05:31:56Z\",\n \"custom_fields\": {\n \"key\": \"value\"\n },\n \"has_oversight\": \"<string>\"\n },\n \"client_org\": {\n \"id\": \"7158\",\n \"name\": \"Company Ltd\",\n \"is_external_client\": \"<string>\",\n \"created_at\": \"2023-11-07T05:31:56Z\",\n \"updated_at\": \"2023-11-07T05:31:56Z\"\n },\n \"supplier\": {\n \"id\": \"77\",\n \"name\": \"Company Inc\",\n \"email\": \"jack_jones@companyinc.com\",\n \"vetting_status\": \"PASSED\",\n \"tax_number\": \"9876543234\",\n \"tax_registered\": \"true\",\n \"created_at\": \"2023-11-07T05:31:56Z\",\n \"updated_at\": \"2023-11-07T05:31:56Z\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.zivio.net/api/v3/invoices/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["X-API-Key"] = '<api-key>'
request["zivio-tenant-id"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"id\": \"1\",\n \"status\": \"draft\",\n \"job_id\": \"23\",\n \"job_summary\": \"Some text about the project\",\n \"net_total\": \"16000.00\",\n \"tax_total\": \"2000.00\",\n \"total\": \"18000.00\",\n \"ccy\": \"GBP\",\n \"due_on\": \"2023-11-07T05:31:56Z\",\n \"milestone_id\": \"435\",\n \"line_item_sheet_id\": \"234\",\n \"credit_note_id\": \"124\",\n \"is_credit_note\": \"null\",\n \"credit_note_reason\": \"invoice paid in error\",\n \"invoice_items\": [\n {\n \"id\": \"1\",\n \"invoice_id\": \"123\",\n \"milestone_id\": \"3654\",\n \"line_item_sheet_id\": \"3645\",\n \"purchase_order_line_id\": \"284\",\n \"description\": \"Some text about the item\",\n \"quantity\": \"10.0\",\n \"unit_type\": \"milestone\",\n \"billing_start\": \"YYYY-MM-DD\",\n \"billing_end\": \"YYYY-MM-DD\",\n \"ccy\": \"GBP\",\n \"unit_cost\": \"30000.00\",\n \"net_total_price\": \"30000.00\",\n \"tax_rate\": \"20.0\",\n \"tax_total\": \"6000.00\",\n \"total_price\": \"36000.00\",\n \"tax_type\": {\n \"id\": \"123\",\n \"label\": \"UK VAT\",\n \"key\": \"cis_registered_contractors_deduction\",\n \"rate\": \"20.0\",\n \"country_code\": \"GB\",\n \"created_at\": \"2023-11-07T05:31:56Z\",\n \"updated_at\": \"2023-11-07T05:31:56Z\",\n \"archived\": \"false\",\n \"custom_fields\": {\n \"key\": \"value\"\n }\n }\n }\n ],\n \"created_at\": \"2023-11-07T05:31:56Z\",\n \"updated_at\": \"2023-11-07T05:31:56Z\",\n \"approved_at\": \"2023-11-07T05:31:56Z\",\n \"approved_by\": {\n \"id\": \"7158\",\n \"first_name\": \"Jack\",\n \"last_name\": \"Jones\",\n \"email\": \"jack_jones@example.com\",\n \"org_name\": \"Organisation Ltd\",\n \"org_id\": \"567\",\n \"business_unit\": \"Public Private Partnerships\",\n \"division\": \"Infastructure\",\n \"department\": \"Bridges\",\n \"vetting_status\": \"PASSED\",\n \"created_at\": \"2023-11-07T05:31:56Z\",\n \"updated_at\": \"2023-11-07T05:31:56Z\",\n \"custom_fields\": {\n \"key\": \"value\"\n },\n \"has_oversight\": \"<string>\"\n },\n \"client\": {\n \"id\": \"7158\",\n \"first_name\": \"Jack\",\n \"last_name\": \"Jones\",\n \"email\": \"jack_jones@example.com\",\n \"org_name\": \"Organisation Ltd\",\n \"org_id\": \"567\",\n \"business_unit\": \"Public Private Partnerships\",\n \"division\": \"Infastructure\",\n \"department\": \"Bridge Building\",\n \"vetting_status\": \"PASSED\",\n \"created_at\": \"2023-11-07T05:31:56Z\",\n \"updated_at\": \"2023-11-07T05:31:56Z\",\n \"custom_fields\": {\n \"key\": \"value\"\n },\n \"has_oversight\": \"<string>\"\n },\n \"client_org\": {\n \"id\": \"7158\",\n \"name\": \"Company Ltd\",\n \"is_external_client\": \"<string>\",\n \"created_at\": \"2023-11-07T05:31:56Z\",\n \"updated_at\": \"2023-11-07T05:31:56Z\"\n },\n \"supplier\": {\n \"id\": \"77\",\n \"name\": \"Company Inc\",\n \"email\": \"jack_jones@companyinc.com\",\n \"vetting_status\": \"PASSED\",\n \"tax_number\": \"9876543234\",\n \"tax_registered\": \"true\",\n \"created_at\": \"2023-11-07T05:31:56Z\",\n \"updated_at\": \"2023-11-07T05:31:56Z\"\n }\n}"
response = http.request(request)
puts response.read_body{
"id": "1",
"status": "draft",
"job_id": "23",
"job_summary": "Some text about the project",
"net_total": "16000.00",
"tax_total": "2000.00",
"total": "18000.00",
"ccy": "GBP",
"due_on": "2023-11-07T05:31:56Z",
"dated_on": "2023-11-07T05:31:56Z",
"milestone_id": "435",
"line_item_sheet_id": "234",
"credit_note_id": "124",
"is_credit_note": "null",
"credit_note_reason": "invoice paid in error",
"invoice_items": [
{
"id": "1",
"invoice_id": "123",
"milestone_id": "3654",
"line_item_sheet_id": "3645",
"purchase_order_line_id": "284",
"description": "Some text about the item",
"quantity": "10.0",
"unit_type": "milestone",
"billing_start": "YYYY-MM-DD",
"billing_end": "YYYY-MM-DD",
"ccy": "GBP",
"unit_cost": "30000.00",
"net_total_price": "30000.00",
"tax_rate": "20.0",
"tax_total": "6000.00",
"total_price": "36000.00",
"tax_type": {
"id": "123",
"label": "UK VAT",
"key": "cis_registered_contractors_deduction",
"rate": "20.0",
"country_code": "GB",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"archived": "false",
"custom_fields": {
"key": "value"
}
}
}
],
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"approved_at": "2023-11-07T05:31:56Z",
"approved_by": {
"id": "7158",
"first_name": "Jack",
"last_name": "Jones",
"email": "jack_jones@example.com",
"org_name": "Organisation Ltd",
"org_id": "567",
"business_unit": "Public Private Partnerships",
"division": "Infastructure",
"department": "Bridges",
"vetting_status": "PASSED",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"custom_fields": {
"key": "value"
},
"has_oversight": "<string>"
},
"client": {
"id": "7158",
"first_name": "Jack",
"last_name": "Jones",
"email": "jack_jones@example.com",
"org_name": "Organisation Ltd",
"org_id": "567",
"business_unit": "Public Private Partnerships",
"division": "Infastructure",
"department": "Bridge Building",
"vetting_status": "PASSED",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"custom_fields": {
"key": "value"
},
"has_oversight": "<string>"
},
"client_org": {
"id": "7158",
"name": "Company Ltd",
"is_external_client": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
},
"supplier": {
"id": "77",
"name": "Company Inc",
"email": "jack_jones@companyinc.com",
"vetting_status": "PASSED",
"tax_number": "9876543234",
"tax_registered": "true",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}
}Path Parameters
Body
application/json
Example:
"1"
Example:
"draft"
Example:
"23"
Example:
"Some text about the project"
Example:
"16000.00"
Example:
"2000.00"
Example:
"18000.00"
Example:
"GBP"
Example:
"435"
Example:
"234"
Example:
"124"
Example:
null
Example:
"invoice paid in error"
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Response
ok
Example:
"1"
Example:
"draft"
Example:
"23"
Example:
"Some text about the project"
Example:
"16000.00"
Example:
"2000.00"
Example:
"18000.00"
Example:
"GBP"
Example:
"435"
Example:
"234"
Example:
"124"
Example:
null
Example:
"invoice paid in error"
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
⌘I

