Skip to main content

Validate an address

POST /v2/fulfillment/lastmile/users/{user_id}/validate_address

Deprecated

This endpoint has been replaced by Create a Connect user and validate an address, which checks for the user and, if the user already exists, validates the address. This change reflects our commitment to making our API more intuitive to use when implementing multiple fulfillment workflows in your e-commerce site. The deprecated endpoint is still supported for existing implementations. For new implementations, use the revised endpoint.

Validates an address for a user. Send this request before you create an order to reduce the possible errors that can be returned from the order creation endpoint. When you create the order, ensure that you use the validated address.

tip

Alternatively, create a user and validate an address in one request.

Security

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

Parameters

NameInTypeRequiredDescription
user_idpathstringRequired

The ID of the user.

Request

FieldTypeRequiredDescription
address_line_1stringRequired

The first address line.

address_line_2stringOptional

The second address line.

address_typestringOptional

The type of address, e.g., "residential".

postal_codestringRequired

The postal/zip code of the address.

citystringOptional

The city or town of the address, e.g., "Chicago".

Request examples

curl --request POST \
--url 'https://connect.instacart.com/v2/fulfillment/lastmile/users/{user_id}/validate_address' \
--header 'Accept: application/json' \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"address_line_1": "string",
"address_line_2": "string",
"address_type": "string",
"postal_code": "string",
"city": "string"
}'

Response

FieldTypeRequiredDescription
address_line_1stringRequired

The first address line.

postal_codestringRequired

The postal/zip code of the address.

flagsFlagsOptional

Additional properties of the address.

Flags Object

FieldTypeRequiredDescription
long_distance_deliverybooleanOptional

Whether a delivery to the address will be a long distance delivery.

Response examples

200 Success

{
"address_line_1": "499 Gainsville",
"postal_code": "81910",
"flags": {
"long_distance_delivery": false
}
}

4XX Errors

Error responses return either a single error or multiple errors.

HTTP CodeCauseError MessageError CodeError Meta
400Invalid input*"There were issues with your request"9999Not applicable
400Address not serviceable"Address is not serviceable."1001{"key":"address_line_1"}
* Multiple error