WearBucks API

API for "WearBucks (Pay for Starbucks)" Android application

View the Project on GitHub stephenv/WearBucks-API

WearBucks API is an open-source RESTful HTTP API for retrieving Starbucks user information. This is the API used by WearBucks (Pay for Starbucks) Android application on Google Play.

This API is based off Starbucks class by Neil.

Login information (username and password) is not stored and the API should only be used over SSL/TSL

Dependencies:

API Endpoints:

Installation instructions:


POST /account

Retrieves Starbucks.com account details (given correct credentials)

Parameters:

Name Description Details
username Starbucks username or password required
password Starbucks password required

Headers:

Name Description Details
Content-Type application/json required
cid Client UUID optional, used by Google Analytics
av App Version Number optional, used by Google Analytics

Example JSON Request body:

{
  "username": "user@domain.com",
  "password": "******"
}

Example JSON Response body:

{
    "error": false,
    "customer_name": "Firstname Lastname",
    "stars": "0",
    "rewards": "0",
    "dollar_balance": "00.00",
}

Response codes & Error Handling

The API will always return an HTTP status code 200 however there may be errors. In the JSON response body, "error" will not be false. Example:

{
  "error":{
    "code": 401,
    "message": "Unauthorized",
    "description": "Authentication credentials were malformed or incorrect."
  }
}

Error codes:


POST /locations

NOTE: This API endpoint is in progress and therefore the documentation is not complete. Analytics is also currently not supported This feature returns a list of nearby Starbucks locations stored in a MongoDB database (not included in API). Set the following environment variables in index.php:

$_ENV['LOCATIONS'] = true;
$_ENV['MONGOHQ_URL'] = mongodb://user:pass@server.mongohq.com/db_name;

Google Analytics

Google analytics can be enabled and is tracked using "Measurement Protocol". Ensure "Universal Analytics" is enabled on the property and use the provided tracking ID "UA-XXXX-XX".Set the following environment variables in index.php:

$_ENV['ANALYTICS'] = true;
$_ENV['TRACKING_ID'] = "UA-XXXXXXXX-X";