UserAddress
Overview
Represents a user's address.
State/Province codes for US, Canada, and Australia
When creating an address using the createUserAddress
method, state is a required field if the country is US, Canada, or Australia. For these countries, the value for the state must be one of these abbreviations:
- United States: AL, AK, AS, AZ, AR, CA, CO, CT, DE, DC, FM, FL, GA, GU, HI, ID, IL, IN, IA, KS, KY, LA, ME, MH, MD, MA, MI, MN, MS, MO, MT, NE, NV, NH, NJ, NM, NY, NC, ND, MP, OH, OK, OR, PW, PA, PR, RI, SC, SD, TN, TX, UT, VT, VI, VA, WA, WV, WI, WY, AA, AE, AP
- Canada: AB, BC, MB, NB, NL, NT, NS, NU, ON, PE, QC, SK, YT
- Australia: ACT, NSW, NT, QLD, SA, TAS, VIC, WA
Fields
Field |
Visibility Level |
Permission Scope |
Type |
Description |
user_address_id
|
private |
address_r
|
int |
The numeric ID of the user's address.
|
user_id
|
private |
address_r
|
int |
The user's numeric ID.
|
name
|
private |
address_r
|
text |
The user's name for this address.
|
first_line
|
private |
address_r
|
text |
The first line of the user's address.
|
second_line
|
private |
address_r
|
text |
The second line of the user's address.
|
city
|
private |
address_r
|
text |
The city field of the user's address.
|
state
|
private |
address_r
|
text |
The state field of the user's address.
|
zip
|
private |
address_r
|
text |
The zip code field of the user's address.
|
country_id
|
private |
address_r
|
int |
The country's numeric ID.
|
country_name
|
private |
address_r
|
string |
The name of the user's country
|
is_default_shipping
|
private |
address_r
|
boolean |
Is this the user's default shipping address
|
Associations
Association |
Visibility Level |
Permission Scope |
Type |
Description |
Country |
private |
address_r
|
Country
|
The full Country record for the user's address.
|
User |
private |
address_r
|
User
|
The full User record whom entered this address.
|
Methods
findAllUserAddresses
Method Name |
findAllUserAddresses |
Synopsis |
Retrieves a set of UserAddress objects associated to a User.
|
HTTP Method |
GET |
URI |
/users/:user_id/addresses |
Parameters |
|
Requires OAuth |
Y |
Permission Scope |
address_r
|
createUserAddress
Method Name |
createUserAddress |
Synopsis |
Creates a new UserAddress. Note: state is required when the country is US, Canada, or Australia. See section above about valid codes.
|
HTTP Method |
POST |
URI |
/users/:user_id/addresses/ |
Parameters |
|
Requires OAuth |
Y |
Permission Scope |
address_w
|
getUserAddress
Method Name |
getUserAddress |
Synopsis |
Retrieves a UserAddress by id.
|
HTTP Method |
GET |
URI |
/users/:user_id/addresses/:user_address_id |
Parameters |
Name |
Required |
Default |
Type |
user_address_id |
Y |
|
array(int) |
|
Requires OAuth |
Y |
Permission Scope |
address_r
|
deleteUserAddress
Method Name |
deleteUserAddress |
Synopsis |
Deletes the UserAddress with the given id.
|
HTTP Method |
DELETE |
URI |
/users/:user_id/addresses/:user_address_id |
Parameters |
Name |
Required |
Default |
Type |
user_address_id |
Y |
|
int |
|
Requires OAuth |
Y |
Permission Scope |
address_w
|