Skip to main content

Notifications

Community site session details

Community site session details

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

How to read data sent into body of API page from postman and create a sales order

(0) ShareShare
ReportReport
Posted on by 10

Hi All,

I am new to AL Programming. I have created an API page in BC that saves data to an custom tables named "Sales Order" and "Sales Order Lines". I am calling this API  from postman and sending an json object to its body.  I am getting this data in custom tables properly.

I want to read this json object on api page and on behalf of the received data want to create a sales order. How can I achieve that. 

Thanks in advance.

Json object that I am sending in body from postman:

{

    "Order_ID""304563",
    "Custome_ID""20220818122121923",
    "Customer_Code""104",
    "VendInvNo""",
    "VendInvDateTm""2023-05-10T05:49:46Z",
    "WorkOrderNo""",
    "OrderStatus""Acknowledged",
    "ShipCompany""ANOKA-RAMSEY CC",
    "ShipFirstName""CHELSY LEE",
    "ShipLastName""",
    "ShipAddress""ROOM C159- RECEIVING",
    "ShipAddress2""11200 MISSISSIPPI B...",
    "ShipCity""COON RAPIDS",
    "ShipState""MN",
    "ShipPostalCode""55433",
    "ShipCountry""",
    "ShipPhoneNumber""411-1234",
    "TotalOrder"95.09,
    "ShippingMethod_ID""14",
    "Customer_PO""P0372987",
    "FreightCharge"0.0,
    "OrderComments""30447**P0372987**1480616949**887717432",
    "LineType_NAV""0",
    "Status_NAV""0",
    "SelltoCustomerNo_"null,
    "VendorOrderID""1480616949",
    "Terms""PO",
    "OrderDateTm""2023-05-10T05:49:46Z",
    "ShipDateTm""2023-05-10T05:49:46Z",
    "CreationDateTm""2023-05-10T05:49:46Z",
    "ExtraField"null,
    "TaxAmount"null,
    "SupplierID""1",
    "MiscChg1"0.0,
    "MiscChg2"0.0,
    "CustomerInvoiceNumber""",
    "Source""STANDARD ORDER",
    "SupplierAcctNo""887717432",
    "salesOrderLines": [
        {
            "Order_ID""304563",
            "OrderDetail_ID""41239",
            "Quantity"2,
            "UnitPrice"5.84,
            "BuyPrice"5.84,
            "DetailStatus""Acknowledged",
            "Punchout_LineNumber""1",
            "Punchout_Item_Number""1NXZ9",
            "Punchout_ManufacturerName""TOUGH GUY",
            "Punchout_ManufacturerPartID""1NXZ9",
            "Punchout_Classification""",
            "Punchout_Description"" Bench Brush Bristle Firmness Medium Bristle Material Synthetic Handle Material Foam Brush Length 9 in Handle Length 2 in Bristle Color Black Overall Length 14 3/8 in Chemical Resistant Yes Bristle Length 2 1/2 in Brush...",
            "Discount"null,
            "ExpectedShipDateTm""2023-05-09T00:00:00Z",
            "ItemCategory""N/A",
            "Status_NAV""1",
            "LineType_NAV""0",
            "VendInvLineUnitCost"0.0,
            "Import_Header_ID""0",
            "VendInvNo""",
            "VendInvDateTm"null,
            "VendInvLineQty"0,
            "CreationDateTm""2023-05-10T05:49:46Z",
            "CustomerInvoiceNo""",
            "AckStatus""accept",
            "Punchout_UoM""",
            "SupplierID""1",
            "SupplierAcctNo""887717432"
        },
        {
            "Order_ID""304563",
            "OrderDetail_ID""41240",
            "Quantity"2,
            "UnitPrice"5.84,
            "BuyPrice"5.84,
            "DetailStatus""Acknowledged",
            "Punchout_LineNumber""2",
            "Punchout_Item_Number""1NXZ9",
            "Punchout_ManufacturerName""TOUGH GUY",
            "Punchout_ManufacturerPartID""1NXZ9",
            "Punchout_Classification""",
            "Punchout_Description"" Bench Brush Bristle Firmness Medium Bristle Material Synthetic Handle Material Foam Brush Length 9 in Handle Length 2 in Bristle Color Black Overall Length 14 3/8 in Chemical Resistant Yes Bristle Length 2 1/2 in Brush...",
            "Discount"null,
            "ExpectedShipDateTm""2023-05-09T00:00:00Z",
            "ItemCategory""N/A",
            "Status_NAV""1",
            "LineType_NAV""0",
            "VendInvLineUnitCost"0.0,
            "Import_Header_ID""0",
            "VendInvNo""",
            "VendInvDateTm"null,
            "VendInvLineQty"0,
            "CreationDateTm""2023-05-10T05:49:46Z",
            "CustomerInvoiceNo""",
            "AckStatus""accept",
            "Punchout_UoM""",
            "SupplierID""1",
            "SupplierAcctNo""887717432"
        }
    ]
}

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

Jainam Kothari – Community Spotlight

We are honored to recognize Jainam Kothari as our June 2025 Community…

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

Leaderboard >

Featured topics

Product updates

Dynamics 365 release plans