Hi again,
I understand your confusion because i was using the field names that you see in the Business Central GUI and not the field names that is used in the api.
So the quantity field in the API is the ordered quantity - like the quantity the customer ordered.
"invoiceQuantity": "decimal",
"shipQuantity": "decimal",
These are the fields that you will use to set the quantity you want to ship and the quantity you want to invoice in this posting. So you set those fields and then you do the posting.
"shippedQuantity": "decimal",
"invoicedQuantity": "decimal",
Are updated after posting and will show the total quantity shipped and total quantity invoiced. And the numbers you find in these two fields can be the result of one or more postings.
When it comes to the shipment tracking it looks like Microsoft did not include that in any of their standard API's.
So for this we should implement a custom API. And for that we need to develop a custom API page.
https://docs.microsoft.com/en-us/dynamics365/business-central/dev-itpro/developer/devenv-develop-custom-api
Here is a code sample for how you can implement that custom api in Business Central
page 50101 SalesHeaderCustomApi
{
APIGroup = 'SalesHead';
APIPublisher = 'NorthW';
APIVersion = 'v1.0';
Caption = 'salesHeaderCustomApi';
DelayedInsert = true;
EntityName = 'salesHead';
EntitySetName = 'salesHeads';
PageType = API;
SourceTable = "Sales Header";
layout
{
area(content)
{
repeater(General)
{
field(transportMethod; Rec."Transport Method")
{
Caption = 'Transport Method';
}
field(packageTrackingNo; Rec."Package Tracking No.")
{
Caption = 'Package Tracking No.';
}
field(shipmentMethodCode; Rec."Shipment Method Code")
{
Caption = 'Shipment Method Code';
}
field(shippingAdvice; Rec."Shipping Advice")
{
Caption = 'Shipping Advice';
}
field(shippingAgentCode; Rec."Shipping Agent Code")
{
Caption = 'Shipping Agent Code';
}
field(shippingAgentServiceCode; Rec."Shipping Agent Service Code")
{
Caption = 'Shipping Agent Service Code';
}
}
}
}
}
I added the relevant shipping fields - you may not have to use all of them but i added them while i was at it.
If you are not the one doing the AL development you can hand this to the AL developers and tell them you need a custom API like this implemented in order to be able to update the tracking information.
Hope this helps you further.