User Tools

Site Tools


api:customer:list

API : Customer List

Introduction

This request will return the list of customers that you may access as a reseller or admin.

Request

URL https://api.telecomx.dk/customer
Method GET
Access level RESELLER - customers that belongs to the reseller
RESELLER_ADMIN or ADMIN
Query offset Number [optional] Index of the first customer to return, default 0.
limit Number [optional] The number of customers to return, default 100, min 1, max 1000.
parentReseller Id [optional] Id of parent reseller that the customers must belong to (RESELLER_ADMIN and up).
filter String [optional] To filter the customers, this can be used. Common fields of the customer will be searched.
all Boolean [optional] If true, all customers for all resellers will be returned (RESELLER_ADMIN and up).
iptvdevices Boolean [optional] If true IPTV device usage data is also returned.
iptvproviders Boolean [optional] If true, return only resellers and businesses that provides IPTV (RESELLER_ADMIN and up).
iptvprivate Boolean [optional] If true, return only resellers or customers that has the IPTV-private flag (RESELLER_ADMIN and up).
flexcare Boolean [optional] If true only customers with feature FLEXCARE is returned.
resellers Boolean [optional] If true only resellers are returned.
customerIds Array [optional] List of specific customers to return.
includeDeleted Boolean [optional] If true, also deleted customers are returned.
full Boolean [optional] If true, complete customer object will be returned instead of the condensed version.
customerGroup Id [optional] Id of customer group the customers must be a member of.
includeSubresellers Boolean [optional] If true, when a reseller lists her customers, then customers of subresellers will also be included.

Query examples

https://api.telecomx.dk/customer
https://api.telecomx.dk/customer?filter=abc&offset=10&limit=25&full=true
https://api.telecomx.dk/customer?filter=abc&parentReseller=12345678901234567890ABCD

Response

JSON object
offset Index of the first customer returned.
limit Number of customers to return. Note that the actual number of customers returned may be lower.
total Number of customers that can be returned when offset and limit is not considered. This is to be used for paging through the data.
customers Array of customers, see definition below
Customer object (JSON)
_id Id Unique customer id.
state Enum State of the customer: ACTIVE, BLOCKED (all services disabled), DELETED.
name String Customer name.
address String address (ex: <street>, <zip> <city>, <country>).
phoneNumber String Primary phone number for the customer.
faxNumber String Primary phone number for the customer (used when faxing e.g. porting documents).
emailAddress String Primary e-mail for the customer.
isReseller Boolean True if customer is a reseller.
parentReseller Id Id of the reseller the customer belongs to.
customerGroup Id Id of the group the customer belongs to, null if not used.
isOrganization Boolean True if the customer is an organization.
iptv Object or String IPTV usage, only present when requested: if iptvproviders is true, iptv is the string 'BUSINESS' or 'PRIVATE'. If iptvdevices is true, iptv is an object with the fields below.
iptv.stbs Number Number of settop boxes.
iptv.stbsOffline Number Number of settop boxes that are offline.
iptv.ios Number Number of iOS/Appletv based devices.
iptv.android Number Number of Android/AndroidTV based devices.
iptv.web Number Number of web based devices.
iptv.apps Number Total number of app based devices (IOS, ANDROID, ANDROIDTV, APPLETV, WEB).
iptv.stbsNew Number Number of settop boxes created this year.
iptv.appsNew Number Number of app based devices created this year.
Customer object if full=true (JSON)
_id Id Unique customer id.
name String Name of the customer.
phoneNumber String Primary customer phone number.
faxNumber String primary customer fax number.
state Enum State of the customer: ACTIVE, BLOCKED (all services disabled), DELETED.
parentReseller Id Id of the reseller the customer belongs to (only top level resellers does not have a parent reseller).
emailAddress String Primary e-mail address.
website String Primary website address.
notes String Notes about the customer (only visible for reseller/admin).
addresses
addresses[]._id Id Id of address.
addresses[].primary Boolean True if this is the primary address.
addresses[].alternativeName String Alternative name for this address.
addresses[].address String Street, number etc.
addresses[].zip String Zip code.
addresses[].city String City.
addresses[].state String State.
addresses[].country String Country (blank if Denmark because it is default).
addresses[].fixedNumber String Fixed phone number on this address, if it differs from the primary.
addresses[].faxNumber String Fax number on this address, if it differs from the primary.
addresses[].municipalityCode Integer Municipality code, automatically set by the system.
Financial settings
finance.vatNumber String VAT number.
finance.accountingSystemId String Id for linking the customer to the accounting system that does the invoicing.
finance.accountingSystemRef String Saved customer contact in the accounting system that does the invoicing
finance.invoiceMethod String How the customer wishes to be invoiced: MAIL, EMAIL, ELECTRONIC.
finance.emailAddress String If invoiceMethod is EMAIL, this is the e-mail address to send it to.
finance.electronicAddress String If invoiceMethod is ELECTRONIC, this is the address to send it to.
finance.paymentTerms String Payment terms: DAYS_5, DAYS_7, DAYS_14, DAYS_30, DAYS_60, DAYS_90, CURRENT_MONTH_PLUS_DAYS_7, CURRENT_MONTH_PLUS_DAYS_14, CURRENT_MONTH_PLUS_DAYS_30.
finance.sipUsageLimit Integer Combined maximum monthly usage in DKK for all SIP accounts.
finance.mvnoUsageLimit Integer Maximum monthly usage in DKK for a MVNO account.
finance.channelLimit Integer Maximum number of concurrent calls the customer may conduct on SIP accounts.
finance.numberRentProduct Id Id of the product used to invoice number rent.
finance.numberRentUntil Date Date that number rent has been invoiced until.
finance.numberRentCount.singles Integer Number of single phone numbers counted during last invoicing.
finance.numberRentCount.hundreds Integer Number of 100-number-series counted during last invoicing.
finance.numberRentLastProduct Id Id of the product used at the last number rent invoicing.
finance.durationMethod Number 0 for standard, >0 for custom (ADMIN only).
finance.billingCustomers Array List of ids of billing customers linked to this customer.
finance.skipInvoicing Boolean If true, this customer's invoices are not shown in endpoints that list invoices.
finance.skipResellerInvoicing Boolean If true, this customer is skipped when the reseller's own invoicing is generated.
isReseller Boolean True if customer is a reseller who can create and manage other customers.
resellerPortal String If customer is a reseller and have a customized management portal, this is the URL for the login page.
resellerInvoice Boolean True if the platform sends out invoices to the customers (e-mail and electronic), false if reseller sends out invoices from their financial system.
resellerNextInvoiceNumber Integer Invoice number to use on the next invoice that is generated. auto-incremented when an invoice is created. Only used if resellerInvoice is true.
resellerSkin String Name of the skin to apply on UI for this resellers customers: EARTH, TEAL, DARK.
resellerEmailAsSender Boolean Sends e-mails with the reseller's own e-mail as sender. Requires the reseller setting up an SPF-record for Telecom X, for it to work properly.
resellerCustomerGroups Array List of customer groups the reseller wish to use.
resellerCustomerGroups[]._id Id Id of group.
resellerCustomerGroups[].name String Name of group.
MVNO settings
mvno.dataTopUpSms Boolean If true, a link allowing a mobile account to buy top-up data is included in the data-limit warning SMS, for all mobile accounts on this customer.
Misc settings
features Array List of features in the TelecomX platform that the customer has access to. Can only be set by ADMIN or RESELLER users. A reseller can only assign features that the reseller has to the resellers customers.
The available features are:
CUSTOMER - Basics, addresses, financial, usage limits, employees
SIP - SIP trunks
MVNO - Mobile phones
PBX - Hosted PBX, SIP phones, music on hold, Webhooks (auto-enables SIP, MVNO, CUSTOMER)
DNS - Domain management
INTERNET - Fiber & xDSL
IPTVPRIVATE - Private IPTV customer
IPTVBUSINESS - Business IPTV customer
FLEXCARE - FlexCare HealthTech
ZEROTIER - ZeroTier networking
EXTERNAL_LICENSES - external licenses
NETWORK_MANAGEMENT - allows managing network devices
DIALOG - FlexCare dialog
CHANGELOG - logging to short term changelog enabled
ORGANIZATION - customer has organizational rights.
The legacy value TCE may appear on a few old customers but cannot be assigned.
authenticationSecurity String The required security level for all users when performing login:
NONE - only username/password
SMS - 2FA using SMS required
AUTHENTICATOR - 2FA using authenticator app.
organizationResellers Array List of ids of resellers that this organization can manage (only if customer has ORGANIZATION feature.
custom Object Optional custom data that 3rd parties may append to a customer, max. 4Kb
Storage information
storage.total Number Maximum file storage capacity in bytes.
Service-level Agreements (Can only be viewed by RESELLER, RESELLER_ADMIN or ADMIN)
serviceLevelAgreements Object Contains information about service-level agreements between the customer and their reseller. Only used currently for specific customers, and is not available to everyone. Only visible to resellers.
serviceLevelAgreements.remote Object Contains information about remote service-level agreement
serviceLevelAgreements.remote.responseTime Number Response-time in hours. Valid values are 1, 3, 8, 24.
serviceLevelAgreements.remote.days String Which days of the week this service-level agreement covers. Valid values are “WEEK_DAYS”, “WEEK_DAYS_AND_SATURDAY”, “ALL”
serviceLevelAgreements.remote.period String Which period/hours in the day this service-level-agreement covers. Valid values are “07:45-16:00”, “08:00-22:00”, “00:00-23:59”
serviceLevelAgreements.onsite Object Contains information about on-site service-level agreement
serviceLevelAgreements.onsite.responseTime Number Response-time in hours. Valid values are 1, 3, 8, 24.
serviceLevelAgreements.onsite.days String Which days of the week this service-level agreement covers. Valid values are “WEEK_DAYS”, “WEEK_DAYS_AND_SATURDAY”, “ALL”
serviceLevelAgreements.onsite.period String Which period/hours in the day this service-level-agreement covers. Valid values are “07:45-16:00”, “08:00-22:00”, “00:00-23:59”
serviceLevelAgreements.services Object Which services are covered as a part of this service-level agreement.
serviceLevelAgreements.services.phoneSupportErrors Boolean Phone support - troubleshooting/bug fixing included
serviceLevelAgreements.services.phoneSupportChanges Boolean Phone support - functional changes included
serviceLevelAgreements.services.onsiteInclusive Boolean On-site assistance included
serviceLevelAgreements.services.hardwareInclusive Boolean Hardware-parts included
serviceLevelAgreements.services.mitelSwas Boolean Mitel software assurance included
serviceLevelAgreements.services.prescriptionStatus Boolean Prescription status included, used when integrating with medical systems.
simTag String Optional name of the eSIM pool to assign sims from.
bindingDate Date A date field that can be used by resellers to document when a customer's contract with their reseller expires.
customerGroup Id Id of the group the customer belongs to, null if not used.

Note that properties holding no value may be omitted from the object.

Example - normal

{
  "offset": 10,
  "limit": 25,
  "total": 243,
  "customers": [
    {
      "_id": "650000000000000000000101",
      "state": "ACTIVE",
      "name": "Northwind Industries",
      "address": "Ahlgade 223, 4000 Roskilde",
      "phoneNumber": "+4512345678",
      "faxNumber": "",
      "emailAddress": "info@example.com",
      "isReseller": false,
      "parentReseller": "650000000000000000000201",
      "customerGroup": null,
      "isOrganization": false
    },
    {
      "_id": "650000000000000000000102",
      "state": "ACTIVE",
      "name": "Example Company",
      "address": "Boulevarden 48, 9000 Aalborg",
      "phoneNumber": "+4512121212",
      "faxNumber": "",
      "emailAddress": "info@example.dk",
      "isReseller": false,
      "parentReseller": "650000000000000000000201",
      "isOrganization": false
    }
  ]
}

Example - full=true

{
  "offset": 0,
  "limit": 25,
  "total": 1,
  "customers": [
    {
      "_id": "650000000000000000000101",
      "name": "Example Company",
      "phoneNumber": "+4588888888",
      "faxNumber": "",
      "state": "ACTIVE",
      "parentReseller": "650000000000000000000201",
      "emailAddress": "info@example.dk",
      "website": "https://www.example.dk",
      "notes": "Contact the finance department before changing subscriptions.",
      "authenticationSecurity": "AUTHENTICATOR",
      "addresses": [
        {
          "_id": "650000000000000000000301",
          "primary": true,
          "alternativeName": "",
          "address": "Eksempelvej 23",
          "zip": "4000",
          "city": "Roskilde",
          "country": "DK",
          "municipalityCode": 265
        }
      ],
      "finance": {
        "vatNumber": "12345678",
        "accountingSystemId": "12345",
        "accountingSystemRef": "Finance department",
        "invoiceMethod": "EMAIL",
        "emailAddress": "invoice@example.dk",
        "paymentTerms": "DAYS_14",
        "sipUsageLimit": 10000,
        "mvnoUsageLimit": 3000,
        "channelLimit": 25,
        "numberRentProduct": "650000000000000000000401",
        "numberRentUntil": "2026-01-01T00:00:00.000Z",
        "numberRentCount": { "singles": 23, "hundreds": 1 },
        "numberRentLastProduct": "650000000000000000000401",
        "durationMethod": 0,
        "billingCustomers": [],
        "skipInvoicing": false,
        "skipResellerInvoicing": false
      },
      "isReseller": false,
      "resellerPortal": "",
      "resellerInvoice": false,
      "resellerNextInvoiceNumber": 1,
      "resellerSkin": "EARTH",
      "resellerEmailAsSender": false,
      "features": ["CUSTOMER", "SIP", "MVNO"],
      "organizationResellers": null,
      "mvno": { "dataTopUpSms": false },
      "storage": { "total": 1073741824 },
      "simTag": "providerx",
      "bindingDate": null,
      "customerGroup": "650000000000000000000601"
    }
  ]
}

Errors

Error code Message Description
403 access_denied Insufficient access level
422 <query parameter> A query parameter is invalid (the error code holds the parameter name)
500 internal_error <Unspecified>
api/customer/list.txt · Last modified: by Mikkel Meerwaldt Jørgensen

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki