OpenPermit Docs
SDK

Core Client

Create an OpenPermit client for API calls across buyer, seller, and control-plane workflows.

import { createOpenPermitClient } from '@openpermit/sdk/client';

const openpermit = createOpenPermitClient({
	baseUrl: 'https://api.openpermit.ai',
	apiKey: process.env.OPENPERMIT_API_KEY,
	organizationId: process.env.OPENPERMIT_ORGANIZATION_ID,
	timeoutMs: 10_000,
});

The client uses the runtime fetch implementation by default. Pass fetch explicitly when your runtime requires a custom implementation.

const openpermit = createOpenPermitClient({
	baseUrl: 'https://api.openpermit.ai',
	apiKey: process.env.OPENPERMIT_API_KEY,
	fetch: myFetch,
});

Common client methods include:

  • createMandateDraft, approveMandate, activateMandate, pauseMandate, revokeMandate
  • normalizePaymentIntent, authorizePayment, executePayment
  • createSeller, listSellers, createSellerResource, createSellerChallenge, verifySellerPayment
  • listReceipts, getReceipt, createWebhookSubscription, listAuditEvents

See the generated API reference for full request and response schemas.