Below is the info about the "CATEGORY ADD ENDPOINT" for the CoreCommerce API.


The Request:


<Request version="1.0">

<Authentication>

<Username><![CDATA[admin]]></Username>

<Password><![CDATA[password!]]></Password>

<StoreName><![CDATA[mystore]]></StoreName>

<XMLKey><![CDATA[123]]></XMLKey>

</Authentication>

<Action>ACTION_TYPE_CATEGORY_ADD</Action>

<List length="1">

<Category>

<Languages length="2">

<LanguageData charset="ISO-8859-1" id="1">

<Name><![CDATA[Samsung Galaxy]]></Name>

<Teaser><![CDATA[Teaser]]></Teaser>

<Description><![CDATA[Description]]></Description>                  

<MetaTitle><![CDATA[Meta Title]]></MetaTitle>

<MetaDescription><![CDATA[Meta Description]]></MetaDescription>

<MetaKeywords><![CDATA[Meta Keywords]]></MetaKeywords>

<Slug><![CDATA[custom_slug_greek]]></Slug>

<BottomText><![CDATA[custom_slug]]></BottomText>

</LanguageData>

<LanguageData charset="UTF-8" id="2">

<Name><![CDATA[Samsung Galaxy]]></Name>

<Teaser><![CDATA[Teaser]]></Teaser>

<Description><![CDATA[Description]]></Description>                  

<MetaTitle><![CDATA[Meta Title]]></MetaTitle>

<MetaDescription><![CDATA[Meta Description]]></MetaDescription>

<MetaKeywords><![CDATA[Meta Keywords]]></MetaKeywords>

<Slug><![CDATA[custom_slug_greek]]></Slug>

<BottomText><![CDATA[custom_slug]]></BottomText>

</LanguageData>

</Languages>

<ParentCategory><![CDATA[Parent Category]></ParentCategory>

<Sort>6</Sort>

<Hide><![CDATA[FALSE_VALUE]]></Hide>

<ViewType><![CDATA[grid]]></ViewType>

<GridColumns>3</GridColumns>

<CanonicalUrl><![CDATA[http://www.mysite.com/Apple-iPhone-3G.html]]></CanonicalUrl>

<PasswordProtected><![CDATA[FALSE_VALUE]]></PasswordProtected>

<SiteWideDiscount>10</SiteWideDiscount>

<SlugStyle><![CDATA[custom]]></SlugStyle>

<PhotoGroups length="1">

<PhotoGroup>

<Photos length="1">

<Photo>

<Flag>THUMBNAIL_PHOTO_FLAG</Flag>

<LocalFile>

<Name><![CDATA[mytest.jpg]]></Name>

<Extension><![CDATA[jpg]]></Extension>

<Data>lksjfsa;lfjsals;fjskafjsa;fjasdkfasjdfadfa</Data>

</LocalFile>

<URL><![CDATA[http://drop.ndtv.com/TECH/product_database/images/3292016114244AM_635_samsung_galaxy_j7_2016.jpeg]]></URL>

<CopyPhoto><![CDATA[TRUE_VALUE]]></CopyPhoto>

<Width><![CDATA[100]]></Width>

<Height><![CDATA[200]]></Height>

<Languages length="2">

<LanguageData charset="ISO-8859-1" id="1">

<Caption><![CDATA[Caption 1]]></Caption>

<AltTitleTag><![CDATA[Alt/Title Tag 1]]></AltTitleTag>

</LanguageData>

<LanguageData charset="UTF-8" id="2">

<Caption><![CDATA[Caption 1 (greek)]]></Caption>

<AltTitleTag><![CDATA[Alt/Title Tag 1 (greek)]]></AltTitleTag>

</LanguageData>

</Languages>

</Photo>      

</Photos>

</PhotoGroup>

</PhotoGroups>

</Category>

</List>

</Request>


Below is a chart of the definitions of what is in the above request, and what each search term means:


Authentication


NameRequiredExample ValueComments
UsernameY"admin" or "mystorename"You create this value inside your admin under Settings->Store API. The value you set there inside your CoreCommerce Admin Panel is the value you use here.
PasswordYAn alphanumeric string that is hard to guess (i.e. "MyPassWord1!")You create this value inside your admin under Settings->Store API. The value you set there inside your CoreCommerce Admin Panel is the value you use here.
XML KeyYA long string to further add to the security of your API connection (i.e. "FY3D57THY32HTC3748TRC38H74TR")You create this value inside your admin under Settings->Store API. The value you set there inside your CoreCommerce Admin Panel is the value you use here.
ActionYACTION_TYPE_CATEGORY_ADD
 This is telling the API which endpoint you want to work with. In this case it is ACTION_TYPE_CATEGORY_ADD.
List
Y"Length = 1" or "Length = 10"Opens the Request by telling the API how many Categories you have included in the request. If you are adding one category, "length" would be set to 1 as you see in the above example. If you are adding multiple categories, this should tell the API how many you are adding.
ParentCategory
"Clothes"This is the name of the "parent category" if there IS one. If this category you are adding is meant to be a subcategory of another category, specify the Parent Category Name here. **Important: The Parent Category MUST already exist for this to assign properly. 
Sort
"6" or "1"This is the sort order of the category. If it is a subcategory, it will sort inside its parent category according to this sort number. The lower the number, the higher on the list it sorts (i.e. it sorts low to high). 
Hide
Either Y for Yes or NULL for NoThis will tell the system whether this category is hidden from customers on the storefront or not. 
ViewType
either "grid" or "list"This tells the system to use either the "Grid" style display for the items WITHIN this category, or the "List" style. List will show 1 item per row and scroll down. "Grid" will show the "GridColumns" node of 2,3,4 or 5 columns based on what you tell it to use.
GridColumns
"2" or "3"If you specify "Grid" as the View Type then specify the number of columns for that grid here.
CanonicalURL
http://www.mysite.com/Apple-iPhone-3G.html
This is the Google "Canonical URL" that you would want to be used if Google determines this category as duplicate content.
PasswordProtected
Either "TRUE" or "FALSE"Tells the system if the category requires a password to view or not.
SiteWideDiscount
"10" If you have Site Wide Discounts enabled in your store, you can add the discount PERCENTAGE here **this assumes a percentage you do not need to % symbol".
SlugStyle
either "custom" or "auto"If you specify a "Slug" for your category (see the next section), then use "custom" here. If you do not, use "auto". 


Fields to Specify for each Category based on each Language

**If you are using English Only, there will only be one set of these fields. If you are using multiple languages, it will require a "set" of the fields below for each 

language.


Name
RequiredExample ValueComments
List
YLength = "1" or Length = "10"
Opens the Request by telling the API how many Categories you have included in the request. If you are adding one category, "length" would be set to 1 as you see in the above example. If you are adding multiple categories, this should tell the API how many you are adding.
Category
YOpening Tag for Each CategoryThis is the opening tag for each category you will be adding. 
Languages
YLength = "1" or Length = "2"
Since CoreCommerce support Multiple Languages, we will need to define how many languages we are using in our store, and then there will be a section to specify language specific data for each language. If you are using English only, typically this will be 'Length = "1"'.
LanguageData
YFor each Language, you would specify the char set (i.e. UTF-8) and the language ID (i.e. "1" above). Each Language has a char set and a lang ID. Typically English will be "ISO-8859-1" with an ID of "1". For any other languages, you should use "UTF-8" and you can grab its ID from your admin panel by going to "Settings > Multiple Languages". When you click to edit a language, look in the address bar to see the ID of that language.
NameY"Hats" or "Shirts"This is the name of the category.
Teaser
"A Category of cool hats"This is the Teaser of the category. It will show up on the category list template when you are viewing a list of categories.
Description
"This category is a great category and contains many great hats for you to purchase."This is the Description of the category. It will display on a product list template, when you are viewing that specific category and what is inside of it, either subcategories or products. It will display below the Category Name and ABOVE any subcategories or products that display.
MetaTitle
"Hats" or "Shirts"This is the SEO Meta Title of the category. When viewing the category specific page, this will appear as the Meta Title of the category.
MetaDescription
"This category is a great category and contains many great hats for you to purchase."
This is the SEO Meta Description of the category. When viewing the category specific page, this will appear as the Meta Description of the category.
MetaKeywords
Hats, Shirts, Clothes, Cotton Hats, Red ShirtsThis is the SEO Meta Title of the category. When viewing the category specific page, this will appear as the Meta Keywords of the category.
Slug
custom-hatsThis is the "page slug" of this category. It will be used as the URL for this category if its specified (i.e. https://mystore.corecommerce.com/custom-hats). If you do not specify a slug, you do not need to include this line in your request. If a slug is not specified, it will be auto assigned based on the Category Name.
BottomText
"These Hats are great for everything from Summer to Winter"This is a field inside each category that will display custom HTML or TEXT at the bottom of the category page, BELOW the subcategories and/or products inside this category. 

    

Fields to Specify for each Category Photo to add the Image


NameRequiredExample ValueComments
PhotoGroups
length = 1If you have a photo to upload for your category, you would start by opening a node here called "PhotoGroups". For each image in the set for this category, you would see the length to be equal to the number of photos to upload.
PhotoGroup

This opens a Node that will begin telling the API the details about each image to add. 
Photos
length = 1This is a node to open the details about a single photo.
FlagYTHUMBNAIL_PHOTO_FLAG
This is the flag to tell the system which type of image we are uploading. The options are:
THUMBNAIL_PHOTO_FLAG

**NEED TO ADD REST OF POSSIBLE FLAGS


LocalFile

If the file you want to use is local, meaning you have added it via FTP inside "_import/_images", then you would use this section for that.
Name
myimage.jpgThe name of the image locally.
Extension
JPGthe extension. This is for security so we can verify the extension is what you say it is. 
Data

You do not need to use this.
URL
http://www.myotherwebsite.com/images/myimage.pngIf you want to use an image that is hosted somewhere else on the web, specify the URL to that image here.
CopyPhoto
TRUE or FALSEIf this is TRUE, we will make a copy of this URL image and use the local copy on your site. If this is FALSE, we will use the URL on the site.

**Note: If you use a URL image and set this to FALSE, then that means if the URL image ever is removed or changed, it will change on your store as well without any notification.
Width
100The width of the image you want to use on the storefront.
Height
200The height of the image you want to use on the storefront.



Fields to Specify for each Category Photo based on each Language

**If you are using English Only, there will only be one set of these fields. If you are using multiple languages, it will require a "set" of the fields below for each 

language.


NameRequiredExample ValueComments
Languages

length = "2"
This is inside the "Photo" node. If you are using English only, you would specify "1" here. Multiple Languages would specify "2" since you would have to add language specific content for each image you upload.
LanguageData


Each Language has a char set and a lang ID. Typically English will be "ISO-8859-1" with an ID of "1". For any other languages, you should use "UTF-8" and you can grab its ID from your admin panel by going to "Settings > Multiple Languages". When you click to edit a language, look in the address bar to see the ID of that language.
Caption

"This is a great photo"
This is the caption for the image.
AltTitleTag

"A hat."
This is the value that will be used for both the "Alt" and the "Title" tag for this image on the storefront.



The Response:


<?xml version="1.0" encoding="UTF-8"?>

<Response>

<Action>ACTION_TYPE_CATEGORY_ADD</Action>

<Status>SUCCESS_CODE</Status>

<Code></Code>

<Messages></Messages>

    <List length="1">

        <Category id="67">

            <Code>100</Code>

            <Message><![CDATA[]]></Message>

        </Category>

    </List>

</Response>


NameComments
ActionThis will tell you the action it just processed.
StatusSUCCESS_CODE means it was successful. Anything other than this means it failed.
Code"200" is a valid response and means it was successful and executed the request you made properly. Anything other than "200" means there was an error.
MessagesThis will be the message from the API telling you what the issue was IF it failed.
ListThis will show you the list of categories it successfully added. You will only see this IF you get a "200" success response code.
Category This will show you the ID of the category it added for your reference.
CodeThe code related to adding or editing that category. "100" means it was successful. 
MessageAny specific message related to adding that category to your store.