POST
/v1/invoice-eventsWrites one code into the history of each named invoice, such as api:paid to mark a selection paid. The codes are the ones POST /v1/invoices/{id}/events takes. An invoice whose history already holds the code is answered in already and gets no second entry. An id this company has no invoice for is answered in unknown.
Request body
application/json, required
- codestringRequired
- invoiceIdsarray of stringRequired
- notestring
Response
A 201 answer carries these fields.
- recordedarray of objectRequired
Show 2 child fields
- invoiceIdstring (uuid)Required
- eventIdstringRequired
- alreadyarray of stringRequired
- unknownarray of stringRequired
Status codes
| Status | Meaning |
|---|---|
201 |
What was written. |
400 |
|
401 |
|
501 |
POST
/v1/invoice-eventsExample
curl -X POST https://api.certinvo.com/v1/invoice-events \
-H "Authorization: Bearer $CERTINVO_API_KEY" \
-H "Content-Type: application/json" \
--data-binary @body.jsonimport { readFile } from 'node:fs/promises'
const response = await fetch(`https://api.certinvo.com/v1/invoice-events`, {
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.CERTINVO_API_KEY}`,
'Content-Type': 'application/json',
},
body: await readFile('body.json'),
})
console.log(response.status, await response.json())import os
import requests
response = requests.post(
"https://api.certinvo.com/v1/invoice-events",
headers={"Authorization": f"Bearer {os.environ['CERTINVO_API_KEY']}", "Content-Type": "application/json"},
data=open("body.json", "rb"),
)
print(response.status_code, response.text)201
application/json
{
"recorded": [
{
"invoiceId": "3f0c2a5e-8d1b-4c7a-9e2f-6b5d4a3c2b1a",
"eventId": "string"
}
],
"already": [
"string"
],
"unknown": [
"string"
]
}Success response