MKG API Purchase Order

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

Tested on API V3 and MKG Version 005.91.014.


Table of Contents


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

 

Postman
For examples of API calls, see this article.

 

Retrieve

Creditor
For retrieving a creditor, see this article.

 

Fetch Purchase Orders

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

GET {{restUrl}}/Documents/iorh

  • Fieldlist: admi_num,iorh_num,iorr_num,cred_num,rela_num,inkr_num,iorh_dat_order
  • NumRows: 1000
{{restUrl}}/Documents/iorh/?NumRows=1000&FieldList=admi_num,iorh_num,iorr_num,cred_num,rela_num,inkr_num,iorh_dat_order

 

Fetch Purchase Order Lines

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

GET {{restUrl}}/Documents/iorh

  • Fieldlist: iorh_num,iorr_num,iorr_cred,t_iorh_cred,iorr_uitbesteding,iorr_verh_aantal_aantal_grp,iorr_backorder_aantal
  • NumRows: 1000
{{restUrl}}/Documents/iorr/?NumRows=1000&FieldList=iorh_num,iorr_num,iorr_cred,t_iorh_cred,iorr_uitbesteding,iorr_verh_aantal_aantal_grp,iorr_backorder_aantal

 

List of Buyers

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

GET {{restUrl}}/Documents/inkr

  • Fieldlist: medw_num,inkr_naam,inkr_num
  • NumRows: 10
{{restUrl}}/Documents/inkr/?Fieldlist=medw_num,inkr_naam,inkr_num&NumRows=10

 

Create

 

Creditor
For creating a creditor, see this article.

 

Purchase Order Header

To create a purchase order, a creditor must be created to which it will be linked. The creditor is linked with the variable {{cred_num}}. 

POST {{restUrl}}/Documents/iorh

{{restUrl}}/Documents/iorh

Request body:

{
    "request": {
        "InputData": {
          "iorh": [
                {
                    "admi_num": {{admi_num}},
                  "cred_num": {{cred_num}},
"inkr_num": "Buyer",
                  "iorh_ref_onze": "Our reference",
                  "iorh_ref_uw": "Creditor reference",
                  "iorh_ordernummer_extern": "Customer order code",
"iorh_dat_order": "31-12-2025",
"iorh_dat_ontvangst": "31-12-2025",
"iorh_dat_bevestigd": "31-12-2025"
                }
            ]
        }
    }
}

 

Purchase Order Line

To create a purchase order line, a purchase order must be created to which it will be linked. This purchase order is linked with the variable {{iorh_num}}.

POST {{restUrl}}/Documents/iorh/{{iorh_num}}/iorh_iorr/

{{restUrl}}/Documents/iorh/{{iorh_num}}/iorh_iorr/

Request body:

{
    "request": {
        "InputData": {
          "iorr": [
                {
                    "admi_num": {{admi_num}},
                  "iorh_num": {{iorh_num}},
"arti_code": "Article",
                  "iorr_oms_1": "Sales order line",
                  "iorr_order_aantal": 100,
                  "iorr_eenh_order": "pcs."
"btwc_code": 1
                }
            ]
        }
    }
}

 

Actions

 

Accept Purchase Order Line

In MKG, it is possible to accept a purchase order line. This can be done for one line or multiple lines at once. Accepting a purchase order line ensures that this line is recorded and accepted. Thus, the line is approved and ready for further processing.

To accept one purchase order line, use the following call:

PUT{{restUrl}}/Documents/iorr/{{admi_num}}+{{iorhnum}}+{{iorrnum}}/Service/s_actie_accepteren?FieldList=iorr_num 

{{restUrl}}/Documents/iorr/{{admi_num}}+{{iorhnum}}+{{iorrnum}}/Service/s_actie_accepteren?FieldList=iorr_num

 

To accept multiple purchase order lines, use the following call:

PUT{{restUrl}}/Documents/iorr/0/Service/s_actie_accepteren

{{restUrl}}/Documents/iorr/0/Service/s_actie_accepteren

Request body:

{
    "request": {
        "InputData": {
            "t_selected_rows": [
                {
                  "t_value": "0x0000000003d6bc43"
                },
                {
                  "t_value": "0x0000000003d6bc44"
                }
            ]
        }
    }
}
 

 

Confirm Purchase Order Line

In MKG, it is possible to confirm a purchase order line. This can be done for one line or multiple lines at once. Confirming a purchase order line ensures that this line is recorded and confirmed to the creditor. The line is then approved and ready for further processing.

To confirm one purchase order line, use the following call:

PUT{{restUrl}}/Documents/iorr/{{admi_num}}+{{iorhnum}}+{{iorrnum}}/Service/s_actie_bevestigen?FieldList=iorr_num 

{{restUrl}}/Documents/iorr/{{admi_num}}+{{iorhnum}}+{{iorrnum}}/Service/s_actie_bevestigen?FieldList=iorr_num

 

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

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

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

Request body:

{
    "request": {
        "InputData": {
            "t_selected_rows": [
                {
                  "t_value": "0x0000000003c86e8b"
                },
                {
                  "t_value": "0x0000000003c86e8c"
                }
            ]
        }
    }
}
 
 

 

Order Purchase Order Line

In MKG, it is possible to order a purchase order line. This can be done for one line or multiple lines at once. Ordering a purchase order line ensures that this line is ordered from the preferred supplier/creditor. The line is then ordered and ready for further processing.

To order one purchase order line, use the following call:

PUT{{restUrl}}/Documents/iorr/{{admi_num}}+{{iorh_num}}+{{iorr_num}}/Service/s_actie_in_bestelling

{{restUrl}}/Documents/iorr/{{admi_num}}+{{iorh_num}}+{{iorr_num}}/Service/s_actie_in_bestelling

 

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

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

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

Request body:

{
    "request": {
        "InputData": {
            "t_selected_rows": [
                {
                  "t_value": "0x0000000003c86e8b"
                },
                {
                  "t_value": "0x0000000003c86e8c"
                }
            ]
        }
    }
}

 

Refresh VC Prices

Sometimes you need to refresh the preliminary calculation prices if changes have occurred. This can be done with the service s_refresh_prices. This service is called with the following call:

PUT{{restUrl}}/Documents/iorr/{{admi_num}}+{{iorh_num}}+{{iorr_num}}/Service/s_refresh_prices

{{restUrl}}/Documents/iorr/{{admi_num}}+{{iorhnum}}+{{iorrnum}}/Service/s_refresh_prices