Project

General

Profile

Coupon


Get Coupons

This method retrieves a list of coupons you received or created.

Request

Method URI
GET /coupons

* Parameters

Parameter Name Value Optional Description
direction String Y The direction of the coupon to get. Acceptable values are:
- "out": Gets created coupons (default)
- "in": Gets received coupons
status String Y The status of the inventory to include or exclude
- Available values are:
-- "O" : open
-- "S" : redeemed
-- "D" : denied
-- "E" : expired
- If you don't specify this value, this method retrieves coupons in any status
- You can pass a comma-separated string to specify multiple status to include/exclude
- You can add a minus( - ) sign to specify a status to exclude

* Request body

Do not supply a request body with this method.
 

Response

If successful, this method returns a list of the the coupon resource as "data" in the response body.

Example

  • GET /coupons
    • Retrieves a list of created coupons
  • GET /coupons?direction=in
    • Retrieves a list of received coupons
  • GET /coupons?status=-E
    • Retrieves a list of inventories not in EXPIRED status
  • GET /coupons?status=O
    • Retrieves a list of coupons in OPEN status

Get Coupon

This method retrieves a specific coupon.

Request

Method URI
GET /coupons/{coupon_id}

* Parameters

Parameter Name Value Optional Description
coupon_id Integer The ID of the coupon to get

* Request body

Do not supply a request body with this method.
 

Response

If successful, this method returns a coupon resource as "data" in the response body.

Example

  • GET /coupons/1234
    • Retrieves a specific coupon with coupon ID #1234

Create Coupon

Creates a new coupon for a buyer

Request

Method URI
POST /coupons

* Parameters

Do not supply a request parameter with this method.

* Request body

In the request body, supply a coupon resource. The coupon resource should includes:

 

Response

If successful, this method returns a coupon resource as "data" in the response body.

Example

  • POST /coupons
    • Creates a new coupon

Update Coupon

This method updates properties of the specified coupon.

Request

Method URI
PUT /coupons/{coupon_id}

* Parameters

Parameter Name Value Optional Description
coupon_id Integer The ID of the coupon to update

* Request body

In the request body, supply a coupon resource. The coupon resource can includes:

 

Response

If successful, this method returns a coupon resource as "data" in the response body.

Example

  • PUT /coupons/1234
    • Updates coupon #1234

Delete Coupon

This method deletes the specified coupon.

Request

Method URI
DELETE /coupons/{coupon_id}

* Parameters

Parameter Name Value Optional Description
coupon_id Integer The ID of the coupon to delete

* Request body

Do not supply a request body with this method.
 

Response

If successful, this method returns an empty "data".

Example

  • DELETE /coupons/1234
    • Deletes coupon #1234

Add picture from clipboard (Maximum size: 24.4 MB)