curl -X PUT "https://api.playground.try.be/shop/course-types/abc123" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-d '{
"name": "5-Pack Aromatherapy Massage",
"currency": "gbp",
"description": "Five 60-minute aromatherapy massages, valid for 12 months\nfrom purchase.\n",
"product_code": "COURSE-AROMA-5",
"external_id": "ext-aroma-5",
"offered_online": false,
"private": false,
"visibility": "public",
"offering_type": "area_booking",
"offering_id": "64a9f3b2c3d8e1f4a5b6c7d8",
"offerings": [
{
"offering_id": "64a9f3b2c3d8e1f4a5b6c7d8",
"offering_name": "Twilight massage",
"offering_type": "appointment"
}
],
"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"
}
],
"meta": {
"title": "string",
"description": "Free-form text from the resource."
},
"quantity": 5,
"credits_validity_interval": "P1Y",
"image_id": "64a9f3b2c3d8e1f4a5b6c7d8",
"customers_only": false,
"members_only": false,
"permitted_membership_type_ids": [
"00000000-0000-0000-0000-000000000000"
],
"category_ids": [
"64a9f3b2c3d8e1f4a5b6c7d8"
],
"revenue_centre": "SPA-CREDITS"
}'
const response = await fetch('https://api.playground.try.be/shop/course-types/abc123', {
method: 'PUT',
headers: {
Authorization: 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json',
Accept: 'application/json',
},
body: JSON.stringify({
"name": "5-Pack Aromatherapy Massage",
"currency": "gbp",
"description": "Five 60-minute aromatherapy massages, valid for 12 months\nfrom purchase.\n",
"product_code": "COURSE-AROMA-5",
"external_id": "ext-aroma-5",
"offered_online": false,
"private": false,
"visibility": "public",
"offering_type": "area_booking",
"offering_id": "64a9f3b2c3d8e1f4a5b6c7d8",
"offerings": [
{
"offering_id": "64a9f3b2c3d8e1f4a5b6c7d8",
"offering_name": "Twilight massage",
"offering_type": "appointment"
}
],
"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"
}
],
"meta": {
"title": "string",
"description": "Free-form text from the resource."
},
"quantity": 5,
"credits_validity_interval": "P1Y",
"image_id": "64a9f3b2c3d8e1f4a5b6c7d8",
"customers_only": false,
"members_only": false,
"permitted_membership_type_ids": [
"00000000-0000-0000-0000-000000000000"
],
"category_ids": [
"64a9f3b2c3d8e1f4a5b6c7d8"
],
"revenue_centre": "SPA-CREDITS"
}),
})
if (!response.ok) {
throw new Error(`Trybe API ${response.status}: ${await response.text()}`)
}
const data = await response.json()
import httpx
response = httpx.put(
"https://api.playground.try.be/shop/course-types/abc123",
headers={
"Authorization": "Bearer YOUR_API_KEY",
"Accept": "application/json",
"Content-Type": "application/json",
},
json={
"name": "5-Pack Aromatherapy Massage",
"currency": "gbp",
"description": "Five 60-minute aromatherapy massages, valid for 12 months\nfrom purchase.\n",
"product_code": "COURSE-AROMA-5",
"external_id": "ext-aroma-5",
"offered_online": False,
"private": False,
"visibility": "public",
"offering_type": "area_booking",
"offering_id": "64a9f3b2c3d8e1f4a5b6c7d8",
"offerings": [
{
"offering_id": "64a9f3b2c3d8e1f4a5b6c7d8",
"offering_name": "Twilight massage",
"offering_type": "appointment"
}
],
"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"
}
],
"meta": {
"title": "string",
"description": "Free-form text from the resource."
},
"quantity": 5,
"credits_validity_interval": "P1Y",
"image_id": "64a9f3b2c3d8e1f4a5b6c7d8",
"customers_only": False,
"members_only": False,
"permitted_membership_type_ids": [
"00000000-0000-0000-0000-000000000000"
],
"category_ids": [
"64a9f3b2c3d8e1f4a5b6c7d8"
],
"revenue_centre": "SPA-CREDITS"
},
)
response.raise_for_status()
data = response.json()
<?php
$client = new \GuzzleHttp\Client();
$response = $client->request('PUT', 'https://api.playground.try.be/shop/course-types/abc123', [
'headers' => [
'Authorization' => 'Bearer YOUR_API_KEY',
'Accept' => 'application/json',
'Content-Type' => 'application/json',
],
'json' => [
'name' => '5-Pack Aromatherapy Massage',
'currency' => 'gbp',
'description' => 'Five 60-minute aromatherapy massages, valid for 12 months
from purchase.
',
'product_code' => 'COURSE-AROMA-5',
'external_id' => 'ext-aroma-5',
'offered_online' => false,
'private' => false,
'visibility' => 'public',
'offering_type' => 'area_booking',
'offering_id' => '64a9f3b2c3d8e1f4a5b6c7d8',
'offerings' => [
[
'offering_id' => '64a9f3b2c3d8e1f4a5b6c7d8',
'offering_name' => 'Twilight massage',
'offering_type' => 'appointment'
]
],
'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'
]
],
'meta' => [
'title' => 'string',
'description' => 'Free-form text from the resource.'
],
'quantity' => 5,
'credits_validity_interval' => 'P1Y',
'image_id' => '64a9f3b2c3d8e1f4a5b6c7d8',
'customers_only' => false,
'members_only' => false,
'permitted_membership_type_ids' => [
'00000000-0000-0000-0000-000000000000'
],
'category_ids' => [
'64a9f3b2c3d8e1f4a5b6c7d8'
],
'revenue_centre' => 'SPA-CREDITS'
],
]);
$data = json_decode($response->getBody(), true);
package main
import (
"bytes"
"encoding/json"
"net/http"
)
func main() {
payload, _ := json.Marshal(map[string]interface{}{
"name": "5-Pack Aromatherapy Massage",
"currency": "gbp",
"description": "Five 60-minute aromatherapy massages, valid for 12 months\nfrom purchase.\n",
"product_code": "COURSE-AROMA-5",
"external_id": "ext-aroma-5",
"offered_online": false,
"private": false,
"visibility": "public",
"offering_type": "area_booking",
"offering_id": "64a9f3b2c3d8e1f4a5b6c7d8",
"offerings": []interface{}{
map[string]interface{}{
"offering_id": "64a9f3b2c3d8e1f4a5b6c7d8",
"offering_name": "Twilight massage",
"offering_type": "appointment",
},
},
"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",
},
},
"meta": map[string]interface{}{
"title": "string",
"description": "Free-form text from the resource.",
},
"quantity": 5,
"credits_validity_interval": "P1Y",
"image_id": "64a9f3b2c3d8e1f4a5b6c7d8",
"customers_only": false,
"members_only": false,
"permitted_membership_type_ids": []interface{}{
"00000000-0000-0000-0000-000000000000",
},
"category_ids": []interface{}{
"64a9f3b2c3d8e1f4a5b6c7d8",
},
"revenue_centre": "SPA-CREDITS",
})
req, _ := http.NewRequest("PUT", "https://api.playground.try.be/shop/course-types/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)
}