Skip to content

Developers

A small API you can hold in your head.

Eight endpoints, one webhook format, an npm client with signature checking, and a plugin for stores without a developer. Full docs live in the dashboard with your own keys filled in.

1 · Create

Create a payment, redirect the customer.

import { Chainquay } from 'chainquay';
const cq = new Chainquay({ apiKey: process.env.CHAINQUAY_API_KEY });

const payment = await cq.payments.create({
  asset: 'BTC',                      // 'BTC' | 'ETH' | 'USDC_ERC20' | 'USDT_BEP20' | …
  priceAmount: '49.99',              // or cryptoAmount: '0.0006'
  priceCurrency: 'USD',              // USD | EUR | GBP
  orderId: 'order-1001',
  customerEmail: '[email protected]',
  successUrl: 'https://shop.example/thanks',
  cancelUrl: 'https://shop.example/cart',
});
// payment.checkoutUrl, payment.depositAddress, payment.cryptoAmount, payment.expiresAt

2 · React

Ship on the webhook.

Every event is a POST with { id, event, createdAt, data } where data is the full payment. Deliveries retry with backoff for up to 8 attempts and can be replayed from the dashboard.

import { constructWebhookEvent } from 'chainquay';

app.post('/webhooks/chainquay', express.raw({ type: '*/*' }), (req, res) => {
  const event = constructWebhookEvent(req.body, req.header('cq-signature'), process.env.WEBHOOK_SECRET);
  if (event.event === 'payment.confirmed') fulfil(event.data.orderId);
  if (event.event === 'payment.refunded') markRefunded(event.data.orderId);
  res.sendStatus(200);
});

Reference

Endpoints

Also available as an OpenAPI 3.1 document for code generators and AI agents.

POST/v1/paymentsCreate a payment
GET/v1/payments/{id}Retrieve a payment with deposits, settlement and refunds
GET/v1/paymentsList payments, filter by status, asset or date
POST/v1/payments/{id}/cancelCancel a payment while it is unpaid
POST/v1/payments/{id}/refundsRefund on-chain or record a manual refund
GET/v1/refundsList refunds
GET/v1/ratesCurrent exchange rates for every asset
GET/public/payments/{id}Public payment status for your own checkout UI (no auth)

Base URL https://api.chainquay.com. Authenticate with Authorization: Bearer cq_live_…; use cq_test_… keys while integrating.

npm client

TypeScript types, ESM and CommonJS, no dependencies, works in Node 18+, serverless and edge runtimes.

npm install chainquay
View on npm →

WooCommerce plugin

Coin picker at checkout, redirect to the hosted page, orders marked paid from the signed webhook, on hold when underpaid, refunded after a refund. Store currency USD, EUR or GBP.

Download plugin zip

Built for AI agents

A machine-readable OpenAPI spec and an llms.txt summary, so coding assistants and agents can integrate Chainquay without guessing.

Build it this afternoon

Create an account, grab a test key, and make your first payment against the API before dinner.