> For the complete documentation index, see [llms.txt](https://docs.eu-pactum.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.eu-pactum.com/procurement-api/programmatic-event-export.md).

# Programmatic event export

An API based approach to supplement the limited CSV exporting capability to keep your systems up to date with changes to negotiation events.

## Overview

This document outlines an effective workflow for synchronising integrator's systems with event data from Pactum. This can be useful for reporting and analytics purposes. This article will be laying out a solution which can be used to either supplement or replace the existing [CSV based result export](https://docs.eu-pactum.com/procurement-product/exporting.md).

The proposed workflow uses three API endpoints (listed below) from the Procurement API to retrieve events from a workspace, supplements the basic information with the detailed event record and results if available.

* List negotiation events
* Get negotiation event details
* Get negotiation event results

## Process example

The below diagram describes the two main export paths: an initial full sync followed by incremental periodic syncs after a point in time. Including the `updatedAfter` query parameter only includes the subset of events which have changed within Pactum systems. The diagram is followed with further explanations regarding each step.

<figure><img src="https://2769938103-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1FM7KTpbu7nDWmneLhlf%2Fuploads%2Fwq3BwwQw5kuem7LX5PZR%2FScreenshot%202026-03-16%20at%2017.01.02.png?alt=media&amp;token=01c4bdca-2f9c-416f-aa69-5fb1490c4d8c" alt=""><figcaption></figcaption></figure>

#### Step 1: Retrieve Updated Events

Call the **List Negotiation Events** endpoint to get events that have been updated since the last sync.

```
GET /procurement/v1/workspaces/{workspaceId}/negotiation-events?updatedAfter={timestamp}
```

**Response**: List of negotiation events with basic metadata (ID, status, timestamps).

#### Step 2: Fetch Event Details

For each event returned in Step 1, retrieve the full configuration:

```
GET /procurement/v1/workspaces/{workspaceId}/negotiation-events/{negotiationEventId}
```

**Response**: Complete event configuration including suppliers, line items, and negotiation settings.

#### Step 3: Fetch Event Results

For each event, retrieve the negotiation outcomes:

```
GET /procurement/v1/workspaces/{workspaceId}/negotiation-events/{negotiationEventId}/results
```

**Response**: Negotiation results including savings achieved and supplier agreements.

#### Step 4: Create value

Use the retrieved data for your own purposes whatever the use case might be.

### Sync Strategies

As indicated on the diagram, multiple synchronisation strategies are available. Refer to the below table:

| Strategy             | Use Case                       | Method                                                 |
| -------------------- | ------------------------------ | ------------------------------------------------------ |
| **Incremental Sync** | Regular updates (recommended)  | Use `updatedAfter` filter to fetch only changed events |
| **Full Import**      | Initial load or reconciliation | Omit `updatedAfter` to retrieve all events             |

> **Rate Limits**: Full sync operations are subject to rate limits. Opt to perform periodic synchronisations instead.
