---
title: "Returns the items with the highest purchase probability-based scores for a customer."
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.get_customer_item_predictions"
---

> 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 with the highest purchase probability-based scores for a customer.

`GET` `/migros/customers/v1/recommender/customeritempredictions/{domain_id}/{customer_id}`

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

Returns scores based on purchase probabilities for the next seven days from the instant the query is executed. If a customer has opted out from profiling and/or has no transactions, scores for popular items are returned as a fallback. API consumers are notified about non-personalized scores i.e. popular items via HTTP response header.

## Path parameters

- `domain_id` (string, required)
- `customer_id` (string, required)

## Query parameters

- `limit` (integer, optional) - Number of items. May return less than requested items.
- `newness` (string, optional) - Select whether to return only items not bought in the last twelve months, items bought in the last twelve months, or all items.
- `items_list` (string, optional) - Comma separated list of up to 50 item IDs. If provided, only items contained in item_list will be returned.
- `items_blacklist` (string, optional) - Comma separated list of up to 50 item IDs. If provided, items contained in items_blacklist will not be returned.
- `items_range` (string, optional) - Select which items will be scored: all or only currently promoted items.

## Responses

- `200` - OK
- `401` - Unauthenticated
- `403` - Forbidden
- `404` - Unknown domain or unknown customer

## 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/customeritempredictions/{domain_id}/{customer_id}:
    get:
      description: >-
        Returns scores based on purchase probabilities for the next seven days
        from the instant the query is executed.

        If a customer has opted out from profiling and/or has no transactions,
        scores for popular items are returned as a fallback. API consumers are
        notified about non-personalized scores i.e. popular items via HTTP
        response header.
      operationId: m_recsys.service.recommendations_api.get_customer_item_predictions
      parameters:
        - in: path
          name: domain_id
          required: true
          schema:
            default: Cumulus
            type: string
        - in: path
          name: customer_id
          required: true
          schema:
            $ref: "#/components/schemas/Customer"
        - description: Number of items. May return less than requested items.
          in: query
          name: limit
          schema:
            default: 10
            maximum: 300
            minimum: 1
            type: integer
        - description: Select whether to return only items not bought in the last twelve
            months, items bought in the last twelve months, or all items.
          in: query
          name: newness
          required: false
          schema:
            default: all
            enum:
              - all
              - not_bought
              - bought
            type: string
        - description: Comma separated list of up to 50 item IDs. If provided, only items
            contained in item_list will be returned.
          in: query
          name: items_list
          required: false
          schema:
            pattern: ^[a-zA-Z0-9]+(,[a-zA-Z0-9]+){0,49}$
            type: string
        - description: Comma separated list of up to 50 item IDs. If provided, items
            contained in items_blacklist will not be returned.
          in: query
          name: items_blacklist
          required: false
          schema:
            pattern: ^[a-zA-Z0-9]+(,[a-zA-Z0-9]+){0,49}$
            type: string
        - description: "Select which items will be scored: all or only currently promoted
            items."
          in: query
          name: items_range
          required: false
          schema:
            default: all
            enum:
              - all
              - promoted
            type: string
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ItemScores"
          description: OK
        "401":
          description: Unauthenticated
        "403":
          description: Forbidden
        "404":
          description: Unknown domain or unknown customer
      security:
        - apiKeyAuth: []
      summary: Returns the items with the highest purchase probability-based scores
        for a customer.
      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
    ItemScores:
      items:
        properties:
          item_id:
            $ref: "#/components/schemas/Item"
          score:
            $ref: "#/components/schemas/Score"
        type: object
      type: array
    Item:
      description: Migros ArtikelID
      example: "110136400000"
      pattern: ^[a-zA-Z0-9=]+$
      type: string
    Score:
      description: Depending on context, a score relates to a 7-day purchase
        probability or is just a ranking.
      format: float
      maximum: 1
      minimum: 0
      type: number
  securitySchemes:
    apiKeyAuth:
      in: header
      name: X-API-Key
      type: apiKey
      x-apikeyInfoFunc: m_recsys.service.key_auth.check_api_key
```
