UpdateCompany updates or creates a Company in Storm for the specified customer. Validation is done before trying to update or create the Company and the below Exceptions might be raised if any important information is missing. Any existing Company will be updated as well. Supply all root data (Code, Name, OrgNo, Phone, ReferUrl, Email, VatNo) about the Company - empty or missing input fields will be emptied. Note though that any missing lists or objects (Addresses, Flags, Info, DeliveryMethodIds, PaymentMethodIds) fields that are not passed in will not be removed but just not updated. PriceLists are not affected here at all.
The Company to update. If a supplied Company does not have an Id specified it is considered new and will be created as well. Otherwise it will be updated.
Success
Bad Request
Key: CompanyAlreadyExists. Gets raised when there already exists a company with the specified organizational number/name combination.
Key: CustomerMissing. Gets raised if the Customer is missing.
Key: InvalidCompanyName. Gets raised if the Company.Name is missing.
Key: DeliveryAddressZipMissing. Gets raised if any DeliveryAddress is supplied and it is missing a Zip code.
Key: DeliveryAddressCityMissing. Gets raised if any DeliveryAddress is supplied and it is missing a City.
Key: DeliveryAddressCountryMissing. Gets raised if any DeliveryAddress is supplied and it is missing a Country.
Key: InvoiceAddressZipMissing. Gets raised if any DeliveryAddress is supplied and it is missing a Zip code.
Key: InvoiceAddressCityMissing. Gets raised if any DeliveryAddress is supplied and it is missing a City.
Key: InvoiceAddressCountryMissing. Gets raised if any DeliveryAddress is supplied and it is missing a Country.
Internal Server Error
{- "Id": 0,
- "Key": "string",
- "Code": "string",
- "Name": "string",
- "OrgNo": "string",
- "Phone": "string",
- "ReferId": 0,
- "ReferUrl": "string",
- "DeliveryAddresses": [
- {
- "Id": 0,
- "CareOf": "string",
- "Line1": "string",
- "Line2": "string",
- "Zip": "string",
- "City": "string",
- "CountryId": 0,
- "Country": "string",
- "Region": "string",
- "IsValidated": true,
- "GlobalLocationNo": "string",
- "ShippingPhoneNumber": "string"
}
], - "InvoiceAddress": {
- "Id": 0,
- "CareOf": "string",
- "Line1": "string",
- "Line2": "string",
- "Zip": "string",
- "City": "string",
- "CountryId": 0,
- "Country": "string",
- "Region": "string",
- "IsValidated": true,
- "GlobalLocationNo": "string",
- "ShippingPhoneNumber": "string"
}, - "UseInvoiceAddressAsDeliveryAddress": true,
- "Info": [
- {
- "Id": 0,
- "Value": "string",
- "Code": "string"
}
], - "PricelistIds": [
- 0
], - "ParentId": 0,
- "DeliveryMethodIds": [
- 0
], - "PaymentMethodIds": [
- 0
], - "Email": "string",
- "Flags": [
- {
- "Id": 0,
- "Name": "string",
- "Group": 0,
- "IsSelected": true
}
], - "VatNo": "string"
}
{- "Id": 0,
- "Key": "string",
- "Code": "string",
- "Email": "string",
- "SSN": "string",
- "FirstName": "string",
- "LastName": "string",
- "Phone": "string",
- "CellPhone": "string",
- "ReferId": 0,
- "ReferUrl": "string",
- "Account": {
- "Id": 0,
- "Key": "string",
- "LoginName": "string",
- "Name": "string",
- "Roles": [
- 0
], - "Authorizations": [
- {
- "Id": 0,
- "Value": "string",
- "Code": "string"
}
], - "IsActive": true
}, - "Companies": [
- {
- "Id": 0,
- "Key": "string",
- "Code": "string",
- "Name": "string",
- "OrgNo": "string",
- "Phone": "string",
- "ReferId": 0,
- "ReferUrl": "string",
- "DeliveryAddresses": [
- {
- "Id": 0,
- "CareOf": "string",
- "Line1": "string",
- "Line2": "string",
- "Zip": "string",
- "City": "string",
- "CountryId": 0,
- "Country": "string",
- "Region": "string",
- "IsValidated": true,
- "GlobalLocationNo": "string",
- "ShippingPhoneNumber": "string"
}
], - "InvoiceAddress": {
- "Id": 0,
- "CareOf": "string",
- "Line1": "string",
- "Line2": "string",
- "Zip": "string",
- "City": "string",
- "CountryId": 0,
- "Country": "string",
- "Region": "string",
- "IsValidated": true,
- "GlobalLocationNo": "string",
- "ShippingPhoneNumber": "string"
}, - "UseInvoiceAddressAsDeliveryAddress": true,
- "Info": [
- {
- "Id": 0,
- "Value": "string",
- "Code": "string"
}
], - "PricelistIds": [
- 0
], - "ParentId": 0,
- "DeliveryMethodIds": [
- 0
], - "PaymentMethodIds": [
- 0
], - "Email": "string",
- "Flags": [
- {
- "Id": 0,
- "Name": "string",
- "Group": 0,
- "IsSelected": true
}
], - "VatNo": "string"
}
], - "DeliveryAddresses": [
- {
- "Id": 0,
- "CareOf": "string",
- "Line1": "string",
- "Line2": "string",
- "Zip": "string",
- "City": "string",
- "CountryId": 0,
- "Country": "string",
- "Region": "string",
- "IsValidated": true,
- "GlobalLocationNo": "string",
- "ShippingPhoneNumber": "string"
}
], - "InvoiceAddress": {
- "Id": 0,
- "CareOf": "string",
- "Line1": "string",
- "Line2": "string",
- "Zip": "string",
- "City": "string",
- "CountryId": 0,
- "Country": "string",
- "Region": "string",
- "IsValidated": true,
- "GlobalLocationNo": "string",
- "ShippingPhoneNumber": "string"
}, - "Flags": [
- {
- "Id": 0,
- "Name": "string",
- "Group": 0,
- "IsSelected": true
}
], - "UseInvoiceAddressAsDeliveryAddress": true,
- "Info": [
- {
- "Id": 0,
- "Value": "string",
- "Code": "string"
}
], - "PricelistIds": [
- 0
], - "CrmId": "string",
- "IsActive": true,
- "Created": "2019-08-24T14:15:22Z",
- "Updated": "2019-08-24T14:15:22Z"
}