Shipping Address API v2

REST API for a User's shipping addresses. OAuth must be setup before making these API calls. See the OAuth 2.0 page for more details.

This REST API supports JSON format.


Request format

http://www.shoppable.com/api/v2/shipping_addresses/:shipping_address_id?access_token=YOUR_ACCESS_TOKEN

Example

Ruby example using OAuth2 and HTTParty.

  # Retrieve access token from session.  You may have saved it in the DB.
  access_token = session[:access_token]

  api_url = "http://localhost:1111/api/v2/shipping_addresses?access_token=" + access_token.to_s
  addresses = HTTParty.get(api_url, :options => { :headers => { 'Content-Type' => 'application/json' } }).to_json

REST Actions

Action Description Method URL Parameters
Index Get all shipping addresses of the user GET http://www.shoppable.com/api/v2/shipping_addresses
  • access_token
Show Get a single shipping address of the user GET http://www.shoppable.com/api/v2/shipping_addresses/:shipping_address_id
  • access_token
  • shipping_address_id
Create Create a new wishlist POST http://www.shoppable.com/api/v2/shipping_addresses
  • access_token
  • shipping address object
Update Update an existing wishlist PUT http://www.shoppable.com/api/v2/shipping_addresses
  • access_token
  • shipping address
Delete Delete a shipping address DELETE http://www.shoppable.com/api/v2/shipping_addresses/:shipping_address_id
  • access_token
  • shipping_address_id

Request parameters

Parameter Type Description
access_token

REQUIRED

URL Param Access token provided through the OAuth service.
shipping_address_id

REQUIRED

URL Param The id of the product you are looking for.
shipping_address[address_1] Data Param

Address line 1 of the shipping address. cURL example:

curl 'http://www.shoppable.com/api/v2/shipping_addresses?access_token=2189aea40fb4c7ffc4ce09ce5b1e7c60cf93857a27442f7fac940a3eeb706f34' -d 'shipping_address[address_1]=123 Fake Street' -d 'shipping_address[address_2]=Apt 1'

shipping_address[address_2] Data Param Address line 2 of the shipping address.
shipping_address[address_type] Data Param Address type of the shipping address (residential, business, etc..).
shipping_address[alias] Data Param Alias or nickname of the shipping address.
shipping_address[city] Data Param City of the shipping address.
shipping_address[country] Data Param Country of the shipping address.
shipping_address[state] Data Param U.S. State of the shipping address (two letter abbreviation).
shipping_address[email] Data Param Email of the shipping address.
shipping_address[first_name] Data Param First name of recipient at the shipping address.
shipping_address[last_name] Data Param Last name of recipient at the shipping address.
shipping_address[phone] Data Param Phone number of the shipping address.
shipping_address[security_code] Data Param Security/buzzer code at the shipping address.
shipping_address[zip] Data Param Zipcode of the shipping address.

Example response

All the shipping addresses of the current user.

[
  {
    "address_1":"123 Fake Street",
    "address_2":"6b",
    "address_type":"res",
    "alias":"MY CASTLE",
    "city":"New York",
    "country":"US",
    "created_at":"2015-02-05T18:10:05Z",
    "email":"john+test132@shoppable.com",
    "first_name":"john",
    "id":49,
    "last_name":"wei",
    "phone":"123343534",
    "security_code":"123",
    "state":"NY",
    "updated_at":"2015-02-05T18:10:05Z",
    "user_id":130,
    "zip":"10009"
  }
]