Skip to main content

Notifications

Announcements

No record found.

Business Central forum
Unanswered

Custom API to Create Sales Order in on-prem BC

Posted on by 47
Hi All,
 
Good Morning
 
I am using On-Prem Business central.

I want to create a custom API using AL language, which will accept the below payload/request and then will create a sales order with line items also.
But i tried to do it, not able to achieve this. I have gone through many videos but not get any satisfied answer.
 
Does anyone have any idea about this,  or if you have any code snip please share.
 
Payload/Request :  This will contains sales order header detail along with line items.
{
    "orderDate": "2024-10-10",
    "postingDate": "2024-10-10",
    "customerId": "d46301ed-970b-ee11-962f-00224859f0ad",
    "currencyCode": "SGD",
    "salesperson": "LEROY",
    "salesOrderLines": [
        {
            "itemId": "eb230e11-160c-ee11-962f-00224859f0ad",
            "lineType": "Item",
            "lineObjectNumber": "10810900019",
            "description": "AXE BODY WASH (INDIA) 250ML X 12 AFRICA",
            "unitOfMeasureId": "add2b303-200c-ee11-962f-00224859f0ad",
            "unitOfMeasureCode": "CTN",
            "quantity": 1,
            "unitPrice": 17,
            "locationId": "4af3149a-6a0c-ee11-962f-00224859f0ad"
        }
    ]
}

Thanks for your Help.
Categories:

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

Anton Venter – Community Spotlight

Kudos to our October Community Star of the month!

Announcing Our 2024 Season 2 Super Users!

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

Dynamics 365 Community Newsletter - September 2024

Check out the latest community news

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 290,552 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 228,552 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,148

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans