Integrate with an AI agent
Patronise Dev is written to be integrated by coding agents (Claude Code, Cursor, Copilot, Windsurf…) as well as people.
Give your agent the docs
llms.txt: a short index with links to every page.llms-full.txt: the whole documentation in one Markdown file. Best for agents.openapi.json: the OpenAPI 3.1 spec, for code generators and API tools.
A prompt that works
Paste this into your agent, then describe your stack ("Next.js app with Prisma", "Laravel shop", "Django + HTMX"…). You can also copy it from Dashboard → API keys.
Integrate Patronise Dev (Mobile Money payments for Central and West Africa) into this project.
Read the full documentation first: https://patronise.me/developers/llms-full.txt
- Base URL: https://api.patronise.me/v1 ; auth: Authorization: Bearer <secret key>, read from the env var
PATRONISE_SECRET_KEY (never hard-code it, never send it to the browser).
- Create payments server-side with POST /v1/payments (or a hosted page with
POST /v1/checkout-sessions), always with an Idempotency-Key.
- Never mark an order paid from the redirect: only from a verified webhook
(Patronise-Signature header, HMAC-SHA256) or GET /v1/payments/:id returning "succeeded".
- Store the webhook secret in PATRONISE_WEBHOOK_SECRET.
- Test with sk_test_ keys and the test numbers from the docs before switching to live.
What a good integration looks like
Check that your agent's code does these things:
- Calls the API from the server only, with the secret key in an environment variable.
- Sends an
Idempotency-Keyon everyPOST, derived from your order id. - Stores the payment
idon your order. - Has a webhook route that checks the signature over the raw body before it trusts the event, and answers
2xxfast. - Handles
payment.succeededidempotently: the same event can arrive twice. - Shows the customer "Confirm on your phone" for
ussd_prompt, or redirects forredirect.