Skip to main content
Trade partners sometimes send updated versions of a document they already sent — for example, a revised order with a changed quantity or an amended invoice. Procuros detects these and links the old and new versions together automatically. Every transaction returned by the API includes three fields that tell you where it sits in that version chain:
FieldTypeDescription
isLatestVersionbooleantrue if no newer version exists. false if this document has been superseded.
replacesProcurosTransactionIduuid | nullThe ID of the older transaction this one replaces. null if this is the original document.
replacedByProcurosTransactionIduuid | nullThe ID of the newer transaction that replaced this one. null if this is still the current version.
Always check isLatestVersion before importing a document into your system. If the value is false, a newer version of the document is already available and the one you are looking at should be skipped or voided.
php
foreach ($body->items as $transaction) {
    if (!$transaction->isLatestVersion) {
        // A newer version exists — skip or void this document
        continue;
    }

    // Safe to import
    importTransaction($transaction);
}
If isLatestVersion is false and the document was already imported, you can use replacedByProcurosTransactionId to identify the newer version. The newer version will also appear as a separate pending transaction on GET /v2/transactions, so no additional API call is needed — simply skip the outdated document and process the newer one when it comes up.
php
if (!$transaction->isLatestVersion) {
    // A newer version will arrive (or has already arrived) as its own pending transaction.
    // Skip this outdated document, or void it if it was already imported.
    continue;
}

Version Chain Example

Given three versions of the same order:
procurosTransactionIdreplacesProcurosTransactionIdreplacedByProcurosTransactionIdisLatestVersion
aaa-111nullbbb-222false
bbb-222aaa-111ccc-333false
ccc-333bbb-222nulltrue
Only ccc-333 should be imported. The earlier versions can be safely skipped or voided.
When polling via GET /v2/transactions (pending transactions), superseded documents are removed from the queue automatically. The isLatestVersion flag is still included for completeness and will always be true for pending transactions.