const response = await fetch("https://api.sudomock.com/api/v1/photo-mockups/3fa85f64-5717-4562-b3fc-2c963f66afa6/render", {
method: "POST",
headers: {
"x-api-key": "sm_your_api_key",
"Content-Type": "application/json",
},
body: JSON.stringify({
"export_options": {
"image_format": "webp",
"image_size": 1920,
"quality": 95
},
"print_areas": [
{
"adjustments": {
"blend_mode": "multiply",
"opacity": 90
},
"artwork_url": "https://example.com/design.png",
"placement": {
"fit": "fit",
"position": "center"
},
"uuid": "223e4567-e89b-12d3-a456-426614174001"
}
]
}),
});
const data = await response.json();
console.log(data);
<?php
$payload = <<<'JSON'
{
"export_options": {
"image_format": "webp",
"image_size": 1920,
"quality": 95
},
"print_areas": [
{
"adjustments": {
"blend_mode": "multiply",
"opacity": 90
},
"artwork_url": "https://example.com/design.png",
"placement": {
"fit": "fit",
"position": "center"
},
"uuid": "223e4567-e89b-12d3-a456-426614174001"
}
]
}
JSON;
$ch = curl_init("https://api.sudomock.com/api/v1/photo-mockups/3fa85f64-5717-4562-b3fc-2c963f66afa6/render");
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 = {'export_options': {'image_format': 'webp',
'image_size': 1920,
'quality': 95},
'print_areas': [{'adjustments': {'blend_mode': 'multiply',
'opacity': 90},
'artwork_url': 'https://example.com/design.png',
'placement': {'fit': 'fit',
'position': 'center'},
'uuid': '223e4567-e89b-12d3-a456-426614174001'}]}
response = requests.post(
"https://api.sudomock.com/api/v1/photo-mockups/3fa85f64-5717-4562-b3fc-2c963f66afa6/render",
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/photo-mockups/3fa85f64-5717-4562-b3fc-2c963f66afa6/render")
request = Net::HTTP::Post.new(uri)
request["x-api-key"] = "sm_your_api_key"
request["Content-Type"] = "application/json"
request.body = <<~JSON
{
"export_options": {
"image_format": "webp",
"image_size": 1920,
"quality": 95
},
"print_areas": [
{
"adjustments": {
"blend_mode": "multiply",
"opacity": 90
},
"artwork_url": "https://example.com/design.png",
"placement": {
"fit": "fit",
"position": "center"
},
"uuid": "223e4567-e89b-12d3-a456-426614174001"
}
]
}
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(`{
"export_options": {
"image_format": "webp",
"image_size": 1920,
"quality": 95
},
"print_areas": [
{
"adjustments": {
"blend_mode": "multiply",
"opacity": 90
},
"artwork_url": "https://example.com/design.png",
"placement": {
"fit": "fit",
"position": "center"
},
"uuid": "223e4567-e89b-12d3-a456-426614174001"
}
]
}`)
req, err := http.NewRequest("POST", "https://api.sudomock.com/api/v1/photo-mockups/3fa85f64-5717-4562-b3fc-2c963f66afa6/render", 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 = """
{
"export_options": {
"image_format": "webp",
"image_size": 1920,
"quality": 95
},
"print_areas": [
{
"adjustments": {
"blend_mode": "multiply",
"opacity": 90
},
"artwork_url": "https://example.com/design.png",
"placement": {
"fit": "fit",
"position": "center"
},
"uuid": "223e4567-e89b-12d3-a456-426614174001"
}
]
}
""";
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.sudomock.com/api/v1/photo-mockups/3fa85f64-5717-4562-b3fc-2c963f66afa6/render"))
.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 = """
{
"export_options": {
"image_format": "webp",
"image_size": 1920,
"quality": 95
},
"print_areas": [
{
"adjustments": {
"blend_mode": "multiply",
"opacity": 90
},
"artwork_url": "https://example.com/design.png",
"placement": {
"fit": "fit",
"position": "center"
},
"uuid": "223e4567-e89b-12d3-a456-426614174001"
}
]
}
""";
var request = new HttpRequestMessage(HttpMethod.Post, "https://api.sudomock.com/api/v1/photo-mockups/3fa85f64-5717-4562-b3fc-2c963f66afa6/render");
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/photo-mockups/3fa85f64-5717-4562-b3fc-2c963f66afa6/render" \
-H "x-api-key: sm_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"export_options": {
"image_format": "webp",
"image_size": 1920,
"quality": 95
},
"print_areas": [
{
"adjustments": {
"blend_mode": "multiply",
"opacity": 90
},
"artwork_url": "https://example.com/design.png",
"placement": {
"fit": "fit",
"position": "center"
},
"uuid": "223e4567-e89b-12d3-a456-426614174001"
}
]
}'
{
"data": {
"print_files": [
{
"duration_ms": 1840,
"export_format": "webp",
"export_path": "https://cdn.sudomock.com/mockup-assets/renders/2d/893ea326-278b-480b-b130-87dd6aee06dc/ac0a5f31-6d2e-4d1b-9c4c-1e7f2b6a5d08.webp"
}
],
"render_uuid": "ac0a5f31-6d2e-4d1b-9c4c-1e7f2b6a5d08"
},
"success": true
}
{
"job_id": "5f1c0b2a-7d43-4e9a-8c16-0b5d3f7a2e94",
"kind": "photo_mockup_render",
"status": "queued",
"status_url": "/api/v1/jobs/5f1c0b2a-7d43-4e9a-8c16-0b5d3f7a2e94"
}
Render a photo mockup
Renders artwork onto a previously created photo mockup identified by the path mockup_id. Artwork can target a saved print area or a whole product surface, and a product offers both. The mockup must be in ‘ready’ status. Costs 5 credits. Returns CDN URL(s) of the rendered image.
const response = await fetch("https://api.sudomock.com/api/v1/photo-mockups/3fa85f64-5717-4562-b3fc-2c963f66afa6/render", {
method: "POST",
headers: {
"x-api-key": "sm_your_api_key",
"Content-Type": "application/json",
},
body: JSON.stringify({
"export_options": {
"image_format": "webp",
"image_size": 1920,
"quality": 95
},
"print_areas": [
{
"adjustments": {
"blend_mode": "multiply",
"opacity": 90
},
"artwork_url": "https://example.com/design.png",
"placement": {
"fit": "fit",
"position": "center"
},
"uuid": "223e4567-e89b-12d3-a456-426614174001"
}
]
}),
});
const data = await response.json();
console.log(data);
<?php
$payload = <<<'JSON'
{
"export_options": {
"image_format": "webp",
"image_size": 1920,
"quality": 95
},
"print_areas": [
{
"adjustments": {
"blend_mode": "multiply",
"opacity": 90
},
"artwork_url": "https://example.com/design.png",
"placement": {
"fit": "fit",
"position": "center"
},
"uuid": "223e4567-e89b-12d3-a456-426614174001"
}
]
}
JSON;
$ch = curl_init("https://api.sudomock.com/api/v1/photo-mockups/3fa85f64-5717-4562-b3fc-2c963f66afa6/render");
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 = {'export_options': {'image_format': 'webp',
'image_size': 1920,
'quality': 95},
'print_areas': [{'adjustments': {'blend_mode': 'multiply',
'opacity': 90},
'artwork_url': 'https://example.com/design.png',
'placement': {'fit': 'fit',
'position': 'center'},
'uuid': '223e4567-e89b-12d3-a456-426614174001'}]}
response = requests.post(
"https://api.sudomock.com/api/v1/photo-mockups/3fa85f64-5717-4562-b3fc-2c963f66afa6/render",
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/photo-mockups/3fa85f64-5717-4562-b3fc-2c963f66afa6/render")
request = Net::HTTP::Post.new(uri)
request["x-api-key"] = "sm_your_api_key"
request["Content-Type"] = "application/json"
request.body = <<~JSON
{
"export_options": {
"image_format": "webp",
"image_size": 1920,
"quality": 95
},
"print_areas": [
{
"adjustments": {
"blend_mode": "multiply",
"opacity": 90
},
"artwork_url": "https://example.com/design.png",
"placement": {
"fit": "fit",
"position": "center"
},
"uuid": "223e4567-e89b-12d3-a456-426614174001"
}
]
}
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(`{
"export_options": {
"image_format": "webp",
"image_size": 1920,
"quality": 95
},
"print_areas": [
{
"adjustments": {
"blend_mode": "multiply",
"opacity": 90
},
"artwork_url": "https://example.com/design.png",
"placement": {
"fit": "fit",
"position": "center"
},
"uuid": "223e4567-e89b-12d3-a456-426614174001"
}
]
}`)
req, err := http.NewRequest("POST", "https://api.sudomock.com/api/v1/photo-mockups/3fa85f64-5717-4562-b3fc-2c963f66afa6/render", 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 = """
{
"export_options": {
"image_format": "webp",
"image_size": 1920,
"quality": 95
},
"print_areas": [
{
"adjustments": {
"blend_mode": "multiply",
"opacity": 90
},
"artwork_url": "https://example.com/design.png",
"placement": {
"fit": "fit",
"position": "center"
},
"uuid": "223e4567-e89b-12d3-a456-426614174001"
}
]
}
""";
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.sudomock.com/api/v1/photo-mockups/3fa85f64-5717-4562-b3fc-2c963f66afa6/render"))
.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 = """
{
"export_options": {
"image_format": "webp",
"image_size": 1920,
"quality": 95
},
"print_areas": [
{
"adjustments": {
"blend_mode": "multiply",
"opacity": 90
},
"artwork_url": "https://example.com/design.png",
"placement": {
"fit": "fit",
"position": "center"
},
"uuid": "223e4567-e89b-12d3-a456-426614174001"
}
]
}
""";
var request = new HttpRequestMessage(HttpMethod.Post, "https://api.sudomock.com/api/v1/photo-mockups/3fa85f64-5717-4562-b3fc-2c963f66afa6/render");
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/photo-mockups/3fa85f64-5717-4562-b3fc-2c963f66afa6/render" \
-H "x-api-key: sm_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"export_options": {
"image_format": "webp",
"image_size": 1920,
"quality": 95
},
"print_areas": [
{
"adjustments": {
"blend_mode": "multiply",
"opacity": 90
},
"artwork_url": "https://example.com/design.png",
"placement": {
"fit": "fit",
"position": "center"
},
"uuid": "223e4567-e89b-12d3-a456-426614174001"
}
]
}'
{
"data": {
"print_files": [
{
"duration_ms": 1840,
"export_format": "webp",
"export_path": "https://cdn.sudomock.com/mockup-assets/renders/2d/893ea326-278b-480b-b130-87dd6aee06dc/ac0a5f31-6d2e-4d1b-9c4c-1e7f2b6a5d08.webp"
}
],
"render_uuid": "ac0a5f31-6d2e-4d1b-9c4c-1e7f2b6a5d08"
},
"success": true
}
{
"job_id": "5f1c0b2a-7d43-4e9a-8c16-0b5d3f7a2e94",
"kind": "photo_mockup_render",
"status": "queued",
"status_url": "/api/v1/jobs/5f1c0b2a-7d43-4e9a-8c16-0b5d3f7a2e94"
}
const response = await fetch("https://api.sudomock.com/api/v1/photo-mockups/3fa85f64-5717-4562-b3fc-2c963f66afa6/render", {
method: "POST",
headers: {
"x-api-key": "sm_your_api_key",
"Content-Type": "application/json",
},
body: JSON.stringify({
"export_options": {
"image_format": "webp",
"image_size": 1920,
"quality": 95
},
"print_areas": [
{
"adjustments": {
"blend_mode": "multiply",
"opacity": 90
},
"artwork_url": "https://example.com/design.png",
"placement": {
"fit": "fit",
"position": "center"
},
"uuid": "223e4567-e89b-12d3-a456-426614174001"
}
]
}),
});
const data = await response.json();
console.log(data);
<?php
$payload = <<<'JSON'
{
"export_options": {
"image_format": "webp",
"image_size": 1920,
"quality": 95
},
"print_areas": [
{
"adjustments": {
"blend_mode": "multiply",
"opacity": 90
},
"artwork_url": "https://example.com/design.png",
"placement": {
"fit": "fit",
"position": "center"
},
"uuid": "223e4567-e89b-12d3-a456-426614174001"
}
]
}
JSON;
$ch = curl_init("https://api.sudomock.com/api/v1/photo-mockups/3fa85f64-5717-4562-b3fc-2c963f66afa6/render");
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 = {'export_options': {'image_format': 'webp',
'image_size': 1920,
'quality': 95},
'print_areas': [{'adjustments': {'blend_mode': 'multiply',
'opacity': 90},
'artwork_url': 'https://example.com/design.png',
'placement': {'fit': 'fit',
'position': 'center'},
'uuid': '223e4567-e89b-12d3-a456-426614174001'}]}
response = requests.post(
"https://api.sudomock.com/api/v1/photo-mockups/3fa85f64-5717-4562-b3fc-2c963f66afa6/render",
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/photo-mockups/3fa85f64-5717-4562-b3fc-2c963f66afa6/render")
request = Net::HTTP::Post.new(uri)
request["x-api-key"] = "sm_your_api_key"
request["Content-Type"] = "application/json"
request.body = <<~JSON
{
"export_options": {
"image_format": "webp",
"image_size": 1920,
"quality": 95
},
"print_areas": [
{
"adjustments": {
"blend_mode": "multiply",
"opacity": 90
},
"artwork_url": "https://example.com/design.png",
"placement": {
"fit": "fit",
"position": "center"
},
"uuid": "223e4567-e89b-12d3-a456-426614174001"
}
]
}
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(`{
"export_options": {
"image_format": "webp",
"image_size": 1920,
"quality": 95
},
"print_areas": [
{
"adjustments": {
"blend_mode": "multiply",
"opacity": 90
},
"artwork_url": "https://example.com/design.png",
"placement": {
"fit": "fit",
"position": "center"
},
"uuid": "223e4567-e89b-12d3-a456-426614174001"
}
]
}`)
req, err := http.NewRequest("POST", "https://api.sudomock.com/api/v1/photo-mockups/3fa85f64-5717-4562-b3fc-2c963f66afa6/render", 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 = """
{
"export_options": {
"image_format": "webp",
"image_size": 1920,
"quality": 95
},
"print_areas": [
{
"adjustments": {
"blend_mode": "multiply",
"opacity": 90
},
"artwork_url": "https://example.com/design.png",
"placement": {
"fit": "fit",
"position": "center"
},
"uuid": "223e4567-e89b-12d3-a456-426614174001"
}
]
}
""";
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.sudomock.com/api/v1/photo-mockups/3fa85f64-5717-4562-b3fc-2c963f66afa6/render"))
.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 = """
{
"export_options": {
"image_format": "webp",
"image_size": 1920,
"quality": 95
},
"print_areas": [
{
"adjustments": {
"blend_mode": "multiply",
"opacity": 90
},
"artwork_url": "https://example.com/design.png",
"placement": {
"fit": "fit",
"position": "center"
},
"uuid": "223e4567-e89b-12d3-a456-426614174001"
}
]
}
""";
var request = new HttpRequestMessage(HttpMethod.Post, "https://api.sudomock.com/api/v1/photo-mockups/3fa85f64-5717-4562-b3fc-2c963f66afa6/render");
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/photo-mockups/3fa85f64-5717-4562-b3fc-2c963f66afa6/render" \
-H "x-api-key: sm_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"export_options": {
"image_format": "webp",
"image_size": 1920,
"quality": 95
},
"print_areas": [
{
"adjustments": {
"blend_mode": "multiply",
"opacity": 90
},
"artwork_url": "https://example.com/design.png",
"placement": {
"fit": "fit",
"position": "center"
},
"uuid": "223e4567-e89b-12d3-a456-426614174001"
}
]
}'
{
"data": {
"print_files": [
{
"duration_ms": 1840,
"export_format": "webp",
"export_path": "https://cdn.sudomock.com/mockup-assets/renders/2d/893ea326-278b-480b-b130-87dd6aee06dc/ac0a5f31-6d2e-4d1b-9c4c-1e7f2b6a5d08.webp"
}
],
"render_uuid": "ac0a5f31-6d2e-4d1b-9c4c-1e7f2b6a5d08"
},
"success": true
}
{
"job_id": "5f1c0b2a-7d43-4e9a-8c16-0b5d3f7a2e94",
"kind": "photo_mockup_render",
"status": "queued",
"status_url": "/api/v1/jobs/5f1c0b2a-7d43-4e9a-8c16-0b5d3f7a2e94"
}
Authorizations
API key with sm_ prefix. Get your key at https://sudomock.com/dashboard/api-keys
Path Parameters
Id of the photo mockup the artwork is rendered onto.
Body
Body for POST /api/v1/photo-mockups/{mockup_id}/render.
The mockup UUID is taken from the path; the body carries only per-print-area artwork configuration and export options.
Artwork configuration per render target. Use uuid for a saved print area, and surface_uuid for a whole product surface. A product can be rendered either way, and saving a print area on it does not take its surface away.
1 - 8 elementsShow child attributes
Show child attributes
Export configuration for format, size and quality. Every field has a default, so the whole object is optional.
Show child attributes
Show child attributes
{ "image_format": "webp", "image_size": 2048, "quality": 95 }
If true, the render is QUEUED and the call returns 202 immediately with a job_id (poll GET /api/v1/jobs/{job_id}, or receive a webhook if one is configured); result_url carries the rendered image URL on success. If false (default), the render runs synchronously and returns the result.
Was this page helpful?