Authentication
How to sign every request to the vinieta.md Partner API with an HMAC-SHA512 signature.
🤖 Building with an AI agent? Point your assistant at
llms.txt(a concise index) orllms-full.txt(the complete spec in a single file) — both are written for LLMs to scaffold an integration end-to-end.
Generating the HMAC Signature
Section titled “Generating the HMAC Signature”All requests to the API must include an X-Hmac-Signature header that contains
your Partner ID and an HMAC signature of the request body. The signature is
generated using the HMAC SHA512 algorithm, with the partner’s secret API key as
the HMAC key.
X-Hmac-Signature: <partnerId>:<signature><partnerId>is your partner identifier (issued to you by vinieta.md).<signature>is the lowercase hex digest ofHMAC-SHA512(rawRequestBody, partnerSecret), wherepartnerSecretis your secret API key (also issued by vinieta.md).- The HMAC key is your
partnerSecret. The HMAC message is the exact raw JSON body string you send — the same bytes the server receives.
The API uses the X-Hmac-Signature header to verify that the request has not
been tampered with and is from an authorized partner. Requests missing the HMAC
signature or with an invalid signature will be rejected.
Failure modes you must handle:
| Code | Cause |
|---|---|
401 |
Header missing entirely |
403 |
Header present but signature invalid (wrong secret, wrong partnerId, re-serialized body) |
Examples
Section titled “Examples”To generate the signature in code:
const crypto = require('crypto');
const body = {...}; // JSON attributes in doc orderconst secret = '...';const partnerId = '...';
const hmac = crypto.createHmac('sha512', secret);hmac.update(JSON.stringify(body));
const signature = hmac.digest('hex');
request.headers['X-Hmac-Signature'] = `${partnerId}:${signature}`;$body = ['...']; // JSON attributes in doc order$secret = '...';$partnerId = '...';
$hmac = hash_hmac('sha512', json_encode($body), $secret);
$headers['X-Hmac-Signature'] = $partnerId . ':' . $hmac;import hashlibimport hmac as hmac_libimport json
body = {...} # JSON attributes in doc ordersecret = '...'partner_id = '...'
signature = hmac_lib.new( secret.encode(), json.dumps(body).encode('utf-8'), hashlib.sha512,).hexdigest()
headers = {'X-Hmac-Signature': partner_id + ':' + signature}The canonical algorithm is a keyed HMAC-SHA512 over the serialized body,
hex-encoded. Match the output of the JS and PHP snippets above.
Postman Pre-request Script
Section titled “Postman Pre-request Script”const message = JSON.stringify(JSON.parse(pm.request.body.raw));const secret = "...";const partnerId = "...";const hashHmacSHA512 = CryptoJS.HmacSHA512(message, secret).toString();
pm.request.headers.add(`x-hmac-signature:${partnerId}:${hashHmacSHA512}`);Next: the Quickstart walks the full order lifecycle end to end.