Skip to content
Docs
API 1.0.0 · 22 Nov 2026

Search the docs

    Română

    Event catalogue

    Subscribe to pay run and payment changes.

    Store the event ID and queue the delivery durably before returning 2xx. Process the stored event afterwards. Read the current pay run when you need the full record. The envelope carries the revision of the change and the status of the run.

    TypeWhen it occurs
    com.rdcopilot.payroll.pay_run.calculated.v1Employee lines were calculated at this revision.
    com.rdcopilot.payroll.pay_run.approved.v1The reviewed run was approved.
    com.rdcopilot.payroll.payment.recorded.v1A settlement or rejection was recorded.
    com.rdcopilot.payroll.pay_run.paid.v1Every payment row has settled.
    com.rdcopilot.payroll.pay_run.filed.v1An accepted filing receipt was recorded.

    curl

    curl "$RDC_BASE_URL/payroll/v1/events" \
      -H "Authorization: Bearer $RDC_TOKEN"

    JavaScript

    const response = await fetch(`${process.env.RDC_BASE_URL}/payroll/v1/events`, {
      method: 'GET',
      headers: {
        Authorization: `Bearer ${process.env.RDC_TOKEN}`,
      },
    });
    const result = await response.json();

    Python

    import os
    import requests
    
    response = requests.request(
        'GET',
        f'{os.environ["RDC_BASE_URL"]}/payroll/v1/events',
        headers={
            'Authorization': f'Bearer {os.environ["RDC_TOKEN"]}',
        },
    )
    result = response.json()

    PHP

    <?php
    
    $curl = curl_init(getenv('RDC_BASE_URL') . '/payroll/v1/events');
    curl_setopt_array($curl, [
        CURLOPT_CUSTOMREQUEST => 'GET',
        CURLOPT_RETURNTRANSFER => true,
        CURLOPT_HTTPHEADER => [
            'Authorization: Bearer ' . getenv('RDC_TOKEN'),
        ],
    ]);
    $result = json_decode(curl_exec($curl), true);
    curl_close($curl);

    C#

    using System.Net.Http.Headers;
    
    var client = new HttpClient();
    var request = new HttpRequestMessage(HttpMethod.Get, $"{Environment.GetEnvironmentVariable("RDC_BASE_URL")}/payroll/v1/events");
    request.Headers.Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("RDC_TOKEN"));
    var response = await client.SendAsync(request);
    var result = await response.Content.ReadAsStringAsync();

    Response 200

    {
      "items": [
        {
          "specversion": "1.0",
          "id": "f7cc9497-d3fd-4476-9100-000000000010",
          "type": "com.rdcopilot.payroll.pay_run.approved.v1",
          "source": "/payroll/v1",
          "time": "2026-12-02T10:15:00Z",
          "customerOrgId": "brumar",
          "legalCompanyId": "brumar",
          "aggregateType": "pay_run",
          "aggregateId": "PR-2026-11",
          "aggregateRevision": 6,
          "correlationId": "f7cc9497-d3fd-4476-9100-000000000011",
          "causationId": "f7cc9497-d3fd-4476-9100-000000000005",
          "actor": {
            "type": "api_client",
            "id": "payroll-client"
          },
          "data": {
            "status": "approved"
          }
        }
      ],
      "nextCursor": null
    }