Create an Invoice
curl --request POST \
--url https://api.zivio.net/api/v3/invoices \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--header 'zivio-tenant-id: <api-key>' \
--data '
{
"type": "ItemisedInvoice",
"description": "Invoice description",
"ccy": "GBP",
"job_id": "137",
"due_on": "2020-11-01",
"dated_on": "2020-10-21",
"milestone_id": "78",
"net_total_cents": "100000",
"tax_total_cents": "20000",
"total_cents": "120000",
"invoice_items_attributes": [
{
"description": "Item description",
"quantity": "5",
"billing_start": "2020-11-01",
"billing_end": "2020-11-03",
"unit_type": "Hotel",
"unit_cost_cents": "20000",
"tax_type_id": "1"
}
]
}
'import requests
url = "https://api.zivio.net/api/v3/invoices"
payload = {
"type": "ItemisedInvoice",
"description": "Invoice description",
"ccy": "GBP",
"job_id": "137",
"due_on": "2020-11-01",
"dated_on": "2020-10-21",
"milestone_id": "78",
"net_total_cents": "100000",
"tax_total_cents": "20000",
"total_cents": "120000",
"invoice_items_attributes": [
{
"description": "Item description",
"quantity": "5",
"billing_start": "2020-11-01",
"billing_end": "2020-11-03",
"unit_type": "Hotel",
"unit_cost_cents": "20000",
"tax_type_id": "1"
}
]
}
headers = {
"X-API-Key": "<api-key>",
"zivio-tenant-id": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'X-API-Key': '<api-key>',
'zivio-tenant-id': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
type: 'ItemisedInvoice',
description: 'Invoice description',
ccy: 'GBP',
job_id: '137',
due_on: '2020-11-01',
dated_on: '2020-10-21',
milestone_id: '78',
net_total_cents: '100000',
tax_total_cents: '20000',
total_cents: '120000',
invoice_items_attributes: [
{
description: 'Item description',
quantity: '5',
billing_start: '2020-11-01',
billing_end: '2020-11-03',
unit_type: 'Hotel',
unit_cost_cents: '20000',
tax_type_id: '1'
}
]
})
};
fetch('https://api.zivio.net/api/v3/invoices', 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",
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([
'type' => 'ItemisedInvoice',
'description' => 'Invoice description',
'ccy' => 'GBP',
'job_id' => '137',
'due_on' => '2020-11-01',
'dated_on' => '2020-10-21',
'milestone_id' => '78',
'net_total_cents' => '100000',
'tax_total_cents' => '20000',
'total_cents' => '120000',
'invoice_items_attributes' => [
[
'description' => 'Item description',
'quantity' => '5',
'billing_start' => '2020-11-01',
'billing_end' => '2020-11-03',
'unit_type' => 'Hotel',
'unit_cost_cents' => '20000',
'tax_type_id' => '1'
]
]
]),
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"
payload := strings.NewReader("{\n \"type\": \"ItemisedInvoice\",\n \"description\": \"Invoice description\",\n \"ccy\": \"GBP\",\n \"job_id\": \"137\",\n \"due_on\": \"2020-11-01\",\n \"dated_on\": \"2020-10-21\",\n \"milestone_id\": \"78\",\n \"net_total_cents\": \"100000\",\n \"tax_total_cents\": \"20000\",\n \"total_cents\": \"120000\",\n \"invoice_items_attributes\": [\n {\n \"description\": \"Item description\",\n \"quantity\": \"5\",\n \"billing_start\": \"2020-11-01\",\n \"billing_end\": \"2020-11-03\",\n \"unit_type\": \"Hotel\",\n \"unit_cost_cents\": \"20000\",\n \"tax_type_id\": \"1\"\n }\n ]\n}")
req, _ := http.NewRequest("POST", 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.post("https://api.zivio.net/api/v3/invoices")
.header("X-API-Key", "<api-key>")
.header("zivio-tenant-id", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"type\": \"ItemisedInvoice\",\n \"description\": \"Invoice description\",\n \"ccy\": \"GBP\",\n \"job_id\": \"137\",\n \"due_on\": \"2020-11-01\",\n \"dated_on\": \"2020-10-21\",\n \"milestone_id\": \"78\",\n \"net_total_cents\": \"100000\",\n \"tax_total_cents\": \"20000\",\n \"total_cents\": \"120000\",\n \"invoice_items_attributes\": [\n {\n \"description\": \"Item description\",\n \"quantity\": \"5\",\n \"billing_start\": \"2020-11-01\",\n \"billing_end\": \"2020-11-03\",\n \"unit_type\": \"Hotel\",\n \"unit_cost_cents\": \"20000\",\n \"tax_type_id\": \"1\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.zivio.net/api/v3/invoices")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-API-Key"] = '<api-key>'
request["zivio-tenant-id"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"type\": \"ItemisedInvoice\",\n \"description\": \"Invoice description\",\n \"ccy\": \"GBP\",\n \"job_id\": \"137\",\n \"due_on\": \"2020-11-01\",\n \"dated_on\": \"2020-10-21\",\n \"milestone_id\": \"78\",\n \"net_total_cents\": \"100000\",\n \"tax_total_cents\": \"20000\",\n \"total_cents\": \"120000\",\n \"invoice_items_attributes\": [\n {\n \"description\": \"Item description\",\n \"quantity\": \"5\",\n \"billing_start\": \"2020-11-01\",\n \"billing_end\": \"2020-11-03\",\n \"unit_type\": \"Hotel\",\n \"unit_cost_cents\": \"20000\",\n \"tax_type_id\": \"1\"\n }\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",
"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
Create an Invoice
POST
/
invoices
Create an Invoice
curl --request POST \
--url https://api.zivio.net/api/v3/invoices \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--header 'zivio-tenant-id: <api-key>' \
--data '
{
"type": "ItemisedInvoice",
"description": "Invoice description",
"ccy": "GBP",
"job_id": "137",
"due_on": "2020-11-01",
"dated_on": "2020-10-21",
"milestone_id": "78",
"net_total_cents": "100000",
"tax_total_cents": "20000",
"total_cents": "120000",
"invoice_items_attributes": [
{
"description": "Item description",
"quantity": "5",
"billing_start": "2020-11-01",
"billing_end": "2020-11-03",
"unit_type": "Hotel",
"unit_cost_cents": "20000",
"tax_type_id": "1"
}
]
}
'import requests
url = "https://api.zivio.net/api/v3/invoices"
payload = {
"type": "ItemisedInvoice",
"description": "Invoice description",
"ccy": "GBP",
"job_id": "137",
"due_on": "2020-11-01",
"dated_on": "2020-10-21",
"milestone_id": "78",
"net_total_cents": "100000",
"tax_total_cents": "20000",
"total_cents": "120000",
"invoice_items_attributes": [
{
"description": "Item description",
"quantity": "5",
"billing_start": "2020-11-01",
"billing_end": "2020-11-03",
"unit_type": "Hotel",
"unit_cost_cents": "20000",
"tax_type_id": "1"
}
]
}
headers = {
"X-API-Key": "<api-key>",
"zivio-tenant-id": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'X-API-Key': '<api-key>',
'zivio-tenant-id': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
type: 'ItemisedInvoice',
description: 'Invoice description',
ccy: 'GBP',
job_id: '137',
due_on: '2020-11-01',
dated_on: '2020-10-21',
milestone_id: '78',
net_total_cents: '100000',
tax_total_cents: '20000',
total_cents: '120000',
invoice_items_attributes: [
{
description: 'Item description',
quantity: '5',
billing_start: '2020-11-01',
billing_end: '2020-11-03',
unit_type: 'Hotel',
unit_cost_cents: '20000',
tax_type_id: '1'
}
]
})
};
fetch('https://api.zivio.net/api/v3/invoices', 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",
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([
'type' => 'ItemisedInvoice',
'description' => 'Invoice description',
'ccy' => 'GBP',
'job_id' => '137',
'due_on' => '2020-11-01',
'dated_on' => '2020-10-21',
'milestone_id' => '78',
'net_total_cents' => '100000',
'tax_total_cents' => '20000',
'total_cents' => '120000',
'invoice_items_attributes' => [
[
'description' => 'Item description',
'quantity' => '5',
'billing_start' => '2020-11-01',
'billing_end' => '2020-11-03',
'unit_type' => 'Hotel',
'unit_cost_cents' => '20000',
'tax_type_id' => '1'
]
]
]),
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"
payload := strings.NewReader("{\n \"type\": \"ItemisedInvoice\",\n \"description\": \"Invoice description\",\n \"ccy\": \"GBP\",\n \"job_id\": \"137\",\n \"due_on\": \"2020-11-01\",\n \"dated_on\": \"2020-10-21\",\n \"milestone_id\": \"78\",\n \"net_total_cents\": \"100000\",\n \"tax_total_cents\": \"20000\",\n \"total_cents\": \"120000\",\n \"invoice_items_attributes\": [\n {\n \"description\": \"Item description\",\n \"quantity\": \"5\",\n \"billing_start\": \"2020-11-01\",\n \"billing_end\": \"2020-11-03\",\n \"unit_type\": \"Hotel\",\n \"unit_cost_cents\": \"20000\",\n \"tax_type_id\": \"1\"\n }\n ]\n}")
req, _ := http.NewRequest("POST", 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.post("https://api.zivio.net/api/v3/invoices")
.header("X-API-Key", "<api-key>")
.header("zivio-tenant-id", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"type\": \"ItemisedInvoice\",\n \"description\": \"Invoice description\",\n \"ccy\": \"GBP\",\n \"job_id\": \"137\",\n \"due_on\": \"2020-11-01\",\n \"dated_on\": \"2020-10-21\",\n \"milestone_id\": \"78\",\n \"net_total_cents\": \"100000\",\n \"tax_total_cents\": \"20000\",\n \"total_cents\": \"120000\",\n \"invoice_items_attributes\": [\n {\n \"description\": \"Item description\",\n \"quantity\": \"5\",\n \"billing_start\": \"2020-11-01\",\n \"billing_end\": \"2020-11-03\",\n \"unit_type\": \"Hotel\",\n \"unit_cost_cents\": \"20000\",\n \"tax_type_id\": \"1\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.zivio.net/api/v3/invoices")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-API-Key"] = '<api-key>'
request["zivio-tenant-id"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"type\": \"ItemisedInvoice\",\n \"description\": \"Invoice description\",\n \"ccy\": \"GBP\",\n \"job_id\": \"137\",\n \"due_on\": \"2020-11-01\",\n \"dated_on\": \"2020-10-21\",\n \"milestone_id\": \"78\",\n \"net_total_cents\": \"100000\",\n \"tax_total_cents\": \"20000\",\n \"total_cents\": \"120000\",\n \"invoice_items_attributes\": [\n {\n \"description\": \"Item description\",\n \"quantity\": \"5\",\n \"billing_start\": \"2020-11-01\",\n \"billing_end\": \"2020-11-03\",\n \"unit_type\": \"Hotel\",\n \"unit_cost_cents\": \"20000\",\n \"tax_type_id\": \"1\"\n }\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",
"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"
}
}Body
application/json
Example:
"ItemisedInvoice"
Example:
"Invoice description"
Example:
"GBP"
Example:
"137"
Example:
"2020-11-01"
Example:
"2020-10-21"
Example:
"78"
Example:
"100000"
Example:
"20000"
Example:
"120000"
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
⌘I

