Embed a product page
GET/products/embed
Returns an HTML page presenting product information, suitable for embedding in a webpage or app via an iframe.
Authentication: This endpoint supports two authentication methods:
- HTTP Basic auth — pass the
Authorizationheader as with other endpoints. - Signed URL (MAC) — useful when embedding in a frontend where HTTP headers cannot be set. Pass
key,t, andmacquery parameters instead of theAuthorizationheader.
Tip: The
/products/findand/products/queryresponses include a pre-signed embed URL inmeta.embedUrl. This is the easiest way to get a working embed URL.
Generating a signed URL manually:
$message = "embed:" . $productId . ":" . $unixTimestamp;
$mac = hash_hmac("sha256", $message, $apiSecretKey);
Then append ?id={productId}&t={timestamp}&key={apiKeyId}&mac={mac} to the endpoint URL.
Malformed signed URL parameters (key, t, or mac) return HTTP 400 with error code bad_request
(for example when t is not a numeric Unix timestamp). Invalid or expired MAC signatures return 401.
Request
Responses
- 200
- 400
- 401
- 404
An HTML page presenting the product information.
Bad request. Returned when no product identifier is provided, or when signed URL
authentication parameters (key, t, or mac) are present but malformed
(for example t is not a numeric Unix timestamp).
For malformed MAC parameters the response body looks like:
{
"error": {
"status": 400,
"code": "bad_request",
"message": "Invalid MAC authentication parameters"
}
}
Authentication failed (invalid credentials or MAC).
Product not found.