Skip to content

Contracts by reference date — v2 (paginated)

GET Retrieve the list of active contracts from PharmaPortal, paginated.

The v2 API returns the same contract data as the v1 API, but paginated. As a result there are no limits on the period or the number of results: even multi-year periods with tens of thousands of contracts can be retrieved page by page.

Access

Available to PharmaPortal licence holders only.

Endpoint

GET https://demo.pharma-portal.nl/api/v2/contracten
GET https://www.pharma-portal.nl/api/v2/contracten
Parameter In Type Required Description
actiefOp query string (YYYY-MM-DD) no Start of the period. Omit for the current date.
actiefTot query string (YYYY-MM-DD) no End of the period (inclusive). Omitting it returns the contracts active on actiefOp. Must not lie before actiefOp; there is no maximum period.
page query integer no Page number, starting at 1 (default 1). A page past the end returns an empty data list.
perPage query integer no Contracts per page, 1 through 1000 (default 500).

Authentication

Header Description
x-portal-key The API key issued to your organisation.

Request

curl "https://demo.pharma-portal.nl/api/v2/contracten?actiefOp=2022-01-01&actiefTot=2026-12-31&page=1" \
  -H "x-portal-key: <your-api-key>"

Response

Code Meaning
200 Correct request.
400 Invalid parameter (date, period, page or perPage). Body: {"result":"error","errorMessage":"…"}.
401 Invalid authentication or HMAC.

Example of a successful response (abbreviated):

{
    "data": [
        {
            "startDatum": "YYYY-MM-DD",
            "eindDatum": "YYYY-MM-DD",
            "opmerkingen": "remark",
            "piCode": 671234,
            "zindexNummer": 12345678,
            "isExclusief": true,
            "prijsPerVerpakking": "1.23000",
            "kortingPercentage": null,
            "soortAfspraak": 1,
            "herkomst": "Source",
            "leveringVia": 1,
            "isLPL": false,
            "trajectSlug": "1-trajectname",
            "createdAt": "2026-01-15T10:30:00+01:00",
            "updatedAt": "2026-01-15T10:30:00+01:00",
            "contractGroep": "contract group ID",
            "contractGroepVolume": 100
        }
    ],
    "meta": {
        "page": 1,
        "perPage": 500,
        "totaal": 12345,
        "totaalPaginas": 25
    }
}

Retrieve all pages by incrementing page up to and including meta.totaalPaginas. The ordering is stable (start date, then internal ID), so pages connect seamlessly.

Fields

The contract fields in data are identical to the v1 API, with two format differences:

Field Type Difference from v1
contractGroepVolume integer A string in v1.
createdAt / updatedAt string ISO 8601 (e.g. 2026-01-15T10:30:00+01:00); YYYY-MM-DD HH:mm:ss in v1.

Price fields (prijsPerVerpakking, kortingPercentage) are returned as strings to avoid rounding loss.

Field Type Description
meta.page integer Requested page.
meta.perPage integer Contracts per page.
meta.totaal integer Total number of contracts in the period.
meta.totaalPaginas integer Total number of pages (0 when there are no results).

Please note

Would you like to test your integration? Contact us in good time via info@zagis.nl. We will prepare test data for you and provide you with an API key.