Skip to main content

Create a user and validate an address

POST /v2/fulfillment/lastmile/validate_address

Deprecated

This endpoint has been replaced by Create a Connect user and validate an address. The URI has changed and now includes the user ID as a path parameter instead of as a body parameter. Otherwise, the request parameters and responses remain the same. This change reflects our commitment to making our API more intuitive to use when implementing multiple fulfillment workflows in your ecommerce site. The deprecated endpoint is still supported for existing implementations. For new implementations, use the revised endpoint.

Creates a Connect user account and validates the address provided in the request. The user ID is generated by your site and can be any unique identifier, such as a login name, loyalty ID, or email address. For more information about users, see Create a user.

If a user account with the given user_id already exists, the address is validated and associated with the existing user. The response contains the existing user's ID and the validated street address and postal code.

When you create an order with this user_id, ensure that you use the validated address.

tip

Alternatively, you can create a user and validate an address as separate calls.

Security

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

Parameters

None.

Request

FieldTypeRequiredDescription
address_line_1stringRequiredThe first address line.
address_line_2stringOptionalThe second address line.
address_typestringOptionalThe type of address, e.g., "residential".
postal_codestringRequiredThe postal/zip code of the address.
user_idstringRequiredUnique user ID to use for this user.

Request examples

curl --request POST \
--url https://connect.instacart.com/v2/fulfillment/lastmile/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",
"user_id": "string"
}'

Response

FieldTypeRequiredDescription
addressCreateAddressOptionalThe address used for validation.
user_idstringOptionalThe ID of the user.

CreateAddress Object

FieldTypeRequiredDescription
address_line_1stringRequiredThe first address line.
postal_codestringRequiredThe postal/zip code of the address.
flagsFlagsOptionalAdditional properties of the address.

Flags Object

FieldTypeRequiredDescription
long_distance_deliverybooleanOptionalWhether a delivery to the address will be a long distance delivery.

Response examples

200 Success

{
"address": {
"address_line_1": "499 Gainsville",
"postal_code": "81910"
},
"user_id": "roberteospeedwagon"
}

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"}
400Without address line 1"can't be blank"1001{"key":"address_line_1"}
400Invalid address"invalid_address"1001{"key":"address"}
400Address contains PO box"address contains PO Box"1001{"key":"address"}
* Multiple error