{"info":{"_postman_id":"ec017cbc-7752-409f-8794-9c1dd1dae732","name":"PayEra API v1","description":"<html><head></head><body><h1 id=\"payera-api-integration\">PayEra API Integration</h1>\n<p>This collection contains all endpoints for the PayEra Payments API v1.</p>\n<hr>\n<h2 id=\"getting-started\">Getting Started</h2>\n<h3 id=\"step-1-create-api-keys\">Step 1: Create API Keys</h3>\n<ol>\n<li><p>Log in to your PayEra Merchant Portal</p>\n</li>\n<li><p>Go to <strong>API Keys</strong> in the sidebar</p>\n</li>\n<li><p>Click <strong>Generate New Key</strong></p>\n</li>\n<li><p>Save your credentials securely:</p>\n<ul>\n<li><p><code>pk_live_...</code> — Publishable key (used in API requests)</p>\n</li>\n<li><p><code>sk_live_...</code> — Secret key (used for signature generation)</p>\n</li>\n</ul>\n</li>\n</ol>\n<h3 id=\"step-2-get-your-checkout-id\">Step 2: Get Your Checkout ID</h3>\n<ol>\n<li><p>Go to <strong>Checkouts</strong> in the sidebar</p>\n</li>\n<li><p>Copy your Checkout ID (format: <code>PPPP-XXXX-XXXX-XXXX</code>)</p>\n</li>\n</ol>\n<h3 id=\"step-3-configure-webhook-endpoint\">Step 3: Configure Webhook Endpoint</h3>\n<ol>\n<li><p>Go to <strong>Webhooks</strong> in the sidebar</p>\n</li>\n<li><p>Click <strong>Add Endpoint</strong></p>\n</li>\n<li><p>Enter your webhook URL (e.g., <code>https://your-server.com/webhooks/payera</code>)</p>\n</li>\n<li><p>Save and copy your webhook signing secret (<code>whsec_...</code>)</p>\n</li>\n</ol>\n<hr>\n<h2 id=\"postman-setup\">Postman Setup</h2>\n<ol>\n<li><p><strong>Set collection variables:</strong></p>\n<ul>\n<li><p><code>baseUrl</code> — <code>https://api.payera.global/v1</code></p>\n</li>\n<li><p><code>apiKey</code> — Your publishable key (<code>pk_live_...</code>)</p>\n</li>\n<li><p><code>secretKey</code> — Your secret key (<code>sk_live_...</code>)</p>\n</li>\n<li><p><code>checkoutId</code> — Your checkout configuration ID</p>\n</li>\n</ul>\n</li>\n<li><p><strong>Signature auto-generation:</strong><br> This collection includes a pre-request script that automatically generates:</p>\n<ul>\n<li><p><code>X-Timestamp</code> header</p>\n</li>\n<li><p><code>X-Signature</code> header</p>\n</li>\n</ul>\n</li>\n</ol>\n<hr>\n<h2 id=\"signature-generation\">Signature Generation</h2>\n<p>The <code>X-Signature</code> header is computed as follows:</p>\n<ol>\n<li><p>Parse the JSON request body into key-value pairs</p>\n</li>\n<li><p>Add <code>timestamp</code> as an extra key (value = the <code>X-Timestamp</code> header, RFC3339 without milliseconds)</p>\n</li>\n<li><p>Sort all keys alphabetically</p>\n</li>\n<li><p>Flatten each value to a string (strings as-is, numbers to string, booleans to <code>true</code>/<code>false</code>, objects to JSON with sorted keys)</p>\n</li>\n<li><p>Hash your secret key: <code>SHA256(sk_live_xxx)</code> → lowercase hex (64 characters)</p>\n</li>\n<li><p>Append the hashed secret key as the last value</p>\n</li>\n<li><p>Join all values with <code>:</code></p>\n</li>\n<li><p>Compute: <code>Base64(SHA256(joined_string))</code></p>\n</li>\n</ol>\n<p><strong>Example:</strong></p>\n<p>Given body <code>{\"amount\": 5000, \"checkout_id\": \"RZPY-A1B2\", \"currency\": \"EUR\"}</code> and timestamp <code>2026-03-07T20:00:00Z</code>:</p>\n<ul>\n<li><p>Sorted keys: <code>amount</code>, <code>checkout_id</code>, <code>currency</code>, <code>timestamp</code></p>\n</li>\n<li><p>Values: <code>5000</code>, <code>RZPY-A1B2</code>, <code>EUR</code>, <code>2026-03-07T20:00:00Z</code></p>\n</li>\n<li><p>Append: <code>SHA256(your_secret_key)</code> as hex</p>\n</li>\n<li><p>Join: <code>5000:RZPY-A1B2:EUR:2026-03-07T20:00:00Z:</code></p>\n</li>\n<li><p>Signature: <code>Base64(SHA256(joined_string))</code></p>\n</li>\n</ul>\n<p><strong>Note:</strong> The timestamp must be within ±5 minutes of server time or the request will be rejected.</p>\n<p><strong>Important:</strong> This is NOT HMAC. It is a plain SHA256 hash encoded as Base64. Webhooks use a separate HMAC-SHA256 scheme with your <code>whsec_</code> secret.</p>\n</body></html>","schema":"https://schema.getpostman.com/json/collection/v2.0.0/collection.json","toc":[{"content":"PayEra API Integration","slug":"payera-api-integration"}],"owner":"52309122","collectionId":"ec017cbc-7752-409f-8794-9c1dd1dae732","publishedId":"2sBXqGrMwN","public":true,"customColor":{"top-bar":"FFFFFF","right-sidebar":"303030","highlight":"FF6C37"},"publishDate":"2026-04-26T18:02:57.000Z"},"item":[{"name":"Payments","item":[{"name":"Create Payment","id":"16721cf3-62bd-40cf-8383-227738d62392","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"checkout_id\": \"XXXX-XXXX-XXXX-XXXX\",\n  \"amount\": 5000,\n  \"currency\": \"EUR\",\n  \"customer_email\": \"customer@example.com\",\n  \"customer_details\": {\n    \"first_name\": \"John\",\n    \"last_name\": \"Smith\",\n    \"country_of_residence\": \"GB\",\n    \"date_of_birth\": \"1990-01-15\",\n    \"phone\": \"+442002001234\"\n  },\n  \"redirect_url\": \"https://merchant.com/payment/result\",\n  \"success_url\": \"https://merchant.com/payment/success\",\n  \"cancel_url\": \"https://merchant.com/payment/cancel\",\n  \"payment_id\": \"order-1777581900\",\n  \"metadata\": {\n    \"order_id\": \"12345\",\n    \"user_id\": \"67890\"\n  }\n}","options":{"raw":{"language":"json"}}},"url":"https://api.payera.global/v1/payments","description":"<p>Creates a new payment through the provider associated with the given <code>checkout_id</code>.</p>\n<hr />\n<h2 id=\"⚠️-important-understanding-checkout_id\">⚠️ IMPORTANT: Understanding checkout_id</h2>\n<p><strong>The</strong> <strong><code>checkout_id</code></strong> <strong>determines WHICH payment method will be used.</strong></p>\n<p>You may have multiple checkout configurations in your Merchant Dashboard, each linked to a different payment provider:</p>\n<div class=\"click-to-expand-wrapper is-table-wrapper\"><table>\n<thead>\n<tr>\n<th>Checkout ID</th>\n<th>Payment Method</th>\n<th>Supported Currencies</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td><code>RZPY-XXXX-XXXX-XXXX</code></td>\n<td>Credit/Debit Card</td>\n<td>USD, EUR</td>\n</tr>\n<tr>\n<td><code>RZOB-XXXX-XXXX-XXXX</code></td>\n<td>Bank Transfer (Open Banking/FPS)</td>\n<td>EUR, GBP</td>\n</tr>\n</tbody>\n</table>\n</div><p><strong>How to find your checkout_id:</strong></p>\n<ol>\n<li><p>Log in to your PayEra Merchant Dashboard</p>\n</li>\n<li><p>Go to <strong>Checkouts</strong> in the sidebar</p>\n</li>\n<li><p>You will see all your checkout configurations listed</p>\n</li>\n<li><p>Copy the <strong>Checkout ID</strong> for the payment method you want to use</p>\n</li>\n</ol>\n<p><strong>Example:</strong></p>\n<ul>\n<li><p>Want to accept <strong>card payments</strong>? → Use your Card checkout_id</p>\n</li>\n<li><p>Want to accept <strong>bank transfers</strong>? → Use your Open Banking checkout_id</p>\n</li>\n</ul>\n<p><strong>Each checkout_id is tied to ONE payment method.</strong> If you pass a Card checkout_id, the customer pays by card. If you pass an Open Banking checkout_id, the customer pays via bank transfer.</p>\n<hr />\n<p><strong>Required Fields:</strong></p>\n<ul>\n<li><p><code>checkout_id</code> - <strong>YOUR checkout configuration ID</strong> (find it in Merchant Dashboard → Checkouts). Format: <code>PPPP-XXXX-XXXX-XXXX</code></p>\n</li>\n<li><p><code>amount</code> - Amount in smallest currency unit (cents). Example: <code>5000</code> = €50.00</p>\n</li>\n<li><p><code>currency</code> - ISO 4217 currency code. <strong>Must be supported by your checkout_id!</strong></p>\n<ul>\n<li><p>Card checkouts: <code>EUR</code>, <code>USD</code></p>\n</li>\n<li><p>Bank Transfer checkouts: <code>EUR</code>, <code>GBP</code></p>\n</li>\n</ul>\n</li>\n<li><p><code>customer_email</code> - Customer email address</p>\n</li>\n<li><p><code>redirect_url</code> - URL where customer returns after payment</p>\n</li>\n<li><p><code>payment_id</code> - Your unique reference for this payment (e.g., your order ID)</p>\n</li>\n<li><p><code>customer_details</code> - Customer information object:</p>\n<ul>\n<li><p><code>first_name</code> - Customer's first name</p>\n</li>\n<li><p><code>last_name</code> - Customer's last name</p>\n</li>\n<li><p><code>phone</code> - Phone number (E.164 format: <code>+442002001234</code>)</p>\n</li>\n<li><p><code>country_of_residence</code> - ISO 3166-1 alpha-2 country code (<code>GB</code>, <code>US</code>, <code>DE</code>)</p>\n</li>\n<li><p><code>date_of_birth</code> - Date of birth (<code>YYYY-MM-DD</code> format)</p>\n</li>\n<li><p><code>state_of_residence</code> - 2-letter US state code — <strong>required only for US customers</strong></p>\n</li>\n</ul>\n</li>\n<li><p><code>metadata</code> - Key-value data for your own tracking (returned in webhooks)</p>\n</li>\n</ul>\n<p><strong>Important Fields:</strong></p>\n<ul>\n<li><p><code>success_url</code> - Specific URL for successful payment redirect</p>\n</li>\n<li><p><code>cancel_url</code> - URL if customer cancels</p>\n</li>\n</ul>\n<hr />\n<p><strong>Response:</strong></p>\n<p>Returns a <code>payment_url</code> — redirect the customer to this URL to complete payment.</p>\n<p>The customer will see the appropriate payment form (card entry OR bank selection) based on which <code>checkout_id</code> you used.</p>\n","auth":{"type":"apikey","apikey":{"basicConfig":[{"key":"key","value":"X-API-Key"},{"key":"value","value":"pk_live_your_api_key"}]},"isInherited":true,"source":{"_postman_id":"ec017cbc-7752-409f-8794-9c1dd1dae732","id":"ec017cbc-7752-409f-8794-9c1dd1dae732","name":"PayEra API v1","type":"collection"}},"urlObject":{"path":["payments"],"host":["https://api.payera.global/v1"],"query":[],"variable":[]}},"response":[{"id":"330aae74-6022-4f8a-8a7f-3a55a6171440","name":"Success","originalRequest":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\n  \"checkout_id\": \"RZPY-A1B2-C3D4-E5F6\",\n  \"amount\": 5000,\n  \"currency\": \"EUR\",\n  \"customer_email\": \"customer@example.com\",\n  \"customer_details\": {\n    \"first_name\": \"John\",\n    \"last_name\": \"Smith\",\n    \"country_of_residence\": \"GB\",\n    \"date_of_birth\": \"1990-01-15\",\n    \"phone\": \"+442002001234\"\n  },\n  \"redirect_url\": \"https://merchant.com/payment/result\",\n  \"success_url\": \"https://merchant.com/payment/success\",\n  \"cancel_url\": \"https://merchant.com/payment/cancel\",\n  \"payment_id\": \"order-12345-67890\",\n  \"metadata\": {\n    \"order_id\": \"12345\",\n    \"user_id\": \"67890\"\n  }\n}"},"url":"https://api.payera.global/v1/payments"},"status":"Created","code":201,"_postman_previewlanguage":"json","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"success\": true,\n  \"payment_id\": \"e08794dd-aaaf-4b32-9f70-0b65f4756472\",\n  \"checkout_id\": \"RZPY-A1B2-C3D4-E5F6\",\n  \"status\": \"pending\",\n  \"payment_url\": \"https://payment-url/pay/019ca9dd-33d7-70ab-bb84-c47415b1b113\"\n}"},{"id":"e9064abb-19bf-4a25-a27d-eb2b493cd2e1","name":"Invalid Signature","originalRequest":{"method":"POST","header":[],"url":"https://api.payera.global/v1/payments"},"status":"Unauthorized","code":401,"_postman_previewlanguage":"json","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"error\": \"invalid signature\"\n}"}],"_postman_id":"16721cf3-62bd-40cf-8383-227738d62392"},{"name":"Create S2S Card Payment","id":"f6a40877-4af4-4287-a26f-32df85c3f20d","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"checkout_id\": \"XXXX-XXXX-XXXX-XXXX\",\n  \"amount\": 5000,\n  \"currency\": \"EUR\",\n  \"customer_email\": \"customer@example.com\",\n  \"customer_details\": {\n    \"first_name\": \"John\",\n    \"last_name\": \"Smith\",\n    \"country_of_residence\": \"GB\",\n    \"date_of_birth\": \"1990-01-15\",\n    \"phone\": \"+442002001234\"\n  },\n  \"card\": {\n    \"number\": \"4242424242424242\",\n    \"expiry_month\": \"12\",\n    \"expiry_year\": \"2099\",\n    \"cvv\": \"123\",\n    \"holder_name\": \"John Smith\"\n  },\n  \"browser\": {\n    \"user_agent\": \"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36\",\n    \"accept_header\": \"text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,*/*;q=0.8\",\n    \"language\": \"en-US\",\n    \"color_depth\": 24,\n    \"screen_width\": 1920,\n    \"screen_height\": 1080,\n    \"timezone\": 0,\n    \"java_enabled\": false,\n    \"javascript_enabled\": true\n  },\n  \"redirect_url\": \"https://merchant.com/payment/result\",\n  \"success_url\": \"https://merchant.com/payment/success\",\n  \"cancel_url\": \"https://merchant.com/payment/cancel\",\n  \"payment_id\": \"order-1777581900\",\n  \"metadata\": {\n    \"order_id\": \"12345\",\n    \"user_id\": \"67890\"\n  }\n}","options":{"raw":{"language":"json"}}},"url":"https://api.payera.global/v1/payments","description":"<p>Creates a card payment via the <strong>server-to-server (S2S)</strong> flow. Submit raw card data in the request and PayEra charges the card directly — no hosted checkout page involved.</p>\n<hr />\n<h2 id=\"request-body--s2s-specific-fields\">Request Body — S2S-specific fields</h2>\n<ul>\n<li><p><strong><code>card</code></strong> <em>(object, required)</em> — raw card data</p>\n<ul>\n<li><p><code>number</code> — PAN (digits only; spaces and dashes are stripped automatically)</p>\n</li>\n<li><p><code>expiry_month</code> — <code>01</code>–<code>12</code></p>\n</li>\n<li><p><code>expiry_year</code> — 4-digit (e.g. <code>2099</code>); 2-digit also accepted (<code>99</code> → <code>2099</code>)</p>\n</li>\n<li><p><code>cvv</code> — 3 or 4 digits</p>\n</li>\n<li><p><code>holder_name</code> <em>(optional)</em> — printed cardholder name</p>\n</li>\n</ul>\n</li>\n<li><p><strong><code>browser</code></strong> <em>(object, recommended)</em> — device fingerprint passed to the issuing bank's ACS when a 3DS challenge is required. Without it, low-risk 3DS frictionless flows may fall back to a full challenge or be declined.</p>\n</li>\n<li><p><strong><code>card_token</code></strong> <em>(string, reserved)</em> — placeholder for a future hosted-fields tokenization flow. Sending it today returns <code>501 Not Implemented</code>.</p>\n</li>\n</ul>\n<p>All other fields (<code>amount</code>, <code>currency</code>, <code>customer_email</code>, <code>customer_details</code>, <code>redirect_url</code>, <code>success_url</code>, <code>cancel_url</code>, <code>payment_id</code>, <code>metadata</code>) match the standard <em>Create Payment</em> request.</p>\n<h2 id=\"policy\">Policy</h2>\n<p>PayEra <strong>never persists raw cardholder data</strong>. Full PAN, CVV, and full card tokens are redacted at every persistence boundary before any data is written to disk, database, or external log sink.</p>\n<p>The <strong>only</strong> card-related data PayEra retains for reference (eg. issuer/BIN lookup, brand identification, chargeback dispute handling, customer support PAN matching) is the <strong>first six digits (BIN)</strong> and the <strong>last four digits</strong> of the PAN, with all middle digits replaced by <code>\\*</code>. Example: <code>4242424242424242</code> is stored as <code>424242******4242</code>.</p>\n<h2 id=\"testing\">Testing</h2>\n<p>For sandbox test card details (3DS challenge cards and non-3DS approve / decline edge cases), please contact PayEra support — they will share the appropriate test set for your assigned checkout(s).</p>\n<hr />\n<h2 id=\"response-shapes\">Response shapes</h2>\n<p><strong>Direct capture (no 3DS challenge):</strong></p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n  \"success\": true,\n  \"payment_id\": \"&lt;intent-uuid&gt;\",\n  \"checkout_id\": \"XXXX-XXXX-XXXX-XXXX\",\n  \"status\": \"succeeded\"\n}\n\n</code></pre>\n<p><strong>Card decline:</strong></p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n  \"success\": false,\n  \"payment_id\": \"&lt;intent-uuid&gt;\",\n  \"checkout_id\": \"XXXX-XXXX-XXXX-XXXX\",\n  \"status\": \"failed\",\n  \"error\": \"Card declined\",\n  \"error_code\": \"DECLINED\"\n}\n\n</code></pre>\n<p><strong>3DS challenge required:</strong></p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n  \"success\": true,\n  \"payment_id\": \"&lt;intent-uuid&gt;\",\n  \"checkout_id\": \"XXXX-XXXX-XXXX-XXXX\",\n  \"status\": \"requires_action\",\n  \"next_action\": {\n    \"type\": \"redirect_to_url\",\n    \"redirect_url\": \"https://api.payera.global/v1/payments/&lt;intent-uuid&gt;/3ds-challenge\",\n    \"return_url\": \"https://merchant.com/payment/result\"\n  }\n}\n\n</code></pre>\n<p>When <code>status=requires_action</code>, redirect the customer's browser to <code>next_action.redirect_url</code>. After the customer completes the challenge, they're redirected back to your <code>redirect_url</code> / <code>success_url</code> / <code>cancel_url</code>. The final status is also delivered asynchronously via the standard webhook (<code>payment.succeeded</code> / <code>payment.failed</code>).</p>\n","auth":{"type":"apikey","apikey":{"basicConfig":[{"key":"key","value":"X-API-Key"},{"key":"value","value":"pk_live_your_api_key"}]},"isInherited":true,"source":{"_postman_id":"ec017cbc-7752-409f-8794-9c1dd1dae732","id":"ec017cbc-7752-409f-8794-9c1dd1dae732","name":"PayEra API v1","type":"collection"}},"urlObject":{"path":["payments"],"host":["https://api.payera.global/v1"],"query":[],"variable":[]}},"response":[{"id":"c6dd10aa-7160-4c78-8598-e65218432762","name":"Success — Direct Capture","originalRequest":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\n  \"checkout_id\": \"XXXX-XXXX-XXXX-XXXX\",\n  \"amount\": 5000,\n  \"currency\": \"EUR\",\n  \"customer_email\": \"customer@example.com\",\n  \"card\": {\n    \"number\": \"4242424242424242\",\n    \"expiry_month\": \"12\",\n    \"expiry_year\": \"2099\",\n    \"cvv\": \"123\"\n  }\n}"},"url":"https://api.payera.global/v1/payments"},"status":"Created","code":201,"_postman_previewlanguage":"json","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"success\": true,\n  \"payment_id\": \"e08794dd-aaaf-4b32-9f70-0b65f4756472\",\n  \"checkout_id\": \"XXXX-XXXX-XXXX-XXXX\",\n  \"status\": \"succeeded\"\n}"},{"id":"4187d0bf-ce13-47b0-9ca5-814eeed3ffdf","name":"Failed — Card Decline","originalRequest":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\n  \"checkout_id\": \"XXXX-XXXX-XXXX-XXXX\",\n  \"amount\": 5000,\n  \"currency\": \"EUR\",\n  \"customer_email\": \"customer@example.com\",\n  \"card\": {\n    \"number\": \"4000000000000002\",\n    \"expiry_month\": \"12\",\n    \"expiry_year\": \"2099\",\n    \"cvv\": \"123\"\n  }\n}"},"url":"https://api.payera.global/v1/payments"},"status":"Created","code":201,"_postman_previewlanguage":"json","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"success\": false,\n  \"payment_id\": \"f19805ee-bbaf-4c33-0a81-1c76a5867583\",\n  \"checkout_id\": \"XXXX-XXXX-XXXX-XXXX\",\n  \"status\": \"failed\",\n  \"error\": \"Card declined by issuer\",\n  \"error_code\": \"DECLINED\"\n}"},{"id":"786b89e3-2bc8-4805-a985-6a9015c07104","name":"Requires Action — 3DS Challenge","originalRequest":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\n  \"checkout_id\": \"XXXX-XXXX-XXXX-XXXX\",\n  \"amount\": 5000,\n  \"currency\": \"EUR\",\n  \"customer_email\": \"customer@example.com\",\n  \"card\": {\n    \"number\": \"4242424242424242\",\n    \"expiry_month\": \"12\",\n    \"expiry_year\": \"2099\",\n    \"cvv\": \"123\"\n  },\n  \"browser\": {\n    \"user_agent\": \"Mozilla/5.0\",\n    \"accept_header\": \"text/html\",\n    \"language\": \"en-US\",\n    \"color_depth\": 24,\n    \"screen_width\": 1920,\n    \"screen_height\": 1080,\n    \"timezone\": 0,\n    \"java_enabled\": false,\n    \"javascript_enabled\": true\n  },\n  \"redirect_url\": \"https://merchant.com/payment/result\"\n}"},"url":"https://api.payera.global/v1/payments"},"status":"Created","code":201,"_postman_previewlanguage":"json","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"success\": true,\n  \"payment_id\": \"7c1f2890-3b4a-4f12-a0e1-2c4d6a8b9f01\",\n  \"checkout_id\": \"XXXX-XXXX-XXXX-XXXX\",\n  \"status\": \"requires_action\",\n  \"next_action\": {\n    \"type\": \"redirect_to_url\",\n    \"redirect_url\": \"https://api.payera.global/v1/payments/7c1f2890-3b4a-4f12-a0e1-2c4d6a8b9f01/3ds-challenge\",\n    \"return_url\": \"https://merchant.com/payment/result\"\n  }\n}"},{"id":"abd6388c-04cd-4dcb-8fce-75566ea119d8","name":"Bad Request — card_token reserved (501)","originalRequest":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\n  \"checkout_id\": \"XXXX-XXXX-XXXX-XXXX\",\n  \"amount\": 5000,\n  \"currency\": \"EUR\",\n  \"customer_email\": \"customer@example.com\",\n  \"card_token\": \"tok_abc123\"\n}"},"url":"https://api.payera.global/v1/payments"},"status":"Not Implemented","code":501,"_postman_previewlanguage":"json","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"error\": \"card_token is reserved for a future hosted-fields integration; pass 'card' for now\"\n}"}],"_postman_id":"f6a40877-4af4-4287-a26f-32df85c3f20d"}],"id":"57c723c4-9271-4f95-ac8a-ff87c0b23a07","description":"<p>Create and manage payments</p>\n","_postman_id":"57c723c4-9271-4f95-ac8a-ff87c0b23a07","auth":{"type":"apikey","apikey":{"basicConfig":[{"key":"key","value":"X-API-Key"},{"key":"value","value":"pk_live_your_api_key"}]},"isInherited":true,"source":{"_postman_id":"ec017cbc-7752-409f-8794-9c1dd1dae732","id":"ec017cbc-7752-409f-8794-9c1dd1dae732","name":"PayEra API v1","type":"collection"}}},{"name":"Webhooks","item":[{"name":"Webhook Payload Example (payment.succeeded)","id":"733a6d4b-a55c-46d1-b57e-e00b7539f0c4","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[{"key":"Content-Type","value":"application/json"},{"key":"X-PayEra-Signature","value":"example_signature_hex","description":"<p>HMAC-SHA256 signature (hex-encoded)</p>\n"},{"key":"X-PayEra-Timestamp","value":"1709312345","description":"<p>Unix timestamp (seconds)</p>\n"},{"key":"X-PayEra-Event","value":"payment.succeeded"},{"key":"User-Agent","value":"PayEra-Webhook/1.0"}],"body":{"mode":"raw","raw":"{\n  \"id\": \"evt_01234567-89ab-cdef-0123-456789abcdef\",\n  \"type\": \"payment.succeeded\",\n  \"timestamp\": \"2026-03-01T15:30:45Z\",\n  \"data\": {\n    \"payment_id\": \"e08794dd-aaaf-4b32-9f70-0b65f4756472\",\n    \"merchant_payment_id\": \"order-12345-67890\",\n    \"checkout_id\": \"ABCD-1234-EFGH-5678\",\n    \"amount\": 5000,\n    \"currency\": \"EUR\",\n    \"status\": \"succeeded\",\n    \"provider_ref\": \"019ca9dd-33d7-70ab-bb84-c47415b1b113\",\n    \"customer_email\": \"customer@example.com\",\n    \"metadata\": {\n      \"order_id\": \"12345\",\n      \"user_id\": \"67890\"\n    }\n  },\n  \"api_version\": \"v1\"\n}","options":{"raw":{"language":"json"}}},"url":"https://your-server.com/webhooks/payera","description":"<p>Example of a <code>payment.succeeded</code> webhook payload sent by PayEra.</p>\n<p><strong>Webhook Headers:</strong></p>\n<ul>\n<li><code>X-PayEra-Signature</code> — HMAC-SHA256 signature (hex-encoded)</li>\n<li><code>X-PayEra-Timestamp</code> — Unix timestamp (seconds, e.g. <code>1709312345</code>)</li>\n<li><code>X-PayEra-Event</code> — Event type (e.g. <code>payment.succeeded</code>)</li>\n</ul>\n<p><strong>Payload Fields:</strong></p>\n<ul>\n<li><code>id</code> — Unique event ID (use for idempotency / deduplication)</li>\n<li><code>type</code> — Event type (<code>payment.succeeded</code>, <code>payment.failed</code>, etc.)</li>\n<li><code>timestamp</code> — ISO 8601 timestamp</li>\n<li><code>api_version</code> — API version (<code>v1</code>)</li>\n<li><code>data.payment_id</code> — PayEra's internal payment UUID</li>\n<li><code>data.merchant_payment_id</code> — Your custom <code>payment_id</code> from the original request</li>\n<li><code>data.checkout_id</code> — Checkout configuration ID</li>\n<li><code>data.provider_ref</code> — Provider's reference ID for this payment</li>\n<li><code>data.customer_email</code> — Customer email (see note below)</li>\n<li><code>data.metadata</code> — Your metadata object echoed back from the original request</li>\n<li><code>data.amount</code> — Amount in smallest currency unit (cents)</li>\n<li><code>data.currency</code> — ISO currency code</li>\n<li><code>data.status</code> — Payment status</li>\n<li><code>data.test</code> — <code>true</code> for test callbacks only (not present in production)</li>\n</ul>\n<p><strong>Signature Verification:</strong></p>\n<ol>\n<li>Concatenate: <code>{X-PayEra-Timestamp}.{raw_json_body}</code></li>\n<li>Decode secret: Remove <code>whsec_</code> prefix, hex-decode to bytes</li>\n<li>Compute: HMAC-SHA256 with decoded secret</li>\n<li>Compare: hex-encode result and compare with <code>X-PayEra-Signature</code></li>\n</ol>\n<p><strong>Important:</strong></p>\n<ul>\n<li>Validate timestamp (reject if &gt; 5 minutes old)</li>\n<li>Handle idempotency (dedupe by <code>id</code> field)</li>\n<li>Respond with 200 OK within 30 seconds</li>\n<li>Both test callbacks and production webhooks use this exact same format</li>\n</ul>\n<p><strong>Customer Email Behavior:</strong>\nThe <code>customer_email</code> field returns the email the customer entered on the PayEra checkout form, which may differ from the <code>customer_email</code> sent in your original payment request (due to KYC/compliance requirements). For reliable user identification, use the <code>metadata</code> object to pass your internal user identifiers (e.g., <code>user_id</code>, <code>user_uuid</code>) which will be returned unchanged.</p>\n","auth":{"type":"apikey","apikey":{"basicConfig":[{"key":"key","value":"X-API-Key"},{"key":"value","value":"pk_live_your_api_key"}]},"isInherited":true,"source":{"_postman_id":"ec017cbc-7752-409f-8794-9c1dd1dae732","id":"ec017cbc-7752-409f-8794-9c1dd1dae732","name":"PayEra API v1","type":"collection"}},"urlObject":{"protocol":"https","path":["webhooks","payera"],"host":["your-server","com"],"query":[],"variable":[]}},"response":[],"_postman_id":"733a6d4b-a55c-46d1-b57e-e00b7539f0c4"},{"name":"Webhook Payload Example (payment.failed)","id":"e8af9c58-1325-4792-9918-d5e512e9777c","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[{"key":"Content-Type","value":"application/json"},{"key":"X-PayEra-Signature","value":"example_signature_hex"},{"key":"X-PayEra-Timestamp","value":"1709312345"},{"key":"X-PayEra-Event","value":"payment.failed"},{"key":"User-Agent","value":"PayEra-Webhook/1.0"}],"body":{"mode":"raw","raw":"{\n  \"id\": \"evt_98765432-10fe-dcba-9876-543210fedcba\",\n  \"type\": \"payment.failed\",\n  \"timestamp\": \"2026-03-01T15:35:00Z\",\n  \"data\": {\n    \"payment_id\": \"f19805ee-bbaf-4c33-0g81-1c76g5867583\",\n    \"merchant_payment_id\": \"order-12345-67890\",\n    \"checkout_id\": \"ABCD-1234-EFGH-5678\",\n    \"amount\": 2500,\n    \"currency\": \"EUR\",\n    \"status\": \"failed\",\n    \"provider_ref\": \"019ca9dd-44e8-71bc-aa95-d58526c2c224\",\n    \"customer_email\": \"customer@example.com\",\n    \"metadata\": {\n      \"order_id\": \"12345\",\n      \"user_id\": \"67890\"\n    },\n    \"error_code\": \"insufficient_funds\",\n    \"error_message\": \"The card has insufficient funds\"\n  },\n  \"api_version\": \"v1\"\n}","options":{"raw":{"language":"json"}}},"url":"https://your-server.com/webhooks/payera","description":"<p>Example of a <code>payment.failed</code> webhook payload sent by PayEra.</p>\n<p><strong>Payload Fields (same as payment.succeeded):</strong></p>\n<ul>\n<li><code>data.error_code</code> — Machine-readable error code</li>\n<li><code>data.error_message</code> — Human-readable error description</li>\n<li>All other fields identical to <code>payment.succeeded</code> webhook</li>\n</ul>\n<p>Both test callbacks and production webhooks use this exact same format.</p>\n","auth":{"type":"apikey","apikey":{"basicConfig":[{"key":"key","value":"X-API-Key"},{"key":"value","value":"pk_live_your_api_key"}]},"isInherited":true,"source":{"_postman_id":"ec017cbc-7752-409f-8794-9c1dd1dae732","id":"ec017cbc-7752-409f-8794-9c1dd1dae732","name":"PayEra API v1","type":"collection"}},"urlObject":{"protocol":"https","path":["webhooks","payera"],"host":["your-server","com"],"query":[],"variable":[]}},"response":[],"_postman_id":"e8af9c58-1325-4792-9918-d5e512e9777c"}],"id":"ebc5f2b3-8dca-48e2-9d14-a0ceb632dfd8","description":"<p>Examples of webhook payloads sent by PayEra to your server. Use these examples to test your webhook handler implementation and signature verification.</p>\n","_postman_id":"ebc5f2b3-8dca-48e2-9d14-a0ceb632dfd8","auth":{"type":"apikey","apikey":{"basicConfig":[{"key":"key","value":"X-API-Key"},{"key":"value","value":"pk_live_your_api_key"}]},"isInherited":true,"source":{"_postman_id":"ec017cbc-7752-409f-8794-9c1dd1dae732","id":"ec017cbc-7752-409f-8794-9c1dd1dae732","name":"PayEra API v1","type":"collection"}}}],"auth":{"type":"apikey","apikey":{"basicConfig":[{"key":"key","value":"X-API-Key"},{"key":"value","value":"pk_live_your_api_key"}]}},"event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["// PayEra Signature Generation Pre-request Script","// Algorithm: Base64(SHA256(sorted_values : SHA256(secret_key)))","","const secretKey = pm.environment.get('secretKey') || pm.collectionVariables.get('secretKey');","","if (!secretKey) {","    console.warn('No secretKey found in environment or collection variables');","    return;","}","","// Step 1: Generate timestamp without milliseconds","const timestamp = new Date().toISOString().replace(/\\.\\d{3}Z$/, 'Z');","pm.request.headers.upsert({ key: 'X-Timestamp', value: timestamp });","","// Step 2: Parse request body","let bodyParams = {};","try {","    if (pm.request.body && pm.request.body.raw) {","        bodyParams = JSON.parse(pm.request.body.raw);","    }","} catch (e) {","    console.error('Failed to parse request body:', e);","    return;","}","","// Step 3: Hash secret key (lowercase hex)","const secretKeyHash = CryptoJS.SHA256(secretKey).toString(CryptoJS.enc.Hex);","","// Step 4: Add timestamp to params","const paramsWithTimestamp = { ...bodyParams, timestamp };","","// Step 5: Sort keys alphabetically","const sortedKeys = Object.keys(paramsWithTimestamp).sort();","","// Step 6: Flatten values (handle nested objects with sorted keys)","function flattenValue(value) {","    if (typeof value === 'string') return value;","    if (typeof value === 'number') return value.toString();","    if (typeof value === 'boolean') return value ? 'true' : 'false';","    if (value === null || value === undefined) return '';","    // Sort nested object keys before stringifying","    const sortedObj = {};","    Object.keys(value).sort().forEach(k => { sortedObj[k] = value[k]; });","    return JSON.stringify(sortedObj);","}","","const values = sortedKeys.map(key => flattenValue(paramsWithTimestamp[key]));","","// Step 7: Append hashed secret key","values.push(secretKeyHash);","const signatureString = values.join(':');","","// Step 8: SHA256 + Base64","const signature = CryptoJS.SHA256(signatureString).toString(CryptoJS.enc.Base64);","","pm.request.headers.upsert({ key: 'X-Signature', value: signature });","","console.log('Generated signature for request');","console.log('Timestamp:', timestamp);","console.log('Sorted keys:', sortedKeys.join(', '));"],"id":"ea91992e-0aab-4ee6-9bc0-7e3d576dabf6"}}],"variable":[{"key":"baseUrl","value":"https://api.payera.global/v1"},{"key":"apiKey","value":"pk_live_your_api_key"},{"key":"secretKey","value":"sk_live_your_secret_key"},{"key":"checkoutId","value":"XXXX-XXXX-XXXX-XXXX"}]}