Skip to main content

Get started

Learn how to authenticate with Instacart Connect and make your first API call in a development environment.

  1. Before you begin
  2. Generate a token
  3. Create a Connect user account

Before you begin#

For this tutorial, you need the following items:

Generate a token#

To make requests to the Connect APIs, you need a bearer token with the client_credentials grant type. To generate the token, use the authentication endpoint and specify your client ID and secret in the body.

curl --request POST \  --url https://<Instacart_development_domain>/v2/oauth/token \  --header 'Accept: application/json' \  --header 'Content-Type: application/json' \  --data '{  "client_id": "<your_client_id>",  "client_secret": "<your_client_secret>",  "grant_type": "client_credentials"}'

The response contains the generated token. The token is valid for 24 hours, after which you need to generate a new token.

{  "access_token": "<your_access_token>",  "token_type": "Bearer",  "expires_in": 86400,  "created_at": 1603897760}

Create a Connect user account#

To validate that your token works, try creating a Connect user account. You need a user account before you can fulfill an order. All requests require the generated access token and an HTTPS call that contains the Instacart development server domain.

curl --request POST \  --url https://<Instacart_development_domain>/v2/fulfillment/users \  --header 'Accept: application/json' \  --header 'Authorization: Bearer <your_access_token>' \  --header 'Content-Type: application/json' \  --data '{  "user_id": "johnsmith6000",  "first_name": "john",  "last_name": "smith",  "phone_number": "800-555-0100"}'

A successful request returns a JSON response with a status code of 200 and the following fields:

{  "user_id": "johnsmith6000",  "first_name": "John",  "last_name": "Smith",  "phone_number": "800-555-0100"}

You are ready to begin trying out Instacart Connect capabilities.

For more information about other responses that you might receive, see Create a Connect user account. If you receive any valid response, the token is working with the Instacart server.