Recommendations

Recommendations are key to providing personalized suggestions for your customers based on their behavior, preferences, and other data. On this page, we’ll dive into the different recommendations endpoints you can use to manage recommendations programmatically. We'll look at how to query, create, update, and delete recommendation records.

The recommendation model

The recommendation model contains all the information related to a recommendation, including the type of recommendation, details, and relevance.

Properties

  • Name
    id
    Type
    string
    Description

    Unique identifier for the recommendation record.

  • Name
    customer_id
    Type
    string
    Description

    Unique identifier for the customer.

  • Name
    recommendation_type
    Type
    string
    Description

    Type of recommendation (e.g., product, service).

  • Name
    details
    Type
    object
    Description

    Details of the recommendation.

  • Name
    relevance_score
    Type
    number
    Description

    Relevance score of the recommendation.

  • Name
    created_at
    Type
    timestamp
    Description

    Timestamp of when the recommendation record was created.

  • Name
    updated_at
    Type
    timestamp
    Description

    Timestamp of when the recommendation record was last updated.


GET/v1/recommendations

List all recommendations

This endpoint allows you to retrieve a paginated list of all your recommendation records. By default, a maximum of ten records are shown per page.

Optional attributes

  • Name
    limit
    Type
    integer
    Description

    Limit the number of recommendation records returned.

  • Name
    customer_id
    Type
    string
    Description

    Only show records for the specified customer.

  • Name
    recommendation_type
    Type
    string
    Description

    Only show records with the specified recommendation type.

Request

GET
/v1/recommendations
curl -G https://api.finx.ai/v1/recommendations \
  -H "Authorization: Bearer {token}" \
  -d limit=10

Response

{
  "has_more": false,
  "data": [
    {
      "id": "xgQQXg3hrtjh7AvZ",
      "customer_id": "WAz8eIbvDR60rouK",
      "recommendation_type": "product",
      "details": {
        "name": "Smartphone",
        "description": "Latest model with advanced features",
        "price": 999.99
      },
      "relevance_score": 9.5,
      "created_at": 705103200,
      "updated_at": 705103200
    },
    {
      "id": "hSIhXBhNe8X1d8Et"
      // ...
    }
  ]
}

POST/v1/recommendations

Create a recommendation

This endpoint allows you to add a new recommendation record. You need to provide the customer ID, recommendation type, details, and relevance score to create a recommendation record.

Required attributes

  • Name
    customer_id
    Type
    string
    Description

    Unique identifier for the customer.

  • Name
    recommendation_type
    Type
    string
    Description

    Type of recommendation (e.g., product, service).

  • Name
    details
    Type
    object
    Description

    Details of the recommendation.

  • Name
    relevance_score
    Type
    number
    Description

    Relevance score of the recommendation.

Request

POST
/v1/recommendations'
curl https://api.finx.ai/v1/recommendations \
  -H "Authorization: Bearer {token}" \
  -d 'customer_id'="WAz8eIbvDR60rouK" \
  -d 'recommendation_type'="product" \
  -d 'details'='{"name": "Smartphone", "description": "Latest model with advanced features", "price": 999.99}' \
  -d 'relevance_score'=9.5

Response

{
  "id": "xgQQXg3hrtjh7AvZ",
  "customer_id": "WAz8eIbvDR60rouK",
  "recommendation_type": "product",
  "details": {
    "name": "Smartphone",
    "description": "Latest model with advanced features",
    "price": 999.99
  },
  "relevance_score": 9.5,
  "created_at": 705103200,
  "updated_at": 705103200
}

GET/v1/recommendations/:id

Retrieve a recommendation

This endpoint allows you to retrieve a recommendation record by providing the record id. Refer to the list at the top of this page to see which properties are included with recommendation objects.

Request

GET
/v1/recommendations/xgQQXg3hrtjh7AvZ
curl https://api.finx.ai/v1/recommendations/xgQQXg3hrtjh7AvZ \
  -H "Authorization: Bearer {token}"

Response

{
  "id": "xgQQXg3hrtjh7AvZ",
  "customer_id": "WAz8eIbvDR60rouK",
  "recommendation_type": "product",
  "details": {
    "name": "Smartphone",
    "description": "Latest model with advanced features",
    "price": 999.99
  },
  "relevance_score": 9.5,
  "created_at": 705103200,
  "updated_at": 705103200
}

PUT/v1/recommendations/:id

Update a recommendation

This endpoint allows you to perform an update on a recommendation record. Examples of updates are changing the recommendation type, updating the details, or modifying the relevance score.

Optional attributes

  • Name
    recommendation_type
    Type
    string
    Description

    Updated type of recommendation.

  • Name
    details
    Type
    object
    Description

    Updated details of the recommendation.

  • Name
    relevance_score
    Type
    number
    Description

    Updated relevance score of the recommendation.

Request

PUT
/v1/recommendations/xgQQXg3hrtjh7AvZ
curl -X PUT https://api.finx.ai/v1/recommendations/xgQQXg3hrtjh7AvZ \
  -H "Authorization: Bearer {token}" \
  -d 'relevance_score'=8.5

Response

{
  "id": "xgQQXg3hrtjh7AvZ",
  "customer_id": "WAz8eIbvDR60rouK",
  "recommendation_type": "product",
  "details": {
    "name": "Smartphone",
    "description": "Latest model with advanced features",
    "price": 999.99
  },
  "relevance_score": 8.5,
  "created_at": 705103200,
  "updated_at": 705103200
}

DELETE/v1/recommendations/:id

Delete a recommendation

This endpoint allows you to delete your recommendation records in Fin X. Note: This will permanently delete the record and all its data — ensure this is the desired action before proceeding.

Request

DELETE
/v1/recommendations/xgQQXg3hrtjh7AvZ
curl -X DELETE https://api.finx.ai/v1/recommendations/xgQQXg3hrtjh7AvZ \
  -H "Authorization: Bearer {token}"

Was this page helpful?