Deltas
In addition to the full feeds PureClarity accepts changes to individual records. Individual records can be added, deleted and existing ones updated. The delta API endpoint allow you to send these updates. Data is sent in the same structure as the full feed references.
The following records can be sent as deltas:
Note that when a delta is pushed to PureClarity they are queued for processing. Each API call will return a token that can then be used to query the status of the delta via the delta status endpoint.
Submit delta endpoint
The maximum size of a single delta is 250 Kb. A delta API call can contain multiple updates so long as the total size of the delta is under 250 Kb. The HTTPS POST will reject the delta with an error code if the delta is too large.
For product updates the delta will overwrite the product so they must contain the full product information rather than a partial update.
The endpoint for the HTTPS POST deltas is:
https://<region-domain>/api/delta
| Region | Endpoint |
| EU | sftp-eu-w-1.pureclarity.net |
| US | sftp-us-e-1.pureclarity.net |
The body of the HTTPS POST should be a JSON object and look like the following:
{
"AppKey": <string>,
"SecretKey": <string>,
"Products": [ {<productdata>} ],
"DeleteProducts": [<string>,<string>],
"SetCategoryOnProducts": [ { <categoryOnProductd>} ],
"RemoveCategoryFromProducts": [ { <removeCategoryFromProduct>} ],
"AccountPrices": [ {<accountprices>} ],
"DeleteAccountPrices": [ {<deleteAccountPrice>} ],
"Users": [ {<userdata>} ]
}
See the relevant references in this guide for the data structures for Products, Categories, Users and Account Prices. DeleteProducts is an array of product identifiers (e.g. Id). Examples of category deltas and DeleteAccountPrice deltas are detailed below..
The request will return a status of 200 if successfully added to the queue of deltas to process, and will return the following JSON object:
{
"Token": "deltatoken123"
}
Query deltas status endpoint
To query the status of deltas send a HTTPS POST to the following endpoint:
https://<region-domain>/api/deltastatus
The body of the request should contain an array of tokens for which the status is required:
{
"AppKey": "appkey123",
"SecretKey": "secretkey123",
"Tokens": [ "deltatoken123", "delta567" ],
}
This will return a JSON object containing an array, where each entry contains the status of a token requested:
[
{
"Token": "deltatoken123",
"Status": 2,
"Reason": "Missing price" //Present if Status is 2 (Error)
}, ...
]
The following table lists the possible status codes:
| Status | Description |
| 0 | Pending. The delta has not been processed yet. |
| 1 | Success. The delta was applied successfully. |
| 2 | Error. The delta failed. The property “Reason” will indicate why. |
Examples
Category deltas
{
"AppKey": "appkey",
"SecretKey": "secretkey",
"SetCategoryOnProducts": [
{
"Category": "catid1",
"Products": [
{ "Id": "prod1" }
]
}
],
"RemoveCategoryFromProducts": [
{
"Category": "catid2",
"Products": [
{ "Id": "prod1" },
]
}
]
}
Delete account price deltas
{
"AppKey": "appkey",
"SecretKey": "secretkey",
"DeleteAccountPrices": [{"AccountId": "account1", "Id": "prod1"}]
}