- Platform Overview
- Resources and Guides
-
POS Integration
-
Getting Started
-
Core Concepts
-
Integration SDK
-
Certification
-
- Order Ahead
-
Provider Enablement
-
Provider Enablement
-
Endpoints
-
Developer Endpoints
-
-
API Reference
-
Getting Started
-
v15
-
- Access Tokens
- Campaigns
- Credit Cards
- Users
- Credit
- Locations
- Payment Methods
- QR Codes
- Progress Adjustments
- Orders
- Rewards
- Gift Cards
-
-
v14
-
- Credit
- Access Tokens
- Campaigns
- Categories
- Credit Cards
- Interstitials
- Locations
- Loyalty
- Orders
- Payment Tokens
- Support Tickets
- Users
-
-
User Addresses .: Create
API Reference / v15
Create a New Address for a User
This endpoint allows you to create a new address for a user. To create an address, you must have a
user access token with the manage_user_addresses
permission.
Request Endpoint
POST /v15/user_addresses
Authorization Required – User Token in Header
Authorization: token user="123897-99SCvr3kSe3TqqQid3DyPXfo2Kq98MyhF6CaNPqoDeMhJ18Uopq19uddcznu6R"
Request Body
{
"user_address": {
"address_type": "home",
"street_address": "101 Arch Street",
"extended_address": "Suite 555",
"locality": "Boston",
"region": "MA",
"postal_code": "02114"
}
}
Request Parameters
Parameters | Type | Description |
---|---|---|
address_type |
String | The type of the address. Valid values are ‘billing’, 'delivery’, 'home’, 'other’, 'payment’, 'shipping’, and 'work’. |
extended_address |
String | The second portion of a user’s address. |
locality |
String | The city of the address. |
postal_code |
String | The ZIP code of the address. |
region |
String | The state of the address. |
street_address |
String | The street and number of the address. |
cURL Example
curl https://sandbox.thelevelup.com/v15/user_addresses \
-H Accept:application/json \
-H Content-Type:application/json \
-H 'Authorization:token user="123897-99SCvr3kSe3TqqQid3DyPXfo2Kq98MyhF6CaNPqoDeMhJ18Uopq19uddcznu6R"' \
-d '{
"user_address": {
"address_type": "home",
"street_address": "123 Main St",
"extended_address": "Apt 1",
"locality": "Boston",
"region": "MA",
"postal_code": "02114"
}
}'
Responses
The address was created successfully
HTTP/1.1 200 OK
{
"user_address": {
"address_type": "home",
"extended_address": "Apt 1",
"id": 123,
"latitude": 42.362603,
"locality": "Boston",
"longitude": -71.065063,
"postal_code": "02114",
"region": "MA",
"street_address": "123 Main St"
}
}
The address details were invalid
HTTP/1.1 422 Unprocessable Entity
[
{
"error": {
"object": "user_address",
"property": "address_type",
"message": "Address type is invalid."
}
}
]