curl -X POST "https://api.playground.try.be/shop/packages?site_id=site_abc123" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-d '{
"name": "Couples Spa Day",
"description": "A full day of relaxation for two — includes a 60-minute\nmassage each, a two-course lunch, and full access to the\nthermal suite.\n",
"product_code": "PKG-COUPLES-DAY",
"external_id": "ext-couples-spa-day",
"currency": "gbp",
"site_id": "00000000-0000-0000-0000-111111111111",
"organisation_id": "00000000-0000-0000-0000-aaaaaaaaaaaa",
"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"
]
}
],
"offered_online": false,
"private": false,
"visibility": "public",
"customers_only": false,
"members_only": false,
"permitted_membership_type_ids": [
"00000000-0000-0000-0000-membership001"
],
"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"
}
],
"item_choices": [
{}
],
"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"
}
],
"category_ids": [
"5e932c0901d210625e3a8766"
],
"meta": {
"title": "Couples Spa Day at Riverside Retreat",
"description": "A relaxing day for two with massages, lunch, and thermal suite access."
},
"customer_cancellation_permitted": "allowed",
"customer_cancellation_min_duration": "PT24H",
"max_daily_duration": 240,
"max_advance_bookings_interval": "P2W",
"min_advance_bookings_interval": "P2D",
"min_guests": 2,
"max_guests": 2,
"prevent_choice_overlaps": false,
"separate_couples_package_choices": false,
"email_options": {
"hide_prices": false
},
"overnight_package_config": {
"enabled": true,
"rate_id": "rate-king-bb",
"num_nights": 1
},
"include_pricing_on_calendar": false,
"max_per_basket": 1,
"max_per_guest": 1
}'
const response = await fetch('https://api.playground.try.be/shop/packages?site_id=site_abc123', {
method: 'POST',
headers: {
Authorization: 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json',
Accept: 'application/json',
},
body: JSON.stringify({
"name": "Couples Spa Day",
"description": "A full day of relaxation for two — includes a 60-minute\nmassage each, a two-course lunch, and full access to the\nthermal suite.\n",
"product_code": "PKG-COUPLES-DAY",
"external_id": "ext-couples-spa-day",
"currency": "gbp",
"site_id": "00000000-0000-0000-0000-111111111111",
"organisation_id": "00000000-0000-0000-0000-aaaaaaaaaaaa",
"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"
]
}
],
"offered_online": false,
"private": false,
"visibility": "public",
"customers_only": false,
"members_only": false,
"permitted_membership_type_ids": [
"00000000-0000-0000-0000-membership001"
],
"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"
}
],
"item_choices": [
{}
],
"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"
}
],
"category_ids": [
"5e932c0901d210625e3a8766"
],
"meta": {
"title": "Couples Spa Day at Riverside Retreat",
"description": "A relaxing day for two with massages, lunch, and thermal suite access."
},
"customer_cancellation_permitted": "allowed",
"customer_cancellation_min_duration": "PT24H",
"max_daily_duration": 240,
"max_advance_bookings_interval": "P2W",
"min_advance_bookings_interval": "P2D",
"min_guests": 2,
"max_guests": 2,
"prevent_choice_overlaps": false,
"separate_couples_package_choices": false,
"email_options": {
"hide_prices": false
},
"overnight_package_config": {
"enabled": true,
"rate_id": "rate-king-bb",
"num_nights": 1
},
"include_pricing_on_calendar": false,
"max_per_basket": 1,
"max_per_guest": 1
}),
})
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/packages?site_id=site_abc123",
headers={
"Authorization": "Bearer YOUR_API_KEY",
"Accept": "application/json",
"Content-Type": "application/json",
},
json={
"name": "Couples Spa Day",
"description": "A full day of relaxation for two — includes a 60-minute\nmassage each, a two-course lunch, and full access to the\nthermal suite.\n",
"product_code": "PKG-COUPLES-DAY",
"external_id": "ext-couples-spa-day",
"currency": "gbp",
"site_id": "00000000-0000-0000-0000-111111111111",
"organisation_id": "00000000-0000-0000-0000-aaaaaaaaaaaa",
"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"
]
}
],
"offered_online": False,
"private": False,
"visibility": "public",
"customers_only": False,
"members_only": False,
"permitted_membership_type_ids": [
"00000000-0000-0000-0000-membership001"
],
"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"
}
],
"item_choices": [
{
}
],
"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"
}
],
"category_ids": [
"5e932c0901d210625e3a8766"
],
"meta": {
"title": "Couples Spa Day at Riverside Retreat",
"description": "A relaxing day for two with massages, lunch, and thermal suite access."
},
"customer_cancellation_permitted": "allowed",
"customer_cancellation_min_duration": "PT24H",
"max_daily_duration": 240,
"max_advance_bookings_interval": "P2W",
"min_advance_bookings_interval": "P2D",
"min_guests": 2,
"max_guests": 2,
"prevent_choice_overlaps": False,
"separate_couples_package_choices": False,
"email_options": {
"hide_prices": False
},
"overnight_package_config": {
"enabled": True,
"rate_id": "rate-king-bb",
"num_nights": 1
},
"include_pricing_on_calendar": False,
"max_per_basket": 1,
"max_per_guest": 1
},
)
response.raise_for_status()
data = response.json()
<?php
$client = new \GuzzleHttp\Client();
$response = $client->request('POST', 'https://api.playground.try.be/shop/packages?site_id=site_abc123', [
'headers' => [
'Authorization' => 'Bearer YOUR_API_KEY',
'Accept' => 'application/json',
'Content-Type' => 'application/json',
],
'json' => [
'name' => 'Couples Spa Day',
'description' => 'A full day of relaxation for two — includes a 60-minute
massage each, a two-course lunch, and full access to the
thermal suite.
',
'product_code' => 'PKG-COUPLES-DAY',
'external_id' => 'ext-couples-spa-day',
'currency' => 'gbp',
'site_id' => '00000000-0000-0000-0000-111111111111',
'organisation_id' => '00000000-0000-0000-0000-aaaaaaaaaaaa',
'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'
]
]
],
'offered_online' => false,
'private' => false,
'visibility' => 'public',
'customers_only' => false,
'members_only' => false,
'permitted_membership_type_ids' => [
'00000000-0000-0000-0000-membership001'
],
'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'
]
],
'item_choices' => [
[
]
],
'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'
]
],
'category_ids' => [
'5e932c0901d210625e3a8766'
],
'meta' => [
'title' => 'Couples Spa Day at Riverside Retreat',
'description' => 'A relaxing day for two with massages, lunch, and thermal suite access.'
],
'customer_cancellation_permitted' => 'allowed',
'customer_cancellation_min_duration' => 'PT24H',
'max_daily_duration' => 240,
'max_advance_bookings_interval' => 'P2W',
'min_advance_bookings_interval' => 'P2D',
'min_guests' => 2,
'max_guests' => 2,
'prevent_choice_overlaps' => false,
'separate_couples_package_choices' => false,
'email_options' => [
'hide_prices' => false
],
'overnight_package_config' => [
'enabled' => true,
'rate_id' => 'rate-king-bb',
'num_nights' => 1
],
'include_pricing_on_calendar' => false,
'max_per_basket' => 1,
'max_per_guest' => 1
],
]);
$data = json_decode($response->getBody(), true);
package main
import (
"bytes"
"encoding/json"
"net/http"
)
func main() {
payload, _ := json.Marshal(map[string]interface{}{
"name": "Couples Spa Day",
"description": "A full day of relaxation for two — includes a 60-minute\nmassage each, a two-course lunch, and full access to the\nthermal suite.\n",
"product_code": "PKG-COUPLES-DAY",
"external_id": "ext-couples-spa-day",
"currency": "gbp",
"site_id": "00000000-0000-0000-0000-111111111111",
"organisation_id": "00000000-0000-0000-0000-aaaaaaaaaaaa",
"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",
},
},
},
"offered_online": false,
"private": false,
"visibility": "public",
"customers_only": false,
"members_only": false,
"permitted_membership_type_ids": []interface{}{
"00000000-0000-0000-0000-membership001",
},
"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",
},
},
"item_choices": []interface{}{
map[string]interface{}{
},
},
"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",
},
},
"category_ids": []interface{}{
"5e932c0901d210625e3a8766",
},
"meta": map[string]interface{}{
"title": "Couples Spa Day at Riverside Retreat",
"description": "A relaxing day for two with massages, lunch, and thermal suite access.",
},
"customer_cancellation_permitted": "allowed",
"customer_cancellation_min_duration": "PT24H",
"max_daily_duration": 240,
"max_advance_bookings_interval": "P2W",
"min_advance_bookings_interval": "P2D",
"min_guests": 2,
"max_guests": 2,
"prevent_choice_overlaps": false,
"separate_couples_package_choices": false,
"email_options": map[string]interface{}{
"hide_prices": false,
},
"overnight_package_config": map[string]interface{}{
"enabled": true,
"rate_id": "rate-king-bb",
"num_nights": 1,
},
"include_pricing_on_calendar": false,
"max_per_basket": 1,
"max_per_guest": 1,
})
req, _ := http.NewRequest("POST", "https://api.playground.try.be/shop/packages?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)
}