Skip to main content
GET
/
subscriptions
/
cp
/
api
/
subscription-custom-csses
/
{id}
Get custom CSS for customer portal
curl --request GET \
  --url https://www.myshop.com/apps/subscriptions/cp/api/subscription-custom-csses/{id}
import requests

url = "https://www.myshop.com/apps/subscriptions/cp/api/subscription-custom-csses/{id}"

response = requests.get(url)

print(response.text)
const options = {method: 'GET'};

fetch('https://www.myshop.com/apps/subscriptions/cp/api/subscription-custom-csses/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));
const url = 'https://www.myshop.com/apps/subscriptions/cp/api/subscription-custom-csses/{id}';
const options = {method: 'GET'};

fetch(url, options)
.then(res => res.json())
.then(json => console.log(json))
.catch(err => console.error(err));
<?php

$curl = curl_init();

curl_setopt_array($curl, [
CURLOPT_URL => "https://www.myshop.com/apps/subscriptions/cp/api/subscription-custom-csses/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
package main

import (
"fmt"
"net/http"
"io"
)

func main() {

url := "https://www.myshop.com/apps/subscriptions/cp/api/subscription-custom-csses/{id}"

req, _ := http.NewRequest("GET", url, nil)

res, _ := http.DefaultClient.Do(req)

defer res.Body.Close()
body, _ := io.ReadAll(res.Body)

fmt.Println(string(body))

}
require 'uri'
require 'net/http'

url = URI("https://www.myshop.com/apps/subscriptions/cp/api/subscription-custom-csses/{id}")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)

response = http.request(request)
puts response.read_body
"{\n  \"id\": 12345,\n  \"shop\": \"example-shop.myshopify.com\",\n  \"customCss\": \"/* Global Portal Styles */\\n\" +\n    \".subscription-portal {\\n\" +\n    \"  font-family: 'Helvetica Neue', Arial, sans-serif;\\n\" +\n    \"  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);\\n\" +\n    \"  min-height: 100vh;\\n\" +\n    \"}\\n\\n\" +\n    \"/* Subscription Cards */\\n\" +\n    \".subscription-card {\\n\" +\n    \"  border-radius: 12px;\\n\" +\n    \"  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);\\n\" +\n    \"  background: white;\\n\" +\n    \"  padding: 24px;\\n\" +\n    \"  margin-bottom: 16px;\\n\" +\n    \"  transition: transform 0.2s ease, box-shadow 0.2s ease;\\n\" +\n    \"}\\n\\n\" +\n    \".subscription-card:hover {\\n\" +\n    \"  transform: translateY(-2px);\\n\" +\n    \"  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);\\n\" +\n    \"}\\n\\n\" +\n    \"/* Primary Button Styling */\\n\" +\n    \".btn-primary {\\n\" +\n    \"  background-color: #4A90E2;\\n\" +\n    \"  border-color: #4A90E2;\\n\" +\n    \"  color: white;\\n\" +\n    \"  font-weight: 600;\\n\" +\n    \"  padding: 12px 24px;\\n\" +\n    \"  border-radius: 6px;\\n\" +\n    \"  transition: all 0.3s ease;\\n\" +\n    \"}\\n\\n\" +\n    \".btn-primary:hover {\\n\" +\n    \"  background-color: #357ABD;\\n\" +\n    \"  border-color: #357ABD;\\n\" +\n    \"  transform: scale(1.02);\\n\" +\n    \"}\\n\\n\" +\n    \"/* Form Inputs */\\n\" +\n    \".form-control {\\n\" +\n    \"  border: 2px solid #E0E0E0;\\n\" +\n    \"  border-radius: 6px;\\n\" +\n    \"  padding: 10px 14px;\\n\" +\n    \"  font-size: 14px;\\n\" +\n    \"}\\n\\n\" +\n    \".form-control:focus {\\n\" +\n    \"  border-color: #4A90E2;\\n\" +\n    \"  box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.1);\\n\" +\n    \"  outline: none;\\n\" +\n    \"}\\n\\n\" +\n    \"/* Responsive Design */\\n\" +\n    \"@media (max-width: 768px) {\\n\" +\n    \"  .subscription-card {\\n\" +\n    \"    padding: 16px;\\n\" +\n    \"  }\\n\" +\n    \"  .btn-primary {\\n\" +\n    \"    width: 100%;\\n\" +\n    \"  }\\n\" +\n    \"}\",\n  \"enabled\": true,\n  \"version\": 2,\n  \"lastModified\": \"2024-02-20T14:45:00Z\",\n  \"createdAt\": \"2024-01-15T10:30:00Z\",\n  \"updatedAt\": \"2024-02-20T14:45:00Z\"\n}"
{
"detail": "Valid X-API-Key header is required",
"status": 401,
"title": "Authentication required",
"type": "https://example.com/errors/unauthorized"
}
{
"detail": "API key does not have permission to view custom CSS settings",
"status": 403,
"title": "Insufficient permissions",
"type": "https://example.com/errors/forbidden"
}
{
"detail": "No custom CSS has been configured for this shop",
"status": 404,
"title": "CSS not found",
"type": "https://example.com/errors/not-found"
}

Path Parameters

id
integer<int64>
required

Response

Custom CSS successfully retrieved

shop
string
required
bundlingCSS
string
bundlingIframeCSS
string
customCss
string
customerPoratlCSS
string
id
integer<int64>