Megaventory API v2017a

<back to all web services

CompanyUpdate

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

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/CompanyUpdate HTTP/1.1 
Host: api.megaventory.com 
Content-Type: application/json
Content-Length: length

{"APIKEY":"String","mvCompany":{"CompanyId":0,"CompanyName":"String","CompanyIsDefault":false,"CompanyAddress":{"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"},"CompanyEmail":"String","CompanyPhone":"String","CompanyCurrency":"String","CompanyTaxIdNumber":"String","CompanyComments":"String","CompanyTimeZoneOffsetInMinutes":0,"CompanyDaylightSavingFlag":false,"CompanyDaylightStartDate":"\/Date(-62135596800000-0000)\/","CompanyDaylightEndDate":"\/Date(-62135596800000-0000)\/"},"mvRecordAction":"Insert","associateCompanyWithDefaultDocumentTypes":false,"documentTypePostfixForDefaultAsssociation":"String","mvInsertUpdateDeleteSourceApplication":"String"}
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: length

{"mvCompany":{"CompanyId":0,"CompanyName":"String","CompanyIsDefault":false,"CompanyAddress":{"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"},"CompanyEmail":"String","CompanyPhone":"String","CompanyCurrency":"String","CompanyTaxIdNumber":"String","CompanyComments":"String","CompanyTimeZoneOffsetInMinutes":0,"CompanyDaylightSavingFlag":false,"CompanyDaylightStartDate":"\/Date(-62135596800000-0000)\/","CompanyDaylightEndDate":"\/Date(-62135596800000-0000)\/"},"ResponseStatus":{"ErrorCode":"String","Message":"String","StackTrace":"String","Errors":[{"ErrorCode":"String","FieldName":"String","Message":"String"}]},"entityID":0,"InternalErrorCode":"String"}