Payeny Payment Orchestration Platform
The single, unified payments engine powering EntryHub, JumpHQ, EquipLink, Audovo, and Elept.
Multi-Tenant Profiles
Dynamic provider credential resolution. Strict 5-tier routing hierarchy: Transaction override > Merchant profile > Product profile > Org profile > Default platform.
Immutable Double-Entry
Every cent captured, fee withheld, refund issued, and payout disbursed is permanently tracked across formal Assets, Liabilities, Equity, Revenue, and Expense ledger accounts.
Turnkey Stripe Connect
Automated Express and Custom connected-account onboarding, balance synchronization, destination charges, application fees, and login links.
Hosted & Embed Checkout
Branded hosted checkout sessions at payeny.com/checkout/{token} and drop-in modal overlay SDK via payeny.js.
Quickstart in 3 Steps
Integrate Payeny into your SaaS in less than 5 minutes.
1. Install the SDK
npm install payeny
composer require nexovex/payeny-php
2. Create a Customer and Charge
const Payeny = require('payeny');
const payeny = new Payeny(process.env.PAYENY_API_KEY);
// 1. Create customer
const customer = await payeny.customers.create({
email: 'client@example.com',
name: 'Acme Corp'
});
// 2. Create payment intent
const payment = await payeny.payments.create({
amount: 4900, // $49.00 USD in cents
currency: 'usd',
customer_id: customer.data.id,
description: 'Monthly SaaS License'
}, {
idempotencyKey: 'idemp_unique_order_88'
});
console.log('Client Secret:', payment.data.client_secret);
<?php
use Payeny\PayenyClient;
$payeny = new PayenyClient($_ENV['PAYENY_API_KEY']);
$customer = $payeny->customers->create([
'email' => 'client@example.com',
'name' => 'Acme Corp'
]);
$payment = $payeny->payments->create([
'amount' => 4900,
'currency' => 'usd',
'customer_id' => $customer['data']['id'],
'description' => 'Monthly SaaS License'
], [
'idempotency_key' => 'idemp_unique_order_88'
]);
echo "Client Secret: " . $payment['data']['client_secret'];
curl -X POST https://payeny.com/api/v1/payments \
-H "Authorization: Bearer payeny_test_..." \
-H "Content-Type: application/json" \
-H "Idempotency-Key: idemp_unique_order_88" \
-d '{
"amount": 4900,
"currency": "usd",
"customer_id": "cus_b902af4fdaa5867265eb",
"description": "Monthly SaaS License"
}'
3. Listen to Verified Webhooks
Payeny signs all webhook deliveries with HMAC-SHA256 in the X-Payeny-Signature header.
Authentication & Security
Authenticate requests by passing your API key as a Bearer token in the Authorization header.
payeny_test_<32_hex_chars>
payeny_live_<32_hex_chars>
| Header | Type | Description |
|---|---|---|
Authorization |
String (Required) | Bearer payeny_live_... |
Idempotency-Key |
String (Recommended) | Unique key to prevent double charges on network retries. Cached for 24h. |
Payeny-Platform-Profile |
String (Optional) | Explicit platform profile override (e.g. plt_default). |
Normalized Domain Identifiers
Payeny never exposes raw third-party IDs as primary resource identifiers. All domain objects use deterministic prefixes.
| Prefix | Resource | Sample Identifier |
|---|---|---|
| pay_ | Payment / Charge Intent | pay_9f4bc1e289 |
| mer_ | Connected Merchant / Business | mer_3625e5181f713fac |
| cus_ | Platform Customer | cus_b902af4fdaa5867265eb |
| cs_ | Hosted Checkout Session | cs_6f3d2267849c131765587b3e |
| plt_ | Payment Platform Profile | plt_default |
| sub_ | Recurring Subscription | sub_55e28a9b1c |
| ref_ | Refund Transaction | ref_42b10091aa |
| fee_ | Monetization Fee Rule | fee_3000bba812 |
| led_ | Double-Entry Ledger Entry | led_09c314de88 |
| wh_ | Registered Webhook Endpoint | wh_11a84f3e79 |
| del_ | Webhook Dispatch Delivery | del_77b3109a25 |
Official Client SDKs
Official libraries with built-in TypeScript typings, automatic retry handling, and signature verification.
Node.js & TypeScript
Zero-dependency package with native Promise support and complete TypeScript definitions.
npm install payeny
PHP SDK
PSR-4 compliant library with typed resource collections and webhook helpers.
composer require nexovex/payeny-php
Platform Profiles & Routing
Payeny routes transactions dynamically through a strict 5-tier routing hierarchy.
5-Tier Resolution Hierarchy
- Tier 1: Transaction Header Override —
Payeny-Platform-Profile: plt_custom_1passed in the HTTP request. - Tier 2: Merchant Platform Profile — Bound at merchant onboarding (
merchants.platform_profile_id). - Tier 3: SaaS Product Profile — Configured default profile for the calling application (e.g.
prd_jumphq). - Tier 4: Organization Profile — Inherited from the parent organization.
- Tier 5: Payeny Default Profile (
plt_default) — System root Stripe Connect platform.
Stripe Connect & Connected Merchants
Onboard marketplace partners, service providers, and vendors with automated Express onboarding.
Onboarding Flow
Generate a hosted Stripe Connect onboarding session link for your merchant:
const link = await payeny.merchants.createOnboardingLink('mer_3625e5181f713fac', {
return_url: 'https://mysaas.com/connect/return',
refresh_url: 'https://mysaas.com/connect/refresh'
});
// Redirect merchant to link.data.url
console.log('Onboard URL:', link.data.url);
Application Fee Engine & Monetization
Monetize every transaction with automatic platform take rates, fixed fees, and minimum/maximum caps.
| Rule Parameter | Type | Behavior |
|---|---|---|
percentage |
Decimal | Calculated fee percentage (e.g. 1.00%, 2.50%). |
fixed_cents |
Integer | Flat fee per transaction (e.g. 30 cents). |
min_fee_cents |
Integer | Floor clamp: application fee will not drop below this amount. |
max_fee_cents |
Integer | Ceiling clamp: application fee will not exceed this amount. |
Immutable Double-Entry Ledger
Complete GAAP-compliant accounting audit trail ensuring debits and credits always balance.
Debit Normal Accounts
Assets & Expenses: Debits increase balance, credits decrease balance.
Credit Normal Accounts
Liabilities, Equity & Revenue: Credits increase balance, debits decrease balance.
Hosted Checkout & Embed Modal
Collect payments effortlessly through Payeny's warm ledger hosted checkout page or embed directly in your SaaS.
Embed via payeny.js Modal
Include our lightweight client script on your SaaS page:
<script src="https://payeny.com/assets/js/payeny.js"></script>
<script>
const payeny = new Payeny();
// Open modal for a session generated by your backend
payeny.openModal('cs_6f3d2267849c131765587b3e', {
onSuccess: function(data) {
console.log('Payment successful!', data);
window.location.href = '/billing/success';
},
onCancel: function() {
console.log('Checkout closed by user');
}
});
</script>
Dual Webhooks Architecture
Payeny ingests Stripe events from multiple platforms, updates balances, and dispatches signed events to your SaaS subscribers.
Subscribed Event Types
Webhook Signature Verification
Validate incoming webhooks using HMAC-SHA256 with replay prevention tolerance.
const Payeny = require('payeny');
app.post('/webhooks/payeny', express.raw({ type: 'application/json' }), (req, res) => {
const sig = req.headers['x-payeny-signature'];
try {
const event = Payeny.webhooks.constructEvent(req.body, sig, process.env.PAYENY_WEBHOOK_SECRET);
console.log('Verified event:', event.type, event.data.object.id);
res.json({ received: true });
} catch (err) {
res.status(400).send(`Webhook Error: ${err.message}`);
}
});
<?php
use Payeny\Webhook;
$payload = file_get_contents('php://input');
$signatureHeader = $_SERVER['HTTP_X_PAYENY_SIGNATURE'] ?? '';
try {
$event = Webhook::constructEvent($payload, $signatureHeader, $_ENV['PAYENY_WEBHOOK_SECRET']);
// Process verified event
http_response_code(200);
echo json_encode(['received' => true]);
} catch (\Exception $e) {
http_response_code(400);
echo "Webhook error: " . $e->getMessage();
}
Checks database latency, operational status, default platform profile health, and system capabilities.
{
"data": {
"status": "operational",
"version": "2.0.0",
"api_version": "2026-09-01",
"system": {
"database": { "status": "healthy", "latency_ms": 0 },
"default_profile": {
"id": "plt_default",
"name": "Payeny Default",
"provider": "stripe",
"status": "active"
}
}
},
"request_id": "req_6d380f214e60142c",
"livemode": false
}
Creates a new customer in Payeny and provisions the corresponding customer record in the active Stripe profile.
| Field | Type | Requirement | Description |
|---|---|---|---|
email |
String | Required | Customer email address. |
name |
String | Required | Customer full name or business entity name. |
phone |
String | Optional | Phone number in E.164 format. |
metadata |
Object | Optional | Key-value metadata dictionary. |
Create a direct or destination charge payment intent. Supports automatic capture or manual authorization holds.
| Field | Type | Requirement | Description |
|---|---|---|---|
amount |
Integer | Required | Total payment amount in cents (e.g. 4900 for $49.00 USD). |
currency |
String | Required | Three-letter ISO currency code (e.g. usd). |
customer_id |
String | Optional | Payeny customer identifier (cus_...). |
merchant_id |
String | Optional | Connected merchant ID to route destination charge and deduct platform fees. |
application_fee_amount |
Integer | Optional | Override platform fee in cents. If omitted, calculated by Fee Engine. |
Generate a hosted checkout session URL or an embed token for drop-in modal checkout on your SaaS.
| Field | Type | Description |
|---|---|---|
amount |
Integer | Amount in cents or dollars. |
title |
String | Display title shown on the hosted checkout page. |
success_url |
String | Redirect URL upon successful card payment. |
cancel_url |
String | Redirect URL if the buyer cancels. |
Register connected merchants and manage their Stripe Connect lifecycle.
Use the onboarding link endpoint to redirect users to Stripe Express onboarding, and login-link to send them to their Stripe Express dashboard.
Disburse platform balances or marketplace partner funds to connected accounts.
| Endpoint | Description |
|---|---|
POST /api/v1/transfers |
Disburse available platform funds to a destination merchant. |
POST /api/v1/payouts |
Trigger an external bank payout for a connected merchant. |
Issue full or partial refunds for settled payments. Automatically adjusts double-entry ledger entries.
| Field | Type | Description |
|---|---|---|
payment_id |
String (Required) | Payeny payment intent identifier (pay_...). |
amount |
Integer (Optional) | Amount in cents to refund. If omitted, refunds the full amount. |
reason |
String (Optional) | duplicate, fraudulent, or requested_by_customer. |
Query monetization fee rules or preview application fee deductions before initiating a charge.
curl -X POST https://payeny.com/api/v1/fee-rules/preview \
-H "Authorization: Bearer payeny_test_..." \
-H "Content-Type: application/json" \
-d '{"amount": 10000, "currency": "usd"}'
Retrieve verified double-entry balances across all 5 standard ledger account classes.
{
"data": {
"assets": { "currency": "USD", "balance_cents": 490000 },
"liabilities": { "currency": "USD", "balance_cents": 441000 },
"revenue": { "currency": "USD", "balance_cents": 49000 },
"balanced": true
},
"request_id": "req_8819bc42a0"
}
Interactive API Sandbox
Execute a real HTTP request against the live Payeny cluster right now.
{
"click_execute_above": true
}