diff --git a/.rvmrc.template b/.rvmrc.template index 88710c4..3591c0d 100644 --- a/.rvmrc.template +++ b/.rvmrc.template @@ -1 +1 @@ -rvm 1.9.3@developer.offerengine.com --create +rvm 1.9.3-p327@developer.offerengine.com --create diff --git a/Gemfile b/Gemfile index 36f2267..0c38eb2 100644 --- a/Gemfile +++ b/Gemfile @@ -8,6 +8,7 @@ gem 'nokogiri', '~> 1.4.4' gem 'yajl-ruby', '~> 0.8.2' gem 'pygmentize', '~> 0.0.3' gem 'mime-types', '~> 1.16' +gem 'guard-nanoc' group :development do gem 'adsf' diff --git a/Gemfile.lock b/Gemfile.lock index 33371a9..17214b2 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,20 +1,60 @@ GEM remote: http://rubygems.org/ specs: - adsf (1.0.1) + adsf (1.2.0) rack (>= 1.0.0) - cri (2.0.2) - kramdown (0.13.4) - mime-types (1.17.2) - nanoc (3.2.4) - nanoc3 (>= 3.2.4) - nanoc3 (3.2.4) - cri (~> 2.0) + celluloid (0.16.0) + timers (~> 4.0.0) + coderay (1.1.0) + colored (1.2) + cri (2.6.1) + colored (~> 1.2) + ffi (1.9.8) + formatador (0.2.5) + guard (2.12.5) + formatador (>= 0.2.4) + listen (~> 2.7) + lumberjack (~> 1.0) + nenv (~> 0.1) + notiffany (~> 0.0) + pry (>= 0.9.12) + shellany (~> 0.0) + thor (>= 0.18.1) + guard-nanoc (1.0.3) + guard (~> 2.8) + nanoc (~> 3.6) + hitimes (1.2.2) + kramdown (0.13.8) + listen (2.10.0) + celluloid (~> 0.16.0) + rb-fsevent (>= 0.9.3) + rb-inotify (>= 0.9) + lumberjack (1.0.9) + method_source (0.8.2) + mime-types (1.25.1) + nanoc (3.7.5) + cri (~> 2.3) + nenv (0.2.0) nokogiri (1.4.7) + notiffany (0.0.6) + nenv (~> 0.1) + shellany (~> 0.0) + pry (0.10.1) + coderay (~> 1.1.0) + method_source (~> 0.8.1) + slop (~> 3.4) pygmentize (0.0.3) - rack (1.4.0) - rake (0.9.2.2) - systemu (2.4.2) + rack (1.6.0) + rake (10.4.2) + rb-fsevent (0.9.4) + rb-inotify (0.9.5) + ffi (>= 0.5.0) + shellany (0.0.1) + slop (3.6.0) + systemu (2.6.5) + thor (0.19.1) + timers (4.0.1) + hitimes yajl-ruby (0.8.3) PLATFORMS @@ -22,6 +62,7 @@ PLATFORMS DEPENDENCIES adsf + guard-nanoc kramdown (~> 0.13.2) mime-types (~> 1.16) nanoc diff --git a/Guardfile b/Guardfile new file mode 100644 index 0000000..751625f --- /dev/null +++ b/Guardfile @@ -0,0 +1,30 @@ +# A sample Guardfile +# More info at https://github.com/guard/guard#readme + +## Uncomment and set this to only include directories you want to watch +# directories %w(app lib config test spec features) + +## Uncomment to clear the screen before every task +# clearing :on + +## Guard internally checks for changes in the Guardfile and exits. +## If you want Guard to automatically start up again, run guard in a +## shell loop, e.g.: +## +## $ while bundle exec guard; do echo "Restarting Guard..."; done +## +## Note: if you are using the `directories` clause above and you are not +## watching the project directory ('.'), then you will want to move +## the Guardfile to a watched dir and symlink it back, e.g. +# +# $ mkdir config +# $ mv Guardfile config/ +# $ ln -s config/Guardfile . +# +# and, you'll have to watch "config/Guardfile" instead of "Guardfile" + +guard 'nanoc' do + watch('nanoc.yaml') # Change this to config.yaml if you use the old config file name + watch('Rules') + watch(%r{^(content|layouts|lib)/.*$}) +end diff --git a/content/index.md b/content/index.md index 6929367..31d42c4 100644 --- a/content/index.md +++ b/content/index.md @@ -22,7 +22,7 @@ If you have any problems or requests, please contact [support](mailto:support@de ## Deal -A _deal_ is a product that offers goods or services from different merchants at discounted levels. +A _deal_ is a product that offers goods or services from different merchants at discounted levels. ## Purchase @@ -36,9 +36,9 @@ A _purchase_ is a transaction in which a person (the _purchaser_) buys a quantit You can provide deals to your customers using just two simple API calls: _get deals_ and _execute a purchase._ The following example is a brief description of how these calls work with an existing mobile application. -In this example, a partner has integrated the entire deal viewing and purchasing process into a native mobile app experience. The following diagram shows the user purchase flow and the steps needed to implement each part of the flow: +In this example, a partner has integrated the entire deal viewing and purchasing process into a native mobile app experience. The following diagram shows the user purchase flow and the steps needed to implement each part of the flow: -Mobile Example Image +Mobile Example Image * Show Offers: Request deals using the Get Deals call. The call returns a list of deals available to purchase based on the filter parameters your provide with the request. Users see a subset of the deals with just a few key aspects of each deal. @@ -48,4 +48,4 @@ In this example, a partner has integrated the entire deal viewing and purchasing * Redeem Offer When an Execute Purchase request is successful, a purchase confirmation page appears with a link to the redemption voucher for the newly purchased deal. -To learn how to use the Deem Offers API, see our [Quick Start Guide](/v1/quick_start/). \ No newline at end of file +To learn how to use the Deem Offers API, see our [Quick Start Guide](/v1/quick_start/). diff --git a/content/v1/adunits.md b/content/v1/adunits.md index ac5f0f3..d08dcc9 100644 --- a/content/v1/adunits.md +++ b/content/v1/adunits.md @@ -9,7 +9,7 @@ The ad units operate like widgets to show in-flight deals that users can click t Up to 10 in-flight deals are selected for each ad unit based on request parameters, and they are rotated periodically. Request parameters applicable to the [Deals API](/v1/deals) are also applicable to ad units.

-Partners need to include only one line of JavaScript to place an ad unit on a web page. +Partners need to include only one line of JavaScript to place an ad unit on a web page. If no deals are identified for the ad units, then a stand-by ad unit is rendered with content "40 - 80% Off at ${partner web site}". In version 1, three types of ad units are supported: diff --git a/content/v1/authentication.md b/content/v1/authentication.md index 94cdedf..8a0b1ef 100644 --- a/content/v1/authentication.md +++ b/content/v1/authentication.md @@ -13,9 +13,9 @@ Your unique API key is provided in the Admin Dashboard. If at any time your key Add the api_key parameter to each GET, POST, and PUT request with the value of your unique API key: ## Request - - GET /v1/deals?api_key={api_key} + + GET /api/v1/deals?api_key={api_key} ## Request Example - GET /v1/deals?api_key=1234567 + GET /api/v1/deals?api_key=1234567 diff --git a/content/v1/deals.md b/content/v1/deals.md index 0a9af8c..9ad77bb 100644 --- a/content/v1/deals.md +++ b/content/v1/deals.md @@ -15,7 +15,7 @@ This request returns a single deal resource for a specific deal. ## Request - GET /deals/{deal_id}?api_key={api_key} + GET /api/v1/deals/{deal_id}?api_key={api_key} ## Request Parameters @@ -26,7 +26,7 @@ deal_id ## Request Example - GET /v1/deals/my-restaurant?api_key=1234567 + GET /api/v1/deals/my-restaurant?api_key=1234567 ## Response @@ -63,7 +63,7 @@ This request returns an array of deal resources, ordered by start_at time (with ## Request - GET /deals/locate?api_key={api_key} + GET /api/v1/deals/locate?api_key={api_key} ## Request Parameters @@ -80,7 +80,7 @@ radius ## Request Example -<%= requests("GET /v1/deals/locate?api_key=1234567") %> +<%= requests("GET /api/v1/deals/locate?api_key=1234567") %> <%= json(OfferEngine.deals_locate_request()) %> ## Response diff --git a/content/v1/full_purchase.md b/content/v1/full_purchase.md index 8f315d6..8d5c0f6 100644 --- a/content/v1/full_purchase.md +++ b/content/v1/full_purchase.md @@ -10,7 +10,7 @@ This single operation will create a new user if the user doesn't already exist, ## Request - POST /v1/purchases/full.json?api_key={api_key} + POST /api/v1/purchases/full.json?api_key={api_key} ## Request Parameters @@ -275,4 +275,4 @@ error_type = "validations_failed" ### Validation errors for user, payment card, purchase, and shipping address <%= headers 422 %> -<%= json(OfferEngine.full_purchase_error_all()) %> \ No newline at end of file +<%= json(OfferEngine.full_purchase_error_all()) %> diff --git a/content/v1/get_deals.md b/content/v1/get_deals.md index 7b8ec18..a60b9b2 100644 --- a/content/v1/get_deals.md +++ b/content/v1/get_deals.md @@ -12,9 +12,9 @@ Each deal has a number of attributes you can use to filter the Get Deals request If you make this call with no set parameters, Get Deals returns a list of all "in-flight" (currently active) deals across all geographical regions -- including deals that are sold out and deals that are not sold out. To avoid retrieving sold-out deals, we recommend that you set exclude_soldout to "true" when making this call. -## Request +## Request - GET /v1/deals?api_key={api_key} + GET /api/v1/deals?api_key={api_key} ## Request Parameters @@ -57,7 +57,7 @@ merchant price_min : _Optional Integer_ Filter the minimum deal price in cents (i.e., 100 equals one dollar). -price_max +price_max : _Optional Integer_ Filter the maximum deal price in cents. ### Location parameters @@ -81,14 +81,14 @@ user ### Source parameters -suppliers +suppliers : _Optional Array_ Filter deals by supplier (a partner slug or set of comma-separated partner slugs). vendors : _Optional Array_ Filter deals by vendor (a vendor slug or set of comma-separated vendor slugs). ### Inventory parameters - + num_left : _Optional Integer_ Filter deals by the quantity of inventory left. @@ -110,7 +110,7 @@ card_links_redeemed ### New user account, new payment card, and a shipping address: -<%= requests("GET /v1/deals?api_key=1234567") %> +<%= requests("GET /api/v1/deals?api_key=1234567") %> <%= json(OfferEngine.deals_request()) %> ## Response @@ -147,4 +147,4 @@ error_type = "find_failed" ## Error Response Example <%= headers 404 %> -<%= json(OfferEngine.deals_error()) %> \ No newline at end of file +<%= json(OfferEngine.deals_error()) %> diff --git a/content/v1/purchases.md b/content/v1/purchases.md index b932e57..843782f 100644 --- a/content/v1/purchases.md +++ b/content/v1/purchases.md @@ -16,7 +16,7 @@ This request retrieves a specific purchase object. It returns a representation o ### Request - GET /purchases/?api_key= + GET /api/v1/purchases/?api_key= ### Parameters @@ -24,7 +24,7 @@ None ### Request Example -<%= requests("GET /purchases/34063ec2.json?api_key=1234567") %> +<%= requests("GET /api/v1/purchases/34063ec2.json?api_key=1234567") %> ### Response @@ -56,7 +56,7 @@ deal_id : _String_ Unique identifier for deal purchased deal_type -: _String_ Type of deal purchased () +: _String_ Type of deal purchased (_possible results_) barcode : _String_ Unique barcode used for purchase redemption @@ -71,7 +71,7 @@ created_at : _String_ Date and time purchase was made state -: _String_ State of the purchase () +: _String_ State of the purchase (_possible results_) qrcode_url : _String_ URL for the qrcode image associated with the coupon @@ -90,7 +90,7 @@ redeemed_at This request creates a purchase for an existing user with a stored payment card. This operation will execute a purchase transaction for an existing user that already has a stored payment card. - POST /purchases + POST /api/v1/purchases ### Parameters deal_id @@ -118,7 +118,7 @@ session_id (optional) ## Reserve a purchase Temporarily reserve inventory (for five minutes) for a purchase in order to process payment transactions. If the transaction succeeds, you would perform a checkout; otherwise, you would return the inventory. - POST /purchases/reserve + POST /api/v1/purchases/reserve ### Parameters @@ -136,7 +136,7 @@ num_bought ## Claim a purchase After inventory has been reserved for a purchase and payment processing is successful, you would use this requent with your reservation token (the response from the reserve call) to create a purchase record from your reservation -- if the reservation is valid. If the reservation is invalid or expired, we will still attempt to create a purchase record; however, succes is not guaranteed because the deal might be sold out. - PUT /purchases/:purchase_id/claim + PUT /api/v1/purchases/:purchase_id/claim ### Parameters @@ -151,7 +151,7 @@ user_id ## Release a reserved purchase If you have reserved inventory for a purchase but the payment processing failed, use this request to release the inventory of the purchase. - PUT /purchases/:purchase_id/release + PUT /api/v1/purchases/:purchase_id/release ### Response diff --git a/content/v1/quick_start.md b/content/v1/quick_start.md index ab6f29a..d67a6a5 100644 --- a/content/v1/quick_start.md +++ b/content/v1/quick_start.md @@ -16,15 +16,15 @@ In order to use the Deem Offers API, you must be an approved Deem Offers partner To use the Deem Offers API, you must first get your partner API key from your Deem Offers Admin website. Keep this private key secret. You will provide this key with every API call you make. Here is an example of how your requests will look: - GET /v1/deals?api_key={api_key} + GET /api/v1/deals?api_key={api_key} To learn more about authentication, see [Authentication](/v1/authentication/). ## Step 2: Get Deals -The next step after getting your API key is to request available deals to display on your internet surface (your website, your emails, or your mobile app). To get a set of available San Francisco deals with inventory that is not currently sold out, make the following request: +The next step after getting your API key is to request available deals to display on your internet surface (your website, your emails, or your mobile app). To get a set of available San Francisco deals with inventory that is not currently sold out, make the following request: -<%= requests("GET /v1/deals?api_key=1234567") %> +<%= requests("GET /api/v1/deals?api_key=1234567") %> <%= json(OfferEngine.deals_request()) %> This request returns a set of deal resources containing all of the information you need to display deals on your internet surface, including the deal title, availability dates, inventory quantity, purchase limits, images, and additional attributes. The response looks like this: @@ -36,7 +36,7 @@ For more information about the Get Deals call, see [Get Deals](/v1/get_deals/). ## Step 3: Execute Purchases -After displaying deals on your internet surfaces, you are ready to execute a purchase for a purchaser. This purchase can be made with one simple call that includes the following: +After displaying deals on your internet surfaces, you are ready to execute a purchase for a purchaser. This purchase can be made with one simple call that includes the following: * user information * payment information * deal information @@ -44,7 +44,7 @@ After displaying deals on your internet surfaces, you are ready to execute a pur The purchase request looks like this: -<%= requests("POST /v1/purchases/full.json") %> +<%= requests("POST /api/v1/purchases/full.json") %> <%= json(OfferEngine.full_purchase_request_new()) %> When the purchase executes successfully, you receive a response similar to this: @@ -57,4 +57,4 @@ For more information about purchasing deals, see [Execute Purchases](/v1/full_pu ## Additional Requests -Additional requests -- such as getting deals from specific locations or regions, managing user sessions, getting user information, creating targted emails, and getting statistical information -- are included with the Deem Offers API. The additional calls are not necessary to provide Deem Offers deals to your customers, but you may find them useful. To learn more about additional requests, see [Additional Calls](/v1/advanced/). \ No newline at end of file +Additional requests -- such as getting deals from specific locations or regions, managing user sessions, getting user information, creating targted emails, and getting statistical information -- are included with the Deem Offers API. The additional calls are not necessary to provide Deem Offers deals to your customers, but you may find them useful. To learn more about additional requests, see [Additional Calls](/v1/advanced/). diff --git a/content/v1/regions/activity.md b/content/v1/regions/activity.md index 55fffc4..5082c45 100644 --- a/content/v1/regions/activity.md +++ b/content/v1/regions/activity.md @@ -10,7 +10,7 @@ title: Region Activities ## List all region's activities Returns an array of activity representations. - GET /regions/:region_id/activity + GET /api/v1/regions/:region_id/activity ### Response diff --git a/content/v1/regions/deals.md b/content/v1/regions/deals.md index ca35d3f..dd67c44 100644 --- a/content/v1/regions/deals.md +++ b/content/v1/regions/deals.md @@ -11,9 +11,9 @@ If you are using the "city, state" syntax, abbreviations are not accepted. "St *Important Note*: There are default filters "in_flight", "current", "not_bg" for backwards compatibility. Most partners will want to override the filter value with "in_flight". - GET /regions/:region_id/deals - GET /regions/:zip/deals - GET /regions/:city,:state/deals + GET /api/v1/regions/:region_id/deals + GET /api/v1/regions/:zip/deals + GET /api/v1/regions/:city,:state/deals ### Parameters diff --git a/content/v1/stats/merchants.md b/content/v1/stats/merchants.md index be71dba..17dcb9c 100644 --- a/content/v1/stats/merchants.md +++ b/content/v1/stats/merchants.md @@ -9,7 +9,7 @@ title: Merchants ## Get merchant stats Returns a csv file of all the merchants. - GET /stats/merchants + GET /api/v1/stats/merchants ### Response diff --git a/content/v1/targeted_emails/batches.md b/content/v1/targeted_emails/batches.md index fd2166e..0aff27d 100644 --- a/content/v1/targeted_emails/batches.md +++ b/content/v1/targeted_emails/batches.md @@ -11,7 +11,7 @@ title: Targeted Emails Batches ## Get a batch Returns a serialized representation of the batch. - GET /v1/targeted_email/batches/:batch_id + GET /api/v1/targeted_email/batches/:batch_id ### Parameters @@ -40,11 +40,11 @@ deal does not match batch's deal ## Create a batch -Creates a new targeted email batch. +Creates a new targeted email batch. Limited to 1000 user ids per request. Limited to 10 000 scheduled user ids per send_at day. - POST /v1/targeted_email/batches + POST /api/v1/targeted_email/batches ### Parameters @@ -115,7 +115,7 @@ is invalid ## Cancel a batch Cancels the batch. - DELETE /v1/targeted_email/batches/:batch_id + DELETE /api/v1/targeted_email/batches/:batch_id ### Parameters api_key @@ -160,4 +160,4 @@ failed : batch has delivered all of its targeted emails. One or more emails failed to send. cancelled -: batch was cancelled before its delivery time (send_at time). \ No newline at end of file +: batch was cancelled before its delivery time (send_at time). diff --git a/content/v1/users.md b/content/v1/users.md index a83ce2b..54bb253 100644 --- a/content/v1/users.md +++ b/content/v1/users.md @@ -17,7 +17,7 @@ user infered from an access token. ## Get a user - GET /users/:user_id + GET /api/v1/users/:user_id ### Response @@ -28,7 +28,7 @@ user infered from an access token. ## Create a user - POST /users + POST /api/v1/users ### Parameters @@ -73,7 +73,7 @@ session_id (optional) ## Update a user - PUT /users/:user_id + PUT /api/v1/users/:user_id ### Parameters @@ -135,23 +135,23 @@ The ramifications of this are as follows:- * assuming the user pre-exists in the offer engine - * if a token is included in the request but it has not changed + * if a token is included in the request but it has not changed then no further action is required - - * if a token is included in the request and there was not a token previously + + * if a token is included in the request and there was not a token previously then no further action is required - - * if a token is included in the request but it has changed - then the overwrite_token = true option must be included: - * this will instruct the api to update the users token with the new value, + + * if a token is included in the request but it has changed + then the overwrite_token = true option must be included: + * this will instruct the api to update the users token with the new value, failure to include the option will result in a 422 error - + * assuming the user does not exist yet in the offer engine - * this resource can still be PUT to, - resulting in the user being created in the offer engine: - The overwrite token is not required in this scenario - + * this resource can still be PUT to, + resulting in the user being created in the offer engine: + The overwrite token is not required in this scenario + ### Parameters @@ -163,7 +163,7 @@ token : * _String_ partner token * only valid with _api_token_ * see note above: optional overwrite_token=true might be required on the request - + first_name : _String_ @@ -188,7 +188,7 @@ is_deleted <%= headers 200 %> <%= json(:status => "success", :user => OfferEngine::USER) %> -* if the token has changed for an existing user and the overwrite_token=true option +* if the token has changed for an existing user and the overwrite_token=true option was not included on the request then the reponse will be <%= headers 422 %> diff --git a/content/v1/users/access_tokens.md b/content/v1/users/access_tokens.md index 2de15ac..0398532 100644 --- a/content/v1/users/access_tokens.md +++ b/content/v1/users/access_tokens.md @@ -12,7 +12,7 @@ Access tokens are temporary tokens which allow users to call APIs directly. Thin ## Create an access token - POST /users/:user/access_tokens + POST /api/v1/users/:user/access_tokens ### Parameters @@ -31,4 +31,4 @@ access ### Response <%= headers 200 %> -<%= json(:status => "success", :access_token => OfferEngine::ACCESS_TOKEN) %> \ No newline at end of file +<%= json(:status => "success", :access_token => OfferEngine::ACCESS_TOKEN) %> diff --git a/content/v1/users/card_links.md b/content/v1/users/card_links.md index c0b0632..cf0ac43 100644 --- a/content/v1/users/card_links.md +++ b/content/v1/users/card_links.md @@ -15,7 +15,7 @@ A card link represents a user linking to a deal. Once created, a card link will ## List all user's card links Returns an array of card link representations. - GET /users/:user_id/card_links + GET /api/v1/users/:user_id/card_links ### Parameters @@ -29,7 +29,7 @@ Returns an array of card link representations. ## Create a card link Creates a card link for a user and a deal or batch of deals in the linked state. - POST /card_links + POST /api/v1/card_links ### Parameters @@ -53,7 +53,7 @@ user_id ## Unlink a card link Used to change a card link from "linked" to "unlinked". - PUT /card_links/:card_link_id/unlink + PUT /api/v1/card_links/:card_link_id/unlink ### Response @@ -63,7 +63,7 @@ Used to change a card link from "linked" to "unlinked". ## Link a card link Used to change a card link from "unlinked" to "linked". - PUT /card_links/:card_link_id/link + PUT /api/v1/card_links/:card_link_id/link ### Response @@ -73,7 +73,7 @@ Used to change a card link from "unlinked" to "linked". ## Redeem a card link Used to notify us when a card link has been redeemed. - PUT /card_links/:card_link_id/redeem + PUT /api/v1/card_links/:card_link_id/redeem ### Parameters diff --git a/content/v1/users/coupons.md b/content/v1/users/coupons.md index 09487de..14c9cbe 100644 --- a/content/v1/users/coupons.md +++ b/content/v1/users/coupons.md @@ -10,7 +10,7 @@ title: User Coupons ## List all user's coupons Returns an array of coupon representations. - GET /users/:user_id/coupons + GET /api/v1/users/:user_id/coupons ### Parameters @@ -24,8 +24,8 @@ Returns an array of coupon representations. ## Redeem a coupon Marks a coupon as redeemed. - PUT /users/:user_id/coupons/:coupon_id/redeem - PUT /coupons/:coupon_id/redeem + PUT /api/v1/users/:user_id/coupons/:coupon_id/redeem + PUT /api/v1/coupons/:coupon_id/redeem ### Response diff --git a/content/v1/users/credit_cards.md b/content/v1/users/credit_cards.md index 023e4c8..5e5bfbd 100644 --- a/content/v1/users/credit_cards.md +++ b/content/v1/users/credit_cards.md @@ -11,7 +11,7 @@ title: User Credit Cards ## List all user's credit cards Returns an array of credit card representations. - GET /credit_cards + GET /api/v1/credit_cards ### Parameters @@ -28,7 +28,7 @@ user_id ## Create a credit card Stores a credit card for user purchases. - POST /credit_cards + POST /api/v1/credit_cards ### Parameters @@ -60,7 +60,7 @@ Make an existing credit card the default card. Note: If a user only has one credit card, it will be the default credit card. - PUT /credit_cards/:credit_card_id/default + PUT /api/v1/credit_cards/:credit_card_id/default ### Response diff --git a/content/v1/users/purchases.md b/content/v1/users/purchases.md index c685b25..99a7455 100644 --- a/content/v1/users/purchases.md +++ b/content/v1/users/purchases.md @@ -7,7 +7,7 @@ title: User Purchases ## List all user's purchases Returns an array of purchase representations. - GET /users/:user_id/purchases + GET /api/v1/users/:user_id/purchases ### Parameters @@ -17,4 +17,4 @@ Returns an array of purchase representations. ### Response <%= headers 200 %> -<%= json(:status => "success", :purchases => [OfferEngine.purchase]) %> \ No newline at end of file +<%= json(:status => "success", :purchases => [OfferEngine.purchase]) %> diff --git a/content/v1/users/saved_deals.md b/content/v1/users/saved_deals.md index 2345038..63ed2b1 100644 --- a/content/v1/users/saved_deals.md +++ b/content/v1/users/saved_deals.md @@ -13,7 +13,7 @@ A saved deal let's a user keep a list of deals for future reference. ## List all user's saved deals Returns an array of saved deal representations. - GET /users/:user_id/saved_deals + GET /api/v1/users/:user_id/saved_deals ### Parameters @@ -28,7 +28,7 @@ Returns an array of saved deal representations. ## Create a saved deal Creates a saved deal for a user and a deal. - POST /saved_deals + POST /api/v1/saved_deals ### Parameters @@ -46,9 +46,9 @@ user_id ## Delete a saved deal Deletes a saved deal. - DELETE /saved_deals/:saved_deal_id + DELETE /api/v1/saved_deals/:saved_deal_id ### Response <%= headers 200 %> -<%= json(:status => "success") %> \ No newline at end of file +<%= json(:status => "success") %> diff --git a/content/v1/users/shipping_addresses.md b/content/v1/users/shipping_addresses.md index 5d66842..4794220 100644 --- a/content/v1/users/shipping_addresses.md +++ b/content/v1/users/shipping_addresses.md @@ -9,7 +9,7 @@ Store a shipping address for a user Note: All addresses are geo-located and corrected for typos. - POST /shipping_addresss + POST /api/v1/shipping_addresss ### Parameters diff --git a/content/v1/users/subscriptions.md b/content/v1/users/subscriptions.md index de78f58..27a08e0 100644 --- a/content/v1/users/subscriptions.md +++ b/content/v1/users/subscriptions.md @@ -12,8 +12,8 @@ title: Subscriptions ## List all user's subscriptions Returns an array of subscription representations. - GET /users/:user_id/subscriptions - GET /users/:user_email/subscriptions + GET /api/v1/users/:user_id/subscriptions + GET /api/v1/users/:user_email/subscriptions ### Parameters @@ -27,7 +27,7 @@ Returns an array of subscription representations. ## Get a subscription Returns a serialized representation of the subscription. - GET /subscriptions/:subscription_id + GET /api/v1/subscriptions/:subscription_id ### Response @@ -36,7 +36,7 @@ Returns a serialized representation of the subscription. ## Create a subscription - POST /users/:user_id/subscriptions + POST /api/v1/users/:user_id/subscriptions ### Parameters @@ -48,7 +48,7 @@ zip ## Update a subscription - PUT /subscriptions/:subscription_id + PUT /api/v1/subscriptions/:subscription_id ### Parameters diff --git a/content/v3/regions/deals.md b/content/v3/regions/deals.md index 5076281..de93bfd 100644 --- a/content/v3/regions/deals.md +++ b/content/v3/regions/deals.md @@ -11,9 +11,9 @@ If you are using the "city, state" syntax, abbreviations are not accepted. "St *Important Note*: There are default filters "in_flight", "current", "not_bg" for backwards compatibility. Most partners will want to override the filter value with "in_flight". - GET /regions/:region_id/deals - GET /regions/:zip/deals - GET /regions/:city,:state/deals + GET /api/v3/regions/:region_id/deals + GET /api/v3/regions/:zip/deals + GET /api/v3/regions/:city,:state/deals ### Parameters @@ -26,4 +26,4 @@ user_id (optional) ### Response <%= headers 200 %> -<%= json(:status => "success", :deals => [OfferEngine::V3.deal]) %> \ No newline at end of file +<%= json(:status => "success", :deals => [OfferEngine::V3.deal]) %> diff --git a/layouts/default.html b/layouts/default.html index ccfca80..13f2ef8 100644 --- a/layouts/default.html +++ b/layouts/default.html @@ -60,25 +60,23 @@

Getting Started

  • Quick Start
  • -

    V3 Core Calls

    +

    V3

    -

    V1 Core Calls

    - - -

    V1 Additional Calls

    +

    V1

    -

    V3 Additional Calls

    -
    diff --git a/lib/resources/deal.rb b/lib/resources/deal.rb index f39faac..7b677b4 100644 --- a/lib/resources/deal.rb +++ b/lib/resources/deal.rb @@ -196,7 +196,6 @@ def self.deal_success def self.deals_empty { :deals => [], - :next_page => '"https://api.offers.deem.com//api/v3/deals?fields=tags%2Cincentive_percentage%2Crobotitle%2Ccategory%2Ctitle%2Cstate%2Cprice%2Cregion%2Ctype%2Cimages%5Bsmall%2Clarge%5D&filter=lat_long%5B34.0936203%2C-118.377601624%2C5%5D%2Ccategory%5BShopping2%5D&page=2&per_page=100"' } end @@ -268,17 +267,19 @@ def self.deal_resource fulfillment_method : _String_ How the consumer redeems the deal: -: * redemptioncoded - A purchase grants the customer a code which is provided by a merchant that can be redeemed on the merchant's website. -: * printed - A user pays for and prints out a physical coupon to bring to a store to redeem for a discount on goods or services. -: * shipped - The purchase is shipped to the customer +:^ +* redemptioncoded - A purchase grants the customer a code which is provided by a merchant that can be redeemed on the merchant's website. +* printed - A user pays for and prints out a physical coupon to bring to a store to redeem for a discount on goods or services. +* shipped - The purchase is shipped to the customer highlights : _String_ Additional important details about the deal images : _Hash_ A list of deal images in different sizes. Each image is available in the following sizes: - * large, medium, small, and tiny - * Each item points to the images URL. +:^ +* large, medium, small, and tiny +* Each item points to the images URL. incentive_amount : _Integer_ A flat amount of discount in cents that a user gets for using this deal (only for card-linked deals) @@ -354,7 +355,8 @@ def self.deal_resource state : _String_ The current workflow state of the deal: -: * in-flight - The deal is available for purchase. (This is the only state returned by the API) +: ^ +* in-flight - The deal is available for purchase. (This is the only state returned by the API) subcategory : _String_ More specific deal type @@ -370,23 +372,15 @@ def self.deal_resource type : _String_ Type of the purchased deal -: Daily Deal: -: The Daily Deal is a prepaid voucher which is in-flight on a partner site for a short period of time. -: -: On-going: -: A long-running prepaid voucher deal which is in-flight on partner sites for more than 15 days. -: -: Affiliate: -: A a deal that can be claimed by a consumer for free. The consumer can click the Claim this deal button to obtain a coupon code. -: -: Affiliate deals do not have actual purchases or vouchers associated with them. A user claims an affiliate deal which: -: -: a) exposes a redeemable code. -: OR -: b) redirects the user to a co-marketed website. -: -: Card-linked Offers: -: A card-linked offer (CLO) is an offer linked to a payment card. The user links an offer to his or her card without having to pay anything. When the user buys the product or service from the qualifying merchant, the offer is applied to the transaction immediately, reducing the card charge, or is applied as a credit to the card. +: ^ +* Daily Deal - The Daily Deal is a prepaid voucher which is in-flight on a partner site for a short period of time. +* On-going - A long-running prepaid voucher deal which is in-flight on partner sites for more than 15 days. +* Affiliate - A deal that can be claimed by a consumer for free. The consumer can click the Claim this deal button to obtain a coupon code. + * Affiliate deals do not have actual purchases or vouchers associated with them. A user claims an affiliate deal which: + * a) exposes a redeemable code. + * OR + * b) redirects the user to a co-marketed website. +* Card-linked Offers - A card-linked offer (CLO) is an offer linked to a payment card. The user links an offer to his or her card without having to pay anything. When the user buys the product or service from the qualifying merchant, the offer is applied to the transaction immediately, reducing the card charge, or is applied as a credit to the card. value : _Integer_ The value of the deal in cents @@ -771,7 +765,6 @@ def self.deal_success def self.deals_empty { :deals => [], - :next_page => '"https://api.offers.deem.com//api/v3/deals?fields=tags%2Cincentive_percentage%2Crobotitle%2Ccategory%2Ctitle%2Cstate%2Cprice%2Cregion%2Ctype%2Cimages%5Bsmall%2Clarge%5D&filter=lat_long%5B34.0936203%2C-118.377601624%2C5%5D%2Ccategory%5BShopping2%5D&page=2&per_page=100"' } end @@ -840,9 +833,10 @@ def self.deal_resource fulfillment_method : _String_ How the consumer redeems the deal: -: * redemptioncoded - A purchase grants the customer a code which is provided by a merchant that can be redeemed on the merchant's website. -: * printed - A user pays for and prints out a physical coupon to bring to a store to redeem for a discount on goods or services. -: * shipped - The purchase is shipped to the customer +: ^ +* redemptioncoded: A purchase grants the customer a code which is provided by a merchant that can be redeemed on the merchant's website. +* printed: A user pays for and prints out a physical coupon to bring to a store to redeem for a discount on goods or services. +* shipped: The purchase is shipped to the customer highlights : _String_ Additional important details about the deal @@ -903,8 +897,9 @@ def self.deal_resource primary_image : _Hash_ A list of deal images in different sizes. Each image is available in the following sizes: - * _103, _135, _180, _198, _222, _300, _306, _316, _372, _400, _498, _640, _660, featured, large, medium, show, thumb, tiny, and xlarge - * Each item has a hash with the dimensions and URL. +: ^ +* _103, _135, _180, _198, _222, _300, _306, _316, _372, _400, _498, _640, _660, featured, large, medium, show, thumb, tiny, and xlarge +* Each item has a hash with the dimensions and URL. purchasable_number : _Integer_ The quantity of units available to sell. This combines logic from max_per_user, and num_left @@ -944,16 +939,16 @@ def self.deal_resource state : _String_ The current workflow state of the deal: - -: * submitted - Base deal data has been entered and the deal is not available for purchase. -: * in-review - The deal needs approval to continue in the workflow and is not available for purchase. -: * rejected - The deal failed approval and is not available for purchase. -: * approved - The content is complete and the deal is ready to be run, but not yet available for purchase. -: * in-flight - The deal is available for purchase. -: * paused - The deal's sale is halted and the deal is not currently available for purchase. -: * cancelled - The deal has been manually canelled and is no longer in flight -: * landed - The run window has passed and the deal is no longer available for purchase. -: * deleted - The deal has been removed.

    +: ^ +* submitted - Base deal data has been entered and the deal is not available for purchase. +* in-review - The deal needs approval to continue in the workflow and is not available for purchase. +* rejected - The deal failed approval and is not available for purchase. +* approved - The content is complete and the deal is ready to be run, but not yet available for purchase. +* in-flight - The deal is available for purchase. +* paused - The deal's sale is halted and the deal is not currently available for purchase. +* cancelled - The deal has been manually canelled and is no longer in flight +* landed - The run window has passed and the deal is no longer available for purchase. +* deleted - The deal has been removed.

    subcategory : _String_ More specific deal type @@ -972,26 +967,19 @@ def self.deal_resource type : _String_ Type of the purchased deal -: Daily Deal: -: The Daily Deal is a prepaid voucher which is in-flight on a partner site for a short period of time. -: -: On-going: -: A long-running prepaid voucher deal which is in-flight on partner sites for more than 15 days. -: -: Affiliate: -: A a deal that can be claimed by a consumer for free. The consumer can click the Claim this deal button to obtain a coupon code. -: -: Affiliate deals do not have actual purchases or vouchers associated with them. A user claims an affiliate deal which: -: -: a) exposes a redeemable code. -: OR -: b) redirects the user to a co-marketed website. -: -: Card-linked Offers: -: A card-linked offer (CLO) is an offer linked to a payment card. The user links an offer to his or her card without having to pay anything. When the user buys the product or service from the qualifying merchant, the offer is applied to the transaction immediately, reducing the card charge, or is applied as a credit to the card. +: ^ +* Daily Deal - The Daily Deal is a prepaid voucher which is in-flight on a partner site for a short period of time. +* On-going - A long-running prepaid voucher deal which is in-flight on partner sites for more than 15 days. +* Affiliate - A a deal that can be claimed by a consumer for free. + * The consumer can click the Claim this deal button to obtain a coupon code. + * Affiliate deals do not have actual purchases or vouchers associated with them. A user claims an affiliate deal which: + * a) exposes a redeemable code. + * OR + * b) redirects the user to a co-marketed website. +* Card-linked Offers - A card-linked offer (CLO) is an offer linked to a payment card. The user links an offer to his or her card without having to pay anything. When the user buys the product or service from the qualifying merchant, the offer is applied to the transaction immediately, reducing the card charge, or is applied as a credit to the card. value : _Integer_ The value of the deal in cents " end -end \ No newline at end of file +end