Skip to main content

Create User Address

API operation: Open the endpoint in the API reference

Use POST /users/{user_id}/addresses to create an address for a user. The current public operation is Address.register.

If available, the operation requires authentication. Administrators and agents can act for another user; other authenticated callers must match user_id. The operation derives the user to store from the route. When default is true, existing addresses for that user are cleared as the default.

const response = await ordering.users(userId).addresses(addressData).save();

This SDK syntax may vary by package version; confirm the package and version before using it. See User address model for representative fields.

OpenAPI reference​

Operation: POST /users/{user_id}/addresses

Path parameters

NameTypeRequiredDescription
user_idintegerYes—

Header parameters

NameTypeRequiredDescription
X-Socket-Id-XstringNo—

Request body fields

NameTypeRequired
addressanyNo
address_notesanyNo
cellphoneanyNo
cityanyNo
countryanyNo
country_codeanyNo
defaultbooleanNo
external_idanyNo
internal_numberanyNo
lastnameanyNo
localityanyNo
locationstringNo
middle_nameanyNo
nameanyNo
neighborhoodanyNo
phoneanyNo
routeanyNo
second_lastnameanyNo
stateanyNo
state_codeanyNo
street_numberanyNo
sublocalityanyNo
user_idnumberYes
zipcodeanyNo

Responses

CodeDescription
200OK (Envelope)
400Bad Request (ErrorResponse)
401Unauthorized
404Not Found
429Too Many Requests (ErrorResponse)
500Internal Server Error (ErrorResponse)
503Service Unavailable (ErrorResponse)
Open this operation in the API reference