Megaventory API v2017a

<back to all web services

PurchaseOrderCancel

The following routes are available for this service:
POST/PurchaseOrder/PurchaseOrderCancelCancels a purchase orderUses your API Key, the Number of the Purchase order you want to cancel (mvPurchaseOrderNoToCancel) and cancels the specified Purchase order if its status is Pending or Verified. Optionally, you can use mvInsertUpdateDeleteSourceApplication when an external application ( eg Magento ) is the one that triggers the PurchaseOrderCancel call.

Examples:



A.

Cancel a Purchase Order. First use the PurchaseOrderGet function to find the Purchase Order Number

Value:

{
   "mvPurchaseOrderNoToCancel": 62,
   "mvInsertUpdateDeleteSourceApplication": "Magento"
}


Response:

 {
   "result": true,
   "ResponseStatus": {
      "ErrorCode": "0"
   }
} 

To override the Content-type in your clients HTTP Accept Header, append the .jsv suffix or ?format=jsv

HTTP + JSV

The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.

POST /jsv/reply/PurchaseOrderCancel HTTP/1.1 
Host: api.megaventory.com 
Content-Type: text/jsv
Content-Length: length

{
	APIKEY: String,
	mvPurchaseOrderNoToCancel: String,
	mvPurchaseOrderTypeId: 0,
	mvInsertUpdateDeleteSourceApplication: String
}
HTTP/1.1 200 OK
Content-Type: text/jsv
Content-Length: length

{
	result: False,
	ResponseStatus: 
	{
		ErrorCode: String,
		Message: String,
		StackTrace: String,
		Errors: 
		[
			{
				ErrorCode: String,
				FieldName: String,
				Message: String
			}
		]
	},
	InternalErrorCode: String
}