Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Posting a new customer (with the friendly code properties)

We suggest to avoid to use the friendly code properties when you post a list of Customers 

...

Do not use the DefaultAddress entity which does not support the posting.

Posting a new Customer (with the Id's)

It is more efficient to specify the Id's of the related entities, especially when we post several customers using the same country, civility, language, currency, vat, category, default account, central account or payment term (PayCode).

...

      "Language_Id": "4b2d0fa7-ecf7-4883-9e04-a89d00bcd216",
      "Currency_Id": "8d70e1d6-57cf-4bc1-8402-a74d006cd472",
      "Code": "TEST2",
      "Name": "The Test Company 2",
      "VatNumber": "0000000295",
      "WebSite": "www.test2.be",
      "Addresses": [
         {
            "$type": "Winbooks.TORM.OM.Address, Winbooks.TORM.OM",
            "TotalLevel": 1,
            "Country_Id": "4bb898f0-21ba-4ea9-9c35-a74d006cd473",
            "Index": 0,
            "Address1": "Vuchtlaan 79",
            "Address2": "",
            "Town": "Antwerpen",
            "Zip": "2000",
            "Name": "",
            "Number": "",
            "Box": "",
            "PhoneNo": "+3233215476",
            "FaxNo": "",
            "MemoType": 0,
            "Memo": "",
            "IsDelivering": true,
            "IsDeliveringDefault": true,
            "IsPosting": true,
            "IsPostingDefault": true,
            "IsInvoicing": true,
            "IsInvoicingDefault": true
         }
      ]
   }
}


Check if a Customer exists

The best is to use the ExecuteCriteria.

...

In case of the customer code does not exist, it returns an empty result.

Update a Customer

You can update the Customer and the Third by the same way you create them but you have to remove the address else it will create a new address. The address has to be updated separately.

...

The TotalLevel of the last level (Third) = 2 else it won't update.

Update the Address

Find the Address Id

First we have to retrieve the Id of the Address of the Third TEST2.

...

[
    "adb4d306-63c9-4d5d-a31a-a8b3008e9946"
]

Update the Address

You have to use the PUT verb in order to update the Address based on the Id which is inside the body. Pay attention at the TotalLevel = 2.

...