Create/Update Address
Create or update an address for a user by ID
Endpoint Details
POST
/users/addresses/add
Headers
Content-Type
application/json
Authorization
Bearer <YOUR_ACCESS_TOKEN>
Body
userId
string
Identifier of the user to add address for
one
string
Primary street address
two
string
Secondary address (apt, suite, etc.)
city
string
City name
state
string
Two-letter state code or full state name
zip
string
Postal/ZIP code
type
string
Address type ('shipping' or 'billing')
placesId
string
Google Places API location identifier
lat
number
Latitude coordinate of address
long
number
Longitude coordinate of address
isDefault
boolean
Set as default address for type, default: false
Response Details
statusCode
number
HTTP status code of the response
message
string
A brief message describing the result of the API call
Metadata Object
languages
Array<string>
List of supported languages for the response, e.g. ["en"]
timestamp
string
Unix timestamp (in milliseconds) when the response was generated
timezone
string
Timezone used for the response, always "UTC"
requestId
string
Unique identifier for the API request. Used for debugging and support
path
string
API path
version
string
API version used for the request
Sample Request and Response
curl --location 'https://staging.api.liquidcommerce.cloud/users/addresses/add' \
--header 'Authorization: Bearer <YOUR_ACCESS_TOKEN>' \
--header 'Content-Type: application/json' \
--data '{
"userId": "usrid_123abc456def",
"one": "100 Madison Ave",
"two": "Apt 1707",
"city": "New York",
"state": "NY",
"zip": "10016",
"type": "shipping",
"placesId": "placeid_123abc456ef",
"lat": 40.7447986,
"long": -73.98530819999999,
"isDefault": true
}'
{
"statusCode": 201,
"message": "Updating or creating an new address succeeded",
"metadata": {
"languages": [
"en"
],
"timestamp": 1731598717444,
"timezone": "UTC",
"requestId": "reqid_123abc45def",
"path": "/api/users/addresses/add",
"version": "1.7.0"
},
"data": {
"id": "addrid_123abc45def",
"type": "shipping",
"one": "100 Madison Ave",
"two": "Apt 1707",
"city": "New York",
"state": "NY",
"zip": "10016",
"lat": 40.7447986,
"long": -73.98530819999999,
"placesId": "placeid_123abc456ef",
"country": "US",
"createdAt": "2024-11-14T15:38:37.775Z",
"updatedAt": "2024-11-14T15:38:37.775Z",
"isDefault": true
}
}
Last updated