Megaventory API v2017a

<back to all web services

SupplierClientUpdate

The following routes are available for this service:
POST/SupplierClient/SupplierClientUpdateInserts a supplier/client or updates an existing one.Uses your API Key and applies a mvRecordAction value on an mvSupplierClient object. We can insert the mvSupplierClient we specified using "Insert" as our mvRecordAction. We can update a current one using "Update", we can insert it if it doesn't already exist, update it if it does using "InsertOrUpdate" and we can insert new fields or update non-empty fields of the object using "InsertOrUpdateNonEmptyFields". Optionally, you can use mvInsertUpdateDeleteSourceApplication when an external application ( eg WooCommerce ) is the one that triggers the SupplierClientUpdate call. SupplierClientId cannot be updated.

Examples:



A.

Insert a new supplier who has 2 contacts. The SupplierClientUpdate call was triggered by Magento.

Value:

 {
   "mvSupplierClient": {
      "SupplierClientType": "Supplier",
      "SupplierClientName": "A4 Paper Supplier",
      "mvContacts": [
         {
            "ContactName": "Andrew Stevens",
            "ContactDepartment": "A4 Papers/Printing",
            "ContactEmail": "andrew@a4printing.jp",
            "ContantIsPrimary": "true"
         },
         {
            "ContactName": "Maria Weems",
            "ContactDepartment": "A4 Papers/Pictures"
         }
      ],
      "SupplierClientBillingAddress": "41st Trueroad , Inglewood CA",
      "SupplierClientShippingAddress": "93rd Kiwi Street, Las Vegas, Nevada"
   },
   "mvGrantPermissionsToAllUser": "true",
   "mvRecordAction": "Insert",
   "mvInsertUpdateDeleteSourceApplication": "Magento"
} 


Response:

 {
   "mvSupplierClient": {
      "SupplierClientID": 23,
      "SupplierClientType": "Supplier",
      "SupplierClientName": "A4 Paper Supplier",
      "mvContacts": [
         {
            "ContactName": "Andrew Stevens",
            "ContactDepartment": "A4 Papers/Printing",
            "ContactEmail": "andrew@a4printing.jp",
            "ContactIsPrimary": false
         },
         {
            "ContactName": "Maria Weems",
            "ContactDepartment": "A4 Papers/Pictures",
            "ContactIsPrimary": false
         }
      ],
      "SupplierClientBillingAddress": "41st Trueroad , Inglewood CA",
      "SupplierClientShippingAddress1": "",
      "SupplierClientShippingAddress2": "",
      "SupplierClientPhone1": "",
      "SupplierClientPhone2": "",
      "SupplierClientFax": "",
      "SupplierClientIM": "",
      "SupplierClientEmail": "",
      "SupplierClientTaxID": "",
      "SupplierClientComments": "",
      "SupplierClientCustomField1": "",
      "SupplierClientCustomField2": "",
      "SupplierClientCustomField3": "",
      "SupplierClientCustomField4": "",
      "SupplierClientCustomField5": "",
      "SupplierClientCustomField6": "",
      "SupplierClientCustomField7": "",
      "SupplierClientCustomField8": "",
      "SupplierClientCustomField9": "",
      "SupplierClientCustomField10": "",
      "SupplierClientOption1": "",
      "SupplierClientOption2": "",
      "SupplierClientOption3": "",
      "SupplierClientOption4": "",
      "SupplierClientOption5": "",
      "SupplierClientOption6": "",
      "SupplierClientOption7": "",
      "SupplierClientOption8": "",
      "SupplierClientOption9": "",
      "SupplierClientOption10": "",
      "SupplierClientCreationDate": "/Date(1507628895856+0300)/"
   },
   "ResponseStatus": {
      "ErrorCode": "0"
   },
   "entityID": 23
}

B.



Updates the above supplier by changing his billing address, adding a second shipping address, a phone and an IM contact.

Value:

 {
   "mvSupplierClient": {
      "SupplierClientId": "23",
      "SupplierClientName": "A4 Paper Supplier",
      "SupplierClientBillingAddress": "47th Trueroad , Inglewood CA",
      "SupplierClientShippingAddress2": "11th Trueside Boulevard, Jacksonville, FL",
      "SupplierClientPhone1": "+113236237323232",
      "SupplierClientIM": "@andrewstevens2017"
   },
   "mvRecordAction": "Update"
} 


Response:

 {
   "mvSupplierClient": {
      "SupplierClientID": 23,
      "SupplierClientType": "Supplier",
      "SupplierClientName": "A4 Paper Supplier",
      "mvContacts": [],
      "SupplierClientBillingAddress": "47th Trueroad , Inglewood CA",
      "SupplierClientShippingAddress1": "",
      "SupplierClientShippingAddress2": "11th Trueside Boulevard, Jacksonville, FL",
      "SupplierClientPhone1": "+113236237323232",
      "SupplierClientPhone2": "",
      "SupplierClientFax": "",
      "SupplierClientIM": "@andrewstevens2017",
      "SupplierClientEmail": "",
      "SupplierClientTaxID": "",
      "SupplierClientCustomField1": "",
      "SupplierClientCustomField2": "",
      "SupplierClientCustomField3": "",
      "SupplierClientCustomField4": "",
      "SupplierClientCustomField5": "",
      "SupplierClientCustomField6": "",
      "SupplierClientCustomField7": "",
      "SupplierClientCustomField8": "",
      "SupplierClientCustomField9": "",
      "SupplierClientCustomField10": "",
      "SupplierClientOption1": "",
      "SupplierClientOption2": "",
      "SupplierClientOption3": "",
      "SupplierClientOption4": "",
      "SupplierClientOption5": "",
      "SupplierClientOption6": "",
      "SupplierClientOption7": "",
      "SupplierClientOption8": "",
      "SupplierClientOption9": "",
      "SupplierClientOption10": "",
      "SupplierClientCreationDate": "/Date(1507628895857-0000)/"
   },
   "ResponseStatus": {
      "ErrorCode": "0"
   },
   "entityID": 23
}

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

To embed the response in a jsonp callback, append ?callback=myCallback

HTTP + JSON

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

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

{"APIKEY":"String","mvSupplierClient":{"SupplierClientID":0,"SupplierClientType":"Both","SupplierClientName":"String","SupplierClientBillingAddress":"String","SupplierClientShippingAddress1":"String","SupplierClientShippingAddress2":"String","SupplierClientAddresses":[{"AddressType":"General","AddressLine1":"String","AddressLine2":"String","AddressLine3":"String","Name":"String","Phone":"String","Email":"String","TaxIdNumber":"String","Organization":"String","City":"String","State":"String","Country":"NONE","CountryName":"String","Longitude":"String","Latitude":"String","ZipCode":"String"}],"SupplierClientPhone1":"String","SupplierClientPhone2":"String","SupplierClientFax":"String","SupplierClientIM":"String","SupplierClientEmail":"String","SupplierClientCurrency":"String","SupplierClientPaymentTermsEnum":"None","SupplierClientPaymentMethodEnum":"None","SupplierClientComments":"String","SupplierClientCustomField1":"String","SupplierClientCustomField2":"String","SupplierClientCustomField3":"String","SupplierClientCustomField4":"String","SupplierClientCustomField5":"String","SupplierClientCustomField6":"String","SupplierClientCustomField7":"String","SupplierClientCustomField8":"String","SupplierClientCustomField9":"String","SupplierClientCustomField10":"String","SupplierClientOption1":false,"SupplierClientOption2":false,"SupplierClientOption3":false,"SupplierClientOption4":false,"SupplierClientOption5":false,"SupplierClientOption6":false,"SupplierClientOption7":false,"SupplierClientOption8":false,"SupplierClientOption9":false,"SupplierClientOption10":false,"SupplierClientCreationDate":"\/Date(-62135596800000-0000)\/","mvContacts":[{"ContactId":0,"ContactName":"String","ContactDepartment":"String","ContactAddress":"String","ContactFullAddress":{"AddressType":"General","AddressLine1":"String","AddressLine2":"String","AddressLine3":"String","Name":"String","Phone":"String","Email":"String","TaxIdNumber":"String","Organization":"String","City":"String","State":"String","Country":"NONE","CountryName":"String","Longitude":"String","Latitude":"String","ZipCode":"String"},"ContactEmail":"String","ContactPhone1":"String","ContactPhone2":"String","ContactFax":"String","ContactIM":"String","ContactCustomField1":"String","ContactCustomField2":"String","ContactIsPrimary":false,"mvSuppliersClients":[{"SupplierClientID":0,"SupplierClientType":"Both","SupplierClientName":"String","SupplierClientBillingAddress":"String","SupplierClientShippingAddress1":"String","SupplierClientShippingAddress2":"String","SupplierClientAddresses":[{"AddressType":"General","AddressLine1":"String","AddressLine2":"String","AddressLine3":"String","Name":"String","Phone":"String","Email":"String","TaxIdNumber":"String","Organization":"String","City":"String","State":"String","Country":"NONE","CountryName":"String","Longitude":"String","Latitude":"String","ZipCode":"String"}],"SupplierClientPhone1":"String","SupplierClientPhone2":"String","SupplierClientFax":"String","SupplierClientIM":"String","SupplierClientEmail":"String","SupplierClientCurrency":"String","SupplierClientPaymentTermsEnum":"None","SupplierClientPaymentMethodEnum":"None","SupplierClientComments":"String","SupplierClientCustomField1":"String","SupplierClientCustomField2":"String","SupplierClientCustomField3":"String","SupplierClientCustomField4":"String","SupplierClientCustomField5":"String","SupplierClientCustomField6":"String","SupplierClientCustomField7":"String","SupplierClientCustomField8":"String","SupplierClientCustomField9":"String","SupplierClientCustomField10":"String","SupplierClientOption1":false,"SupplierClientOption2":false,"SupplierClientOption3":false,"SupplierClientOption4":false,"SupplierClientOption5":false,"SupplierClientOption6":false,"SupplierClientOption7":false,"SupplierClientOption8":false,"SupplierClientOption9":false,"SupplierClientOption10":false,"SupplierClientCreationDate":"\/Date(-62135596800000-0000)\/","mvContacts":[{"ContactId":0,"ContactName":"String","ContactDepartment":"String","ContactAddress":"String","ContactFullAddress":{"AddressType":"General","AddressLine1":"String","AddressLine2":"String","AddressLine3":"String","Name":"String","Phone":"String","Email":"String","TaxIdNumber":"String","Organization":"String","City":"String","State":"String","Country":"NONE","CountryName":"String","Longitude":"String","Latitude":"String","ZipCode":"String"},"ContactEmail":"String","ContactPhone1":"String","ContactPhone2":"String","ContactFax":"String","ContactIM":"String","ContactCustomField1":"String","ContactCustomField2":"String","ContactIsPrimary":false,"mvSuppliersClients":[{"SupplierClientID":0,"SupplierClientType":"Both","SupplierClientName":"String","SupplierClientBillingAddress":"String","SupplierClientShippingAddress1":"String","SupplierClientShippingAddress2":"String","SupplierClientAddresses":[{"AddressType":"General","AddressLine1":"String","AddressLine2":"String","AddressLine3":"String","Name":"String","Phone":"String","Email":"String","TaxIdNumber":"String","Organization":"String","City":"String","State":"String","Country":"NONE","CountryName":"String","Longitude":"String","Latitude":"String","ZipCode":"String"}],"SupplierClientPhone1":"String","SupplierClientPhone2":"String","SupplierClientFax":"String","SupplierClientIM":"String","SupplierClientEmail":"String","SupplierClientCurrency":"String","SupplierClientPaymentTermsEnum":"None","SupplierClientPaymentMethodEnum":"None","SupplierClientComments":"String","SupplierClientCustomField1":"String","SupplierClientCustomField2":"String","SupplierClientCustomField3":"String","SupplierClientCustomField4":"String","SupplierClientCustomField5":"String","SupplierClientCustomField6":"String","SupplierClientCustomField7":"String","SupplierClientCustomField8":"String","SupplierClientCustomField9":"String","SupplierClientCustomField10":"String","SupplierClientOption1":false,"SupplierClientOption2":false,"SupplierClientOption3":false,"SupplierClientOption4":false,"SupplierClientOption5":false,"SupplierClientOption6":false,"SupplierClientOption7":false,"SupplierClientOption8":false,"SupplierClientOption9":false,"SupplierClientOption10":false,"SupplierClientCreationDate":"\/Date(-62135596800000-0000)\/","mvContacts":[{"ContactId":0,"ContactName":"String","ContactDepartment":"String","ContactAddress":"String","ContactFullAddress":{"AddressType":"General","AddressLine1":"String","AddressLine2":"String","AddressLine3":"String","Name":"String","Phone":"String","Email":"String","TaxIdNumber":"String","Organization":"String","City":"String","State":"String","Country":"NONE","CountryName":"String","Longitude":"String","Latitude":"String","ZipCode":"String"},"ContactEmail":"String","ContactPhone1":"String","ContactPhone2":"String","ContactFax":"String","ContactIM":"String","ContactCustomField1":"String","ContactCustomField2":"String","ContactIsPrimary":false,"mvSuppliersClients":[{}]}],"SupplierClientTaxID":"String"}]}],"SupplierClientTaxID":"String"}]}],"SupplierClientTaxID":"String"},"mvRecordAction":"Insert","mvGrantPermissionsToAllUsers":false,"mvInsertUpdateDeleteSourceApplication":"String"}
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: length

{"mvSupplierClient":{"SupplierClientID":0,"SupplierClientType":"Both","SupplierClientName":"String","SupplierClientBillingAddress":"String","SupplierClientShippingAddress1":"String","SupplierClientShippingAddress2":"String","SupplierClientAddresses":[{"AddressType":"General","AddressLine1":"String","AddressLine2":"String","AddressLine3":"String","Name":"String","Phone":"String","Email":"String","TaxIdNumber":"String","Organization":"String","City":"String","State":"String","Country":"NONE","CountryName":"String","Longitude":"String","Latitude":"String","ZipCode":"String"}],"SupplierClientPhone1":"String","SupplierClientPhone2":"String","SupplierClientFax":"String","SupplierClientIM":"String","SupplierClientEmail":"String","SupplierClientCurrency":"String","SupplierClientPaymentTermsEnum":"None","SupplierClientPaymentMethodEnum":"None","SupplierClientComments":"String","SupplierClientCustomField1":"String","SupplierClientCustomField2":"String","SupplierClientCustomField3":"String","SupplierClientCustomField4":"String","SupplierClientCustomField5":"String","SupplierClientCustomField6":"String","SupplierClientCustomField7":"String","SupplierClientCustomField8":"String","SupplierClientCustomField9":"String","SupplierClientCustomField10":"String","SupplierClientOption1":false,"SupplierClientOption2":false,"SupplierClientOption3":false,"SupplierClientOption4":false,"SupplierClientOption5":false,"SupplierClientOption6":false,"SupplierClientOption7":false,"SupplierClientOption8":false,"SupplierClientOption9":false,"SupplierClientOption10":false,"SupplierClientCreationDate":"\/Date(-62135596800000-0000)\/","mvContacts":[{"ContactId":0,"ContactName":"String","ContactDepartment":"String","ContactAddress":"String","ContactFullAddress":{"AddressType":"General","AddressLine1":"String","AddressLine2":"String","AddressLine3":"String","Name":"String","Phone":"String","Email":"String","TaxIdNumber":"String","Organization":"String","City":"String","State":"String","Country":"NONE","CountryName":"String","Longitude":"String","Latitude":"String","ZipCode":"String"},"ContactEmail":"String","ContactPhone1":"String","ContactPhone2":"String","ContactFax":"String","ContactIM":"String","ContactCustomField1":"String","ContactCustomField2":"String","ContactIsPrimary":false,"mvSuppliersClients":[{"SupplierClientID":0,"SupplierClientType":"Both","SupplierClientName":"String","SupplierClientBillingAddress":"String","SupplierClientShippingAddress1":"String","SupplierClientShippingAddress2":"String","SupplierClientAddresses":[{"AddressType":"General","AddressLine1":"String","AddressLine2":"String","AddressLine3":"String","Name":"String","Phone":"String","Email":"String","TaxIdNumber":"String","Organization":"String","City":"String","State":"String","Country":"NONE","CountryName":"String","Longitude":"String","Latitude":"String","ZipCode":"String"}],"SupplierClientPhone1":"String","SupplierClientPhone2":"String","SupplierClientFax":"String","SupplierClientIM":"String","SupplierClientEmail":"String","SupplierClientCurrency":"String","SupplierClientPaymentTermsEnum":"None","SupplierClientPaymentMethodEnum":"None","SupplierClientComments":"String","SupplierClientCustomField1":"String","SupplierClientCustomField2":"String","SupplierClientCustomField3":"String","SupplierClientCustomField4":"String","SupplierClientCustomField5":"String","SupplierClientCustomField6":"String","SupplierClientCustomField7":"String","SupplierClientCustomField8":"String","SupplierClientCustomField9":"String","SupplierClientCustomField10":"String","SupplierClientOption1":false,"SupplierClientOption2":false,"SupplierClientOption3":false,"SupplierClientOption4":false,"SupplierClientOption5":false,"SupplierClientOption6":false,"SupplierClientOption7":false,"SupplierClientOption8":false,"SupplierClientOption9":false,"SupplierClientOption10":false,"SupplierClientCreationDate":"\/Date(-62135596800000-0000)\/","mvContacts":[{"ContactId":0,"ContactName":"String","ContactDepartment":"String","ContactAddress":"String","ContactFullAddress":{"AddressType":"General","AddressLine1":"String","AddressLine2":"String","AddressLine3":"String","Name":"String","Phone":"String","Email":"String","TaxIdNumber":"String","Organization":"String","City":"String","State":"String","Country":"NONE","CountryName":"String","Longitude":"String","Latitude":"String","ZipCode":"String"},"ContactEmail":"String","ContactPhone1":"String","ContactPhone2":"String","ContactFax":"String","ContactIM":"String","ContactCustomField1":"String","ContactCustomField2":"String","ContactIsPrimary":false,"mvSuppliersClients":[{"SupplierClientID":0,"SupplierClientType":"Both","SupplierClientName":"String","SupplierClientBillingAddress":"String","SupplierClientShippingAddress1":"String","SupplierClientShippingAddress2":"String","SupplierClientAddresses":[{"AddressType":"General","AddressLine1":"String","AddressLine2":"String","AddressLine3":"String","Name":"String","Phone":"String","Email":"String","TaxIdNumber":"String","Organization":"String","City":"String","State":"String","Country":"NONE","CountryName":"String","Longitude":"String","Latitude":"String","ZipCode":"String"}],"SupplierClientPhone1":"String","SupplierClientPhone2":"String","SupplierClientFax":"String","SupplierClientIM":"String","SupplierClientEmail":"String","SupplierClientCurrency":"String","SupplierClientPaymentTermsEnum":"None","SupplierClientPaymentMethodEnum":"None","SupplierClientComments":"String","SupplierClientCustomField1":"String","SupplierClientCustomField2":"String","SupplierClientCustomField3":"String","SupplierClientCustomField4":"String","SupplierClientCustomField5":"String","SupplierClientCustomField6":"String","SupplierClientCustomField7":"String","SupplierClientCustomField8":"String","SupplierClientCustomField9":"String","SupplierClientCustomField10":"String","SupplierClientOption1":false,"SupplierClientOption2":false,"SupplierClientOption3":false,"SupplierClientOption4":false,"SupplierClientOption5":false,"SupplierClientOption6":false,"SupplierClientOption7":false,"SupplierClientOption8":false,"SupplierClientOption9":false,"SupplierClientOption10":false,"SupplierClientCreationDate":"\/Date(-62135596800000-0000)\/","mvContacts":[{"ContactId":0,"ContactName":"String","ContactDepartment":"String","ContactAddress":"String","ContactFullAddress":{"AddressType":"General","AddressLine1":"String","AddressLine2":"String","AddressLine3":"String","Name":"String","Phone":"String","Email":"String","TaxIdNumber":"String","Organization":"String","City":"String","State":"String","Country":"NONE","CountryName":"String","Longitude":"String","Latitude":"String","ZipCode":"String"},"ContactEmail":"String","ContactPhone1":"String","ContactPhone2":"String","ContactFax":"String","ContactIM":"String","ContactCustomField1":"String","ContactCustomField2":"String","ContactIsPrimary":false,"mvSuppliersClients":[{}]}],"SupplierClientTaxID":"String"}]}],"SupplierClientTaxID":"String"}]}],"SupplierClientTaxID":"String"},"ResponseStatus":{"ErrorCode":"String","Message":"String","StackTrace":"String","Errors":[{"ErrorCode":"String","FieldName":"String","Message":"String"}]},"entityID":0,"InternalErrorCode":"String"}