PayQube

SDKs & plugins

Ready-made code so you can go live in an afternoon. Every package talks to the same REST API with your keys from Dashboard → API keys.

Node.js SDK

const PayQube = require('./payqube-node');
const pq = new PayQube({ keyId: process.env.PQ_KEY_ID, secret: process.env.PQ_SECRET, baseUrl: 'https://your-payqube-domain' });

const payment = await pq.payments.create({
  amount: 499, order_id: 'ORD-1042', description: 'Order #1042',
  customer: { name: 'Asha Verma', email: 'asha@example.com', phone: '9876543210' },
  return_url: 'https://yourstore.in/thanks',
});
res.redirect(payment.payment_url);          // send the customer to checkout

// webhook route — use the RAW body
app.post('/payqube/webhook', express.raw({ type: 'application/json' }), (req, res) => {
  if (!PayQube.verifyWebhook(req.body.toString(), req.get('X-PayQube-Signature'), process.env.PQ_WEBHOOK_SECRET)) return res.sendStatus(401);
  const event = JSON.parse(req.body); // event.event = payment.success | payment.failed | refund.processed
  res.sendStatus(200);
});

PHP SDK

require 'PayQube.php';
$pq = new PayQube(getenv('PQ_KEY_ID'), getenv('PQ_SECRET'), 'https://your-payqube-domain');
$p  = $pq->createPayment([
  'amount' => 499, 'order_id' => 'ORD-1042', 'return_url' => 'https://yourstore.in/thanks',
  'customer' => ['name' => 'Asha Verma', 'email' => 'asha@example.com', 'phone' => '9876543210'],
]);
header('Location: ' . $p['payment_url']);

// webhook.php
$raw = file_get_contents('php://input');
if (!PayQube::verifyWebhook($raw, $_SERVER['HTTP_X_PAYQUBE_SIGNATURE'] ?? '', getenv('PQ_WEBHOOK_SECRET'))) { http_response_code(401); exit; }

WooCommerce

  1. Download payqube-woocommerce.zip → WordPress → Plugins → Add New → Upload Plugin → Activate.
  2. WooCommerce → Settings → Payments → PayQube → paste your PayQube URL, Key ID and Key secret.
  3. In Dashboard → Webhooks set the URL to https://YOUR-STORE/?wc-api=payqube_webhook and copy the signing secret into the plugin.
  4. Place a test order in Test mode, then switch to Live mode after KYC approval.

The plugin never trusts the browser redirect: it fetches the payment from the API and checks the amount before marking an order paid. Refunds work from the WooCommerce order screen.

Shopify

Honest status: Shopify only lists third-party card/UPI checkouts that are built on its Payments Apps API, which needs approval as a Shopify Payments Partner (company review, PCI evidence, a sandbox review). Until that approval, use the setup below — it works on every Shopify plan today.

Today: manual payment method + PayQube link

  1. Shopify admin → Settings → Payments → Manual payment methods → Create custom payment method. Name it “UPI / Cards / Net banking (PayQube)”.
  2. Additional details: “You will receive a secure PayQube payment link on WhatsApp/email right after placing the order.”
  3. Create a Shopify Flow or a small webhook app on orders/create that calls POST /api/v1/payments with order_id = shopify order name and sends the returned payment_url to the customer (the Node SDK does this in ~20 lines).
  4. On our payment.success webhook, call Shopify Admin API POST /orders/{id}/transactions.json (kind: capture) to mark the order paid.

Later: native Shopify payments app

  1. Apply to the Shopify Payments Partner programme with the operating company's details.
  2. After approval, build the payments extension (offsite payment session → redirect to PayQube checkout → resolve/reject session from our webhook). Our API already exposes everything it needs.
  3. Pass Shopify's review in their sandbox, then publish to merchants.

Payouts API Sandbox

Send money from your settled balance to a saved beneficiary. In this build transfers are simulated (queued → processing → processed with a test UTR, ~20 s). Amounts ending in .13 simulate a bank rejection. Live payouts switch on when the gateway's payouts product is approved.

GET  /api/v1/balance                → { available, settled, paid_out }
GET  /api/v1/beneficiaries          → { data: [{ id, name, ifsc, vpa, account_last4 }] }
POST /api/v1/payouts                { beneficiary_id, amount, method: "IMPS"|"NEFT"|"UPI", narration }
GET  /api/v1/payouts/:id            → { id, status, utr, failure_reason, sandbox: true }

Webhook retries

If your endpoint does not answer 2xx within 8 seconds we retry after 1 min, 5 min, 30 min, 2 h and 12 h (6 attempts in total). Each attempt carries X-PayQube-Attempt. Make your handler idempotent on data.id. You can resend any delivery from Dashboard → Webhooks.