PAYOK Signature Generator plugin for Yaak HTTP Client
Yaak plugin to generate and verify PAYOK RSA-SHA256 digital signatures directly inside your requests.
| Feature | Description |
|---|---|
payok.signature |
Generate the sign header for outgoing PAYOK API requests |
payok.timestamp |
Generate a consistent ISO8601 timestamp for requestTime fields |
payok.uuid |
Generate a consistent UUID for fields like merchantOrderId |
| Export Signature Code | Export standalone signing (and webhook verification) code in 6 languages |
| Verify Incoming Signature | Verify a received signature live inside Yaak — no external tools needed |
payok.signatureGenerates the sign header value. The plugin reads the request body automatically — no need to copy it into the arguments.
Setup:
signpayok and select payok.signature from autocomplete/api-pay/payment/V3.2/order/create-api (must match the path PAYOK expects for signing, independent of the request URL)payok.timestampGenerates the current ISO8601 timestamp (e.g. 2024-01-15T10:30:00.123Z).
In the request body, place your cursor inside the requestTime value and select payok.timestamp from the template tag autocomplete.
{ "requestTime": "${[ payok.timestamp() ]}" }
payok.uuidGenerates a UUID for fields like merchantOrderId that must be unique per request.
{ "merchantOrderId": "${[ payok.uuid() ]}" }
payok.signature expires both caches before rendering the body. This guarantees:
payok.signature renders
→ expires UUID + timestamp caches
→ renders body → payok.uuid() and payok.timestamp() generate fresh values and cache them
→ signs body with those values
Yaak sends actual request
→ renders body → payok.uuid() and payok.timestamp() return cached values ✓
Both formats are accepted:
MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSj...
-----BEGIN PRIVATE KEY-----
MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSj...
-----END PRIVATE KEY-----
If your key starts with
-----BEGIN RSA PRIVATE KEY-----(PKCS#1), convert it first:openssl pkcs8 -topk8 -nocrypt -in rsa_private.pem -out pkcs8_private.pem
Right-click any request in the sidebar (or open the request’s actions menu) and select Export Signature Code to generate a standalone code snippet that reproduces the PAYOK signature algorithm in your language of choice:
Pick a language from the dropdown to regenerate the snippet, then click Copy to Clipboard.
| Value | Source |
|---|---|
| Body | The current request body, with template tags resolved |
| Path | The pathname extracted from the request URL (e.g. /api-pay/payment/V3.2/order/create-api) |
| Private key | The private_key argument on the sign header’s payok.signature(...) tag, including nested references such as ${[ getEnvironmentVariable(...) ]} |
If no sign header with a private_key is configured yet, a PASTE_YOUR_BASE64_PKCS8_PRIVATE_KEY_HERE placeholder is used instead.
Note:
payok.signatureuses the Endpoint Path you enter in its dialog, while Export Signature Code derives the path from the request URL. Make sure both match the path PAYOK expects when signing outgoing requests.
Each snippet is fully standalone (only using each language’s standard library, plus cryptography for Python and openssl for PHP) and implements the exact same steps as payok.signature:
-----BEGIN/END (RSA) PRIVATE KEY----- headers from the supplied Base64 key and rewrap it as a PKCS#8 PEM block.<body> + "&" + <path>.⚠️ Security note: when a real key is found, the exported code — and your clipboard — contains your actual private key in plaintext. Don’t paste it into shared chats, tickets, or commit it to version control.
Every exported snippet also includes a verifySignature function (or VerifySignature / verify_signature, depending on language convention). It validates a signature against an RSA public key (X.509 / SubjectPublicKeyInfo, Base64 or PEM):
-----BEGIN/END PUBLIC KEY----- headers from the supplied Base64 key.<body> + "&" + <path>. If the path is empty: just <body>.true/false.A ready-to-run webhook verification example is included at the bottom of every snippet. Paste the real values over these placeholders:
PASTE_RECEIVED_WEBHOOK_BODY_HEREPASTE_RECEIVED_SIGNATURE_HEREPASTE_PAYOK_BASE64_PUBLIC_KEY_HEREThe example calls verifySignature with an empty path, since PAYOK signs notifications/webhooks over the body alone — confirmed by testing against a real PAYOK notification payload/signature/public key.
Right-click any request in the sidebar (or open the request’s actions menu) and select Verify Incoming Signature to check, directly inside Yaak, whether a signature you received (e.g. on an incoming PAYOK notification/webhook) is valid — no exported code or external tools needed.
Paste in:
sign value you receivedThe result — ✅ Valid, ❌ Invalid, or ⚠️ an error message (e.g. malformed Base64) — updates live as you edit the fields.
Note: this checks the signature over the body alone, matching how PAYOK signs incoming notifications/webhooks. This is different from outgoing requests you send to PAYOK (
payok.signature, Export Signature Code), which are signed overbody + "&" + pathinstead.Verification only succeeds if the public key matches the private key that produced the signature. Use PAYOK’s public key to verify signatures from PAYOK, and your own public key to verify signatures you produced.
Outgoing requests (you → PAYOK):
message = <request_body_string> + "&" + <endpoint_path>
signature = Base64( RSA-SHA256-sign(privateKey, message) )
Incoming notifications/webhooks (PAYOK → you):
message = <request_body_string>
signature = Base64( RSA-SHA256-sign(PAYOK_privateKey, message) )
Verification uses the same message format as signing — body + "&" + path for outgoing, body alone for incoming webhooks.