How to generate mockups with an API?
The MockupLaunch API allows you to generate mockups programmatically.
PHP examples are provided throughout our API documentation. However, calls to the MockupLaunch API can also be made via various other libraries.
Before you start
To complete the actions presented below, you must have:
- A logged in MockupLaunch account.
- An active subscription that includes our API, Pro Plan or Premium Plan.
- Created an API token.
- Read the API documentation.
Generate mockup request
use GuzzleHttp\Client;
// Your API access token
$token = "my-secret-token";
// API endpoint URL
$endpoint = "https://mockuplaunch.com/api/v1/mockup/266fa483-f8c0-4a97-aed3-dd09c7e89e7d";
// Control the placement of the artwork in the mockup area
$options = [
"design" => [
"x" => 100,
"y" => 100,
"zoom" => 0.8,
]
];
// Create API request
$request = (new Client())->post($endpoint, [
"headers" => [
"Accept" => "application/json",
"Authorization" => "Bearer ".$token,
],
"multipart" => [
[
"name" => "design",
"contents" => fopen("/path/file.jpg", "r"),
"filename" => "file.jpg",
],
[
"name" => "options",
"contents" => json_encode($options),
]
]
]);
// Get mockup from the response
$response = $request->getBody()->getContents();
Response
API response format is JSON
{
"mockup": "iVBORw0KGgoAAAANSUhEUgAAAGQAAABkCAIAAAD/gAIDAAAACXBIWXMAAAsTAAALEwEAmpwYAABIlklEQVR4nG39abBlWXYehq219nCmO70x56ysubqqq9HoEQ00AJEADAoERIGSQdKiqJAj7FCE5T8OSVSEFCEpwpRsBqWQGJL5Q6RkU7QkUyRIgpgIGwSBFrsBEFWorq7uGrrmnF6++U5n2Huvtfxj3/eyCtKNzIqXma/evWefvdf61vd9ax38T//jf7cuy/Fo6l0hKiEMYQjD0A+h70Mfh2FYrduuLZrm6o0bu7M9XxRAaCyNR6Ot6XY5nhhflnVV1vW9u/d/89d+5ezBR6TpZLladf0Tt28//dQzW7MtVxSz7dnWbBsAEkcVIWOrauyqynqHhlJIq9Pzw/PT1EeLlKRdtW0K0aqKKjNzYmvNdDbb3dspmom13lpdns8/ev/9Vd874yRGZlaA6bUbn//Sl69fvWGIhjAQkTHm/v37p6cnAAiqVV2zpGEYJEQOkbxrJhMVjSEoqCojICLt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G2cLJCTKnlUA0ZRSHwbhFMIgckkmQk4NoEzKii7jLGutcx4Bs0cwbyr9BIBXVeZNKKTnX/7CG99+65f+/t9dzg+euv3y1Zl0D/7i88/Pnnji5aPDg7KonS9ijIvlajYxP/a1Z15+8XZRjZrJVs/BETb1+OC8fe+995VBYt8PfYwpxRiYh8RZGbgwAEFG4MKqBhGILKpX2BCBBpw1zhnn0XnjnHPOFM6UhSt84X1ReO+9c84aQ4hEhoyBi7OWLy3G0KXofHFld//Onadu3nxid/dK4eu8y/I1q4KKXAY9Y8h7j4iiwhtQp588vbopIBUA7AcfPXz+2Se/8pUfI0P3Hx7NH/wWz+/eeu6JfoigGlNQBRaYTHYm9Yfd6W/u7P3cdHKlrCoeegNclxWn0Vsf3t/d3Xv6mTtDt0QA1dJYybynAfqUnJGDSb53uRZkFLpcVRW6AN0I+eZvcNMmw4GoEJrH+wUBEUVERG7evjPb3a2r2hAxSz/0pydnxizH40lV1Vtb24vFaUziiI2knCYMGecsYvYvSU7DReG8d5+otjfKlSVbfPkrX71+/XrSpl0cvX9+44WX/8v33n1vlWpWTSn0fRdDjEX7UJt2tdf1HyDRyeJstVxjaQxAU9en/fCH331zNKp3dne79VpVnXgVZeYcskX1kodEpAz"
}
Feel free to contact us if you have any questions regarding the API implementation.
About
Arnd-Jan (pronounced AJ) is a software engineer and founder of MockupLaunch.
Driven by a fascination for automation and scalable solutions. He combines his tech skills with entrepreneurial experience as a print-on-demand seller, helping businesses streamline creative workflows and grow efficiently.
Want product news and updates? Sign up for our newsletter.
We care about your data. Read our privacy policy.