API reference
Three pieces: create an order, send the customer to the payment page, receive a signed order.paid webhook.
1. Create an order
Authenticate with your secret API key from Dashboard → Integration. Never use it in browser code.
POST https://instagate.vercel.app/api/v1/orders
Authorization: Bearer igk_live_...
Content-Type: application/json
{
"amount": 250.00, // EGP, required
"external_ref": "order-1001", // your id, unique per account (optional)
"description": "2x T-shirt", // shown on the payment page (optional)
"customer_name": "Mona", // optional
"return_url": "https://shop.example/thanks" // "Back to the store" button after payment (optional)
}
201 Created
{ "id": "7c1e…", "payUrl": "https://instagate.vercel.app/pay/7c1e…", "createdAt": "…" }Errors: 401 bad key · 400 invalid amount · 402 monthly plan limit reached · 403 account suspended · 409 duplicate external_ref or InstaPay address not set.
2. Redirect the customer
Send the customer to payUrl. They transfer with InstaPay, upload the screenshot, and the page updates live until the bank confirms.
3. Receive order.paid
Set your webhook URL in Dashboard → Settings. We POST:
POST https://your-shop.example/instagate-webhook
x-instagate-timestamp: 1767225600
x-instagate-signature: <hex HMAC-SHA256(webhook_secret, timestamp + "." + rawBody)>
{ "event": "order.paid", "order_id": "7c1e…", "external_ref": "order-1001",
"amount": 250, "currency": "EGP", "paid_at": "2026-01-01T12:00:00.000Z" }Verify the signature, reject timestamps older than 5 minutes, answer 2xx, and handle duplicates by order_id.
// Node.js / Express
import crypto from 'node:crypto';
app.post('/instagate-webhook', express.raw({ type: 'application/json' }), (req, res) => {
const ts = req.header('x-instagate-timestamp');
const sig = req.header('x-instagate-signature') ?? '';
const expected = crypto.createHmac('sha256', process.env.INSTAGATE_WEBHOOK_SECRET)
.update(ts + '.' + req.body.toString('utf8')).digest('hex');
const fresh = Math.abs(Date.now() / 1000 - Number(ts)) < 300;
if (!fresh || sig.length !== expected.length ||
!crypto.timingSafeEqual(Buffer.from(sig), Buffer.from(expected))) return res.sendStatus(401);
const event = JSON.parse(req.body.toString('utf8'));
// mark event.external_ref as paid (idempotently), then:
res.sendStatus(200);
});// PHP
$raw = file_get_contents('php://input');
$ts = $_SERVER['HTTP_X_INSTAGATE_TIMESTAMP'] ?? '';
$sig = $_SERVER['HTTP_X_INSTAGATE_SIGNATURE'] ?? '';
$expected = hash_hmac('sha256', $ts . '.' . $raw, getenv('INSTAGATE_WEBHOOK_SECRET'));
if (abs(time() - (int)$ts) > 300 || !hash_equals($expected, $sig)) { http_response_code(401); exit; }
$event = json_decode($raw, true);
// mark $event['external_ref'] as paid (idempotently)
http_response_code(200);Check an order
GET https://instagate.vercel.app/api/v1/orders/{id or external_ref}
Authorization: Bearer igk_live_...
{ "id": "…", "external_ref": "order-1001", "total_amount": 250, "status": "PAID", "paid_at": "…", "created_at": "…" }Statuses: AWAITING_PAYMENT, PENDING_BANK_CONFIRMATION, MANUAL_REVIEW, PAID, PAYMENT_EXPIRED, CANCELLED. Only PAID means you should ship.
The phone
Payments are confirmed from your bank's SMS. Install the forwarder app on a dedicated Android phone with the SIM of the receiving account, paste the setup code from Dashboard → Integration, and keep it charging and online. New accounts start in shadow mode: you confirm each payment until the Shadow report shows the system agrees with you.