API Documentation
Introduction
What is an API?
An API (Application Programming Interface) is a set of rules and protocols that allows different software applications to communicate and interact with each other. It defines the methods, data structures, and conventions for building software components that can be easily integrated into other systems.
What is a RESTful API?
A RESTful API (Representational State Transfer) is a type of API that follows the principles of the REST architectural style. It uses standard HTTP methods like GET, POST to perform operations on resources. RESTful APIs are stateless, meaning each request is independent and doesn't rely on previous requests or session information.
What is JSON?
JSON (JavaScript Object Notation) is a lightweight data-interchange format. It is easy for humans to read and write. It is easy for machines to parse and generate. It is based on a subset of the JavaScript Programming Language.
Types of Requests:
Our API supports the following HTTP methods:
- GET: Used to retrieve data from the server. For example, you can use a GET request to fetch information about a specific resource.
- POST: Used to send data to the server for creating new resources. This request is commonly used for submitting forms or uploading files.
Responses
When making requests to our API, you can expect the following HTTP status codes in the responses:
- 200 OK: The request was successful, and the server returned the requested data.
- 201 Created: The request to create a new resource was successful.
- 400 Bad Request: The request was invalid or malformed. Additional information about the error can be found in the response body.
- 404 Not Found: The requested resource was not found on the server.
- 500 Internal Server Error: An unexpected error occurred on the server.
Authentication
API Token
To authenticate your requests, you need to pass your API Token in the Authorization header. You can find your API Token in your account settings.
Rate Limit
The API is limited to 3600 requests per hour. If you exceed this limit, you will receive a 429 Too Many Requests response.
Endpoints
All Products
This route will return all client products where `page` is the pagination number.
This endpoint returns both active and deactivated products.
GET Request
Expected Response
{
"product": {
"product_id": "1A",
"name": "Product 1",
"url": "https://www.product.com/1",
"brand": "Brand 1",
"category_1": "Category 1",
"category_2": "Category 2",
"tags": "Tag 1, Tag 2, Tag 3",
"status": "Avaliable",
"sell_price": "306.00",
"cost_price": "429.00",
"matches": [
{
"match_id": 2,
"website": "example.com",
"url": "https://www.example.com/A4",
"price": "9.00",
"product_name": "A4"
},
{
"match_id": 3,
"website": "example.com",
"url": "https://www.example.com/A5",
"price": "10.00",
"product_name": "A5"
}
]
}
}{
"Warning": "Bad Request!",
"Missing/Invalid": "page"
}Products Search
This route will return all products with `products_id` or `name` like XXX
GET Request
Expected Response
{
"total_products": 5,
"products": [
{
"product_id": "1A",
"name": "Product 1",
"url": "https://www.product.com/1",
"brand": "Brand 1",
"category_1": "Category 1",
"category_2": "Category 2",
"tags": "Tag 1, Tag 2, Tag 3",
"status": "Avaliable",
"sell_price": "306.00",
"cost_price": "429.00"
},
{
"product_id": "11A",
"name": "Product 11",
"url": "https://www.product.com/11",
"brand": "Brand 11",
"category_1": "Category 1",
"category_2": "Category 2",
"tags": "Tag 1, Tag 2, Tag 3",
"status": "Avaliable",
"sell_price": "471.00",
"cost_price": "343.00"
}
]
}{
"Warning": "Bad Request!",
"Missing": "search-term"
}Single Product
This route will return a product where {productId} is product id/SKU
GET Request
Expected Response
{
"product": {
"product_id": "1A",
"name": "Product 1",
"url": "https://www.product.com/1",
"brand": "Brand 1",
"category_1": "Category 1",
"category_2": "Category 2",
"tags": "Tag 1, Tag 2, Tag 3",
"status": "Avaliable",
"sell_price": "306.00",
"cost_price": "429.00",
"matches": [
{
"match_id": 2,
"website": "example.com",
"url": "https://www.example.com/A4",
"price": "9.00",
"product_name": "A4"
},
{
"match_id": 3,
"website": "example.com",
"url": "https://www.example.com/A5",
"price": "10.00",
"product_name": "A5"
}
]
}
}{
"Warning": "Bad Request!",
"Missing": "product_id"
}{
"Warning": "Not Found!",
"Invalid": "product_id"
}Add Product
This route will add product. Body must contain the following fields:
product_id must be unique within your account. If you submit a duplicate product_id, the request will be rejected with a conflict error.
- product_id * (string)
- name * (string)
- url (string)
- sell_price * (decimal)
- cost_price (decimal)
- brand (string)
- category_1 (string)
- category_2 (string)
- tags (string)
- status (string)
POST Request
Expected Response
{
"success": true,
"message": "Product added successfully! "
}{
"message": "The product id field is required.",
"errors": {
"product_id": ["The product id field is required."]
}
}Bulk Add Product
This route will add bulk products. Body must contain fields in the following format:
product_id must be unique within your account. If you submit a duplicate product_id, the request will be rejected with a conflict error.
- product_id * (string)
- name * (string)
- url (string)
- sell_price * (decimal)
- cost_price (decimal)
- brand (string)
- category_1 (string)
- category_2 (string)
- tags (string)
- status (string)
POST Request
JSON format accepted:
{
"products": [
{
"product_id": "1A",
"name": "Product 1",
"url": "https://www.your-site.com/product/1",
"brand": "Brand 1",
"category_1": "Category 1",
"category_2": "Category 2",
"tags": "Tag 1, Tag 2, Tag 3",
"status": "Avaliable",
"sell_price": "306.00",
"cost_price": "429.00"
},
{
"product_id": "11A",
"name": "Product 11",
"url": "https://www.your-site.com/product/11A",
"brand": "Brand 11",
"category_1": "Category 1",
"category_2": "Category 2",
"tags": "Tag 1, Tag 2, Tag 3",
"status": "Avaliable",
"sell_price": "471.00",
"cost_price": "343.00"
}
]
}
Expected Response
{
"success": true,
"message": "Product added successfully! "
}{
"success": true,
"problems": true,
"message": "Products have been added successfully, but some issues were found. Please check /api/products-with-issues and make necessary corrections. Thank you!"
}{
"message": "Invalid url.",
"success": false
}Products with Issue
This route will return all product with issue. It is important to note that these products cannot be matched with until the underlying issues are resolved/edited.
GET Request
Expected Response
{
"success": true,
"products": [
{
"product_id": "SKU_8",
"url": "your-website.com/product/8",
"issue": "Invalid URL"
},
{
"product_id": "1A",
"url": "httwww.product.com/11",
"issue": "Invalid URL"
}
]
}Edit Product
This route will edit product. Body must contain the following fields:
- product_id * (string)
- name * (string)
- url (string)
- sell_price * (decimal)
- cost_price (decimal)
- brand (string)
- category_1 (string)
- category_2 (string)
- tags (string)
- status (string)
POST Request
Expected Response
{
"success": true,
"message": "The product has been successfully edited."
}{
"message": "The product id field is required.",
"errors": {
"product_id": ["The product id field is required."]
}
}Bulk Edit Product
This route will edit multiple products in a single request. Only product_id is mandatory for each product. All other fields are optional - if not included, the existing value will be preserved. If included but empty/null, the field will be cleared.
The endpoint supports partial success: if some products fail validation (e.g., deactivated or not found), the valid products will still be updated and detailed warnings/errors will be returned.
Important: Maximum 2000 products per request. For larger updates, split into multiple requests.
Body must include at least one product, where product_id is required and at least one other attribute must be included to update it.
- product_id * (string)
- name * (string)
- url (string)
- brand (string)
- category_1 (string)
- category_2 (string)
- tags (string)
- status (string)
- sell_price (decimal)
- cost_price (decimal)
POST Request
JSON format accepted:
{
"products": [
{
"product_id": "SKU_001",
"name": "Updated Product Name",
"sell_price": 99.99
},
{
"product_id": "SKU_002",
"cost_price": 45.00,
"brand": "New Brand"
},
{
"product_id": "SKU_003",
"brand": "Updated Brand",
"category_1": "Electronics"
}
]
}{
"success": true,
"message": "Successfully updated 2 of 2 products.",
"summary": {
"total": 2,
"updated": 2,
"warnings": 0,
"errors": 0
}
}{
"success": true,
"message": "Successfully updated 2 of 3 products. 1 product(s) had warnings.",
"summary": {
"total": 3,
"updated": 2,
"warnings": 1,
"errors": 0
},
"warnings": [
{
"product_id": "SKU_DEACTIVATED",
"message": "Product is deactivated and has been omitted from the request."
}
]
}{
"success": false,
"message": "No products were updated. 1 product(s) had errors.",
"summary": {
"total": 1,
"updated": 0,
"warnings": 0,
"errors": 1
},
"errors": [
{
"product_id": "INVALID_SKU",
"message": "Product not found."
}
]
}{
"success": false,
"message": "Validation failed. Please check your input data.",
"errors": {
"products": ["Products data is required."]
}
}Delete Product
This route will delete product. Body must contain the following fields:
- product_id * (string)
POST Request
Expected Response
{
"success": true,
"message": "Product deleted successfully."
}{
"message": "The product id field is required.",
"errors": {
"product_id": ["The product id field is required."]
}
}All Matches
This route will return all matches where `page` is the pagination number.
- product_id * (string)
GET Request
Expected Response
{
"page": 1,
"total_pages": 1,
"total_products": 5,
"products_per_page": 200,
"all-matches": [
{
"match_id": 2,
"product_id": 1,
"website": "example.com",
"url": "https://www.example.com/A2",
"price": "299.99",
"client_product": {
"name": "Product 1",
"url": "https://www.product.com/1",
"brand": "Brand 1",
"category_1": "Category 1",
"category_2": "Category 2",
"tags": "Tag 1, Tag 2, Tag 3",
"status": "Avaliable",
"sell_price": "306.00",
"cost_price": "429.00"
}
},
{
"match_id": 3,
"product_id": 1,
"website": "example.com",
"url": "https://www.example.com/A3",
"price": "310.00",
"client_product": {
"name": "Product 1",
"url": "https://www.product.com/1",
"brand": "Brand 1",
"category_1": "Category 1",
"category_2": "Category 2",
"tags": "Tag 1, Tag 2, Tag 3",
"status": "Avaliable",
"sell_price": "306.00",
"cost_price": "429.00"
}
}
]
}{
"Warning": "Bad Request!",
"Missing/Invalid": "page"
}Get a Match
This route will return a match where match_id is match id that comes from the API.
- product_id * (string)
GET Request
Expected Response
{
"match": {
"match_id": 2,
"product_id": 1,
"website": "example.com",
"url": "https://www.example.com/A2",
"price": "299.99",
"client_product": {
"name": "Product 1",
"url": "https://www.product.com/1",
"brand": "Brand 1",
"category_1": "Category 1",
"category_2": "Category 2",
"tags": "Tag 1, Tag 2, Tag 3",
"status": "Avaliable",
"sell_price": "306.00",
"cost_price": "429.00"
}
}
}{
"Warning": "Bad Request!",
"Missing": "match_id"
}{
"Warning": "Not Found",
"Missing": "match_id"
}Add Match
This route will add a match. Body must contain the following fields:
- url * (string)
- product_id * (string)
POST Request
Expected Response
{
"success": true,
"message": "The match has been successfully added."
}{
"Warning": "Not Found",
"Missing/Invalid": "product_id"
}{
"message": "The product id field is required.",
"errors": {
"product_id": ["The product id field is required."]
}
}Note that products with errors in their URL cannot be matched with until the underlying issues are resolved.**
Edit Match
This route will edit a match. Body must contain the following fields:
- match_id * (integer)
- url * (string)
POST Request
Expected Response
{
"success": true,
"message": "The match has been successfully added."
}{
"message": "The match id field is required",
"errors": {
"product_id": ["The match id field is required"]
}
}Delete Match
This route will delete a match. Body must contain the following fields:
- match_id * (integer)
POST Request
Expected Response
{
"success": true,
"message": "Product deleted successfully. "
}{
"message": "The match id field is required",
"errors": {
"product_id": ["The match id field is required"]
}
}All Brands
This route will return all brands.
GET Request
Expected Response
{
"total-brands": 3,
"brands": [
{
"brand": "Brand 1"
},
{
"brand": "Brand 2"
},
{
"brand": "Brand 3"
}
]
}All Categories
This route will return all categories.
GET Request
Expected Response
{
"total-categories": 2,
"categories": [
{
"category_1": "Category 1",
"category_2": "Category 2"
},
{
"category_1": null,
"category_2": null
}
]
}