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 .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/CompanyUpdate HTTP/1.1 
Host: api.megaventory.com 
Content-Type: text/jsv
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: 0001-01-01,
		CompanyDaylightEndDate: 0001-01-01
	},
	mvRecordAction: Insert,
	associateCompanyWithDefaultDocumentTypes: False,
	documentTypePostfixForDefaultAsssociation: String,
	mvInsertUpdateDeleteSourceApplication: String
}
HTTP/1.1 200 OK
Content-Type: text/jsv
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: 0001-01-01,
		CompanyDaylightEndDate: 0001-01-01
	},
	ResponseStatus: 
	{
		ErrorCode: String,
		Message: String,
		StackTrace: String,
		Errors: 
		[
			{
				ErrorCode: String,
				FieldName: String,
				Message: String
			}
		]
	},
	entityID: 0,
	InternalErrorCode: String
}