Create a catalogue service.
curl --request POST \
--url https://dash.dmly.io/api/v1/services \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data @- <<EOF
{
"name": "Men's Haircut",
"type": "appointment",
"category": "9b1f2c34-5d6e-4a7b-8c9d-0e1f2a3b4c5d",
"description": "A classic cut and style.",
"price": 35,
"cost_price": 8,
"currency": "USD",
"tax_rate": 7.5,
"tax_inclusive": false,
"credits": 1,
"credit_cost": 0,
"payment_mode": "before",
"capacity": 1,
"public_visible": true,
"online": false,
"duration_min": 30,
"location_type": "in_person",
"location_details": "Main salon, chair 3",
"color": "#22c55e",
"active": true
}
EOFimport requests
url = "https://dash.dmly.io/api/v1/services"
payload = {
"name": "Men's Haircut",
"type": "appointment",
"category": "9b1f2c34-5d6e-4a7b-8c9d-0e1f2a3b4c5d",
"description": "A classic cut and style.",
"price": 35,
"cost_price": 8,
"currency": "USD",
"tax_rate": 7.5,
"tax_inclusive": False,
"credits": 1,
"credit_cost": 0,
"payment_mode": "before",
"capacity": 1,
"public_visible": True,
"online": False,
"duration_min": 30,
"location_type": "in_person",
"location_details": "Main salon, chair 3",
"color": "#22c55e",
"active": True
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'Men\'s Haircut',
type: 'appointment',
category: '9b1f2c34-5d6e-4a7b-8c9d-0e1f2a3b4c5d',
description: 'A classic cut and style.',
price: 35,
cost_price: 8,
currency: 'USD',
tax_rate: 7.5,
tax_inclusive: false,
credits: 1,
credit_cost: 0,
payment_mode: 'before',
capacity: 1,
public_visible: true,
online: false,
duration_min: 30,
location_type: 'in_person',
location_details: 'Main salon, chair 3',
color: '#22c55e',
active: true
})
};
fetch('https://dash.dmly.io/api/v1/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://dash.dmly.io/api/v1/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' => 'Men\'s Haircut',
'type' => 'appointment',
'category' => '9b1f2c34-5d6e-4a7b-8c9d-0e1f2a3b4c5d',
'description' => 'A classic cut and style.',
'price' => 35,
'cost_price' => 8,
'currency' => 'USD',
'tax_rate' => 7.5,
'tax_inclusive' => false,
'credits' => 1,
'credit_cost' => 0,
'payment_mode' => 'before',
'capacity' => 1,
'public_visible' => true,
'online' => false,
'duration_min' => 30,
'location_type' => 'in_person',
'location_details' => 'Main salon, chair 3',
'color' => '#22c55e',
'active' => true
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-key>"
],
]);
$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://dash.dmly.io/api/v1/services"
payload := strings.NewReader("{\n \"name\": \"Men's Haircut\",\n \"type\": \"appointment\",\n \"category\": \"9b1f2c34-5d6e-4a7b-8c9d-0e1f2a3b4c5d\",\n \"description\": \"A classic cut and style.\",\n \"price\": 35,\n \"cost_price\": 8,\n \"currency\": \"USD\",\n \"tax_rate\": 7.5,\n \"tax_inclusive\": false,\n \"credits\": 1,\n \"credit_cost\": 0,\n \"payment_mode\": \"before\",\n \"capacity\": 1,\n \"public_visible\": true,\n \"online\": false,\n \"duration_min\": 30,\n \"location_type\": \"in_person\",\n \"location_details\": \"Main salon, chair 3\",\n \"color\": \"#22c55e\",\n \"active\": true\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<api-key>")
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://dash.dmly.io/api/v1/services")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Men's Haircut\",\n \"type\": \"appointment\",\n \"category\": \"9b1f2c34-5d6e-4a7b-8c9d-0e1f2a3b4c5d\",\n \"description\": \"A classic cut and style.\",\n \"price\": 35,\n \"cost_price\": 8,\n \"currency\": \"USD\",\n \"tax_rate\": 7.5,\n \"tax_inclusive\": false,\n \"credits\": 1,\n \"credit_cost\": 0,\n \"payment_mode\": \"before\",\n \"capacity\": 1,\n \"public_visible\": true,\n \"online\": false,\n \"duration_min\": 30,\n \"location_type\": \"in_person\",\n \"location_details\": \"Main salon, chair 3\",\n \"color\": \"#22c55e\",\n \"active\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://dash.dmly.io/api/v1/services")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"Men's Haircut\",\n \"type\": \"appointment\",\n \"category\": \"9b1f2c34-5d6e-4a7b-8c9d-0e1f2a3b4c5d\",\n \"description\": \"A classic cut and style.\",\n \"price\": 35,\n \"cost_price\": 8,\n \"currency\": \"USD\",\n \"tax_rate\": 7.5,\n \"tax_inclusive\": false,\n \"credits\": 1,\n \"credit_cost\": 0,\n \"payment_mode\": \"before\",\n \"capacity\": 1,\n \"public_visible\": true,\n \"online\": false,\n \"duration_min\": 30,\n \"location_type\": \"in_person\",\n \"location_details\": \"Main salon, chair 3\",\n \"color\": \"#22c55e\",\n \"active\": true\n}"
response = http.request(request)
puts response.read_body{
"message": "<string>"
}{
"message": "<string>"
}{
"message": "<string>"
}{
"message": "<string>",
"errors": {}
}{
"message": "<string>"
}Create a catalogue service.
Creates an appointment, class, or add-on service. category (a ServiceCategory uuid) is resolved server-side. payment_mode sets payment_required automatically. For add_on, booking-policy fields are forced to non-bookable defaults; capacity only applies to class. A unique slug is generated from the name. Dispatches ServiceCreated (and ServiceActivated when active). Returns 201.
POST
/
services
Create a catalogue service.
curl --request POST \
--url https://dash.dmly.io/api/v1/services \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data @- <<EOF
{
"name": "Men's Haircut",
"type": "appointment",
"category": "9b1f2c34-5d6e-4a7b-8c9d-0e1f2a3b4c5d",
"description": "A classic cut and style.",
"price": 35,
"cost_price": 8,
"currency": "USD",
"tax_rate": 7.5,
"tax_inclusive": false,
"credits": 1,
"credit_cost": 0,
"payment_mode": "before",
"capacity": 1,
"public_visible": true,
"online": false,
"duration_min": 30,
"location_type": "in_person",
"location_details": "Main salon, chair 3",
"color": "#22c55e",
"active": true
}
EOFimport requests
url = "https://dash.dmly.io/api/v1/services"
payload = {
"name": "Men's Haircut",
"type": "appointment",
"category": "9b1f2c34-5d6e-4a7b-8c9d-0e1f2a3b4c5d",
"description": "A classic cut and style.",
"price": 35,
"cost_price": 8,
"currency": "USD",
"tax_rate": 7.5,
"tax_inclusive": False,
"credits": 1,
"credit_cost": 0,
"payment_mode": "before",
"capacity": 1,
"public_visible": True,
"online": False,
"duration_min": 30,
"location_type": "in_person",
"location_details": "Main salon, chair 3",
"color": "#22c55e",
"active": True
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'Men\'s Haircut',
type: 'appointment',
category: '9b1f2c34-5d6e-4a7b-8c9d-0e1f2a3b4c5d',
description: 'A classic cut and style.',
price: 35,
cost_price: 8,
currency: 'USD',
tax_rate: 7.5,
tax_inclusive: false,
credits: 1,
credit_cost: 0,
payment_mode: 'before',
capacity: 1,
public_visible: true,
online: false,
duration_min: 30,
location_type: 'in_person',
location_details: 'Main salon, chair 3',
color: '#22c55e',
active: true
})
};
fetch('https://dash.dmly.io/api/v1/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://dash.dmly.io/api/v1/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' => 'Men\'s Haircut',
'type' => 'appointment',
'category' => '9b1f2c34-5d6e-4a7b-8c9d-0e1f2a3b4c5d',
'description' => 'A classic cut and style.',
'price' => 35,
'cost_price' => 8,
'currency' => 'USD',
'tax_rate' => 7.5,
'tax_inclusive' => false,
'credits' => 1,
'credit_cost' => 0,
'payment_mode' => 'before',
'capacity' => 1,
'public_visible' => true,
'online' => false,
'duration_min' => 30,
'location_type' => 'in_person',
'location_details' => 'Main salon, chair 3',
'color' => '#22c55e',
'active' => true
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-key>"
],
]);
$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://dash.dmly.io/api/v1/services"
payload := strings.NewReader("{\n \"name\": \"Men's Haircut\",\n \"type\": \"appointment\",\n \"category\": \"9b1f2c34-5d6e-4a7b-8c9d-0e1f2a3b4c5d\",\n \"description\": \"A classic cut and style.\",\n \"price\": 35,\n \"cost_price\": 8,\n \"currency\": \"USD\",\n \"tax_rate\": 7.5,\n \"tax_inclusive\": false,\n \"credits\": 1,\n \"credit_cost\": 0,\n \"payment_mode\": \"before\",\n \"capacity\": 1,\n \"public_visible\": true,\n \"online\": false,\n \"duration_min\": 30,\n \"location_type\": \"in_person\",\n \"location_details\": \"Main salon, chair 3\",\n \"color\": \"#22c55e\",\n \"active\": true\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<api-key>")
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://dash.dmly.io/api/v1/services")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Men's Haircut\",\n \"type\": \"appointment\",\n \"category\": \"9b1f2c34-5d6e-4a7b-8c9d-0e1f2a3b4c5d\",\n \"description\": \"A classic cut and style.\",\n \"price\": 35,\n \"cost_price\": 8,\n \"currency\": \"USD\",\n \"tax_rate\": 7.5,\n \"tax_inclusive\": false,\n \"credits\": 1,\n \"credit_cost\": 0,\n \"payment_mode\": \"before\",\n \"capacity\": 1,\n \"public_visible\": true,\n \"online\": false,\n \"duration_min\": 30,\n \"location_type\": \"in_person\",\n \"location_details\": \"Main salon, chair 3\",\n \"color\": \"#22c55e\",\n \"active\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://dash.dmly.io/api/v1/services")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"Men's Haircut\",\n \"type\": \"appointment\",\n \"category\": \"9b1f2c34-5d6e-4a7b-8c9d-0e1f2a3b4c5d\",\n \"description\": \"A classic cut and style.\",\n \"price\": 35,\n \"cost_price\": 8,\n \"currency\": \"USD\",\n \"tax_rate\": 7.5,\n \"tax_inclusive\": false,\n \"credits\": 1,\n \"credit_cost\": 0,\n \"payment_mode\": \"before\",\n \"capacity\": 1,\n \"public_visible\": true,\n \"online\": false,\n \"duration_min\": 30,\n \"location_type\": \"in_person\",\n \"location_details\": \"Main salon, chair 3\",\n \"color\": \"#22c55e\",\n \"active\": true\n}"
response = http.request(request)
puts response.read_body{
"message": "<string>"
}{
"message": "<string>"
}{
"message": "<string>"
}{
"message": "<string>",
"errors": {}
}{
"message": "<string>"
}Authorizations
apiKeyAuthbearerAuth
Your workspace API key. It both authenticates the caller and selects the workspace.
Body
application/json
Response
Success.
Was this page helpful?
⌘I

