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

Create Form

Developer Preview

Creates a form.

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/forms

Body Params

NAME
TYPE
DESCRIPTION
form
Required

object

The form to be created

Response Object

NAME
TYPE
DESCRIPTION
form

object

The created form

Status/Error Codes

The response will include an HTTP status code.

Was this helpful?

Create Form

Creates a customer bookings form

Request

curl

Copy Code
1curl -X POST \
2 'https://www.wixapis.com/bookings/v1/forms' \
3 -H "Content-Type: application/json" \
4 -H 'Authorization: <AUTH>' \
5 --data '{
6 "form": {
7 "header": {
8 "description": "Tell us a bit about yourself",
9 "title": "Add Your Info",
10 "isDescriptionHidden": false
11 },
12 "actionLabels": {
13 "offlinePaymentLabel": "Book It",
14 "onlinePaymentLabel": "Pay Now",
15 "bookingRequestApprovalLabel": "Request To Book"
16 },
17 "name": {
18 "label": "Name"
19 },
20 "email": {
21 "label": "Email"
22 },
23 "phone": {
24 "label": "Phone Number"
25 },
26 "numberOfParticipants": {
27 "label": "Number of Participants"
28 },
29 "address": {
30 "street": {
31 "label": "Street"
32 },
33 "city": {
34 "label": "City"
35 },
36 "floorNumber": {
37 "label": "Apt. / Floor No.",
38 "userConstraints": {
39 "required": false
40 }
41 },
42 "state": {
43 "label": "State",
44 "userConstraints": {
45 "required": false
46 }
47 }
48 },
49 "customFields": [
50 {
51 "valueType": "LONG_TEXT",
52 "label": "Add Your Message",
53 "userConstraints": {
54 "required": false
55 }
56 }
57 ]
58 }
59 }'

Response

json

1
2{"form": {
3 "id": "a8119733-f872-4b0a-963b-09a95208474e",
4 "header": {
5 "description": "Tell us a bit about yourself",
6 "title": "Add Your Info",
7 "isDescriptionHidden": false
8 },
9 "actionLabels": {
10 "offlinePaymentLabel": "Book It",
11 "onlinePaymentLabel": "Pay Now",
12 "bookingRequestApprovalLabel": "Request To Book"
13 },
14 "name": {
15 "fieldId": "fbe7fc3b-c30e-4ebe-8699-b272a120b178",
16 "valueType": "SHORT_TEXT",
17 "label": "Name",
18 "userConstraints": {"required": true},
19 "additionalLabels": []
20 },
21 "email": {
22 "fieldId": "30c5f37d-e7c8-4c57-879b-bcd75252d668",
23 "valueType": "SHORT_TEXT",
24 "label": "Email",
25 "userConstraints": {"required": true},
26 "additionalLabels": []
27 },
28 "phone": {
29 "fieldId": "0691f056-ac53-48e1-a4d7-5f4a6509d8eb",
30 "valueType": "SHORT_TEXT",
31 "label": "Phone Number",
32 "userConstraints": {"required": false},
33 "additionalLabels": []
34 },
35 "numberOfParticipants": {
36 "fieldId": "9f362e51-461b-4f5c-85b1-d4fb355543b9",
37 "valueType": "SHORT_TEXT",
38 "label": "Number of Participants",
39 "userConstraints": {"required": true},
40 "additionalLabels": []
41 },
42 "address": {
43 "street": {
44 "fieldId": "c1e68eb8-bc6e-419f-b6c7-7e57d7ff968e",
45 "valueType": "SHORT_TEXT",
46 "label": "Street",
47 "userConstraints": {"required": true},
48 "additionalLabels": []
49 },
50 "city": {
51 "fieldId": "42337533-6fd6-4f7c-906f-beb69c63aa99",
52 "valueType": "SHORT_TEXT",
53 "label": "City",
54 "userConstraints": {"required": true},
55 "additionalLabels": []
56 },
57 "floorNumber": {
58 "fieldId": "3c258e9a-3fdd-4cd3-83f9-44b4f47a12de",
59 "valueType": "SHORT_TEXT",
60 "label": "Apt. / Floor No.",
61 "userConstraints": {"required": false},
62 "additionalLabels": []
63 },
64 "state": {
65 "fieldId": "b7957be3-0776-40da-9a47-7fbb0b832538",
66 "valueType": "SHORT_TEXT",
67 "label": "State",
68 "userConstraints": {"required": false},
69 "additionalLabels": []
70 }
71 },
72 "customFields": [ {
73 "fieldId": "fd57ad23-22c0-4049-b674-0c95512ca078",
74 "valueType": "LONG_TEXT",
75 "label": "Add Your Message",
76 "userConstraints": {"required": false},
77 "additionalLabels": []
78 }]
79}}