Coupons

get
Coupons

https://api.woowup.com/apiv3/coupons
Retrieve a list of redeemed coupons by assign_date descending
Request
Response
Request
Path Parameters
status
optional
string
"available", "assigned", "pending", "cancelled", "used"
from
optional
string
Min assign_date of the returned coupons. Format yyyy-mm-dd hh:mm:ss (UTC
to
optional
string
Max assign_date of the returned coupons. Format yyyy-mm-dd hh:mm:ss (UTC)
page
optional
number
Number of the page returned. Default 0
limit
optional
number
Items per page returned. Default 25, MAX 100
Response
200: OK
[
{
"id": 1234,
"code": "ASE34AWVS21",
"assign_date": "2017-05-10 14:32:12",
"status": "assigned",
"user": {
"userapp_id": 1234,
"user_id": 1234,
"app_id": 123,
"service_uid": "98765",
"email": "user@email.com",
"first_name": "John",
"last_name": "Doe",
"telephone": "5411987654321",
"birthday": "1986-08-13",
"gender": "M",
"tags": [],
"points": 0,
"points_pending": 0,
"customform": {
"user_id": "98765"
},
"club_inscription_date": "2017-01-03",
"blocked": false,
"notes": "user notes",
"mailing_enabled": true,
"mailing_enabled_reason": null
},
"benefit": {
"id": 1234,
"slug": "benefit-1-title",
"title": "Benefit 1 title",
"description": "Benefit 1 description",
"terms": "Terms and condition",
"on_assign_msg": "After assign message",
"status": 1,
"app_id": 123,
"startdate": "2017-04-20 14:51:00",
"enddate": "2017-05-17 19:34:25",
"action_id": 5678,
"image_url": "https://api.woowup.com/image.png"
}
},
{
"id": 1235,
"code": "ASE34AWVS22",
"assign_date": null,
"status": "available",
"user": null,
"benefit": {
"id": 1234,
"slug": "benefit-1-title",
"title": "Benefit 1 title",
"description": "Benefit 1 description",
"terms": "Terms and condition",
"on_assign_msg": "After assign message",
"status": 1,
"app_id": 123,
"startdate": "2017-04-20 14:51:00",
"enddate": "2017-05-17 19:34:25",
"action_id": 5678,
"image_url": "https://api.woowup.com/image.png"
}
}
]
400: Bad Request
500: Internal Server Error

Example

curl -X GET \
'https://api.woowup.com/apiv3/coupons?status=assigned&limit=100&page=0&from=2017-01-01%2000%3A00%3A00&to=2017-05-31%2023%3A59%3A59' \
-H 'accept: application/json' \
-H 'authorization: Basic XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX' \
-H 'cache-control: no-cache'

put
Update Coupon

https://api.woowup.com/apiv3/coupons/:code
Request
Response
Request
Body Parameters
status
optional
string
Response
200: OK
[
{
"id": 1234,
"code": "abcdefg",
"assign_date": "2017-05-10 14:32:12",
"status": "cancelled",
"user": {
"userapp_id": 1234,
"user_id": 1234,
"app_id": 123,
"service_uid": "98765",
"email": "user@email.com",
"first_name": "John",
"last_name": "Doe",
"telephone": "5411987654321",
"birthday": "1986-08-13",
"gender": "M",
"tags": [],
"points": 0,
"points_pending": 0,
"customform": {
"user_id": "98765"
},
"club_inscription_date": "2017-01-03",
"blocked": false,
"notes": "user notes",
"mailing_enabled": true,
"mailing_enabled_reason": null
},
"benefit": {
"id": 1234,
"slug": "benefit-1-title",
"title": "Benefit 1 title",
"description": "Benefit 1 description",
"terms": "Terms and condition",
"on_assign_msg": "After assign message",
"status": 1,
"app_id": 123,
"startdate": "2017-04-20 14:51:00",
"enddate": "2017-05-17 19:34:25",
"action_id": 5678,
"image_url": "https://api.woowup.com/image.png"
}
}
]
400: Bad Request
{
"payload": {
"errors": [
"/status: Value \"qwerty\" is not one of: [\"available\",\"assigned\",\"pending\",\"cancelled\",\"used\"]"
]
},
"message": "bad request",
"code": "bad_request",
"time": "42ms"
}
500: Internal Server Error
{
"payload": [],
"message": "Can't update coupon",
"code": "internal_error",
"time": "82ms"
}

{ "$schema": "http://json-schema.org/draft-04/schema#", "description": "A representation of a coupon", "type": "object", "required": ["status"], "properties": { "status": { "type": "string", "enum": ["available", "assigned", "pending", "cancelled", "used"] } }

curl -X PUT \
https://api.woowup.com/apiv3/coupons/abcdefg \
-H 'accept: application/json' \
-H 'authorization: Basic XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX' \
-d '{
"status": "cancelled"
}'