const response = await fetch("https://api.sudomock.com/api/v1/studio/create-session", {
method: "POST",
headers: {
"x-api-key": "sm_your_api_key",
"Content-Type": "application/json",
},
body: JSON.stringify({
"allowed_origin": "https://your-store.example.com",
"mockup_type": "psd",
"mockup_uuid": "c315f78f-d2c7-4541-b240-a9372842de94",
"product_id": "8342019283",
"session_kind": "customize",
"variant_id": "44912837465"
}),
});
const data = await response.json();
console.log(data);
<?php
$payload = <<<'JSON'
{
"allowed_origin": "https://your-store.example.com",
"mockup_type": "psd",
"mockup_uuid": "c315f78f-d2c7-4541-b240-a9372842de94",
"product_id": "8342019283",
"session_kind": "customize",
"variant_id": "44912837465"
}
JSON;
$ch = curl_init("https://api.sudomock.com/api/v1/studio/create-session");
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
"x-api-key: sm_your_api_key",
"Content-Type: application/json",
]);
curl_setopt($ch, CURLOPT_POSTFIELDS, $payload);
$response = curl_exec($ch);
curl_close($ch);
echo $response;
import requests
payload = {
"allowed_origin": "https://your-store.example.com",
"mockup_type": "psd",
"mockup_uuid": "c315f78f-d2c7-4541-b240-a9372842de94",
"product_id": "8342019283",
"session_kind": "customize",
"variant_id": "44912837465"
}
response = requests.post(
"https://api.sudomock.com/api/v1/studio/create-session",
headers={"x-api-key": "sm_your_api_key"},
json=payload,
)
response.raise_for_status()
print(response.json())
require "net/http"
require "uri"
uri = URI("https://api.sudomock.com/api/v1/studio/create-session")
request = Net::HTTP::Post.new(uri)
request["x-api-key"] = "sm_your_api_key"
request["Content-Type"] = "application/json"
request.body = <<~JSON
{
"allowed_origin": "https://your-store.example.com",
"mockup_type": "psd",
"mockup_uuid": "c315f78f-d2c7-4541-b240-a9372842de94",
"product_id": "8342019283",
"session_kind": "customize",
"variant_id": "44912837465"
}
JSON
response = Net::HTTP.start(uri.host, uri.port, use_ssl: true) do |http|
http.request(request)
end
puts response.body
package main
import (
"bytes"
"fmt"
"io"
"net/http"
)
func main() {
payload := []byte(`{
"allowed_origin": "https://your-store.example.com",
"mockup_type": "psd",
"mockup_uuid": "c315f78f-d2c7-4541-b240-a9372842de94",
"product_id": "8342019283",
"session_kind": "customize",
"variant_id": "44912837465"
}`)
req, err := http.NewRequest("POST", "https://api.sudomock.com/api/v1/studio/create-session", bytes.NewBuffer(payload))
if err != nil {
panic(err)
}
req.Header.Set("x-api-key", "sm_your_api_key")
req.Header.Set("Content-Type", "application/json")
res, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
String payload = """
{
"allowed_origin": "https://your-store.example.com",
"mockup_type": "psd",
"mockup_uuid": "c315f78f-d2c7-4541-b240-a9372842de94",
"product_id": "8342019283",
"session_kind": "customize",
"variant_id": "44912837465"
}
""";
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.sudomock.com/api/v1/studio/create-session"))
.header("x-api-key", "sm_your_api_key")
.header("Content-Type", "application/json")
.POST(HttpRequest.BodyPublishers.ofString(payload))
.build();
HttpResponse<String> response = HttpClient.newHttpClient()
.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
using System.Net.Http;
using System.Text;
var payload = """
{
"allowed_origin": "https://your-store.example.com",
"mockup_type": "psd",
"mockup_uuid": "c315f78f-d2c7-4541-b240-a9372842de94",
"product_id": "8342019283",
"session_kind": "customize",
"variant_id": "44912837465"
}
""";
var request = new HttpRequestMessage(HttpMethod.Post, "https://api.sudomock.com/api/v1/studio/create-session");
request.Headers.Add("x-api-key", "sm_your_api_key");
request.Content = new StringContent(payload, Encoding.UTF8, "application/json");
var client = new HttpClient();
var response = await client.SendAsync(request);
Console.WriteLine(await response.Content.ReadAsStringAsync());
curl -X POST "https://api.sudomock.com/api/v1/studio/create-session" \
-H "x-api-key: sm_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"allowed_origin": "https://your-store.example.com",
"mockup_type": "psd",
"mockup_uuid": "c315f78f-d2c7-4541-b240-a9372842de94",
"product_id": "8342019283",
"session_kind": "customize",
"variant_id": "44912837465"
}'
{
"mockup_type": "psd",
"session": "string",
"expires_in": 1,
"message_session_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"bootstrap_secret": "string"
}
Create a new Studio session
Generates an opaque session token for the Studio iframe. Requires x-api-key header (WooCommerce, custom) or Shopify App Proxy HMAC. No unauthenticated access. API key never leaves the server.
const response = await fetch("https://api.sudomock.com/api/v1/studio/create-session", {
method: "POST",
headers: {
"x-api-key": "sm_your_api_key",
"Content-Type": "application/json",
},
body: JSON.stringify({
"allowed_origin": "https://your-store.example.com",
"mockup_type": "psd",
"mockup_uuid": "c315f78f-d2c7-4541-b240-a9372842de94",
"product_id": "8342019283",
"session_kind": "customize",
"variant_id": "44912837465"
}),
});
const data = await response.json();
console.log(data);
<?php
$payload = <<<'JSON'
{
"allowed_origin": "https://your-store.example.com",
"mockup_type": "psd",
"mockup_uuid": "c315f78f-d2c7-4541-b240-a9372842de94",
"product_id": "8342019283",
"session_kind": "customize",
"variant_id": "44912837465"
}
JSON;
$ch = curl_init("https://api.sudomock.com/api/v1/studio/create-session");
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
"x-api-key: sm_your_api_key",
"Content-Type: application/json",
]);
curl_setopt($ch, CURLOPT_POSTFIELDS, $payload);
$response = curl_exec($ch);
curl_close($ch);
echo $response;
import requests
payload = {
"allowed_origin": "https://your-store.example.com",
"mockup_type": "psd",
"mockup_uuid": "c315f78f-d2c7-4541-b240-a9372842de94",
"product_id": "8342019283",
"session_kind": "customize",
"variant_id": "44912837465"
}
response = requests.post(
"https://api.sudomock.com/api/v1/studio/create-session",
headers={"x-api-key": "sm_your_api_key"},
json=payload,
)
response.raise_for_status()
print(response.json())
require "net/http"
require "uri"
uri = URI("https://api.sudomock.com/api/v1/studio/create-session")
request = Net::HTTP::Post.new(uri)
request["x-api-key"] = "sm_your_api_key"
request["Content-Type"] = "application/json"
request.body = <<~JSON
{
"allowed_origin": "https://your-store.example.com",
"mockup_type": "psd",
"mockup_uuid": "c315f78f-d2c7-4541-b240-a9372842de94",
"product_id": "8342019283",
"session_kind": "customize",
"variant_id": "44912837465"
}
JSON
response = Net::HTTP.start(uri.host, uri.port, use_ssl: true) do |http|
http.request(request)
end
puts response.body
package main
import (
"bytes"
"fmt"
"io"
"net/http"
)
func main() {
payload := []byte(`{
"allowed_origin": "https://your-store.example.com",
"mockup_type": "psd",
"mockup_uuid": "c315f78f-d2c7-4541-b240-a9372842de94",
"product_id": "8342019283",
"session_kind": "customize",
"variant_id": "44912837465"
}`)
req, err := http.NewRequest("POST", "https://api.sudomock.com/api/v1/studio/create-session", bytes.NewBuffer(payload))
if err != nil {
panic(err)
}
req.Header.Set("x-api-key", "sm_your_api_key")
req.Header.Set("Content-Type", "application/json")
res, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
String payload = """
{
"allowed_origin": "https://your-store.example.com",
"mockup_type": "psd",
"mockup_uuid": "c315f78f-d2c7-4541-b240-a9372842de94",
"product_id": "8342019283",
"session_kind": "customize",
"variant_id": "44912837465"
}
""";
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.sudomock.com/api/v1/studio/create-session"))
.header("x-api-key", "sm_your_api_key")
.header("Content-Type", "application/json")
.POST(HttpRequest.BodyPublishers.ofString(payload))
.build();
HttpResponse<String> response = HttpClient.newHttpClient()
.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
using System.Net.Http;
using System.Text;
var payload = """
{
"allowed_origin": "https://your-store.example.com",
"mockup_type": "psd",
"mockup_uuid": "c315f78f-d2c7-4541-b240-a9372842de94",
"product_id": "8342019283",
"session_kind": "customize",
"variant_id": "44912837465"
}
""";
var request = new HttpRequestMessage(HttpMethod.Post, "https://api.sudomock.com/api/v1/studio/create-session");
request.Headers.Add("x-api-key", "sm_your_api_key");
request.Content = new StringContent(payload, Encoding.UTF8, "application/json");
var client = new HttpClient();
var response = await client.SendAsync(request);
Console.WriteLine(await response.Content.ReadAsStringAsync());
curl -X POST "https://api.sudomock.com/api/v1/studio/create-session" \
-H "x-api-key: sm_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"allowed_origin": "https://your-store.example.com",
"mockup_type": "psd",
"mockup_uuid": "c315f78f-d2c7-4541-b240-a9372842de94",
"product_id": "8342019283",
"session_kind": "customize",
"variant_id": "44912837465"
}'
{
"mockup_type": "psd",
"session": "string",
"expires_in": 1,
"message_session_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"bootstrap_secret": "string"
}
const response = await fetch("https://api.sudomock.com/api/v1/studio/create-session", {
method: "POST",
headers: {
"x-api-key": "sm_your_api_key",
"Content-Type": "application/json",
},
body: JSON.stringify({
"allowed_origin": "https://your-store.example.com",
"mockup_type": "psd",
"mockup_uuid": "c315f78f-d2c7-4541-b240-a9372842de94",
"product_id": "8342019283",
"session_kind": "customize",
"variant_id": "44912837465"
}),
});
const data = await response.json();
console.log(data);
<?php
$payload = <<<'JSON'
{
"allowed_origin": "https://your-store.example.com",
"mockup_type": "psd",
"mockup_uuid": "c315f78f-d2c7-4541-b240-a9372842de94",
"product_id": "8342019283",
"session_kind": "customize",
"variant_id": "44912837465"
}
JSON;
$ch = curl_init("https://api.sudomock.com/api/v1/studio/create-session");
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
"x-api-key: sm_your_api_key",
"Content-Type: application/json",
]);
curl_setopt($ch, CURLOPT_POSTFIELDS, $payload);
$response = curl_exec($ch);
curl_close($ch);
echo $response;
import requests
payload = {
"allowed_origin": "https://your-store.example.com",
"mockup_type": "psd",
"mockup_uuid": "c315f78f-d2c7-4541-b240-a9372842de94",
"product_id": "8342019283",
"session_kind": "customize",
"variant_id": "44912837465"
}
response = requests.post(
"https://api.sudomock.com/api/v1/studio/create-session",
headers={"x-api-key": "sm_your_api_key"},
json=payload,
)
response.raise_for_status()
print(response.json())
require "net/http"
require "uri"
uri = URI("https://api.sudomock.com/api/v1/studio/create-session")
request = Net::HTTP::Post.new(uri)
request["x-api-key"] = "sm_your_api_key"
request["Content-Type"] = "application/json"
request.body = <<~JSON
{
"allowed_origin": "https://your-store.example.com",
"mockup_type": "psd",
"mockup_uuid": "c315f78f-d2c7-4541-b240-a9372842de94",
"product_id": "8342019283",
"session_kind": "customize",
"variant_id": "44912837465"
}
JSON
response = Net::HTTP.start(uri.host, uri.port, use_ssl: true) do |http|
http.request(request)
end
puts response.body
package main
import (
"bytes"
"fmt"
"io"
"net/http"
)
func main() {
payload := []byte(`{
"allowed_origin": "https://your-store.example.com",
"mockup_type": "psd",
"mockup_uuid": "c315f78f-d2c7-4541-b240-a9372842de94",
"product_id": "8342019283",
"session_kind": "customize",
"variant_id": "44912837465"
}`)
req, err := http.NewRequest("POST", "https://api.sudomock.com/api/v1/studio/create-session", bytes.NewBuffer(payload))
if err != nil {
panic(err)
}
req.Header.Set("x-api-key", "sm_your_api_key")
req.Header.Set("Content-Type", "application/json")
res, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
String payload = """
{
"allowed_origin": "https://your-store.example.com",
"mockup_type": "psd",
"mockup_uuid": "c315f78f-d2c7-4541-b240-a9372842de94",
"product_id": "8342019283",
"session_kind": "customize",
"variant_id": "44912837465"
}
""";
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.sudomock.com/api/v1/studio/create-session"))
.header("x-api-key", "sm_your_api_key")
.header("Content-Type", "application/json")
.POST(HttpRequest.BodyPublishers.ofString(payload))
.build();
HttpResponse<String> response = HttpClient.newHttpClient()
.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
using System.Net.Http;
using System.Text;
var payload = """
{
"allowed_origin": "https://your-store.example.com",
"mockup_type": "psd",
"mockup_uuid": "c315f78f-d2c7-4541-b240-a9372842de94",
"product_id": "8342019283",
"session_kind": "customize",
"variant_id": "44912837465"
}
""";
var request = new HttpRequestMessage(HttpMethod.Post, "https://api.sudomock.com/api/v1/studio/create-session");
request.Headers.Add("x-api-key", "sm_your_api_key");
request.Content = new StringContent(payload, Encoding.UTF8, "application/json");
var client = new HttpClient();
var response = await client.SendAsync(request);
Console.WriteLine(await response.Content.ReadAsStringAsync());
curl -X POST "https://api.sudomock.com/api/v1/studio/create-session" \
-H "x-api-key: sm_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"allowed_origin": "https://your-store.example.com",
"mockup_type": "psd",
"mockup_uuid": "c315f78f-d2c7-4541-b240-a9372842de94",
"product_id": "8342019283",
"session_kind": "customize",
"variant_id": "44912837465"
}'
{
"mockup_type": "psd",
"session": "string",
"expires_in": 1,
"message_session_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"bootstrap_secret": "string"
}
Authorizations
API key with sm_ prefix. Get your key at https://sudomock.com/dashboard/api-keys
Body
psd, 2d setup, customize UUID of the mockup to customize
"c315f78f-d2c7-4541-b240-a9372842de94"
Product ID from the platform
255"8342019283"
Variant ID from the platform
255"44912837465"
2048"https://your-store.example.com"
Optional session-only Studio config override. Not persisted.
Hide child attributes
Hide child attributes
^#[0-9A-Fa-f]{6}$^#[0-9A-Fa-f]{6}$^#[0-9A-Fa-f]{6}$^#[0-9A-Fa-f]{6}$^#[0-9A-Fa-f]{6}$^#[0-9A-Fa-f]{6}$^#[0-9A-Fa-f]{6}$0 <= x <= 202048"https://your-store.example.com/assets/logo.png"
1 - 64^[A-Za-z0-9][A-Za-z0-9 ,._-]*$"Inter, sans-serif"
961 - 961 - 961 - 961 - 961 - 961 - 961 - 96300 <= x <= 3000full, compact 1 - 96 elements[ { "hex": "#1a1a1a", "label": "Black" }, { "hex": "#f5f5f5", "label": "Natural" } ]
light, dark en, tr 1 <= x <= 501 - 64^[A-Za-z0-9][A-Za-z0-9._:-]{0,63}$"add-to-cart"
- StudioArtworkInput · object[]
- StudioArtworkInput · object
Hide child attributes
Hide child attributes
Smart Object id for PSD. For 2D, either a saved print area id or a product surface id. The same field accepts both.
^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"7c1f4b02-9d3e-4a68-b5c1-0e2d9a6f83b4"
HTTPS artwork URL. Ignored when base64 is also supplied.
2048"https://cdn.example.com/design.png"
Canonical raw base64 artwork, up to 64 MB decoded. Takes precedence when url is also supplied.
4 - 89478488Optional opening placement for this design, in percentages of the target's own region. Omit it to open where the editor opens today.
Hide child attributes
Hide child attributes
How large the design starts: an allowance, or the box itself.
- StudioSeedAutoBox
- StudioSeedManualBox
{ "coverage": 85, "mode": "auto" }
How the artwork's pixels meet the box.
fill, fit, crop Percentage of the region WIDTH, from the region centre, positive right.
-100 <= x <= 10012.5
Percentage of the region HEIGHT, from the region centre, positive down.
-100 <= x <= 100-8
Degrees about the box centre, clockwise positive.
-360 <= x <= 360-15
Flip artwork horizontally (left-right mirror)
Flip artwork vertically (top-bottom mirror)
Optional opening appearance for this design. Send back what a finished session reported to carry a look from one mockup of a product to the next. Omit it to open at the editor's own values. A PSD target reads brightness, contrast, saturation, vibrance, opacity and blur; a photo target reads opacity and blend_mode.
Hide child attributes
Hide child attributes
Brightness, -100 to 100. Omit for the editor's own.
-100 <= x <= 10010
Contrast, -100 to 100. Omit for the editor's own.
-100 <= x <= 1008
Saturation, -100 to 100. Omit for the editor's own.
-100 <= x <= 100-5
Vibrance, -100 to 100. Omit for the editor's own.
-100 <= x <= 10015
Opacity, 0 to 100. Omit for the editor's own.
0 <= x <= 10080
Blur, 0 to 20, in half steps. Omit for the editor's own.
0 <= x <= 202.5
How the artwork sits on the product surface. Photo targets only. Omit for the editor's own.
multiply, normal, screen, lighten, soft_light, overlay, darken Response
Successful Response
psd, 2d "sess_xQ8pM2vK7nR4tB1yH6zJ3wL5sD9fG0aC2eN8uV4iT7o"
900
"7d1b4a90-2e63-4f18-bb27-1c9a0e4d7f52"
Was this page helpful?