Feed wishlisty
Feed wishlisty jest opcjonalnym dodatkowym sygnałem dla silnika rekomendacji. Produkty, które użytkownik dodał do wishlisty, wyrażają intencję zakupową i poprawiają personalizację rekomendacji użytkownika dla tego użytkownika.
Żądanie
Wishlistę przesyła się żądaniem PUT do następującego endpointu:
PUT {{OpenAppUrl}}/merchant/v1/recommendations/wishlist
Ciało żądania zawiera pełną aktualną wishlistę jednego użytkownika i zastępuje wcześniej zapisaną wishlistę tego użytkownika. Żądanie należy wysłać każdorazowo, gdy wishlistę zmieni; należy przesłać pustą tablicę products, gdy użytkownik wyczyści wishlistę.
- Żądanie
- Schemat
{
"loggedUser": "user-id-from-webshop",
"updatedAt": "2026-06-10T09:12:00.000Z",
"products": [
{
"id": "id123-red",
"ean": "5901234123457",
"createdAt": "2026-06-01T20:44:00.000Z"
},
{
"id": "id123-blue",
"ean": "5901234123471",
"createdAt": "2026-06-10T09:12:00.000Z"
}
]
}
loggedUserstringWymaganeThe merchant's own stable identifier for the user. Must be consistent with the loggedUser sent in the order feed.
maxLength: 255
updatedAtstringWymaganeThe moment the wishlist was last changed in the merchant system. OpenApp ignores snapshots older than the one already stored.
format: date-time
productstablica typu WishlistProductWymaganeThe full current content of the wishlist. The snapshot replaces the previously stored wishlist; an empty array clears it.
maxItems: 500
Pokaż parametry podrzędneUkryj parametry podrzędne3
idstringWymaganeThe catalogue variant ID of the product.
maxLength: 36
eanstringOpcjonalneThe ean (or other barcode) of the product.
maxLength: 36
createdAtstringOpcjonalneThe moment the product was added to the wishlist.
format: date-time
Surowy schemat JSON
{
"description": "Full snapshot of a single user's wishlist fed by the merchant into the OpenApp recommendation engine",
"additionalProperties": false,
"type": "object",
"properties": {
"loggedUser": {
"description": "The merchant's own stable identifier for the user. Must be consistent with the loggedUser sent in the order feed.",
"maxLength": 255,
"type": "string",
"title": "loggedUser"
},
"updatedAt": {
"description": "The moment the wishlist was last changed in the merchant system. OpenApp ignores snapshots older than the one already stored.",
"format": "date-time",
"type": "string",
"title": "updatedAt"
},
"products": {
"description": "The full current content of the wishlist. The snapshot replaces the previously stored wishlist; an empty array clears it.",
"maxItems": 500,
"type": "array",
"items": {
"$ref": "#/definitions/WishlistProduct"
},
"title": "products"
}
},
"required": [
"loggedUser",
"products",
"updatedAt"
],
"definitions": {
"WishlistProduct": {
"title": "WishlistProduct",
"type": "object",
"properties": {
"id": {
"description": "The catalogue variant ID of the product.",
"maxLength": 36,
"type": "string",
"title": "id"
},
"ean": {
"description": "The ean (or other barcode) of the product.",
"maxLength": 36,
"type": "string",
"title": "ean"
},
"createdAt": {
"description": "The moment the product was added to the wishlist.",
"format": "date-time",
"type": "string",
"title": "createdAt"
}
},
"required": [
"id"
]
}
},
"$schema": "http://json-schema.org/draft-07/schema#"
}
Pole updatedAt zabezpiecza przed dostarczeniem wiadomości w złej kolejności: OpenApp ignoruje snapshot starszy niż ten, który już przechowuje dla danego użytkownika.
loggedUser jest obowiązkowy. Jest to własny, stabilny identyfikator użytkownika merchanta i musi być spójny z loggedUser wysyłanym w feedzie zamówień.
Wpisy wishlisty, których id nie jest znany jako wariant katalogu, są po cichu ignorowane. Ponieważ feed używa semantyki snapshotów, zostaną automatycznie uwzględnione przy następnym wysłaniu snapshocie po zakończeniu następnej synchronizacji katalogu.
Odpowiedź
OpenApp potwierdza aktualizację odpowiedzią 200 OK z pustym ciałem.
Błędy
| Nazwa błędu | Kod |
|---|---|
WishlistValidationException | 400 |
TooManyProductsException | 413 |