Coupons
Coupons
GET
https://api.woowup.com/apiv3/coupons
Retrieve a list of redeemed coupons by assign_date descending
Path Parameters
Name
Type
Description
status
string
"available", "assigned", "pending", "cancelled", "used"
from
string
Min assign_date of the returned coupons. Format yyyy-mm-dd hh:mm:ss (UTC
to
string
Max assign_date of the returned coupons. Format yyyy-mm-dd hh:mm:ss (UTC)
page
number
Number of the page returned. Default 0
limit
number
Items per page returned. Default 25, MAX 100
[
{
"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"
}
}
]
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'
Update Coupon
PUT
https://api.woowup.com/apiv3/coupons/:code
Request Body
Name
Type
Description
status
string
[
{
"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"
}
}
]
{
"payload": {
"errors": [
"/status: Value \"qwerty\" is not one of: [\"available\",\"assigned\",\"pending\",\"cancelled\",\"used\"]"
]
},
"message": "bad request",
"code": "bad_request",
"time": "42ms"
}
{
"payload": [],
"message": "Can't update coupon",
"code": "internal_error",
"time": "82ms"
}
curl -X PUT \
https://api.woowup.com/apiv3/coupons/abcdefg \
-H 'accept: application/json' \
-H 'authorization: Basic XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX' \
-d '{
"status": "cancelled"
}'
Last updated
Was this helpful?