Content
Introduction
The Product feed API allows you to fetch, upload, edit and delete your products in real-time. It should be used together with the File Upload functionality in case more frequent updates are necessary. All default attributes are described in the Product data feed/Available properties documentation.
Versioning
The API version is defined in the header X-XNG-ApiVersion. To use the product API provide version 1.
Authentication
ActivatePro uses header authentication. To get your Master API key, please log in to the app and navigate to Settings. You will find it in the System setup -> API keys section in the Master API key value. The following is an example of the format of an authentication header:
-
X-XNG-AuthToken:1ab00011122c1234
Date Format
Dates and times are expressed in ISO8601 format in UTC (Coordinated Universal Time), with a special UTC designator ("Z") For more information please check here.
Error Handling
Following errors are possible:
401 Unauthorized access is not allowed500 Internal Server Error502 Bad gateway503 Service Unavailable504 Gateway Timeout
Resume or retry uploads that fail due to connection interruptions or any 5xx errors
How to retry requests made to ActivatePro in case of errors:
- Use an exponential backoff strategy if an export request returns a 5xx server error. These errors can occur if a server is overloaded. Exponential backoff can alleviate such problems during periods of high request volume or heavy network traffic.
- Other kinds of requests should not be handled by exponential backoff but you can still retry a number of them. When retrying these requests, limit the number of times you retry them. For example your code could limit to ten retries or less before reporting the error to our team for investigation.
Reference
Get Product Feed
URL:
GET https://api.crossengage.io/product-feed/v1/product?pageNumber=&pageSize=10
| Parameters | ||
|---|---|---|
| pageNumber | optional) the page number. Example 1. |
Number |
| pageSize |
(optional) the number of products to be returned on one page. Example Default: |
Number |
Request
Headers
Content-Type:application/json Accept:application/json
Response
200
Headers
Content-Type:application/json
Body
{
"pageNumber": 0,
"pageSize": 10,
"totalElements": 1,
"content": [
{
"id": 123,
"sku": 56874,
"businessUnit": "DE",
"title": "Data-Decision-Delivery Pillow",
"description": "Extra cozy pillow",
"link": "https://demo.crossengage.io/product/data-decision-delivery-pillow/",
"bigImageLink": "https://demo.crossengage.io/wp-content/uploads/2019/05/5586-big.jpg",
"smallImageLink": "https://demo.crossengage.io/wp-content/uploads/2019/05/5586.jpg",
"category": "Pilow",
"price": 10,
"salesPrice": 8.5,
"salesPriceEffectiveDate": "the sale will run until Friday",
"discount": "-15%",
"currency": "€",
"stockQuantity": 120,
"enabled": 1,
"attributes": {
"colour": "Black",
"material": "Plush"
},
"createdAt": "2020-01-02T16:00:03.449Z",
"updatedAt": "2020-04-21T17:00:03.449Z"
}
]
}
When requesting a list of products, you may include the pageNumber and pageSize as parameters. By default, you will fetch the first page with 10 products (displayed in Response: pageNumber 0).
Attributes in response see here.
URL:
GET https://api.crossengage.io/product-feed/v1/product/sku?businessUnit=
| Parameters | |
|---|---|
| sku | (required) the part of the product identifier. Examples 123 or LNK1230098 |
Request
Response
200
Headers
Content-Type:application/json Accept:application/json
Body
{
"id": 123,
"sku": 56874,
"businessUnit": "DE",
"title": "Data-Decision-Delivery Pillow",
"description": "Extra cozy pillow",
"link": "https://demo.crossengage.io/product/data-decision-delivery-pillow/",
"bigImageLink": "https://demo.crossengage.io/wp-content/uploads/2019/05/5586-big.jpg",
"smallImageLink": "https://demo.crossengage.io/wp-content/uploads/2019/05/5586.jpg",
"category": "Pilow",
"price": 10,
"salesPrice": 8.5,
"salesPriceEffectiveDate": "the sale will run until Friday",
"discount": "-15%",
"currency": "€",
"stockQuantity": 120,
"enabled": 1,
"attributes": {
"colour": "Black",
"material": "Plush"
},
"createdAt": "2020-01-02T16:00:03.449Z",
"updatedAt": "2020-04-21T17:00:03.449Z"
}
Get a single product by sku or sku and businessUnit
- In case, you’re using both
skuandbusinessUnitas a combined identifier for your products, please provide both of them here. - If only
skuis provided, we will look for a product with thatskuand an emptybusinessUnit.
Attributes in response see here.
Update Product Feed
URL:
PUT https://api.crossengage.io/product-feed/v1/product/sku
| Parameters | |
|---|---|
| sku | (required) the part of the product identifier. Examples 123 or LNK1230098 |
Request
Possible attributes for the update see here.
Headers
Content-Type:application/json X-XNG-ApiVersion:1 X-XNG-AuthToken:Your API Key
Body
{
"id": 123,
"sku": 56874,
"businessUnit": "DE",
"title": "Data-Decision-Delivery Pillow",
"description": "Extra cozy pillow",
"link": "https://demo.crossengage.io/product/data-decision-delivery-pillow/",
"bigImageLink": "https://demo.crossengage.io/wp-content/uploads/2019/05/5586-big.jpg",
"smallImageLink": "https://demo.crossengage.io/wp-content/uploads/2019/05/5586.jpg",
"category": "Pilow",
"price": 10,
"salesPrice": 8.5,
"salesPriceEffectiveDate": "the sale will run until Friday",
"discount": "-15%",
"currency": "€",
"stockQuantity": 120,
"enabled": 1,
"attributes": {
"colour": "Black",
"material": "Plush"
},
"createdAt": "2020-01-02T16:00:03.449Z",
"updatedAt": "2020-04-21T17:00:03.449Z"
}
Response
Update was scheduled
202
Headers
Content-Type:application/json
Body
Response
Validation error
400
Headers
Content-Type:application/json
Body
{
"message": "Input validation failed",
"key": "error.input-validation",
"args": {},
"errors": [
{
"source": "productDTO.sku",
"key": "error.constraint-violation.NotNull",
"message": "must not be null",
"args": {}
}
]
}
Response
Unsupported Media Type
415
Headers
Content-Type:application/json
Body
{
"message": "Input validation failed",
"key": "error.input-validation",
"args": {},
"errors": [
{
"source": "productDTO.sku",
"key": "error.constraint-violation.NotNull",
"message": "must not be null",
"args": {}
}
]
}
- To create a new product include
skuorskuandbusinessUnitto the JSON body. - To update information about a product include
skuorskuandbusinessUnitof that product to the JSON body. All properties will be updated, missing properties will be removed. - Custom attributes can be added as a string type to the product.
URL:
DELETE https://api.crossengage.io/product-feed/v1/product/sku?businessUnit=
| Parameters | ||
|---|---|---|
| sku | (required) a part of the product identifier. Examples 123 or LNK1230098
|
String |
| businessUnit | (optional) will be used as a part of the product identifier together with ‘sku’ when provided. Example DE
|
String |
Request
Response
Product deletion was scheduled
202
Headers
Content-Type:application/json
Delete a single product by sku or sku and businessUnit
- A product will be deleted if
skuorskuandbusinessUnitmatch a product in the system.
Attributes
Product data. The unique identifier for the product is a combination of sku and businessUnit. sku is the only required field. businessUnit is optional. Additional fields, not present in the current specification, may be added. There is only one limitation - those fields should be of string type.
| Attributes | ||
|---|---|---|
| id | Original product id. | String |
|
sku
required
|
Product SKU.
|
String |
| businessUnit | Product business unit.
|
String |
| title |
A product's title. Data-Decision-Delivery Pillow |
String |
| description |
A product's description. Extra cozy pillow |
String |
| link |
Absolute URL to a product's page. https://demo.crossengage.io/product/data-decision-delivery-pillow/ |
String |
| bigImageLink |
Absolute URL to a product's larger image. https://demo.crossengage.io/wp-content/uploads/2019/05/5586-big.jpg |
String |
| smallImageLink |
Absolute URL to a product's thumbnail image. https://demo.crossengage.io/wp-content/uploads/2019/05/5586.jpg |
String |
| price |
The price of the product without currency.
10 |
Number |
| salesPrice |
The advertised sale price of the product.
8.5 |
Number |
| salesPriceEffectiveDate | the sale will run until Friday | String |
| discount |
The difference between the original price and the discounted price (if set). e.g -15% |
String |
| currency |
The currency of the prices. € |
String |
| stockQuantity |
The number of items in stock.
120 |
Number |
| enabled |
Represents whether or not the product can be used in marketing communications.
1 |
Number |
| attributes | An object representing additional product attributes not covered by the default set. All additional attributes must be written in camel-сase format. e.g. { "colour":"Black", "material":"Plush" }
|
Object |
| createdAt |
The timestamp of when the product was created, this cannot be edited
2020-01-02T16:00:03.449Z |
String |
| updatedAt |
The timestamp of when the product was updated, this cannot be edited
2020-04-21T17:00:03.449Z |
String |