Megaventory API v2017a

<back to all web services

SupplierClientDelete

The following routes are available for this service:
POST/SupplierClient/SupplierClientDeleteDeletes a current suplier or clientUses your API Key and the ID of the supplier/client you want to delete (SupplierClientIDToDelete) and deletes the specified supplier/client, if the specified supplier/client exists in Megaventory. You can specify the kind of delete action you want to implement using SupplierClientDeleteAction. In particular, you can replace them with a new Id (exclusively for Suppliers and only if the new Id provided is another Supplier's Id), you can delete all the products associated with this Supplier/Client or use the default option to just delete the Supplier/Client. Optionally, you can use mvInsertUpdateDeleteSourceApplication when an external application ( eg Magento ) is the one that triggers the SupplierClientDelete call.

Examples:



A.

Replace a supplier's Id with 7. Call was triggered by Magento.

Value:

{
   "SupplierClientIDToDelete": "20",
   "SupplierClientDeleteAction": "ReplaceWithNewId",
   "NewSupplierClientIDToReplaceDeleted": "7",
   "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/SupplierClientDelete HTTP/1.1 
Host: api.megaventory.com 
Content-Type: text/jsv
Content-Length: length

{
	APIKEY: String,
	SupplierClientIDToDelete: 0,
	SupplierClientDeleteAction: ReplaceWithNewId,
	NewSupplierClientIDToReplaceDeleted: 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
}