Getting Started

The weclapp REST API lets you integrate weclapp with other applications or services.

What should I know before starting?

Our API is continuously being developed and improved, but we are still trying to keep it as stable as possible. We try to only have changes that are backwards compatible: usually the changes are only additions, e.g. new resources are implemented or new properties are added to existing resources. Sometimes breaking changes cannot be avoided, e.g. when a new feature requires an incompatible change to the underlying data model, all those changes will be documented in the change log.

Security and Authentication

You must be a verified user to make API requests. You can authorize against the API with an API token. The token is configurable in your weclapp account under My settings > API. Authentication is possible in multiple ways: If the request contains the session cookies of a logged in weclapp session then the user and permissions of that session are used. This is useful when testing the API in a Webbrowser, because then requests are “automatically” authenticated if weclapp is used in another tab. But generally the API is not used from a browser or with session cookies, instead there is an API token for each user that can be used to authenticate requests. Each user can find his/her token on the My Settings page. The token should be kept secret like a password. A user can also generate a new token at any time, doing that invalidates all previous tokens. Authenticating using a token is possible in two ways:

• the token can be sent using the AuthenticationToken header AuthenticationToken: {api_token}
• the standard HTTP Basic authentication can be used: the username needs to be “*” and the password is the token

Using curl

curl -H "AuthenticationToken:{api_token} https://<tenant>.weclapp.com/webapp/api/v1/...


Examples of how to use curl will be shown in each section of this API.

Headers

This is a JSON-only API. You must supply a Content-Type: application/json header on PUT and POST operations. You must set a Accept: application/json header on all requests. You may get a text/plain response in case of error, e.g. in case of a bad request, you should treat this as an error you need to take action on.

URLs

The base URL for the API is https://<tenant>.weclapp.com/webapp/api/v1/ where <tenant>.weclapp.com is the domain of the specific weclapp instance. So each weclapp instance has its own API endpoints which allow accessing data for that particular instance. The API provides access to various resources like customers, sales orders, articles etc.. Each of those resources implements a common set of operations. The URLs and HTTP methods for the different resource operations use the same pattern for all resources:

Operation HTTP Method URL pattern
Query/list instances GET
                  https://<tenant>.weclapp.com/webapp/api/v1/<resource>
total number of instances GET
                  https://<tenant>.weclapp.com/webapp/api/v1/<resource>/count
Get a specific instance by id GET
                  https://<tenant>.weclapp.com/webapp/api/v1/<resource>/id/<id>
Create a new instance POST
                  https://<tenant>.weclapp.com/webapp/api/v1/<resource>
Update a specific instance PUT
                  https://<tenant>.weclapp.com/webapp/api/v1/<resource>/id/<id>
Delete a specific instance DELETE
                  https://<tenant>.weclapp.com/webapp/api/v1/<resource>/id/<id>
Not all resources support all of those operations. A general description for each operation can be found in API Operations by example, and details for each resource are described on the page for that resource.

Additional operations

Some resources allow further operations or actions. Those operations can be executed with a POST request, for some operations that only read data it is also possible to use a GET request (this is documented for each operation). For general operations for a resource the URL pattern is https://<tenant>.weclapp.com/webapp/api/v1/<resource>/<operation>. Some operations are instance specific, those use the following URL pattern: https://<tenant>.weclapp.com/webapp/api/v1/<resource>/id/<id>/<operation>.

JSON

Type Representation in JSON
string Serialized as JSON string, empty strings (length 0 or only whitespace) are always interpreted as null, it is not possible to have a property with an empty string value.
boolean Serialized as true/false.
decimal number Most numbers in weclapp are decimal numbers with a fixed precision and scale (e.g. quantities or prices), they are serialized as JSON strings and not as JSON numbers to prevent accidental loss of precision when the JSON is deserialized with a JSON library that uses doubles to represent JSON numbers. The serialized numbers always use a “.” as the decimal mark (if one is required).
integers Integer numbers (that can safely be represented as a double) are serialized as JSON numbers.
floats/doubles Serialized as JSON numbers.
dates and timestamps Serialized as the milliseconds since 1970-01-01T00:00:00Z (as a JSON number).
enums Sometimes a property value can be one of a fixed number of named options. Those enum properties are serialized as a JSON string with the name of the option.
The deserialization of data sent to the API is relatively lenient, for example when a string is expected, but a number is given then that number is used as the string and the other way around (if possible). Properties with the value null are not serialized by default and when sending data to the API it is also not necessary to include properties whose value is null: all properties that are missing from the JSON object but are expected are assumed to be null. To get all properties including those with the value null the query parameter serializeNulls can be added to the request URL, in that case null values are included in the response.

Change Policy

weclapp may modify the attributes and resources available to the API and our policies related to access and use of the API from time to time without advance notice. weclapp will use commercially reasonable efforts to notify you of any modifications to the API or policies through notifications or posts on the weclapp Developer Website. weclapp also tracks deprecation of attributes of the API on its Changelog. Modification of the API may have an adverse effect on weclapp Applications, including but not limited to changing the manner in which weclapp Applications communicate with the API and display or transmit Your Data. weclapp will not be liable to you or any third party for such modifications or any adverse effects resulting from such modifications


API operations sample

As mentioned previously all resources implement common operations in the same way. In the following all the common operations are explained for the customer resource. The operations work in the same way for all other resources (some resources don’t support all the operations), the differences between the resources are mostly the data and the properties that are required and used.

Querying

The most common operation is querying or listing the existing entity instances. This is possible with a GET request to the base URL of a resource:

/customer

            curl -H "AuthenticationToken:<TOKEN> https://<tenant>.com/webapp/api/v1/customer

Output:

{
  "result": [
     {
        "id": "4342",
        "version": "1",
        "addresses": [
          {
            "id": "4344",
            "version": "0",
            "city": "München",
            "countryCode": "DE",
            "createdDate": 1496828973904,
            "deliveryAddress": false,
            "invoiceAddress": false,
            "lastModifiedDate": 1496828973903,
            "primeAddress": true,
            "street1": "Mustergasse 7",
            "zipcode": "80331 "
          }
        ],
        "blocked": false,
        "company": "Muster GmbH",
        "contacts": [
          {
            "id": "4332",
            "version": "1",
            "addresses": [
              {
                "id": "4334",
                "version": "0",
                "city": "München",
                "countryCode": "DE",
                "createdDate": 1496828882836,
                "deliveryAddress": false,
                "invoiceAddress": false,
                "lastModifiedDate": 1496828882836,
                "primeAddress": true,
                "street1": "Fasanenweg 15",
                "zipcode": "80331"
              }
            ],
            "createdDate": 1496828882837,
            "email": "mustermann@beipsiel.de",
            "firstName": "Max",
            "lastModifiedDate": 1496828996245,
            "lastName": "Mustermann",
            "partyType": "PERSON",
            "personCompany": "Muster GmbH",
            "salutation": "MR"
          }
        ],
        "createdDate": 1496828973904,
        "currencyId": "248",
        "currencyName": "EUR",
        "customAttributes": [
          {
            "attributeDefinitionId": "4048"
          }
        ],
        "customerNumber": "C1006",
        "customerTopics": [],
        "deliveryBlock": false,
        "insolvent": false,
        "insured": false,
        "lastModifiedDate": 1496828996212,
        "optIn": false,
        "partyType": "ORGANIZATION",
        "responsibleUserFixed": false,
        "responsibleUserId": "947",
        "responsibleUserUsername": "sales@weclapp.com",
        "salesChannel": "NET1",
        "useCustomsTariffNumber": false
      }
  ]
}

In this case there is one sales order with one order item. By default all null values are ommitted, to include them the query parameter serializeNulls can be used:

/customer?serializeNulls

          curl -H "AuthenticationToken:<TOKEN> https://<tenant>.com/webapp/api/v1/customer?serializeNulls
Output:
{
    "result": [
        {
          "id": "4342",
          "version": "1",
          "addresses": [
            {
              "id": "4344",
              "version": "0",
              "city": "München",
              "company": null,
              "company2": null,
              "countryCode": "DE",
              "createdDate": 1496828973904,
              "deliveryAddress": false,
              "globalLocationNumber": null,
              "invoiceAddress": false,
              "lastModifiedDate": 1496828973903,
              "postOfficeBoxCity": null,
              "postOfficeBoxNumber": null,
              "postOfficeBoxZipCode": null,
              "primeAddress": true,
              "state": null,
              "street1": "Mustergasse 7",
              "street2": null,
              "zipcode": "80331 "
            }
          ],
          "amountInsured": null,
          "annualRevenue": null,
          "birthDate": null,
          "blockNotice": null,
          "blocked": false,
          "commercialLanguageId": null,
          "company": "Muster GmbH",
          "company2": null,
          "contacts": [
            {
              "id": "4332",
              "version": "1",
              "addresses": [
                {
                  "id": "4334",
                  "version": "0",
                  "city": "München",
                  "company": null,
                  "company2": null,
                  "countryCode": "DE",
                  "createdDate": 1496828882836,
                  "deliveryAddress": false,
                  "globalLocationNumber": null,
                  "invoiceAddress": false,
                  "lastModifiedDate": 1496828882836,
                  "postOfficeBoxCity": null,
                  "postOfficeBoxNumber": null,
                  "postOfficeBoxZipCode": null,
                  "primeAddress": true,
                  "state": null,
                  "street1": "Fasanenweg 15",
                  "street2": null,
                  "zipcode": "80331"
                }
              ],
              "birthDate": null,
              "company": null,
              "company2": null,
              "createdDate": 1496828882837,
              "customAttributes": null,
              "description": null,
              "email": "mustermann@beipsiel.de",
              "fax": null,
              "firstName": "Max",
              "fixPhone2": null,
              "lastModifiedDate": 1496828996245,
              "lastName": "Mustermann",
              "middleName": null,
              "mobilePhone1": null,
              "mobilePhone2": null,
              "partyType": "PERSON",
              "personCompany": "Muster GmbH",
              "personDepartment": null,
              "personRole": null,
              "phone": null,
              "phoneHome": null,
              "salutation": "MR",
              "title": null,
              "website": null
            }
          ],
          "createdDate": 1496828973904,
          "creditLimit": null,
          "currencyId": "248",
          "currencyName": "EUR",
          "customAttributes": [
            {
              "attributeDefinitionId": "4048",
              "booleanValue": null,
              "dateValue": null,
              "numberValue": null,
              "selectedValueId": null,
              "selectedValues": null,
              "stringValue": null
            }
          ],
          "customerCategoryId": null,
          "customerCategoryName": null,
          "customerNumber": "C1006",
          "customerRating": null,
          "customerTopics": [],
          "defaultHeaderDiscount": null,
          "defaultHeaderSurcharge": null,
          "deliveryBlock": false,
          "description": null,
          "email": null,
          "fax": null,
          "firstName": null,
          "insolvent": false,
          "insured": false,
          "invoiceContactId": null,
          "lastModifiedDate": 1496828996212,
          "lastName": null,
          "leadSourceId": null,
          "leadSourceName": null,
          "middleName": null,
          "mobilePhone1": null,
          "oldCustomerNumber": null,
          "optIn": false,
          "parentPartyId": null,
          "partyType": "ORGANIZATION",
          "paymentMethodId": null,
          "paymentMethodName": null,
          "personCompany": null,
          "personDepartment": null,
          "personRole": null,
          "phone": null,
          "primaryContactId": null,
          "responsibleUserFixed": false,
          "responsibleUserId": "947",
          "responsibleUserUsername": "sales@weclapp.com",
          "salesChannel": "NET1",
          "salutation": null,
          "satisfaction": null,
          "sectorId": null,
          "sectorName": null,
          "shipmentMethodId": null,
          "shipmentMethodName": null,
          "termOfPaymentId": null,
          "termOfPaymentName": null,
          "title": null,
          "useCustomsTariffNumber": false,
          "vatRegistrationNumber": null,
          "website": null
        }
    ]
}

Pagination

By default the operation will not return all entity instances but only the first 100, this can be changed by using the pageSize query parameter with the number of desired results. But pageSize cannot be arbitrarily high it usually is limited 1000 (exceptions to the default limits of 100 and 1000 are noted in the documentation for the specific resources). To get further results it is necessary to skip entity instances, this is done using the page query parameter. Examples:

/customer?pageSize=10

          curl -H "AuthenticationToken:<TOKEN> https://<tenant>.com/webapp/api/v1/customer?pageSize=10

returns at most 10 instances

/customer?page=2&pageSize=10

          curl -H "AuthenticationToken:<TOKEN> https://<tenant>.com/webapp/api/v1/customer?page=2&pageSize=10

returns the second page of results (the page parameter is one based, so page=1 is the first page, which is also the default). Using those two parameters it is possible to implement pagination.

Sorting

It is also possible to change the order of the returned results using the sort parameter:

/customer?sort=lastModifiedDate

          curl -H "AuthenticationToken:<TOKEN> https://<tenant>.com/webapp/api/v1/customer?sort=lastModifiedDate

sort by lastModifiedDate (ascending).

/customer?sort=-lastModifiedDate

          curl -H "AuthenticationToken:<TOKEN> https://<tenant>.com/webapp/api/v1/customer?sort=-lastModifiedDate

sort by lastModifiedDate descending.

/customer?sort=lastModifiedDate,-salesChannel

          curl -H "AuthenticationToken:<TOKEN>
          https://<tenant>.com/webapp/api/v1/customer?sort=lastModifiedDate,-salesChannel

sort by lastModifiedDate (ascending) and then salesChannel descending.

It is generally possible to sort by most of the simple properties of an entity. It is possible to combine multiple sort orders by combining the property names with a comma. To sort in descending order just prepend a minus to the property name. If an unsupported or unknown property is specified then an error response is returned.

Filtering

It is often desired to get just a subset of the data, for example just the orders of a specific customer or created after a specific date. This is possible using filtering query parameters:

/customer?customerNumber-eq=C1002

          curl -H "AuthenticationToken:<TOKEN> https://<tenant>.com/webapp/api/v1/customer?salesChannel-eq=NET1

customers for salesChannel NET1.

/customer?createdDate-gt=1398436281262

          curl -H "AuthenticationToken:<TOKEN> https://<tenant>.com/webapp/api/v1/customer?createdDate-gt=1398436281262

customers created after the specified timestamp.

/customer?salesChannel-eq=NET1&createdDate-gt=1398436281262

          curl -H "AuthenticationToken:<TOKEN>
          https://<tenant>.com/webapp/api/v1/customer?salesChannel-eq=NET1&createdDate-gt=1398436281262

customers for salesChannel NET1 and created after the specified timestamp.

/customer?customAttribute4587-eq=NEW

          curl -H "AuthenticationToken:<TOKEN>
          https://<tenant>.com/webapp/api/v1/customer?customAttribute4587-eq=NEW

customers with the value NEW for customAttribute with id 4587.

CustomAttributeDefinitions are available under the path

/customAttributeDefinitions

All attributeTypes are supported except MULTISELECT_LIST and REFERENCE. CustomAttributes of attributeType LIST could be filtered by customAttribute{customAttributeId}.id or customAttribute{customAttributeId}.value.

/customer?customAttribute3387.value-eq=OPTION1

          curl -H "AuthenticationToken:<TOKEN>
          https://<tenant>.com/webapp/api/v1/customer?customAttribute3387.value-eq=OPTION1

customers with value OPTION1 for customAttribute with id 3387.


A filtering query parameter consists of a property name and a filter operator joined together with a minus. If multiple filtering query parameter are specified then they are combined and the returned results match all of them. Filtering query parameters for unknown properties or properties that don’t support filtering are silently ignored.

The following filtering operators are supported (not all of them work for all property types):
Operator Meaning
eq equal
ne not equal
lt less than
gt greater than
le less equal
ge greater equal
null propery is null (the query parameter value is ignored and can be ommitted)
notnull propery is not null (the query parameter value is ignored and can be ommitted)
like like expression (supports % and _ as placeholders, similar to SQL LIKE)
notlike not like expression
ilike like expression, ignoring case
notilike not like expression, ignoring case
in the property value is in the specified list of values, the query parameter value must be a JSON array with the values in the correct type, for example ?customerNumber-in=["1006","1007"]
notin the property value is not in the specified list of values

Return only specific properties

Sometimes it is desirable to only fetch a subset of all properties, for example to save bandwidth. This is possible by specifying the desired properties using the properties query parameter:

/customer?properties=id,customerNumber,salesChannel

          curl -H "AuthenticationToken:<TOKEN>
          https://<tenant>.com/webapp/api/v1/customer?properties=id,customerNumber,salesChannel
Output:
{
    "result": [
        {
          "id": "3346",
          "customerNumber": "C1002",
          "salesChannel": "NET1"
        }
    ]
}
It is also possible to specify property paths:

/customer?properties=id,customerNumber,salesChannel,contacts.id,contacts.lastName

          curl -H "AuthenticationToken:<TOKEN>
          https://<tenant>.com/webapp/api/v1/customer?properties=id,customerNumber,salesChannel,contacts.id,contacts.lastName

If an unknown property or property path is specified then an error response is returned.
{
    "result": [
        {
          "id": "3346",
          "contacts": [
            {
              "id": "3731",
              "lastName": "Mustermann"
            }
          ],
          "customerNumber": "C1002",
          "salesChannel": "NET1"
        }
    ]
}

Combinations

The query parameters for pagination, sorting, filtering and returning only specific properties can be combined to perform queries.

Counting

To determine the total number of entity instances the count operation can be used:
          curl -H "AuthenticationToken:<TOKEN> https://<tenant>.weclapp.com/webapp/api/v1/customer/count

It is possible to use the filtering query parameters from the querying operation with the count operation:
          curl -H "AuthenticationToken:<TOKEN>
          https://<tenant>.weclapp.com/webapp/api/v1/customer/count?salesChannel-eq=NET1

returns the number of customers for salesChannel NET1.

Optimistic locking

For the update operation the resources usually also support optimistic locking using the version property: if the version property is in the request body and it does not match the current version, then the request fails with an optimistic lock error. In that case the caller should again get the latest version, apply the changes and try the request again.

Basic Operations

The following entries will show you how to use the different basic operations (GET, POST, PUT, DELETE) and what an exemplary response they will give whether the operation was successfull or not.

The following table will show you the HTTP status codes of the basic operations if the operation was successfull:
Operation HTTP status code
GET 200 (OK)
POST 201 (Created)
PUT 200 (OK)
DELETE 204 (No Content)
If you are not currently logged in to weclapp, you are using another browser or the AuthenticationToken was wrong you will get a response of 401 (Unauthorized). It is possible to disable the optimisitic locking check by just ommitting the version property, but doing this might accidentally overwrite changes done by another user in the meantime.

Get a specific entity instance

Each entity instance has its own URL where it can be retrieved. The URL is based on the entity id.
Performing a GET request on that URL returns the entity instance:

/customer/id/3346

          curl -H "AuthenticationToken:<TOKEN>
          https://<tenant>.com/webapp/api/v1/customer/id/3346
Output:
{
    "result": [
       {
        "id": "3346",
        "version": "2",
        "addresses": [
          {
            "id": "3348",
            "version": "0",
            "countryCode": "DE",
            "createdDate": 1487765943229,
            "deliveryAddress": false,
            "invoiceAddress": false,
            "lastModifiedDate": 1487765943229,
            "primeAddress": true
          },
          {
            "id": "3976",
            "version": "0",
            "company": "11111",
            "company2": "22222",
            "countryCode": "DE",
            "createdDate": 1496040807652,
            "deliveryAddress": false,
            "globalLocationNumber": "gln",
            "invoiceAddress": false,
            "lastModifiedDate": 1496040807648,
            "primeAddress": false
          }
        ],
        "blocked": false,
        "company": "Musterdaten GmbH",
        "contacts": [
          {
            "id": "3377",
            "version": "0",
            "addresses": [
              {
                "id": "3379",
                "version": "0",
                "countryCode": "DE",
                "createdDate": 1487767121646,
                "deliveryAddress": false,
                "invoiceAddress": false,
                "lastModifiedDate": 1487767121645,
                "primeAddress": true
              }
            ],
            "createdDate": 1487767121649,
            "firstName": "Max",
            "lastModifiedDate": 1487767121642,
            "lastName": "Mustermann",
            "partyType": "PERSON",
            "personCompany": "Musterdaten GmbH",
            "salutation": "MR"
          }
        ],
        "createdDate": 1487765943230,
        "currencyId": "248",
        "currencyName": "EUR",
        "customAttributes": [
          {
            "attributeDefinitionId": "4048"
          }
        ],
        "customerNumber": "C1002",
        "customerTopics": [],
        "deliveryBlock": false,
        "insolvent": false,
        "insured": false,
        "lastModifiedDate": 1496040807672,
        "optIn": false,
        "partyType": "ORGANIZATION",
        "responsibleUserFixed": false,
        "responsibleUserId": "947",
        "responsibleUserUsername": "@weclapp.com",
        "salesChannel": "NET1",
        "useCustomsTariffNumber": false
      }   
    ]
}

Create a new instance

Creating new instances is done by performing a POST request to the base URL of a resource.

The body for that request must have the same structure as the result of the "get by id" request, but usually not all properties need to be specified and there are defaults for some properties. Here are some general notes:
• id, version, createdDate and lastModifiedDate can usually not be set by the client, so those values are ignored if they are specified
• references to other entities are often represented by two properties (usually id and some other more or less unique property of the referenced entity), for example customer has currencyId and currencyName to reference the currency, when creating a new customer then it is not necessary to specily both properties, one of them is usually enough as long as it specifies the referenced entity uniquely, if both are given then they must not contradict each other
• usually some required properties have sensible defaults, so if those are not given or null then the default will be used

/customer


curl -H "AuthenticationToken:<TOKEN> 
-H Content-Type: application/json
-X POST https://<tenant>.com/webapp/api/v1/customer
-d   {
       "customerNumber": "C1013",
       "partyType": "ORGANIZATION",
       "company": "Firma"
      }  
Output:

    {
      "id": "4391",
      "version": "0",
      "addresses": [
        {
          "id": "4393",
          "version": "0",
          "countryCode": "DE",
          "createdDate": 1496840784272,
          "deliveryAddress": false,
          "invoiceAddress": false,
          "lastModifiedDate": 1496840784272,
          "primeAddress": true
        }
      ],
      "blocked": false,
      "company": "Firma",
      "contacts": [],
      "createdDate": 1496840784273,
      "currencyId": "248",
      "currencyName": "EUR",
      "customAttributes": [
        {
          "attributeDefinitionId": "4048"
        }
      ],
      "customerNumber": "C1013",
      "customerTopics": [],
      "deliveryBlock": false,
      "insolvent": false,
      "insured": false,
      "lastModifiedDate": 1496840784270,
      "optIn": false,
      "partyType": "ORGANIZATION",
      "responsibleUserFixed": false,
      "responsibleUserId": "947",
      "responsibleUserUsername": "sales@weclapp.com",
      "salesChannel": "NET1",
      "useCustomsTariffNumber": false
    }

The response status will be 201 (Created) and the response will have a Location header pointing to the URL of the created instance.

Update a specific instance

Updating an instances is done by performing a PUT request to the URL of the instance.

A successful response will have the status 200 (OK) and the response body will contain the updated entity.

When updateing it is generally necessary to specify all properties that are not null, all unspecified properties will be interpreted as null. There are some exceptions:
• the read-only properties like createdDate are ignored anyway, so they do not need to be given
• id and version are processed as follows: if the id is given it must match the id of the updated instance and if the version is given then optimistic locking is enabled (see below)
• for the references that use two properties it is again possible to specify only one of them, if both are given then they must not contradict each other

Since sometimes new properties are added to entities, it is strongly recommended that an API client always first gets the latest version using
/customer/id/{id}, then modifies that JSON and finally performs the PUT request. Doing this ensures that new properties that the client does not know about are not accidentally overwritten with null.

In this example only the property "company" will be updated. All other properties are unchanged.

/customer/id/4391


  curl -H "AuthenticationToken:<TOKEN>
       -H Content-Type: application/json
       -X PUT https://<tenant>.com/webapp/api/v1/customer/id/4391
       -d   {
                "id": "4391",
                "version": "0",
                "addresses": [
                  {
                    "id": "4393",
                    "version": "0",
                    "countryCode": "DE",
                    "createdDate": 1496840784272,
                    "deliveryAddress": false,
                    "invoiceAddress": false,
                    "lastModifiedDate": 1496840784272,
                    "primeAddress": true
                  }
                ],
                "blocked": false,
                "company": "NEUER FIRMENNAME!!!",
                "contacts": [],
                "createdDate": 1496840784273,
                "currencyId": "248",
                "currencyName": "EUR",
                "customAttributes": [
                  {
                    "attributeDefinitionId": "4048"
                  }
                ],
                "customerNumber": "C1013",
                "customerTopics": [],
                "deliveryBlock": false,
                "insolvent": false,
                "insured": false,
                "lastModifiedDate": 1496840784270,
                "optIn": false,
                "partyType": "ORGANIZATION",
                "responsibleUserFixed": false,
                "responsibleUserId": "947",
                "responsibleUserUsername": "sales@weclapp.com",
                "salesChannel": "NET1",
                "useCustomsTariffNumber": false
         }
Output:

{
      "id": "4391",
      "version": "1",
      "addresses": [
        {
          "id": "4393",
          "version": "0",
          "countryCode": "DE",
          "createdDate": 1496840784272,
          "deliveryAddress": false,
          "invoiceAddress": false,
          "lastModifiedDate": 1496840784272,
          "primeAddress": true
        }
      ],
      "blocked": false,
      "company": "NEUER FIRMENNAME!!!",
      "contacts": [],
      "createdDate": 1496840784273,
      "currencyId": "248",
      "currencyName": "EUR",
      "customAttributes": [
        {
          "attributeDefinitionId": "4048"
        }
      ],
      "customerNumber": "C1013",
      "customerTopics": [],
      "deliveryBlock": false,
      "insolvent": false,
      "insured": false,
      "lastModifiedDate": 1496842955268,
      "optIn": false,
      "partyType": "ORGANIZATION",
      "responsibleUserFixed": false,
      "responsibleUserId": "947",
      "responsibleUserUsername": "sales@weclapp.com",
      "salesChannel": "NET1",
      "useCustomsTariffNumber": false
    }

Optimistic locking


For the update operation the resources usually also support optimistic locking using the version property: if the version property is in the request body and it does not match the current version, then the request fails with an optimistic lock error. In that case the caller should again get the latest version, apply the changes and try the request again. It is possible to disable the optimisitic locking check by just ommitting the version property, but doing this might accidentally overwrite changes done by another user in the meantime.

Delete a specific instance

Deleting an instances is done by performing a DELETE request to the URL of the instance.

/customer/id/{id}

          curl -H "AuthenticationToken:<TOKEN>
          -X DELETE https://<tenant>.com/webapp/api/v1/customer/id/4391

If the deletion is possible it is performed and the response status will be 204 (No Content), otherwise an error response will be returned.