Skip to content

Latest commit

 

History

History
213 lines (180 loc) · 6.29 KB

offers-en.md

File metadata and controls

213 lines (180 loc) · 6.29 KB

Merchant API

Merchant deals

List of all merchant deals

GET /merchants/offers.json

Returns list of all merchant deals.

Ответ сервера:

{
  "offers": [
    {
      "deal": {
        "title": "Билет на концерт Evdokimov Show с программой «Я сделал всех!» в Государственном московском театре эстрады",
        "options": [
          {
            "title": "Билет на концерт Evdokimov Show «Я сделал всех!». Партер, 16 ряд, 16-30. 1000 рублей вместо 2000",
            "max_limit": 25,
            "valid_to": "2012-04-26",
            "unlimited": false,
            "bought": 0,
            "discount": 50,
            "usual_price": 2000,
            "price": 1000
          },
          {
            "title": "Билет на концерт Evdokimov Show «Я сделал всех!». Партер, 9 ряд, места 32-44. 1500 рублей вместо 3000",
            "max_limit": 12,
            "valid_to": "2012-04-26",
            "unlimited": false,
            "bought": 0,
            "discount": 50,
            "usual_price": 3000,
            "price": 1500
          }
        ],
        "images": [
          {
            "large_promo": "http://i3.grouponcdn.ru/system/offers/000/077/336/179511/large_promo_jpg.jpg?1334590278",
            "promo": "http://i1.grouponcdn.ru/system/offers/000/077/336/179511/promo_jpg.jpg?1334590278",
            "small": "http://i1.grouponcdn.ru/system/offers/000/077/336/179511/small_jpg.jpg?1334590278"
          }
        ],
        "category": {
          "name": "Развлечения и спорт"
        },
        "multideal": true,
        "sub_category": {
          "name": "NEW Концерт/Шоу"
        },
        "places": [
          {
            "metro_station": null,
            "address": "Берсеневская наб., д. 20/2",
            "longitude": 37.6101855933667,
            "latitude": 55.744220459861
          }
        ]
        },
        "id": 326056,
        "url": "http://groupon.ru/moscow/evdokimovshow"
    },
    # ...
  ]
}

Detailed information about merchant specific deal

GET /merchants/offers/#{id}.json

Returns detailed information about merchant specific deal.

Parameters:

  • id - deal ID

Response:

{
  "offer": {
    "deal": {
      "title": "Билет на концерт Evdokimov Show с программой «Я сделал всех!» в Государственном московском театре эстрады",
      "options": [
        {
          "title": "Билет на концерт Evdokimov Show «Я сделал всех!». Партер, 16 ряд, 16-30. 1000 рублей вместо 2000",
          "max_limit": 25,
          "valid_to": "2012-04-26",
          "unlimited": false,
          "bought": 0,
          "discount": 50,
          "usual_price": 2000,
          "price": 1000
        },
        {
          "title": "Билет на концерт Evdokimov Show «Я сделал всех!». Партер, 9 ряд, места 32-44. 1500 рублей вместо 3000",
          "max_limit": 12,
          "valid_to": "2012-04-26",
          "unlimited": false,
          "bought": 0,
          "discount": 50,
          "usual_price": 3000,
          "price": 1500
        }
      ],
      "images": [
        {
          "large_promo": "http://i3.grouponcdn.ru/system/offers/000/077/336/179511/large_promo_jpg.jpg?1334590278",
          "promo": "http://i1.grouponcdn.ru/system/offers/000/077/336/179511/promo_jpg.jpg?1334590278",
          "small": "http://i1.grouponcdn.ru/system/offers/000/077/336/179511/small_jpg.jpg?1334590278"
        }
      ],
      "category": {
        "name": "Развлечения и спорт"
      },
      "multideal": true,
      "sub_category": {
        "name": "NEW Концерт/Шоу"
      },
      "places": [
        {
          "metro_station": null,
          "address": "Берсеневская наб., д. 20/2",
          "longitude": 37.6101855933667,
          "latitude": 55.744220459861
        }
      ]
    },
    "id": 326056,
    "url": "http://groupon.ru/moscow/evdokimovshow"
  }
}

Increase coupons limit

PUT /merchants/offers/#{id}/increase_limit.json

Increases coupon limit for merchant specific deal.

Parameters:

  • id - deal ID
  • amount - amount to increase
  • option_id - deal option ID

Response:

Server will respond with 200 OK status on success. Otherwise it will response with error message.

Decrease coupons limit

PUT /merchants/offers/#{id}/decrease_limit.json

Decreases coupon limit for merchant specific deal.

Parameters:

  • id - deal ID
  • amount - amount to decrease
  • option_id - deal option ID

Response:

Server will respond with 200 OK status on success. Otherwise it will response with error message.

Response fields description:

  • deal - deal information
    • multideal - is it a "multi-deal"?
    • options - deal options
      • id - deal option ID
      • title - deal option title
      • price - coupon price
      • bought - amount of sold coupons
      • usual_price - usual price (without discount)
      • discount - discount (in percentage)
      • max_limit - maximum possible amount of coupons to be sold
      • unlimited - is amount of coupons limited?
      • valid_to - coupon expiration date
    • category - category
      • name - category name
    • title - deal title
    • places - deal venues
      • address - venue address
      • latitude - latitude coordinate
      • longitude - longitude coordinate
      • metro_station - closest metro station
        • name - metro station name
        • latitude - latitude coordinate
        • longitude - longitude coordinate
    • images - deal images
      • promo - normal size
      • large_promo - large size
      • small - small size
    • sub_category - subcategory
      • name - subcategory name
    • merchant - merchant
      • name - merchant name
  • url - deal url
  • id - deal ID