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...
Suggested answer

How to Create Custom API Page in Dynamic 365 Business Central v15 cloud

(0) ShareShare
ReportReport
Posted on by

I need to create a custom API page with OData in Dynamic 365 Business Central v15 cloud - for posting a sales order as shipped via API. Can someone help me how should I achieve this? I could not find any docs for the cloud version of business central oData.

I have the same question (0)
  • LewisH95 Profile Picture
    65 on at
    RE: How to Create Custom API Page in Dynamic 365 Business Central v15 cloud

    check you this old post from the community.dynamics. They have explained how you can create custom APIs for business central. I hope this helps you.

    community.dynamics.com/.../how-to-create-custom-apis-for-business-central-even-from-macos

    If you find this article helpful, please mark it as a solution.

    Regards,

    Admin

    Apps4rent

  • Suggested answer
    THE Italian Profile Picture
    on at
    RE: How to Create Custom API Page in Dynamic 365 Business Central v15 cloud

    I think that an agile way to stretch your bones with this is to extract the standard API code. 

    You might use Docker to create a container and pull out the source code of API V1 extension or you could download on premise DVD and extract the source file from Applications folder for API V1. There you will find the source code for all standard APIs. 

    A good blog post from the almighty AJ could help you to know more about that

    https://www.kauffmann.nl/2019/11/02/where-is-the-api-v1-0-source-code/

  • Community Member Profile Picture
    on at
    RE: How to Create Custom API Page in Dynamic 365 Business Central v15 cloud

    To called Posting function in the API page, you can create a Bound Action in the page and that action will call the posting function in BC. Please refer to below link for more detail information

    community.dynamics.com/.../bound-actions-in-dynamics-nav-amp-business-central

  • Community Member Profile Picture
    on at
    RE: How to Create Custom API Page in Dynamic 365 Business Central v15 cloud

    @aotto this might be what I need but how would I form the OData base url for cloud version? Also I am not familiar with AL. I just need the posting functionality via API.

  • Community Member Profile Picture
    on at
    RE: How to Create Custom API Page in Dynamic 365 Business Central v15 cloud

    @aotto I have figured out the base url but I am not able call the bound function of Sales Order.

  • Community Member Profile Picture
    on at
    RE: How to Create Custom API Page in Dynamic 365 Business Central v15 cloud

    You should be able to call the function like below

    salesOrders("SalesOrderId")/Microsoft.NAV.shipAndInvoice

  • Community Member Profile Picture
    on at
    RE: How to Create Custom API Page in Dynamic 365 Business Central v15 cloud

    No - it does not work with POST request. This is the url - api.businesscentral.dynamics.com/.../salesOrders(e74b86e2-475c-ea11-a814-000d3ab1b8ee

    )/Microsoft.NAV.shipAndInvoice

    I get this response - 

    "error": {
            "code": "BadRequest_NotFound",
            "message": "The URI segment 'Microsoft.NAV.shipAndInvoice' is invalid after the segment 'salesOrders(e74b86e2-475c-ea11-a814-000d3ab1b8ee)'.  CorrelationId:  c4a03eb4-a53a-4ee4-b953-f6a582b4afdd."
        }
  • Community Member Profile Picture
    on at
    RE: How to Create Custom API Page in Dynamic 365 Business Central v15 cloud

    Try

    api.businesscentral.dynamics.com/.../Microsoft.NAV.shipAndInvoice

  • Community Member Profile Picture
    on at
    RE: How to Create Custom API Page in Dynamic 365 Business Central v15 cloud

    I had to change company name to company id but it worked.

    But what if I only want to ship the order not invoice it?

  • Suggested answer
    THE Italian Profile Picture
    on at
    RE: How to Create Custom API Page in Dynamic 365 Business Central v15 cloud

    You have to create a custom API with a bound action that perform what you would like to do. Not a snappy thing.

    Please refer to your CSP Partner or reseller for this.

    You are also encouraged in vote this request through IDEAS site for future product enhancements that actually request what you wuold like to do 

    https://experience.dynamics.com/ideas/idea/?ideaid=f85e9809-3f70-e911-80e7-0003ff68c74e

    "

    "

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

#2
Sumit Singh Profile Picture

Sumit Singh 2,611

#3
YUN ZHU Profile Picture

YUN ZHU 1,975 Super User 2025 Season 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans