---
title: "Returns the items best matching given ingredients."
url: "https://developer-qual.migros.ch/apis/unified-customer-item-recommender-api-2/versions/06e8ba18-fa54-477e-8cbf-510ade75454a/operations/m_recsys.service.recommendations_api.post_ingredients"
---

> Full API specification: https://developer-qual.migros.ch/apis/unified-customer-item-recommender-api-2/versions/06e8ba18-fa54-477e-8cbf-510ade75454a.md

# Returns the items best matching given ingredients.

`POST` `/migros/customers/v1/recommender/ingredients/{domain_id}`

Operation ID: `m_recsys.service.recommendations_api.post_ingredients`

Per ingredient, the item Id with the highest number of transactions within the last twelve months is returned, if no customer id is given. If a customer id is given, and this customer id has purchased any of the items from the ingredient within the last 180 days, the item with the most transactions is returned. Failures are signaled via the *warnings* property of the response.

## Path parameters

- `domain_id` (string, required)

## Query parameters

- `customer_id` (string, optional)
- `include_exclusive_migros_online_products` (boolean, optional) - Whether or not products only sold by Migros Online should be included in results

## Request body (required)

Content types: `application/json`

## Responses

- `200` - OK
- `401` - Unauthorized
- `403` - Forbidden
- `404` - Unknown domain, unknown customer, or unknown item

## OpenAPI definition

```yaml
openapi: 3.0.1
info:
  title: Unified Customer-Item Recommender API
  version: 2.0.0.dev0
servers:
  - description: URL of upstream
    url: https://qual-unified-recommender.service.migros.cloud
paths:
  /migros/customers/v1/recommender/ingredients/{domain_id}:
    post:
      description: >-
        Per ingredient, the item Id with the highest number of transactions
        within the last twelve months is returned, if no customer id is given.

        If a customer id is given, and this customer id has purchased any of the
        items from the ingredient within the last 180 days, the item with the
        most transactions is returned.

        Failures are signaled via the *warnings* property of the response.
      operationId: m_recsys.service.recommendations_api.post_ingredients
      parameters:
        - in: path
          name: domain_id
          required: true
          schema:
            default: Cumulus
            type: string
        - in: query
          name: customer_id
          required: false
          schema:
            $ref: "#/components/schemas/Customer"
        - description: Whether or not products only sold by Migros Online should be
            included in results
          in: query
          name: include_exclusive_migros_online_products
          required: false
          schema:
            default: false
            type: boolean
      requestBody:
        content:
          application/json:
            schema:
              properties:
                ingredients:
                  items:
                    properties:
                      ingredient_id:
                        type: string
                      item_ids:
                        items:
                          $ref: "#/components/schemas/Item"
                        type: array
                    type: object
                  type: array
              type: object
        description: Ingredient scoring request
        required: true
      responses:
        "200":
          content:
            application/json:
              schema:
                properties:
                  data:
                    items:
                      properties:
                        ingredient_id:
                          type: string
                        item_id:
                          $ref: "#/components/schemas/Item"
                      type: object
                    type: array
                  reference_date:
                    example: 2022-04-01T00:00:00Z
                    format: date-time
                    type: string
                type: object
          description: OK
        "401":
          description: Unauthorized
        "403":
          description: Forbidden
        "404":
          description: Unknown domain, unknown customer, or unknown item
      security:
        - apiKeyAuth: []
      summary: Returns the items best matching given ingredients.
      tags:
        - Online
security:
  - apiKeyAuth: []
components:
  schemas:
    Customer:
      description: e.g. CumulusID, PersonenID or pseudonymized version thereof
      example: 2099XXXXXXX
      pattern: ^[a-zA-Z0-9-]+$
      type: string
    Item:
      description: Migros ArtikelID
      example: "110136400000"
      pattern: ^[a-zA-Z0-9=]+$
      type: string
  securitySchemes:
    apiKeyAuth:
      in: header
      name: X-API-Key
      type: apiKey
      x-apikeyInfoFunc: m_recsys.service.key_auth.check_api_key
```
