MKG API CAD/CAM

Documentation of frequently used API calls for CAD/CAM API partners.

Tested on API V3 and MKG Version 005.082.013.


Table of Contents


Data Dictionary
For information on endpoints, fields, and actions, refer to the article API - Data Dictionary (Endpoints).

 

Postman
For examples of API calls, refer to the article API - Postman Collection.

 

Retrieve

 

Search Article

When a user wants to manually search for articles in MKG, the following GET request can be used to gradually display a list of options. Enter the article to be searched in Search.

GET {{restUrl}}/Documents/arti

  • Filter: admi_num = {{admi_num}} AND arti_actief = true AND Search = "search text" 
  • FieldList: arti_code,arti_oms_1,arti_oms_2,arti_oms_3 
  • Sort: arti_code
  • NumRows: 10
{{restUrl}}/Documents/arti?Filter=admi_num = {{admi_num}} AND arti_actief = true AND Search = "search text"&FieldList=arti_code,arti_oms_1,arti_oms_2,arti_oms_3&Sort=arti_code&NumRows=10

 

Request List of Articles

To request a list of articles, the following call can be used.
The API uses pagination. A maximum of 100 lines are offered in one call.

GET {{restUrl}}/Documents/arti

  • Filter: admi_num = {{admi_num}} AND arti_actief = true AND ...
  • FieldList: arti_code,arti_oms_1,arti_oms_2,arti_oms_3,... 
  • Sort: arti_code
  • NumRows: 100
  • SkipRows: 0
{{restUrl}}/Documents/arti?Filter=admi_num = {{admi_num}} AND arti_actief = true&FieldList=arti_code,arti_oms_1,arti_oms_2,arti_oms_3&Sort=arti_code&NumRows=100&SkipRows=0

 

Request Specific Article

For requesting a specific article, there are two options, namely with the primary key and with the rowkey. The rowkey accompanies each GET request and is unique in combination with the endpoint.

GET {{restUrl}}/Documents/arti/{{admi_num}}+{{arti_code}}

GET {{restUrl}}/Documents/arti/{{RowKey}}

  • FieldList: arti_code,arti_actief,arti_oms_1,arti_oms_2,arti_oms_3,arti_eenh_vrd,arti_stlh_num,... 
{{restUrl}}/Documents/arti/{{admi_num}}+{{arti_code}}?FieldList=arti_code,arti_actief,arti_oms_1,arti_oms_2,arti_oms_3,arti_eenh_vrd,arti_stlh_num

 

Request Specific Bill of Materials

The bill of materials header (stlh) only contains the bill of materials number, the linkage of a bill of materials with an article is at the end product of the bill of materials. Since a bill of materials can only have one end product, it will always be bill of materials line 1.

Table structure of a bill of materials:

stlh - Bill of materials header
- stlr - End product (stlr_num = 1)
-- stlm - Materials
-- stlb - Operations
-- stlr - Sub-assemblies (stlr_parent = 1)
--- stlm - Materials
--- stlb - Operations
--- stlr - Sub-assemblies (stlr_parent = ...)
---- etc...

GET  {{restUrl}}/Documents/stlr/{{admi_num}}+{{stlh_num}}+{{stlr_num}}

  • FieldList: stlh_num,stlh_num.stlh_actief,stlr_num,arti_code,stlr_oms_1,stlr_oms_2,stlr_oms_3
  {{restUrl}}/Documents/stlr/{{admi_num}}+{{stlh_num}}+{{stlr_num}}?FieldList=stlh_num,stlh_num.stlh_actief,stlr_num,arti_code,stlr_oms_1,stlr_oms_2,stlr_oms_3

 

Bill of Materials Materials

Uses the collection of materials at the endpoint of the bill of materials line (stlr).

GET {{restUrl}}/Documents/stlr/{{admi_num}}+{{stlh_num}}+{{stlr_num}}/stlr_stlm

  • FieldList: stlm_num,arti_code,stlm_oms_1,stlm_oms_2,stlm_oms_3,stlm_aantal,stlm_eenh,... 
  • Sort: stlm_num
{{restUrl}}/Documents/stlr/{{admi_num}}+{{stlh_num}}+{{stlr_num}}/stlr_stlm?FieldList=stlh_num,stlh_num.stlh_actief,stlr_num,arti_code,stlr_oms_1,stlr_oms_2,stlr_oms_3

 

Create

 

Create Article

For creating articles, we use profiles in MKG (article template). In the Article module, multiple profiles can be created with which all relevant information is automatically filled by MKG.

It is advised to create at least the following profiles in consultation with the MKG consultant. For each advised profile, multiple variants can be created due to differences in desired financial handling (purchase/sale/stock groups).

Profile Article Purchase Stock Costs After optimizing
7000 Purchase stock-driven true true false Material
7100 Purchase order-driven true false false Material
7200 Purchase costs true true true Material
7300 Production/sale stock-driven false true false Material
7400 Production/sale order-driven false false false Sub-assembly
7999 Unknown/default * * * *

 

By using profiles, entering the basic information is sufficient.

POST {{restUrl}}/Documents/arti/?Profile={{profile_num}}

{{restUrl}}/Documents/arti/?Profile={{profile_num}}

Request body:

{
    "request": {
        "InputData": {
            "arti": [
                {
                    "admi_num": {{admi_num}},
                    "arti_code": "Article name",
                    "arti_oms_1": "Article description",
"arti_oms_2": "Article description",
"arti_oms_2": "Article description"                 } ] } } }

 

Create VRM Article

Within MKG, VRM (Accelerated Calculation Method) articles can also be used.
These are articles where all parameters and the trade length are recorded on the article, and the consumption can be specified on the bill of materials material. 

The advice is to have VRM articles created by the MKG user in MKG and then take them over.
VRM articles can be recognized by the fact that the Formula field (matf_num) on the article is filled.

 

Create Bill of Materials Header

POST {{restUrl}}/Documents/stlh/

{{restUrl}}/Documents/stlh/

Request body:

{
    "request": {
        "InputData": {
            "stlh": [
                {
                    "admi_num": {{admi_num}},
                    "stlh_actief": true,
                    "stlh_memo": "Memo text"
                }
            ]
        }
    }
}

 

Create Bill of Materials Line

POST {{restUrl}}/Documents/stlr/

{{restUrl}}/Documents/stlr/

Request body:

{
    "request": {
        "InputData": {
            "stlr": [
                {
                    "admi_num": {{admi_num}},
                    "stlh_num": "{{stlh_num}}",
                  "arti_code": "{{arti_code}}"
              } ] } } }

 

Create Bill of Materials Materials

Add all necessary materials to the bill of materials line

POST {{restUrl}}/Documents/stlr/{{admi_num}}+{{stlh_num}}+{{stlr_num}}/stlr_stlm

{{restUrl}}/Documents/stlr/{{admi_num}}+{{stlh_num}}+{{stlr_num}}/stlr_stlm

Request body:

{
    "request": {
        "InputData": {
            "stlm": [
                {
                    "arti_code": "{{arti_code}}",
                  "stlr_aantal": 1,
                  "eenh_code": "st."                 } ] } } }

 

Create Bill of Materials VRM Materials

Within MKG, VRM (Accelerated Calculation Method) articles can also be used.
These are articles where the trade length is recorded on the article, and the consumption can be specified on the bill of materials material.

For VRM articles, all parameters are fixed on the article. At the bill of materials material, the quantity and the required length can be specified.

POST {{restUrl}}/Documents/stlr/{{admi_num}}+{{stlh_num}}+{{stlr_num}}/stlr_stlm

{{restUrl}}/Documents/stlr/{{admi_num}}+{{stlh_num}}+{{stlr_num}}/stlr_stlm

Request body:

{
    "request": {
        "InputData": {
            "stlm": [
                {
                    "arti_code": "{{arti_code}}",
                  "stlr_aantal": 1,
                  "eenh_code": "st.",
                  "stlm_lengte": "100", // The length is always in millimeters
                  "stlm_behoefte_obv": 3 // Requirement based on product length and trade length (PL/HL)                 } ] } } }

 

Execute Optimize Bill of Materials

The Optimize Bill of Materials service adds layering to the bill of materials where applicable. This is crucial for the requirement determination in the production process.

Advice on using the optimize bill of materials:
[x] Optimize only selected bill of materials
HF: 
[x] Include stock-driven articles as material
[x] Include purchase articles as material
[x] Include article with active bill of materials as reference
Material:
[x] Include articles that are order-driven as sub-assembly

PUT {{restUrl}}/Documents/stlh/{{admi_num}}+{{stlh_num}}/Service/s_optimize_partlist

{{restUrl}}/Documents/stlh/{{admi_num}}+{{stlh_num}}/Service/s_optimize_partlist

Request body:

{
    "request": {
        "InputData": {
            "stlh": [
                {
                    "RowKey" : 1,                      // Fixed value, do not remove
                    // Bill of material
                    "t_opt_stlh": true,                // Optimize selected bill of materials only (Note! If FALSE, ALL bills of materials are optimized)
                    "t_opt_stlh_actief_arti": false,   // Make items used in bills of materials active if bill of materials is active
                    "t_opt_stlh_actief_stlh": false,   // Make bills of materials referenced in the bill of materials active if the bill of materials is active
                    "t_opt_stlh_arti_vrd_min": false,  // Adjust minimum stock of used items
                    "t_opt_stlh_formules": false,      // Bill of materials with formulas also optimized
 
                    // Sub-Assemblies
                    "t_opt_half_vrd": true,           // Stocked items recorded as material
                    "t_opt_half_ink": true,            // Include purchase items as materials
                    "t_opt_half_verw": true,           // Include article with active bill of materials as a reference
                    "t_opt_half_opnemen": false,       // Include all references in bill of materials
                    "t_opt_half_oms": false,           // Update descriptions and memos based on the article (incl. translations)
                    "t_opt_half_arti_oms": false,      // Updating descriptions and memos of inactive articles
                    "t_opt_half_formules_mat": false,  // Include as material, copy contents of formulas
 
                    // Materials
                    "t_opt_mat": true,                 // Include items that are order-driven as sub-assemblies
                    "t_opt_mat_vrd": false,            // Record items that are stock-driven as sub-assemblies
                    "t_opt_mat_oms": false,            // Update descriptions and memos based on the article (incl. translations)
                    "t_opt_mat_arti_oms": false,       // Updating descriptions and memos of inactive articles
                    "t_opt_mat_formules_half": false,  // Record as sub-assemblies, copy contents of formulas
                    "t_opt_spec": false,               // Redefining specifications
 
                    // Parameters
                    "t_opt_parm_std": false,           // fill formula fields based on default parameters
                    "t_opt_parm_verwijderen": false,   // Remove parameters that are not used
 
                    // Collecting operations
                    "t_opt_bew_verz": 0,               // Collect operations (0 = Not, 1 = Semi-manufactured, 2 = Finished product)
                    "t_opt_bew_list": ""                // Operations (Operation numbers separated by ";")
                }
            ]
        }
    }
}

 

Link Documents

To create a document link in MKG, the service s_add_document must be added to the relevant endpoint. In the Key, all fields of the primary key must be provided separated by semicolons. Linking a category is optional but desirable. 
The advice is to create at least one category where only the most recent documents are always available. These can be automatically sent with purchases if desired.

PUT {{restUrl}}/Documents/arti/x/Service/s_add_document

  • Key: {{admi_num}};{{arti_num}}
  • File: C:/path/to/the.file
  • Description: Description text
  • Categories: {{dcat_num}},{{dcat_num}} 
{{restUrl}}/Documents/arti/x/Service/s_add_document?Key={{admi_num}};{{arti_num}}&File=C:/path/to/the.file&Description=Description text&Categories={{dcat_num}},{{dcat_num}} 

 

Implement Revision

In the administration, the process numbering for revisions must be set up.

 

Create Revision

With the call below, MKG copies the bill of materials to a new revision where the sub-assemblies and materials are not included.

PUT {{restUrl}}/Documents/stlh/{{admi_num}}+{{stlh_num}}/Service/s_create_revision

Request body:

{
    "request": {
        "InputData": {
            "PartListRevision": [
                {
                    "RowKey": 1,                              // Fixed value, do not remove
                    "t_half": false,                          // Copy Sub-assemblies
                    "t_mat": false,                           // Copy Materials
                    "t_uit": true,                            // Copy Outsourcing
                    "t_bew": true,                            // Copy Operations
                    "t_arti": false                           // Create item
                }
            ]
        }
    }
}

 

Enter Bill of Materials Materials

See: Create Bill of Materials Materials

 

Optimize Bill of Materials

See: Execute Optimize Bill of Materials

 

Adjust Article Revision

The new revision number must be entered on the article.

PUT {{restUrl}}/Documents/arti/{{admi_num}}+{{arti_code}}

{{restUrl}}/Documents/arti/{{admi_num}}+{{arti_code}}

Request body:

{
    "request": {
        "InputData": {
            "arti": [
                {
                    "arti_revisie": "Article revision number"
                }
            ]
        }
    }
}

 

Implement Revision on Active Bills of Materials

After implementing a revision on an article, this revision number must be adjusted on all active bills of materials. This can be done with the following call.

PUT {{restUrl}}/Documents/arti/{{admi_num}}+{{arti_code}}/s_recalc_revisie

{{restUrl}}/Documents/arti/{{admi_num}}+{{arti_code}}/s_recalc_revisie

Request body:

{
    "request": {
        "InputData": {
            "PartListRevision": [
                {
                  "RowKey": "x",
                  "t_eind": "true",      // Change assemblies revision
                  "t_half": "true",      // Change sub-assemblies revision
                    "t_mat": "true"        // Change material revision
                }
            ]
        }
    }
}

 

 

  • Published:24 Feb 2026 23:24
  • Latest update:25 Feb 2026 00:24
  • TypeHandleidingen
  • Category
  • Availability
    Openbaar