Retrieving campaigns
https://app.iteras.dk/api/campaigns/
The /api/campaigns/ endpoint enables you to retrieve
information about active campaigns. A campaign in Iteras describes
what a subscription should receive in a single period, how the period is
billed and if the subscription should be renewed.
Parameters
-
id stringIteras ID of a specific campaign, e.g.
?id=308. Can be repeated to fetch several campaigns. -
campaign_id stringSelf-chosen ID of a specific campaign, e.g.
?campaign_id=3months. If left out, information for all campaigns is returned. -
include_archived boolInclude archived campaigns, e.g.
?include_archived=1. -
price_calculated_for_customer stringCampaign 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 dateCampaign prices are calculated for a specific date, as
YYYY-MM-DD, e.g.?price_calculated_for_date=2026-10-15. -
business_entity stringThe 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, like this {"campaigns": [{"campaign_id": 3months, ...}]}. Each campaign object may contain the following attributes:
-
id stringIteras ID of the campaign, e.g.
308. Use it to update or delete the campaign. -
name stringInternal campaign name shown inside Iteras, e.g.
3 issues. -
campaign_id stringSelf-chosen ID of the campaign, e.g.
3months. -
active boolWhether the campaign is active, e.g.
true. -
customer_facing_name stringCampaign name shown to customers, e.g.
Three beautiful issues. -
duration_based_on stringHow the period length is determined, either
timeorassignments, e.g.assignments. -
period_assignments integerNumber of assigned products in each period, e.g.
3. Included whenduration_based_onisassignments. -
time stringLength of each period, either a duration such as
6morfixed, e.g.6m. Included whenduration_based_onistime. -
fixed_date dateDate the period ends, as
YYYY-MM-DD, e.g.2027-01-15. Included whentimeisfixed. -
repeat_number_of_times integerHow many times in a row the subscription gets a period on the campaign before continuing, e.g.
2. -
next_campaign stringIteras ID of the campaign the subscription continues on, e.g.
309. Included if set. -
next_campaign_id string
campaign_idof the campaign the subscription continues on, e.g.6m. Included if set. -
business_entity stringExternal ID of the campaign's business entity, e.g.
DKbranch. Included if the business entity has an external ID. -
lines arrayWhat is invoiced for each period, in the invoice line format, e.g.
[{"text": "3 issues", "amount": 24950, "tax_rate": 0.25}]. No lines means the campaign is free. -
price decimalA computed price per period, for convenience, e.g.
224.5. If you need a more precise price for a given customer or date, fill in theprice_calculated_for_customerandprice_calculated_for_dateparameters. -
currency stringCurrency of the computed price, e.g.
EUR. -
products arrayThe products in the campaign, each an object with
name,external_idand, for the product that counts the period,used_for_period_duration, e.g.[{"name": "Test Magazine", "external_id": "testexternal", "used_for_period_duration": true}]. -
Whether the subscription is only pro forma for accounting purposes and receives nothing, e.g.
false. -
Whether upcoming products are assigned to the subscription automatically, e.g.
true. -
Access to previous products when integrating with digital edition platforms:
"",receivedorall, e.g.all. -
Whether an active subscription gets access to content protected by a paywall, e.g.
true. -
policy stringExternal ID of an overriding business policy, e.g.
no_pause. Included if set. -
Name of the campaign's product image from the image library, e.g.
cover.jpg. Included if set. -
Unit price in cents including tax, used for crediting, e.g.
150. Included if set. -
controlled_group_campaigns arrayCampaigns that subscriptions on this campaign can control as group recipients, each an object with
idandcampaign_id, e.g.[{"id": "311", "campaign_id": "employee"}]. Group structures can be nested, so a controlled campaign may itself control further campaigns. -
controlled_addon_campaigns arrayCampaigns that can be added on to a subscription on this campaign, each an object with
idandcampaign_id, e.g.[{"id": "312", "campaign_id": "digital-extra"}]. -
switching object
Campaigns the customer can switch to, grouped by situation, e.g.
{"offered_instead_of_cancel": [{"id": "309", "campaign_id": "6m"}]}. Each key holds an array of campaign references, each an object withidandcampaign_id.allowed_from_selfservice, campaigns the customer can switch to from the self-serviceoffered_instead_of_cancel, campaigns offered instead of cancelling in the self-serviceoffered_from_invoice, campaigns offered through a link in the invoice
You can set any custom campaign field, using its field id (the field name with a colon prepended, or its external identifier).
Log in, or send your API key as a bearer token, to see the custom campaign fields set up for your account.
A yes/no field (type bool) is true or false, and has no value when it isn't set. Set it with true or false, and clear it with null.
Examples
{
"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",
"used_for_period_duration": true,
":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"
}
]
}
]
}
Errors
A customer or business_entity that does not exist returns
a plain text HTTP 404 error.