Developer Quickstart
Use the PayChainHQ SDK or REST API from a trusted backend. Never expose API keys in browsers, mobile apps, static sites, or public client code.Docs positioning: The SDK is the fastest path for Node.js and TypeScript. REST examples are available in REST API guide and Payment flows.
Install the SDK
Create a customer
Create an invoice
Flow note: This is the fixed amount invoice flow. For auto-detected payments, payout route invoices, dynamic payout recipients, and programmatic withdrawals, see Payment flows.
Attach a payout route
Dynamic payout recipients
Dynamic recipients are for trusted backend payout automation, usually with a payout API key. The SDK accepts percentages and converts them to basis points for the API.Verify webhooks
PayChain sends webhooks when an invoice, withdrawal, or routing event changes state. Your backend should verify every webhook before acting on it. Verification must use the raw request body, not parsed and re-stringified JSON. After verification, fetch the canonical invoice or withdrawal record before crediting a user, releasing an order, or marking a payout complete.Webhook note: A valid webhook tells you PayChain sent the event. Your fulfillment system should still fetch the canonical invoice or withdrawal before releasing value.
Read balances, transactions, networks, and tokens
Use balances to understand treasury availability, transactions to reconcile invoice and withdrawal activity, networks to discover supported rails, and tokens to confirm which assets can be accepted or withdrawn. See Supported networks and tokens for the current catalog pattern and discovery guidance. Do not treat raw wallet balances as invoice truth. Invoice state and signed webhook events remain the source of truth for customer payments.Do not do this
- Do not ship API keys to browsers or mobile apps.
- Do not log SDK config, request headers, API keys, webhook secrets, or payout destination auth tokens.
- Do not disable webhook verification.
- Do not use standard API keys for withdrawals.
- Do not trust client-submitted payout destinations without your own validation.