A common use case is when an external part need order information to fulfill the order. The order will be fetched from Plugboard, processed and shipped to the customer. The external system will usually want to update the order with tracking information. This article will show an example on how that can be done through the API.
The workflow in this example is:
- Fetch the order from Plugboard
- Handle the order in the external system
- Ship the order to the customer
- Add a shipment to the order
- Update the order status, shipping status
Fetch order
The order should be fetch from Plugboard which can be done by the method described in Fetch orders. The response will contain all matching orders, save the localId for each order. The localId can be used in the next call when adding the shipment.
Add a shipment
In this example we will only add a tracking code and a tracking uri. Plugboard stores tracking information as a shipment connected to the order. The shipment can be sent to any remote system that have shipment support in Plugboard.
Example
POST /order/{localId}/shipment OR
POST /order/by-remote-id/shipment?remoteId={the order remoteId}
[
{
"trackingCode": "Trackingcode test",
"trackingUri": "https://tracking.example.com"
}
]
Update status
The order should probably be updated when it have been shipped to the customer. The order can have an order status, payment status and a shipping status. In this example we will update the order status and the shipping status.
The current available status values for orderStatus and shippingStatus can be found in the API-reference, check the model for OrderEdit.
Example
PUT /order/{localId} OR
PUT /order/by-remote-id?remoteId={the order remoteId}
{
"orderStatus": "complete",
"shippingStatus": "fully-shipped"
}
Kommentarer
0 kommentarer
logga in för att lämna en kommentar.