Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 6 Next »

Getting New Device ID

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


Request

EndpointRequest Type
https://api.personaclick.com/initGET

Parameters

NameTypeRequirementDescription
shop_idstringrequiredUnique Store Key in PersonaClick. Located there: Account > Settings > Store Settings
didstringrequired if previously receivedUnique Device ID. See the API response below.
seancestringrequired if previously received within the current user sessionUnique ID of the current user session. See the API response below.
refererstringoptionallyRequest source URL
tznumberoptionallyThe time zone of the current user
streamstringoptionallyData stream code. Alphanumeric string (letters, numbers only). Max length: 16. The empty default value will mean "web". Can be "ios", "android" or any other string. Used to distinguish between mobile apps, websites, and other events sources.
testmodebooleanoptionallyAllows adding JS snippets that are in test mode status to the API response. See the API response below.

API Response Code

HTTP status code

Description
200 OK

Authentication was successful.

403 ForbiddenAuthentication failed.

API Response Data

NameTypeDescription
didstring

The unique ID of the current device.

When received, the device ID must be stored on your side or the user's device (in local storage or cookies) and must be used in the future for all requests that require it as a required parameter. Don't request a new Device ID if it has been requested before and is available.

seancestring

Unique ID of the current user session.

When received, the Session ID must be stored on your side or the user's device (in local storage or cookies) and must be used in all queries requiring it as a required parameter. You need to request a new Session ID every time the user starts a new session or if the ID has been lost for some reason.

snippetsObject Array

Array with JavaScript snippets. Located there: Account > Shared content > JS-snippets

Each object in the array contains properties:

  • code - javascript snippet code
  • name - snippet internal name
  • priority - snippet priority (the higher the value, the higher the priority)
auto_css_recommenderbooleanReserved for the JS SDK internal use
cmsstringReserved for the JS SDK internal use
currencystringReserved for the JS SDK internal use
email_collectorbooleanReserved for the JS SDK internal use
has_emailbooleanReserved for the JS SDK internal use
popupObjectReserved for the JS SDK internal use
recommendationsbooleanReserved for the JS SDK internal use
searchObjectReserved for the JS SDK internal use
viocebooleanReserved for the JS SDK internal use
web_push_settingsObjectReserved for the JS SDK internal use

Example Request

curl 'https://api.personaclick.com/init?shop_id=0d42fd8b713d0752776ca589cc0056'


curl 'https://api.personaclick.com/init?did=7rjVGhMykT&shop_id=0d42fd8b713d0752776ca589cc0056&referer=https%3A%2F%2Fmystore.com%2F&seance=R5eQXkrKCf&tz=3&testmode=true'

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: [location, location, ...]
} 

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.


Example of Categories Request

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


Requests for Import and Update

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/productsPOST, PUTapplication/json40 requests/minute32 MB/request

OperationRequest TypeDescription
OverwritePOSTRewrite the database removing all previously imported records and adding new items
AddPUTUpdate the database adding new items (no rewriting)

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.


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.
availablebooleanrequiredProduct Availability
namestringrequiredProduct Name. Max 255 symbols.
pricenumberrequiredProduct Price
urlstringrequiredProduct Page URL
picturestringrequiredProduct Picture URL
categoriesarrayrequiredProduct Categories. See description below.
currencystringrequiredCurrency code: USD, EUR, TRY, etc.
oldpricenumberoptionallyProduct Old Price
locationsarrayoptionallyProduct Locations. See description below.
brandstringoptionallyProduct Brand
barcodestringoptionallyProduct Barcode
price_marginnumberoptionallyProduct Margin
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 description below.
cosmeticobjectoptionallyAdditional properties for a product from the cosmetic niche. See description below.
childobjectoptionallyAdditional properties for a product from the cosmetic niche. See description below.
bookobjectoptionallyAdditional properties for a product from the niche of children's products. See description below.
paramsarrayoptionallyAdditional custom properties. See description below.
is_newbooleanoptionallyThe product is from a new arrival.
customer_recommendationsarrayoptionallyAllows setting manually recommended products for a specific product. Need to set in the array the product IDs.

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.

{
    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"
        }
    ]
} 

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.

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


Example of Products Request

{
    shop_id: "eehj3eu84299kg5ghw5a6743r8",   
    shop_secret: "pmd5362597thrgq8k256ep01t0",   
    items:            [
        {
            id:             "6335",
            name:           "Hoverboard 100500",
            price:          1000,
            currency:       "USD",
            url:            "https://examplestore.com/products/6335.html",
            picture:        "https://examplestore.com/pictures/6335.jpg",
            available:      true, 
            categories:     [14, 3],
            barcode:        0123456789,
            price_margin:   10,
            locations: [
                {
                    location: "New York"
                },
                {
                    location: "Los Angeles",
                    price: 1250,
                    oldprice: 1500
                }
            ],
            brand:          "Dr. Emmett Brown",
            tags:           ["titanium", "steel", "sport"],
            is_child:       true
        },
        {
            id:             133
            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"
            }
        }
    ]
}



Synchronization Request

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
itemsarrayrequiredArray with product IDs that should be marked as in 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.


Deletion Request

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.

  • No labels