<?php
require_once("includes/config.php");
// Define API endpoint and shop ID
$endpoint = "https://api.etsy.com/v3/application/shops/";
$shop_id = "14688931"; // Replace with the shop ID you want to retrieve

// Define API key and access token
$api_key = $etsyConfig['api_key'];
$access_token = "12910242.HaLk3HDgIXxsfBbcJ73NJ0OUsj8WszbNHZ7-7WG46s3qtcmJz0bLV7El8WzB14FAbZ5D3Y--ggdR-BV6TheFsavcV-e";

// Set API request headers
$headers = array(
    "Content-Type: application/json",
    "Authorization: Bearer ".$access_token,
    "x-api-key: ".$api_key
);

// Set API request URL
$url = $endpoint.$shop_id;

// Send API request and retrieve response
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
$response = curl_exec($ch);
curl_close($ch);

// Parse API response and display shop details
$data = json_decode($response, true);
if (isset($data['data'])) {
    $shop = $data['data'];
    echo "Shop Name: ".$shop['name']."\n";
    echo "Owner: ".$shop['owner']['login_name']."\n";
    echo "Shop URL: ".$shop['url']."\n";
    // ...and so on for other shop details you want to display
} else {
    echo "Shop not found.";
}