Back to top

Happy Returns Location Service

Listing, finding, and displaying Happy Returns locations.

Display

Various ways to display the availability or location of Happy Returns.

Badge

Badge
GET/badge.js

Javascript to display a badge on a webpage if a Happy Returns location is nearby. Example usage:

<script src="//locations.happyreturns.com/badge.js"
  id="happy-returns-script"
  data-retailer="myRetailer"
  data-accuracy="high|smart|low"
  data-badge-style="1|2|3|4"
  data-distance="25"
  data-address="90210"
></script>

Example URI

GET http://locations.happyreturns.com/badge.js
Response  200
HideShow
Headers
Content-Type: application/javascript

Embeddable Map

Embeddable Map
GET/map{?retailer,distance,address}

An embeddable map, ideal for use as an iframe src parameter. Example usage:

<iframe src="http://locations.happyreturns.com/map" />

Example URI

GET http://locations.happyreturns.com/map?retailer=test&distance=50&address=Los Angeles
URI Parameters
HideShow
retailer
string (optional) Example: test
distance
number (optional) Example: 50
address
string (optional) Example: Los Angeles
Response  200
HideShow
Headers
Content-Type: text/html; charset=utf-8

Locations Page

Locations Page
GET/{?retailer,distance,address}

The Happy Returns location page. Ideal for use as a link.

Example URI

GET http://locations.happyreturns.com/?retailer=test&distance=50&address=Los Angeles
URI Parameters
HideShow
retailer
string (optional) Example: test
distance
number (optional) Example: 50
address
string (optional) Example: Los Angeles
Response  200
HideShow
Headers
Content-Type: text/html; charset=utf-8

API

Programmatic ways to list or find Happy Returns locations.

All Locations

All Locations
GET/locations/all{?retailer}

Lists all locations

Example URI

GET http://locations.happyreturns.com/locations/all?retailer=test
URI Parameters
HideShow
retailer
string (optional) Example: test
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "locations": [
    {
      "id": "smp",
      "name": "Santa Monica Place",
      "address": "395 Santa Monica Place, Santa Monica, CA 90401",
      "parsedAddress": {
        "address": "395 Santa Monica Place",
        "city": "Santa Monica",
        "state": "CA",
        "zipcode": "90401"
      },
      "directions": "On the second floor, next to Uniqlo",
      "hours": "Mon-Sat 10am - 9pm, Sun 10am - 8pm",
      "notes": "Only accepting returns from cool people",
      "lat": 34.013784434934585,
      "lng": -118.49423557519913,
      "distance": 0
    },
    {
      "id": "sfc",
      "name": "Westfield San Francisco Centre",
      "address": "865 Market St., San Francisco, CA 94103",
      "parsedAddress": {
        "address": "865 Market St.",
        "city": "San Francisco",
        "state": "CA",
        "zipcode": "94103"
      },
      "directions": "",
      "hours": "Mon-Sat 10:00AM - 8:30PM, Sun 11:00AM - 7:00PM",
      "notes": "",
      "lat": 37.784118791422294,
      "lng": -122.40643590688705,
      "distance": 0
    }
  ]
}

Search Locations

Search Locations
GET/locations{?retailer,distance,address}

Searches for locations within a given radius of a given address. It falls back to using geoip-based coordinates if no address is provided.

Example URI

GET http://locations.happyreturns.com/locations?retailer=test&distance=50&address=Los Angeles
URI Parameters
HideShow
retailer
string (optional) Example: test
distance
number (optional) Example: 50
address
string (optional) Example: Los Angeles
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "address": "Los Angeles",
  "coordinates": {
    "lat": 34.0522342,
    "lng": -118.2436849
  },
  "locations": [
    {
      "id": "smp",
      "name": "Santa Monica Place",
      "address": "395 Santa Monica Place, Santa Monica, CA 90401",
      "parsedAddress": {
        "address": "395 Santa Monica Place",
        "city": "Santa Monica",
        "state": "CA",
        "zipcode": "90401"
      },
      "directions": "On the second floor, next to Uniqlo",
      "hours": "Mon-Sat 10am - 9pm, Sun 10am - 8pm",
      "notes": "Only accepting returns from cool people",
      "lat": 34.013784434934585,
      "lng": -118.49423557519913,
      "distance": 14.5943
    }
  ]
}

Generated by aglio on 22 Mar 2018