Skip to main content
ArrowLeftDeveloper Portal

SDKs & Libraries

Official client libraries for Python and Node.js. Start integrating in minutes.

Terminal

Python SDK

v1.0.0
Async support (asyncio)Type hintsAutomatic retriesWebhook verification
Terminalpip install cantarell-sdk

Zap QUICKSTART

from cantarell import CantarellClient

# Initialize with your API key
client = CantarellClient("sk_live_your_key_here")

# List orders
orders = client.orders.list(limit=10)
for order in orders.data:
    print(f"{order.id}: {order.product} — {order.total_mxn} MXN")

# Create a payment
payment = client.payments.create(
    amount=225000,
    currency="MXN",
    clabe="012180000000000001",
    reference="INV-2024-001"
)
print(f"Payment {payment.id}: {payment.status}")

# Register a webhook
webhook = client.webhooks.create(
    url="https://yoursite.com/webhook",
    events=["order.*", "payment.*"]
)
print(f"Webhook secret: {webhook.secret}")

# Verify webhook signature
from cantarell.webhooks import verify_signature
is_valid = verify_signature(
    secret=webhook.secret,
    payload=request.body,
    signature=request.headers["X-Cantarell-Signature-256"],
    timestamp=request.headers["X-Cantarell-Timestamp"],
)
Code

Node.js SDK

v1.0.0
TypeScript-firstPromise-basedAutomatic retriesWebhook verification
Terminalnpm install @cantarell/sdk

Zap QUICKSTART

import { CantarellClient } from '@cantarell/sdk';

// Initialize with your API key
const client = new CantarellClient('sk_live_your_key_here');

// List orders
const orders = await client.orders.list({ limit: 10 });
orders.data.forEach(order => {
  console.log(`${order.id}: ${order.product} — ${order.totalMxn} MXN`);
});

// Create a payment
const payment = await client.payments.create({
  amount: 225000,
  currency: 'MXN',
  clabe: '012180000000000001',
  reference: 'INV-2024-001',
});
console.log(`Payment ${payment.id}: ${payment.status}`);

// Register a webhook
const webhook = await client.webhooks.create({
  url: 'https://yoursite.com/webhook',
  events: ['order.*', 'payment.*'],
});
console.log(`Webhook secret: ${webhook.secret}`);

// Verify webhook signature (Express example)
import { verifyWebhook } from '@cantarell/sdk/webhooks';

app.post('/webhook', (req, res) => {
  const isValid = verifyWebhook({
    secret: process.env.WEBHOOK_SECRET,
    payload: req.body,
    signature: req.headers['x-cantarell-signature-256'],
    timestamp: req.headers['x-cantarell-timestamp'],
  });
  if (!isValid) return res.status(401).send('Invalid signature');
  // Process event...
  res.status(200).send('OK');
});

cURL / HTTP

No SDK needed. Use any HTTP client with the standard REST API.

# List orders
curl -X GET https://api.cantarell-os.tech/api/v2/orders \
  -H "Authorization: Bearer sk_live_..."

# Create a webhook
curl -X POST https://api.cantarell-os.tech/api/v2/webhooks \
  -H "Authorization: Bearer sk_live_..." \
  -H "Content-Type: application/json" \
  -d '{"url":"https://you.com/hook","events":["order.*"]}'

# Get credit score
curl -X GET https://api.cantarell-os.tech/api/v2/credit/score \
  -H "Authorization: Bearer sk_live_..."