Skip to main content

Recommendations API endpoints overview

Instacart Connect offers different endpoints for frontend and backend implementations. Backend endpoints require a client credentials access token. Frontend endpoints require a user access token.

important

Always generate the user and client credentials access tokens on the backend.

Backend implementation

In a backend implementation, your platform calls the Instacart Connect platform directly and includes the user ID as a parameter. In this case, generate an access token with the API scope and the client_credentials grant type. For instructions, see Get a client credentials access token.

Use these endpoints with a client credentials access token:

EndpointDescription
/v2/recommendations/users/{user_id}/replacement_itemsGet suggested replacement items.
/v2/recommendations/users/{user_id}/orders/{order_id}/replacement_itemsGet suggested replacement items for an order.
/v2/recommendations/users/{user_id}/complementary_itemsGet suggested complementary items.
/v2/recommendations/users/{user_id}/orders/{order_id}/complementary_itemsGet suggested complementary items for an order.

Frontend implementation

In a frontend implementation where you call the API from within a browser or mobile device, you need to encode the user ID within the access token so that the user ID is never passed on the client side during an API call. In this case, generate a user access token to use in your requests. For instructions, see Get a user access token.

Use these endpoints with a user access token:

EndpointDescription
/v2/recommendations/replacement_itemsGet suggested replacement items.
/v2/recommendations/orders/{order_id}/replacement_itemsGet suggested replacement items for an order.
/v2/recommendations/complementary_itemsGet suggested complementary items.
/v2/recommendations/orders/{order_id}/complementary_itemsGet suggested complementary items for an order.