Skip to main content

Authorize an Instacart user for account linking

POST /v2/fulfillment_sandbox/instacart_users/{user_id}/authorize

Authorizes an Instacart user for account linking.

Security

NameInDescription
AuthorizationheaderThe Authorization header with the bearer token acquired during authentication.

Parameters

NameInTypeRequiredDescription
user_idpathintegerRequired

The ID of the Instacart user created through FulfillmentSandbox.CreateInstacartUser endpoint.

Request

FieldTypeRequiredDescription
redirect_uristringRequired

The redirect URI when the authorization code was generated.

scopestringRequired

The OAuth2 scopes needed for authoriation.

code_challenge_methodstringOptional

The code challenge method.

code_challengestringOptional

The code challenge.

Request examples

curl --request POST \
--url 'https://connect.instacart.com/v2/fulfillment_sandbox/instacart_users/{user_id}/authorize' \
--header 'Accept: application/json' \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"redirect_uri": "string",
"scope": "string",
"code_challenge_method": "string",
"code_challenge": "string"
}'

Response

FieldTypeRequiredDescription
codestringRequired

The authorization code that can be exchanged for access token.

Response examples

200 Success

{
"code": "zth2LONsv7xVq76ocOcS9ZYwc_eZLdDNX74Z9gSgilk"
}

4XX Errors

Error responses return either a single error or multiple errors.

HTTP CodeCauseError MessageError CodeError Meta
400Invalid user_id"Invalid user_id"1001{"key":"user_id"}