SBX - Search With Button

SBX - Forum Post Title

Create Customer via API (Dynamics NAV 2018 BE localization)

Microsoft Dynamics NAV Forum

Giovanni De Stefano asked a question on 13 Jun 2018 2:21 AM

Question Status

Suggested Answer

Hello,

I am trying to create a Customer via API using Dynamics NAV 2018 BE localization.

I POST this to the customers endpoint:

{
  "displayName": "Test Customer Name 2",
  "type": "Company",
  "address": {
    "street": "Rue Osseghem, 69",
    "city": "BRUXELLES (MOLENBEEK-ST.-JEAN)",
    "state": "",
    "countryLetterCode": "BE",
    "postalCode": "1080"
  },
  "phoneNumber": "0491111111",
  "email": "zxxz@test.be",
  "website": "https://www.company2.be/",
  "taxLiable": true,
  "taxAreaId": "b6f66331-9a4d-4ba2-93f1-8264fa1d4160",
  "taxRegistrationNumber": "BE 0400 200 000",
  "currencyId": "00000000-0000-0000-0000-000000000000",
  "currencyCode": "EUR",
  "paymentTermsId": "50545c77-70a1-49ef-b562-b59be3e9d462",
  "paymentTerms": {
    "code": "FM",
    "description": "Mois en cours"
  },
  "paymentMethodId": "0c91ced9-43cb-4881-a730-fd2676166378",
  "paymentMethod": {
    "code": "BANQUE",
    "description": "Virement bancaire"
  },
  "shipmentMethodId": "34387235-adf1-443f-bf65-6687eaa7f53f",
  "shipmentMethod": {
    "code": "EXW",
    "description": "A l'usine"
  },
  "blocked": " ",
  "balance": 0,
  "overdueAmount": 0,
  "totalSalesExcludingTax": 0
}


But I get the following error (HTTP 400):

{
    "error": {
        "code": "Application_DialogException",
        "message": "You must use Enterprise No. for Belgian customers."
    }
}


I thought the taxRegistrationNumber would do but apparently that's not the case...

 I am referring to the official documentation

What field should I use to POST the Enterprise No.?

Any help is much appreciated!

Thanks,

Giovanni

Reply
Khoa Nguyen responded on 13 Jun 2018 5:43 AM
My Badges

Hi Giovanni,

Is there VAT Registration No. field? If yes, you can use it to post the Enterprise No.

Reply
Giovanni De Stefano responded on 13 Jun 2018 7:28 AM

Hello Khoa,

The closest field I see in the API is "taxRegistrationNumber".

On the other hand, I see the Enterprise No. field in the GUI as per the screenshot:

but I need to create a Customer from the API.

So, what is the Enterprise No. equivalent in the API?

Thanks,

Giovanni

Reply
Khoa Nguyen responded on 18 Jun 2018 5:23 AM
My Badges
Suggested Answer

Hi Giovanni,

You nearly reach Rome. "taxRegistrationNumber" is exactly "Enterprise No." in NAV.

So map the "taxRegistrationNumber" to "Enterprise No." for creating customer from the API.

Reply
Khoa Nguyen responded on 18 Jun 2018 5:23 AM
My Badges
Suggested Answer

Hi Giovanni,

You nearly reach Rome. "taxRegistrationNumber" is exactly "Enterprise No." in NAV.

So map the "taxRegistrationNumber" to "Enterprise No." for creating customer from the API.

Reply

SBX - Two Col Forum

SBX - Migrated JS