```mermaid
flowchart LR
  A["Agent: tools/call zapremit_payment<br/>remit.paymentrequired.com/mcp"] --> V["validate()<br/>tools.js"]
  V --> D["callTool zapremit_payment<br/>mcp.js"]
  D --> Z["zapremit.payment: once, cached"]
  Z --> ZR(("ZapRemit API"))
  Z --> W(("payer Lightning wallet"))
```

# `zapremit_payment` (Remit)

[← Index](../index.md) · [Overview](../overview.md) · [Signer](../signer.md) · [Issued links](../links.md)

> Evidence labels: **CODE** = read in the cited file at the recorded revision/hash; **FIXTURE** = parent-accepted combined cloud fixture run 99/99 (`directory-wave/parent-directory-wave-acceptance.json`), not live; **LIVE-RO** = observed read-only on the live host 2026-10-14 (raw files in `evidence/live-probes/`); **UNVERIFIED** = not executed here. Topology = accepted directory-wave source, **not deployed**. Nothing in this handbook moved money, signed, or activated a card.

## What it does

Asks ZapRemit once for the Lightning invoice funding `orderId`, returns it with a QR (`invoice`, `paymentUri`, `automaticDetection:true`, `qr{svgUrl,pngUrl}`) while payable. The payer pays from their own wallet; the server never pays it.

**Catalog:** remit.paymentrequired.com/mcp (ZapRemit sub-catalog). **Schema & dispatch:** Definition [`remit:src/zapremit-tools.js:65`](https://github.com/nuri-com/nuri-clickpesa-remit-mcp/blob/212886c7eedfa314f7de790622ea95632630057b/src/zapremit-tools.js#L65); dispatch [`remit:src/zapremit.js:559`](https://github.com/nuri-com/nuri-clickpesa-remit-mcp/blob/212886c7eedfa314f7de790622ea95632630057b/src/zapremit.js#L559)

## Actions / operations

| action | what happens | effect | source |
|---|---|---|---|
| `zapremit_payment` | ZapRemit Lightning invoice | read (shows where to pay; payer moves money) | [`remit:src/zapremit.js:559`](https://github.com/nuri-com/nuri-clickpesa-remit-mcp/blob/212886c7eedfa314f7de790622ea95632630057b/src/zapremit.js#L559) |

## Prerequisites

No account, registration or API key (instructions text). ZapRemit must be configured on the server, otherwise 503 `provider_unavailable`.

## How to use it (exact `tools/call` JSON)

Endpoint: `POST https://remit.paymentrequired.com/mcp` (JSON-RPC 2.0). Placeholders in `<…>` are never real values; secrets (`session`, `wallet_key`) are never pasted into docs or logs.

**zapremit_payment**

```json
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "zapremit_payment",
    "arguments": {
      "orderId": "zap_00000000-0000-4000-8000-000000000000"
    }
  }
}
```

Expected result (`structuredContent`, shape from code; values illustrative):

```json
{"provider":"zapremit","orderId":"zap_…","status":"pending","amountSats":…,"invoice":"lnbc…","paymentUri":"lightning:…","automaticDetection":true,"qr":{"svgUrl":"…","pngUrl":"…"}}
```

Plain-JSON form (same handler): `POST /mcp` with `{"tool":"zapremit_payment", …arguments}`; a payment request then comes back as HTTP 402 ([`remit:src/mcp.js:799`](https://github.com/nuri-com/nuri-clickpesa-remit-mcp/blob/212886c7eedfa314f7de790622ea95632630057b/src/mcp.js#L799)).

## Approval, signature and money

The payer's own Lightning wallet pays; nothing is signed by this server.

## Failure, peer-down and retry

Repeated calls return the same invoice; outcome-unknown → 409 `payment_unknown`, not re-sent.

## What was actually observed

UNVERIFIED: not called by this handbook.
