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_idpathintegerRequiredThe ID of the Instacart user created through FulfillmentSandbox.CreateInstacartUser endpoint.

Request

FieldTypeRequiredDescription
redirect_uristringRequiredThe redirect URI when the authorization code was generated.
scopestringRequiredThe OAuth2 scopes needed for authoriation.
code_challenge_methodstringOptionalThe code challenge method.
code_challengestringOptionalThe 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
codestringRequiredThe authorization code that can be exchanged for access token.

Response examples

200 Success

{
"code": "37MnE-YtB19F8aE37btINN3UQBTo2rke0eIuYuvV06M"
}

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"}