Adding a gift to the cart (Part one)

  1. Customer goes to the SailPlay Loyalty Page and redeems their points for a gift. 
  2. We process the transaction, deduct points, etc.
  3. We send a JSONP request to an address of your choice, containing the following: 
    1. gift_public_key: a unique hash;
    2. gift_sku: Gift ID in your system;
    3. user_email OR origin_user_id OR user_phone;

The request the Example:

(Part two)

  1. Upon receipt of our query your site should make a request back to us to check the status of the transaction. You'll need to send the following parameters:
    1. gift_public_key: a unique hash;
    2. the token: the auth your the token (see );
    3. store_department_id: your store_department_id (see );
      The request the Example: 
      You should receive a response like this:

      "status": "ok",  
      "purchase_gift": { 
      "id": 166, // the transaction id 
      "already_completed": to false, // Whether or not the the transaction has already been completed
      "gift_id": 20, // gift in SailPlay id 
      "gift_sku": "123", // product product SKU in your system 
      "PURCHASE_DATE": "2013-03-26T10: 18: 41",        
      "complete_date": "2013-03-26T10: 19: 04,118" 
      "points_delta": 800, 
      "is_completed": to true,  
      "the user": " " 

  2. If the request is successful, and already_completed is false, then you can add the customer's free gift to their cart. 
  3. Customer completes checkout as normal. You physically deliver the gift along with the rest of their order.