Skip to content

Commit 03fc258

Browse files
committed
Changed Rewards to Wallets in Spec
1 parent aa1696b commit 03fc258

File tree

1 file changed

+76
-6
lines changed

1 file changed

+76
-6
lines changed

apiary.apib

Lines changed: 76 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2213,7 +2213,7 @@ Note: Do html redirect to the password reset successful page and kill the active
22132213
}
22142214

22152215
### Refund Booking [POST /bookings/:booking_id/refund]
2216-
Refunds should go to the customers rewards balance, so he can use it for another booking
2216+
Refunds should go to the customers wallet's balance, so he can use it for another booking
22172217

22182218
+ Headers
22192219
Authorization: dd3343ae567c8f8a0b9e8f
@@ -3852,9 +3852,10 @@ Remember to requery the transaction to confirm the true state from the processor
38523852

38533853
+ Response 401 (text/html)
38543854

3855-
## Rewards [/rewards]
3855+
## Wallets [/wallets]
38563856

3857-
### Get Reward Balance [GET /rewards/balance]
3857+
### Get Wallet Balance [GET /wallets/balance]
3858+
If user_id is not provided, get current users wallet balance
38583859

38593860
+ Headers
38603861
Authorization: dd3343ae567c8f8a0b9e8f
@@ -3911,7 +3912,7 @@ Remember to requery the transaction to confirm the true state from the processor
39113912
"data": {}
39123913
}
39133914

3914-
### Get User Rewards [GET /rewards/me]
3915+
### Get Current User's Wallet Statement [GET /wallets/me]
39153916

39163917
+ Headers
39173918
Authorization: dd3343ae567c8f8a0b9e8f
@@ -3971,6 +3972,75 @@ Remember to requery the transaction to confirm the true state from the processor
39713972
"data": {}
39723973
}
39733974

3975+
+ Response 401 (application/json)
3976+
3977+
{
3978+
"status": "error",
3979+
"message": "unauthorized", // May come with a more detailed message sometimes
3980+
"data": {}
3981+
}
3982+
3983+
### Get User's Wallet Statement [GET /wallets/user/:user_id]
3984+
3985+
+ Headers
3986+
Authorization: dd3343ae567c8f8a0b9e8f
3987+
3988+
+ Parameters
3989+
+ skip (Number) - Number of records to skip
3990+
+ limit (Number) - Number of records to return
3991+
+ user_id (String) - Id of the user we want to get a statement for
3992+
3993+
+ Response 200 (application/json)
3994+
3995+
{
3996+
"status": "success",
3997+
"data": [{
3998+
"id": "2d3343ae567c8f8a0b9e8f",
3999+
"balance": 2000,
4000+
"description": "Reward for writing this description",
4001+
"user_id": "2d3343ae567c8f8a0b9e8f"
4002+
},{
4003+
"id": "2d3343ae567c8f8a0b9e8f",
4004+
"balance": 2000,
4005+
"description": "Reward for writing this description",
4006+
"user_id": "2d3343ae567c8f8a0b9e8f"
4007+
}],
4008+
"total": 200,
4009+
"limit": 10,
4010+
"skip": 20
4011+
}
4012+
4013+
+ Response 400 (application/json)
4014+
4015+
{
4016+
"status": "error",
4017+
"message": "bad request", // May come with a more detailed message sometimes
4018+
"data": {}
4019+
}
4020+
4021+
+ Response 503 (application/json)
4022+
4023+
{
4024+
"status": "error",
4025+
"message": "forbidden", // May come with a more detailed message sometimes
4026+
"data": {}
4027+
}
4028+
4029+
+ Response 404 (application/json)
4030+
4031+
{
4032+
"status": "error",
4033+
"message": "not found"
4034+
}
4035+
4036+
+ Response 500 (application/json)
4037+
4038+
{
4039+
"status": "error",
4040+
"message": "server error", // May come with a more detailed message sometimes
4041+
"data": {}
4042+
}
4043+
39744044
+ Response 401 (application/json)
39754045

39764046
{
@@ -3979,7 +4049,7 @@ Remember to requery the transaction to confirm the true state from the processor
39794049
"data": {}
39804050
}
39814051

3982-
### Credit User Rewards [POST /rewards/credit]
4052+
### Credit User's Wallet [POST /wallets/credit]
39834053

39844054
+ Headers
39854055
Authorization: dd3343ae567c8f8a0b9e8f
@@ -4043,7 +4113,7 @@ Remember to requery the transaction to confirm the true state from the processor
40434113
"data": {}
40444114
}
40454115

4046-
### Debit User Rewards [POST /rewards/debit]
4116+
### Debit User's Wallet [POST /wallets/debit]
40474117

40484118
+ Headers
40494119
Authorization: dd3343ae567c8f8a0b9e8f

0 commit comments

Comments
 (0)