Skip to main content
Use Payhere through Corsair: one client, typed API calls, and incoming webhooks. Authenticate with the API key from the integrations section of the merchants admin; the plugin sends it as an Authorization Bearer token. Every list endpoint pages with page and per_page (default 20, maximum 100) and answers { data, meta } where meta.next_page is the next page number. Webhook deliveries are signed in the X-Signature header: HMAC-SHA1 hex of the raw body with the shared secret from the merchants admin. Store that secret with keys.set_webhook_signature (or set webhookSecret on the plugin) so deliveries can be verified. Events include payment.success, payment.failed and subscription.cancelled. The plugin covers nine read and refund operations. Creating plans and cancelling subscriptions (POST /api/v1/plans, DELETE /api/v1/subscriptions/:id) are not wrapped yet. Every operation is described in the official docs: https://developers.payhere.co/docs/api-auth What you get:
  • 9 typed API operations
  • 1 incoming webhook event types

Setup

1

Install

2

Add the plugin

corsair.ts
With multiTenancy: true, scope calls with corsair.withTenant(id). See Quick start for KEK + Hub keys, and Multi-tenancy for account isolation.
3

Choose authentication

4

Connect a tenant

Mint a connect link and send the tenant to it. Hub hosts the page and delivers the result to your app — see Connect / OAuth.

Example API calls

Read a customer with their history
Refund a payment
See the full list on the API page.

Webhooks

This plugin registers 1 webhook event type. Configure the provider to POST to your Corsair HTTP handler, then use webhookHooks on the plugin factory. See Webhooks for every event path and payload shape, and Webhooks concept for routing.

What’s next

API reference

Every payhere.api.* operation with input and output types.

Webhooks

Event paths, payloads, and webhookHooks examples.

Connect / OAuth

createLink, Hub delivery, and tenant connect flows.

Use with agents

Expose this plugin’s operations as MCP tools.