Skip to content

API reference

Forward an invoice to your own system

Invoices API

POST/v1/invoices/{id}/forwards

Announces 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, 409 request_in_progress. A key over 255 characters is 400 invalid_idempotency_key. Without a key, every request is done.

Request body

application/json, required

  • formatstringRequired
    One 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.
POST/v1/invoices/{id}/forwards
Example
curl -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.json
import { 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)
202
application/json
{
  "eventId": "string",
  "format": "string"
}
Success response
POST
/v1/invoices/{id}/forwards
Forward an invoice to your own system
All
›AuthenticationRequiredBearerAuth

Provide your API key in the Authorization: Bearer <key> header. Keys are stored locally in your browser.

›Variables1
›Headers2
›Bodyapplication/json
›Code Snippet
curl -X POST "https://api.certinvo.com/v1/invoices/{id}/forwards" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "format": "original"
}...'
Response

No request sent yet

Configure parameters and click Send to view the response.

Navigation

Type to search…

↑↓ navigate↵ selectEsc close