Home Developers

Developers

Guides for Developers
By Inkress Support
6 articles

How to Create an Order and Generate a Payment Link

You’ve got a product and a price — now let’s get paid! The POST /orders endpoint helps you create an order, generate a unique short link, and share it anywhere (email, WhatsApp, even QR code). Why use an order? Orders are the foundation for payments. They help track: - Who’s paying (customer info) - How much they’re paying - What they’re buying - And where they’re redirected after payment Example: Create your first order Here’s a full example you can try: curl -X POST "https://api.inkress.com/api/v1/orders" \ -H "Authorization: Bearer YOUR_JWT" \ -H "Client-Id: m-nonitropicals" \ -H "Content-Type: application/json" \ -d '{ "currency_code": "JMD", "customer": { "email": "ava@example.com", "first_name": "Ava", "last_name": "Lee" }, "total": 2499, "reference_id": "order-1001", "kind": "online" }' You’ll get something like: { "state": "ok", "data": { "id": 12345, "payment_urls": { "short_link": "https://pay.inkress.com/abc123" } } } That short_link is your hosted checkout page — ready to share! Common use cases - Selling items on Instagram? Send the short link via DM. - Running a service business? Embed the link in invoices. - Want to simplify your checkout flow? Redirect users directly there. Friendly reminders ✅ Include currency_code and total — they’re required. ✅ Use a unique reference_id so you can match orders later. ✅ Don’t mark orders “paid” yourself — Inkress will handle that once payment succeeds.

Last updated on Sep 27, 2025

Setting Up Webhooks (So Inkress Can Talk Back)

Inkress isn’t just waiting for you to ask questions — it also likes to send updates! Webhooks are how it tells your app when important stuff happens. Why webhooks matter Webhooks keep your app in sync without constant polling. You’ll get notifications like: - 🟢 Payment succeeded - 🔴 Payment failed - 🔁 Refund issued - 🆕 Merchant registered How to set one up 1. Create a webhook endpoint on your server (e.g., /webhooks/payment). 2. Add its URL when creating or updating your merchant. 3. Inkress will send POST requests there whenever an event fires. Example in Node.js import express from "express"; import jwt from "jsonwebtoken"; const app = express(); app.use("/webhooks/payment", express.raw({ type: "application/json" })); app.post("/webhooks/payment", (req, res) => { try { const payload = JSON.parse(req.body); const token = payload.jwt; const verified = jwt.verify(token, process.env.INKRESS_WEBHOOK_SECRET); switch (verified.status) { case "paid": console.log("🎉 Order paid:", verified.order_id); break; case "failed": console.log("❌ Payment failed:", verified.reason); break; } res.sendStatus(200); } catch (e) { res.status(400).send("Invalid signature"); } }); app.listen(3000); What to keep in mind - Always verify the JWT — it’s your proof Inkress sent it. - Respond quickly with a 200. - Webhooks may retry — make your handling idempotent. If Inkress can’t reach your endpoint (timeout, 500 error, etc.), it’ll retry later — so make sure your URL is public and stable.

Last updated on Sep 27, 2025