Deem Offers API Documentation

User Card Links

A card link represents a user linking to a deal. Once created, a card link will have a state of either “linked”, “unlinked”, or “fulfilled”.

Returns an array of card link representations.

GET /users/:user_id/card_links

Parameters

filter (optional)
String Filter the list according to applicable filters (comma-separated). These include: “linked”, “unlinked”, “fulfilled”.
count (optional)
Boolean Returns the count instead of the list. If present, per_page and page will be ignored.
per_page (optional)
Integer Limits the size of the list. Default is 100. Max is 1000.
page (optional)
Integer Returns the list corresponding to the page number if the result cannot be displayed in a single page. Default is 1.

Response

Status: 200 OK
{
  "status": "success",
  "card_links": [
    {
      "id": "k3dk20d4",
      "deal_id": "dk3kd0a",
      "user_id": "dkd90e0",
      "merchant_id": "dfk9o3k",
      "state": "linked"
    }
  ]
}

Creates a card link for a user and a deal or batch of deals in the linked state.

POST /card_links

Parameters

deal_id
String Id of the deal

or

deal_ids
Optional String Comma seperated list of deal ids (eg: ?deal_ids=”first-deal,second-deal”)
Optional Array Multi-value list of deal ids (eq: ?deal_ids[]=”first-deal”&deal_ids[]=”second-deal”)
user_id
String Id of the user

Response

Status: 200 OK
{
  "status": "success",
  "card_link": {
    "id": "k3dk20d4",
    "deal_id": "dk3kd0a",
    "user_id": "dkd90e0",
    "merchant_id": "dfk9o3k",
    "state": "linked"
  }
}

Used to change a card link from “linked” to “unlinked”.

PUT /card_links/:card_link_id/unlink

Response

Status: 200 OK
{
  "status": "success",
  "card_link": {
    "id": "k3dk20d4",
    "deal_id": "dk3kd0a",
    "user_id": "dkd90e0",
    "merchant_id": "dfk9o3k",
    "state": "unlinked"
  }
}

Used to change a card link from “unlinked” to “linked”.

PUT /card_links/:card_link_id/link

Response

Status: 200 OK
{
  "status": "success",
  "card_link": {
    "id": "k3dk20d4",
    "deal_id": "dk3kd0a",
    "user_id": "dkd90e0",
    "merchant_id": "dfk9o3k",
    "state": "linked"
  }
}

Used to notify us when a card link has been redeemed.

PUT /card_links/:card_link_id/redeem

Parameters

transaction_amount
Integer total amount charged in cents
transaction_date
String XML DateTime formatted as “YYYY-MM-DDThh:mm:ss”; i.e. 2012-02-06T21:39:51-08:00
transaction_reference
String
max_redemption
Boolean Set to true if this redemption fulfills the card link.

Response

Status: 200 OK
{
  "status": "success"
}