Reference
Zero-dependency clients for Node.js, Python and PHP.
SDKs
Drop-in, zero-dependency clients. Download from the links below and replace YOUR_PAYLINKY_DOMAIN with https://paylinky.vercel.app (or pass baseUrl).
| Language | Download | Requires |
|---|---|---|
| Node.js | `paylinky.js` | Node 18+ |
| Python | `paylinky.py` | requests |
| PHP | `Paylinky.php` | PHP 7.4+, ext-curl |
javascript
1const { Paylinky, PaylinkyError } = require("./paylinky.js");2const plk = new Paylinky(process.env.PAYLINKY_KEY, { baseUrl: "https://paylinky.vercel.app" });3 4// Direct API5const tx = await plk.collect({ amount: 1000, currency: "XAF", country_code: "CM", operator: "MTN Mobile Money", phone: "+237000000001", reference: "order_1" });6 7// Hosted page8const link = await plk.createPaymentLink({ title: "Order #1", amount: 10000, currency: "XAF" }, "order-1");9console.log(link.payment_link);10 11// Errors12try { await plk.collect({}); } catch (e) { if (e instanceof PaylinkyError) console.log(e.status, e.code, e.message); }Methods
| Method | Endpoint |
|---|---|
countries() | GET /countries |
cryptoAssets() | GET /crypto/assets |
fees() / balance() | GET /fees, GET /balance |
collect(params) | POST /collect |
cryptoCollect(params) | POST /crypto/collect |
transaction(id) | GET /transaction/{id} |
createPaymentLink(params, idempotencyKey) | POST /payment-links |
paymentLink(id) | GET /payment-links/{id} |
simulate(id, status) | POST /sandbox/simulate |
verifyWebhook(raw, headers, secret) | Signature check |