Documentation

Integrate Vura

Accept Pi payments in your app or website in minutes. Choose your integration type below.

No Code

Create a payment link from the Vura dashboard and share it anywhere — no coding required. Anyone with Pi can pay it in two taps.

Payment links can be set to one-time or reusable, and can have an expiry time. Manage and track them from the Business dashboard.

Website Integration

Embed the Vura SDK in any webpage with a single script tag. Works inside Pi Browser — users pay Pi directly from your page.

html · complete example
<!-- Step 1: Load the Vura SDK --> <script src="https://vura.pages.dev/sdk/vura.min.js"></script> <!-- Step 2: Add a payment button --> <button onclick="pay()">Pay with Pi</button> <script> // Required for registered Pi apps (Pi Developer Portal) Pi.init({ version: '2.0', sandbox: false }); // Initialize Vura with your merchant credentials Vura.init({ merchantId: 'YOUR_MERCHANT_ID', env: 'production', // use 'testnet' while testing }); async function pay() { await Vura.pay({ amount: 10, memo: 'Order #1042', onSuccess(piPaymentId, txid) { console.log('Payment confirmed on the Pi blockchain:', txid); }, onError(err) { console.error('Payment failed:', err.message); }, onCancel() { console.log('User cancelled'); }, }); } </script>
Pi Browser only. The Vura SDK calls window.Pi which is only available inside Pi Browser. Add an if (typeof Pi === 'undefined') guard to show a "Open in Pi Browser" message to desktop visitors.

Custom Integration

Call the Vura REST API directly from your server. Full control over the payment lifecycle — useful for custom approval logic, webhooks, or non-standard environments.

javascript · raw API approach
// 1. Create a payment link (server-side) const res = await fetch('https://vura-api.john-wayne-ryan25.workers.dev/v1/links/create', { method: 'POST', headers: { 'Content-Type': 'application/json', 'X-Merchant-Key': 'YOUR_API_KEY', }, body: JSON.stringify({ amount: 10, memo: 'Order #1042' }), }); const { url } = await res.json(); // share this URL // 2. In the client — Pi SDK fires these callbacks Pi.createPayment({ amount: 10, memo: 'Order #1042', metadata: {}, }, { async onReadyForServerApproval(piPaymentId) { // Your server approves the payment await fetch('/v1/payments/create', { method: 'POST', body: JSON.stringify({ merchantId: 'YOUR_MERCHANT_ID', piPaymentId }), }); }, async onReadyForServerCompletion(piPaymentId, txid) { // Your server records the txid and triggers payout await fetch('/v1/payments/confirm', { method: 'POST', body: JSON.stringify({ piPaymentId, txid }), }); }, onCancel(piPaymentId) { /* handle cancel */ }, onError(error) { /* handle error */ }, });

Webhook verification

Vura signs every payment.confirmed webhook with HMAC-SHA256. Verify the X-Vura-Signature header against your webhook secret from Vura Settings.

Mobile App (Pi Browser)

Building a Pi app that runs inside Pi Browser? window.Pi is already injected by Pi Browser — no Pi SDK script tag needed. Use the Vura SDK the same way as the Website integration.

Pi Browser injects window.Pi automatically for registered Pi apps. Your app must be listed in the Pi Developer Portal for payments to work in production.
html · Pi Browser app
<!-- Pi SDK is injected by Pi Browser — no script tag needed --> <!-- Load the Vura SDK --> <script src="https://vura.pages.dev/sdk/vura.min.js"></script> <script> async function init() { // Required for registered Pi apps await Pi.init({ version: '2.0', sandbox: false }); // Then init Vura Vura.init({ merchantId: 'YOUR_MERCHANT_ID', env: 'production', }); } async function pay() { await Vura.pay({ amount: 10, memo: 'Order #1042', onSuccess(piPaymentId, txid) { /* handle success */ }, onError(err) { /* handle error */ }, onCancel() { /* handle cancel */ }, }); } init(); </script>