Create Booking for Client
Creates a new booking for a client by an artist. This endpoint allows artists to create bookings on behalf of their clients, optionally including session details. If the client doesn’t exist, a new client account will be created.
curl --request POST \
--url http://localhost:3000/api/bookings/create-for-client \
--header 'Content-Type: application/json' \
--data '
{
"clientEmail": "jsmith@example.com",
"clientFirstName": "<string>",
"includeSession": true,
"clientLastName": "<string>",
"clientPhoneNumber": {
"countryCode": "<string>",
"number": "<string>"
},
"notes": "<string>",
"sessionDate": 123,
"sessionStartTime": 123,
"sessionEndTime": 123,
"sessionPrice": "<string>",
"sessionDepositFee": "<string>"
}
'import requests
url = "http://localhost:3000/api/bookings/create-for-client"
payload = {
"clientEmail": "jsmith@example.com",
"clientFirstName": "<string>",
"includeSession": True,
"clientLastName": "<string>",
"clientPhoneNumber": {
"countryCode": "<string>",
"number": "<string>"
},
"notes": "<string>",
"sessionDate": 123,
"sessionStartTime": 123,
"sessionEndTime": 123,
"sessionPrice": "<string>",
"sessionDepositFee": "<string>"
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
clientEmail: 'jsmith@example.com',
clientFirstName: '<string>',
includeSession: true,
clientLastName: '<string>',
clientPhoneNumber: {countryCode: '<string>', number: '<string>'},
notes: '<string>',
sessionDate: 123,
sessionStartTime: 123,
sessionEndTime: 123,
sessionPrice: '<string>',
sessionDepositFee: '<string>'
})
};
fetch('http://localhost:3000/api/bookings/create-for-client', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_PORT => "3000",
CURLOPT_URL => "http://localhost:3000/api/bookings/create-for-client",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'clientEmail' => 'jsmith@example.com',
'clientFirstName' => '<string>',
'includeSession' => true,
'clientLastName' => '<string>',
'clientPhoneNumber' => [
'countryCode' => '<string>',
'number' => '<string>'
],
'notes' => '<string>',
'sessionDate' => 123,
'sessionStartTime' => 123,
'sessionEndTime' => 123,
'sessionPrice' => '<string>',
'sessionDepositFee' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "http://localhost:3000/api/bookings/create-for-client"
payload := strings.NewReader("{\n \"clientEmail\": \"jsmith@example.com\",\n \"clientFirstName\": \"<string>\",\n \"includeSession\": true,\n \"clientLastName\": \"<string>\",\n \"clientPhoneNumber\": {\n \"countryCode\": \"<string>\",\n \"number\": \"<string>\"\n },\n \"notes\": \"<string>\",\n \"sessionDate\": 123,\n \"sessionStartTime\": 123,\n \"sessionEndTime\": 123,\n \"sessionPrice\": \"<string>\",\n \"sessionDepositFee\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("http://localhost:3000/api/bookings/create-for-client")
.header("Content-Type", "application/json")
.body("{\n \"clientEmail\": \"jsmith@example.com\",\n \"clientFirstName\": \"<string>\",\n \"includeSession\": true,\n \"clientLastName\": \"<string>\",\n \"clientPhoneNumber\": {\n \"countryCode\": \"<string>\",\n \"number\": \"<string>\"\n },\n \"notes\": \"<string>\",\n \"sessionDate\": 123,\n \"sessionStartTime\": 123,\n \"sessionEndTime\": 123,\n \"sessionPrice\": \"<string>\",\n \"sessionDepositFee\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("http://localhost:3000/api/bookings/create-for-client")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"clientEmail\": \"jsmith@example.com\",\n \"clientFirstName\": \"<string>\",\n \"includeSession\": true,\n \"clientLastName\": \"<string>\",\n \"clientPhoneNumber\": {\n \"countryCode\": \"<string>\",\n \"number\": \"<string>\"\n },\n \"notes\": \"<string>\",\n \"sessionDate\": 123,\n \"sessionStartTime\": 123,\n \"sessionEndTime\": 123,\n \"sessionPrice\": \"<string>\",\n \"sessionDepositFee\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"bookingId": "<string>",
"clientCreated": true
}{
"message": "<string>"
}{
"message": "<string>"
}{
"message": "<string>"
}Body
Email address of the client
First name of the client
1Whether to include a session with the booking
Last name of the client (optional)
Phone number of the client (optional)
Show child attributes
Show child attributes
Description or notes for the booking (optional)
Type of session (required if includeSession is true)
CONSULTATION, TATTOO Timestamp for the session date (required if includeSession is true)
Timestamp for session start time (required if includeSession is true)
Timestamp for session end time (required if includeSession is true)
Location for the session (optional, defaults to artist's primary location)
Show child attributes
Show child attributes
Price for the session (optional)
Deposit fee for the session (optional, must be less than sessionPrice)
curl --request POST \
--url http://localhost:3000/api/bookings/create-for-client \
--header 'Content-Type: application/json' \
--data '
{
"clientEmail": "jsmith@example.com",
"clientFirstName": "<string>",
"includeSession": true,
"clientLastName": "<string>",
"clientPhoneNumber": {
"countryCode": "<string>",
"number": "<string>"
},
"notes": "<string>",
"sessionDate": 123,
"sessionStartTime": 123,
"sessionEndTime": 123,
"sessionPrice": "<string>",
"sessionDepositFee": "<string>"
}
'import requests
url = "http://localhost:3000/api/bookings/create-for-client"
payload = {
"clientEmail": "jsmith@example.com",
"clientFirstName": "<string>",
"includeSession": True,
"clientLastName": "<string>",
"clientPhoneNumber": {
"countryCode": "<string>",
"number": "<string>"
},
"notes": "<string>",
"sessionDate": 123,
"sessionStartTime": 123,
"sessionEndTime": 123,
"sessionPrice": "<string>",
"sessionDepositFee": "<string>"
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
clientEmail: 'jsmith@example.com',
clientFirstName: '<string>',
includeSession: true,
clientLastName: '<string>',
clientPhoneNumber: {countryCode: '<string>', number: '<string>'},
notes: '<string>',
sessionDate: 123,
sessionStartTime: 123,
sessionEndTime: 123,
sessionPrice: '<string>',
sessionDepositFee: '<string>'
})
};
fetch('http://localhost:3000/api/bookings/create-for-client', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_PORT => "3000",
CURLOPT_URL => "http://localhost:3000/api/bookings/create-for-client",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'clientEmail' => 'jsmith@example.com',
'clientFirstName' => '<string>',
'includeSession' => true,
'clientLastName' => '<string>',
'clientPhoneNumber' => [
'countryCode' => '<string>',
'number' => '<string>'
],
'notes' => '<string>',
'sessionDate' => 123,
'sessionStartTime' => 123,
'sessionEndTime' => 123,
'sessionPrice' => '<string>',
'sessionDepositFee' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "http://localhost:3000/api/bookings/create-for-client"
payload := strings.NewReader("{\n \"clientEmail\": \"jsmith@example.com\",\n \"clientFirstName\": \"<string>\",\n \"includeSession\": true,\n \"clientLastName\": \"<string>\",\n \"clientPhoneNumber\": {\n \"countryCode\": \"<string>\",\n \"number\": \"<string>\"\n },\n \"notes\": \"<string>\",\n \"sessionDate\": 123,\n \"sessionStartTime\": 123,\n \"sessionEndTime\": 123,\n \"sessionPrice\": \"<string>\",\n \"sessionDepositFee\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("http://localhost:3000/api/bookings/create-for-client")
.header("Content-Type", "application/json")
.body("{\n \"clientEmail\": \"jsmith@example.com\",\n \"clientFirstName\": \"<string>\",\n \"includeSession\": true,\n \"clientLastName\": \"<string>\",\n \"clientPhoneNumber\": {\n \"countryCode\": \"<string>\",\n \"number\": \"<string>\"\n },\n \"notes\": \"<string>\",\n \"sessionDate\": 123,\n \"sessionStartTime\": 123,\n \"sessionEndTime\": 123,\n \"sessionPrice\": \"<string>\",\n \"sessionDepositFee\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("http://localhost:3000/api/bookings/create-for-client")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"clientEmail\": \"jsmith@example.com\",\n \"clientFirstName\": \"<string>\",\n \"includeSession\": true,\n \"clientLastName\": \"<string>\",\n \"clientPhoneNumber\": {\n \"countryCode\": \"<string>\",\n \"number\": \"<string>\"\n },\n \"notes\": \"<string>\",\n \"sessionDate\": 123,\n \"sessionStartTime\": 123,\n \"sessionEndTime\": 123,\n \"sessionPrice\": \"<string>\",\n \"sessionDepositFee\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"bookingId": "<string>",
"clientCreated": true
}{
"message": "<string>"
}{
"message": "<string>"
}{
"message": "<string>"
}