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 .xml suffix or ?format=xml

HTTP + XML

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

POST /xml/reply/SupplierClientDelete HTTP/1.1 
Host: api.megaventory.com 
Content-Type: application/xml
Content-Length: length

<SupplierClientDelete xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/Megaventory.APIEndpoints.Operations">
  <APIKEY>String</APIKEY>
  <SupplierClientIDToDelete>0</SupplierClientIDToDelete>
  <SupplierClientDeleteAction>ReplaceWithNewId</SupplierClientDeleteAction>
  <NewSupplierClientIDToReplaceDeleted>0</NewSupplierClientIDToReplaceDeleted>
  <mvInsertUpdateDeleteSourceApplication>String</mvInsertUpdateDeleteSourceApplication>
</SupplierClientDelete>
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: length

<SupplierClientDeleteResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/Megaventory.APIEndpoints.Operations">
  <result>false</result>
  <ResponseStatus xmlns:d2p1="http://schemas.servicestack.net/types">
    <d2p1:ErrorCode>String</d2p1:ErrorCode>
    <d2p1:Message>String</d2p1:Message>
    <d2p1:StackTrace>String</d2p1:StackTrace>
    <d2p1:Errors>
      <d2p1:ResponseError>
        <d2p1:ErrorCode>String</d2p1:ErrorCode>
        <d2p1:FieldName>String</d2p1:FieldName>
        <d2p1:Message>String</d2p1:Message>
      </d2p1:ResponseError>
    </d2p1:Errors>
  </ResponseStatus>
  <InternalErrorCode>String</InternalErrorCode>
</SupplierClientDeleteResponse>