Create a Shipment for Sales Orders
If you are using the contract-based REST API to integrate MYOB Acumatica with an external system, this external system can create a shipment for multiple sales orders in a single API call.
System Preparation
Before you test the request below, you need to do the following to configure your client application and the MYOB Acumatica instance to be used:
- Deploy a new MYOB Acumatica instance with the T100 dataset. For details on deploying an instance, see Instance Deployment: To Deploy an Instance with Demo Data in the Installation Guide.
- If you use Postman as the client application for testing, in the IntegrationDevelopmentGuide.postman_collection.json collection, make sure that the collection’s variables have the proper values. This collection is located in the IntegrationDevelopment\Help folder of the Help-and-Training-Examples repository on GitHub.
- To sign in to the instance in the client application, use the tenant name (which you specified when you created the instance) and the MYSTORE branch.
- On the Sales Orders (SO301000) form, find the sales orders with the 000004 and 000006 order numbers. These are the preconfigured sales orders of the customer with the C000000003 customer ID. Make sure that these sales orders have the Open status.
Request
You can use the following example of an HTTP request to create a shipment for two sales orders.
Tip:
In the request example below,
<MYOB Acumatica instance URL>
is the URL of the MYOB Acumatica
instance (such as https://my.acumatica.com/MyInstance). You can omit the instance
name in the URL (that is, you can use https://my.acumatica.com) if the instance
is installed in the root of the website.Tip:
If you do not use the Postman collection provided with this course, to
execute this request, you need to create a new request in a Postman collection and
specify the settings as follows:
- Select the
PUT
HTTP method. - Specify the <MYOB Acumatica instance URL>/entity/Default/24.200.001/Shipment URL, such as https://localhost/MyStoreInstance/entity/Default/24.200.001/Shipment.
- On the Params tabs, specify the values of the $expand and $select parameters.
- Make sure that the authorization is configured correctly.
- On the Headers tab, add the values of the Accept and Content-Type headers.
- On the Body tab, add the body of the request.
PUT /entity/Default/24.200.001/Shipment?
$select=Type,ShipmentNbr,Status,Details/InventoryID&
$expand=Details HTTP/1.1
Host: [<MYOB Acumatica instance URL>]
Accept: application/json
Content-Type: application/json
{
"Type":{"value":"Shipment"},
"CustomerID":{"value":"C000000003"},
"WarehouseID":{"value":"MAIN"},
"ShipmentDate":{"value":"2024-11-01"},
"Details":[
{
"OrderType":{"value":"SO"},
"OrderNbr":{"value":"000004"}
},
{
"OrderType":{"value":"SO"},
"OrderNbr":{"value":"000006"}
}
]
}
Usage Notes
Note the following about creation of a shipment:
- Although you are creating a shipment with multiple detail lines, you use one request for the creation of the shipment. (That is, you do not need to submit each detail of the shipment in a separate request.) For optimal performance of the application, it is important to use the minimum number of requests.
- If you need to include in a shipment particular items (rather than all items) from a sales order, you need to retrieve the sales orders with the included items from MYOB Acumatica by using the key fields, and then include the needed items in the shipment (by specifying the inventory ID, the warehouse ID, and the type and number of the sales order in which the item is included in the details of the shipment).
-
If you intend to use the Picked field of the Shipment entity, note that its value may be incorrect in scenarios other than batch picking or wave picking.