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 also follows the shopper's preferences and leaves out the products 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 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 recommendations, but some parameter names and the response format differ. The Applies to column in the parameter table and the Response section show 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 (Style ID). To pass a Variant ID, a barcode or the 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 personalized recommendations like top, not items similar to the basket contents. The department is taken from the products in the basket. Use it on basket, wishlist, or checkout pages to suggest additional items before the shopper completes the purchase.
Pass the products in the basket in ids, in the JavaScript client library as well as over HTTP. Without ids, or if none of them can be resolved, you still get recommendations.
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", {
ids: ["PC12345", "PC23456"],
garment_format: "detailed",
max_items: 8,
onSuccess: (data) => {},
onFailure: (err) => {},
});HTTP
GET https://api.your-domain.com/api/v2/items/basket?ids=PC12345,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 |
|
| Comma-separated list, for example | Identifiers of the products in the basket. These products are excluded from the recommendations, and the department is taken from them. If the list is empty or none of the identifiers can be resolved, you still get recommendations. |
|
|
| 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 results. |
|
| Comma-separated list, for example | Products to exclude from the results, in addition to the ones already excluded automatically. |
|
|
| Department the recommendations are drawn from. |
|
|
| Sorts the recommendations by price. Set the order with |
|
|
| Sort order for |
|
| 1 to 100, no filter by default | Maximum price reduction of returned items, in percent. Only works if your product data contains discount information. |
|
| UUID | Identifies the placement for reporting. The value is provided by Mapp. |
|
| Boolean, default | Whether internal Mapp Fashion identifiers are included in the response. Set to |
|
| Boolean, default | Whether a |
| 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
The JavaScript client library and direct HTTP requests return the same recommendations in different formats. The JavaScript client library adds the product data to each item and renames some fields.
JavaScript Client Library
onSuccess receives an object with the following properties:
Item type | Properties |
|---|---|
|
|
|
|
|
|
|
|
|
|
response_id is the event_id of the HTTP response. The items have one of two formats, depending on garment_format or response_format. To match items with your product data, use style_id. It is returned in both formats.
Items in the Simple Format
Field | Type | Description |
|---|---|---|
| String | Identifier of the item. It has the same type as the identifiers in the request ( |
| String | Style ID (product code). |
| Number | Internal Mapp Fashion ID. Only filled if |
| String | Product ID (product level), if your product data contains it. |
| Array | Variant IDs (SKUs) of the item that are in stock. |
Items in the Detailed Format
Field | Type | Description |
|---|---|---|
| Number | Internal Mapp Fashion ID. |
| String | Style ID (product code). |
| String | Product ID (product level), if your product data contains it. |
| String | Alternative product code. Empty if your product data does not contain it. |
| Array | Variant IDs (SKUs) of the item that are in stock. |
| String | Product name. |
| String | Brand name. |
| String | URL of the product page. |
| String | Current price. |
| String | Previous price, if the product is reduced. |
| String |
|
| Number | Mapp Fashion garment category ID. |
| String | Mapp Fashion garment category name. |
| String | URL of the main image. |
| Array | All image URLs from the product feed. |
| String | URL of the thumbnail. If there is none, the first image from the feed or the main image is used. |
| String | URL of the selected image with a model, if available. |
| String | URL of the selected product image, if available. |
| Boolean | Whether outfits are available for the item. |
Note
In the detailed format, items without product data are left out. The list can therefore contain fewer items than requested.
HTTP
The HTTP response contains event_id, garment_data, available_skus and the recommended items under one key per item type: outfits, partner_outfits, similar_items, top_items, or recommendations for basket. Item-based types also return the anchor item as source.
garment_data contains the product data and is only filled in the detailed format. available_skus lists the in-stock Variant IDs of each recommended item, keyed by garment_id.
The example below shows a similar response requested with garment_format=simple.
{
"event_id": "6a959a3a5e29c89df1d8ddbe",
"source": {
"garment_id": "PC12345",
"raw_garment_id": 5746027,
"product_id": "P123",
"ancillary_product_code": "PC123"
},
"garment_data": [],
"available_skus": [
{ "garment_id": "PC23456", "skus": ["PC23456-36", "PC23456-38"] }
],
"similar_items": {
"content_id": "6a959a3b5e29c89df1d8ddbf",
"items": [
{
"garment_id": "PC23456",
"product_id": "P234",
"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, andstoresare no longer supported.include_user_datais only available forbasket.Empty sections are omitted from the response instead of being returned as empty keys.