```mermaid
flowchart LR
  A["Agent: tools/call get_payment<br/>remit.paymentrequired.com/mcp"] --> V["validate()<br/>tools.js"]
  V --> D["callTool get_payment<br/>mcp.js"]
  D --> J{"closedForPayment?"}
  J -->|yes| X["409 order_not_payable"]
  J -->|no| P["payments.get(orderId, rail)<br/>QR image"]
```

# `get_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

Exact amount, address/invoice and QR (image content) for `orderId` on `rail` `usdc_base` (default), `eurc_base`, `btc_onchain`, `lightning`. Lightning only when automatic detection is proven; paid/recovered/expired orders never return details.

**Catalog:** remit.paymentrequired.com/mcp (own MCP, independent). **Schema & dispatch:** Definition [`remit:src/tools.js:315`](https://github.com/nuri-com/nuri-clickpesa-remit-mcp/blob/212886c7eedfa314f7de790622ea95632630057b/src/tools.js#L315); dispatch [`remit:src/mcp.js:381`](https://github.com/nuri-com/nuri-clickpesa-remit-mcp/blob/212886c7eedfa314f7de790622ea95632630057b/src/mcp.js#L381)

## Actions / operations

| action | what happens | effect | source |
|---|---|---|---|
| `get_payment` | Payment details and QR for an unpaid order | read (shows where to pay) | [`remit:src/mcp.js:381`](https://github.com/nuri-com/nuri-clickpesa-remit-mcp/blob/212886c7eedfa314f7de790622ea95632630057b/src/mcp.js#L381) |

## Prerequisites

No account, registration or API key (instructions text). 

## 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.

**get_payment**

```json
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "get_payment",
    "arguments": {
      "orderId": "NURI-00000000-0000-4000-8000-000000000001",
      "rail": "usdc_base"
    }
  }
}
```

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

```json
{"ok":true,"orderId":"NURI-…","status":"awaiting_payment","rail":"usdc_base","asset":"USDC","network":"…","amount":"…","amountAtomic":"…","payTo":"0x…","automaticDetection":true} + image/png content
```

Plain-JSON form (same handler): `POST /mcp` with `{"tool":"get_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

Money is paid by the agent/person into the offered rail (USDC/EURC on Base, BTC, Lightning, or x402/L402 proof); payout to Tanzania follows **after** the incoming payment is verified.

## Failure, peer-down and retry

Read-only; repeat freely. `order_not_payable` (409) once paid.

## What was actually observed

LIVE-RO 2026-10-14T18:10Z @212886c: unknown id → JSON-RPC error `unknown_order`. Real order: UNVERIFIED.
