curl -X POST "https://api.playground.try.be/shop/appointment-types?site_id=site_abc123" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-d '{
"name": "Aromatherapy Massage 60 minutes",
"description": "A relaxing aromatherapy massage using a blend of essential oils\ntailored to your needs. Ideal for stress relief and improving\ncirculation.\n",
"product_code": "MASSAGE-AROMA-60",
"external_id": "ext-aroma-60",
"currency": "gbp",
"site_ids": [
"00000000-0000-0000-0000-000000000000"
],
"organisation_id": "00000000-0000-0000-0000-000000000000",
"practitioner_ids": [
"64a9f3b2c3d8e1f4a5b6c7d8"
],
"equipment_ids": [
"64a9f3b2c3d8e1f4a5b6c7d8"
],
"room_ids": [
"64a9f3b2c3d8e1f4a5b6c7d8"
],
"category_ids": [
"64a9f3b2c3d8e1f4a5b6c7d8"
],
"tag_ids": [
"64a9f3b2c3d8e1f4a5b6c7d8"
],
"durations": [
30,
60,
90
],
"start_time_interval": 15,
"end_buffer": 15,
"offered_online": false,
"private": false,
"visibility": "public",
"customers_only": false,
"members_only": false,
"permitted_membership_type_ids": [
"00000000-0000-0000-0000-000000000000"
],
"membership_booking_windows_enabled": false,
"membership_booking_windows": [
{
"membership_type_id": "00000000-0000-0000-0000-000000000000",
"max_advance_bookings_interval": "P2W",
"min_advance_bookings_interval": "P2D"
}
],
"min_guests": 1,
"max_guests": 2,
"max_advance_bookings_interval": "P30D",
"min_advance_bookings_interval": "PT2H",
"customer_cancellation_permitted": "allowed",
"customer_cancellation_min_duration": "PT24H",
"allocate_multi_capacity_rooms": false,
"include_pricing_on_calendar": false,
"max_per_basket": 4,
"max_per_guest": 2,
"revenue_centre": "spa-treatments",
"shop_practitioner_selection": "forced",
"contraindications": [
{
"condition": "blood_pressure",
"indication": "conditional",
"notes": "Free-form text from the resource."
}
],
"availability_rules": [
{
"id": "64a9f3b2c3d8e1f4a5b6c7d8",
"date_from": "2021-02-15T12:00:00+00:00",
"date_to": "2021-02-15T12:00:00+00:00",
"is_available": true,
"max_duration": 1,
"min_duration": 1,
"time_from": "11:00",
"time_to": "17:00",
"weekdays": [
"string"
]
}
],
"upsell_offerings": [
{
"offering_id": "64a9f3b2c3d8e1f4a5b6c7d8",
"offering_name": "Twilight massage",
"offering_type": "appointment"
}
],
"cross_sell_offerings": [
{
"offering_id": "64a9f3b2c3d8e1f4a5b6c7d8",
"offering_name": "Twilight massage",
"offering_type": "appointment"
}
],
"related_retail_offerings": [
{
"offering_id": "64a9f3b2c3d8e1f4a5b6c7d8",
"offering_name": "Twilight massage",
"offering_type": "appointment"
}
],
"image_id": "5f1234567890abcdef123456",
"meta": {
"title": "string",
"description": "Free-form text from the resource."
}
}'
const response = await fetch('https://api.playground.try.be/shop/appointment-types?site_id=site_abc123', {
method: 'POST',
headers: {
Authorization: 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json',
Accept: 'application/json',
},
body: JSON.stringify({
"name": "Aromatherapy Massage 60 minutes",
"description": "A relaxing aromatherapy massage using a blend of essential oils\ntailored to your needs. Ideal for stress relief and improving\ncirculation.\n",
"product_code": "MASSAGE-AROMA-60",
"external_id": "ext-aroma-60",
"currency": "gbp",
"site_ids": [
"00000000-0000-0000-0000-000000000000"
],
"organisation_id": "00000000-0000-0000-0000-000000000000",
"practitioner_ids": [
"64a9f3b2c3d8e1f4a5b6c7d8"
],
"equipment_ids": [
"64a9f3b2c3d8e1f4a5b6c7d8"
],
"room_ids": [
"64a9f3b2c3d8e1f4a5b6c7d8"
],
"category_ids": [
"64a9f3b2c3d8e1f4a5b6c7d8"
],
"tag_ids": [
"64a9f3b2c3d8e1f4a5b6c7d8"
],
"durations": [
30,
60,
90
],
"start_time_interval": 15,
"end_buffer": 15,
"offered_online": false,
"private": false,
"visibility": "public",
"customers_only": false,
"members_only": false,
"permitted_membership_type_ids": [
"00000000-0000-0000-0000-000000000000"
],
"membership_booking_windows_enabled": false,
"membership_booking_windows": [
{
"membership_type_id": "00000000-0000-0000-0000-000000000000",
"max_advance_bookings_interval": "P2W",
"min_advance_bookings_interval": "P2D"
}
],
"min_guests": 1,
"max_guests": 2,
"max_advance_bookings_interval": "P30D",
"min_advance_bookings_interval": "PT2H",
"customer_cancellation_permitted": "allowed",
"customer_cancellation_min_duration": "PT24H",
"allocate_multi_capacity_rooms": false,
"include_pricing_on_calendar": false,
"max_per_basket": 4,
"max_per_guest": 2,
"revenue_centre": "spa-treatments",
"shop_practitioner_selection": "forced",
"contraindications": [
{
"condition": "blood_pressure",
"indication": "conditional",
"notes": "Free-form text from the resource."
}
],
"availability_rules": [
{
"id": "64a9f3b2c3d8e1f4a5b6c7d8",
"date_from": "2021-02-15T12:00:00+00:00",
"date_to": "2021-02-15T12:00:00+00:00",
"is_available": true,
"max_duration": 1,
"min_duration": 1,
"time_from": "11:00",
"time_to": "17:00",
"weekdays": [
"string"
]
}
],
"upsell_offerings": [
{
"offering_id": "64a9f3b2c3d8e1f4a5b6c7d8",
"offering_name": "Twilight massage",
"offering_type": "appointment"
}
],
"cross_sell_offerings": [
{
"offering_id": "64a9f3b2c3d8e1f4a5b6c7d8",
"offering_name": "Twilight massage",
"offering_type": "appointment"
}
],
"related_retail_offerings": [
{
"offering_id": "64a9f3b2c3d8e1f4a5b6c7d8",
"offering_name": "Twilight massage",
"offering_type": "appointment"
}
],
"image_id": "5f1234567890abcdef123456",
"meta": {
"title": "string",
"description": "Free-form text from the resource."
}
}),
})
if (!response.ok) {
throw new Error(`Trybe API ${response.status}: ${await response.text()}`)
}
const data = await response.json()
import httpx
response = httpx.post(
"https://api.playground.try.be/shop/appointment-types?site_id=site_abc123",
headers={
"Authorization": "Bearer YOUR_API_KEY",
"Accept": "application/json",
"Content-Type": "application/json",
},
json={
"name": "Aromatherapy Massage 60 minutes",
"description": "A relaxing aromatherapy massage using a blend of essential oils\ntailored to your needs. Ideal for stress relief and improving\ncirculation.\n",
"product_code": "MASSAGE-AROMA-60",
"external_id": "ext-aroma-60",
"currency": "gbp",
"site_ids": [
"00000000-0000-0000-0000-000000000000"
],
"organisation_id": "00000000-0000-0000-0000-000000000000",
"practitioner_ids": [
"64a9f3b2c3d8e1f4a5b6c7d8"
],
"equipment_ids": [
"64a9f3b2c3d8e1f4a5b6c7d8"
],
"room_ids": [
"64a9f3b2c3d8e1f4a5b6c7d8"
],
"category_ids": [
"64a9f3b2c3d8e1f4a5b6c7d8"
],
"tag_ids": [
"64a9f3b2c3d8e1f4a5b6c7d8"
],
"durations": [
30,
60,
90
],
"start_time_interval": 15,
"end_buffer": 15,
"offered_online": False,
"private": False,
"visibility": "public",
"customers_only": False,
"members_only": False,
"permitted_membership_type_ids": [
"00000000-0000-0000-0000-000000000000"
],
"membership_booking_windows_enabled": False,
"membership_booking_windows": [
{
"membership_type_id": "00000000-0000-0000-0000-000000000000",
"max_advance_bookings_interval": "P2W",
"min_advance_bookings_interval": "P2D"
}
],
"min_guests": 1,
"max_guests": 2,
"max_advance_bookings_interval": "P30D",
"min_advance_bookings_interval": "PT2H",
"customer_cancellation_permitted": "allowed",
"customer_cancellation_min_duration": "PT24H",
"allocate_multi_capacity_rooms": False,
"include_pricing_on_calendar": False,
"max_per_basket": 4,
"max_per_guest": 2,
"revenue_centre": "spa-treatments",
"shop_practitioner_selection": "forced",
"contraindications": [
{
"condition": "blood_pressure",
"indication": "conditional",
"notes": "Free-form text from the resource."
}
],
"availability_rules": [
{
"id": "64a9f3b2c3d8e1f4a5b6c7d8",
"date_from": "2021-02-15T12:00:00+00:00",
"date_to": "2021-02-15T12:00:00+00:00",
"is_available": True,
"max_duration": 1,
"min_duration": 1,
"time_from": "11:00",
"time_to": "17:00",
"weekdays": [
"string"
]
}
],
"upsell_offerings": [
{
"offering_id": "64a9f3b2c3d8e1f4a5b6c7d8",
"offering_name": "Twilight massage",
"offering_type": "appointment"
}
],
"cross_sell_offerings": [
{
"offering_id": "64a9f3b2c3d8e1f4a5b6c7d8",
"offering_name": "Twilight massage",
"offering_type": "appointment"
}
],
"related_retail_offerings": [
{
"offering_id": "64a9f3b2c3d8e1f4a5b6c7d8",
"offering_name": "Twilight massage",
"offering_type": "appointment"
}
],
"image_id": "5f1234567890abcdef123456",
"meta": {
"title": "string",
"description": "Free-form text from the resource."
}
},
)
response.raise_for_status()
data = response.json()
<?php
$client = new \GuzzleHttp\Client();
$response = $client->request('POST', 'https://api.playground.try.be/shop/appointment-types?site_id=site_abc123', [
'headers' => [
'Authorization' => 'Bearer YOUR_API_KEY',
'Accept' => 'application/json',
'Content-Type' => 'application/json',
],
'json' => [
'name' => 'Aromatherapy Massage 60 minutes',
'description' => 'A relaxing aromatherapy massage using a blend of essential oils
tailored to your needs. Ideal for stress relief and improving
circulation.
',
'product_code' => 'MASSAGE-AROMA-60',
'external_id' => 'ext-aroma-60',
'currency' => 'gbp',
'site_ids' => [
'00000000-0000-0000-0000-000000000000'
],
'organisation_id' => '00000000-0000-0000-0000-000000000000',
'practitioner_ids' => [
'64a9f3b2c3d8e1f4a5b6c7d8'
],
'equipment_ids' => [
'64a9f3b2c3d8e1f4a5b6c7d8'
],
'room_ids' => [
'64a9f3b2c3d8e1f4a5b6c7d8'
],
'category_ids' => [
'64a9f3b2c3d8e1f4a5b6c7d8'
],
'tag_ids' => [
'64a9f3b2c3d8e1f4a5b6c7d8'
],
'durations' => [
30,
60,
90
],
'start_time_interval' => 15,
'end_buffer' => 15,
'offered_online' => false,
'private' => false,
'visibility' => 'public',
'customers_only' => false,
'members_only' => false,
'permitted_membership_type_ids' => [
'00000000-0000-0000-0000-000000000000'
],
'membership_booking_windows_enabled' => false,
'membership_booking_windows' => [
[
'membership_type_id' => '00000000-0000-0000-0000-000000000000',
'max_advance_bookings_interval' => 'P2W',
'min_advance_bookings_interval' => 'P2D'
]
],
'min_guests' => 1,
'max_guests' => 2,
'max_advance_bookings_interval' => 'P30D',
'min_advance_bookings_interval' => 'PT2H',
'customer_cancellation_permitted' => 'allowed',
'customer_cancellation_min_duration' => 'PT24H',
'allocate_multi_capacity_rooms' => false,
'include_pricing_on_calendar' => false,
'max_per_basket' => 4,
'max_per_guest' => 2,
'revenue_centre' => 'spa-treatments',
'shop_practitioner_selection' => 'forced',
'contraindications' => [
[
'condition' => 'blood_pressure',
'indication' => 'conditional',
'notes' => 'Free-form text from the resource.'
]
],
'availability_rules' => [
[
'id' => '64a9f3b2c3d8e1f4a5b6c7d8',
'date_from' => '2021-02-15T12:00:00+00:00',
'date_to' => '2021-02-15T12:00:00+00:00',
'is_available' => true,
'max_duration' => 1,
'min_duration' => 1,
'time_from' => '11:00',
'time_to' => '17:00',
'weekdays' => [
'string'
]
]
],
'upsell_offerings' => [
[
'offering_id' => '64a9f3b2c3d8e1f4a5b6c7d8',
'offering_name' => 'Twilight massage',
'offering_type' => 'appointment'
]
],
'cross_sell_offerings' => [
[
'offering_id' => '64a9f3b2c3d8e1f4a5b6c7d8',
'offering_name' => 'Twilight massage',
'offering_type' => 'appointment'
]
],
'related_retail_offerings' => [
[
'offering_id' => '64a9f3b2c3d8e1f4a5b6c7d8',
'offering_name' => 'Twilight massage',
'offering_type' => 'appointment'
]
],
'image_id' => '5f1234567890abcdef123456',
'meta' => [
'title' => 'string',
'description' => 'Free-form text from the resource.'
]
],
]);
$data = json_decode($response->getBody(), true);
package main
import (
"bytes"
"encoding/json"
"net/http"
)
func main() {
payload, _ := json.Marshal(map[string]interface{}{
"name": "Aromatherapy Massage 60 minutes",
"description": "A relaxing aromatherapy massage using a blend of essential oils\ntailored to your needs. Ideal for stress relief and improving\ncirculation.\n",
"product_code": "MASSAGE-AROMA-60",
"external_id": "ext-aroma-60",
"currency": "gbp",
"site_ids": []interface{}{
"00000000-0000-0000-0000-000000000000",
},
"organisation_id": "00000000-0000-0000-0000-000000000000",
"practitioner_ids": []interface{}{
"64a9f3b2c3d8e1f4a5b6c7d8",
},
"equipment_ids": []interface{}{
"64a9f3b2c3d8e1f4a5b6c7d8",
},
"room_ids": []interface{}{
"64a9f3b2c3d8e1f4a5b6c7d8",
},
"category_ids": []interface{}{
"64a9f3b2c3d8e1f4a5b6c7d8",
},
"tag_ids": []interface{}{
"64a9f3b2c3d8e1f4a5b6c7d8",
},
"durations": []interface{}{
30,
60,
90,
},
"start_time_interval": 15,
"end_buffer": 15,
"offered_online": false,
"private": false,
"visibility": "public",
"customers_only": false,
"members_only": false,
"permitted_membership_type_ids": []interface{}{
"00000000-0000-0000-0000-000000000000",
},
"membership_booking_windows_enabled": false,
"membership_booking_windows": []interface{}{
map[string]interface{}{
"membership_type_id": "00000000-0000-0000-0000-000000000000",
"max_advance_bookings_interval": "P2W",
"min_advance_bookings_interval": "P2D",
},
},
"min_guests": 1,
"max_guests": 2,
"max_advance_bookings_interval": "P30D",
"min_advance_bookings_interval": "PT2H",
"customer_cancellation_permitted": "allowed",
"customer_cancellation_min_duration": "PT24H",
"allocate_multi_capacity_rooms": false,
"include_pricing_on_calendar": false,
"max_per_basket": 4,
"max_per_guest": 2,
"revenue_centre": "spa-treatments",
"shop_practitioner_selection": "forced",
"contraindications": []interface{}{
map[string]interface{}{
"condition": "blood_pressure",
"indication": "conditional",
"notes": "Free-form text from the resource.",
},
},
"availability_rules": []interface{}{
map[string]interface{}{
"id": "64a9f3b2c3d8e1f4a5b6c7d8",
"date_from": "2021-02-15T12:00:00+00:00",
"date_to": "2021-02-15T12:00:00+00:00",
"is_available": true,
"max_duration": 1,
"min_duration": 1,
"time_from": "11:00",
"time_to": "17:00",
"weekdays": []interface{}{
"string",
},
},
},
"upsell_offerings": []interface{}{
map[string]interface{}{
"offering_id": "64a9f3b2c3d8e1f4a5b6c7d8",
"offering_name": "Twilight massage",
"offering_type": "appointment",
},
},
"cross_sell_offerings": []interface{}{
map[string]interface{}{
"offering_id": "64a9f3b2c3d8e1f4a5b6c7d8",
"offering_name": "Twilight massage",
"offering_type": "appointment",
},
},
"related_retail_offerings": []interface{}{
map[string]interface{}{
"offering_id": "64a9f3b2c3d8e1f4a5b6c7d8",
"offering_name": "Twilight massage",
"offering_type": "appointment",
},
},
"image_id": "5f1234567890abcdef123456",
"meta": map[string]interface{}{
"title": "string",
"description": "Free-form text from the resource.",
},
})
req, _ := http.NewRequest("POST", "https://api.playground.try.be/shop/appointment-types?site_id=site_abc123", bytes.NewBuffer(payload))
req.Header.Set("Authorization", "Bearer YOUR_API_KEY")
req.Header.Set("Accept", "application/json")
req.Header.Set("Content-Type", "application/json")
resp, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
var data map[string]interface{}
json.NewDecoder(resp.Body).Decode(&data)
}