User Tools

Site Tools


api:product:campaign:overview

API : Product campaign Overview

Introduction

This request lists the campaigns that can still cost money: campaigns that have not started, campaigns that are enrolling, and campaigns whose window has closed while enrolled accounts are still discounted. A campaign drops off the list once it can no longer reach an invoice, and so does a campaign that was stopped before it opened.

With product, the list covers one rateplan's chain: the product itself, the products above it, and - for a master product - the reseller products below it. This is what a product's campaign tab shows.

What the caller sees follows who sees what.

Request

URL https://api.telecomx.dk/product/campaign
Method GET
Access level RESELLER, RESELLER_ADMIN or ADMIN - customers are not shown campaigns
Query
usage Boolean [optional] true to count how many accounts each campaign has been invoiced to (usageCount). Default false.
product Id [optional] Id of a rateplan product. Only the campaigns in that rateplan's chain are listed.

Query example

GET https://api.telecomx.dk/product/campaign?product=665ef4b42ed3cfb02005fdc9&usage=true

Response

JSON array of campaign rows
_id Id Id of the campaign.
name String Name of the campaign.
createdAt Date When the campaign was created.
startDate Date First day of the enrolment window (Copenhagen midnight).
endDate Date Last day of the enrolment window (Copenhagen midnight). The whole day is inside the window.
months Number Whole months the discount lasts, 1-12.
wholesale Number What the reseller pays per month during the campaign.
price Number What the customer pays per month during the campaign.
message String Free text for the UI. Null if not used.
resellers Array of Id Resellers the master campaign applies to. Null on a reseller campaign. A RESELLER only sees itself listed.
stoppedAt Date When the campaign was stopped. Null if not stopped.
fromCampaign Id On a reseller's copy of a master campaign: the id of the master campaign. Absent otherwise.
tier String MASTER or RESELLER - which tier the campaign lives on.
status String SCHEDULED before the window opens, ENROLLING while accounts created now are enrolled, DISCOUNTING once the window has closed but enrolled accounts are still discounted.
costsUntil Date The first day the campaign can no longer put a discount on an invoice.
product Id Id of the product holding the campaign.
productName String Name of that product.
reseller Id The reseller owning the product. Null on a master product.
resellerName String Name of that reseller. Null on a master product.
type String MVNO_RATEPLAN or SIP_RATEPLAN.
usageCount Number How many accounts have been invoiced on the campaign, counted from invoice lines. Null unless usage was true.

Example

[
  {
    "_id": "6aba6a8be5b8b45688b9faed",
    "name": "Efterårstilbud",
    "createdAt": "2026-09-28T13:24:27.162Z",
    "startDate": "2026-09-30T22:00:00.000Z",
    "endDate": "2026-10-30T23:00:00.000Z",
    "months": 3,
    "wholesale": 8,
    "price": 30,
    "message": null,
    "resellers": ["58fdbb7d1e3389290630f1b2"],
    "stoppedAt": null,
    "tier": "MASTER",
    "status": "ENROLLING",
    "costsUntil": "2027-05-01T00:00:00.000Z",
    "product": "60bf169291eb7e58090617a3",
    "productName": "Telecom X mobil EU lille",
    "reseller": null,
    "resellerName": null,
    "type": "MVNO_RATEPLAN",
    "usageCount": 12
  }
]

Errors

Error code Message Description
422 <property> Invalid input for the named property - the request body, query or URL parameter failed validation
403 access_denied Insufficient access level
404 product Product not found
500 internal_error <Unspecified>
api/product/campaign/overview.txt · Last modified: by Thomas Andersen

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki