By means of the metasfresh web service (REST API) you can transfer external data to metasfresh and retrieve, update or delete existing data entries from the system. This is done via so-called API endpoints. Each endpoint is set up for the migration of certain data sets, which can be transferred to the metasfresh application server through server requests in JSON format. A special feature of the metasfresh REST API is that you can also combine data sets that would normally be migrated separately via the respective endpoints, and import them in a single server request, thereby creating several data entries in one go. For example, when migrating a sales order candidate to metasfresh’s sales order disposition, both a new business partner and product entry can be created simultaneously.
A template for a JSON server request is provided for each endpoint in the respective input field () and can be viewed, copied and modified using the required data. A description of the request model () with explanations of the individual elements will help you to create your own server request.
In order to use the web service, you require an authentication token that you will have to use to authenticate yourself against the REST API before you can send a server request. This token is provided in the entry of your metasfresh user.
Note: Any error messages will be displayed in the Responses section below.
The endpoints currently available are listed below. Click on an endpoint you would like to learn more about.
"externalId": "2156435"
This name-value pair refers to the ID of the data record on the external platform from which the data are retrieved. The externalId
must be unique. It can be found at the end of a data entry’s URL in metasfresh behind the window ID, as shown in the following example:
https://{{ base.URL }}
/window/123/2156435
"syncAdvise": {
"ifExists": "DONT_UPDATE",
"ifNotExists": "CREATE"
}
This object is used to check whether a data record already exists or not, and to control what should happen in each case. Depending on the value specified, existing data records can be updated, deleted or excluded from data migration, new data records can be created or the entire migration process terminated.
Condition | Values | Description |
---|---|---|
“ifExists” | • UPDATE_MERGE • UPDATE_REMOVE • DONT_UPDATE |
If a data record already exists, it can be updated, deleted, or omitted. |
“ifNotExists” | • CREATE • FAIL |
If a data record does not exist, it can be created or the migration process shall be terminated. |