Documentation menu

Quick start

This gets a gateway running on your machine against the Nile testnet, creates a project, and takes one invoice from creation to a signed invoice.paid webhook. No real money and no wallet software are needed. It takes about five minutes.

1. Get the code and configure it

git clone https://github.com/AQaddora/qirsh
cd qirsh
cp .env.example .env

Open .env and set the first admin account:

ADMIN_EMAIL=you@example.com
ADMIN_PASSWORD=choose-at-least-12-characters
NETWORK=nile

Leave the rest as it is. The server checks the configuration when it starts and exits with a precise message if something is wrong.

2. Start it

With Docker:

docker compose up -d --build
docker compose logs -f qirsh     # wait for "Qirsh is running with N active project(s)"

Without Docker (Node 22 or later):

npm ci
npm run dev                          # reads .env, restarts on code changes

Check that it is up:

curl -s http://localhost:8080/health
{"ok":true,"watcher":{"ok":true,"last_poll_at":null,"last_error":null,"catching_up":false,"deposits_unreconciled":0},"sweeper":{"enabled":false,"ok":true,"queued":0,"in_flight":0,"failed":0,"held":0}}

3. Get a webhook endpoint

The gateway needs somewhere to send webhooks. For a first test, the quickest option is a public request inspector such as webhook.site: open it, copy your unique URL, and use it below.

If you want to receive the webhook on your own machine instead, run the demo store in examples/node-store (see step 7). Webhook URLs on localhost or private networks are refused for dashboard projects unless you set ALLOW_PRIVATE_WEBHOOKS=true in .env and restart. Only do that in development. Inside Docker, localhost is the container itself, so the demo store is easier with the Node setup.

4. Create a project

  1. Open http://localhost:8080/admin and sign in with the admin account from .env.
  2. Click Admin, then + New project.
  3. Fill in:
    • Project name: Test shop
    • Network: Nile testnet
    • Wallet that receives payments: either Generate a new wallet (the dashboard creates one in your browser; write down the 12 words and type 3 of them back, as the dialog asks) or Use an existing address and paste a Nile address you control. For a simulation-only test any valid address works, for example TXYZopYRdj2D9XRtbG411XZZ3kM5VkAeBf. See Choose the wallet.
    • Webhook URL: the URL from step 3.
    • Tick Allow simulated payments (testnets only).
  4. Save. The gateway shows the project's API key and webhook secret once. Copy both now.
export QIRSH_URL=http://localhost:8080
export QIRSH_API_KEY=<the API key>

5. Create an invoice

curl -s -X POST $QIRSH_URL/api/v1/invoices \
  -H "Authorization: Bearer $QIRSH_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"amount":"10","order_id":"TEST-1","description":"Quick start test"}'

The response (shortened):

{
  "id": "inv_Luonp2fQ0b8rR1cS9yZ5w08",
  "object": "invoice",
  "status": "pending",
  "order_id": "TEST-1",
  "amount": "10",
  "amount_due": "10.004213",
  "currency": "USDT",
  "network": "tron-nile",
  "pay_address": "TXYZopYRdj2D9XRtbG411XZZ3kM5VkAeBf",
  "checkout_url": "http://localhost:8080/pay/inv_Luonp2fQ0b8rR1cS9yZ5w08",
  "expires_at": "2026-12-05T18:30:00.000Z",
  "deposit_mode": "amount"
}

Open checkout_url in a browser. You see the hosted checkout with the exact amount, a QR code, the address and a countdown. Add ?lang=ar to see the Arabic version.

6. Simulate the payment

curl -s -X POST $QIRSH_URL/api/v1/invoices/<invoice id>/simulate-payment \
  -H "Authorization: Bearer $QIRSH_API_KEY"

The invoice becomes paid, the checkout page switches to Payment received, and the gateway sends a signed invoice.paid webhook to your endpoint. You can also press Simulate paid next to the invoice in the dashboard.

Look at the request your endpoint received. It has a Qirsh-Signature: t=...,v1=... header and a body like:

{
  "id": "evt_...",
  "type": "invoice.paid",
  "created_at": "2026-12-05T18:01:12.000Z",
  "data": { "invoice": { "id": "inv_...", "status": "paid", "order_id": "TEST-1", "amount": "10", "amount_paid": "10.004213" } }
}

The dashboard's Webhooks tab shows each delivery with its status code.

7. Optional: run the demo store

examples/node-store is a one-product shop in about 100 lines that creates invoices, verifies webhooks and marks orders paid.

npm run build --prefix sdk
cd examples/node-store
QIRSH_URL=http://localhost:8080 \
QIRSH_API_KEY=<the API key> \
QIRSH_WEBHOOK_SECRET=<the webhook secret> \
node server.mjs

Set the project's webhook URL to http://localhost:3000/webhooks/qirsh (with ALLOW_PRIVATE_WEBHOOKS=true on the gateway), open http://localhost:3000, buy the coffee, and simulate the payment.

Next steps

Edit this page on GitHub