Appendices

Appendix 1: Using Browser Filters

Coming Soon

Appendix 2: Using the Fetch Path

Request

POST /apitest/api/glx/entities/trader/fetch
Content-Type: application/json
{
    "SelectProperties": ["ID", "TIN", "Name", "Code"],
    "IncludePaths": [{
            "Path": "Customers",
            "SelectProperties": ["ID", "TrdrID", "CompID", "Code", "Active"],
            "IncludePaths": [{
                    "Path": "Sites",
                    "SelectProperties": ["ID", "CustID"],
                    "IncludePaths": [],
                    "Filters": []
                }
            ],
            "Filters": [{
                    "Name": "CompID",
                    "Type": "Default",
                    "Operator": "Equal",
                    "Value": "68cf9fd0-5d69-416d-84e1-bdf117c784b7",
                    "Filters": []
                }
            ]
        }, {
            "Path": "Sites",
            "SelectProperties": [],
            "IncludePaths": [],
            "Filters": []
        }
    ],
    "Filters": [{
            "Name": "ID",
            "Type": "Default",
            "Operator": "In",
            "Value": ["bcecd70b-eeff-4651-aa5f-00195ec7c571","c6ef4eec-f2bf-4eda-9938-003e84160965"]
        }
    ]
}   

Sample Response

[
  {
    "ID": "bcecd70b-eeff-4651-aa5f-00195ec7c571",
    "Code": "115-1073",
    "Name": "ΜΠΑΚΟΓΙΩΡΓΟΣ ΣΤΕΡΓΙΟΣ",
    "TIN": "069766124",
    "Customers": [
      {
        "ID": "f75a1aa2-993c-42ad-a3fa-c104cd5aa427",
        "TrdrID": "bcecd70b-eeff-4651-aa5f-00195ec7c571",
        "CompID": "68cf9fd0-5d69-416d-84e1-bdf117c784b7",
        "Active": 1,
        "Code": "115-1073",
        "Sites": [
          {
            "ID": "fe4ac776-69c9-4afb-8884-38c8f4f83360",
            "CustID": "f75a1aa2-993c-42ad-a3fa-c104cd5aa427"
          }
        ]
      }
    ],
    "Sites": [
      {
        "ID": "09af474b-05c1-449d-bebe-f58c69d8dfb5",
        "TrdrID": "bcecd70b-eeff-4651-aa5f-00195ec7c571",
        "Active": 1,
        "ActiveDate": "2016-05-12T00:00:00",
        "Code": "001",
        "Description": "Κύριο",
        "AdtpID": null,
        "AddressStatus": 2,
        "Street": "ΑΘ.ΑΡΓΥΡΟΥ",
        "CntrID": "6a9a5bbe-3198-4ff7-8752-20e6dab2cda0",
        "PrefID": "06d49b3d-c447-4882-8a24-4cc099d7eb9f",
        "RegnID": "0e67881e-0065-431b-951e-5971a96baf4f",
        "StreetNumber": "22",
        "PostalCode": "62200",
        "Phone1": "23220 22254",
        "Phone2": null,
        "CCEmail": null,
        "Email": null,
        "Fax": null,
        "Mobile": null,
        "ContactID": null,
        "POBox": null,
        "OilRegCode": null,
        "ElectrCompPayCode": null,
        "GPSCoordination": null,
        "Accuracy": null,
        "Contacts": [],
        "SiteLocation": []
      }
    ]
  },
  {
    "ID": "c6ef4eec-f2bf-4eda-9938-003e84160965",
    "Code": "426-1011",
    "Name": "ΛΙΤΣΑ ΣΟΥΛΤΑΝΑ",
    "TIN": "043451634",
    "Customers": [
      {
        "ID": "0c3b6be4-2272-471c-9ec9-e1af3eacc809",
        "TrdrID": "c6ef4eec-f2bf-4eda-9938-003e84160965",
        "CompID": "68cf9fd0-5d69-416d-84e1-bdf117c784b7",
        "Active": 1,
        "Code": "426-1011",
        "Sites": [
          {
            "ID": "865e2637-3744-414b-ab0d-58511cf7a171",
            "CustID": "0c3b6be4-2272-471c-9ec9-e1af3eacc809"
          }
        ]
      }
    ],
    "Sites": [
      {
        "ID": "a4dcbfb1-33b6-4d0d-b41b-d50f1acf6926",
        "TrdrID": "c6ef4eec-f2bf-4eda-9938-003e84160965",
        "Active": 1,
        "ActiveDate": "2016-05-12T00:00:00",
        "Code": "001",
        "Description": "Κύριο",
        "AdtpID": null,
        "AddressStatus": 2,
        "Street": "ΕΥΑΓΓΕΛΙΣΤΡΙΑΣ ",
        "CntrID": "6a9a5bbe-3198-4ff7-8752-20e6dab2cda0",
        "PrefID": "89e5a753-e22f-4fec-9880-6a9ff3f3f76f",
        "RegnID": "f5fbf135-55a5-4813-b1ac-2bf37e3d6303",
        "StreetNumber": "9",
        "PostalCode": "51100",
        "Phone1": "24620 85025",
        "Phone2": null,
        "CCEmail": null,
        "Email": null,
        "Fax": null,
        "Mobile": null,
        "ContactID": null,
        "POBox": null,
        "OilRegCode": null,
        "ElectrCompPayCode": null,
        "GPSCoordination": null,
        "Accuracy": null,
        "Contacts": [],
        "SiteLocation": []
      }
    ]
  }
]

Appendix 3: WebShop API Commercial Entry Payload

{
  "header": null,
  "body": {
    "header": {
      "version": "2.3.2",
      "processtype": "B2C",
      "source": "Webshop"
    },
    "data": {
      "company": {
        "identifier": {
          "id": "59c7f302-f5b0-45f6-8a32-6c7f64e91c00",
          "codelist": "RCP",
          "idspecifier": null
        },
        "descr": "Best Market SA"
      },
      "revisionnumber": 1,
      "doccurrency": {
        "identifier": {
          "id": "9efe2b51-f986-4071-9ce4-65d42075740b",
          "codelist": "RCP",
          "idspecifier": null
        },
        "descr": "Ευρώ"
      },
      "docid": null,
      "docdate": "2016-03-09T10:44:40",
      "billtoaddress": {
        "identifier": {
          "id": "246e6c01-135b-45ee-82ed-4c6d86ed211f",
          "codelist": "RCP",
          "idspecifier": null
        },
        "country": {
          "identifier": {
            "id": "6a9a5bbe-3198-4ff7-8752-20e6dab2cda0",
            "codelist": "RCP",
            "idspecifier": null
          },
          "descr": "Ελλάδα"
        },
        "municipality": null,
        "prefecture": {
          "identifier": {
            "id": "89fc0de8-bd2f-4792-bab9-01d79cbe6f00",
            "codelist": "RCP",
            "idspecifier": null
          },
          "descr": "Αττική"
        },
        "city": {
          "identifier": {
            "id": "4ba007cb-fc73-4bf9-913c-0216dca9a2b7",
            "codelist": "RCP",
            "idspecifier": null
          },
          "descr": "Κηφισιά"
        },
        "zipcode": "97643",
        "streetname": "Πλουτάρχου",
        "streetnum": "1313Α"
      },
      "deliveryinfo": {
        "delivdate": "2016-03-09T10:44:40",
        "address": {
          "identifier": {
            "id": "246e6c01-135b-45ee-82ed-4c6d86ed211f",
            "codelist": "RCP",
            "idspecifier": null
          },
          "country": {
            "identifier": {
              "id": "6a9a5bbe-3198-4ff7-8752-20e6dab2cda0",
              "codelist": "RCP",
              "idspecifier": null
            },
            "descr": "Ελλάδα"
          },
          "municipality": null,
          "prefecture": {
            "identifier": {
              "id": "89fc0de8-bd2f-4792-bab9-01d79cbe6f00",
              "codelist": "RCP",
              "idspecifier": null
            },
            "descr": "Αττική"
          },
          "city": {
            "identifier": {
              "id": "4ba007cb-fc73-4bf9-913c-0216dca9a2b7",
              "codelist": "RCP",
              "idspecifier": null
            },
            "descr": "Κηφισιά"
          },
          "zipcode": "97643",
          "streetname": "Πλουτάρχου",
          "streetnum": "1313Α"
        },
        "telephone": "2108196764",
        "fax": null,
        "email": null,
        "additionalinfo": null
      },
      "trader": {
        "identifier": {
          "id": "19c11669-2e48-4c25-9dc4-b8fbd6667ca5",
          "codelist": "RCP",
          "idspecifier": null
        },
        "tin": "044444444",
        "name": "FOT",
        "localtaxoffice": {
          "identifier": {
            "id": "09eb69e9-db09-4924-9ab3-2cebab7f5a6d",
            "codelist": "RCP",
            "idspecifier": null
          },
          "descr": "ΚΗΦΙΣΙΑΣ"
        },
        "mainactivity": null,
        "address": {
          "identifier": {
            "id": "1342b893-c872-4260-89ea-094da3bdd3ab",
            "codelist": "RCP",
            "idspecifier": null
          },
          "country": {
            "identifier": {
              "id": "6a9a5bbe-3198-4ff7-8752-20e6dab2cda0",
              "codelist": "RCP",
              "idspecifier": null
            },
            "descr": "Ελλάδα"
          },
          "municipality": null,
          "prefecture": {
            "identifier": {
              "id": "89fc0de8-bd2f-4792-bab9-01d79cbe6f00",
              "codelist": "RCP",
              "idspecifier": null
            },
            "descr": "Αττική"
          },
          "city": {
            "identifier": {
              "id": "4ba007cb-fc73-4bf9-913c-0216dca9a2b7",
              "codelist": "RCP",
              "idspecifier": null
            },
            "descr": "Κηφισιά"
          },
          "zipcode": "97643",
          "streetname": "Πλουτάρχου",
          "streetnum": "1313Α"
        },
        "telephone": "2108196764",
        "fax": null,
        "email": null,
        "website": null
      },
      "comment": null,
      "transportmode": {
        "identifier": {
          "id": "c6115df2-e203-4d84-91ec-eb6743c8a787",
          "codelist": "RCP",
          "idspecifier": null
        },
        "descr": "Οδική μεταφορά"
      },
      "transporter": {
        "identifier": {
          "id": "b2cef0cb-43a9-4b5e-9092-c72e9e1a7e62",
          "codelist": "RCP",
          "idspecifier": null
        },
        "descr": "Οδικώς"
      },
      "dispatchpurpose": {
        "identifier": {
          "id": "9350af80-ec80-43cb-aad2-74dfdf99bf00",
          "codelist": "RCP",
          "idspecifier": null
        },
        "descr": "Προς Πώληση"
      },
      "paymentagreement": {
        "paymentplan": {
          "identifier": {
            "id": "e6858a58-7368-4396-8758-bec724c9510f",
            "codelist": "RCP",
            "idspecifier": null
          },
          "descr": "Payment in 90 days"
        }
      },
      "payableamount": 179.95,
      "totalamount": 189.95,
      "netamount": 66.78,
      "discamount": 14.65,
      "vatamount": 23.28,
      "charges": [
        {
          "identifier": {
            "id": "9ec33dd5-13c9-4b7b-9c9b-5c644c4d2266",
            "codelist": "RCP",
            "idspecifier": null
          },
          "descr": "Μεταφορικά Πωλήσεων",
          "value": 40,
          "vatvalue": 4
        }
      ],
      "chargestotal": 40,
      "lines": [
        {
          "item": {
            "mgitemtypeid": 0,
            "servicetype": null,
            "sellersid": null,
            "identifier": {
              "id": "58f21886-2326-4ce3-8260-82008afa5b4e",
              "codelist": "RCP",
              "idspecifier": "ItcpID"
            },
            "descr": "FOT-STOCK ITEM 006 (23%-ALL COMP-ATTR-NOSTOCK) [COMP DESCR]"
          },
          "itemattributes": null,
          "qtymunit": {
            "identifier": {
              "id": "ee45e954-69f5-4651-a659-3b19630bf479",
              "codelist": "RCP",
              "idspecifier": null
            },
            "descr": "Τεμάχιο"
          },
          "qty": 1,
          "pricemunit": {
            "identifier": {
              "id": "ee45e954-69f5-4651-a659-3b19630bf479",
              "codelist": "RCP",
              "idspecifier": null
            },
            "descr": "Τεμάχιο"
          },
          "netprice": 11.07,
          "netamount": 9.08,
          "vatprc": 21,
          "vatamount": 2.09,
          "discamount": 1.99,
          "totalamount": 11.17,
          "charges": [
            {
              "identifier": {
                "id": "48d3f734-039f-4b05-b8e3-2c10a3d70c41",
                "codelist": "RCP",
                "idspecifier": null
              },
              "descr": "Επιβάρυνση για ειδική συσκευασία (πωλήσεις)",
              "value": 5.99,
              "vatvalue": 1.36
            }
          ],
          "chargestotal": 7.1,
          "extrataxes": null,
          "extrataxestotal": null,
          "deductions": null,
          "deductionstotal": null,
          "comment": null
        },
        {
          "item": {
            "mgitemtypeid": 0,
            "servicetype": null,
            "sellersid": null,
            "identifier": {
              "id": "6ce2d504-de6a-42f9-a1e1-35f02bf7a4f7",
              "codelist": "RCP",
              "idspecifier": "ItcpID"
            },
            "descr": "FOT-STOCK ITEM 029 (23%-ALL COMP-ATTR-SEMISTOCK-LOT_DECLLOT-SN) [COMP DESCR]"
          },
          "itemattributes": null,
          "qtymunit": {
            "identifier": {
              "id": "ee45e954-69f5-4651-a659-3b19630bf479",
              "codelist": "RCP",
              "idspecifier": null
            },
            "descr": "Τεμάχιο"
          },
          "qty": 1,
          "pricemunit": {
            "identifier": {
              "id": "ee45e954-69f5-4651-a659-3b19630bf479",
              "codelist": "RCP",
              "idspecifier": null
            },
            "descr": "Τεμάχιο"
          },
          "netprice": 11.07,
          "netamount": 9.08,
          "vatprc": 23,
          "vatamount": 2.09,
          "discamount": 1.99,
          "totalamount": 11.17,
          "charges": [
            {
              "identifier": {
                "id": "48d3f734-039f-4b05-b8e3-2c10a3d70c41",
                "codelist": "RCP",
                "idspecifier": null
              },
              "descr": "Επιβάρυνση για ειδική συσκευασία (πωλήσεις)",
              "value": 5.99,
              "vatvalue": 1.38
            }
          ],
          "chargestotal": 7.1,
          "extrataxes": null,
          "extrataxestotal": null,
          "deductions": null,
          "deductionstotal": null,
          "comment": null
        },
        {
          "item": {
            "mgitemtypeid": 0,
            "servicetype": null,
            "sellersid": null,
            "identifier": {
              "id": "7748584f-49b2-41f8-a53d-2f39c74db6d0",
              "codelist": "RCP",
              "idspecifier": "ItcpID"
            },
            "descr": "FOT-STOCK ITEM 020 (21%-ALL COMP-ATTR-SEMISTOCK-LOT_DECLLOT) [COMP DESCR]"
          },
          "itemattributes": null,
          "qtymunit": {
            "identifier": {
              "id": "ee45e954-69f5-4651-a659-3b19630bf479",
              "codelist": "RCP",
              "idspecifier": null
            },
            "descr": "Τεμάχιο"
          },
          "qty": 1,
          "pricemunit": {
            "identifier": {
              "id": "ee45e954-69f5-4651-a659-3b19630bf479",
              "codelist": "RCP",
              "idspecifier": null
            },
            "descr": "Τεμάχιο"
          },
          "netprice": 10.89,
          "netamount": 8.93,
          "vatprc": 21,
          "vatamount": 1.88,
          "discamount": 1.96,
          "totalamount": 10.81,
          "charges": [
            {
              "identifier": {
                "id": "48d3f734-039f-4b05-b8e3-2c10a3d70c41",
                "codelist": "RCP",
                "idspecifier": null
              },
              "descr": "Επιβάρυνση για ειδική συσκευασία (πωλήσεις)",
              "value": 5.99,
              "vatvalue": 1.38
            }
          ],
          "chargestotal": 7.08,
          "extrataxes": null,
          "extrataxestotal": null,
          "deductions": null,
          "deductionstotal": null,
          "comment": null
        }
      ]
    }
  },
  "attachments": null
}

Appendix 4: Authentication example

The following is a simple authentication example using the demo server with root: http://webshop-host.northeurope.cloudapp.azure.com/apitest/

It performs two API requests. The first is for authentication and the second is a simple LookUp.

Note: As described in API Reference after authentication all subsequent requests require a valid cookie obtained through /auth in order to succeed. This cookie can alternatively be initialized by the client as below:

C# (Using RestSharp clinet for .NET)

var client = new RestClient("http://webshop-host.northeurope.cloudapp.azure.com/apitest/");
client.CookieContainer = new System.Net.CookieContainer();

var request = new RestRequest("/auth?username=demo&password=demo", Method.GET);
request.AddHeader("cache-control", "no-cache");
client.Execute(request);

request = new RestRequest("/api/glx/lookups/addresstype", Method.GET);
IRestResponse entities = client.Execute(request);

PHP (Using cURL library)

session_start();
$ch = curl_init();
curl_setopt($ch, CURLOPT_COOKIE, 'ss-id=' . session_id());

curl_setopt($ch, CURLOPT_URL, 'http://webshop-host.northeurope.cloudapp.azure.com/apitest/auth?username=demo&password=demo');
curl_exec($ch);

curl_setopt($ch, CURLOPT_URL, 'http://webshop-host.northeurope.cloudapp.azure.com/apitest/api/glx/lookups/addresstype');
curl_exec($ch);

curl_close($ch);