Developer Resources

Build with KolayMiles

Integrate our APIs and SDKs to add mil rewards to your applications.
Get started in minutes, not hours.

RESTful APIs
TypeScript SDK
Webhook Support
Get Started in 5 Minutes

Quick Start Guide

Integrate KolayMiles rewards in your application with just a few lines of code

1
Install PayKLY SDK
Add the official KLYCoin payment SDK to your project
npm install paykly
2
Initialize SDK
Set up the facilitator with your merchant credentials
import { PayKLYFacilitator } from 'paykly';

const paykly = new PayKLYFacilitator({
  facilitatorAddress: '0x...',
  merchantId: 'your-merchant-id'
});
3
Create Payment
Accept payments and automatically reward customers with miles
const payment = await paykly.createPayment({
  amount: 50,
  currency: 'USDT',
  orderId: 'order_123',
  description: 'Product purchase'
});
Powerful SDK

Why PayKLY SDK?

Everything you need to integrate crypto payments with mil rewards

Lightning Fast
Accept payments in seconds with optimized blockchain interactions
Bank-Grade Security
Built-in signature verification and transaction validation
Multi-Currency
Support for KOLAY, BNB, USDT, BUSD and more
Real-time Updates
Webhook integration for instant payment notifications
TypeScript First
Complete type safety and IntelliSense support
Production Ready
Used by 100+ merchants processing $1M+ monthly
API Documentation

API Reference

Complete REST API documentation for integrating KolayMiles

POST
/api/x402/charge
Create a new payment charge

Request Body

{
  "payer": "0x742d35Cc...",
  "merchant": "0x8ba1f109...",
  "asset": "USDC",
  "amount": 10.50,
  "metadata": {
    "receiptId": "ORDER-123",
    "description": "Product purchase"
  }
}

Response

{
  "ok": true,
  "x402Id": "402-ORDER-123-abc",
  "expires_in": 300,
  "signature": "0x...",
  "status": "pending"
}
Code Examples

Integration Examples

Real-world examples for common integration scenarios

E-commerce Checkout
Process payments and award miles in your online store
async function processCheckout(cart) {
  const payment = await paykly.createPayment({
    amount: cart.total,
    currency: 'USDT',
    orderId: cart.id,
    description: `Order with ${cart.items.length} items`,
    metadata: { 
      customerId: cart.userId,
      items: cart.items.map(i => i.name)
    }
  });
  
  return { paymentId: payment.paymentId };
}
Webhook Handler
Handle payment notifications in real-time
app.post('/webhooks/paykly', async (req, res) => {
  const event = await webhook.processWebhook(
    req.body,
    req.headers['x-paykly-signature'],
    async (event) => {
      if (event.event === 'payment.completed') {
        await fulfillOrder(event.data.orderId);
      }
    }
  );
  
  res.status(200).send('OK');
});

Ready to Build?

Start integrating KolayMiles today. Get support from our team and join hundreds of developers.

WhatsApp: +905447693163

Çerez İzinleri

Deneyiminizi iyileştirmek için çerezler kullanıyoruz. Zorunlu çerezler her zaman açıktır. Diğerleri için izninize ihtiyaç var.

Daha fazla bilgi için Çerez Politikası.

KolayMiles — Earn Rewards. Pay Smarter.