Developer Hub
Integration guides, API references, and code examples to get your payment flows live, from hosted cashier to full server-to-server control.
Get from zero to first transaction in four steps.
API keys, environments, and request signing.
Hosted cashier and embedded SDK guides.
Server-to-server endpoints for sessions, transactions, and payouts.
Real-time notifications for transaction state changes.
Test credentials, simulated flows, and debugging tools.
Quickstart
Four steps to get your integration running in the sandbox environment.
Register as a merchant and receive your sandbox API credentials from the TX Fabric dashboard.
Select from hosted cashier, embedded SDK, or server-to-server API based on your requirements.
Integrate in your sandbox environment, test payment flows, and validate webhook handling.
Complete onboarding verification, switch to production credentials, and start processing.
Authentication
All API requests are authenticated with Bearer tokens. TX Fabric provides separate keys for sandbox and production environments.
// Authentication - all requests require a Bearer token
const headers = {
"Authorization": "Bearer YOUR_API_KEY",
"Content-Type": "application/json",
"X-Idempotency-Key": "unique-request-id", // recommended
};
// API keys are environment-specific:
// Sandbox: sk_test_...
// Production: sk_live_...
// Rate limits: 100 req/s per merchant (sandbox)
// 500 req/s per merchant (production)Frontend Integration
Use the hosted redirect for the fastest setup, or embed the SDK directly in your application for a seamless branded experience.
The quickest integration path. Create a session on your server, then redirect or open the TX Fabric hosted cashier. No frontend build required.
<!-- TX Fabric Cashier - Hosted Redirect -->
<script src="https://cdn.tx-fabric.com/cashier/v1/loader.js"></script>
<script>
TXFabric.Cashier.open({
merchantId: "your-merchant-id",
sessionToken: sessionToken, // from server-side session creation
amount: 5000, // in minor units (e.g. cents)
currency: "EUR",
locale: "en",
onComplete: (result) => {
console.log("Payment result:", result.status);
},
onError: (error) => {
console.error("Cashier error:", error.message);
}
});
</script>API Reference
RESTful endpoints for session management, transaction processing, payouts, and merchant operations.
Creates a new payment session. Returns a session token for frontend initialisation and a redirect URL for hosted cashier flows.
// Server-side - Create a payment session
const response = await fetch("https://api.tx-fabric.com/v1/sessions", {
method: "POST",
headers: {
"Authorization": "Bearer YOUR_API_KEY",
"Content-Type": "application/json",
},
body: JSON.stringify({
merchant_id: "your-merchant-id",
amount: 5000,
currency: "EUR",
type: "deposit",
customer: {
email: "customer@example.com",
reference: "cust_12345",
},
callback_url: "https://yoursite.com/api/webhooks/txfabric",
redirect_url: "https://yoursite.com/payment/complete",
}),
});
const session = await response.json();
// session.token -> pass to frontend
// session.redirect_url -> redirect for hosted cashierWebhooks & Events
TX Fabric sends webhook events for all transaction state changes. Verify signatures, process events, and keep your system in sync.
transaction.completedPayment successfully processedtransaction.failedPayment attempt failedtransaction.pendingAwaiting confirmationtransaction.refundedRefund processedwithdrawal.approvedPayout approved and initiatedwithdrawal.completedPayout deliveredsession.expiredPayment session timed out// Express.js webhook handler
app.post("/api/webhooks/txfabric", (req, res) => {
const signature = req.headers["x-txfabric-signature"];
// Verify webhook signature
if (!verifySignature(req.body, signature, WEBHOOK_SECRET)) {
return res.status(401).send("Invalid signature");
}
const event = req.body;
switch (event.type) {
case "transaction.completed":
// Credit user account
creditAccount(event.data.customer_ref, event.data.amount);
break;
case "transaction.failed":
// Notify user of failure
notifyFailure(event.data.customer_ref, event.data.reason);
break;
case "withdrawal.approved":
// Process payout
processPayout(event.data);
break;
default:
console.log("Unhandled event:", event.type);
}
res.status(200).json({ received: true });
});Sandbox & Testing
Full sandbox environment with test credentials, simulated payment flows, and debugging tools.
Dedicated sandbox API keys with no real money movement.
Test cards and bank accounts that simulate success, failure, and pending states.
Replay and inspect webhook deliveries in the sandbox dashboard.
Test 3D Secure challenge and frictionless flows with test cards.
Full request/response logging for every API call in sandbox.
Trigger specific outcomes (timeout, decline, partial) with test parameters.
Register as a merchant to get your sandbox credentials, or talk to our team about your integration requirements.