Skip to main content

How to link a user account with an Instacart account

Enable your customers to link their Connect user account to their Instacart account. For more information, see Account linking.

Prerequisites#

You need the following things:

  • Account linking is enabled for your site. Contact your Instacart Connect representative.
  • A page exists on your site where the customer is redirected after they have allowed or denied access to their Instacart Express account.
  • The URI for the redirect page is added to the list of URIs allowed to redirect to the Login with Instacart page. Contact your Instacart Connect representative.

Link accounts#

Your retailer site needs to redirect customers to the Login with Instacart page where a customer can grant permission to link accounts.

important

Advise your customers that they can unlink accounts at any time by contacting Instacart Care.

  1. On your retailer site, prompt your customers to link their Connect user account to their Instacart account. Add a link to the Login with Instacart page.

    The following Login with Instacart URLs are available:

    EnvironmentURL
    Productionhttps://login.instacart.com/r3/oauth/authorize
    Developmenthttp://login.dev.instacart.tools/r3/oauth/authorize
  2. After your customer clicks the link, your site redirects the customer to the Login with Instacart page with the following query parameters:

    NameTypeDescription
    response_typestringAlways code.
    client_idstringYour client ID.
    scopestringAlways account_linking.
    statestringA CSRF token that your site generates for the current interaction. This token is passed to the redirect URI for verification.
    redirect_uristringA URI on your site that the customer is redirected to after they have allowed or denied access to their Instacart account. The URI must be added to the Instacart allow list.
  3. On the Login with Instacart page, your customer logs in to their account and grants your site access to their Instacart account.

    Instacart redirects the customer to the page you specified as the redirect_uri with the following query parameters:

    NameTypeDescription
    statestringThe CSRF token passed to the Login with Instacart URL. Your site should verify that it is the one generated for the current interaction.
    codestringThe authorization code, if the authorization succeeded. The authorization code is required to generate the linking token. The code is valid for 10 minutes.
    errorstringThe error, if the authorization failed.
    error_descriptionstringThe error description, if the authorization failed.
  4. If your site receives an authorization code, it can link the accounts. See:

    1. Generate a linking token
    2. Link an Instacart account

Next step: After the accounts are linked, your site can retrieve the customer's Instacart Express membership status by calling Get Instacart account information.