Your keys

i-Pay Merchant API

For i-Pay businesses on the Business package: your till, POS or accounting reads the payments made to you through i-Pay. (Accepting payments in your own app or website is the separate i-Pay Payments API, coming later.)

Important: "started", not "paid"

i-Pay records when a customer presses PAY on your sticker. Wallet companies don't confirm payments to i-Pay yet, so every payment has "status": "started". Check your wallet SMS for what arrived. When providers connect, confirmed payments will get "status": "paid".

Authentication

Create a key in Business → Developers. Send it on every request. Never put it in a web page or app that customers can see.

Authorization: Bearer ipay_live_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

Base URL: https://i-pay.so/api/v1. All amounts are USD strings with 2 decimals. Dates are Somalia time (EAT).

GET /me

Your business, wallets and stickers.

curl https://i-pay.so/api/v1/me -H "Authorization: Bearer $IPAY_KEY"

GET /payments

Newest first. from/to are dates (YYYY-MM-DD, inclusive, max 366 days; default last 7 days). limit 1–1000 (default 100), offset for paging.

curl "https://i-pay.so/api/v1/payments?from=2026-11-01&to=2026-11-30&limit=100" -H "Authorization: Bearer $IPAY_KEY"

{
  "data": [
    { "created_at": "2026-11-26T14:12:59Z", "wallet": "evc", "amount": "4.50",
      "currency": "USD", "sticker": "A7K2QX", "status": "started" }
  ],
  "total": 1, "limit": 100, "offset": 0, "has_more": false
}

GET /reports/summary

Totals by wallet, day and sticker. range = today, yesterday, 7d, 30d, month, lastmonth, or custom with from/to.

curl "https://i-pay.so/api/v1/reports/summary?range=month" -H "Authorization: Bearer $IPAY_KEY"

POST /pay-links

A link to your pay page with the amount filled in, e.g. to send on WhatsApp. Optional sticker picks which of your stickers.

curl -X POST https://i-pay.so/api/v1/pay-links -H "Authorization: Bearer $IPAY_KEY"   -H "content-type: application/json" -d '{"amount":"12.50"}'

{ "data": { "url": "https://i-pay.so/p/A7K2QX?a=12.5", "amount": "12.5", "currency": "USD", "sticker": "A7K2QX" } }

Webhook: payment.started

Set your https URL in Business → Developers. We POST this JSON when a customer presses PAY. Answer with any 2xx within 5 seconds.

POST https://yourshop.so/ipay-webhook
X-IPAY-Signature: t=1795700000,v1=5f2c…

{ "id": "evt_123", "type": "payment.started", "created_at": "2026-11-26T14:12:59Z",
  "data": { "merchant_id": "…", "sticker": "A7K2QX", "wallet": "evc",
            "amount": "4.50", "currency": "USD", "status": "started" } }

Check the signature (Node.js). Reject anything that fails or is older than 5 minutes:

const crypto = require("crypto");
function verify(rawBody, header, secret) {
  const parts = Object.fromEntries(header.split(",").map(p => p.split("=")));
  if (Math.abs(Date.now() / 1000 - Number(parts.t)) > 300) return false;
  const want = crypto.createHmac("sha256", secret).update(parts.t + "." + rawBody).digest();
  const got = Buffer.from(parts.v1 || "", "hex");
  return got.length === want.length && crypto.timingSafeEqual(got, want);
}

Errors

{ "error": { "code": "unauthorized", "message": "This API key is wrong or has been revoked." } }