How to Integrate

Connect any website or mobile app in a few minutes. Minimal code required.

1

Register your site / app

Go to the Admin → Register Site page. Enter a name and (recommended) a webhook URL where we should notify you when a payment finishes.

You will receive two keys:

  • site_key – public identifier
  • api_keysecret, use only on your server

Store the API key as an environment variable, e.g. TIGULENI_API_KEY=ak_xxxx

2

Start a payment (from your backend)

Send a POST request to https://pay.tiguleni.com/api/initiate with the header X-API-Key: your_api_key.

const response = await fetch("https://pay.tiguleni.com/api/initiate", {
  method: "POST",
  headers: {
    "Content-Type": "application/json",
    "X-API-Key": process.env.TIGULENI_API_KEY
  },
  body: JSON.stringify({
    amount: 2500,
    currency: "MWK",
    email: "customer@example.com",
    first_name: "Jane",
    last_name: "Phiri",
    return_url: "https://yoursite.com/thank-you",
    title: "Order #ORD-8821",
    description: "Premium plan – monthly",
    user_id: "42",
    item_type: "subscription",
    item_id: "plan_pro",
    plan: "pro",
    billing_cycle: "monthly",
    meta: { order_id: "ORD-8821" }
  })
});

const data = await response.json();
if (data.success) {
  // Redirect the browser to PayChangu checkout
  window.location.href = data.checkout_url;
  // or in Express: res.redirect(data.checkout_url);
}
<?php
$apiKey   = getenv("TIGULENI_API_KEY");
$backbone = "https://pay.tiguleni.com";

$payload = [
    "amount"      => 2500,
    "currency"    => "MWK",
    "email"       => "customer@example.com",
    "first_name"  => "Jane",
    "last_name"   => "Phiri",
    "return_url"  => "https://yoursite.com/thank-you.php",
    "title"       => "Order #ORD-8821",
    "user_id"     => "42",
    "item_type"   => "product",
    "item_id"     => "SKU-123"
];

$ch = curl_init("$backbone/api/initiate");
curl_setopt_array($ch, [
    CURLOPT_POST           => true,
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_HTTPHEADER     => [
        "Content-Type: application/json",
        "X-API-Key: $apiKey"
    ],
    CURLOPT_POSTFIELDS     => json_encode($payload)
]);

$result = json_decode(curl_exec($ch), true);

if (!empty($result["success"])) {
    header("Location: " . $result["checkout_url"]);
    exit;
}
echo "Error: " . ($result["error"] ?? "unknown");
import os, requests

resp = requests.post(
    "https://pay.tiguleni.com/api/initiate",
    headers={
        "Content-Type": "application/json",
        "X-API-Key": os.getenv("TIGULENI_API_KEY")
    },
    json={
        "amount": 2500,
        "email": "customer@example.com",
        "first_name": "Jane",
        "return_url": "https://yoursite.com/thank-you",
        "title": "Order #123",
        "user_id": "42",
        "item_type": "product",
        "item_id": "SKU-123"
    },
    timeout=30
)

data = resp.json()
if data.get("success"):
    # redirect user to data["checkout_url"]
    print("Checkout URL:", data["checkout_url"])
curl -X POST https://pay.tiguleni.com/api/initiate \
  -H "Content-Type: application/json" \
  -H "X-API-Key: ak_your_secret_key" \
  -d '{
    "amount": 2500,
    "email": "customer@example.com",
    "first_name": "Jane",
    "return_url": "https://yoursite.com/thank-you",
    "title": "Order #123",
    "user_id": "42"
  }'
3

Redirect the customer

The response contains a checkout_url. Redirect the user’s browser (or open a WebView in a mobile app) to that URL. They will complete payment on PayChangu’s hosted page.

{
  "success": true,
  "tx_ref": "TIG-A1B2C3-XXXXXXXXXX",
  "checkout_url": "https://checkout.paychangu.com/........",
  "message": "Redirect the user to checkout_url"
}
4

Receive the payment result (webhook – recommended)

If you provided a webhook_url when registering the site, the backbone will POST the final result to your server:

{
  "event": "payment.paid",
  "tx_ref": "TIG-A1B2C3-XXXXXXXXXX",
  "status": "paid",
  "amount": 2500,
  "currency": "MWK",
  "user_id": "42",
  "item_type": "subscription",
  "item_id": "plan_pro",
  "plan": "pro",
  "meta": { "order_id": "ORD-8821" },
  "paid_at": "2026-08-13T21:30:00Z"
}

Example handler (Express):

app.post("/api/paychangu-notify", (req, res) => {
  const { tx_ref, status, user_id, item_id } = req.body;
  if (status === "paid") {
    // unlock product / activate subscription / mark order paid
  }
  res.json({ ok: true });
});
5

Optional – poll status

You can also check the status at any time:

GET https://pay.tiguleni.com/api/status/TIG-XXXXXX
Header: X-API-Key: ak_your_key

📱 Mobile Apps (Flutter / React Native / etc.)

Never put the API key inside the mobile binary. Always call /api/initiate from your own backend. Then open the returned checkout_url in a WebView or system browser.

After payment the user is redirected to your return_url. Use the webhook (or status polling) on your backend to confirm the payment before granting access.

Request body fields

FieldRequiredDescription
amountYesAmount to charge (number)
emailRecommendedCustomer email
first_nameNoCustomer first name
last_nameNoCustomer last name
return_urlRecommendedWhere the user is sent after payment
titleNoTitle shown on checkout page
descriptionNoDescription shown on checkout
user_idNoYour internal user ID
item_typeNoe.g. product, subscription, donation
item_idNoYour product / plan ID
planNoPlan name
billing_cycleNomonthly, yearly, etc.
currencyNoDefault: MWK
metaNoAny extra JSON you want stored
Register a Site now