This topic helps you import your Product Feed via our HTTP API.
Why You May Need HTTP API for Product Feed Import
There are situations when the XML Product Feed option is unavailable:
- Too many items in your database (over 200,000)
- New arrivals come often and in small batches, which consistently results in "out of stock" pages for these lots after a short time. In this situation, importing every time a complete product feed with hundreds of thousands of items to update a few hundred is a waste a traffic and server resources.
- You need to constantly monitor your products (more often than once every 3 hours)
For the situations like these, we have developed a proper solution – HTTP API.
For the user of REES46 Niche Solutions: HTTP API supports a limited number of additional parameters (unlike the XML option), which may cause a poorer performance of the Niche Solution algorithms.
Product feed import via HTTP API requires the following preparatory actions:
- Import info about your available categories
- Import info about location of your outlets/pick-up points
Also note that by default unauthorized HTTP request are rejected by our servers.
To use the HTTP requests feature, please first contact us at email@example.com, so we can whitelist your account.
Types of HTTP Requests
Our API supports the the following types:
|Operation||HTTP Request Type||Description|
|Overwrite||POST||Rewrite the database removing all previously imported records and adding new items|
|Add||PUT||Update the database adding new items (no rewriting)|
|Sync||PATCH||Sync product availability status|
|Remove||DELETE||Remove selected items from the database (mark the selected items as "out of stock")|
In the situation lacking a technical feasibility to send DELETE, PATCH and PUT requests, use POST requests and add to the JSON-body a variable method with the corresponding value in the upper case.
Examples: method = PUT, method = PATCH, method = DELETE.
The requests are made through POST/PATCH/PUT/DELETE requests to http://api.rees46.com/import/products
Include into the request the following header:
The data is sent in the form of a JSON-string (the body of the request).
- API REES46 server receives the initial request
- The server verifies your access using your unique keys (variables
shop_secretstanding for your Store Key and Secret Key from your Store Settings).
Note that if the
shop_secretvalues do not correlate with existing in our database, the server returns a
400 Bad requesterror.
- Upon a successful verification, the server sends the task to the processing queue.
- To inform your about it, the server returns you a
204 No bodynotification.
- When the task is successfully processed, you can see the renewed numbers in your REES46 account: on the Product Feed widget and the Product Catalog page.
- In case of a failure in processing, you get a notification email to the address you specified in your Store Settings on rees46.com.
Note that all keys are case-sensitive.
Data Array Syntax
items is an array of JSON objects containing details of the imported items.
For a full list available details, consider this example of a JSON object:
A JSON object example for the users of REES46 Apparel & Accessories Niche Solution (code
fashion; for more information on this topic, address the Apparel & Accessories section):
A JSON object example for the users of REES46 Cosmetics & Perfumes Niche Solution (code
cosmetic; for more information on this topic, address the Cosmetics & Perfumes section):
The object "Geographic location and price" 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.
All the locations not specified in the object (variable
locations) will show the "out of stock" status for the given product.
Advanced Request Example
Consider this advanced request example for a better understanding of the structure:
DELETE Request Syntax
To remove an item from the REES46 database, specify the IDs of selected items in a DELETE request:
PATCH Request Syntax
Syncing product availability statuses via a PATCH request, list the IDs of the items you want to mark as available. All the items in the database that are not listed in a PATCH request will be marked as out of stock:
Please no more than 5000 items per request.
- No labels