When suppliers invoice you through Peppol, ArdentaxIT can export each document to `received_inbox` for ERP import. This guide covers polling, deduplication, and syncing PDF/XML.
Prerequisites
SFTP enabled on your account
Received document connector mapping configured for routing TIN and file format (Prepare §5)
ERP staging tables for purchase invoices and credit notes
For the first sandbox file, see Inbound sandbox (Peppol delivery — not an SFTP upload trigger)
Inbound file naming
List the inbox for new files:
sftp -P <port> <username>@<sftp-host> <<'EOF'
ls received_inbox
bye
EOFInbox vs index timing
For a new Peppol receipt, ArdentaxIT writes `received_inbox/{document_uuid}.*`, then `received_archive/{document_uuid}_index.*`, and fills the folder at `retrieval_path` (PDF/XML and API artifacts) as part of the same delivery. In practice:
Poll `received_inbox/` for new
{uuid}files as the primary “ready to import” signal.If the inbox file exists but `{uuid}_index.*` is missing, wait and retry once or twice — the index should appear immediately after the inbox file in normal operation.
You may import from the inbox file alone; use the index when you need
peppol_status,retrieval_path, or a wider payload mirror.
Processing loop
List
received_inbox/and diff against a local processed ledger (file or database table of UUIDs).For each new
{uuid}.jsonor.xlsx:Download the inbox file → parse into ERP purchase document.
Download
received_archive/{uuid}_index.*when present forpeppol_statusandretrieval_path.Fetch PDF/XML from
retrieval_path(underreceived_archive/{TIN}/Peppol/.../{uuid}/).
On successful ERP post, record the UUID in the ledger.
Remove or archive the inbox file on your side (ArdentaxIT may retain copies under
received_archiveuntil retention purge).
Idempotency
Use
document_uuidas the natural key. Never create duplicate ERP vouchers for the same UUID.If ERP import fails, do not add the UUID to the ledger; retry on the next poll.
Partial imports should be rolled back or marked in ERP workflow before retry.
Shell sketch
#!/usr/bin/env bash
set -euo pipefail
HOST="<sftp-host>"
PORT="<port>"
USER="<username>"
LEDGER="/var/lib/sftp-integration/received.uuids"
WORKDIR="/tmp/sftp-received"
mkdir -p "$WORKDIR"
LISTING=$(mktemp)
sftp -P "$PORT" -b - "${USER}@${HOST}" <<EOF > "$LISTING"
ls received_inbox
bye
EOF
while read -r name; do
[[ "$name" == *.json || "$name" == *.xlsx ]] || continue
uuid="${name%.*}"
if grep -qxF "$uuid" "$LEDGER" 2>/dev/null; then
continue
fi
sftp -P "$PORT" -b - "${USER}@${HOST}" <<EOF
get received_inbox/${name} ${WORKDIR}/${name}
bye
EOF
# invoke your ERP import: import_received.sh "${WORKDIR}/${name}"
# on success:
# echo "$uuid" >> "$LEDGER"
done < <(awk 'NF {print $NF}' "$LISTING" | grep -v '^\.' || true)Replace the comment with your ERP integration. Download received_archive/${uuid}_index.json when you need peppol_status before posting.
Syncing Peppol status to ERP
For draft posting, the `received_inbox/{uuid}` payload is enough when the file appears. For clearance-gated workflows (block payment until Peppol is final), wait until the index shows a terminal peppol_status (ACCEPTED, REJECTED, or VALIDATION_FAILED), not `NULL`.
Inbound indexes use the same `peppol_status` vocabulary as outbound: `NULL` while processing, then terminal `ACCEPTED`, `REJECTED`, or `VALIDATION_FAILED`. `NA` is uncommon on inbound but treat it as terminal if present.
Retention
received_archive and completed inbox exports fall under the same ~60-day rolling retention as outbound archives. Mirror PDF/XML into your ERP or document store promptly.
Failure handling
Next steps
Prepare to integrate — received connector mapping
