MKG API Sales Order

This article contains the frequently used API calls for Sales Orders.

Tested on API V3 and MKG Version 005.90.002.


Table of Contents


Data Dictionary
For information about endpoints, fields, and actions, see this article.

 

Postman
For examples of API calls, see this article.

 

Retrieve

 

Debtor
For retrieving a debtor, see this article.

 

List of Salespeople

To retrieve a list of salespeople, the following call can be used. The API uses pagination, offering a maximum of 1000 lines in one call.

GET {{restUrl}}/Documents/verk

  • Fieldlist: medw_num,verk_naam,verk_num
  • NumRows: 10
{{restUrl}}/Documents/verk/?Fieldlist=medw_num,verk_naam,verk_num&NumRows=10

 

Create

 

Debtor
For creating a debtor, see this article.

 

Sales Order Header

To create a sales order, a debtor must be created to which it will be linked. The debtor is linked using the variable {{debi_num}}. 

POST {{restUrl}}/Documents/vorh

{{restUrl}}/Documents/vorh

Request body:

{
    "request": {
        "InputData": {
            "vorh": [
                {
                    "admi_num": {{admi_num}},
                    "debi_num": {{debi_num}},
"verk_num": "Salesperson",
                    "vorh_ref_onze": "Our reference",
                    "vorh_ref_uw": "Customer reference",
                  "vorh_bestelcode_extern": "Customer order code",
"vorh_dat_order": "31-12-2025",
"vorh_dat_gewenst": "31-12-2025"
                }
            ]
        }
    }
}

 

Sales Order Line

To create a sales order line, a sales order must be created to which it will be linked. This sales order is linked using the variable {{vorh_num}}.

POST {{restUrl}}/Documents/vorr

{{restUrl}}/Documents/vorr

Request body:

{
    "request": {
        "InputData": {
            "vorr": [
                {
                    "admi_num": {{admi_num}},
                    "vorh_num": {{vorh_num}},
"arti_code": "Article",
                    "vorr_oms_1": "Sales order line",
                    "vorr_order_aantal": 100,
                    "vorr_eenh_order": "pcs."
"btwc_code": 1
                }
            ]
        }
    }
}

 

Actions

 

Confirm Sales Order Line

In MKG, it is possible to confirm a sales order line. This can be done for a single line or multiple lines simultaneously. Confirming a sales order line ensures that this line is recorded and confirmed to the customer. The line is then approved and ready for further processing, such as production, purchase, or delivery.

To confirm a single sales order line, use the following call:

PUT{{restUrl}}/Documents/vorr/{{admi_num}}+{{vorhnum}}+{{vorr_num}}/Service/s_actie_bevestigen

{{restUrl}}/Documents/vorr/{{admi_num}}+{{vorhnum}}+{{vorr_num}}/Service/s_actie_bevestigen

 

To confirm multiple sales order lines, use the following call:

PUT{{restUrl}}/Documents/vorr/0/Service/s_actie_bevestigen

{{restUrl}}/Documents/vorr/0/Service/s_actie_bevestigen

Request body:

{
    "request": {
        "InputData": {
            "t_selected_rows": [
                {
                    "t_value": "0x0000000003c86e8b"      // RowKey from vorr_num
                },
                {
                    "t_value": "0x0000000003c86e8c"     // RowKey from vorr_num
                }
            ]
        }
    }
}
 

Create Production Order

PUT {{restUrl}}/Documents/vorr/1+{{vorh_num}}+{{vorr_num}}/Service/s_createproductionorder

{{restUrl}}/Documents/vorr/1+{{vorh_num}}+{{vorr_num}}/Service/s_createproductionorder
 

Create Purchase Order

Put {{restUrl}}/Documents/vorr/1+{{vorh_num}}+{{vorr_num}}/Service/s_createpurchaseorder

{{restUrl}}/Documents/vorr/1+{{vorh_num}}+{{vorr_num}}/Service/s_createpurchaseorder
 
 

Create Reservation

PUT {{restUrl}}/Documents/vorr/{{admi_num}}+{{vorh_num}}+{{vorr_num}}/Service/s_createreservation

{{restUrl}}/Documents/vorr/{{admi_num}}+{{vorh_num}}+{{vorr_num}}/Service/s_createreservation

Request body:

{
    "request": {
        "InputData": {
            "Reservation": [
                {
                  "t_eenh_reserveren": "pcs.",
                  "t_afgewerkt": true,
                  "Rowkey": 1
                }
            ],
            "StockAvailableList": [
                {
                  "RowKey": 1,
                  "t_ingave": 1,
                  "t_pamt_row": "{{part_num}}"
                }
            ]
        }
    }
}