cs_api_dotnet.CaseStackApi.SetShipmentStatus C# (CSharp) Method

SetShipmentStatus() public method

Set status of shipment
public SetShipmentStatus ( int shipmentId, ShipmentStatus status ) : void
shipmentId int Shipment ID
status ShipmentStatus Shipment Status
return void
        public void SetShipmentStatus(int shipmentId, ShipmentStatus status)
        {
            var client = GetRestClient();
            var request = new RestRequest
            {
                Resource = "api/shipment/status/" + shipmentId,
                RequestFormat = DataFormat.Json,
                Method = Method.PUT
            };

            request.AddParameter("status", EnumUtils.stringValueOf(status));

            var response = client.Execute(request);
            if (response.ErrorException != null)
                throw new ApplicationException("Error updating status of Shipment", response.ErrorException);
        }