-
Notifications
You must be signed in to change notification settings - Fork 0
/
experience.http
102 lines (86 loc) · 1.81 KB
/
experience.http
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
###
### Create Experience
POST http://localhost:8888/experiences
Content-Type: application/json
{
"name": "Alpaca walks",
"duration": 1,
"locations": [
{
"name": "Munich",
"timeslots": [
{
"name": "Mondays at 13:00",
"price": {
"name": "10EUR",
"rate": 10
}
}
]
},
{
"name": "Hamburg",
"timeslots": [
{
"name": "Saturdays at 11:00",
"price": {
"name": "20EUR",
"rate": 20
}
}
]
}
]
}
###
### Get Experience as Category
GET http://localhost:8888/experiences/category
Accept: application/json
> {%
if(response.body.length > 0){
client.global.set("experience_id", response.body[0].id);
}
%}
### Experience with location
GET http://localhost:8888/experiences
Accept: application/json
> {%
if(response.body.length > 0){
client.global.set("location_id", response.body[0].locations[0].id);
}
%}
### Get a location by id
GET http://localhost:8888/experiences/location/{{location_id}}
Accept: application/json
> {%
if(response.body){
client.global.set("timeslot_id", response.body.timeslots[0].id);
}
%}
### Assign price to timeslot
POST http://localhost:8888/prices/assign-to-timeslot
Content-Type: application/json
{
"name": "20EUR",
"rate": 20,
"timeslot": {
"id": "{{timeslot_id}}"
}
}
### Create a voucher with an appointment setup
POST http://localhost:8888/vouchers
Content-Type: application/json
{
"totalAmount": 45,
"customer": {
"name": "Bosd Doe",
"address": "Jose street 2332"
},
"appointment": {
"experienceID": "{{experience_id}}",
"locationID": "{{location_id}}",
"timeslot": {
"id": "{{timeslot_id}}"
}
}
}