Skip to main content

Notifications

Announcements

No record found.

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"
                }
            ]
        }
    ]
}

  • Suggested answer
    Inge M. Bruvik Profile Picture
    Inge M. Bruvik 995 Super User 2024 Season 1 on at
    RE: Microsoft Dynamics Business Central REST API does not return the full list of fields

    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

  • mava05 Profile Picture
    mava05 5 on at
    RE: Microsoft Dynamics Business Central REST API does not return the full list of fields

    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
    Inge M. Bruvik 995 Super User 2024 Season 1 on at
    RE: Microsoft Dynamics Business Central REST API does not return the full list of fields

    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.

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

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Vahid Ghafarpour – Community Spotlight

We are excited to recognize Vahid Ghafarpour as our February 2025 Community…

Congratulations to the January Top 10 leaders!

Check out the January community rock stars...

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 292,187 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 230,966 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans