API: createOrganization
  • 2 Minutes to read
  • Dark
    Light

API: createOrganization

  • Dark
    Light

Article summary

  • Starting June 1, 2022, SmarterU will require all API calls to POST to HTTPS. Any POST to HTTP will result in the SU:01 error (i.e., No POST data detected.).
  • If you are viewing the help in a language other than English, please change your language to English before copying and pasting any code. All API attributes and functions are in English.
  • Tags are required unless specified.

Description

The createOrganization method adds an organization .

Who Has Access

The following users have access to the createOrganization method:

API Call XML Package

<SmarterU>
   <AccountAPI>![CDATA[]]</AccountAPI>
   <UserAPI>![CDATA[]]</</UserAPI>
   <Method>getUserGroups</Method>
   <Parameters>

      <Organization>
         <Name><![CDATA[]]></Name>
         <Email><![CDATA[]]></Email>
         <CompanyID><![CDATA[]]></CompanyID>
         <Status><![CDATA[]]></Status>
         <PhonePrimary><![CDATA[]]></PhonePrimary>
         <PhoneAlternate><![CDATA[]]></PhoneAlternate>
         <Fax><![CDATA[]]></Fax>
         <Website><![CDATA[]]></Website>
         <Address1><![CDATA[]]></Address1>
         <Address2><![CDATA[]]></Address2>
         <City><![CDATA[]]></City>
         <PostalCode><![CDATA[]]></PostalCode>
         <Province><![CDATA[]]></Province>
         <Country><![CDATA[]]></Country>

         <CustomFields>
            <CustomField>
               <CustomFieldName><![CDATA[]]></CustomFieldName>
               <CustomFieldValue><![CDATA[]]></CustomFieldValue>
            </CustomField>
         </CustomFields>

       </Organization>

   </Parameters>
</SmarterU>

Organization Tag Group

The Organization tag group is a container for the organization's details.

<Organization>
   <Name><![CDATA[]]></Name>
   <Email><![CDATA[]]></Email>
   <CompanyID><![CDATA[]]></CompanyID>
   <Status><![CDATA[]]></Status>
   <PhonePrimary><![CDATA[]]></PhonePrimary>
   <PhoneAlternate><![CDATA[]]></PhoneAlternate>
   <Fax><![CDATA[]]></Fax>
   <Website><![CDATA[]]></Website>
   <Address1><![CDATA[]]></Address1>
   <Address2><![CDATA[]]></Address2>
   <City><![CDATA[]]></City>
   <PostalCode><![CDATA[]]></PostalCode>
   <Province><![CDATA[]]></Province>
   <Country><![CDATA[]]></Country>

   <CustomFields>
      <CustomField>
         <CustomFieldName><![CDATA[]]></CustomFieldName>
         <CustomFieldValue><![CDATA[]]></CustomFieldValue>
      </CustomField>
   </CustomFields>
</Organization>

The Organization tag may contain the following.

Name

The organization's name.

Email (optional)

The organization's email address.

CompanyID (optional)

The organization's user-specified identifier.

Status (optional)

The organization's status. Acceptable values are Active or Inactive.

PhonePrimary (optional)

The organization's primary phone number.

PhoneAlternate (optional)

The organization's alternate phone number.

Fax (optional)

The organization's fax number.

Website (optional)

The URL of the organization's website.

Address1 (optional)

The first line of the organization's physical address.

Address2 (optional)

The second line of the organization's physical address.

City (optional)

The city where the organization is located.

PostalCode (optional)

The postal code where the organization is located.

Province (optional)

The province where the organization is located.

Country (optional)

The country where the organization is located.

CustomFields (optional)

A container for assigning values to custom organization fields. Refer to CustomFields Tag Group.

CustomFields Tag

The CustomFields tag group is a container for assigning values to custom organization fields. 

<CustomFields>
   <CustomField>
      <CustomFieldName><![CDATA[]]></CustomFieldName>
      <CustomFieldValue><![CDATA[]]></CustomFieldValue>
   </CustomField>
</CustomFields>

Each custom organization field is contained in a CustomField tag and contains the following.

CustomFieldName

The custom organization field's name. This is the Name returned by the listCustomFields method.

CustomFieldValue

The value you want to assign the custom organization field specified in the CustomFieldName tag.

API Response XML Package

The API response XML package will always include a Result, Info, and Errors tag.

<SmarterU>
   <Result></Result>
   <Info>
      <Organization><![CDATA[]]></Organization>
   </Info>
   <Errors>
      <Error>
         <ErrorID></ErrorID>
         <ErrorMessage></ErrorMessage>
      </Error>
   </Errors>
</SmarterU>

The response may also contain the following.

Organization

The organization's name.

Example API Response XML Package

Below is an example of an API response XML package.

<SmarterU>
   <Result>Success</Results>
   <Info>
       <Organization><![CDATA[Top Toe Distributors]]></Organization>
   </Info>

   <Errors>
   </Errors>
</SmarterU>

Error Codes

Error CodeMessage
CO:01
The name provided is not valid.
CO:02
The email address provided is not valid.
CO:03
The company id provided is not valid.
CO:04
The status provided is not valid.
CO:05
The primary phone number provided is not valid.
CO:06
The alternate phone number provided is not valid.
CO:07
The fax provided is not valid.
CO:08
The website provided is not valid.
CO:09
The address 1 provided is not valid.
CO:10
The address 2 provided is not valid.
CO:11
The city provided is not valid.
CO:12
The postal code provided is not valid.
CO:13
The province provided is not valid.
CO:14
The country provided is not valid.
CO:15
A custom field name provided is not valid.
CO:16
A custom field value provided is not valid.
CO:17
The required permissions are not met to call the createOrganization method.
CO:19
Organization name cannot be used.

Was this article helpful?