Skip to main content
PUT
/
invoices
/
{invoice_id}
Update Invoice
curl --request PUT \
  --url https://api.everhour.com/invoices/{invoice_id} \
  --header 'Content-Type: application/json' \
  --header 'X-Api-Key: <api-key>' \
  --data '
{
  "publicId": "1020",
  "issueDate": "2019-03-20",
  "dueDate": "2019-03-20",
  "reference": "contract",
  "publicNotes": "<string>",
  "tax": {
    "id": 123,
    "rate": 11
  },
  "discount": 25,
  "showRowNumbers": true,
  "invoiceItems": [
    {
      "id": 52,
      "name": "Software Development",
      "billedTime": 415860,
      "listAmount": 288793,
      "taxable": false,
      "position": 1
    }
  ]
}
'
import requests

url = "https://api.everhour.com/invoices/{invoice_id}"

payload = {
"publicId": "1020",
"issueDate": "2019-03-20",
"dueDate": "2019-03-20",
"reference": "contract",
"publicNotes": "<string>",
"tax": {
"id": 123,
"rate": 11
},
"discount": 25,
"showRowNumbers": True,
"invoiceItems": [
{
"id": 52,
"name": "Software Development",
"billedTime": 415860,
"listAmount": 288793,
"taxable": False,
"position": 1
}
]
}
headers = {
"X-Api-Key": "<api-key>",
"Content-Type": "application/json"
}

response = requests.put(url, json=payload, headers=headers)

print(response.text)
const options = {
method: 'PUT',
headers: {'X-Api-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
publicId: '1020',
issueDate: '2019-03-20',
dueDate: '2019-03-20',
reference: 'contract',
publicNotes: '<string>',
tax: {id: 123, rate: 11},
discount: 25,
showRowNumbers: true,
invoiceItems: [
{
id: 52,
name: 'Software Development',
billedTime: 415860,
listAmount: 288793,
taxable: false,
position: 1
}
]
})
};

fetch('https://api.everhour.com/invoices/{invoice_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.everhour.com/invoices/{invoice_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'publicId' => '1020',
'issueDate' => '2019-03-20',
'dueDate' => '2019-03-20',
'reference' => 'contract',
'publicNotes' => '<string>',
'tax' => [
'id' => 123,
'rate' => 11
],
'discount' => 25,
'showRowNumbers' => true,
'invoiceItems' => [
[
'id' => 52,
'name' => 'Software Development',
'billedTime' => 415860,
'listAmount' => 288793,
'taxable' => false,
'position' => 1
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-Api-Key: <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.everhour.com/invoices/{invoice_id}"

payload := strings.NewReader("{\n \"publicId\": \"1020\",\n \"issueDate\": \"2019-03-20\",\n \"dueDate\": \"2019-03-20\",\n \"reference\": \"contract\",\n \"publicNotes\": \"<string>\",\n \"tax\": {\n \"id\": 123,\n \"rate\": 11\n },\n \"discount\": 25,\n \"showRowNumbers\": true,\n \"invoiceItems\": [\n {\n \"id\": 52,\n \"name\": \"Software Development\",\n \"billedTime\": 415860,\n \"listAmount\": 288793,\n \"taxable\": false,\n \"position\": 1\n }\n ]\n}")

req, _ := http.NewRequest("PUT", url, payload)

req.Header.Add("X-Api-Key", "<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.put("https://api.everhour.com/invoices/{invoice_id}")
.header("X-Api-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"publicId\": \"1020\",\n \"issueDate\": \"2019-03-20\",\n \"dueDate\": \"2019-03-20\",\n \"reference\": \"contract\",\n \"publicNotes\": \"<string>\",\n \"tax\": {\n \"id\": 123,\n \"rate\": 11\n },\n \"discount\": 25,\n \"showRowNumbers\": true,\n \"invoiceItems\": [\n {\n \"id\": 52,\n \"name\": \"Software Development\",\n \"billedTime\": 415860,\n \"listAmount\": 288793,\n \"taxable\": false,\n \"position\": 1\n }\n ]\n}")
.asString();
require 'uri'
require 'net/http'

url = URI("https://api.everhour.com/invoices/{invoice_id}")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Put.new(url)
request["X-Api-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"publicId\": \"1020\",\n \"issueDate\": \"2019-03-20\",\n \"dueDate\": \"2019-03-20\",\n \"reference\": \"contract\",\n \"publicNotes\": \"<string>\",\n \"tax\": {\n \"id\": 123,\n \"rate\": 11\n },\n \"discount\": 25,\n \"showRowNumbers\": true,\n \"invoiceItems\": [\n {\n \"id\": 52,\n \"name\": \"Software Development\",\n \"billedTime\": 415860,\n \"listAmount\": 288793,\n \"taxable\": false,\n \"position\": 1\n }\n ]\n}"

response = http.request(request)
puts response.read_body
{
  "id": 2660155,
  "client": {
    "id": 4567,
    "name": "Client Name",
    "projects": [
      "ev:1234567890"
    ],
    "businessDetails": "<string>",
    "budget": {
      "type": "money",
      "budget": 100000,
      "period": "general",
      "appliedFrom": "<string>",
      "disallowOverbudget": true,
      "excludeUnbillableTime": true,
      "excludeExpenses": true,
      "threshold": 123,
      "progress": 0
    }
  },
  "createdAt": "2018-01-16 12:42:59",
  "createdBy": {
    "id": 1304,
    "name": "User Name",
    "role": "admin",
    "status": "active",
    "headline": "CEO",
    "avatarUrl": "<string>",
    "phone": "<string>",
    "capacity": 123,
    "avatarUrlLarge": "<string>"
  },
  "status": "draft",
  "dateFrom": "<string>",
  "dateTill": "<string>",
  "dueDate": "<string>",
  "discount": {
    "amount": 4581,
    "rate": 25
  },
  "expenseMask": "%PROJECT% :: %CATEGORY%",
  "includeExpenses": true,
  "includeTime": true,
  "invoiceItems": [
    {
      "billedTime": 415860,
      "createdAt": "2017-02-22 16:11:33",
      "custom": false,
      "id": 52,
      "listAmount": 288793,
      "name": "Software Development",
      "netAmount": 288793,
      "position": 1,
      "taxable": 1,
      "totalAmount": 288793
    }
  ],
  "issueDate": "2019-03-22",
  "limitDateFrom": "<string>",
  "limitDateTill": "<string>",
  "listAmount": 18325,
  "netAmount": 13744,
  "projects": [
    "gh:63301595"
  ],
  "publicId": "1020",
  "tax": {
    "id": 123,
    "rate": 11,
    "amount": 1512
  },
  "timeMask": "%PROJECT%",
  "totalAmount": 15256,
  "totalTime": 43980,
  "valid": true
}

Authorizations

X-Api-Key
string
header
required

Path Parameters

invoice_id
number
required

Invoice ID

Example:

11903

Body

application/json
publicId
string
Example:

"1020"

issueDate
string
Example:

"2019-03-20"

dueDate
string
Example:

"2019-03-20"

reference
string
Example:

"contract"

publicNotes
string
tax
object

Tax to apply. Set rate (percentage), or id to reference a tax from a connected accounting integration.

discount
number

Discount rate as a percentage (0-100)

Example:

25

manualStatus
enum<string>

Manually set the invoice status. Overrides the automatically derived status.

Available options:
draft,
sent,
paid
showRowNumbers
boolean
invoiceItems
object[]

Response

OK

id
number
required

Invoice ID

Example:

2660155

client
object
required
createdAt
string
required
Example:

"2018-01-16 12:42:59"

createdBy
object
required
status
enum<string>
required
Available options:
draft,
sent,
paid,
deleted,
partial
Example:

"draft"

dateFrom
string
dateTill
string
dueDate
string
discount
object
expenseMask
string
Example:

"%PROJECT% :: %CATEGORY%"

includeExpenses
boolean
Example:

true

includeTime
boolean
Example:

true

invoiceItems
object[]
issueDate
string
Example:

"2019-03-22"

limitDateFrom
string
limitDateTill
string
listAmount
number

List amount in cents (without discount and taxes)

Example:

18325

netAmount
number

Net amount in cents (without taxes but with discount applied)

Example:

13744

projects
string[]
Example:
["gh:63301595"]
publicId
string
Example:

"1020"

tax
object
timeMask
string
Example:

"%PROJECT%"

totalAmount
number

Total invoice amount in cents (with discount and taxes applied)

Example:

15256

totalTime
number

Total invoice time in seconds

Example:

43980

valid
boolean
Example:

true