AddressProperties

Each address is accessed via /api/address and has the following properties. Complete details in AddressProperties.

id

The unique id for this address. It will never change.

object_type

address.

date_created

A date when the address was created.

date_updated

A date when the address was last updated.

user_id

The unique id of a User that this address belongs to.

name

The name of the person you're shipping this order to.

company

Optional. The name of the company located at this address if any.

address1

The first part of the street address.

address2

Optional. The second part of the street address.

city

A city name.

state

A state or province. If a US State, the two letter code should be used. See the address options for details.

postal_code

A zip code or other postal code.

country

A two character country code. See the address options for details.

phone_number

A number that can be called at the address if any problems occur.

Address Options

Provides a list of the options that can be used to fill out various fields when creating or updating an address.

 GET /api/address/_options

Returns:

 {
    "country" : [...],
    "_country" : {...},
    "state" : [...],
    "_state" : {...}
 }

NOTE: You can also get this data by adding _include_options=1 to the parameter list when fetching an address.

Relationships

shipments

A list of Receipts to which this address is attached as a shipping address.

Related Objects

user

The User that this address is owned by.

Address Methods

The methods used to fetch and manipulate addreses.

Create Address

 POST /api/address
session_id

Required. The unique session id provided by a Session method.

user_id

Required.

name

Required.

company

Optional.

address1

Required.

address2

Optional.

city

Required.

state

Required. May be set to N/A when country is not US.

postal_code

Required.

country

Required.

phone_number

Required.

Returns:

 {
   "id" : "xxx",
   "name" : "Andy Dufresne",
   "company" : "Shawshank Prison",
   "address1" : "1600 Heartbreak Ln",
   "address2" : "Room: Prison Library",
   "state" : "ME",
   "postal_code" : "04093",
   "country" : "US",
   "phone_number" : "207-555-1111"
   ...
 }

Update Address

 PUT /api/address/xxx

See Create Address for details.

NOTE: Updating addresses is only allowed by admins.

Delete Address

 DELETE /api/address/xxx
session_id

Required. The unique session id provided by a Session method.

Returns:

 {
   "success" : 1
 }

Fetch Address

 GET /api/address/xxx
session_id

Optional. The unique session id provided by a Session method.

_include_relationships

Optional. See "Relationships" in Intro and Address Relationships above for details.

Returns:

 {
   "id" : "xxx",
   "image_id" : "xxx",
   ...
 }

Fetch List of Countries

 GET /api/address/countries

Returns:

 {
  "US" : "United States",
  "GB" : "United Kingdom",
  "CA" : "Canada",
 ...
 }

Fetch List of States

 GET /api/address/states

Returns:

 {
  "WI" : "Wisconsin",
  "IL" : "Illinois",
  "CA" : "California",
 ...
 }
^ Back to Top ^