From e7ce20e580958b02c217ee37888b256ebfbb60fd Mon Sep 17 00:00:00 2001 From: Mark Gregory Date: Wed, 9 Sep 2026 10:17:44 +0100 Subject: [PATCH] host updates --- create-rsync-studio-catalog.sh | 247 +++++++++++++++++++++++++++++++++ rsync-studio-paddle-ids.env | 7 + 2 files changed, 254 insertions(+) create mode 100755 create-rsync-studio-catalog.sh create mode 100644 rsync-studio-paddle-ids.env diff --git a/create-rsync-studio-catalog.sh b/create-rsync-studio-catalog.sh new file mode 100755 index 0000000..7e913ad --- /dev/null +++ b/create-rsync-studio-catalog.sh @@ -0,0 +1,247 @@ +#!/usr/bin/env bash + +set -euo pipefail + +PADDLE_API_KEY="${PADDLE_API_KEY:-}" + +if [[ -z "$PADDLE_API_KEY" ]]; then + echo "ERROR: PADDLE_API_KEY is not set." + echo 'Run: export PADDLE_API_KEY="pdl_sdbx_apikey_..."' + exit 1 +fi + +API="https://sandbox-api.paddle.com" + +api_post() { + local endpoint="$1" + local payload="$2" + + curl --fail-with-body --silent --show-error \ + --request POST \ + --url "${API}${endpoint}" \ + --header "Authorization: Bearer ${PADDLE_API_KEY}" \ + --header "Content-Type: application/json" \ + --data "$payload" +} + +create_product() { + local name="$1" + local description="$2" + + api_post "/products" "$(jq -n \ + --arg name "$name" \ + --arg description "$description" \ + '{ + name: $name, + description: $description, + type: "standard", + tax_category: "standard" + }' + )" +} + +create_price() { + local product_id="$1" + local name="$2" + local description="$3" + local cycle="$4" + local usd="$5" + local gbp="$6" + local eur="$7" + local aud="$8" + + api_post "/prices" "$(jq -n \ + --arg product_id "$product_id" \ + --arg name "$name" \ + --arg description "$description" \ + --arg cycle "$cycle" \ + --arg usd "$usd" \ + --arg gbp "$gbp" \ + --arg eur "$eur" \ + --arg aud "$aud" \ + '{ + product_id: $product_id, + name: $name, + description: $description, + + billing_cycle: { + interval: $cycle, + frequency: 1 + }, + + trial_period: { + interval: "day", + frequency: 7 + }, + + unit_price: { + amount: $usd, + currency_code: "USD" + }, + + unit_price_overrides: [ + { + country_codes: ["GB"], + unit_price: { + amount: $gbp, + currency_code: "GBP" + } + }, + { + country_codes: ["IE"], + unit_price: { + amount: $eur, + currency_code: "EUR" + } + }, + { + country_codes: ["AU"], + unit_price: { + amount: $aud, + currency_code: "AUD" + } + } + ], + + tax_mode: "account_setting", + + quantity: { + minimum: 1, + maximum: 1 + } + }' + )" +} + +echo +echo "Creating Rsync Studio Paddle sandbox catalog..." +echo + +# +# Personal +# + +PERSONAL_PRODUCT=$(create_product \ + "Rsync Studio Personal" \ + "Rsync Studio for personal use.") + +PERSONAL_PRODUCT_ID=$(echo "$PERSONAL_PRODUCT" | jq -r '.data.id') + +echo "Created Personal product: $PERSONAL_PRODUCT_ID" + +PERSONAL_MONTHLY=$(create_price \ + "$PERSONAL_PRODUCT_ID" \ + "Personal Monthly" \ + "Rsync Studio Personal — monthly subscription with 7-day free trial." \ + "month" \ + "199" \ + "199" \ + "199" \ + "299") + +PERSONAL_MONTHLY_ID=$(echo "$PERSONAL_MONTHLY" | jq -r '.data.id') + +echo "Created Personal Monthly: $PERSONAL_MONTHLY_ID" + +PERSONAL_ANNUAL=$(create_price \ + "$PERSONAL_PRODUCT_ID" \ + "Personal Annual" \ + "Rsync Studio Personal — annual subscription with 7-day free trial." \ + "year" \ + "1499" \ + "1499" \ + "1699" \ + "2499") + +PERSONAL_ANNUAL_ID=$(echo "$PERSONAL_ANNUAL" | jq -r '.data.id') + +echo "Created Personal Annual: $PERSONAL_ANNUAL_ID" + +# +# Professional +# + +PRO_PRODUCT=$(create_product \ + "Rsync Studio Professional" \ + "Rsync Studio for professional and commercial use.") + +PRO_PRODUCT_ID=$(echo "$PRO_PRODUCT" | jq -r '.data.id') + +echo "Created Professional product: $PRO_PRODUCT_ID" + +PRO_MONTHLY=$(create_price \ + "$PRO_PRODUCT_ID" \ + "Professional Monthly" \ + "Rsync Studio Professional — monthly subscription with 7-day free trial." \ + "month" \ + "399" \ + "399" \ + "449" \ + "699") + +PRO_MONTHLY_ID=$(echo "$PRO_MONTHLY" | jq -r '.data.id') + +echo "Created Professional Monthly: $PRO_MONTHLY_ID" + +PRO_ANNUAL=$(create_price \ + "$PRO_PRODUCT_ID" \ + "Professional Annual" \ + "Rsync Studio Professional — annual subscription with 7-day free trial." \ + "year" \ + "2999" \ + "2999" \ + "3499" \ + "4999") + +PRO_ANNUAL_ID=$(echo "$PRO_ANNUAL" | jq -r '.data.id') + +echo "Created Professional Annual: $PRO_ANNUAL_ID" + +echo +echo "============================================================" +echo " RSYNC STUDIO — PADDLE SANDBOX CATALOG" +echo "============================================================" +echo +echo "PERSONAL" +echo " Product ID: $PERSONAL_PRODUCT_ID" +echo " Monthly Price ID: $PERSONAL_MONTHLY_ID" +echo " Annual Price ID: $PERSONAL_ANNUAL_ID" +echo +echo "PROFESSIONAL" +echo " Product ID: $PRO_PRODUCT_ID" +echo " Monthly Price ID: $PRO_MONTHLY_ID" +echo " Annual Price ID: $PRO_ANNUAL_ID" +echo +echo "------------------------------------------------------------" +echo "Pricing" +echo "------------------------------------------------------------" +echo +printf "%-24s %-12s %-12s %-12s %-12s\n" \ + "Plan" "USD" "UK" "Ireland" "Australia" +printf "%-24s %-12s %-12s %-12s %-12s\n" \ + "Personal Monthly" '$1.99' '£1.99' '€1.99' 'A$2.99' +printf "%-24s %-12s %-12s %-12s %-12s\n" \ + "Personal Annual" '$14.99' '£14.99' '€16.99' 'A$24.99' +printf "%-24s %-12s %-12s %-12s %-12s\n" \ + "Professional Monthly" '$3.99' '£3.99' '€4.49' 'A$6.99' +printf "%-24s %-12s %-12s %-12s %-12s\n" \ + "Professional Annual" '$29.99' '£29.99' '€34.99' 'A$49.99' +echo +echo "All four prices include a 7-day FREE trial." +echo +echo "============================================================" + +cat > rsync-studio-paddle-ids.env <