Zum Inhalt

Create calcSalesOrder

Create a calcSalesOrder object in Business Central.

HTTP request

Replace the URL prefix for Business Central depending on environment following the guideline.

POST {businesscentralPrefix}/companies({id})/calcSalesOrdersWebCon

Request headers

Header Value
Authorization Bearer {token}. Required.
Content-Type application/json

Request body

In the request body, supply a JSON representation of calcSalesOrderWebCon object.

Response

If successful, this method returns 201 Created response code and a calcSalesOrder object in the response body.

Example

Request

Here is an example of a request.

POST https://{businesscentralPrefix}/companies({id})/calcSalesOrdersWebCon
Content-type: application/json

{   
    "customerNumber": "10000",
    "calcSalesOrderLinesWebCon": [
    {
        "lineType": "Item",
        "lineObjectNumber": "1925-W",        
        "quantity": 1.0
    },
    {
        "lineType": "Item",
        "lineObjectNumber": "1928-S",        
        "quantity": 2.0
    }
    ],
    "calcSalesOrderAmounts": [
        {
            "amount": 0
        }
    ]
}

Response

Here is an example of the response.

Note

The response object shown here may be truncated for brevity. All of the properties will be returned from an actual call.

{
    "id": "00000000-0000-0000-0000-000000000000",
    "customerNumber": "10000",
    "sellToCustomerName": "Adatum Corporation",
    "calcSalesOrderLinesWebCon": [
        {
            "id": "00000000-0000-0000-0000-000000000000",
            "lineType": "Item",
            "lineObjectNumber": "1925-W",
            "lineNo": 10000,
            "quantity": 1,
            "amount": 189.8
        },
        {
            "id": "00000000-0000-0000-0000-000000000000",
            "lineType": "Item",
            "lineObjectNumber": "1928-S",
            "lineNo": 20000,
            "quantity": 2,
            "amount": 110.4
        }
    ],
    "calcSalesOrderAmounts": [
        {
            "id": "00000000-0000-0000-0000-000000000000",
            "amount": 300.2,
            "amountInclVAT": 357.24,
            "amountVAT": 57.04,
            "invoiceDiscountamount": 300.2,
            "totalAmount": 0
        }
    ]
}

See also

Tips for working with the APIs
calcSalesOrder