Invoice Comment Add API
curl --request POST \
--url https://api.pazy.io/v1.0/invoice/:invoiceId/commentimport requests
url = "https://api.pazy.io/v1.0/invoice/:invoiceId/comment"
response = requests.post(url)
print(response.text)const options = {method: 'POST'};
fetch('https://api.pazy.io/v1.0/invoice/:invoiceId/comment', 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.pazy.io/v1.0/invoice/:invoiceId/comment",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.pazy.io/v1.0/invoice/:invoiceId/comment"
req, _ := http.NewRequest("POST", url, nil)
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.pazy.io/v1.0/invoice/:invoiceId/comment")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.pazy.io/v1.0/invoice/:invoiceId/comment")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
response = http.request(request)
puts response.read_bodyInvoice APIs
Invoice Comment Add API
Add a comment to a specific invoice, with optional @-mentions of users
Invoice Comment Add API
curl --request POST \
--url https://api.pazy.io/v1.0/invoice/:invoiceId/commentimport requests
url = "https://api.pazy.io/v1.0/invoice/:invoiceId/comment"
response = requests.post(url)
print(response.text)const options = {method: 'POST'};
fetch('https://api.pazy.io/v1.0/invoice/:invoiceId/comment', 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.pazy.io/v1.0/invoice/:invoiceId/comment",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.pazy.io/v1.0/invoice/:invoiceId/comment"
req, _ := http.NewRequest("POST", url, nil)
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.pazy.io/v1.0/invoice/:invoiceId/comment")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.pazy.io/v1.0/invoice/:invoiceId/comment")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
response = http.request(request)
puts response.read_bodyAuthentication
All requests require an API key in the request headers. Headers:Authorization: Api-Key YOUR_API_KEY
Content-Type: application/json
Request
Content-Type:application/json
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
invoiceId | string | Yes | Unique identifier of the invoice to comment on |
Body Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
comment | string | Yes | The comment text (1–1500 characters). May contain @<userId> mentions — see Mentions below. |
Mentions
Comments support user mentions in the form@<userId> (the user’s id / slug). When rendered via the Invoice Comments API, valid @<userId> tokens are replaced with the user’s display name (e.g., @John Doe). Mentions whose user id does not exist in your organization are kept in the text as-is — they are not rejected.
Code Examples
curl -X POST https://api.pazy.io/v1.0/invoice/<invoiceId>/comment \
-H "Authorization: Api-Key YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"comment": "Please review this invoice @<userId>"
}'
const response = await fetch('https://api.pazy.io/v1.0/invoice/<invoiceId>/comment', {
method: 'POST',
headers: {
'Authorization': 'Api-Key YOUR_API_KEY',
'Content-Type': 'application/json'
},
body: JSON.stringify({
comment: 'Please review this invoice @<userId>'
})
});
const result = await response.json();
import requests
url = "https://api.pazy.io/v1.0/invoice/<invoiceId>/comment"
headers = {
"Authorization": "Api-Key YOUR_API_KEY",
"Content-Type": "application/json"
}
payload = { "comment": "Please review this invoice @<userId>" }
response = requests.post(url, headers=headers, json=payload)
result = response.json()
Success Response
HTTP Status:200 OK
Response Fields:
| Field | Type | Description |
|---|---|---|
ok | boolean | Indicates whether the request was successful |
insert | boolean | Indicates the comment was inserted on the invoice |
Response Example
{
"ok": true,
"insert": true
}
Error Responses
Missing Comment
HTTP Status:400 Bad Request
{
"ok": false,
"error": {
"code": "VALIDATION_ERROR",
"message": "Validation failed: /body: must have required property 'comment'"
}
}
Invalid Comment Type
HTTP Status:400 Bad Request
{
"ok": false,
"error": {
"code": "INVALID_TYPE",
"message": "Comment should be a string"
}
}
Invoice Not Found
HTTP Status:404 Not Found
{
"ok": false,
"error": {
"code": "INVOICE_NOT_FOUND",
"message": "Invoice not found"
}
}
Access Denied
HTTP Status:403 Forbidden
{
"ok": false,
"error": {
"code": "ACCESS_DENIED",
"message": "Access denied: You can only view your own invoices or invoices where you are the vendor owner"
}
}
Authentication Errors
HTTP Status:401 Unauthorized
{
"ok": false,
"error": {
"code": "MISSING_CREDENTIALS",
"message": "Missing Credentials"
}
}
{
"ok": false,
"error": {
"code": "INVALID_API_KEY",
"message": "Invalid API Key"
}
}
Permission Errors
HTTP Status:403 Forbidden
{
"ok": false,
"error": {
"code": "INSUFFICIENT_PERMISSIONS",
"message": "Permission check failed - PERMISSION_CHECK_FAILED"
}
}
Internal Error
HTTP Status:500 Internal Server Error
{
"ok": false,
"error": {
"code": "INTERNAL_ERROR",
"message": "Internal error"
}
}
Best Practices
- Keep comments under 1500 characters — longer text is rejected with
VALIDATION_ERROR - Use
@<userId>to address specific users — fetch the id from the User List API or User Details API - The comment author is the user tied to the API key — there is no
userIdfield in the body - Use the Invoice Comments API to retrieve the thread with mentions resolved to user names
Was this page helpful?