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...
Answered

Microsoft Dynamics Business Central REST API does not return the full list of fields

(1) ShareShare
ReportReport
Posted on by 5

I'm trying to get all fields from the Business Central Customer entity, and API doesn't return the full list of properties that represented on the page

So I'm running the following request

https://api.businesscentral.dynamics.com/v2.0/DEV_ENV/api/v2.0/companies(3a6a4d9e-0000-0000-0000-d4bf220a4312)/customers?$expand=currency, paymentTerm, shipmentMethod, paymentMethod, customerFinancialDetail, defaultDimensions, agedAccountsReceivable, contactsInformation&$filter=number eq '1003058'

And expect to get also these properties in addition to the standard, but as the result of the request I'm getting the following data:

pastedimage1652861130667v2.png

actual result:

{
    "@odata.context": "https://api.businesscentral.dynamics.com/v2.0/DEV_ENV/api/v2.0/$metadata#companies(3a6a4d9e-0000-0000-0000-d4bf220a4312)/customers",
    "value": [
        {
            "@odata.etag": "W/\"qwert\"",
            "id": "40ae2178-0000-0000-0000-00224827599f",
            "number": "1003058",
            "displayName": "Test Cust",
            "type": "Company",
            "addressLine1": "line 1",
            "addressLine2": "",
            "city": "Cali",
            "state": "CA",
            "country": "US",
            "postalCode": "000000",
            "phoneNumber": "12345678",
            "email": "test@test.com",
            "website": "",
            "salespersonCode": "",
            "balanceDue": 1819,
            "creditLimit": 0,
            "taxLiable": false,
            "taxAreaId": "00000000-0000-0000-0000-000000000000",
            "taxAreaDisplayName": "",
            "taxRegistrationNumber": "",
            "currencyId": "00000000-0000-0000-0000-000000000000",
            "currencyCode": "USD",
            "paymentTermsId": "a2ba2a82-0000-0000-0000-0022482c59bf",
            "shipmentMethodId": "00000000-0000-0000-0000-000000000000",
            "paymentMethodId": "00000000-0000-0000-0000-000000000000",
            "blocked": "_x0020_",
            "lastModifiedDateTime": "2022-03-29T20:16:25.853Z",
            "currency": null,
            "paymentTerm": {
                "@odata.etag": "W/\"23556\"",
                "id": "a2ba2a82-0000-0000-0000-0022482c59bf",
                "code": "NET 30",
                "displayName": "",
                "dueDateCalculation": "30D",
                "discountDateCalculation": "",
                "discountPercent": 0,
                "calculateDiscountOnCreditMemos": false,
                "lastModifiedDateTime": "2022-04-30T04:35:25.47Z"
            },
            "shipmentMethod": null,
            "paymentMethod": null,
            "customerFinancialDetail": {
                "@odata.etag": "W/\"tyuutu=\"",
                "id": "40ae2178-0000-0000-0000-00224827599f",
                "number": "1000000",
                "balance": 1819,
                "totalSalesExcludingTax": 2168,
                "overdueAmount": 0
            },
            "defaultDimensions": [],
            "agedAccountsReceivable": {
                "@odata.etag": "W/\"qwer123\"",
                "customerId": "40ae2178-0000-0000-0000-00224827599f",
                "customerNumber": "100000",
                "name": "cust name",
                "currencyCode": "",
                "balanceDue": 1819,
                "currentAmount": 1819,
                "period1Amount": 0,
                "period2Amount": 0,
                "period3Amount": 0,
                "agedAsOfDate": "2022-05-18",
                "periodLengthFilter": "30D"
            },
            "contactsInformation": [
                {
                    "@odata.etag": "W/\"Jqwert\"",
                    "contactId": "71a7194a-0000-0000-0000-000d3a4e517b",
                    "contactNumber": "CT000000",
                    "contactName": "My",
                    "contactType": "Company",
                    "relatedId": "40ae2178-0000-0000-0000-00224827599f",
                    "relatedType": "Customer"
                }
            ]
        }
    ]
}

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

    If you are using the standard BC API there is only a selection of fields available in that API. You can customize the API if you need to include fields that are not in the standard API.

    You can also publish the page as a web service, but that is not considered best practice.

  • mava05 Profile Picture
    5 on at

    Yes, I'm using the standard BC API. How can I customize it to get access to these additional fields?

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

    Here is a walk through of how to create a custom API.

    docs.microsoft.com/.../devenv-develop-custom-api

    You will just be using the customer table instead of the table they use in their example.

    You can also copy the source code for the standard API an build on that.

    You will find that on github here:

    github.com/.../pages

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,577

#2
YUN ZHU Profile Picture

YUN ZHU 888 Super User 2025 Season 2

#3
Jainam M. Kothari Profile Picture

Jainam M. Kothari 778 Super User 2025 Season 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans