/v1/invoices/{id}/forwardsAnnounces one file of this invoice to this company’s webhooks as the history step api:forwarded, with the link to download it. The file is not in the post: your system fetches it from href with its API key.
The file is announced only when the invoice’s newest check accepts it, as for a download of an invoice not sent yet. An invoice already sent stays downloadable on the check it was sent with, but forwarding it again needs the newest check. At least one live webhook must hear api:forwarded.
Path parameters
- idstring (uuid)Required
Headers
- Idempotency-Keystring
The same key and body again is answered with the first answer, and nothing is done twice. The same key with another body is 409
idempotency_key_reused; while the first is still being done, 409request_in_progress. A key over 255 characters is 400invalid_idempotency_key. Without a key, every request is done.
Request body
application/json, required
- formatstringRequiredOne of
original,ubl,cii,zugferd-pdf,peppol,en16931-ubl,en16931-cii,factur-x,extended-cii,zugferd-extended.
Response
A 202 answer carries these fields.
- eventIdstring or nullRequired
- formatstringRequired
Status codes
| Status | Meaning |
|---|---|
202 |
The step was added; the webhooks post it. |
400 |
The body is not JSON (invalid_json), or is not one invoice file (invalid_forward). Nothing was sent. |
401 |
No usable credential was sent (invalid_credentials). |
404 |
No such invoice exists for this company, or it has no file of that format (unknown_invoice). |
409 |
The file may not leave, for the reason the download gives (invoice_rejected, invoice_not_validated, invoice_changed_since_check), it cannot be written in that format (conversion_would_be_incomplete), no live webhook hears api:forwarded (no_webhook_for_forwards), your settings hold this received invoice for its bank account (invoice_on_hold), or an edit replaced this version (invoice_replaced; the message names the newest version). Nothing was sent. A repeat with the same Idempotency-Key and another body (idempotency_key_reused), or while the first is still being done (request_in_progress; send it again in a moment). Nothing was done twice. |
/v1/invoices/{id}/forwardscurl -X POST https://api.certinvo.com/v1/invoices/$INVOICE_ID/forwards \
-H "Authorization: Bearer $CERTINVO_API_KEY" \
-H "Content-Type: application/json" \
--data-binary @body.jsonimport { readFile } from 'node:fs/promises'
const invoiceId = '3f0c2a5e-8d1b-4c7a-9e2f-6b5d4a3c2b1a'
const response = await fetch(`https://api.certinvo.com/v1/invoices/${invoiceId}/forwards`, {
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
invoice_id = "3f0c2a5e-8d1b-4c7a-9e2f-6b5d4a3c2b1a"
response = requests.post(
f"https://api.certinvo.com/v1/invoices/{invoice_id}/forwards",
headers={"Authorization": f"Bearer {os.environ['CERTINVO_API_KEY']}", "Content-Type": "application/json"},
data=open("body.json", "rb"),
)
print(response.status_code, response.text){
"eventId": "string",
"format": "string"
}