Deem Offers API Documentation

User Coupons

List all user’s coupons

Returns an array of coupon representations.

GET /users/:user_id/coupons

Parameters

filter (optional)
String Filter the list according to applicable filters (comma-separated). These include: “valid”, “redeemed”, “expired”.
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",
  "coupons": [
    {
      "id": "a21c5452d8",
      "expires_at": null,
      "created_at": "Fri Dec 16 19:14:55 UTC 2011",
      "qr_code_url": "http://domain/coupon/qr_code/ab231c9e",
      "qr_code": "apaosidnqw4tdsdpqi45jf091835ukdfq3-40695.kfmdg-q09i6m'ldfi8nqk6",
      "state": "valid",
      "redemption_code": null,
      "redeemed_at": null,
      "print_url": "http://domain/coupons/a21c5452d8/print"
    }
  ]
}

Redeem a coupon

Marks a coupon as redeemed.

PUT /users/:user_id/coupons/:coupon_id/redeem
PUT /coupons/:coupon_id/redeem

Response

Status: 200 OK
{
  "status": "success",
  "coupon": {
    "id": "a21c5452d8",
    "expires_at": null,
    "created_at": "Fri Dec 16 19:14:55 UTC 2011",
    "qr_code_url": "http://domain/coupon/qr_code/ab231c9e",
    "qr_code": "apaosidnqw4tdsdpqi45jf091835ukdfq3-40695.kfmdg-q09i6m'ldfi8nqk6",
    "state": "redeemed",
    "redemption_code": null,
    "redeemed_at": "Fri Dec 16 21:14:55 UTC 2011",
    "print_url": "http://domain/coupons/a21c5452d8/print"
  }
}