Developer documentation

Campaigns

get https://app.iteras.dk/api/campaigns/

The /api/campaigns/ endpoint enables you to retrieve information about active campaigns. A campaign in Iteras describes what the customer should receive in a single period, how the period is billed and if the subscription should be renewed.

Parameters

All parameters are optional.

  • campaign_id string
    ID of a specific campaign, e.g. ?campaign_id=3months. If left out, information for all campaigns is returned.
  • include_archived boolean
    Include archived campaigns, e.g. ?include_archived=1.
  • price_calculated_for_customer string
    Campaign prices are calculated with the provided customer ID which sometimes make a difference, for instance if there are conditional invoice lines, e.g. ?price_calculated_for_customer=9224437.
  • price_calculated_for_date date
    Campaign prices are calculated for a specific date, e.g. ?price_calculated_for_date=2026-10-09.
  • business_entity string
    The external ID of the business entity to fetch campaigns for.

Return value

The data returned is an object with an array of campaign information (possibly empty array).

Note that the content depends on what fields have been set up inside Iteras and filled in on a given campaign. In general, only filled-in fields are returned, so for instance if a campaign doesn't have a particular field set, it won't show up in the data for the campaign.

Campaigns can refer to other campaigns. Such a reference is an object with the Iteras ID of the campaign in "id" and the campaign ID in "campaign_id", so it can be matched up with the corresponding entry in the returned array of campaigns.

A customer or business_entity that does not exist returns a plain text HTTP 404 error.

A subscription on a campaign can control other subscriptions, either as a group or as add-ons to it. The campaigns that those controlled subscriptions can be created on are listed in "controlled_group_campaigns" and "controlled_addon_campaigns". Group structures can be nested, so a controlled campaign may itself control further campaigns.

The campaigns a subscription can be switched to are listed under "switching", divided into the situations where they are offered.

{
  "campaigns": [
    {
      "id": "308",
      "name": "3 issues",
      "campaign_id": "3i",
      "active": true,
      "customer_facing_name": "Three beautiful issues",
      "duration_based_on": "assignments",
      "period_assignments": 3,
      "price": 224.5,
      "currency": "EUR",
      "repeat_number_of_times": 2,
      "next_campaign_id": "3i",
      "business_entity": "DKbranch",  // if the business entity has an external ID
      "lines": [
        {
          "text": "3 issues",
          "amount": 24950,
          "tax_rate": 0.25
        },
        {
          "text": "Special discount",
          "percentage": -0.10
        }
      ],
      "products": [
        {
          "name": "Test Magazine",
          "external_id": "testexternal",
          ":Custom product field": "Eksempeltekst"
        }
      ],
      "switching": {                     // campaigns this one can be switched to
        "allowed_from_selfservice": [
          {
            "id": "309",
            "campaign_id": "6m"
          }
        ],
        "offered_instead_of_cancel": [   // offered when cancelling in the selfservice
          {
            "id": "309",
            "campaign_id": "6m"
          }
        ],
        "offered_from_invoice": [        // offered by a link in the invoice
          {
            "id": "309",
            "campaign_id": "6m"
          }
        ]
      },
      ":Custom campaign field": "Eksempeltekst",
    },
    {
      "id": "309",
      "name": "1/2 year",
      "campaign_id": "6m",
      "active": true,
      "customer_facing_name": "Half a year",
      "duration_based_on": "time",
      "time": "6m",
      "fixed_date": null,
      "price": 500,
      "currency": "EUR",
      "next_campaign_id": "6m",
      "lines": [
        {
          "text": "Subscription 6 months",
          "amount": 50000,
          "tax_rate": 0.0
        }
      ],
      "products": [
        {
          "name": "Test Magazine",
          "external_id": "testexternal",
          ":Custom product field": "Eksempeltekst"
        }
      ],
      ":Custom campaign field": "Eksempeltekst",
    },
    {
      "id": "310",
      "name": "Division",
      "campaign_id": "division",
      "active": true,
      "customer_facing_name": "Division",
      "duration_based_on": "time",
      "time": "12m",
      "price": 0,
      "currency": "EUR",
      "next_campaign_id": "division",
      "products": [],
      "controlled_group_campaigns": [    // campaigns the group can have subscriptions on
        {
          "id": "311",
          "campaign_id": "employee"
        }
      ],
      "controlled_addon_campaigns": [    // campaigns that can be added on to a subscription
        {
          "id": "312",
          "campaign_id": "digital-extra"
        }
      ]
    }
  ]
}