# Retrieving changes

The /api/events/ endpoint enables you to retrieve raw data and associated new state for the changes that happen in Iteras.

Changes in Iteras produce events - a customer is created, an address is updated, a subscription changes status. Events exist for customers, subscriptions, vacations and future changes, product assignments, payments and campaigns and more. Each event has a type, a timestamp and an increasing event_id. Keeping another system up to date is essentially a matter of processing the events in order. See the synchronization guide for how to do this.

It is also possible to receive the raw event data as the events happen, by setting up event webhooks. Using a webhook reduces the latency, as Iteras pushes the event data immediately to your server - but that of course requires you to have a server set up to receive the data, whereas you can all this endpoint at your leisure.

# Using events

In some cases, you want to learn about what's happening. The attributes on the events describe that. Much of that is internal to Iteras, though.

In many cases, what you really want to know is the new state of the changed object, e.g. the customer or a subscription. Instead of having to go through the customer data API to retrieve that information immediately afterwards, you can pass a prefetch parameter. Then Iteras will the attach the information about the concerned objects directly.

The prefetched data comes in the same format as when you retrieve customer data to make it trivial to use the same code to update a system whether the data comes from events or from the customer data API.

There are many events in Iteras, so use filtering to get only those you're interested in.

# API

# Parameters

The endpoint uses GET and currently supports the following parameters, all optional:

  • "event_id" - (optional) ID of a specific event, e.g. ?event_id=462416.

  • "customer" - (optional) events for a specific customer with the provided customer ID, e.g. ?customer=9224437.

  • "types" - (optional) events with the requested event types, repeating the parameter for each type, e.g. ?types=customer:created&types=customer:deleted.

    The following event types are supported:

    • customer:created
    • customer:updated
    • customer:deleted
    • customer:password-reset-requested
    • customer:onetime-password-requested
    • customer:added-internal-note
    • subscription:created
    • subscription:updated
    • subscription:changed-status
    • subscription:changed-campaign
    • subscription:created
    • subscription:updated
    • subscription:changed-status
    • subscription:changed-campaign
    • subscription:renewed
    • subscription:changed-period
    • subscription:registered-campaign-change
    • subscription:registered-stop
    • subscription:cancelled-stop
    • customeroverride:created
    • customeroverride:updated
    • customeroverride:ended
    • customer-product-assignment:created
    • customer-product-assignment:updated
    • campaign:created
    • campaign:updated
    • payment:created
    • payment:allocated
    • error:webhook
    • error:dao
    • error:universaldistribution
    • error:dimaps
    • error:podio
    • error:pingen
    • error:mailchimp
    • error:activecampaign
    • error:magento
    • error:bank
    • error:bank-unmatched-payments
    • error:peppol
    • error:maventa
    • error:external-email-server
    • error:invalid-address:bs
    • error:invalid-address:pingen
    • error:invalid-email
    • error:email-delivery
    • error:backup

  • "created_before" - (optional) e.g. ?created_before=2024-01-01 (the date inclusive)

  • "created_after" - (optional) e.g. ?created_after=2024-01-01 (the date inclusive)

  • "created_before_id" - (optional) events created before the event with the given ID, e.g. ?created_before_id=63524 (the event with ID not included)

  • "created_after_id" - (optional) events created after the event with the given ID, e.g. ?created_after_id=63524 (the event with ID not included)

  • "max_results" - how many events to retrieve at most, e.g. max_results=1000. If there are more results available, a next_url is returned which you can use to grab the next page. If left out, 10000 will be assumed.

  • "prefetch" - a list of prefetch settings for each event type to return in the JSON. Each prefetch setting in the list should consist of three parts separated by colon: the event object type, the type of setting and the value of the setting, e.g. ?prefetch=customer:fields:data,subscriptions. The default is that no prefetching is done.

  • For the events available though this API except the campaign events, the fields available for prefetch are related to the customer of the event. The available fields are the same as the ones you can fetch for customers via /api/customers/. E.g. when fetching payment events, the prefetch options are based on the customer data, so that to prefetch customers, their subscriptions and payments the prefetch settings could be payment:fields:data,subscriptions,payments. To prefetch only the subscription or the payment related to the subscription or the payment event, you can add the setting subscription:single_subscription:true or payment:single_payment:true to the list of settings

    • "customer:fields:subscriptions" - prefetch a list of subscriptions for the prefetched customers
    • "subscription:fields:data" - fetch related customer data for each subscription event
    • "subscription:fields:subscriptions.begin" - fetch related customer subscription data for each subscription event
    • "campaign:fields:data" - fetch related campaign data for each campaign event
    • "payment:fields:data,subscriptions,payments" - fetch all subscriptions and payment data for the related customer for each payment event
    • "subscription:single_subscription:true" - fetch only subscription data for the event subscription for the related customer prefetch data
    • "payment:single_payment:true" - fetch only payment data for the event payments for the related customer prefetch data

    # Return value

    The data returned is an object with an array of event information (possibly empty array). The events will be sorted with the oldest event first.

    Note that the content depends on the type of the event. Common for all event types are the fields event_id, timestamp and event.

    GET /api/events/?created_after_id=6789&types=customer:created&types=payment:created
                       &prefetch=customer:fields:data&prefetch=payment:fields:data&prefetch=payment:single_payment:true
    {
      "events": [
        {
          "event_id": "6791",
          "timestamp": 2026-08-27T08:44:44,
          "event": "customer:created",
          "via": "administration",
          "customer_id": "4560",
          "data": {
            "name": "Arnold Smith",
            "email": "a@smith.com",
            "company": "Big Business Corp."
          },
          "prefetch": {
             "customers": [
               {
                 "id": "4560",
                 "name": "Arnold Smith",
                 "company": "Big Business Corp.",
                 "email": "a@smith.com"
               }
             ]
           },
        },
        {
          "event_id": "6790",
          "timestamp": 2026-08-26T08:44:44,
          "event": "payment:created",
          "amount": 5.0,
          "method": "manual",
          "payment_id": "1186",
          "currency": "DKK",
          "invoice_type": "invoice",
          "invoice": 1004,
          "customer_id": "3256",
          "prefetch": {
             "customers": [
               {
                 "id": "3256",
                 "name": "Maggie Johnson",
                 "company": "",
                 "email": "maggie@example.com",
                 "payments": [
                   {
                     "id": "1186",
                     "amount": 5.0,
                     "currency": "DKK",
                     "business_entity": "TinyCorp"
                   }
                 ]
               }
             ]
           }
         }
      ]
    }