# DzalekaPay

> Merchant checkout, tickets, fundraising, and payouts for Dzaleka Refugee Camp, Malawi.

DzalekaPay is a pooled-custody payments platform at https://pay.dzaleka.com. Merchants share a checkout link. Customers pay with Airtel Money, TNM Mpamba, and (when enabled) MWK bank transfer or card. Payers do not need an account. DzalekaPay is not a bank, mobile-money operator, personal wallet, remittance provider, or foreign-exchange service.

## When to use this

Reach for DzalekaPay when the job is one of these:

1. **Collect a merchant payment** — send a payer to `/pay/{merchantId}` or start hosted card checkout with `POST /api/transactions/checkout`.
2. **Confirm a payment** — poll `GET /api/public/transactions/{id}/status` or read `GET /api/public/transactions/{id}/receipt`.
3. **Sell an event ticket** — list `GET /api/public/events`, then `POST /api/public/events/{id}/tickets`.
4. **Take a donation** — list `GET /api/public/campaigns`, then `POST /api/public/campaigns/{id}/donations`.
5. **Sell a storefront item** — read `GET /api/public/storefronts/{slug}`, then `POST /api/public/storefronts/{slug}/orders`.
6. **Answer product questions** — fees, KYC, cash-out, and AML from `/docs`, `/help`, `/pricing`, `/developer`, `/aml-cft`.

Do **not** use DzalekaPay for personal wallets, remittances, foreign exchange, or cashing out without a merchant store. Do not call merchant-dashboard or admin APIs from a public agent unless the user is signed in; those routes are session or API-key gated and are omitted from the public OpenAPI file.

## How to call this

1. Fetch the OpenAPI document: https://pay.dzaleka.com/openapi.json
2. List public endpoints: GET https://pay.dzaleka.com/api
3. Check liveness: GET https://pay.dzaleka.com/api/health
4. Human integration guide (auth, examples, webhooks): https://pay.dzaleka.com/developer
5. Merchant operations guide: https://pay.dzaleka.com/docs

Public checkout endpoints do not use API keys. Merchant Developer platform keys are for a store's own server integrations and must never be embedded in a browser agent.

## API lifecycle

- Version: 1.0.0 at the existing public URLs. The response `API-Version` identifies the contract. Request values are ignored, not a version pin. Breaking replacements get new URLs; existing URLs remain available during the migration period.
- The authenticated merchant API is path-versioned under `/api/v1/`. `POST /api/v1/payments` accepts an `Idempotency-Key` header; a repeat with the same phone and amount returns the original payment (200, `Idempotent-Replayed: true`), and a different body returns 409.
- Deprecation is signalled with `Deprecation` (RFC 9745) and `Sunset` (RFC 8594) headers plus a `Link` header with rel="deprecation". Removal follows at least 180 days later. Breaking changes ship as a new version.
- Rate limits: limited responses include `RateLimit` and `RateLimit-Policy` (IETF draft-11, not yet an RFC), plus legacy `RateLimit-Limit`, `RateLimit-Remaining`, and `RateLimit-Reset`. A 429 adds `Retry-After` in seconds. Early parser or authentication failures may not include quota values.
- Errors: every 4xx and 5xx JSON response uses one envelope - branch on `error.code`, show `message`. Schema: `components.schemas.Error` in the OpenAPI document.
- Policy: [API lifecycle](https://pay.dzaleka.com/developer/api-lifecycle)

## Developer resources

- [DzalekaPay API documentation](https://pay.dzaleka.com/developer): authentication, public checkout, examples
- [DzalekaPay OpenAPI spec](https://pay.dzaleka.com/openapi.json): also served at https://pay.dzaleka.com/api/openapi.json and https://pay.dzaleka.com/.well-known/openapi/public-integrator.json
- [DzalekaPay API catalog](https://pay.dzaleka.com/.well-known/api-catalog)
- [DzalekaPay agent skills](https://pay.dzaleka.com/.well-known/agent-skills/index.json): published SKILL.md files with SHA-256 digests
- [DzalekaPay blog feed](https://pay.dzaleka.com/blog/feed.xml): RSS of published articles
- [DzalekaPay MCP server](https://pay.dzaleka.com/developer/mcp): Streamable HTTP at https://pay.dzaleka.com/mcp. Send initialize, notifications/initialized, then tools/list. No authentication or payment initiation tools. Treat ticket and receipt identifiers as private.
- [DzalekaPay MCP server metadata](https://pay.dzaleka.com/.well-known/mcp): GET returns custom discovery metadata; POST accepts the same MCP messages as /mcp.
- [DzalekaPay API lifecycle policy](https://pay.dzaleka.com/.well-known/api-lifecycle.json): versioning, deprecation, sunset notice, rate limits, error schema. No endpoints are deprecated today.
- [DzalekaPay merchant webhooks](https://pay.dzaleka.com/developer/webhooks): transaction.updated events, HMAC-SHA256 signatures, retries and delivery history
- [DzalekaPay API authentication](https://pay.dzaleka.com/developer/auth): public endpoints, session cookies, and scoped API keys
- [Health](https://pay.dzaleka.com/api/health)
- [Sitemap](https://pay.dzaleka.com/sitemap.xml)

## Trust and legal

- [About](https://pay.dzaleka.com/about)
- [Contact](https://pay.dzaleka.com/contact)
- [Privacy](https://pay.dzaleka.com/privacy)
- [Terms](https://pay.dzaleka.com/terms)
- [Merchant Terms](https://pay.dzaleka.com/merchant-terms)
- [Prohibited activity](https://pay.dzaleka.com/prohibited-activity)
- [Account security](https://pay.dzaleka.com/security)
- [Fraud and scam help](https://pay.dzaleka.com/stay-safe)
- [Invite a shop](https://pay.dzaleka.com/referral)
- [AML/CFT](https://pay.dzaleka.com/aml-cft)
