curl --request POST \
--url https://{your-subdomain}.neetoinvoice.com/api/external/v1/clients/{client_id}/invoices \
--header 'Content-Type: application/json' \
--header 'X-Api-Key: <x-api-key>' \
--data '
{
"email": "john@example.com",
"number": "INV-EXT-001",
"total": 500,
"invoice_time_entries": [
{
"time_entry_id": "128c1dfc-b29f-4fda-9a05-8a90e197b81b",
"project_id": "f627c399-379d-4d07-a6f6-90b7c9470ac0",
"task_id": "4d0d7ad1-91ce-44d0-abfe-6718422716dd",
"user_id": "5a2de667-243b-4da3-b090-b698a03d98da",
"notes": "Working on feature implementation",
"hours": 2.5,
"hourly_rate": 50
}
],
"issue_date": "12/25/2023",
"due_date": "01/25/2024",
"due_date_period": 30,
"interval": "monthly",
"notes": "Payment terms: Net 30 days",
"include_hours_by_person": true,
"include_hours_by_task": false,
"include_time_entries": true,
"send_automated_reminder_email": true,
"include_payment_link": true,
"payment_provider": "undefined",
"display_task_name": true,
"display_person_name": true,
"display_date": true,
"display_note": true,
"display_project_name": false,
"project_id": [
"89d1b47d9f36af3c9ecf",
"24e6a2fe31bb686c541a"
],
"send_email": true,
"invoice_details": {
"subject": "Invoice INV-EXT-001 from Your Company",
"message": "Please find attached your invoice for the services rendered.",
"attach_pdf_invoice": "true",
"send_me_a_copy": "false",
"recipient_ids": [
"128c1dfc-b29f-4fda-9a05-8a90e197b81b",
"6be815a8-9a10-455c-95d9-b0b548664420"
]
},
"tax_details": [
{
"name": "GST",
"percentage": 10,
"notes": "Goods and Services Tax",
"selected": true
}
]
}
'import requests
url = "https://{your-subdomain}.neetoinvoice.com/api/external/v1/clients/{client_id}/invoices"
payload = {
"email": "john@example.com",
"number": "INV-EXT-001",
"total": 500,
"invoice_time_entries": [
{
"time_entry_id": "128c1dfc-b29f-4fda-9a05-8a90e197b81b",
"project_id": "f627c399-379d-4d07-a6f6-90b7c9470ac0",
"task_id": "4d0d7ad1-91ce-44d0-abfe-6718422716dd",
"user_id": "5a2de667-243b-4da3-b090-b698a03d98da",
"notes": "Working on feature implementation",
"hours": 2.5,
"hourly_rate": 50
}
],
"issue_date": "12/25/2023",
"due_date": "01/25/2024",
"due_date_period": 30,
"interval": "monthly",
"notes": "Payment terms: Net 30 days",
"include_hours_by_person": True,
"include_hours_by_task": False,
"include_time_entries": True,
"send_automated_reminder_email": True,
"include_payment_link": True,
"payment_provider": "undefined",
"display_task_name": True,
"display_person_name": True,
"display_date": True,
"display_note": True,
"display_project_name": False,
"project_id": ["89d1b47d9f36af3c9ecf", "24e6a2fe31bb686c541a"],
"send_email": True,
"invoice_details": {
"subject": "Invoice INV-EXT-001 from Your Company",
"message": "Please find attached your invoice for the services rendered.",
"attach_pdf_invoice": "true",
"send_me_a_copy": "false",
"recipient_ids": ["128c1dfc-b29f-4fda-9a05-8a90e197b81b", "6be815a8-9a10-455c-95d9-b0b548664420"]
},
"tax_details": [
{
"name": "GST",
"percentage": 10,
"notes": "Goods and Services Tax",
"selected": True
}
]
}
headers = {
"X-Api-Key": "<x-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': '<x-api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
email: 'john@example.com',
number: 'INV-EXT-001',
total: 500,
invoice_time_entries: [
{
time_entry_id: '128c1dfc-b29f-4fda-9a05-8a90e197b81b',
project_id: 'f627c399-379d-4d07-a6f6-90b7c9470ac0',
task_id: '4d0d7ad1-91ce-44d0-abfe-6718422716dd',
user_id: '5a2de667-243b-4da3-b090-b698a03d98da',
notes: 'Working on feature implementation',
hours: 2.5,
hourly_rate: 50
}
],
issue_date: '12/25/2023',
due_date: '01/25/2024',
due_date_period: 30,
interval: 'monthly',
notes: 'Payment terms: Net 30 days',
include_hours_by_person: true,
include_hours_by_task: false,
include_time_entries: true,
send_automated_reminder_email: true,
include_payment_link: true,
payment_provider: 'undefined',
display_task_name: true,
display_person_name: true,
display_date: true,
display_note: true,
display_project_name: false,
project_id: ['89d1b47d9f36af3c9ecf', '24e6a2fe31bb686c541a'],
send_email: true,
invoice_details: {
subject: 'Invoice INV-EXT-001 from Your Company',
message: 'Please find attached your invoice for the services rendered.',
attach_pdf_invoice: 'true',
send_me_a_copy: 'false',
recipient_ids: ['128c1dfc-b29f-4fda-9a05-8a90e197b81b', '6be815a8-9a10-455c-95d9-b0b548664420']
},
tax_details: [{name: 'GST', percentage: 10, notes: 'Goods and Services Tax', selected: true}]
})
};
fetch('https://{your-subdomain}.neetoinvoice.com/api/external/v1/clients/{client_id}/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://{your-subdomain}.neetoinvoice.com/api/external/v1/clients/{client_id}/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([
'email' => 'john@example.com',
'number' => 'INV-EXT-001',
'total' => 500,
'invoice_time_entries' => [
[
'time_entry_id' => '128c1dfc-b29f-4fda-9a05-8a90e197b81b',
'project_id' => 'f627c399-379d-4d07-a6f6-90b7c9470ac0',
'task_id' => '4d0d7ad1-91ce-44d0-abfe-6718422716dd',
'user_id' => '5a2de667-243b-4da3-b090-b698a03d98da',
'notes' => 'Working on feature implementation',
'hours' => 2.5,
'hourly_rate' => 50
]
],
'issue_date' => '12/25/2023',
'due_date' => '01/25/2024',
'due_date_period' => 30,
'interval' => 'monthly',
'notes' => 'Payment terms: Net 30 days',
'include_hours_by_person' => true,
'include_hours_by_task' => false,
'include_time_entries' => true,
'send_automated_reminder_email' => true,
'include_payment_link' => true,
'payment_provider' => 'undefined',
'display_task_name' => true,
'display_person_name' => true,
'display_date' => true,
'display_note' => true,
'display_project_name' => false,
'project_id' => [
'89d1b47d9f36af3c9ecf',
'24e6a2fe31bb686c541a'
],
'send_email' => true,
'invoice_details' => [
'subject' => 'Invoice INV-EXT-001 from Your Company',
'message' => 'Please find attached your invoice for the services rendered.',
'attach_pdf_invoice' => 'true',
'send_me_a_copy' => 'false',
'recipient_ids' => [
'128c1dfc-b29f-4fda-9a05-8a90e197b81b',
'6be815a8-9a10-455c-95d9-b0b548664420'
]
],
'tax_details' => [
[
'name' => 'GST',
'percentage' => 10,
'notes' => 'Goods and Services Tax',
'selected' => true
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-Api-Key: <x-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://{your-subdomain}.neetoinvoice.com/api/external/v1/clients/{client_id}/invoices"
payload := strings.NewReader("{\n \"email\": \"john@example.com\",\n \"number\": \"INV-EXT-001\",\n \"total\": 500,\n \"invoice_time_entries\": [\n {\n \"time_entry_id\": \"128c1dfc-b29f-4fda-9a05-8a90e197b81b\",\n \"project_id\": \"f627c399-379d-4d07-a6f6-90b7c9470ac0\",\n \"task_id\": \"4d0d7ad1-91ce-44d0-abfe-6718422716dd\",\n \"user_id\": \"5a2de667-243b-4da3-b090-b698a03d98da\",\n \"notes\": \"Working on feature implementation\",\n \"hours\": 2.5,\n \"hourly_rate\": 50\n }\n ],\n \"issue_date\": \"12/25/2023\",\n \"due_date\": \"01/25/2024\",\n \"due_date_period\": 30,\n \"interval\": \"monthly\",\n \"notes\": \"Payment terms: Net 30 days\",\n \"include_hours_by_person\": true,\n \"include_hours_by_task\": false,\n \"include_time_entries\": true,\n \"send_automated_reminder_email\": true,\n \"include_payment_link\": true,\n \"payment_provider\": \"undefined\",\n \"display_task_name\": true,\n \"display_person_name\": true,\n \"display_date\": true,\n \"display_note\": true,\n \"display_project_name\": false,\n \"project_id\": [\n \"89d1b47d9f36af3c9ecf\",\n \"24e6a2fe31bb686c541a\"\n ],\n \"send_email\": true,\n \"invoice_details\": {\n \"subject\": \"Invoice INV-EXT-001 from Your Company\",\n \"message\": \"Please find attached your invoice for the services rendered.\",\n \"attach_pdf_invoice\": \"true\",\n \"send_me_a_copy\": \"false\",\n \"recipient_ids\": [\n \"128c1dfc-b29f-4fda-9a05-8a90e197b81b\",\n \"6be815a8-9a10-455c-95d9-b0b548664420\"\n ]\n },\n \"tax_details\": [\n {\n \"name\": \"GST\",\n \"percentage\": 10,\n \"notes\": \"Goods and Services Tax\",\n \"selected\": true\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-Api-Key", "<x-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://{your-subdomain}.neetoinvoice.com/api/external/v1/clients/{client_id}/invoices")
.header("X-Api-Key", "<x-api-key>")
.header("Content-Type", "application/json")
.body("{\n \"email\": \"john@example.com\",\n \"number\": \"INV-EXT-001\",\n \"total\": 500,\n \"invoice_time_entries\": [\n {\n \"time_entry_id\": \"128c1dfc-b29f-4fda-9a05-8a90e197b81b\",\n \"project_id\": \"f627c399-379d-4d07-a6f6-90b7c9470ac0\",\n \"task_id\": \"4d0d7ad1-91ce-44d0-abfe-6718422716dd\",\n \"user_id\": \"5a2de667-243b-4da3-b090-b698a03d98da\",\n \"notes\": \"Working on feature implementation\",\n \"hours\": 2.5,\n \"hourly_rate\": 50\n }\n ],\n \"issue_date\": \"12/25/2023\",\n \"due_date\": \"01/25/2024\",\n \"due_date_period\": 30,\n \"interval\": \"monthly\",\n \"notes\": \"Payment terms: Net 30 days\",\n \"include_hours_by_person\": true,\n \"include_hours_by_task\": false,\n \"include_time_entries\": true,\n \"send_automated_reminder_email\": true,\n \"include_payment_link\": true,\n \"payment_provider\": \"undefined\",\n \"display_task_name\": true,\n \"display_person_name\": true,\n \"display_date\": true,\n \"display_note\": true,\n \"display_project_name\": false,\n \"project_id\": [\n \"89d1b47d9f36af3c9ecf\",\n \"24e6a2fe31bb686c541a\"\n ],\n \"send_email\": true,\n \"invoice_details\": {\n \"subject\": \"Invoice INV-EXT-001 from Your Company\",\n \"message\": \"Please find attached your invoice for the services rendered.\",\n \"attach_pdf_invoice\": \"true\",\n \"send_me_a_copy\": \"false\",\n \"recipient_ids\": [\n \"128c1dfc-b29f-4fda-9a05-8a90e197b81b\",\n \"6be815a8-9a10-455c-95d9-b0b548664420\"\n ]\n },\n \"tax_details\": [\n {\n \"name\": \"GST\",\n \"percentage\": 10,\n \"notes\": \"Goods and Services Tax\",\n \"selected\": true\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{your-subdomain}.neetoinvoice.com/api/external/v1/clients/{client_id}/invoices")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-Api-Key"] = '<x-api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"email\": \"john@example.com\",\n \"number\": \"INV-EXT-001\",\n \"total\": 500,\n \"invoice_time_entries\": [\n {\n \"time_entry_id\": \"128c1dfc-b29f-4fda-9a05-8a90e197b81b\",\n \"project_id\": \"f627c399-379d-4d07-a6f6-90b7c9470ac0\",\n \"task_id\": \"4d0d7ad1-91ce-44d0-abfe-6718422716dd\",\n \"user_id\": \"5a2de667-243b-4da3-b090-b698a03d98da\",\n \"notes\": \"Working on feature implementation\",\n \"hours\": 2.5,\n \"hourly_rate\": 50\n }\n ],\n \"issue_date\": \"12/25/2023\",\n \"due_date\": \"01/25/2024\",\n \"due_date_period\": 30,\n \"interval\": \"monthly\",\n \"notes\": \"Payment terms: Net 30 days\",\n \"include_hours_by_person\": true,\n \"include_hours_by_task\": false,\n \"include_time_entries\": true,\n \"send_automated_reminder_email\": true,\n \"include_payment_link\": true,\n \"payment_provider\": \"undefined\",\n \"display_task_name\": true,\n \"display_person_name\": true,\n \"display_date\": true,\n \"display_note\": true,\n \"display_project_name\": false,\n \"project_id\": [\n \"89d1b47d9f36af3c9ecf\",\n \"24e6a2fe31bb686c541a\"\n ],\n \"send_email\": true,\n \"invoice_details\": {\n \"subject\": \"Invoice INV-EXT-001 from Your Company\",\n \"message\": \"Please find attached your invoice for the services rendered.\",\n \"attach_pdf_invoice\": \"true\",\n \"send_me_a_copy\": \"false\",\n \"recipient_ids\": [\n \"128c1dfc-b29f-4fda-9a05-8a90e197b81b\",\n \"6be815a8-9a10-455c-95d9-b0b548664420\"\n ]\n },\n \"tax_details\": [\n {\n \"name\": \"GST\",\n \"percentage\": 10,\n \"notes\": \"Goods and Services Tax\",\n \"selected\": true\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"invoice": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"number": "<string>",
"total": 123,
"status": "<string>",
"issue_date": "2023-12-25",
"due_date": "2023-12-25",
"notes": "<string>",
"client_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"organization_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}
}Generate invoice
Generate an invoice for a client.
curl --request POST \
--url https://{your-subdomain}.neetoinvoice.com/api/external/v1/clients/{client_id}/invoices \
--header 'Content-Type: application/json' \
--header 'X-Api-Key: <x-api-key>' \
--data '
{
"email": "john@example.com",
"number": "INV-EXT-001",
"total": 500,
"invoice_time_entries": [
{
"time_entry_id": "128c1dfc-b29f-4fda-9a05-8a90e197b81b",
"project_id": "f627c399-379d-4d07-a6f6-90b7c9470ac0",
"task_id": "4d0d7ad1-91ce-44d0-abfe-6718422716dd",
"user_id": "5a2de667-243b-4da3-b090-b698a03d98da",
"notes": "Working on feature implementation",
"hours": 2.5,
"hourly_rate": 50
}
],
"issue_date": "12/25/2023",
"due_date": "01/25/2024",
"due_date_period": 30,
"interval": "monthly",
"notes": "Payment terms: Net 30 days",
"include_hours_by_person": true,
"include_hours_by_task": false,
"include_time_entries": true,
"send_automated_reminder_email": true,
"include_payment_link": true,
"payment_provider": "undefined",
"display_task_name": true,
"display_person_name": true,
"display_date": true,
"display_note": true,
"display_project_name": false,
"project_id": [
"89d1b47d9f36af3c9ecf",
"24e6a2fe31bb686c541a"
],
"send_email": true,
"invoice_details": {
"subject": "Invoice INV-EXT-001 from Your Company",
"message": "Please find attached your invoice for the services rendered.",
"attach_pdf_invoice": "true",
"send_me_a_copy": "false",
"recipient_ids": [
"128c1dfc-b29f-4fda-9a05-8a90e197b81b",
"6be815a8-9a10-455c-95d9-b0b548664420"
]
},
"tax_details": [
{
"name": "GST",
"percentage": 10,
"notes": "Goods and Services Tax",
"selected": true
}
]
}
'import requests
url = "https://{your-subdomain}.neetoinvoice.com/api/external/v1/clients/{client_id}/invoices"
payload = {
"email": "john@example.com",
"number": "INV-EXT-001",
"total": 500,
"invoice_time_entries": [
{
"time_entry_id": "128c1dfc-b29f-4fda-9a05-8a90e197b81b",
"project_id": "f627c399-379d-4d07-a6f6-90b7c9470ac0",
"task_id": "4d0d7ad1-91ce-44d0-abfe-6718422716dd",
"user_id": "5a2de667-243b-4da3-b090-b698a03d98da",
"notes": "Working on feature implementation",
"hours": 2.5,
"hourly_rate": 50
}
],
"issue_date": "12/25/2023",
"due_date": "01/25/2024",
"due_date_period": 30,
"interval": "monthly",
"notes": "Payment terms: Net 30 days",
"include_hours_by_person": True,
"include_hours_by_task": False,
"include_time_entries": True,
"send_automated_reminder_email": True,
"include_payment_link": True,
"payment_provider": "undefined",
"display_task_name": True,
"display_person_name": True,
"display_date": True,
"display_note": True,
"display_project_name": False,
"project_id": ["89d1b47d9f36af3c9ecf", "24e6a2fe31bb686c541a"],
"send_email": True,
"invoice_details": {
"subject": "Invoice INV-EXT-001 from Your Company",
"message": "Please find attached your invoice for the services rendered.",
"attach_pdf_invoice": "true",
"send_me_a_copy": "false",
"recipient_ids": ["128c1dfc-b29f-4fda-9a05-8a90e197b81b", "6be815a8-9a10-455c-95d9-b0b548664420"]
},
"tax_details": [
{
"name": "GST",
"percentage": 10,
"notes": "Goods and Services Tax",
"selected": True
}
]
}
headers = {
"X-Api-Key": "<x-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': '<x-api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
email: 'john@example.com',
number: 'INV-EXT-001',
total: 500,
invoice_time_entries: [
{
time_entry_id: '128c1dfc-b29f-4fda-9a05-8a90e197b81b',
project_id: 'f627c399-379d-4d07-a6f6-90b7c9470ac0',
task_id: '4d0d7ad1-91ce-44d0-abfe-6718422716dd',
user_id: '5a2de667-243b-4da3-b090-b698a03d98da',
notes: 'Working on feature implementation',
hours: 2.5,
hourly_rate: 50
}
],
issue_date: '12/25/2023',
due_date: '01/25/2024',
due_date_period: 30,
interval: 'monthly',
notes: 'Payment terms: Net 30 days',
include_hours_by_person: true,
include_hours_by_task: false,
include_time_entries: true,
send_automated_reminder_email: true,
include_payment_link: true,
payment_provider: 'undefined',
display_task_name: true,
display_person_name: true,
display_date: true,
display_note: true,
display_project_name: false,
project_id: ['89d1b47d9f36af3c9ecf', '24e6a2fe31bb686c541a'],
send_email: true,
invoice_details: {
subject: 'Invoice INV-EXT-001 from Your Company',
message: 'Please find attached your invoice for the services rendered.',
attach_pdf_invoice: 'true',
send_me_a_copy: 'false',
recipient_ids: ['128c1dfc-b29f-4fda-9a05-8a90e197b81b', '6be815a8-9a10-455c-95d9-b0b548664420']
},
tax_details: [{name: 'GST', percentage: 10, notes: 'Goods and Services Tax', selected: true}]
})
};
fetch('https://{your-subdomain}.neetoinvoice.com/api/external/v1/clients/{client_id}/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://{your-subdomain}.neetoinvoice.com/api/external/v1/clients/{client_id}/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([
'email' => 'john@example.com',
'number' => 'INV-EXT-001',
'total' => 500,
'invoice_time_entries' => [
[
'time_entry_id' => '128c1dfc-b29f-4fda-9a05-8a90e197b81b',
'project_id' => 'f627c399-379d-4d07-a6f6-90b7c9470ac0',
'task_id' => '4d0d7ad1-91ce-44d0-abfe-6718422716dd',
'user_id' => '5a2de667-243b-4da3-b090-b698a03d98da',
'notes' => 'Working on feature implementation',
'hours' => 2.5,
'hourly_rate' => 50
]
],
'issue_date' => '12/25/2023',
'due_date' => '01/25/2024',
'due_date_period' => 30,
'interval' => 'monthly',
'notes' => 'Payment terms: Net 30 days',
'include_hours_by_person' => true,
'include_hours_by_task' => false,
'include_time_entries' => true,
'send_automated_reminder_email' => true,
'include_payment_link' => true,
'payment_provider' => 'undefined',
'display_task_name' => true,
'display_person_name' => true,
'display_date' => true,
'display_note' => true,
'display_project_name' => false,
'project_id' => [
'89d1b47d9f36af3c9ecf',
'24e6a2fe31bb686c541a'
],
'send_email' => true,
'invoice_details' => [
'subject' => 'Invoice INV-EXT-001 from Your Company',
'message' => 'Please find attached your invoice for the services rendered.',
'attach_pdf_invoice' => 'true',
'send_me_a_copy' => 'false',
'recipient_ids' => [
'128c1dfc-b29f-4fda-9a05-8a90e197b81b',
'6be815a8-9a10-455c-95d9-b0b548664420'
]
],
'tax_details' => [
[
'name' => 'GST',
'percentage' => 10,
'notes' => 'Goods and Services Tax',
'selected' => true
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-Api-Key: <x-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://{your-subdomain}.neetoinvoice.com/api/external/v1/clients/{client_id}/invoices"
payload := strings.NewReader("{\n \"email\": \"john@example.com\",\n \"number\": \"INV-EXT-001\",\n \"total\": 500,\n \"invoice_time_entries\": [\n {\n \"time_entry_id\": \"128c1dfc-b29f-4fda-9a05-8a90e197b81b\",\n \"project_id\": \"f627c399-379d-4d07-a6f6-90b7c9470ac0\",\n \"task_id\": \"4d0d7ad1-91ce-44d0-abfe-6718422716dd\",\n \"user_id\": \"5a2de667-243b-4da3-b090-b698a03d98da\",\n \"notes\": \"Working on feature implementation\",\n \"hours\": 2.5,\n \"hourly_rate\": 50\n }\n ],\n \"issue_date\": \"12/25/2023\",\n \"due_date\": \"01/25/2024\",\n \"due_date_period\": 30,\n \"interval\": \"monthly\",\n \"notes\": \"Payment terms: Net 30 days\",\n \"include_hours_by_person\": true,\n \"include_hours_by_task\": false,\n \"include_time_entries\": true,\n \"send_automated_reminder_email\": true,\n \"include_payment_link\": true,\n \"payment_provider\": \"undefined\",\n \"display_task_name\": true,\n \"display_person_name\": true,\n \"display_date\": true,\n \"display_note\": true,\n \"display_project_name\": false,\n \"project_id\": [\n \"89d1b47d9f36af3c9ecf\",\n \"24e6a2fe31bb686c541a\"\n ],\n \"send_email\": true,\n \"invoice_details\": {\n \"subject\": \"Invoice INV-EXT-001 from Your Company\",\n \"message\": \"Please find attached your invoice for the services rendered.\",\n \"attach_pdf_invoice\": \"true\",\n \"send_me_a_copy\": \"false\",\n \"recipient_ids\": [\n \"128c1dfc-b29f-4fda-9a05-8a90e197b81b\",\n \"6be815a8-9a10-455c-95d9-b0b548664420\"\n ]\n },\n \"tax_details\": [\n {\n \"name\": \"GST\",\n \"percentage\": 10,\n \"notes\": \"Goods and Services Tax\",\n \"selected\": true\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-Api-Key", "<x-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://{your-subdomain}.neetoinvoice.com/api/external/v1/clients/{client_id}/invoices")
.header("X-Api-Key", "<x-api-key>")
.header("Content-Type", "application/json")
.body("{\n \"email\": \"john@example.com\",\n \"number\": \"INV-EXT-001\",\n \"total\": 500,\n \"invoice_time_entries\": [\n {\n \"time_entry_id\": \"128c1dfc-b29f-4fda-9a05-8a90e197b81b\",\n \"project_id\": \"f627c399-379d-4d07-a6f6-90b7c9470ac0\",\n \"task_id\": \"4d0d7ad1-91ce-44d0-abfe-6718422716dd\",\n \"user_id\": \"5a2de667-243b-4da3-b090-b698a03d98da\",\n \"notes\": \"Working on feature implementation\",\n \"hours\": 2.5,\n \"hourly_rate\": 50\n }\n ],\n \"issue_date\": \"12/25/2023\",\n \"due_date\": \"01/25/2024\",\n \"due_date_period\": 30,\n \"interval\": \"monthly\",\n \"notes\": \"Payment terms: Net 30 days\",\n \"include_hours_by_person\": true,\n \"include_hours_by_task\": false,\n \"include_time_entries\": true,\n \"send_automated_reminder_email\": true,\n \"include_payment_link\": true,\n \"payment_provider\": \"undefined\",\n \"display_task_name\": true,\n \"display_person_name\": true,\n \"display_date\": true,\n \"display_note\": true,\n \"display_project_name\": false,\n \"project_id\": [\n \"89d1b47d9f36af3c9ecf\",\n \"24e6a2fe31bb686c541a\"\n ],\n \"send_email\": true,\n \"invoice_details\": {\n \"subject\": \"Invoice INV-EXT-001 from Your Company\",\n \"message\": \"Please find attached your invoice for the services rendered.\",\n \"attach_pdf_invoice\": \"true\",\n \"send_me_a_copy\": \"false\",\n \"recipient_ids\": [\n \"128c1dfc-b29f-4fda-9a05-8a90e197b81b\",\n \"6be815a8-9a10-455c-95d9-b0b548664420\"\n ]\n },\n \"tax_details\": [\n {\n \"name\": \"GST\",\n \"percentage\": 10,\n \"notes\": \"Goods and Services Tax\",\n \"selected\": true\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{your-subdomain}.neetoinvoice.com/api/external/v1/clients/{client_id}/invoices")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-Api-Key"] = '<x-api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"email\": \"john@example.com\",\n \"number\": \"INV-EXT-001\",\n \"total\": 500,\n \"invoice_time_entries\": [\n {\n \"time_entry_id\": \"128c1dfc-b29f-4fda-9a05-8a90e197b81b\",\n \"project_id\": \"f627c399-379d-4d07-a6f6-90b7c9470ac0\",\n \"task_id\": \"4d0d7ad1-91ce-44d0-abfe-6718422716dd\",\n \"user_id\": \"5a2de667-243b-4da3-b090-b698a03d98da\",\n \"notes\": \"Working on feature implementation\",\n \"hours\": 2.5,\n \"hourly_rate\": 50\n }\n ],\n \"issue_date\": \"12/25/2023\",\n \"due_date\": \"01/25/2024\",\n \"due_date_period\": 30,\n \"interval\": \"monthly\",\n \"notes\": \"Payment terms: Net 30 days\",\n \"include_hours_by_person\": true,\n \"include_hours_by_task\": false,\n \"include_time_entries\": true,\n \"send_automated_reminder_email\": true,\n \"include_payment_link\": true,\n \"payment_provider\": \"undefined\",\n \"display_task_name\": true,\n \"display_person_name\": true,\n \"display_date\": true,\n \"display_note\": true,\n \"display_project_name\": false,\n \"project_id\": [\n \"89d1b47d9f36af3c9ecf\",\n \"24e6a2fe31bb686c541a\"\n ],\n \"send_email\": true,\n \"invoice_details\": {\n \"subject\": \"Invoice INV-EXT-001 from Your Company\",\n \"message\": \"Please find attached your invoice for the services rendered.\",\n \"attach_pdf_invoice\": \"true\",\n \"send_me_a_copy\": \"false\",\n \"recipient_ids\": [\n \"128c1dfc-b29f-4fda-9a05-8a90e197b81b\",\n \"6be815a8-9a10-455c-95d9-b0b548664420\"\n ]\n },\n \"tax_details\": [\n {\n \"name\": \"GST\",\n \"percentage\": 10,\n \"notes\": \"Goods and Services Tax\",\n \"selected\": true\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"invoice": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"number": "<string>",
"total": 123,
"status": "<string>",
"issue_date": "2023-12-25",
"due_date": "2023-12-25",
"notes": "<string>",
"client_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"organization_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}
}{your-subdomain} with your workspace’s subdomain. Learn how to find your subdomain in Workspace subdomain.
Headers
Use the X-Api-Key header to provide your workspace API key. Refer to Authentication for more information.
Path Parameters
Unique ID of the client for which you want to retrieve or update details. Refer to Getting the Client ID section for detailed instructions.
Body
- Time Entries
- Services
Email of the person creating the invoice.
"john@example.com"
Invoice identifier.
"INV-EXT-001"
Total amount of the invoice.
500
Array of time entries to include in the invoice.
Hide child attributes
Hide child attributes
ID of the time entry. Refer to Getting the Time Entry ID section for detailed instructions.
"128c1dfc-b29f-4fda-9a05-8a90e197b81b"
Unique ID of the project.
"f627c399-379d-4d07-a6f6-90b7c9470ac0"
Unique ID of the task. Refer to Getting the Task ID section for detailed instructions.
"4d0d7ad1-91ce-44d0-abfe-6718422716dd"
User ID for this time entry. Refer to Getting the User ID section for detailed instructions.
"5a2de667-243b-4da3-b090-b698a03d98da"
Notes for the time entry.
"Working on feature implementation"
Hours worked.
2.5
Hourly rate for this time entry.
50
Issue date of the invoice in MM/DD/YYYY format.
"12/25/2023"
Due date of the invoice in MM/DD/YYYY format.
"01/25/2024"
Due date period for the invoice in days.
30
Billing interval for the invoice.
"monthly"
Additional notes for the invoice.
"Payment terms: Net 30 days"
Whether to include hours breakdown by person.
true
Whether to include hours breakdown by task.
false
Whether to include detailed time entries.
true
Whether to send automated reminder emails.
true
Whether to include payment link in the invoice.
true
Payment provider for the invoice.
stripe, undefined "undefined"
Whether to display task names in the invoice.
true
Whether to display person names in the invoice.
true
Whether to display dates in the invoice.
true
Whether to display notes in the invoice.
true
Whether to display project names in the invoice.
false
Projects on which the invoice is to be generated. Refer to Getting the Project ID section for detailed instructions.
[
"89d1b47d9f36af3c9ecf",
"24e6a2fe31bb686c541a"
]
Whether to send the invoice via email. If true, invoice_details is required.
true
Email details for sending the invoice. Required when send_email is true.
Hide child attributes
Hide child attributes
Email subject for the invoice.
"Invoice INV-EXT-001 from Your Company"
Email message for the invoice.
"Please find attached your invoice for the services rendered."
Whether to attach PDF invoice.
true, false "true"
Whether to send a copy to the sender.
true, false "false"
Array of recipient IDs for email delivery. Refer to Getting the Recipient ID section for detailed instructions.
[
"128c1dfc-b29f-4fda-9a05-8a90e197b81b",
"6be815a8-9a10-455c-95d9-b0b548664420"
]
Array of tax details for the invoice.
Response
OK - Request succeeded
Hide child attributes
Hide child attributes