Skip to main content
Use Piggy through Corsair: one client, typed API calls, and incoming webhooks. Authenticate with a Personal Access Token created for a private app in the Piggy Business Dashboard Marketplace; the plugin sends it as an Authorization Bearer token. Resource paths sit under https://api.leat.com/api/v3/oauth/clients/. Piggy is the same product as Leat: the developer docs live at docs.leat.com (docs.piggy.eu redirects there) and the token is created in the Leat-branded dashboard. Answers carry a { data, meta } envelope; errors carry { message, code, status_code } with a numeric business code (e.g. 55031 Contact not found). Deletion and merge of contacts cannot be undone; reversal calls (points, rewards, vouchers) compensate a write and a transaction can be reversed once. Webhook deliveries carry an HMAC-SHA256 signature of the raw body in the Signature header, keyed with the subscription secret (or the account secret). Store the subscription secret with keys.set_webhook_signature (or set webhookSecret on the plugin). Piggy sends two envelope versions: V1 posts one event per request (deduplicate on uuid) and V2 posts a batch under events[] (deduplicate on events[].event_uuid); the receiver verifies the signature and branches on version, so one endpoint serves both. The API documents far more resources than this plugin covers (orders, bookings, unit transactions, prepaid transactions, portal sessions, stamp cards, referrals, tiers management, custom attributes, automations and more, all on the same shapes). The deprecated credit-receptions endpoints and the legacy shops paths are intentionally not part of this plugin. Every operation is described in the official reference: https://docs.leat.com/v3 What you get:
  • 47 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 contact
Find or create a contact
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 piggy.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.