HTTP API (Product Catalog)

Reasons to use HTTP API import

  1. Too many products in the database (over 200,000).
  2. New arrivals often come in small quantities, making it unreasonable to create a new XML with hundreds of thousands of products for the sake of a few new ones.
  3. Product changes must be applied more quickly than the time it takes to generate the XML and have it processed by the system.



Case Sensitivity

All parameter names are case-sensitive and should follow the spelling used in this documentation.



Import/Update Categories

This part describes how to import product categories into PersonaClick using HTTP API import.


Request

EndpointRequest TypeActionContent TypeRate LimitMax Data Size
https://api.personaclick.com/import/categoriesPOSTOverwriteapplication/json40 requests/minute32 MB/request
PUTUpdate


API Response 

HTTP status code

Description
204 No content

Authentication was successful. The data was accepted and queued for processing in the background.

If the data processing fails, the account owner and employees authorized to receive technical notifications will be sent an email describing the error.

400 Bad requestAuthorization failed.


Request Data Syntax

NameTypeRequirementDescription
shop_idstringrequiredUnique Store Key in PersonaClick. Located there: Account > Settings > Store Settings
shop_secretstringrequiredThe store's Secret Key in PersonaClick. Located there: Account > Settings > Store Settings
categoriesarrayrequiredArray with category property objects. See description below.

{
    shop_id: "...",
    shop_secret: "...",
    categories: [object, object, ...]
} 

Category Object

NameTypeRequirementDescription
idstringrequiredCategory ID
namestringrequiredCategory Name
parentstringrequired for subcategoriesParent category ID. This property must have NULL value for categories that have no parent category.
urlstringoptionallyCategory URL
aliasstringoptionallyCategory Page URL


Example of Categories Request

{
    "shop_id":     "eehj3eu84299kg5ghw5a6743r8",	
    "shop_secret": "pmd5362597thrgq8k256ep01t0",	
    "categories": [
        {
            "id":      1,
            "name":    "Main category",
            "parent":  null,
            "url":     "https://mysite.com/catalog",
            "alias":   "main"
        },
        {
            "id":      2,
            "name":    "Apparel",
            "parent":  1,
            "url":     "https://mysite.com/catalog/apparel",
            "alias":   "apparel"
        },
        {
            "id":      3,
            "name":    "Hoverboards",
            "parent":  1,
            "url":     "https://mysite.com/catalog/hoverboards",
            "alias":   "hoverboards"
        },
        {
            "id":      14,
            "name":    "Child Hoverboards",
            "parent":  3,
            "url":     "https://mysite.com/categories/hoverboards/child",
            "alias":   "hoverboards/child"
        }
	]
} 


Import Locations

This part describes how to import store locations into PersonaClick using HTTP API import.


Request

EndpointRequest TypeContent TypeRate LimitMax Data Size
https://api.personaclick.com/import/locationsPOSTapplication/json40 requests/minute32 MB/request


API Response 

HTTP status code

Description
204 No content

Authentication was successful. The data was accepted and queued for processing in the background.

If the data processing fails, the account owner and employees authorized to receive technical notifications will be sent an email describing the error.

400 Bad requestAuthorization failed.


Request Data Syntax

NameTypeRequirementDescription
shop_idstringrequiredUnique Store Key in PersonaClick. Located there: Account > Settings > Store Settings
shop_secretstringrequiredThe store's Secret Key in PersonaClick. Located there: Account > Settings > Store Settings
locationsarrayrequiredArray with location objects. See description below.

{
    shop_id: "...",
    shop_secret: "...",
    locations: [object, object, ...]
} 

Location Object

NameTypeRequirementDescription
idstringrequiredLocation ID
namestringrequiredLocation Name
parentstringrequired for sublocationsParent location ID. This property must have NULL value for categories that have no parent category.
groupstringoptionallyGrouping of locations by any custom property. For example: "cash only", "wholesale", etc.


Example of Locations Request

{
    shop_id:      "eehj3eu84299kg5ghw5a6743r8",  
    shop_secret:  "pmd5362597thrgq8k256ep01t0",
    locations:    [
        {
            id:           1,
            name:         "New York",
            parent:       null,
            group:        "city"
        },
        {
            id:           2,
            name:         "Los Angeles",
            parent:       null,
            group:        "city"
        },
        {
            id:           3,
            name:         "Brighton Beach",
            parent:       1
        },
        {
            id:           4,
            name:         "Beverly Hills",
            parent:       2
        }
    ]
} 


Import/Update Products

This part describes how to import products into PersonaClick using HTTP API import.


Requests

EndpointRequest TypesContent TypeRate LimitMax Data Size
https://api.personaclick.com/import/productsPUTapplication/json40 requests/minute32 MB/request

OperationRequest TypeDescription
AddPUTAdds a new or updates existing products

In the situation lacking a technical feasibility to send PUT request, use POST requests and add to the JSON-body a variable method with the corresponding value in the upper case: PUT.



API Response 

HTTP status code

Description
204 No content

Authentication was successful. The data was accepted and queued for processing in the background.

If the data processing fails, the account owner and employees authorized to receive technical notifications will be sent an email describing the error.

400 Bad requestAuthorization failed.
423 Locked

This response code is possible if one of the previous requests was a PATCH request (see its description), which hasn't finished its work yet. Should keep this in mind in development and repeat sending the current request until it succeeds.



Request Data Syntax

NameTypeRequirementDescription
shop_idstringrequiredUnique Store Key in PersonaClick. Located there: Account > Settings > Store Settings
shop_secretstringrequiredThe store's Secret Key in PersonaClick. Located there: Account > Settings > Store Settings
itemsarrayrequiredArray with product property objects. See description below.

Product Object

NameTypeRequirementDescription
idstringrequiredProduct ID. Max 64 symbols.
group_idstringoptionally

Used to combine several variants of the same product into a group. The system will automatically use the most relevant product variant in the tools. 

If the product variants don't have this property, the system will consider each product variant as a separate product.

availablebooleanrequiredProduct Availability
namestringrequiredProduct Name. Max 255 symbols.
pricenumberrequiredProduct Price
urlstringrequiredProduct Page URL
deeplink_androidstringoptionallyDeep link to a product for an Android app.
deeplink_iosstringoptionallyDeep link to a product for an iOS app.
picturestringrequiredProduct Picture URL
categoriesarrayrequiredProduct Categories. See description below.
currencystringrequiredCurrency code: USD, EUR, TRY, etc.
oldpricenumberoptionallyProduct Old Price
discount_percentnumberoptionally

User-defined discount value.

Usually, the "price" and "old_price" values are used to calculate the discount value. The "discount_percent" property allows to set the discount value in advance.

installmentnumberoptionallyThe payment cost if purchasing the product in installments.
promocodestringoptionallyThe promo code is for a specific product.
price_with_promocodenumberoptionallyThe product price when using the promo code specified for the product.
locationsarrayoptionally

Product Locations. See description below.

If the property isn't used, the product is considered available in all known locations.

type_prefixstringoptionallyType/category of product (for example: "mobile phone", "washing machine", "corner sofa")
modelstringoptionallyModel and product name
brandstringoptionallyProduct Brand
barcodestringoptionallyProduct Barcode
vendor_codestringoptionallyManufacturer product code
price_marginnumberoptionally

Product Margin

It only can be a value from 0 to 100 (in percent). Using values greater than 100 leads to unpredictable results of calculation formulas.

tagsarrayoptionallyProduct-Related Tags
is_childbooleanoptionallyThe product is for children or not
is_fashionbooleanoptionallyThe product is clothing or not
fashionobjectoptionallyAdditional properties for a product from the clothing and accessories niche. See the description below.
cosmeticobjectoptionallyAdditional properties for a product from the cosmetic niche. See the description below.
childobjectoptionallyAdditional properties for a product from the niche of children's products. See the description below.
bookobjectoptionallyAdditional properties for a product from the book niche. See the description below.
jewelryobjectoptionallyAdditional properties for a product from the jewelry niche. See the description below.
is_newbooleanoptionallyThe product is from a new arrival.
seasonalityarrayoptionallyProduct seasonality. The sequence number of the month (from 1 to 12) is used as the value.
accessoriesarrayoptionallyAllows setting manually recommended products for a specific product. Need to set in the array the product IDs.
customer_recommendationsarrayoptionally

This has a similar meaning to the "accessories" property. Support for this property will be discontinued on 2024-01-01.

stock_quantitynumberoptionallyThe available quantity of products. Integer value from 1 and more.
leftoversstringoptionallyRough number of the products left in stock. Available values are:
  • one - one product
  • few - 2-10 products
  • lot - over 10 products
ratingnumberoptionallyProduct rating. Integer value from 1 to 5.
giftbooleanoptionallySpecifies whether the product is a gift.
descriptionstringoptionally

Product description

Please contact your account manager to activate this property.

datestringoptionally

Any date in YYYY-MM-DD format

This is typically used to specify the creation date for sorting products by newness.

paramsObject arrayoptionallyAdditional parameters. See the description below.

Fashion Object

NameTypeRequirementDescription
genderstringoptionallyProduct relating to a specific gender. See the available values in the "Apparel & Accessories" section of the XML product feed.
typestringoptionallyProduct relating to a specific type. See the available values in the "Apparel & Accessories" section of the XML product feed.
sizesarrayrequired if the "type" property is setAn array of available sizes. See the size value format in the "Apparel & Accessories" section of the XML product feed.
colorsarrayoptionallyObject array with available product colors and product image URLs to the corresponding color. See example below.
featurestringoptionallyThe product has some features. Available values: adult (default), child, pregnant.

{
    gender: "m",
	sizes:  ["XS", "S", "L"], // "M" and "XL" sizes aren't available
    type:   "shoe",
	colors: [
        {
            color: "blue",
            picture: "https://examplestore.com/product/100500/images/blue.jpg"
        }, 
        {
            color: "yellow",
            picture: "https://examplestore.com/product/100500/images/yellow.jpg"
        }
    ],
    feature: "child"
} 

Cosmetic Object

NameTypeRequirementDescription
genderstringoptionallyProduct relating to a specific gender. See the available values in the "Cosmetics & Perfumes" section of the XML product feed.
hypoallergenicbooleanoptionallyThe product is hypoallergenic or not. Default value: false.
skinobjectoptionallyAllows marking a product that relates to a specific skin type. Values for available properties: type, condition, part are available in the "Cosmetics & Perfumes" section of the XML product feed.
hairobjectoptionallyAllows marking a product that relates to a specific hair type. Values for available properties: type, condition are available in the "Cosmetics & Perfumes" section of the XML product feed.
nailobjectoptionallyAllows marking a product that relates to a specific nail type. Values for available properties: type, polish_color are available in the "Cosmetics & Perfumes" section of the XML product feed.
perfumeobjectoptionallyAllows filling the product with the properties of the perfume niche. Values for available properties: family, aroma are available in the "Cosmetics & Perfumes" section of the XML product feed.
periodicbooleanoptionallyThe product is professional or not. Default value: false.
professionalbooleanoptionallyThe product is professional or not. Default value: false.

Child Object

NameTypeRequirementDescription
genderstringoptionallyProduct relating to a specific gender. See the available values in the "Baby & Children" section of the XML product feed.
typestringoptionallyProduct relating to a specific type. See the available values in the "Baby & Children" section of the XML product feed.
ageobjectoptionallyProduct relating to a specific age. See the available values in the "Baby & Children" section of the XML product feed.

Book Object

NameTypeRequirementDescription
authorstringoptionallyAllows specifying the author of a work, book, etc.
publisherstringoptionallyAllows specifying the publisher of a work, book, etc.
seriesstringoptionallyAllows specifying a series of works.
yearnumberoptionallyAllows specifying the year of publishing.
isbnarrayoptionallyAllows listing the ISBNs. The values in the array must be of string type.

Jewelry Object

NameTypeRequirementDescription
genderstringoptionallyProduct relating to a specific gender. See the available values in the "Jewelry" section of the XML product feed.
ring_sizesarrayoptionallyThe product has specific ring sizes. See the example below.
bracelet_sizesarrayoptionallyThe product has specific bracelet sizes. See the example below.
chain_sizesarrayoptionallyThe product has specific chain sizes. See the example below.
colorstringoptionallyThe product has a specific color. See the available values in the "Jewelry" section of the XML product feed.
metalstringoptionallyThe product made of a specific metal. See the available values in the "Jewelry" section of the XML product feed.
gemstringoptionallyThe product with a specific gemstone. See the available values in the "Jewelry" section of the XML product feed.

Locations Array

The "locations" array specifies the product availability status for various cities/towns as well as any alterations in price in these cities/towns. Your default price is used if the price alterations have not been stated in this object. 


NameTypeRequirementDescription
locationstringrequiredLocation ID
pricenumberoptionallyPrice for location
oldpricenumberoptionallyOld price for location

Params Object

NameTypeRequirementDescription
namestringrequiredParameter name
valueString arrayrequired

An array of parameter string values.

The maximum size of the string is 1000 symbols.

unitstringrequired for numeric valuesThe measurement unit
params: [
    {
        name: "interface",
        value: ["bluetooth", "wi-fi"]
    },
    {
        name: "connection",
        value: ["10", "100", "1000"],
        unit: "MB"
    }
] 



Example of Products Request

{
    shop_id: "eehj3eu84299kg5ghw5a6743r8",   
    shop_secret: "pmd5362597thrgq8k256ep01t0",   
    items: [
        {
            id: "6335",
            group_id: "3955",
            name: "Hoverboard 100500",
            price: 1000,
            old_price: 1200,
            discount_percent: 16,
            installment: 85,
            promocode: "BACKTOTHEFUTURE",
            price_with_promocode: 950,
            currency: "USD",
            url: "https://examplestore.com/products/6335.html",
            deeplink_android: "app_android://395532",
            deeplink_ios: "app_ios://395532",
            picture: "https://examplestore.com/pictures/6335.jpg",
            available: true, 
            categories: [
                14,
                3
            ],
            barcode: "0123456789",
            vendor_code: "HB100500",
            price_margin: 10,
            stock_quantity: 3,
            locations: [
                {
                    location: "New York"
                },
                {
                    location: "Los Angeles",
                    price: 1250,
                    oldprice: 1500
                }
            ],
            brand: "Dr. Emmett Brown",
            tags: [
                "titanium",
                "steel",
                "sport"
            ],
            is_child: true,
            accessories: [146, 100500],
            seasonality: [1, 2, 12],
            rating: 4,
            leftovers: "few",
            date: "2023-04-13"
        },
        {
            id: "133",
            group_id: "3955",
            name: "red jacket",
            price: 200,  
            currency: "USD",
            url: "https://examplestore.com/products/133.html",
            picture: "https://examplestore.com/pictures/133.jpg",
            available: true, 
            categories: [
                33
            ],
            locations: [
                {
                    "location": "New York"
                }
            ],
            brand: "McFly",
            tags: [
                "winter",
                "sport"
            ],
            is_fashion: true,
            fashion: {
                gender: "m",
                sizes: [
                    "M",
                    "L",
                    "XXL"
                ],
                type: "jacket"
            },
            params: [
                {
                    name: "drying",
                    value: [
                        30,
                        40,
                        60
                    ],
                    unit: "°C"
                }
            ]
        },
        {
            id: 146,
            name: "Diamond Ring",
            price: 1999.99,  
            currency: "USD",
            url: "https://examplestore.com/products/146.html",
            picture: "https://examplestore.com/pictures/146.jpg",
            available: true, 
            gift: true,
            categories: [
                55
            ],
            jewelry: {
                gender: "f",
                ring_sizes: [16, 16.5, 17],
                color: "yellow",
                metal: "gold",
                gem: "diamond"
            }
        }
    ]
}


Synchronization of Products Availability

Allows synchronizing the availability status of products. All products sent in the request will be marked as in stock, the rest as out of stock.


Requests

EndpointRequest TypeContent TypeRate LimitMax Data Size
https://api.personaclick.com/import/productsPATCHapplication/json40 requests/minute32 MB/request

OperationRequest TypeDescription
SyncPATCHSync product availability status

In the situation lacking a technical feasibility to send PATCH request, use POST requests and add to the JSON-body a variable method with the corresponding value in the upper case: PATCH.



Request Data Syntax

NameTypeRequirementDescription
shop_idstringrequiredUnique Store Key in PersonaClick. Located there: Account > Settings > Store Settings
shop_secretstringrequiredThe store's Secret Key in PersonaClick. Located there: Account > Settings > Store Settings
itemsarrayrequired

An array with product IDs that should be marked as in stock. The other products (that aren't in the request) will be marked as out of stock.

Can be an empty array to disable all products.

If you are going to use a combination of "empty PATCH request + PUT requests" to periodically re-import the entire product database, please contact your account manager to activate this feature.


{
    shop_id:        "eehj3eu84299kg5ghw5a6743r8",	
    shop_secret:    "pmd5362597thrgq8k256ep01t0",	
    items:          [635, 3373, 75778]
}
# to disable all products
{
    shop_id:        "eehj3eu84299kg5ghw5a6743r8",	
    shop_secret:    "pmd5362597thrgq8k256ep01t0",	
    items:          []
}


API Response 

HTTP status code

Description
204 No content

Authentication was successful. The data was accepted and queued for processing in the background.

If the data processing fails, the account owner and employees authorized to receive technical notifications will be sent an email describing the error.

400 Bad requestAuthorization failed.
423 Locked

This response code is possible if one of the previous requests was a PATCH request (see its description), which hasn't finished its work yet. Should keep this in mind in development and repeat sending the current request until it succeeds.



Deleting Products

Allows marking products in the request as out of stock. The statuses of the other products will remain unchanged.


Requests

EndpointRequest TypeContent TypeRate LimitMax Data Size
https://api.personaclick.com/import/productsDELETEapplication/json40 requests/minute32 MB/request

OperationRequest TypeDescription
RemoveDELETERemove selected items from the database (mark the selected items as "out of stock")

In the situation lacking a technical feasibility to send DELETE request, use POST requests and add to the JSON-body a variable method with the corresponding value in the upper case: DELETE.



Request Data Syntax

NameTypeRequirementDescription
shop_idstringrequiredUnique Store Key in PersonaClick. Located there: Account > Settings > Store Settings
shop_secretstringrequiredThe store's Secret Key in PersonaClick. Located there: Account > Settings > Store Settings
itemsarrayrequiredArray with product IDs that should be marked as out of stock.

{
    shop_id:        "eehj3eu84299kg5ghw5a6743r8",	
    shop_secret:    "pmd5362597thrgq8k256ep01t0",	
    items:          [635, 3373, 75778]
}


API Response 

HTTP status code

Description
204 No content

Authentication was successful. The data was accepted and queued for processing in the background.

If the data processing fails, the account owner and employees authorized to receive technical notifications will be sent an email describing the error.

400 Bad requestAuthorization failed.
423 Locked

This response code is possible if one of the previous requests was a PATCH request (see its description), which hasn't finished its work yet. Should keep this in mind in development and repeat sending the current request until it succeeds.



Product Catalog Synchronization

The best practice of periodically synchronizing the product catalog.

ActionPeriodRequests
The first import of the product catalogOnce

Importing categories (POST request)

Importing locations (POST request)

Importing products (PUT request)

Synchronization of the product catalogOnce a day

Importing categories (PUT request)

Importing locations (POST request)

Synchronize product availability (PATCH request)

Importing products (PUT request)

Synchronize products availabilityEvery an hourSynchronize product availability (PATCH request)
Updating modified products, adding new ones, and deleting not-existed onesEvery 15 minutes

Importing products (PUT request)

Deleting products (DELETE request)

Re-import the entire product base

Please contact your account manager to activate this feature.

When it's necessary, for example, once a month

Importing categories (POST request)

Disabling all products (empty PATCH request)

Importing products (PUT request)




Multiple Requests

The system makes multiple simultaneous requests to download product images. Check the IP list and make sure they are all whitelisted on your side.

Copyright 2018-2024 PersonaClick