SPI Product Recommendations

Create Product Recommendations

post /product-recommendations

Make query to create product recommendations for a single product.

PARAMETERS
Store-ID
string
header

ID of the store (Sitoo clients will send the externalid property of the store object in Sitoo).

Staff-ID
string
header

ID of the staff (Sitoo clients will send the externalid property of the user object in Sitoo).

Register-ID
string
header

ID of the register.

Request-ID
string
header

ID of the request.

REQUEST BODY
object
REQUIRED

The product recommendations object

ProductRecommendations
Returns

Successful. Returns a ProductRecommendations object.

posthttps://recommendations.example.com/product-recommendations
{
"id": "123e4567-e89b-12d3-a456-426614174000",
"sku": "234.788.14",
"crm_channel_id": "custom-crm",
"customer_id": "123456789"
}
RESPONSE JSON
{
"id": "123e4567-e89b-12d3-a456-426614174000",
"sku": "234.788.14",
"recommendations": {
"similar": [
"234.788.15",
"234.788.16"
],
"related": [],
"accessories": [
"234.500.01",
"234.500.02",
"234.500.03"
]
}
}
HTTP Status Code Summary
201Successful. Returns a ProductRecommendations object.
400Invalid request. Data sent from client is invalid.
401Missing or bad authentication.
403User is not authorized to perform operation.
500Internal Server Error.
502Bad Gateway.

Objects

ProductRecommendations
object

The object containing the SKU for the product that should get recommendations. If applicable, user information can also be part of the request object.

PROPERTIES
id
string
REQUIRED

An identifier for the product recommendations request (that together with the SKU can be the basis for caching the request). Sitoo POS will send the current cart ID for this field.

Max Length: 128
Min Length: 1
sku
string
REQUIRED

Stock Keeping Unit (SKU) for the product that should get recommendations.

Max Length: 128
crm_channel_id
string
WRITE ONLY

The ID for the CRM channel that the customer belongs to.

customer_id
string
WRITE ONLY

The ID for the customer associated with the purchase.

recommendations
READ ONLY
REQUIRED

Recommendations
object

Object holding the different types of recommendation arrays

PROPERTIES
similar
array
(string)
REQUIRED

An array of similar products

related
array
(string)
REQUIRED

An array of related products

accessories
array
(string)
REQUIRED

An array of accessory products

ErrorCode
string

Error code describing the data and depending on value, the error_data property will contain the following additional information:

Error codeAdditional info
field-missingfield
field-unknownfield
field-readonlyfield
field-typefield
field-validationfield
version-invalidnone
condition-failednone
othernone

Example: "field-missing"

ErrorMessage
object

Error object returned when a request is not successful.

PROPERTIES
request_id
string
REQUIRED

ID of request.

Example: ""123e4567-e89b-12d3-a456-426614174000""
error_code
REQUIRED

The error code returned.

error_data
object
REQUIRED

A string map with fields depending on the error_code. The field message is always available.

<*>
string