Developer API

Welcome to the first iteration of the Yiftee developer API! Below you will find descriptions of all API endpoints that will allow you to search for merchants, send gifts, and check the status of your purchases.

Things to know

All calls to our API MUST specify the api_token parameter. Certain function involving transactions must also contain the api_secret field. These values can be found in your app settings page. In addition, there are two different domains: app.yiftee.com/v2/ for production use and sandbox.yiftee.com/v2 for testing. Be sure to use the approptiate secret depending on which server you are querying.

API Objects

Below you'll find sample JSON objects that are returned from the Various API endpoints.

Merchant

{
  "id": 138591,
  "name": "Domino's Pizza",
  "description": "Get a rad pizza!",
  "web": "http://www.dominos.com/",
  "image": "http://app.yiftee.com/system/merchants/business_photo_images/138591/icon_400x400/business_photo.jpg",
  "logo": "http://app.yiftee.com/system/merchants/logo_images/138591/icon_400x400/logo.jpg",
  "max_price": 200,
  "min_price": 5,
  "address": {
    "address1": "876 Geary St.",
    "address2": "",
    "city": "San Francisco",
    "state": "California",
    "zipcode": "94109"
  }
}
      

Receipt

{
  "total":  6.25,
  "account_balance":  975.0,
  "invoice_id": 20890,
  "transactions" : [
    {
      "audit_number": "JvVN7D5",
      "recipient_details": {
        "name": "Matt Green",
        "email": "matt@yiftee.com",
        "phone": ""
      },
      "message": "A Gift for You!",
      "price_paid" : "6.25",
      "sender_name" : "Aldo",
      "gift": {
        "merchant_id": 24,
        "merchant_name": "Coupa Cafe",
        "redeemable_at_copy": "538 Ramona St, Palo Alto, California  94301",
        "amount": "5.00",
        "status": "DELIVERED",
        "expiration_date": "Tuesday Nov 31",
        "recipient_gift_link": "http://app.yiftee.com/g/wvtcLlz",
        "sender_gift_link": "http://app.yiftee.com/p/CM8KJlr",
        "image_url":  "https://app.yiftee.com/system/merchants/business_photo_images/24/icon_100x100_no_crop/coupamerchantphoto.png"
      }
    }
  ]
}
   

GET /account/balance

Returns the account balance

Parameters
none
Response
balancenumber signifying current account balance

GET /merchants/national_brands

Returns all national brands in our database

Parameters
none
Response
merchantslist of merchant objects

GET /merchants/lat_lon

Returns all merchants around area at lat/lon

Parameters
latlatitude   (required)
lonlongitude   (required)
radiusradius in miles of search; default=5
Response
merchantslist of merchant objects

GET /merchants/zipcode

Get’s all merchants in specified zipcode

Parameters
zipcodezipcode   (required)
limitnumber of results to return; default=20
offsetoffset of search results; default=5
Response
merchantslist of merchant objects

GET /merchants/city_state

Returns all merchants in the specified city and state

Parameters
citycity name   (required)
statestate   (required)
limitnumber of results to return; default=20
offsetoffset of search results; default=5
Response
merchantslist of merchant objects

GET /gift/status

Returns the status of a given gift

Parameters
audit_numberthe audit number of the transaction   (required)
Response
receipta receipt objects

GET /order/status

Returns the status of a given order (collection of gifts)

Parameters
invoice_idthe invoice id of the order   (required)
Response
receipta receipt objects

POST /gift/give

Send a gift

Parameters
merchant_idthe id of the merchant   (required)
priceamount of the gift to give   (required)
sender_namename of person sending gift; default=account name
sender_imagean image to associate with the sender; default=account image
sender_emailan email address of the sender; default=account email
messagemessage to accompany gift; default=?
recipient_emailemail address to send gift to   (required for Yiftee to deliver gift unless recipient_phone is specified)
recipient_phonephone number to text gift to   (required for Yiftee to deliver gift unless recipient_email is specified)
recipient_name name of recipient; default=email or phone number
exchangeable can the gift be exchanged for a different merchant; default=true or false
donatable can the gift be donated; default=true or false
Response
receipta receipt objects