Skip to main content
PUT
/
cleemy-procurement
/
api
/
invoices
/
{id}
Update Invoice
curl --request PUT \
  --url https://{host}/cleemy-procurement/api/invoices/{id} \
  --header 'Authorization: <authorization>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "dueDate": "2023-12-25",
  "paymentDate": "2023-12-25",
  "paymentDetails": {
    "bankAccount": {
      "iban": "<string>",
      "bic": "<string>"
    }
  },
  "documentDate": "2023-12-25",
  "documentNumber": "<string>",
  "accountingLabel": "<string>",
  "comment": "<string>",
  "intraCommunityTaxes": true
}
'
import requests

url = "https://{host}/cleemy-procurement/api/invoices/{id}"

payload = {
"dueDate": "2023-12-25",
"paymentDate": "2023-12-25",
"paymentDetails": { "bankAccount": {
"iban": "<string>",
"bic": "<string>"
} },
"documentDate": "2023-12-25",
"documentNumber": "<string>",
"accountingLabel": "<string>",
"comment": "<string>",
"intraCommunityTaxes": True
}
headers = {
"Authorization": "<authorization>",
"Content-Type": "application/json"
}

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

print(response.text)
const options = {
method: 'PUT',
headers: {Authorization: '<authorization>', 'Content-Type': 'application/json'},
body: JSON.stringify({
dueDate: '2023-12-25',
paymentDate: '2023-12-25',
paymentDetails: {bankAccount: {iban: '<string>', bic: '<string>'}},
documentDate: '2023-12-25',
documentNumber: '<string>',
accountingLabel: '<string>',
comment: '<string>',
intraCommunityTaxes: true
})
};

fetch('https://{host}/cleemy-procurement/api/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://{host}/cleemy-procurement/api/invoices/{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([
'dueDate' => '2023-12-25',
'paymentDate' => '2023-12-25',
'paymentDetails' => [
'bankAccount' => [
'iban' => '<string>',
'bic' => '<string>'
]
],
'documentDate' => '2023-12-25',
'documentNumber' => '<string>',
'accountingLabel' => '<string>',
'comment' => '<string>',
'intraCommunityTaxes' => true
]),
CURLOPT_HTTPHEADER => [
"Authorization: <authorization>",
"Content-Type: application/json"
],
]);

$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://{host}/cleemy-procurement/api/invoices/{id}"

payload := strings.NewReader("{\n \"dueDate\": \"2023-12-25\",\n \"paymentDate\": \"2023-12-25\",\n \"paymentDetails\": {\n \"bankAccount\": {\n \"iban\": \"<string>\",\n \"bic\": \"<string>\"\n }\n },\n \"documentDate\": \"2023-12-25\",\n \"documentNumber\": \"<string>\",\n \"accountingLabel\": \"<string>\",\n \"comment\": \"<string>\",\n \"intraCommunityTaxes\": true\n}")

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

req.Header.Add("Authorization", "<authorization>")
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://{host}/cleemy-procurement/api/invoices/{id}")
.header("Authorization", "<authorization>")
.header("Content-Type", "application/json")
.body("{\n \"dueDate\": \"2023-12-25\",\n \"paymentDate\": \"2023-12-25\",\n \"paymentDetails\": {\n \"bankAccount\": {\n \"iban\": \"<string>\",\n \"bic\": \"<string>\"\n }\n },\n \"documentDate\": \"2023-12-25\",\n \"documentNumber\": \"<string>\",\n \"accountingLabel\": \"<string>\",\n \"comment\": \"<string>\",\n \"intraCommunityTaxes\": true\n}")
.asString();
require 'uri'
require 'net/http'

url = URI("https://{host}/cleemy-procurement/api/invoices/{id}")

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

request = Net::HTTP::Put.new(url)
request["Authorization"] = '<authorization>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"dueDate\": \"2023-12-25\",\n \"paymentDate\": \"2023-12-25\",\n \"paymentDetails\": {\n \"bankAccount\": {\n \"iban\": \"<string>\",\n \"bic\": \"<string>\"\n }\n },\n \"documentDate\": \"2023-12-25\",\n \"documentNumber\": \"<string>\",\n \"accountingLabel\": \"<string>\",\n \"comment\": \"<string>\",\n \"intraCommunityTaxes\": true\n}"

response = http.request(request)
puts response.read_body
{
  "id": 123,
  "type": "<string>",
  "purchase": {
    "id": 123,
    "href": "<string>",
    "name": "<string>"
  },
  "expectedAmount": {
    "base": {
      "value": 123
    },
    "counter": {
      "value": 123
    },
    "rate": 123
  },
  "costAmount": {
    "base": {
      "value": 123
    },
    "counter": {
      "value": 123
    },
    "rate": 123
  },
  "context": {
    "purchase": {
      "id": 123,
      "href": "<string>",
      "name": "<string>"
    },
    "expectedDocumentId": 2,
    "originalAmount": {
      "value": 123
    },
    "data": {}
  },
  "documentDate": "2023-12-25",
  "documentNumber": "<string>",
  "amountIncludingTaxes": {
    "base": {
      "excludingTaxes": {
        "value": 123
      },
      "taxes": [
        {
          "rateTypeId": 123,
          "value": 123
        }
      ],
      "includingTaxes": {
        "value": 123
      }
    },
    "counter": {
      "excludingTaxes": {
        "value": 123
      },
      "taxes": [
        {
          "rateTypeId": 123,
          "value": 123
        }
      ],
      "includingTaxes": {
        "value": 123
      }
    },
    "rate": 123
  },
  "documentBreakdown": {
    "id": 2,
    "href": "<string>",
    "name": "<string>"
  },
  "attachments": [
    {
      "id": 123,
      "file": {
        "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
        "href": "<string>",
        "name": "<string>",
        "displayHref": "<string>"
      },
      "createdAt": "2023-11-07T05:31:56Z",
      "pages": {
        "displayHrefTemplate": "<string>",
        "count": 123
      }
    }
  ],
  "dueDate": "2023-12-25",
  "paymentDetails": {
    "bankAccount": {
      "iban": "<string>",
      "bic": "<string>"
    }
  },
  "paymentDate": "2023-12-25",
  "accountingLabel": "<string>",
  "comment": "<string>",
  "commentsCount": 1,
  "createdAt": "2023-11-07T05:31:56Z",
  "author": {
    "id": 123,
    "href": "<string>",
    "name": "<string>",
    "firstName": "<string>",
    "lastName": "<string>",
    "pictureHref": "<string>"
  },
  "modifiedAt": "2023-11-07T05:31:56Z",
  "modifier": {
    "id": 123,
    "href": "<string>",
    "name": "<string>",
    "firstName": "<string>",
    "lastName": "<string>",
    "pictureHref": "<string>"
  }
}

Headers

Authorization
string
required

API key. Value must be formatted like so: lucca application={api_key}.

Path Parameters

id
integer<int32>
required

ID of the invoice.

Body

application/json

Invoice fields to update.

Editable fields of an invoice.

dueDate
string<date>
paymentDate
string<date> | null
paymentDetails
object | null
documentDate
string<date>
documentNumber
string
accountingLabel
string | null
comment
string | null
intraCommunityTaxes
boolean

Response

200 - application/json

OK

id
integer<int32>
read-only
type
string
read-only
Allowed value: "Invoice"
purchase
Reference to a purchase · object

Reference to a purchase.

expectedAmount
dual-currency-amount · object

Represents an amount of money in two different currencies.

costAmount
dual-currency-amount · object

Represents an amount of money in two different currencies.

context
Booked document context · object
documentDate
string<date>
documentNumber
string
amountIncludingTaxes
Dual currency taxed amount · object

Represents an amount of money with VAT taxes in two different currencies.

documentBreakdown
Reference to a document-breakdown. · object
attachments
attachment · object[]
Required array length: 1 - 3 elements
dueDate
string<date>
paymentDetails
object
conformityState
enum<string>
Available options:
ToReview,
PendingBreakdown,
Confirmed,
Litigation,
Discarded,
Removed,
Bypassed
paymentState
enum<string>
Available options:
None,
ToPay,
UnderReview,
Emitting,
Paid,
OnHold,
Rejected,
Cancelled
paymentDate
string<date> | null
completion
enum<string>
Available options:
ToReview,
Partial,
Disputed,
Complete
flag
enum<string>
Available options:
Unflagged,
Flagged
accountingLabel
string | null
comment
string | null
commentsCount
integer<int32>
Required range: x >= 0
createdAt
string<date-time>
read-only
author
Reference to a user · object

Reference to a user.

modifiedAt
string<date-time>
read-only
modifier
Reference to a user · object

Reference to a user.