Skip to main content

Submitting Data Feeds

There are three ways of submitting feeds to PureClarity:
  • Via a HTTP POST request to /api/productfeed to PureClarity, passing the URL where PureClarity can download it.
  • Securely submitting a feed via SFTP.
  • Securely streaming feeds as batches to PureClarity via HTTPS
  • Once a feed has been submitted you can see the progress of processing under Settings > Feed Management in the PureClarity Admin console.
Below details the 3 ways of submitting a data feed.

Submitting Via HTTPS

You can make a HTTPS POST request to the PureClarity endpoint /api/productfeed passing the URL where PureClarity can download a full JSON feed as part of the body. The productfeed API reference details this endpoint.

Submitting Using SFTP

You can submit feeds securely via SFTP. Endpoints are region specific and are as follows:
RegionEndpointPort
EUsftp-eu-w-1.pureclarity.net2222
USsftp-us-e-1.pureclarity.net2222
To authenticate, the username is your store view Access Key and the password is the Secret Key. These can be found in the Admin console under My Account > Integrations.
Ensure that the Secret Key is never revealed.
Once a feed has been submitted you can see the progress as PureClarity processes the feed under Settings > Feed Management in the PureClarity Admin console.

Submitting Using HTTP Stream Requests

For systems that cannot submit using an SFTP server PureClarity can receive feeds via multiple HTTP requests. Using this API you can send the feed in multiple API calls to build up a complete JSON object inside of PureClarity. This is done by appending strings to a remote file on the PureClarity server. You first send a create command with an opening JSON bracket, followed by an append command building up the items, finishing with a close command and appending a close JSON bracket. Once the close command is received PureClarity will begin processing the feed. The three endpoints are as follows:
  • https://<region-domain>/feed-create
  • https://<region-domain>/feed-append
  • https://<region-domain>/feed-close
The <region-domain> for the streaming API uses HTTPS and is as follows:
RegionEndpointPort
EUsftp-eu-w-1.pureclarity.net443
USsftp-us-e-1.pureclarity.net443
Each request must be a HTTPS POST request.
Each of the three calls should contain a JSON body with the following 4 properties:
PropertyDescription
accessKeyThe store view Access Key.
secretKeyThe store view Secret Key.
feedNameA unique identifier for the feed. This should be the same for each of the 3 calls.
payLoadThe next part of the string that builds up the feed file.
payLoad is a string, NOT a JSON object

Start of feed: /feed-create

This indicates to PureClarity that a new feed is being sent. You should include the start of the feed in the payLoad if required. Typically you would send over the opening brace of the JSON feed in the payLoad along with the start of property array that will hold the items. For example: "{"
This is a string that is being sent, and not a JSON object.
If you send another request to feed-create before you have completed a feed with an existing feedName it will be reset to the contents of the new payLoad and previous appends will be overwritten.

Data in the feed: /feed-append

Use consecutive calls to the append endpoint to send parts of the feed, such as the header for the item array, followed by multiple calls containing the items, followed by another call to end the array. For example, the header for a products feed may look like: "Products": [" Then the addition of products: {"Id":"prod123","Title":"A sample product","Prices":["3.99 GBP","4.99 USD"]},
Take care to ensure commas are not appended to the last item. Remember these strings are appending to a file on the server to generate valid JSON.
Finally you need to close this section of the feed: "]"
You can repeat the above to include other sections for the feed if required (i.e. categories and brands) although these can also be sent as separate feeds.
The details of what data to send for the various feeds is discussed in the feed documentation overview.

End of feed: /feed-close

Use this call once you are ready to submit the feed to PureClarity for processing. You can include the final part of the feed in the request if required. Once PureClarity has received this it will process the file. Typically you would send over the closing brace of the JSON feed in the payLoad: "}"