Overview
This page describes how to retrieve Mapp Fashion recommendation items from your website or frontend.
Five item types are available. Three of them start from a specific product, for example on a product detail page. top needs no product at all and follows the shopper's preferences. basket starts from the products currently in the basket.
For what outfits are and how they are assembled, see How outfits work in the Integration Overview.
Note
The JavaScript calls described on this page require Integrated Tracking with the Mapp Fashion extension for the Mapp Intelligence Smart Pixel. They are not available in a Standalone Tracking setup.
Key facts
Retrieves recommendation content only; no tracking is performed on retrieval
Interaction tracking is handled separately via Recommendation Tracking
Each item type has its own call and its own endpoint
Item order and grouping must be preserved for correct interaction tracking
Typically used in PDP implementations, basket pages, landing pages, or headless frontends
Available Item Types
Choose the item type that matches the page you are building.
Item type | Typical use | Starting point | Endpoint |
|---|---|---|---|
| Complete looks built around a product, on the product detail page | Anchor item |
|
| Outfits you supplied yourself, such as campaign or editorial looks | Anchor item |
|
| Alternatives to the product a shopper is viewing | Anchor item |
|
| Personalized entry points such as homepages and landing pages | Shopper profile |
|
| Add-on suggestions on basket, wishlist, or checkout pages | Basket contents |
|
Note
Outfits, partner outfits, and similar items always require a valid anchor item. There is no fallback logic: an identifier that Mapp Fashion does not recognize results in an empty or irrelevant response.
Retrieval Approaches
Recommendation items can be retrieved in two ways. Both return the same content, but the parameter names differ in places, and the basket contents are handled differently. The Applies to column in the parameter table shows where.
JavaScript client library
Use this approach when recommendations are rendered client-side and Integrated Tracking is in place. The Smart Pixel handles the request, the shopper context, and the response.
Direct HTTP requests
Use this approach for server-side rendering, headless setups, or backend integrations. All request properties are passed as query parameters.
Note
The exact domain depends on your Mapp Fashion environment. A separate host is configured per partner.
Outfits
Returns complete looks built around a single product. Use it on product detail pages to show how an item can be worn.
Outfits are grouped by occasion. The anchor item is excluded from the returned outfits by default.
Identifiers are interpreted as product codes. To pass an SKU, EAN, GTIN, or internal Mapp Fashion identifier, set identifier_type as well.
JavaScript
wtSmart.extension.fashion.call("items", "outfits", {
item_id: "YOUR_PRODUCT_CODE",
placement_id: "A_UUID_PROVIDED_BY_MAPP",
response_format: "detailed",
onSuccess: (data) => {},
onFailure: (err) => {},
});HTTP
GET https://api.your-domain.com/api/v2/items/outfits?id=PC12345&garment_format=detailedPartner Outfits
Returns outfits that you supplied yourself instead of outfits generated by Mapp Fashion. Use it when you want full control over specific looks, such as campaign or editorial styling.
Partner outfits are not assigned to an occasion, and outfits_per_occasion has no effect on them. How many outfits are returned depends on the looks you supplied. As with outfits, the anchor item is excluded by default.
JavaScript
wtSmart.extension.fashion.call("items", "partner_outfits", {
item_id: "YOUR_PRODUCT_CODE",
placement_id: "A_UUID_PROVIDED_BY_MAPP",
response_format: "detailed",
onSuccess: (data) => {},
onFailure: (err) => {},
});HTTP
GET https://api.your-domain.com/api/v2/items/partner_outfits?id=PC12345&garment_format=detailedSimilar Items
Returns products that are comparable to the product a shopper is viewing. Use it to offer alternatives when an item is not the right fit, is out of stock, or is outside the shopper's price range.
JavaScript
wtSmart.extension.fashion.call("items", "similar", {
item_id: "YOUR_PRODUCT_CODE",
placement_id: "A_UUID_PROVIDED_BY_MAPP",
response_format: "detailed",
onSuccess: (data) => {},
onFailure: (err) => {},
});HTTP
GET https://api.your-domain.com/api/v2/items/similar?id=PC12345&garment_format=detailedTop Items
Returns personalized recommendations without a starting product. Use it early in the customer journey, before a shopper reaches a product detail page, for example on the homepage or at the top of a product listing page.
Recommendations are based on how likely a shopper is to buy items with particular attributes, not on the products they viewed most recently. For shoppers with no history, the call returns broadly relevant top products, so it can be used for new and anonymous visitors as well.
Without department, recommendations are drawn from the female department. Set the value explicitly to match the page.
JavaScript
wtSmart.extension.fashion.call("items", "top", {
department: "female",
garment_format: "detailed",
max_items: 8,
onSuccess: (data) => {},
onFailure: (err) => {},
});HTTP
GET https://api.your-domain.com/api/v2/items/top?department=female&max_items=8&garment_format=detailedBasket Items
Returns recommendations for the products currently in a shopper's basket. Use it on basket, wishlist, or checkout pages to suggest additional items before the shopper completes the purchase.
In the JavaScript client library you do not pass any product codes. The basket contents are taken from the product data that the Mapp Fashion extension already collects, so product tracking must be in place on the basket page. When you call the endpoint directly over HTTP, pass the basket products in the ids parameter.
Products that are in the basket are removed from the recommendations, so shoppers never see items they have already added.
Note
A maximum of 10 basket products is taken into account. This is the input limit and is independent of
max_items, which controls how many recommendations are returned.
JavaScript
wtSmart.extension.fashion.call("items", "basket", {
garment_format: "detailed",
max_items: 8,
onSuccess: (data) => {},
onFailure: (err) => {},
});HTTP
GET https://api.your-domain.com/api/v2/items/basket?ids=PC12345&ids=PC23456&garment_format=detailedRequest Parameters
The following parameters control which content is returned and how items are represented in the response. Not every parameter applies to every item type.
Parameter | Applies to | Values and default | Description |
|---|---|---|---|
|
| String | Required. Identifier of the anchor item. Its interpretation is controlled by |
|
| Repeated query parameter, maximum 10 values | Required for direct HTTP calls. Identifiers of the products in the basket. These products are excluded from the recommendations. In the JavaScript client library the basket contents come from the tracking data and are not passed to the call. |
|
|
| Controls how the identifiers are interpreted: |
| All |
| Format of the returned item data. |
|
| 1 to 20, default 6 | Number of items to return. |
|
| 1 to 4, default 2 | Number of outfits to return per occasion. |
|
| Boolean, default | Whether the anchor item is removed from the returned outfits. |
|
| Repeated query parameter, for example | Products to exclude from the results, in addition to the ones already excluded automatically. |
|
|
| Department the recommendations are drawn from. |
|
| 1 to 100, no filter by default | Maximum price reduction of returned items, in percent. |
|
| UUID | Identifies the placement for reporting. The value is provided by Mapp. |
| All | Boolean, default | Whether internal Mapp Fashion identifiers are included in the response. |
| All | String, for example | Restricts results to this locale, if provided in the feed. |
| All | String, for example | Localizes the response to this language, if provided in the feed. |
| All (JavaScript only) | Callback | Called with the response data. |
| All (JavaScript only) | Callback | Called when the request fails. |
Note
Additional parameters are passed through directly as query parameters, even if they are not listed in the client configuration.
Response
Every response contains an event identifier, the recommended items, and a garment_data section. With garment_format set to simple, garment_data stays empty and only the item identifiers are returned. Request detailed when you render product cards and need names, prices, and images.
The example below shows a similar response requested with garment_format=simple.
{
"event_id": "6a959a3a5e29c89df1d8ddbe",
"source": {
"garment_id": "PC12345",
"ancillary_product_code": "PC123"
},
"garment_data": [],
"similar_items": {
"content_id": "6a959a3b5e29c89df1d8ddbf",
"items": [
{
"garment_id": "PC23456",
"ancillary_product_code": "PC234"
}
]
}
}Outfit responses are structured as groups of items instead of a flat list. For the full response schema of each item type, see the Mapp Fashion API documentation.
Note
The
content_idof a returned set is required for Recommendation Tracking. Keep the items in the order in which they were returned.
Migrating from the Combined Call
Earlier integrations retrieved outfits, partner outfits, and similar items in a single call that used a methods parameter:
wtSmart.extension.fashion.call("related", "items", {
item_id: "YOUR_PRODUCT_CODE",
methods: ["outfits", "partner_outfits", "similar_items"],
try_all_methods: true,
onSuccess: (data) => {},
onFailure: (err) => {},
});This call still works. Internally it is split into one request per method, so it offers no performance benefit over calling the item types individually. New integrations should use the individual calls described on this page.
When migrating, note the following changes:
The call is now
call("items", "<item type>", { … })instead ofcall("related", "items", { … }), with one item type per call. The former methods correspond to today's item types, andsimilar_itemsis now calledsimilar.The parameters
methodsandtry_all_methodsno longer exist.max_similar_itemsis now calledmax_items.include_dressipi_idsis now calledinclude_fashion_ids, and its default changed fromtruetofalse.The default of
garment_formatchanged fromdetailedtosimple. If you render product cards, setdetailedexplicitly.garment_formatacceptssimpleanddetailed. The former valueretailer_idscorresponds tosimple;documentis no longer available.Without
identifier_type, identifiers are now interpreted as product codes. Previously the internal Mapp Fashion identifier was assumed. To keep sending internal identifiers, setidentifier_typetofashion-id.identifier_typeno longer acceptsdressipi-idandancillary-product-code. Usefashion-idinstead ofdressipi-id.The parameters
sku_refinement,fields,stores, andinclude_user_dataare no longer supported.Empty sections are omitted from the response instead of being returned as empty keys.