# API Reference

## API Reference

All endpoints are live at <https://afriwage.vercel.app/api>

***

### GET /api/rates

Returns live USDC exchange rates for 8 African currencies. Data sourced from CoinGecko. Cached for 60 seconds.

Response: { "NGN": 1355.75, "GHS": 14.20, "KES": 129.14, "ZAR": 16.38, "TZS": 2600, "UGX": 3750, "XOF": 610, "XAF": 610, "updatedAt": "2026-05-09T19:41:15.129Z" }

***

### GET /api/account/\[address]

Returns balances for a Stellar address.

Parameters:

* address (path) — Stellar public key starting with G

Response: { "address": "G...", "xlmBalance": "124.50", "usdcBalance": "250.00", "isActive": true, "updatedAt": "2026-05-09T19:41:15.129Z" }

Error (invalid address): { "error": "Invalid Stellar address" }

Error (account not found): { "isActive": false, "xlmBalance": "0", "usdcBalance": "0" }

***

### GET /api/transactions/\[address]

Returns paginated payment history for a Stellar address.

Parameters:

* address (path) — Stellar public key
* limit (query) — number of results, default 20, max 50
* cursor (query) — pagination cursor
* filter (query) — "sent" | "received" | "all" (default "all")

Response: { "transactions": \[ { "id": "...", "type": "sent", "amount": "250.00", "asset": "USDC", "counterparty": "G...", "memo": "Design invoice", "hash": "abc123...", "createdAt": "2026-05-09T19:41:15.129Z", "explorerUrl": "<https://stellar.expert/explorer/testnet/tx/abc123>" } ], "nextCursor": "cursor\_string\_or\_null", "total": 12 }

***

### GET /api/payment/verify

Verifies a transaction by hash and returns payment proof.

Parameters:

* hash (query) — Stellar transaction hash

Response: { "hash": "abc123...", "verified": true, "status": "success", "sender": "G...", "recipient": "G...", "amount": "250.00", "asset": "USDC", "memo": "Design invoice", "fee": "0.00001", "createdAt": "2026-05-09T19:41:15.129Z", "explorerUrl": "<https://stellar.expert/explorer/testnet/tx/abc123>", "receiptUrl": "<https://afriwage.vercel.app/receipt/abc123>" }

***

### POST /api/fund-testnet

Funds a Stellar testnet account via Friendbot.

Body: { "address": "G..." }

Response (success): { "success": true, "address": "G...", "amount": "10000", "asset": "XLM", "message": "Account funded with 10,000 XLM on Stellar testnet" }

Response (already funded): { "success": false, "error": "Account already funded." }

Rate limited to 3 requests per minute per IP.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://k1ngd4vid.gitbook.io/afriwage-doc/api-reference.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
