1

Select your region to check prices in your currency, VAT rate, and shipping costs.

Endpoint

GET https://external-api.mddlinx.com/externalapi/categories

Returns the complete catalogue tree: categories and products (symbols) with names in multiple languages, descriptions, item types. The response contains a collection of Elements, which may have nested Elements (subcategories/groups).

Request

Headers
  • Accept string
    Possible values: application/json

    Expected response type.

    Default value: application/json

Response

JSON
{
  "Elements": [
    {
      "Id": 0,
      "DescriptiveName": "Root",
      "Key": "0",
      "Name": [
        { "LangSymbol": "PL", "Value": "Root" }
      ],
      "Description": [],
      "Picture": "",
      "Products": [],
      "Elements": [
        {
          "Id": 527865,
          "DescriptiveName": "All",
          "Key": "1",
          "Name": [
            { "LangSymbol": "EN", "Value": "All products" },
            { "LangSymbol": "PL", "Value": "Wszystkie produkty" }
          ],
          "Description": [],
          "Picture": "",
          "Products": [],
          "Elements": [
            {
              "Id": 101675,
              "DescriptiveName": "Ultra",
              "Key": "101675",
              "Name": [
                { "LangSymbol": "EN", "Value": "Ultra" },
                { "LangSymbol": "PL", "Value": "Ultra" }
              ],
              "Description": [
                { "LangSymbol": "EN", "Value": "chair polished aluminium base" },
                { "LangSymbol": "PL", "Value": "krzesło podstawa aluminium polerowane" }
              ],
              "Picture": "",
              "Products": [
                { "Symbol": "UFBPP19",  "DirectDigital": 1 },
                { "Symbol": "UFPP19K",  "DirectDigital": 1 }
              ],
              "Elements": [],
              "Type": 4,
              "TypeName": "Virtual symbol",
              "DirectDigital": 1,
              "JoinID": 0,
              "IsMain": 1,
              "IsHidden": 0,
              "MainKeyForElement": 101675,
              "InvisibleOnPricelist": 0,
              "InvisibleOnPricelistCurrencies": ["SEK"]
            }
          ],
          "Type": 1,
          "TypeName": "Category",
          "DirectDigital": 1,
          "JoinID": 0,
          "IsMain": 0,
          "IsHidden": 0,
          "MainKeyForElement": 1,
          "InvisibleOnPricelist": 0,
          "InvisibleOnPricelistCurrencies": []
        }
      ],
      "Type": 0,
      "TypeName": "Root",
      "DirectDigital": 1,
      "JoinID": 0,
      "IsMain": 0,
      "IsHidden": 0,
      "MainKeyForElement": 0,
      "InvisibleOnPricelist": 0,
      "InvisibleOnPricelistCurrencies": []
    }
  ]
}
  • Elements array<object> Required

    List of catalogue tree elements (categories, groups, virtual symbols, etc.).

  • Elements[].Id integer Required

    ID of the element in the database.

  • Elements[].DescriptiveName string|null

    Descriptive name of the element (often more “dictionary-like” than Name[].Value).

  • Elements[].Key string Required

    Abstract element key (character string used in the catalogue).

  • Elements[].Name array<object>

    Name of the element in various languages.

  • Elements[].Name[].LangSymbol string Required
    Possible values: PL EN DE ES FR IT

    Language code (two-letter, e.g. PL, EN, DE).

  • Elements[].Name[].Value string Required

    Name of the element in the chosen language.

  • Elements[].Description array<object>

    Descriptions of the elements in various languages.

  • Elements[].Description[].LangSymbol string Required
    Possible values: PL EN DE ES FR IT

    Description language code.

  • Elements[].Description[].Value string Required

    Description in the chosen language (can be empty).

  • Elements[].Picture string

    URL of the image associated with the element (if any).

  • Elements[].Products array<object>

    List of products (indexes) connected with the element (e.g. category / family).

  • Elements[].Products[].Symbol string Required

    Product index (SKU).

  • Elements[].Products[].DirectDigital integer Required
    Possible values: 0 1

    Direct Digital symbol availability flag (0 - no, 1 - yes).

  • Elements[].Elements array<object>

    Nested elements (subcategories/groups/tree nodes) with the same structure as Elements[].

  • Elements[].Type integer Required

    Element type code (e.g. root, category, virtual symbol - exact meaning on the system side).

  • Elements[].TypeName string Required

    Element type name (e.g. "Root", "Virtual symbol", "Category").

  • Elements[].DirectDigital integer
    Possible values: 0 1

    Flag indicating whether a given element (branch) is available in Direct Digital.

  • Elements[].JoinID integer

    ID of the element with which it is associated (e.g. "original" record).

    Default value: 0
  • Elements[].IsMain integer
    Possible values: 0 1

    Is this element the main element? (1 - yes, 0 - no)

    Default value: 0
  • Elements[].IsHidden integer
    Possible values: 0 1

    Should the element be hidden on the page? (1 - hidden, 0 - visible)

    Default value: 0
  • Elements[].MainKeyForElement integer

    The key of the parent/main element, if it is not the main element.

    Default value: 0
  • Elements[].InvisibleOnPricelist integer
    Possible values: 0 1

    Should the element be invisible on the price list? (1 - hidden, 0 - visible)

    Default value: 0
  • Elements[].InvisibleOnPricelistCurrencies array<string>

    A list of currency codes for which the element should be hidden on the price list.

JSON
{
  "status": 500,
  "error": "server_error",
  "message": "Server error occurred."
}

Implementation

Examples of endpoint calls (anonymous GET, without Authorisation header) for /externalapi/categories.

PHP
<?php
declare(strict_types=1);

$endpoint = 'https://external-api.mddlinx.com/externalapi/categories';

$ch = curl_init($endpoint);
curl_setopt_array($ch, [
    CURLOPT_HTTPGET        => true,
    CURLOPT_HTTPHEADER     => ['Accept: application/json'],
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_TIMEOUT        => 60,
]);

$body  = curl_exec($ch);
$errno = curl_errno($ch);
$error = curl_error($ch);
$http  = (int) curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);

if ($errno) {
    throw new RuntimeException($error);
}
if ($http < 200 || $http >= 300) {
    throw new RuntimeException('HTTP ' . $http . ': ' . $body);
}

$data = json_decode($body, true, 512, JSON_THROW_ON_ERROR);
print_r($data);
Laravel
<?php
use Illuminate\Support\Facades\Http;

$endpoint = 'https://external-api.mddlinx.com/externalapi/categories';

$response = Http::acceptJson()
    ->timeout(60)
    ->get($endpoint);

if ($response->failed()) {
    throw new RuntimeException('HTTP ' . $response->status() . ': ' . $response->body());
}

$tree = $response->json();
print_r($tree);
JS
const endpoint = 'https://external-api.mddlinx.com/externalapi/categories';

(async () => {
  const res = await fetch(endpoint, {
    method: 'GET',
    headers: {
      'Accept': 'application/json'
    }
  });

  if (!res.ok) {
    throw new Error('HTTP ' + res.status + ': ' + (await res.text()));
  }

  const data = await res.json();
  console.log(data);
})();
Python
import requests

endpoint = 'https://external-api.mddlinx.com/externalapi/categories'

r = requests.get(
    endpoint,
    headers={
        'Accept': 'application/json',
    },
    timeout=60,
)
r.raise_for_status()

print(r.json())
C#
using System;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Threading.Tasks;

class Program {
  static async Task Main() {
    var endpoint = "https://external-api.mddlinx.com/externalapi/categories";

    using var http = new HttpClient();
    http.DefaultRequestHeaders.Accept.ParseAdd("application/json");

    var res  = await http.GetAsync(endpoint);
    var body = await res.Content.ReadAsStringAsync();

    if (!res.IsSuccessStatusCode)
      throw new Exception("HTTP " + (int)res.StatusCode + ": " + body);

    Console.WriteLine(body);
  }
}