Insplay API
Insplay API on turvaline pistikprogramm Sinu e-poe ja Insplay lao ning süsteemide vahel, mis võimaldab personaalset ligipääsu Insplay toodetele, tooteinfole ja protsessidele ning neid võimaluste piires juhtida.
Insplay API loob ligipääsu toodete kataloogile – Tootjatele ja tootemärkidele; toote kategooriatele; toodetele ja teenustele. Samuti toote või teenusega seoses olevatele siltidele; piltidele, infomaterjalidele, kirjeldustele ja sidustoodetele.
Insplay API võimaldab teha filtreeritud päringuid – kasutab API võti turvaliseks ühendamiseks ja personaliseerimiseks; keelevalik ja keelekohane sisu; päringu liimiidid ja piirangud; andmete ja kuupäeva vahemikud, laoseisud jpm.
Insplay API on seotud otse laoga– reaalajas ja unikaalse identifitseerimisnumbriga toodete loetelu ja käsitlus Sinu e-poes.
API Changelog
29.10.2020
- Added code example for image request in php.
18.10.2020
- Added out_of_production to product request.
28.08.2020
- Added product_id, product_image_ids, main_picture_url and additional_picture_urls to product request.
Insplay API kirjeldus
Ligipääs Insplay API'le (edaspidi lihtsalt API) antakse kindlatele isikutele, kelle kasutajainfo seotakse iga päringuga. Päringute arv on piiratud 10'le päringule minutis ja võimalusega eristada need IP aadressid, mis on kõrgema intensiivsusega, kui seatud limiidid. See võimaldab vältida pahatahtlikku kasutust ja tagada kvaliteetse teeninduse kõikidele soovijatele.
API tagastab iga valitud toote kohta jae- ja hulgihinna ning selle laoseisu. Laoseisu vanus on maksimaalselt 20min. Päringutega kaasneb ka keelevalik, kui tootel on vastav info tõlgitud. Praegune API versioon võimaldab infot vahetada nendes kategooriates
brands - esitleb tootjate nimekirja
categories - esitleb toodete kategooriad
products - esitleb tooted
tags - esitleb toodetele lisatud sildid ja nende seosed
product_images - esitleb toodetega seotud pildid ning multimeedia
product_attachments - esitleb toodega seotud dokumendid
product_sale_arguments - esitleb toodetega seotud müügiargumendid
Parim praktika:
pärast esmast toodete andmebaasi importimist soovitame jooksvalt uuendada laoseisu ja hindade infot iga 10 minuti tagant. Ülejäänud tooteinfot soovitame uuendada kord ööpäevas ja võimalusel öösiti.Piltide lingid saab kätte products meetodiga, aga palume pilte üle lingi uuendada mitte rohkem kui kord ööpäevas ning öösiti. Veel parem on kasutada piltide laadimiseks product_images meetodit koos date_since parameetriga, et vältida üleliigset koormust. See võimaldab tuvastada ainult muutunud või uusi pilte.
Oleme jooksvalt API't täiendamas ja Sinu soovid ning tagasiside on meile oluline. Palun anna teada, mida Sul vaja on ja vaatame, mida teha annab. API täiendustest annab ülevaate Changelog.
API ühendamine
API ühendamine Sinu e-poega on lihtne! Sinu arenduspartner ja ka enamuste tänapäevaste süsteemide valmidus võimaldab selle üles seada tundidega.
Võta meiega ühendust ja loome Sulle meie süsteemi konto ning selle külge unikaalse API võtme, mille abil saab arendaja luua spetisiifilised päringud meie andmebaasi.
Edasine API kirjeldus jätkubki juba inglise keeles ja on pigem suunatud Sinu arenduspartnerile.
API päringu näidis Pythonis
API päringu näidis PHP-s
API päringu näidis Curlis
API details
Methods
The possible API methods are as follows:
- brands - Lists Product Brands
- categories - Lists Product Categories
- products - Lists available Products
- tags - Lists additional Product Tags with links to Products
- product_images - Gets images of specified Products
- product_attachments - Gets attachments (PDFs, etc.) for specified Products
- product_sale_arguments - Lists Sale Arguments with links to Products
Requests are to be made over POST, payloads and responses are in JSON format. Payload data needs to be encapsulated inside a “params” key in the JSON payload.
Requests include these parameters:
- api_key - the assigned API key (required)
- language - locale with territory code, default is et_EE, examples include en_GB, en_US - if a translation does not exist, en_US will be used instead
- offset, limit - limit the request to specific number of entries, use offset for paging, default is no limit and offset = 0
- date_since - this field is used to limit results to only such results, that have been updated since this date, the correct format is “YYYY-MM-DD” (some requests may not include this parameter)
Response base object has two parameters:
- status - either ‘success’ or ‘error’
- data - data object of the response if the request is successful
- error_message - error message of the response if the request is unsuccessful
Result data follows a set standard of parameter naming conventions.
- id, name - every object returned has its own ID and name associated with it
- *_id and *_ids - either a single object or a list of objects, where every item is a pair of ID and Name
- *_ids_m2m - list of ID and Name pairs, more information should be queried separately with the appropriate method using the IDs returned
- The other end of the many2many will also include the inverse ID and Name pairs
- create_date - the date of the creation of this object (except for images and attachments)
- last_change_date - the date of the last update for this object (except for images and attachments)
Brands
https://api.insplay.eu/brands
Lists available Product Brands.
Request params:
- api_key (required)
- language
- ids - list of brand IDs, limit query to requesting a specific set of brands
- search_name - specify a name to search brands by, ids parameter takes precedence
- offset
- limit
Response data:
- name
- description - Brand’s description
- logo_base64 - Brand logo
- create_date
- last_change_date
Categories
https://api.insplay.eu/categories
Lists available Product Categories. Categories follow a tree structure.
Request params:
- api_key (required)
- language
- ids - list of category IDs, limit query to requesting a specific set of categories
- search_name - specify a name to search categories by, ids parameter takes precedence
- brands_ids - specify a brand IDs to search categories by, parameters above take precedence
- public_categ_ids - specify a category IDs to search categories by, parameters above take precedence
- date_since
- offset
- limit
Response data:
- name
- parent_category_id - parent category or False
- priority - priority of the category, used for sorting
- code - category code
- is_published - is category active
- create_date
- last_change_date
Products
https://api.insplay.eu/products
Lists Products.
Request params:
- api_key (required)
- language
- ids - list of product IDs, limit query to requesting a specific set of products
- brand_ids - list of brand ids requesting specific set of brand products
- search_name - specify a name to search products by, ids parameter takes precedence
- date_since - specify a date to find all products that have been updated after it, ids and search_name parameters take precedence
- offset
- limit
Response data:
- name
- description_sale - short description of the product
- description_sale_long - long description of the product
- product_code - product code
- ean13 - EAN13 barcode
- brand_id - associated brand ID
- dimensions - dimensions of the products, descriptive text field
- wholesale_price - wholesale price of the product without VAT
- under_3_forbidden - is the product forbidden for children under the age of 3
- create_date
- last_change_date
- age_from - appropriate for ages from
- age_to - appropriate for ages to
- more_info_url - manufacturer URL for more product info
- quantity_available - current available quantity
- keywords - descriptive keywords for the product
- category_ids - product category IDs and Names
- sale_argument_ids_m2m - product sale arguments, many2many, IDs and names
- tariff_no - tariff number for this product
- origin_country - country this product originates from
- old_nav_category - category name from the previous ERP system
- out_of_production - End of Life (EOL) or Out of Production product, that is no longer produced. We recommend to deactivate it once the stock is depleted.
- main_picture_url - product main picture url
- additional_picture_urls - list of additional product pictures
- recommended_retail_price - recommended retail price (RRP) of the product including Estonian VAT 20%
- net_weight - net weight of this product in KG
- height - product height
length - product length
width - product width - related_products_ids_m2m - related products with many2many relation, pairs of IDs and names
Product Tags
https://api.insplay.eu/tags
List available Product Tags with their associations to Products.
Request params:
- api_key (required)
- language
- ids - list of category IDs, limit query to requesting a specific set of categories
- offset
- limit
Response data:
- name
- code - Tag code
- associated_category - Associated product category
- product_ids_m2m - associated product IDs, many2many, pairs of IDs and names
- create_date
- last_change_date
Product Images
https://api.insplay.eu/product_images
Returns Product Images (main image and other images) for the specified products.
Request params:
- api_key (required)
- language
- product_ids (required or date_since) - list of product IDs, limit query to images of the specified products
- date_since (required or product_ids)- specify a date to find all products that have been updated after it, product_ids parameter takes precedence
- offset
- limit (max 100)
Response data:
- dictionary of images for each product, where key is Product ID and value is:
Product Attachments
https://api.insplay.eu/product_attachments
Returns all associated documents and attachments for the specified products.
Request params:
- api_key (required)
- language
- product_ids (required or date_since) - list of product IDs, limit query to requesting attachments for the specified products
- date_since (required or product_ids) - specify a date to find all products that have been updated after it, product_ids parameter takes precedence
- offset
- limit (max 100)
Response data:
- dictionary of images for each product, where key is Product ID and value is a list, where each object’s is a dictionary of:
Product Sale Arguments
https://api.insplay.eu/product_sale_arguments
List available Product Sale Arguments with their associations to Products.
Request params:
- api_key (required)
- language
- ids - list of argument IDs, limit query to requesting a specific set of sale arguments
- offset
- limit
Response data:
- name
- priority - priority of the sale argument, used for sorting
- description - description of the sale argument
- product_ids_m2m - associated product IDs, many2many, pairs of IDs and names
- create_date
- last_change_date