Create a new service
Create a service on a shop. A bundle cannot also be marked as a base service or add-on, and it cannot reference another bundle.
curl --request POST \
--url https://api.guile.app/shops/{shopId}/services \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "Skin Fade",
"bundledAddOns": [
{
"id": "service-123",
"name": "Beard Trim"
}
],
"categories": [
{
"id": "afada02b-e9fe",
"name": "Shaving"
}
],
"description": "Expertly transitioned fade with optional designs on the side.",
"duration": "PT30M",
"cost": "45.00",
"ageRestrictions": {
"min": 18,
"max": 100
}
}
'import requests
url = "https://api.guile.app/shops/{shopId}/services"
payload = {
"name": "Skin Fade",
"bundledAddOns": [
{
"id": "service-123",
"name": "Beard Trim"
}
],
"categories": [
{
"id": "afada02b-e9fe",
"name": "Shaving"
}
],
"description": "Expertly transitioned fade with optional designs on the side.",
"duration": "PT30M",
"cost": "45.00",
"ageRestrictions": {
"min": 18,
"max": 100
}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'Skin Fade',
bundledAddOns: [{id: 'service-123', name: 'Beard Trim'}],
categories: [{id: 'afada02b-e9fe', name: 'Shaving'}],
description: 'Expertly transitioned fade with optional designs on the side.',
duration: 'PT30M',
cost: '45.00',
ageRestrictions: {min: 18, max: 100}
})
};
fetch('https://api.guile.app/shops/{shopId}/services', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.guile.app/shops/{shopId}/services",
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([
'name' => 'Skin Fade',
'bundledAddOns' => [
[
'id' => 'service-123',
'name' => 'Beard Trim'
]
],
'categories' => [
[
'id' => 'afada02b-e9fe',
'name' => 'Shaving'
]
],
'description' => 'Expertly transitioned fade with optional designs on the side.',
'duration' => 'PT30M',
'cost' => '45.00',
'ageRestrictions' => [
'min' => 18,
'max' => 100
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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 := "https://api.guile.app/shops/{shopId}/services"
payload := strings.NewReader("{\n \"name\": \"Skin Fade\",\n \"bundledAddOns\": [\n {\n \"id\": \"service-123\",\n \"name\": \"Beard Trim\"\n }\n ],\n \"categories\": [\n {\n \"id\": \"afada02b-e9fe\",\n \"name\": \"Shaving\"\n }\n ],\n \"description\": \"Expertly transitioned fade with optional designs on the side.\",\n \"duration\": \"PT30M\",\n \"cost\": \"45.00\",\n \"ageRestrictions\": {\n \"min\": 18,\n \"max\": 100\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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("https://api.guile.app/shops/{shopId}/services")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Skin Fade\",\n \"bundledAddOns\": [\n {\n \"id\": \"service-123\",\n \"name\": \"Beard Trim\"\n }\n ],\n \"categories\": [\n {\n \"id\": \"afada02b-e9fe\",\n \"name\": \"Shaving\"\n }\n ],\n \"description\": \"Expertly transitioned fade with optional designs on the side.\",\n \"duration\": \"PT30M\",\n \"cost\": \"45.00\",\n \"ageRestrictions\": {\n \"min\": 18,\n \"max\": 100\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.guile.app/shops/{shopId}/services")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"Skin Fade\",\n \"bundledAddOns\": [\n {\n \"id\": \"service-123\",\n \"name\": \"Beard Trim\"\n }\n ],\n \"categories\": [\n {\n \"id\": \"afada02b-e9fe\",\n \"name\": \"Shaving\"\n }\n ],\n \"description\": \"Expertly transitioned fade with optional designs on the side.\",\n \"duration\": \"PT30M\",\n \"cost\": \"45.00\",\n \"ageRestrictions\": {\n \"min\": 18,\n \"max\": 100\n }\n}"
response = http.request(request)
puts response.read_body{
"name": "Skin Fade",
"bundledAddOns": [
{
"id": "service-123",
"name": "Beard Trim"
}
],
"categories": [
{
"id": "afada02b-e9fe",
"name": "Shaving"
}
],
"description": "Expertly transitioned fade with optional designs on the side.",
"id": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"duration": "PT30M",
"cost": "45.00",
"addOn": {
"duration": "PT30M",
"cost": "45.00"
},
"ageRestrictions": {
"min": 18,
"max": 100
}
}{
"type": "<string>",
"title": "<string>",
"occurredAt": "2023-11-07T05:31:56Z",
"id": "<string>",
"status": 349,
"detail": "<string>",
"instance": "<string>",
"attributes": {},
"recovery": {
"rateLimit": {
"limit": 123,
"remaining": 123,
"resetsAt": "2023-11-07T05:31:56Z"
}
},
"problems": [
{
"type": "<string>",
"title": "<string>",
"occurredAt": "2023-11-07T05:31:56Z",
"id": "<string>",
"status": 349,
"detail": "<string>",
"instance": "<string>",
"attributes": {}
}
]
}{
"type": "<string>",
"title": "<string>",
"occurredAt": "2023-11-07T05:31:56Z",
"id": "<string>",
"status": 349,
"detail": "<string>",
"instance": "<string>",
"attributes": {},
"recovery": {
"rateLimit": {
"limit": 123,
"remaining": 123,
"resetsAt": "2023-11-07T05:31:56Z"
}
},
"problems": [
{
"type": "<string>",
"title": "<string>",
"occurredAt": "2023-11-07T05:31:56Z",
"id": "<string>",
"status": 349,
"detail": "<string>",
"instance": "<string>",
"attributes": {}
}
]
}{
"type": "<string>",
"title": "<string>",
"occurredAt": "2023-11-07T05:31:56Z",
"id": "<string>",
"status": 349,
"detail": "<string>",
"instance": "<string>",
"attributes": {},
"recovery": {
"rateLimit": {
"limit": 123,
"remaining": 123,
"resetsAt": "2023-11-07T05:31:56Z"
}
},
"problems": [
{
"type": "<string>",
"title": "<string>",
"occurredAt": "2023-11-07T05:31:56Z",
"id": "<string>",
"status": 349,
"detail": "<string>",
"instance": "<string>",
"attributes": {}
}
]
}{
"type": "<string>",
"title": "<string>",
"occurredAt": "2023-11-07T05:31:56Z",
"id": "<string>",
"status": 349,
"detail": "<string>",
"instance": "<string>",
"attributes": {},
"recovery": {
"rateLimit": {
"limit": 123,
"remaining": 123,
"resetsAt": "2023-11-07T05:31:56Z"
}
},
"problems": [
{
"type": "<string>",
"title": "<string>",
"occurredAt": "2023-11-07T05:31:56Z",
"id": "<string>",
"status": 349,
"detail": "<string>",
"instance": "<string>",
"attributes": {}
}
]
}{
"type": "<string>",
"title": "<string>",
"occurredAt": "2023-11-07T05:31:56Z",
"id": "<string>",
"status": 349,
"detail": "<string>",
"instance": "<string>",
"attributes": {},
"recovery": {
"rateLimit": {
"limit": 123,
"remaining": 123,
"resetsAt": "2023-11-07T05:31:56Z"
}
},
"problems": [
{
"type": "<string>",
"title": "<string>",
"occurredAt": "2023-11-07T05:31:56Z",
"id": "<string>",
"status": 349,
"detail": "<string>",
"instance": "<string>",
"attributes": {}
}
]
}{
"type": "<string>",
"title": "<string>",
"occurredAt": "2023-11-07T05:31:56Z",
"id": "<string>",
"status": 349,
"detail": "<string>",
"instance": "<string>",
"attributes": {},
"recovery": {
"rateLimit": {
"limit": 123,
"remaining": 123,
"resetsAt": "2023-11-07T05:31:56Z"
}
},
"problems": [
{
"type": "<string>",
"title": "<string>",
"occurredAt": "2023-11-07T05:31:56Z",
"id": "<string>",
"status": 349,
"detail": "<string>",
"instance": "<string>",
"attributes": {}
}
]
}{
"type": "<string>",
"title": "<string>",
"occurredAt": "2023-11-07T05:31:56Z",
"id": "<string>",
"status": 349,
"detail": "<string>",
"instance": "<string>",
"attributes": {},
"recovery": {
"rateLimit": {
"limit": 123,
"remaining": 123,
"resetsAt": "2023-11-07T05:31:56Z"
}
},
"problems": [
{
"type": "<string>",
"title": "<string>",
"occurredAt": "2023-11-07T05:31:56Z",
"id": "<string>",
"status": 349,
"detail": "<string>",
"instance": "<string>",
"attributes": {}
}
]
}Path Parameters
The unique, opaque system identifier for a resource. This case-sensitive ID is also used as path parameters in URLs or in other properties or parameters that reference a resource by ID rather than URL.
Body
Properties for creating a new service for a barber.
A service can be configured as a base service, add-on, or bundle. When configured as a bundle, the service cannot be configured as an add-on or included in another bundle.
Services that are not bundles and have configurations for being used as a base service, an add-on, or both.
The display name for this service.
"Skin Fade"
The visibility of the service. Hidden services are not visible to customers.
visible, hidden Additional add-on services included in this service bundle.
Show child attributes
Show child attributes
[
{ "id": "service-123", "name": "Beard Trim" }
]
The categories for this service.
Show child attributes
Show child attributes
[
{ "id": "afada02b-e9fe", "name": "Shaving" }
]
The description of this service.
500"Expertly transitioned fade with optional designs on the side."
The duration of the service.
"PT30M"
The cost of the service, excluding any fees or taxes.
^-?(0|[1-9][0-9]*)\.[0-9][0-9]$"45.00"
If set, the configuration for this service when used as an add-on.
Show child attributes
Show child attributes
The age restrictions, if any, for this service.
Show child attributes
Show child attributes
Response
Created.
Representation of a service performed by a barber.
The display name for this service.
"Skin Fade"
The visibility of the service. Hidden services are not visible to customers.
visible, hidden Additional add-on services included in this service bundle.
Show child attributes
Show child attributes
[
{ "id": "service-123", "name": "Beard Trim" }
]
The categories for this service.
Show child attributes
Show child attributes
[
{ "id": "afada02b-e9fe", "name": "Shaving" }
]
The description of this service.
500"Expertly transitioned fade with optional designs on the side."
The unique identifier for this service.
The duration of the service.
"PT30M"
The cost of the service, excluding any fees or taxes.
^-?(0|[1-9][0-9]*)\.[0-9][0-9]$"45.00"
If set, the configuration for this service when used as an add-on.
Show child attributes
Show child attributes
The age restrictions, if any, for this service.
Show child attributes
Show child attributes
Was this page helpful?
curl --request POST \
--url https://api.guile.app/shops/{shopId}/services \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "Skin Fade",
"bundledAddOns": [
{
"id": "service-123",
"name": "Beard Trim"
}
],
"categories": [
{
"id": "afada02b-e9fe",
"name": "Shaving"
}
],
"description": "Expertly transitioned fade with optional designs on the side.",
"duration": "PT30M",
"cost": "45.00",
"ageRestrictions": {
"min": 18,
"max": 100
}
}
'import requests
url = "https://api.guile.app/shops/{shopId}/services"
payload = {
"name": "Skin Fade",
"bundledAddOns": [
{
"id": "service-123",
"name": "Beard Trim"
}
],
"categories": [
{
"id": "afada02b-e9fe",
"name": "Shaving"
}
],
"description": "Expertly transitioned fade with optional designs on the side.",
"duration": "PT30M",
"cost": "45.00",
"ageRestrictions": {
"min": 18,
"max": 100
}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'Skin Fade',
bundledAddOns: [{id: 'service-123', name: 'Beard Trim'}],
categories: [{id: 'afada02b-e9fe', name: 'Shaving'}],
description: 'Expertly transitioned fade with optional designs on the side.',
duration: 'PT30M',
cost: '45.00',
ageRestrictions: {min: 18, max: 100}
})
};
fetch('https://api.guile.app/shops/{shopId}/services', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.guile.app/shops/{shopId}/services",
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([
'name' => 'Skin Fade',
'bundledAddOns' => [
[
'id' => 'service-123',
'name' => 'Beard Trim'
]
],
'categories' => [
[
'id' => 'afada02b-e9fe',
'name' => 'Shaving'
]
],
'description' => 'Expertly transitioned fade with optional designs on the side.',
'duration' => 'PT30M',
'cost' => '45.00',
'ageRestrictions' => [
'min' => 18,
'max' => 100
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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 := "https://api.guile.app/shops/{shopId}/services"
payload := strings.NewReader("{\n \"name\": \"Skin Fade\",\n \"bundledAddOns\": [\n {\n \"id\": \"service-123\",\n \"name\": \"Beard Trim\"\n }\n ],\n \"categories\": [\n {\n \"id\": \"afada02b-e9fe\",\n \"name\": \"Shaving\"\n }\n ],\n \"description\": \"Expertly transitioned fade with optional designs on the side.\",\n \"duration\": \"PT30M\",\n \"cost\": \"45.00\",\n \"ageRestrictions\": {\n \"min\": 18,\n \"max\": 100\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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("https://api.guile.app/shops/{shopId}/services")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Skin Fade\",\n \"bundledAddOns\": [\n {\n \"id\": \"service-123\",\n \"name\": \"Beard Trim\"\n }\n ],\n \"categories\": [\n {\n \"id\": \"afada02b-e9fe\",\n \"name\": \"Shaving\"\n }\n ],\n \"description\": \"Expertly transitioned fade with optional designs on the side.\",\n \"duration\": \"PT30M\",\n \"cost\": \"45.00\",\n \"ageRestrictions\": {\n \"min\": 18,\n \"max\": 100\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.guile.app/shops/{shopId}/services")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"Skin Fade\",\n \"bundledAddOns\": [\n {\n \"id\": \"service-123\",\n \"name\": \"Beard Trim\"\n }\n ],\n \"categories\": [\n {\n \"id\": \"afada02b-e9fe\",\n \"name\": \"Shaving\"\n }\n ],\n \"description\": \"Expertly transitioned fade with optional designs on the side.\",\n \"duration\": \"PT30M\",\n \"cost\": \"45.00\",\n \"ageRestrictions\": {\n \"min\": 18,\n \"max\": 100\n }\n}"
response = http.request(request)
puts response.read_body{
"name": "Skin Fade",
"bundledAddOns": [
{
"id": "service-123",
"name": "Beard Trim"
}
],
"categories": [
{
"id": "afada02b-e9fe",
"name": "Shaving"
}
],
"description": "Expertly transitioned fade with optional designs on the side.",
"id": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"duration": "PT30M",
"cost": "45.00",
"addOn": {
"duration": "PT30M",
"cost": "45.00"
},
"ageRestrictions": {
"min": 18,
"max": 100
}
}{
"type": "<string>",
"title": "<string>",
"occurredAt": "2023-11-07T05:31:56Z",
"id": "<string>",
"status": 349,
"detail": "<string>",
"instance": "<string>",
"attributes": {},
"recovery": {
"rateLimit": {
"limit": 123,
"remaining": 123,
"resetsAt": "2023-11-07T05:31:56Z"
}
},
"problems": [
{
"type": "<string>",
"title": "<string>",
"occurredAt": "2023-11-07T05:31:56Z",
"id": "<string>",
"status": 349,
"detail": "<string>",
"instance": "<string>",
"attributes": {}
}
]
}{
"type": "<string>",
"title": "<string>",
"occurredAt": "2023-11-07T05:31:56Z",
"id": "<string>",
"status": 349,
"detail": "<string>",
"instance": "<string>",
"attributes": {},
"recovery": {
"rateLimit": {
"limit": 123,
"remaining": 123,
"resetsAt": "2023-11-07T05:31:56Z"
}
},
"problems": [
{
"type": "<string>",
"title": "<string>",
"occurredAt": "2023-11-07T05:31:56Z",
"id": "<string>",
"status": 349,
"detail": "<string>",
"instance": "<string>",
"attributes": {}
}
]
}{
"type": "<string>",
"title": "<string>",
"occurredAt": "2023-11-07T05:31:56Z",
"id": "<string>",
"status": 349,
"detail": "<string>",
"instance": "<string>",
"attributes": {},
"recovery": {
"rateLimit": {
"limit": 123,
"remaining": 123,
"resetsAt": "2023-11-07T05:31:56Z"
}
},
"problems": [
{
"type": "<string>",
"title": "<string>",
"occurredAt": "2023-11-07T05:31:56Z",
"id": "<string>",
"status": 349,
"detail": "<string>",
"instance": "<string>",
"attributes": {}
}
]
}{
"type": "<string>",
"title": "<string>",
"occurredAt": "2023-11-07T05:31:56Z",
"id": "<string>",
"status": 349,
"detail": "<string>",
"instance": "<string>",
"attributes": {},
"recovery": {
"rateLimit": {
"limit": 123,
"remaining": 123,
"resetsAt": "2023-11-07T05:31:56Z"
}
},
"problems": [
{
"type": "<string>",
"title": "<string>",
"occurredAt": "2023-11-07T05:31:56Z",
"id": "<string>",
"status": 349,
"detail": "<string>",
"instance": "<string>",
"attributes": {}
}
]
}{
"type": "<string>",
"title": "<string>",
"occurredAt": "2023-11-07T05:31:56Z",
"id": "<string>",
"status": 349,
"detail": "<string>",
"instance": "<string>",
"attributes": {},
"recovery": {
"rateLimit": {
"limit": 123,
"remaining": 123,
"resetsAt": "2023-11-07T05:31:56Z"
}
},
"problems": [
{
"type": "<string>",
"title": "<string>",
"occurredAt": "2023-11-07T05:31:56Z",
"id": "<string>",
"status": 349,
"detail": "<string>",
"instance": "<string>",
"attributes": {}
}
]
}{
"type": "<string>",
"title": "<string>",
"occurredAt": "2023-11-07T05:31:56Z",
"id": "<string>",
"status": 349,
"detail": "<string>",
"instance": "<string>",
"attributes": {},
"recovery": {
"rateLimit": {
"limit": 123,
"remaining": 123,
"resetsAt": "2023-11-07T05:31:56Z"
}
},
"problems": [
{
"type": "<string>",
"title": "<string>",
"occurredAt": "2023-11-07T05:31:56Z",
"id": "<string>",
"status": 349,
"detail": "<string>",
"instance": "<string>",
"attributes": {}
}
]
}{
"type": "<string>",
"title": "<string>",
"occurredAt": "2023-11-07T05:31:56Z",
"id": "<string>",
"status": 349,
"detail": "<string>",
"instance": "<string>",
"attributes": {},
"recovery": {
"rateLimit": {
"limit": 123,
"remaining": 123,
"resetsAt": "2023-11-07T05:31:56Z"
}
},
"problems": [
{
"type": "<string>",
"title": "<string>",
"occurredAt": "2023-11-07T05:31:56Z",
"id": "<string>",
"status": 349,
"detail": "<string>",
"instance": "<string>",
"attributes": {}
}
]
}