web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Small and medium business | Business Central, N...
Suggested Answer

How to set customer's Gen. Bus. Posting Group and Customer Posting Group through BC REST API

(0) ShareShare
ReportReport
Posted on by 10

Hi,


I am unable to set the customer's Gen. Bus. Posting Group and Customer Posting Group using the business central API, as I see no fields exposed for the same.

The customer endpoint being used is below:

https://docs.microsoft.com/en-us/dynamics365/business-central/dev-itpro/api-reference/v2.0/api/dynamics_customer_create



This means that we are unable to create an invoice to business central for a new customer using the API.

If we try to create an invoice without setting these fields, the below error occurs:

Application_FieldValidationException:Gen. Bus. Posting Group must have a value in Customer: No.=11. It cannot be zero or empty.  CorrelationId:  662bd19f-6643-4971-82c1-d55e1d08705c.

The user is having to manually go in to the website to set these fields for each new customer.

For an existing customer this works fine (as the details are already filled in).

I have read in some answers that we can setup customer templates (with default values) for this. But then how to specify which template to use when creating the customer using the API.
 


Can anyone help me out please? An example would be really helpful.



Thanks

Inte



customer.png

I have the same question (5)
  • Suggested answer
    Inge M. Bruvik Profile Picture
    1,111 Moderator on at

    Even if the fields are not shown in the example code you can just add them to your request body.

  • Suggested answer
    YUN ZHU Profile Picture
    95,597 Super User 2025 Season 2 on at

    Hi, Standard API may have many limitations, so I think you can create a Custom API.

    https://docs.microsoft.com/en-us/dynamics365/business-central/dev-itpro/developer/devenv-develop-custom-api#creating-api-pages

    Hope this will help.

    Thanks.

    ZHU

  • Inte Profile Picture
    10 on at

    Hi, can you pls tell me what are the field names for Gen. Bus. Posting Group and Customer Posting Group ? I could not find them on the customer object. Thanks

  • Suggested answer
    Inge M. Bruvik Profile Picture
    1,111 Moderator on at

    They are called:Gen. Bus. Posting Group  field no. 88

    and: Customer Posting Group field no. 21

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Small and medium business | Business Central, NAV, RMS

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 2,785

#2
Jainam M. Kothari Profile Picture

Jainam M. Kothari 1,007 Super User 2025 Season 2

#3
YUN ZHU Profile Picture

YUN ZHU 948 Super User 2025 Season 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans