Download OpenAPI specification: Download
Welcome to the Prisync API (proudly version 2.0) documentation.
Prisync API is a RESTful API which enables programmatically controlling actions on your Prisync account. For example: You can simply integrate your competitor prices from Prisync into your e-commerce software, such as Magento, Opencart or CSCart.
You can instantly sign up on prisync.com and get your API credentials.
The Prisync API is an application programming interface allowing you to access:
We worked hard to get most intuitive and most powerful endpoints, to allow you get the data easily or do whatever actions you want.
The Prisync V2.0 API aims to provide you all the functions which you are already using on the Prisync Dashboard, be accessible programmatically so that you can automate your complex flows.
In this document, we first talk about the general overview about the design, then go into details of endpoints. Each endpoint has clear examples in several programming languages for your convenience.
HTTP requests can be made with tons of tools, each modern programming language has its own HTTP functions and libraries. Luckily, we are living in a world supporting hyperconnectivity. All the requests should be made with HTTPS to make sure that your data is encrypted. The Prisync API will handle each request in a meaningful manner, depending on the action required.
Method | Usage |
---|---|
GET | For simple retrieval of information about your account, products, URLs, or any other data, you should use the GET method. API will respond you with a JSON object. Using the returned information, you can form additional requests. All the GET requests are made read-only, which means making a GET requests cannot change the state of any information stored on Prisync. |
POST | When you want to create an object and store in on the Prisync, you should choose POST method. The POST request includes all of the attributes necessary to create a new object. |
When you make a request to the API, you will get a response including the data you want with standard HTTP statuses, including error codes.
In case of an unusual event, such as a record cannot be created because of it already exists, the status code will have an error code. Besides that, the body of the request will contain additional information about the event to provide you the most conventional way to fix the flow. To make it clear, status codes are usually in between 2XX-5XX range.
Status Code | Meaning |
---|---|
2XX | Request is handled successfully, there is no errors. Yay! |
4XX | There is an issue and we need your attention. A request may return 400 if a required parameter is missing or 404 if the requested record does not exists on earth or if the requested url is wrong. Authorization problems and malformed requests lay in this category as well. |
5XX | There is a problem on the server-side. It would indicate that we are having an issue or get an unexpected requests. You can always repeat the request. |
For each successfull and unsuccessfull request, a JSON-formatted response body will be sent back. If you make a request for a single object, say, for a Product, the resource root will be a single object containing the data you requested. If you request a collection, say, a group of Products, response body will contain a collection.
The number of requests that can be made through the API is currently limited to 2,500 per hour per API token.
You should set apikey and apitoken as HTTP request headers on all requests. Your API key is your Prisync login email. You can obtain your apitoken on your Prisync dashboard->account.
Most of HTTP GET requests need querystring parameters.
Most of HTTP POST requests need POST body parameters.
For almost all API requests, we provide examples calls with cURL command. With a single copy and paste, you can always try making a request and see the results.
A product presenting one of the things that you sell.
Products are the physical goods, digital goods, digital downloads or services which have a unique product page in your e-commerce infrastructure.
Different products have different attributes and several e-commerce CMS'es such as Magento or Shopify uses different labels for the same attributes.
We use the most common attributes to provide to lessen the hassle and make room for the price tracking and dynamic pricing.
Product Attributes
Name: Name of the Product. 'iPhone 8', 'MyBook Laptop core i7 16GB' or 'Sennheiser Wired Headphone Hd 429 (Black)' are examples of a Product name. Naming your Products is up to your business requirements.
Brand: (See Brand)
Category: (See Category)
Product Code: A custom code attribute allowing you matching your database records with the API results. Some companies use SKU's (Stock Keeping Unit), EAN's (International Article Number), GTIN's (Global Trade Item Number), (or ISBN, UPC etc.) as a Product code, as well as the others use custom codes.
Cost: If you provide the cost of a product (the price that you pay to obtain the item from your supplier or the production cost if you produce that item) Prisync will provide you the dynamic pricing features. (See our blog post explaining Dynamic Pricing Engine / SmartPrice features for details.
This endpoint returns information about the products that have been added to Prisync via web UI or the API. The result is paginated. Each page contains up to 100 products.
Offset for pagination. It can take 0 and exact multiples of 100 as a value.
P.S.: Actually, startFrom is an optional parameter. When not provided, this method returns the first page only. So that, calling without startFrom is equivalent to startFrom/0.
200 An object contains an array of products and next page link.
404 Requested product list not found.
curl -X GET https://prisync.com/api/v2/list/product/startFrom/0 -H 'apikey: Your API_KEY' -H 'apitoken: Your API_TOKEN'
$curl = curl_init(); curl_setopt_array($curl, array( CURLOPT_URL => "https://prisync.com/api/v2/list/product/startFrom/0", CURLOPT_RETURNTRANSFER => true, CURLOPT_CUSTOMREQUEST => "GET", CURLOPT_HTTPHEADER => array( "apikey: Your API_KEY", "apitoken: Your API_TOKEN", ), )); $response = curl_exec($curl); $err = curl_error($curl); curl_close($curl); if ($err) { echo "cURL Error #:" . $err; } else { echo $response; }
200 An object contains an array of products and next page link.
404 Requested product list not found.
{}
"results": [],
{}
"id": "435", "name": "Product Test XQ1899", "category": {},
"id": "2536", "name": "Mobile Phones" "brand": {},
"id": "9868", "name": "Apple" "product_code": "XQ1899", "barcode": 194252022191, "cost": "499", "additional_cost": "40", "tags": "Tag1, tag2, tag name4, tag_name3", "my_position": "cheapest" "nextURL": "string"
{}
"error": "string", "errorCode": "string"
This endpoint returns information about the products including price information that have been added to Prisync via web UI or the API. The result is paginated. Each page contains up to 100 products.
A keyword to obtain all price information related to the product.
Offset for pagination. It can take 0 and exact multiples of 100 as a value.
P.S.: Actually, startFrom is an optional parameter. When not provided, this method returns the first page only. So that, calling without startFrom is equivalent to startFrom/0.
200 An object contains an array of products with price summary information and next page link.
404 Requested product list not found.
curl -X GET https://prisync.com/api/v2/list/product/summary/startFrom/0 -H 'apikey: Your API_KEY' -H 'apitoken: Your API_TOKEN'
$curl = curl_init(); curl_setopt_array($curl, array( CURLOPT_URL => "https://prisync.com/api/v2/list/product/summary/startFrom/0", CURLOPT_RETURNTRANSFER => true, CURLOPT_CUSTOMREQUEST => "GET", CURLOPT_HTTPHEADER => array( "apikey: Your API_KEY", "apitoken: Your API_TOKEN", ), )); $response = curl_exec($curl); $err = curl_error($curl); curl_close($curl); if ($err) { echo "cURL Error #:" . $err; } else { echo $response; }
200 An object contains an array of products with price summary information and next page link.
404 Requested product list not found.
{}
"results": [],
{}
"id": "435", "name": "Product Test XQ1899", "category": {},
"id": "2536", "name": "Mobile Phones" "brand": {},
"id": "9868", "name": "Apple" "product_code": "XQ1899", "barcode": 194252022191, "cost": "499", "additional_cost": "40", "tags": "Tag1, tag2, tag name4, tag_name3", "summary": {},
"amazon.com": {},
"price": "766.00", "total_price": "786.00", "stock": true "bestbuy.com": {}
"price": "786.00", "total_price": "799.00", "stock": true "my_position": "cheapest", "my_position_total_price": "cheapest" "nextURL": "string"
{}
"error": "string", "errorCode": "string"
This endpoint returns product id, product code, barcode and SmartPrice information about the products that have been added to Prisync via web UI or the API. The result is paginated. Each page contains up to 100 products.
Offset for pagination. It can take 0 and exact multiples of 100 as a value.
P.S.: Actually, startFrom is an optional parameter. When not provided, this method returns the first page only. So that, calling without startFrom is equivalent to startFrom/0.
200 An object contains an array of products with product id and SmartPrice information and next page link.
404 Requested SmartPrice list not found.
curl -X GET https://prisync.com/api/v2/list/smartprice/startFrom/0 -H 'apikey: Your API_KEY' -H 'apitoken: Your API_TOKEN'
$curl = curl_init(); curl_setopt_array($curl, array( CURLOPT_URL => "https://prisync.com/api/v2/list/smartprice/startFrom/0", CURLOPT_RETURNTRANSFER => true, CURLOPT_CUSTOMREQUEST => "GET", CURLOPT_HTTPHEADER => array( "apikey: Your API_KEY", "apitoken: Your API_TOKEN", ), )); $response = curl_exec($curl); $err = curl_error($curl); curl_close($curl); if ($err) { echo "cURL Error #:" . $err; } else { echo $response; }
200 An object contains an array of products with product id and SmartPrice information and next page link.
404 Requested SmartPrice list not found.
{}
"results": [],
{}
"product_id": "135", "product_code": "XQ1899", "barcode": 194252022191, "smart_price": "1,299.90", "my_position": "cheapest" "nextURL": "string"
{}
"error": "string", "errorCode": "string"
This endpoint returns product info with given id.
Unique id of the product
200 A product object contains attached URL ids.
404 Requested product not found.
curl -X GET https://prisync.com/api/v2/get/product/id/1 -H 'apikey: Your API_KEY' -H 'apitoken: Your API_TOKEN'
$curl = curl_init(); curl_setopt_array($curl, array( CURLOPT_URL => "https://prisync.com/api/v2/get/product/id/1", CURLOPT_RETURNTRANSFER => true, CURLOPT_CUSTOMREQUEST => "GET", CURLOPT_HTTPHEADER => array( "apikey: Your API_KEY", "apitoken: Your API_TOKEN", ), )); $response = curl_exec($curl); $err = curl_error($curl); curl_close($curl); if ($err) { echo "cURL Error #:" . $err; } else { echo $response; }
200 A product object contains attached URL ids.
404 Requested product not found.
{}
"id": "24612", "name": "Samsung S8", "category": {},
"id": "2536", "name": "Mobile Phones" "brand": {},
"id": "9868", "name": "Apple" "product_code": "XQ1899", "barcode": 194252022191, "cost": "499", "additional_cost": "40", "tags": "Tag1, tag2, tag name4, tag_name3", "external_ref": "75643231", "smart_price": "799", "my_position": "cheapest", "urls": []
[]
"3467", "47387"
{}
"error": "string", "errorCode": "string"
This end point can be used on adding a new product to your Prisync account.
Product name
Brand name
Category name
Product code
Barcode
Product cost
Additional cost
Product tags
200 A successful response object contains unique id of the new product and result status.
400 Missing or incorrect parameter.
404 Requested object not found.
405 This method is not allowed.
422 This object already exists.
curl -X POST https://prisync.com/api/v2/add/product/ -H 'apikey: Your API_KEY' -H 'apitoken: Your API_TOKEN' -H 'content-type: multipart/form-data' -F 'name=Test Product' -F 'brand=Test Brand' -F 'category=Test Category' -F 'product_code=TST001' -F 'barcode=194252022191' -F 'cost=100' -F 'additional_cost=40' -F 'tags=Tag1, tag2, tag name4, tag_name3'
$ch = curl_init(); curl_setopt($ch, CURLOPT_URL, "https://prisync.com/api/v2/add/product/"); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_POST, 1); $data = array(); $data["name"] = "Test Product"; $data["brand"] = "Test Brand"; $data["category"] = "Test Category"; $data["product_code"] = "TST001"; $data["barcode"] = "194252022191"; $data["cost"] = "100"; $data["additional_cost"] = "40"; $data["tags"] = "Tag1, tag2, tag name4, tag_name3"; $headers = array(); $headers[] = "apikey: Your API_KEY"; $headers[] = "apitoken: Your API_TOKEN"; $headers[] = "Content-Type: multipart/form-data"; curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); curl_setopt($ch, CURLOPT_POSTFIELDS, $data); $response = curl_exec($ch); $err = curl_error($ch); curl_close($ch); if ($err) { echo "cURL Error #:" . $err; } else { echo $response; }
200 A successful response object contains unique id of the new product and result status.
400 Missing or incorrect parameter.
404 Requested object not found.
405 This method is not allowed.
422 This object already exists.
{}
"id": "23623", "result": true
{}
"error": "string", "errorCode": "string"
{}
"error": "string", "errorCode": "string"
{}
"error": "string", "errorCode": "string"
{}
"error": "string", "errorCode": "string"
This endpoint can be used on adding more than one product at a time.
You can make a request to this endpoint whenever you want to add more than one product. Instead of writing for loops around /add/product calls, you can wrap your all products into just a single request.
This request is very similar to /add/product, the only difference lays in the parameter structure. Instead of only one product name, brand, category, product_code and price, you need to add an array of those.
A clear example adding two products in a single request is shown on the right hand side of this page.
This is a list of products where you need to add each product is an element of the parameter array and each element should contain name, brand, category, product_code and cost fields. (See the example on the right column.)
You can see an example of product from here.
We do not accept package limit exceeding requests by default. You can set this parameter to false if you want to import first allowed number of products.
E.g. Your package limit is 1000 products and you have 850 products already in your panel.
If you try to import 500 new products, it will cause an error (422 - Package limit exceeded) by default.
If this parameter set as false, system will import first 150 products.
200 A successful response object contains progress result.
400 Missing or incorrect parameter. / Post data is empty, it should not be empty.
422 This list already in the process queue. / Package limit exceeded.
curl -X POST https://prisync.com/api/v2/add/batch/ -H 'apikey: Your API_KEY' -H 'apitoken: Your API_TOKEN' -H 'content-type: multipart/form-data' -F 'product0[name]=Test Product 1' -F 'product0[brand]=Test Brand' -F 'product0[category]=Test Category' -F 'product0[product_code]=TST001' -F 'product0[barcode]=194252022191' -F 'product0[cost]=100' -F 'product0[additional_cost]=20' -F 'product1[name]=Test Product 2' -F 'product1[brand]=Test Brand 2' -F 'product1[category]=Test Category 2' -F 'product1[product_code]=TST002' -F 'product1[barcode]=194252022192' -F 'product1[cost]=200' -F 'product1[additional_cost]=40' -F 'cancelOnPackageLimitExceeding=false'
$ch = curl_init(); curl_setopt($ch, CURLOPT_URL, "https://prisync.com/api/v2/add/batch/"); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_POST, 1); $product1 = $product2 = $data = array(); $product1["name"] = "Test Product 1"; $product1["brand"] = "Test Brand"; $product1["category"] = "Test Category"; $product1["product_code"] = "TST001"; $product1["barcode"] = "194252022191"; $product1["cost"] = "100"; $product1["additional_cost"] = "20"; $product2["name"] = "Test Product 2"; $product2["brand"] = "Test Brand 2"; $product2["category"] = "Test Category 2"; $product2["product_code"] = "TST002"; $product2["barcode"] = "194252022192"; $product2["cost"] = "200"; $product1["additional_cost"] = "40"; $cancelOnPackageLimitExceeding = "false"; $data['product1'] = $product1; $data['product2'] = $product2; $data['cancelOnPackageLimitExceeding'] = $cancelOnPackageLimitExceeding; $headers = array(); $headers[] = "apikey: Your API_KEY"; $headers[] = "apitoken: Your API_TOKEN"; curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($data)); $response = curl_exec($ch); $err = curl_error($ch); curl_close($ch); if ($err) { echo "cURL Error #:" . $err; } else { echo $response; }
200 A successful response object contains progress result.
400 Missing or incorrect parameter. / Post data is empty, it should not be empty.
422 This list already in the process queue. / Package limit exceeded.
{}
"message": "Completed.", "status": "finished", "total": "100", "processed": "100", "errors": []
[]
"Line 1: Duplicate Product in request. Product Name: Test Product 1", "Line 4: Duplicate Product in database. Product Name: Test Product 2"
{}
"error": "string", "errorCode": "string"
{}
"error": "string", "errorCode": "string"
This endpoint can be used for changing name, brand, category, product code, barcode or product cost of given product.
This is a overwriting operation. The product will be updated with the new values that you send within the request.
You can edit one or more (or even all) attribute(s) of a product in a single request. Product id is a read-only value so that it is immutable.
Unique id of the product
Product name
Brand name
Category name
Product tags. Previous tags will be removed and replaced with these.
Product code
Barcode
Product cost
Additional cost
200 A successful response object contains unique id of the product and result status.
400 Missing or incorrect parameter.
404 Requested object not found.
405 This method is not allowed.
422 This object already exists.
curl -X POST https://prisync.com/api/v2/edit/product/id/123 -H 'apikey: Your API_KEY' -H 'apitoken: Your API_TOKEN' -H 'content-type: multipart/form-data' -F 'name=Test Product Edit' -F 'brand=Test Brand' -F 'category=Test Category' -F 'tags=Tag1, tag2, tag name4, tag_name3' -F 'product_code=TST004' -F 'barcode=194252022191' -F 'cost=299' -F 'additional_cost=40'
$ch = curl_init(); curl_setopt($ch, CURLOPT_URL, "https://prisync.com/api/v2/edit/product/id/123"); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_POST, 1); $data = array(); $data["name"] = "Test Product Edit"; $data["brand"] = "Test Brand"; $data["category"] = "Test Category"; $data["tags"] = "Tag1, tag2, tag name4, tag_name3"; $data["product_code"] = "TST004"; $data["cost"] = "299"; $data["additional_cost"] = "40"; $headers = array(); $headers[] = "apikey: Your API_KEY"; $headers[] = "apitoken: Your API_TOKEN"; $headers[] = "Content-Type: multipart/form-data"; curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); curl_setopt($ch, CURLOPT_POSTFIELDS, $data); $response = curl_exec($ch); $err = curl_error($ch); curl_close($ch); if ($err) { echo "cURL Error #:" . $err; } else { echo $response; }
200 A successful response object contains unique id of the product and result status.
400 Missing or incorrect parameter.
404 Requested object not found.
405 This method is not allowed.
422 This object already exists.
{}
"id": "23623", "result": true
{}
"error": "string", "errorCode": "string"
{}
"error": "string", "errorCode": "string"
{}
"error": "string", "errorCode": "string"
{}
"error": "string", "errorCode": "string"
This endpoint can be used on delete product with given id.
P.S. Product deletion requires further cleaning so that it may take a few seconds to finish the request.
Unique id of the product
200 A successful response object contains result status.
404 Requested object not found.
405 This method is not allowed.
curl -X POST https://prisync.com/api/v2/delete/product/id/123 -H 'apikey: Your API_KEY' -H 'apitoken: Your API_TOKEN'
$ch = curl_init(); curl_setopt($ch, CURLOPT_URL, "https://prisync.com/api/v2/delete/product/id/123"); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_POST, 1); $headers = array(); $headers[] = "apikey: Your API_KEY"; $headers[] = "apitoken: Your API_TOKEN"; curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); $response = curl_exec($ch); $err = curl_error($ch); curl_close($ch); if ($err) { echo "cURL Error #:" . $err; } else { echo $response; }
200 A successful response object contains result status.
404 Requested object not found.
405 This method is not allowed.
{}
"result": true
{}
"error": "string", "errorCode": "string"
{}
"error": "string", "errorCode": "string"
This endpoint returns progress status of batch import product.
/add/batch request works asynchronously which means it returns success immediately, then it adds all the products into a buffer queue, and finally it saves products into Prisync database. You can query this endpoint to get current status of your bulk add.
200 A successful response object contains result status.
500 A general error occurred.
curl -X GET https://prisync.com/api/v2/progress/batchImport -H 'apikey: Your API_KEY' -H 'apitoken: Your API_TOKEN'
$ch = curl_init(); curl_setopt($ch, CURLOPT_URL, "https://prisync.com/api/v2/progress/batchImport"); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); $headers = array(); $headers[] = "apikey: Your API_KEY"; $headers[] = "apitoken: Your API_TOKEN"; curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); $response = curl_exec($ch); $err = curl_error($ch); curl_close($ch); if ($err) { echo "cURL Error #:" . $err; } else { echo $response; }
200 A successful response object contains result status.
500 A general error occurred.
{}
"message": "Completed.", "status": "finished", "total": "100", "processed": "100", "errors": []
[]
"Line 1: Duplicate Product in request. Product Name: Test Product 1", "Line 4: Duplicate Product in database. Product Name: Test Product 2"
{}
"error": "string", "errorCode": "string"
A URL pointing your or one of your competitors product page. Prisync successfully tracks all kinds of product pages from all types of websites so that you should precisely add the product detail page of your own website or your competitor's websites.
Example:
https://www.amazon.com/Hamlet-Folger-Library-Shakespeare-William/dp/074347712X
This is a typical product page, including the name of the product, the image of the product and price/stock information. This is the correct type of URL that should be added.
A Common Mistake:
https://www.amazon.com/Drama-Literature-Fiction-Books/b/?&node=2159
This is NOT a product page, instead, this is a category listing page. This page includes several different products in a single page and Prisync CANNOT guess which product that you want to track. The API allows adding category listing URLs but Prisync will NOT track them.
Another Common Mistake:
https://www.amazon.com
This mistake is actually very similar to the previous one. This URL is NOT a product page URL as well. Amazon sells more than 400 million URLs (2017) and probably you wouldn't want to track all of them. Instead of adding the naked domain name (such as amazon.com, bestbuy.com, amazon.co.uk etc.) you should add the specific URL pointing the product page. You can technically add these type of URLs but Prisync will NOT track them.
This endpoint returns URL info with given id.
Tip:
When you want to get all URLs belonging to a particular product, first you should make a request for getting the details of the product (See get product.). That request will return an array of URL id's in the response. Using those URL id's, you can get exact URL (the actual address) using this endpoint.
Unique id of the URL
200 A URL object contains unique id and url.
404 Requested URL not found.
curl -X GET https://prisync.com/api/v2/get/url/id/1 -H 'apikey: Your API_KEY' -H 'apitoken: Your API_TOKEN'
$curl = curl_init(); curl_setopt_array($curl, array( CURLOPT_URL => "https://prisync.com/api/v2/get/url/id/1", CURLOPT_RETURNTRANSFER => true, CURLOPT_CUSTOMREQUEST => "GET", CURLOPT_HTTPHEADER => array( "apikey: Your API_KEY", "apitoken: Your API_TOKEN", ), )); $response = curl_exec($curl); $err = curl_error($curl); curl_close($curl); if ($err) { echo "cURL Error #:" . $err; } else { echo $response; }
200 A URL object contains unique id and url.
404 Requested URL not found.
{}
"id": "54674", "price": "769.99", "in_stock": "1", "last_check": "2017-10-21 11:22:21", "change_day": "0.02", "currency": "USD", "last_changed": "21/10/2017", "old_price": "754.75"
{}
"error": "string", "errorCode": "string"
Add a URL to a particular product. You can add your own URL or a competitor's URL to one of your products. Tip
Let's say you want to add your first product (e.g. MyBook Laptop Core i7 16GB) using the API. First, you should add a product using add product endpoint. Add product endpoint returns the newly created product's id in the response. Now it's time to add your own URL. For the sake of the example, let's assume your website is 'https://mybook.com' and the product page of MyBook Laptop Core i7 16GB is 'https://mybook.com/187728/MyBook-Corei7-16GB'.
At this point, you have a product id and a URL address. Just make a request to add URL endpoint and voilà. You've just starting tracking your first product and your first URL.
Now you can add your competitors URLs using the same product id, then Prisync will going to handle the rest, collect the data automatically.
Product id which you want to add a URL.
Url
200 A successful response object contains unique id of the new URL and result status.
400 Missing or incorrect parameter.
404 Requested object not found.
405 This method is not allowed.
422 This object already exists.
curl -X POST https://prisync.com/api/v2/add/url/ -H 'apikey: Your API_KEY' -H 'apitoken: Your API_TOKEN' -F 'product_id=123' -F 'url=http://example.com/product/1'
$ch = curl_init(); curl_setopt($ch, CURLOPT_URL, "https://prisync.com/api/v2/add/url/"); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_POST, 1); $data = array(); $data["product_id"] = "123"; $data["url"] = "http://example.com/product/1"; $headers = array(); $headers[] = "apikey: Your API_KEY"; $headers[] = "apitoken: Your API_TOKEN"; $headers[] = "Content-Type: multipart/form-data"; curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); curl_setopt($ch, CURLOPT_POSTFIELDS, $data); $response = curl_exec($ch); $err = curl_error($ch); curl_close($ch); if ($err) { echo "cURL Error #:" . $err; } else { echo $response; }
200 A successful response object contains unique id of the new URL and result status.
400 Missing or incorrect parameter.
404 Requested object not found.
405 This method is not allowed.
422 This object already exists.
{}
"id": "23623", "result": true
{}
"error": "string", "errorCode": "string"
{}
"error": "string", "errorCode": "string"
{}
"error": "string", "errorCode": "string"
{}
"error": "string", "errorCode": "string"
This endppoint can be used on delete url with given id.
Tip
The web is a dynamic environment. Products go out of stock, even they are not sold anymore. Websites move products to different URLs and old URLs start to respond with 404s. Or else, URL structures change all the time.
You can always delete URLs from your account. To delete a URL, you need its URL id. Just make a get request to the product that URL belongs to (using /get/product/id/{id} endpoint) and obtain the id of the URL.
Now you can use /delete/url endpoint to delete the URL. Don't forget to provide the URL id that you've just obtained.
Unique id of the URL
200 A successful response object contains result status.
404 Requested object not found.
405 This method is not allowed.
curl -X POST https://prisync.com/api/v2/delete/url/id/123 -H 'apikey: Your API_KEY' -H 'apitoken: Your API_TOKEN'
$ch = curl_init(); curl_setopt($ch, CURLOPT_URL, "https://prisync.com/api/v2/delete/url/id/123"); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_POST, 1); $headers = array(); $headers[] = "apikey: Your API_KEY"; $headers[] = "apitoken: Your API_TOKEN"; curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); $response = curl_exec($ch); $err = curl_error($ch); curl_close($ch); if ($err) { echo "cURL Error #:" . $err; } else { echo $response; }
200 A successful response object contains result status.
404 Requested object not found.
405 This method is not allowed.
{}
"result": true
{}
"error": "string", "errorCode": "string"
{}
"error": "string", "errorCode": "string"
The name of the manufacturer or the supplier of one (or several) Products.
Brand names are totally customizable, which means Prisync does not provide you a static Brand list. Instead, you can define your own Brands.
Brands are defined via /add/product endpoint. If the Brand you provided in your add product request already exists in your account, we only add your Product to the given Brand. If the Brand doesn't exists in your account, the API will create that Brand on behalf of you automatically.
So that, there is no need to make extra Brand create requests.
This endpoint returns list of your brands. The response is paginated and it can show 100 brands at a time.
Offset for pagination. It can take 0 and exact multiples of 100 as a value.
P.S.: Actually, startFrom is an optional parameter. When not provided, this method returns the first page only. So that, calling without startFrom is equivalent to startFrom/0.
200 An object contains an array of brands and next page link.
404 Requested brand list not found.
curl -X GET https://prisync.com/api/v2/list/brand/startFrom/0 -H 'apikey: Your API_KEY' -H 'apitoken: Your API_TOKEN'
$curl = curl_init(); curl_setopt_array($curl, array( CURLOPT_URL => "https://prisync.com/api/v2/list/brand/startFrom/0", CURLOPT_RETURNTRANSFER => true, CURLOPT_CUSTOMREQUEST => "GET", CURLOPT_HTTPHEADER => array( "apikey: Your API_KEY", "apitoken: Your API_TOKEN", ), )); $response = curl_exec($curl); $err = curl_error($curl); curl_close($curl); if ($err) { echo "cURL Error #:" . $err; } else { echo $response; }
200 An object contains an array of brands and next page link.
404 Requested brand list not found.
{}
"results": [],
{}
"id": "9868", "name": "Apple" "nextURL": "string"
{}
"error": "string", "errorCode": "string"
This endpoint returns brand info with given id.
Unique id of the brand
200 A brand object contains unique id and name.
404 Requested brand not found.
curl -X GET https://prisync.com/api/v2/get/brand/id/1 -H 'apikey: Your API_KEY' -H 'apitoken: Your API_TOKEN'
$curl = curl_init(); curl_setopt_array($curl, array( CURLOPT_URL => "https://prisync.com/api/v2/get/brand/id/1", CURLOPT_RETURNTRANSFER => true, CURLOPT_CUSTOMREQUEST => "GET", CURLOPT_HTTPHEADER => array( "apikey: Your API_KEY", "apitoken: Your API_TOKEN", ), )); $response = curl_exec($curl); $err = curl_error($curl); curl_close($curl); if ($err) { echo "cURL Error #:" . $err; } else { echo $response; }
200 A brand object contains unique id and name.
404 Requested brand not found.
{}
"id": "9868", "name": "Apple"
{}
"error": "string", "errorCode": "string"
This endpoint can be used on editing brand name with given id.
Unique id of the brand
New brand name
200 A successful response object contains unique id of the brand and result status.
400 Missing or incorrect parameter.
404 Requested object not found.
405 This method is not allowed.
curl -X POST https://prisync.com/api/v2/edit/brand/id/123 -H 'apikey: Your API_KEY' -H 'apitoken: Your API_TOKEN' -H 'content-type: multipart/form-data' -F 'name=Test Brand'
$ch = curl_init(); curl_setopt($ch, CURLOPT_URL, "https://prisync.com/api/v2/edit/brand/id/123"); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_POST, 1); $data = array(); $data["name"] = "Test Brand"; $headers = array(); $headers[] = "apikey: Your API_KEY"; $headers[] = "apitoken: Your API_TOKEN"; $headers[] = "Content-Type: multipart/form-data"; curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); curl_setopt($ch, CURLOPT_POSTFIELDS, $data); $response = curl_exec($ch); $err = curl_error($ch); curl_close($ch); if ($err) { echo "cURL Error #:" . $err; } else { echo $response; }
200 A successful response object contains unique id of the brand and result status.
400 Missing or incorrect parameter.
404 Requested object not found.
405 This method is not allowed.
{}
"id": "23623", "result": true
{}
"error": "string", "errorCode": "string"
{}
"error": "string", "errorCode": "string"
{}
"error": "string", "errorCode": "string"
A group name including similar Products.
Category names are totally customizable, which means Prisync does not provide you a static Category list. Instead, you can define your own Categories.
Categories are defined via /add/product endpoint. If the Category you provided in your add product request already exists in your account, we only add your Product to the given Category. If the Category doesn't exists in your account, the API will create that Category on behalf of you automatically.
So that, there is no need to make extra Category create requests.
This endpoint returns list of your categories. The response is paginated and it can show 100 categories at a time.
Offset for pagination. It can take 0 and exact multiples of 100 as a value.
P.S.: Actually, startFrom is an optional parameter. When not provided, this method returns the first page only. So that, calling without startFrom is equivalent to startFrom/0.
200 An object contains an array of categories and next page link.
404 Requested category list not found.
curl -X GET https://prisync.com/api/v2/list/category/startFrom/0 -H 'apikey: Your API_KEY' -H 'apitoken: Your API_TOKEN'
$curl = curl_init(); curl_setopt_array($curl, array( CURLOPT_URL => "https://prisync.com/api/v2/list/category/startFrom/0", CURLOPT_RETURNTRANSFER => true, CURLOPT_CUSTOMREQUEST => "GET", CURLOPT_HTTPHEADER => array( "apikey: Your API_KEY", "apitoken: Your API_TOKEN", ), )); $response = curl_exec($curl); $err = curl_error($curl); curl_close($curl); if ($err) { echo "cURL Error #:" . $err; } else { echo $response; }
200 An object contains an array of categories and next page link.
404 Requested category list not found.
{}
"results": [],
{}
"id": "2536", "name": "Mobile Phones" "nextURL": "string"
{}
"error": "string", "errorCode": "string"
This endpoint returns category info with given id.
Unique id of the category
200 A category object contains unique id and name.
404 Requested category not found.
curl -X GET https://prisync.com/api/v2/get/category/id/1 -H 'apikey: Your API_KEY' -H 'apitoken: Your API_TOKEN'
$curl = curl_init(); curl_setopt_array($curl, array( CURLOPT_URL => "https://prisync.com/api/v2/get/category/id/1", CURLOPT_RETURNTRANSFER => true, CURLOPT_CUSTOMREQUEST => "GET", CURLOPT_HTTPHEADER => array( "apikey: Your API_KEY", "apitoken: Your API_TOKEN", ), )); $response = curl_exec($curl); $err = curl_error($curl); curl_close($curl); if ($err) { echo "cURL Error #:" . $err; } else { echo $response; }
200 A category object contains unique id and name.
404 Requested category not found.
{}
"id": "2536", "name": "Mobile Phones"
{}
"error": "string", "errorCode": "string"
This endpoint can be used on editing category name with given id.
Unique id of the category
New category name
200 A successful response object contains unique id of the category and result status.
400 Missing or incorrect parameter.
404 Requested object not found.
405 This method is not allowed.
curl -X POST https://prisync.com/api/v2/edit/category/id/123 -H 'apikey: Your API_KEY' -H 'apitoken: Your API_TOKEN' -H 'content-type: multipart/form-data' -F 'name=Test Category'
$ch = curl_init(); curl_setopt($ch, CURLOPT_URL, "https://prisync.com/api/v2/edit/category/id/123"); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_POST, 1); $data = array(); $data["name"] = "Test Category"; $headers = array(); $headers[] = "apikey: Your API_KEY"; $headers[] = "apitoken: Your API_TOKEN"; $headers[] = "Content-Type: multipart/form-data"; curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); curl_setopt($ch, CURLOPT_POSTFIELDS, $data); $response = curl_exec($ch); $err = curl_error($ch); curl_close($ch); if ($err) { echo "cURL Error #:" . $err; } else { echo $response; }
200 A successful response object contains unique id of the category and result status.
400 Missing or incorrect parameter.
404 Requested object not found.
405 This method is not allowed.
{}
"id": "23623", "result": true
{}
"error": "string", "errorCode": "string"
{}
"error": "string", "errorCode": "string"
{}
"error": "string", "errorCode": "string"
We provide a brief info about your account via this endpoint. Basically, this endpoint returns your Prisync plan type, number of products that your plan includes and your account status.
This endpoint returns your account details.
200 An object contains your account details.
401 Requested account not authorized to access to API.
curl -X GET https://prisync.com/api/v2/account/ -H 'apikey: Your API_KEY' -H 'apitoken: Your API_TOKEN'
$ch = curl_init(); curl_setopt($ch, CURLOPT_URL, "https://prisync.com/api/v2/account"); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); $headers = array(); $headers[] = "apikey: Your API_KEY"; $headers[] = "apitoken: Your API_TOKEN"; curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); $response = curl_exec($ch); $err = curl_error($ch); curl_close($ch); if ($err) { echo "cURL Error #:" . $err; } else { echo $response; }
200 An object contains your account details.
401 Requested account not authorized to access to API.
{}
"package": "M", "product_limit": 1000, "company_status": "in_trial", "remaining_trial_days": 10, "api_enabled": true, "competitor_monitoring_style": "url_based"
{}
"error": "string", "errorCode": "string"