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

Community site session details

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

API - Retrieve Customer Record By No Rather Than SystemId

(0) ShareShare
ReportReport
Posted on by 3,197

Hi All

APIV2 examples use SystemId (guid) of the record to retrive by passing it as below:

GET businesscentralPrefix/companies({id})/customers({id})

GET businesscentralPrefix/companies({id})/customers({f2a5738a-44e3-ea11-bb43-000d3a2feca1})

Is there a way to create an endpoint to retrieve records by "No," such as customer number below:

GET businesscentralPrefix/companies({id})/customers({10000})

For a record in Cronus

"id": "f2a5738a-44e3-ea11-bb43-000d3a2feca1",

"number": "10000",

"displayName": "Adatum Corporation", "type": "Company", "addressLine1": "192 Market Square", "addressLine2": "", "city": "Atlanta", "state": "GA", "country": "US", "postalCode": "31772", "phoneNumber": "", "email": "robert.townes@contoso.com", "website": "", "taxLiable": true, "taxAreaId": "90196a90-44e3-ea11-bb43-000d3a2feca1", "taxAreaDisplayName": "ATLANTA, GA", "taxRegistrationNumber": "", "currencyId": "00000000-0000-0000-0000-000000000000", "currencyCode": "USD", "paymentTermsId": "04a5738a-44e3-ea11-bb43-000d3a2feca1", "shipmentMethodId": "00000000-0000-0000-0000-000000000000", "paymentMethodId": "3b196a90-44e3-ea11-bb43-000d3a2feca1", "blocked": " ", "lastModifiedDateTime": "2020-08-21T07:38:44.293Z"

I have the same question (0)
  • Verified answer
    YUN ZHU Profile Picture
    93,151 Super User 2025 Season 2 on at
    RE: API - Retrieve Customer Record By No Rather Than SystemId

    Hi, you can do it.

    But this need to create a new custom API page.

    For example:

    pastedimage1647561651793v1.png

    pastedimage1647561662410v2.png

    Test Code:

    page 50102 "ZY Customers"
    {
        Caption = 'ZY Customers';
        APIGroup = 'app1';
        APIPublisher = 'zy';
        APIVersion = 'v2.0';
        DelayedInsert = true;
        EntityName = 'zyCustomer';
        EntitySetName = 'zyCustomers';
        PageType = API;
        SourceTable = Customer;
    
        layout
        {
            area(content)
            {
                repeater(General)
                {
                    field(number; Rec."No.")
                    {
                        Caption = 'Customer NO.';
                    }
                    field(name; Rec.Name)
                    {
                        Caption = 'Customer Name';
                    }
                }
            }
        }
    }

    Test EndPoint: api.businesscentral.dynamics.com/.../zyCustomers('10000')

    Hope this will help.

    Thanks.

    ZHU

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…

Abhilash Warrier – Community Spotlight

We are honored to recognize Abhilash Warrier as our Community Spotlight honoree for…

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

#1
Rishabh Kanaskar Profile Picture

Rishabh Kanaskar 3,750

#2
Sumit Singh Profile Picture

Sumit Singh 2,689

#3
YUN ZHU Profile Picture

YUN ZHU 1,987 Super User 2025 Season 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans