Create basic escrow transactions with Bitcoin
Simple redirect-based integration for SaaS applications
Redirect User
Redirect user to SplitSafe payment gateway with URL parametersUser Authentication
User logs in with ICP Internet Identity on SplitSafePayment Processing
User completes Bitcoin payment and escrow is createdReturn to App
User returns to your app via return_url or cancel_urlComplete reference for SplitSafe API endpoints
/auth/session
Get a session token using your API key for authenticated requests
Authorization
(string)Bearer token with your API key (e.g., "Bearer sk_live_pal_abc123...")
{ "success": true, "data": { "sessionToken": "session_token_pal_abc_1703123456", "expiresAt": "2024-12-16T10:00:00Z", "clientId": "client_pal_abc" } }
/transactions/{transactionId}
Get transaction details by ID using session authentication
transactionId
(string)The unique identifier of the transaction
Authorization
(string)Bearer token with your session token (e.g., "Bearer session_token_pal_abc_1703123456")
{ "success": true, "data": { "id": "txn_pal_abc_1703123456", "amount": 2500, "currency": "PHP", "status": "completed", "description": "Flight booking - Manila to Cebu", "createdAt": "2024-12-16T08:00:00Z", "completedAt": "2024-12-16T08:15:00Z", "escrow": { "id": "escrow_pal_abc_1703123456", "status": "active", "bitcoinAddress": "bc1qxy2kgdygjrsqtzq2n0yrf2493p83kkfjhx0wlh", "bitcoinAmount": 0.00012345 }, "merchant": { "id": "client_pal_abc", "name": "Philippine Airlines" } } }
Examples in different programming languages
// Simple redirect-based integration
function redirectToSplitSafe(paymentData) {
const splitsafeUrl = 'https://sandbox.thesplitsafe.com/payment-gateway';
const params = new URLSearchParams({
merchant: 'philippine_airlines',
amount: paymentData.amount.toString(),
currency: paymentData.currency,
description: paymentData.description,
return_url: 'https://your-app.com/payment/success',
cancel_url: 'https://your-app.com/payment/cancel',
api_key: process.env.NEXT_PUBLIC_SPLITSAFE_KEY // Your API key
});
// Redirect user to SplitSafe payment gateway
window.location.href = `${splitsafeUrl}?${params.toString()}`;
}
// Usage example
const paymentData = {
amount: 2500.00,
currency: 'PHP',
description: 'Flight booking - Manila to Cebu'
};
redirectToSplitSafe(paymentData);
See SplitSafe in action with Philippines Airlines
⚠️ This is a simulation demo only - no actual login or transfers occur