Search.../
  1. Home
  2. Getting Started
  3. Overview
Generate a test token to explore our APIs

Create Service

Developer Preview

Creates a service

Authorization

This endpoint requires an authorization header - pass the access token from the OAuth installation flow.

Permissions

This endpoint requires the Manage Bookings permission scope.

POST

https://www.wixapis.com/bookings/v1/services

Body Params

NAME
TYPE
DESCRIPTION
service
Required

object

The service to be created.

schedules
Required

Array<object>

List of schedules to be assigned for that service. Currently only a single schedule is allowed.

Response Object

NAME
TYPE
DESCRIPTION
id

string

The Id of the created service.

Status/Error Codes

The response will include an HTTP status code.

Was this helpful?

Create a class service

Create a Yoga class service taking place every Monday and Wednesday

Request

curl

Copy Code
1curl -X POST \
2 'https://www.wixapis.com/bookings/v1/services' \
3 -H "Content-Type: application/json" \
4 -H 'Authorization: <AUTH>' \
5 --data '
6 {
7 "service": {
8 "info": {
9 "name": "Astanga Yoga",
10 "images": [
11 {
12 "id": "57c6c8b4-fca3-416b-bae5-8c614e1ab6e6",
13 "width": 3000,
14 "height": 2001,
15 "url": "57c6c8b4fca3416bbae58c614e1ab6e6.jpg"
16 }
17 ],
18 "tagLine": "Describe here"
19 },
20 "policy": {
21 "isBookOnlineAllowed": true,
22 "bookingsApprovalPolicy": {
23 "requestsAffectsAvailability": true,
24 "isBusinessApprovalRequired": false
25 }
26 },
27 "paymentOptions": {
28 "wixPayOnline": true
29 },
30 "customProperties": {
31 "uouHidden": "false"
32 },
33 "categoryId": "442d101a-37b1-4769-81e5-4e7f809585e8"
34 },
35 "schedules": [
36 {
37 "scheduleOwnerId": "361110db-a07d-4877-9058-bef7f29e7b78",
38 "firstSessionStart": "2020-02-22T08:00:00Z",
39 "lastSessionEnd": "2021-02-20T09:00:00Z",
40 "timeZone": "Asia/Jerusalem",
41 "intervals": [
42 {
43
44 "start": "2020-02-19T22:00:00Z",
45 "end": "2021-02-20T21:59:59.999Z",
46 "interval": {
47 "daysOfWeek": "MON",
48 "hourOfDay": 10,
49 "minuteOfHour": 0,
50 "duration": 60
51 },
52 "frequency": {
53 "repetition": 1
54 },
55 "affectedSchedules": [
56 {
57 "scheduleId": "71286e3b-8391-47ed-a78b-cf3be0e4db1b",
58 "transparency": "BUSY",
59 "scheduleOwnerId": "b48faa02-2f23-4253-85e2-55cd27deef97"
60 }
61 ]
62 },
63 {
64
65 "start": "2020-02-19T22:00:00Z",
66 "end": "2021-02-20T21:59:59.999Z",
67 "interval": {
68 "daysOfWeek": "WED",
69 "hourOfDay": 10,
70 "minuteOfHour": 0,
71 "duration": 60
72 },
73 "frequency": {
74 "repetition": 1
75 },
76 "affectedSchedules": [
77 {
78 "scheduleId": "71286e3b-8391-47ed-a78b-cf3be0e4db1b",
79 "transparency": "BUSY",
80 "scheduleOwnerId": "b48faa02-2f23-4253-85e2-55cd27deef97"
81 }
82 ]
83 },
84 {
85
86 "start": "2020-02-19T22:00:00Z",
87 "end": "2021-02-20T21:59:59.999Z",
88 "interval": {
89 "daysOfWeek": "SAT",
90 "hourOfDay": 10,
91 "minuteOfHour": 0,
92 "duration": 60
93 },
94 "frequency": {
95 "repetition": 1
96 },
97 "affectedSchedules": [
98 {
99 "scheduleId": "71286e3b-8391-47ed-a78b-cf3be0e4db1b",
100 "transparency": "BUSY",
101 "scheduleOwnerId": "b48faa02-2f23-4253-85e2-55cd27deef97"
102 }
103 ]
104 }
105 ],
106 "title": "Astanga Yoga",
107 "tags": [
108 "GROUP"
109 ],
110 "location": {
111 "locationType": "OWNER_BUSINESS"
112 },
113 "capacity": 50,
114 "rate": {
115 "labeledPriceOptions": {
116 "general": {
117 "amount": "9.99",
118 "currency": "USD",
119 "downPayAmount": "0"
120 }
121 }
122 },
123 "availability": {
124 "start": "2020-02-19T22:00:00Z",
125 "end": "2021-02-20T21:59:59.999Z"
126 },
127 "status": "CREATED"
128 }
129 ]
130 }'

Response

json

1
2{"id": "19ab8b27-2cf5-4f79-b92d-2ec24285e6c7"}
Create Appointment Service
Create a course service