Tracking Delivery
After sending a document, track its journey through the Peppol network to confirm delivery.
Transaction Lifecycleโ
A document you send over the Peppol network is created as queued and finishes as
delivered or failed. A document that GoRoute issues for you to email instead, or
that goes to the tax authority only, is created as issued and stays there โ it is
finished, and it is never transmitted over Peppol.
Those below are the only status values the API uses โ there is no pending,
processing or sending state.
queued โโโถ submitted โโโถ delivered
โ
โโโโถ retrying โโโถ delivered or failed
โโโโถ failed
issued โโโถ (finished: you send the PDF yourself โ see below)
held โโโถ (prepared on purpose and not transmitted โ see below)
| Status | What it means | Terminal |
|---|---|---|
queued | Accepted by the API and waiting to be picked up for sending. | No |
submitted | Handed to the AS4 sender for transmission to the receiver's access point. | No |
accepted | The receiving side's AS4 acknowledgement has been recorded as a step of its own. Most sends never show this โ see the note below. | No |
delivered | The receiver's access point acknowledged the document. delivered_at is set. | Yes |
failed | The send did not succeed and will not be retried automatically. error_code, error_message and failed_at are set. You can ask for it to be delivered again yourself โ see Retrying the same transaction. | Yes |
retrying | A transport problem that may clear on its own. The send is retried up to three more times; after that the transaction becomes failed. | No |
issued | The document was built and stored for delivery by email rather than over the network, or it went to the tax authority only ("destination": "authority"). GoRoute will never transmit it over Peppol. Nothing has gone wrong. | Yes |
held | Built, stored and auditable, but deliberately not transmitted. Nothing has gone wrong. | No |
About accepted. For a document sent through this API the receiver's
acknowledgement comes back as part of the send itself, so a transaction normally
moves from submitted straight to delivered and accepted_at stays empty. The
acknowledgement is recorded on the transaction as receipt_message_id and
receipt_timestamp. See Proof of delivery below.
About issued. This is the one that most often catches people out, because it is an
ending that does not look like one. When you call POST /api/v1/invoices and the buyer
cannot be reached over Peppol, GoRoute builds the invoice, stores it, and hands it back to
you to send yourself โ usually as a ZUGFeRD or Factur-X PDF you attach to an email. The
transaction is then issued and nothing further will happen to it: no submitted, no
delivered, no failed, and no retry. Any code that waits for delivered or failed
must treat issued as a third ending, or it will wait forever. The response to the send
tells you this at the time, in a delivery object, and the transaction carries
delivery_channel: "email". How the choice is made, and how to fetch the PDF, is on
Delivery and formats.
A document sent with "destination": "authority" is also issued, with
delivery_channel: "authority", and it is not one for you to email: the tax authority's
answer is on the transaction's authority object, never on its status โ see
Spain (Verifactu) and
Poland (KSeF).
About held. A held document has been built, stored and made auditable, but was
never put on the network on purpose โ for example a tax report that is owed before
the tax authority's receiving endpoint is open, or an Oman B2C invoice that the rules
say must not be exchanged with a receiving access point. It is not a failure, and
nothing is retrying it. A document you received can show held too, for the short
time GoRoute checks it against the Peppol rules before handing it over to you; it then
becomes delivered, or failed with error_code MLS_CORE_REJECTED if it is refused. See
What the Peppol MLS means for your invoice.
How long each step takes depends on the receiving access point, so this page quotes no timings.
Checking Statusโ
Get Transaction Detailsโ
import requests
def get_transaction_status(transaction_id: str) -> dict:
"""Get current status of a transaction."""
response = requests.get(
f"https://app.goroute.ai/peppol-api/api/v1/transactions/{transaction_id}",
headers={"X-API-Key": "your_api_key"}
)
response.raise_for_status()
return response.json()
# Example usage. Transaction identifiers are UUIDs.
status = get_transaction_status("550e8400-e29b-41d4-a716-446655440000")
print(f"Status: {status['status']}")
print(f"Created: {status['created_at']}")
print(f"Updated: {status['updated_at']}")
Response Structureโ
The sender and receiver come back as single text fields holding
scheme:identifier, not as objects, and there are no company names in the
response. Errors come back as two separate fields, error_code and
error_message.
{
"id": "550e8400-e29b-41d4-a716-446655440000",
"org_id": "661f9511-f3ac-52e5-b827-557766551111",
"direction": "sent",
"status": "delivered",
"message_id": "550e8400-e29b-41d4-a716-446655440000@peppol.goroute.ai",
"sender_peppol_id": "9959:123456789",
"receiver_peppol_id": "9959:987654321",
"document_type": "urn:oasis:names:specification:ubl:schema:xsd:Invoice-2::Invoice",
"process_id": "urn:fdc:peppol.eu:2017:poacc:billing:01:1.0",
"document_hash": "9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08",
"document_size_bytes": 15420,
"metadata": {
"document_number": "INV-2026-00123"
},
"delivery_channel": "peppol",
"created_at": "2026-08-20T10:30:00Z",
"updated_at": "2026-08-20T10:30:05Z",
"submitted_at": "2026-08-20T10:30:01Z",
"accepted_at": null,
"delivered_at": "2026-08-20T10:30:05Z",
"failed_at": null,
"error_code": null,
"error_message": null,
"retry_count": 0,
"receipt_message_id": "receipt-123@receiver.example",
"receipt_timestamp": "2026-08-20T10:30:05Z",
"retention_expires_at": null,
"storage_present": null,
"storage_checked_at": null,
"clearance_status": null,
"mls_status": null,
"substitute_participant": null,
"substitute_reason": null
}
Fields worth knowing before you write your parsing:
| Field | Notes |
|---|---|
id | The transaction identifier, a UUID. |
sender_peppol_id, receiver_peppol_id | Text, in the form scheme:identifier. Empty if the transaction has no scheme or identifier recorded. |
metadata | Whatever you sent as metadata. The invoice number recorded by the send paths lives here under document_number. |
delivery_channel | Which route was chosen for the document: peppol when it was queued for the network, email when it was issued for you to send (the transaction is then issued), authority when it went to the tax authority only with "destination": "authority" (the transaction is then issued too). Otherwise it is null for documents that did not go through POST /api/v1/invoices โ raw UBL posted to POST /api/v1/documents, for example โ because no delivery decision was made for those. See Delivery and formats. |
error_code, error_message | Both plain text, both null unless the send failed. |
receipt_message_id, receipt_timestamp | The transport acknowledgement from the receiving access point. See Proof of delivery. |
retention_expires_at | When the statutory retention period for the record ends. Stamped on documents you receive and on Oman point-of-sale transactions; empty on an ordinary outbound send. |
storage_present, storage_checked_at | Whether the stored document was still retrievable when the storage sweep last looked, and when that was. Both null means nobody has looked yet โ which is not the same as the document being gone. |
clearance_status, mls_status, substitute_participant, substitute_reason | Oman tax-reporting outcomes. null for a document with no Oman reporting obligation. |
Polling for Statusโ
For asynchronous sends, poll until delivery is confirmed. There are three endings, not
two: delivered, issued and failed. A loop that only watches for delivered and
failed never returns for a document GoRoute issued for you to email.
import time
def wait_for_delivery(transaction_id: str, timeout: int = 120) -> dict:
"""Wait for transaction to reach terminal status."""
start_time = time.time()
while time.time() - start_time < timeout:
status = get_transaction_status(transaction_id)
if status["status"] == "delivered":
return status
# Terminal, and not a failure: the buyer is not reachable over Peppol,
# so the document was issued for you to email. Nothing more will happen
# to this transaction โ fetch the PDF and send it yourself.
if status["status"] == "issued":
return status
if status["status"] == "failed":
raise Exception(
f"Delivery failed ({status.get('error_code')}): "
f"{status.get('error_message')}"
)
# Wait before polling again
time.sleep(2)
raise TimeoutError(f"Transaction {transaction_id} did not complete within {timeout}s")
# Usage. Transaction identifiers are UUIDs โ there is no `txn_`-prefixed form.
result = wait_for_delivery("550e8400-e29b-41d4-a716-446655440000")
if result["status"] == "issued":
# delivered_at is null here; the document was never put on the network.
print("Issued for you to email โ download the PDF and send it")
else:
print(f"Delivered at: {result['delivered_at']}")
Webhooks (Recommended)โ
Instead of polling, receive status updates via webhooks:
Configure Webhookโ
The create call accepts four fields โ url, events, and optionally description and
metadata. It does not accept a secret: GoRoute generates one and returns it in this
response only. Save it immediately, because no later call will show you more than its first
eight characters.
# Register a webhook endpoint
response = requests.post(
"https://app.goroute.ai/peppol-api/api/v1/webhooks",
headers={
"X-API-Key": "your_api_key",
"Content-Type": "application/json"
},
json={
"url": "https://your-app.com/webhooks/goroute",
"events": ["transaction.delivered", "transaction.failed"],
"description": "Delivery tracking"
}
)
response.raise_for_status()
webhook = response.json()
save_webhook_secret(webhook["secret"]) # shown once, never again
Full details of registration, including the sandbox default of two webhooks โ which GoRoute can raise for your organisation on request, rather than it being a fixed rule โ are in Webhook Setup.
Webhook Eventsโ
These are the delivery-tracking events GoRoute actually sends. Each is subscribed to by exact name.
| Event | Description |
|---|---|
transaction.queued | Document accepted for processing |
transaction.delivered | Successfully delivered to the recipient's Access Point |
transaction.failed | Delivery failed terminally |
There is no event for validation starting or for transmission starting. Earlier revisions of
this page listed three names of that kind; none of them exists, and the create call rejects
an unknown event name with 422 Unprocessable Entity. The complete list of real events is in
the Webhook Events Reference.
Webhook Payloadโ
The event name is in a field called event_type. A handler that reads type fails on its
first line.
{
"id": "evt_2b3c4d5e6f708192a3b4c5d6e7f80912",
"event_type": "transaction.delivered",
"created_at": "2026-01-15T10:32:00.884210",
"data": {
"transaction_id": "550e8400-e29b-41d4-a716-446655440000",
"status": "delivered",
"message_id": "phase4-msg-abc123",
"receipt_message_id": "phase4-rcpt-def456",
"receiver_id": "0192:300000002"
}
}
A transaction.failed message carries transaction_id, status, error_code,
error_message and retry_count. Neither message contains your invoice number, so key your
own records on transaction_id โ see Store Transaction IDs.
created_at is UTC and carries no timezone suffix. Parse it as UTC.
Handle Webhooksโ
Two things to get right. The signature is in X-Webhook-Signature, and its value is
t=<timestamp>,v1=<hex digest> โ the digest is taken over the timestamp, a full stop, and
then the raw request body, not over the body alone. And the event name is in event_type.
import hashlib
import hmac
import time
from flask import Flask, request
app = Flask(__name__)
WEBHOOK_SECRET = load_webhook_secret() # the value saved when the webhook was created
def verify_signature(raw_body: bytes, header_value: str, secret: str,
tolerance_seconds: int = 300) -> bool:
if not header_value:
return False
parts = dict(
piece.split("=", 1)
for piece in header_value.split(",")
if "=" in piece
)
timestamp = parts.get("t")
received = parts.get("v1")
if not timestamp or not received:
return False
# Your own replay window. GoRoute does not enforce one.
if abs(time.time() - int(timestamp)) > tolerance_seconds:
return False
signed = timestamp.encode() + b"." + raw_body
expected = hmac.new(secret.encode(), signed, hashlib.sha256).hexdigest()
return hmac.compare_digest(expected, received)
@app.route("/webhooks/goroute", methods=["POST"])
def handle_webhook():
if not verify_signature(
request.get_data(),
request.headers.get("X-Webhook-Signature"),
WEBHOOK_SECRET,
):
return {"error": "Invalid signature"}, 401
event = request.get_json()
if event["event_type"] == "transaction.delivered":
handle_delivery(event["data"])
elif event["event_type"] == "transaction.failed":
handle_failure(event["data"])
return {"status": "ok"}
def handle_delivery(data):
"""Process successful delivery."""
transaction_id = data["transaction_id"]
# Update your database against the transaction ID you stored when sending.
db.update_invoice_status_by_transaction(transaction_id, "delivered")
logger.info(f"Transaction {transaction_id} delivered")
def handle_failure(data):
"""Process delivery failure."""
transaction_id = data["transaction_id"]
# Alert the team
notify_team(f"Delivery failed: {transaction_id}", data["error_message"])
# Decide for yourself whether to resend: a failed transaction is terminal.
# (Key on the event id: a webhook delivery can arrive more than once.)
queue_for_review(transaction_id, data["error_code"])
A GoRoute service with automatic retry sends a webhook your endpoint failed to accept up to
five more times, over about nine hours; its deliveries carry an X-Webhook-Attempt header.
A service without it attempts each delivery once: if your endpoint is down when it sends one
of these, the message is not re-sent for you, and you recover it yourself from the delivery
record โ see
Deliveries.
Either way, a webhook whose events fail ten times in a row is switched off, silently. See
Delivery, failure and recovery.
List Transactionsโ
Query your transaction history:
# List recent transactions
response = requests.get(
"https://app.goroute.ai/peppol-api/api/v1/transactions",
params={
"status": "delivered",
"page": 1,
"page_size": 100
},
headers={"X-API-Key": "your_api_key"}
)
result = response.json()
print(f"Total: {result['total']} across {result['pages']} page(s)")
for txn in result["items"]:
print(f"{txn['id']}: {txn['metadata'].get('document_number')} - {txn['status']}")
Query Parametersโ
Paging uses page and page_size. There is no limit or offset, and the date
filters are date_from and date_to โ in that order, not the other way round.
| Parameter | Type | Description |
|---|---|---|
page | integer | Page number, starting at 1. Default 1. |
page_size | integer | Results per page. Default 50, maximum 100. |
status | string | One of queued, submitted, accepted, delivered, failed, retrying, held, issued. |
direction | string | sent or received. |
sender_id | string | Sender identifier, matched exactly, without the scheme โ 123456789, not 9959:123456789. |
receiver_id | string | Receiver identifier, same rule as sender_id. |
participant | string | The other side of the exchange, matched against either the sender or the receiver. Case-insensitive, and a substring: a full scheme:identifier, the bare identifier, or a fragment of one all match. Use it when you want everything you have exchanged with one trading partner, in both directions. Use sender_id or receiver_id when you want an exact, one-sided match. The values to pass come from Counterparties. |
scope | string | Set it to group to read your whole group โ the calling organisation and every entity beneath it โ with the same filters and paging. Each row then carries an entity object of org_id and name saying which entity it belongs to; outside group scope entity is null. |
document_type | string | Partial, case-insensitive match on the document type identifier. |
date_from | string | Created on or after this time (ISO 8601). |
date_to | string | Created on or before this time (ISO 8601). |
invoice_number | string | The invoice number as it appears on your document, matched exactly. Use it to find a transaction again when you no longer have its identifier. |
source | string | Where the document came from, for example csv_import. |
import_job_id | string | Everything created by one bulk import job. |
exclude_reporting_legs | boolean | Leave out documents the platform files on your behalf โ Oman Tax Data Documents and eDEC message-level status receipts โ rather than ones you issued. Set it when you are showing an invoice register, so the rows and the totals agree. |
Response Envelopeโ
Lists come back in a page envelope, not a bare array:
{
"items": [],
"total": 128,
"page": 1,
"page_size": 50,
"pages": 3,
"has_next": true,
"has_prev": false
}
items holds transactions in the shape shown under
Response Structure.
Example: Find Failed Transactionsโ
# Get all failed transactions in the last 24 hours
from datetime import datetime, timedelta
yesterday = (datetime.utcnow() - timedelta(days=1)).isoformat() + "Z"
response = requests.get(
"https://app.goroute.ai/peppol-api/api/v1/transactions",
params={
"status": "failed",
"date_from": yesterday
},
headers={"X-API-Key": "your_api_key"}
)
failed = response.json()["items"]
print(f"Failed in last 24h: {len(failed)}")
for txn in failed:
print(f" {txn['id']}: {txn['error_code']} - {txn['error_message']}")
Once you have the list, see Retrying the same transaction and Resending a failed invoice for what you can do about them โ and, importantly, for the cases where a resend is not possible and a retry is.
Counterparties: who you actually trade withโ
The participant filter above takes a Peppol identifier, and nobody knows their customers by
0248:OM1100000964. This call returns the trading partners that actually appear in your own
traffic, each with the name your register already shows for it, so the filter can be a menu
instead of a text box.
GET /api/v1/transactions/counterparties
response = requests.get(
"https://app.goroute.ai/peppol-api/api/v1/transactions/counterparties",
params={"direction": "sent", "limit": 50},
headers={"X-API-Key": "your_api_key"},
)
for party in response.json()["counterparties"]:
label = party["name"] or party["peppol_id"]
print(f"{label} ({party['total']} documents)")
Requires the transactions:read permission.
Query parametersโ
| Parameter | Type | Description |
|---|---|---|
direction | string | sent gives the parties you invoice, received the parties that invoice you. Leave it out, or send it empty, for both. Matched case-insensitively. Anything else is refused โ see below. |
date_from | string | Only count documents exchanged on or after this time (ISO 8601). |
date_to | string | Only count documents exchanged on or before this time (ISO 8601). |
exclude_reporting_legs | boolean | Defaults to true here, unlike the transaction list, where it defaults to false. Documents the platform files on your behalf โ Oman Tax Data Documents, eDEC message-level status receipts โ are addressed to a tax authority, which is machine traffic rather than a trading partner anyone picks from a menu. Set it to false to see them. |
limit | integer | How many partners to return at most. Default 200, minimum 1, maximum 500. |
scope | string | group aggregates across your whole group, under the same gate and the same refusals as the transaction list. |
Responseโ
{
"counterparties": [
{
"peppol_id": "9959:987654321",
"name": "Customer Inc",
"sent": 42,
"received": 3,
"total": 45,
"last_seen": "2026-09-05T09:14:22Z"
}
],
"total": 1
}
| Field | Meaning |
|---|---|
peppol_id | The other party โ the receiver of a document you sent, the sender of one you received โ as scheme:identifier. Pass it straight back as participant on the transaction list. |
name | The name recorded by the most recent of that party's documents that carries one, however many nameless documents came after it. A bare AS4 receive carries identifiers and nothing else, so name is null only when none of the party's documents named it. |
sent, received | How many documents went each way inside the window you asked for. |
total | On a row, sent + received. |
last_seen | When you last exchanged a document with that party. |
Ordering and limit. Rows come back busiest first: by row total descending, then by name
with unnamed parties last, then by identifier. limit keeps the busiest. Where several parties
tie on total at the cut-off, the identifier decides which survive, because the name is
resolved after the cut.
One partner is one row. Identifiers are grouped without regard to upper or lower case,
because the participant filter matches that way too and the network is not consistent about
it. The spelling you get back is the one the most recent document used. A document that
recorded only one side of the exchange has no counterparty and is skipped, exactly as your
register shows "-" for it.
total is not a count of your partnersIt is the number of rows in counterparties, after limit has been applied. This call
answers a picker, not a pageable register, so do not render it as "you have N trading
partners". With the default limit of 200, an organisation with 900 partners still sees
"total": 200.
Refusal
| Status | error_code | When |
|---|---|---|
| 400 | INVALID_DIRECTION | direction was something other than sent, received or empty. A mistyped value is refused rather than answered with an empty list, because an empty picker looks like an organisation with no customers. |
Proof of deliveryโ
Three different things can be described as proof, and they answer different questions. This section says which is which and how to get each one.
Until August 2026 this page described a downloadable delivery receipt, reached by adding a receipt step to a transaction's web address, and showed a response with fields for a notification identifier, the receiving access point and a raw notification body. No such call has ever existed in this API, and neither did those fields. Anyone who wrote code against that description got a "not found" on the first call. It has been removed.
The vocabulary was also wrong. A Message Disposition Notification, or MDN, belongs to AS2, an older transport. Peppol uses AS4, so nothing in a Peppol exchange produces an MDN.
1. What the network acknowledgedโ
When the receiver's access point acknowledges the transmission, the acknowledgement
is recorded on the transaction itself. There is nothing extra to fetch: read
receipt_message_id and receipt_timestamp from the transaction you already have.
txn = get_transaction_status("550e8400-e29b-41d4-a716-446655440000")
if txn["status"] == "delivered":
print(f"Acknowledged by the receiving access point at {txn['receipt_timestamp']}")
print(f"Acknowledgement message id: {txn['receipt_message_id']}")
This is transport-level evidence: the receiving access point confirmed it took the message. It says nothing about what the buyer's finance system later decided about the invoice.
2. The document itselfโ
To get back the document that was exchanged, fetch its XML with /document/content. The
XML is the response body (Content-Type: application/xml).
response = requests.get(
f"https://app.goroute.ai/peppol-api/api/v1/transactions/{transaction_id}/document/content",
headers={"X-API-Key": "your_api_key"}
)
xml = response.text
Requires the transactions:read permission. For a document issued by email, this call returns
the EN 16931 CII by default; add syntax=ubl for the stored UBL. See
Getting the XML on its own.
The plain GET /api/v1/transactions/{transaction_id}/document call does not return the XML
on GoRoute's service. It returns JSON: a download_url for the stored file, valid for one hour
(expires_in_seconds: 3600), with content_type and filename. The link needs no API key to
follow, so treat it like the document itself. A deployment that keeps documents on local disk
returns the file directly instead.
If the transaction exists but no document was stored for it, the call answers 404
with the code DOCUMENT_NOT_STORED.