Integrate KolayMiles rewards in your application with just a few lines of code
npm install payklyimport { PayKLYFacilitator } from 'paykly';
const paykly = new PayKLYFacilitator({
facilitatorAddress: '0x...',
merchantId: 'your-merchant-id'
});const payment = await paykly.createPayment({
amount: 50,
currency: 'USDT',
orderId: 'order_123',
description: 'Product purchase'
});Everything you need to integrate crypto payments with mil rewards
Complete REST API documentation for integrating KolayMiles
{
"payer": "0x742d35Cc...",
"merchant": "0x8ba1f109...",
"asset": "USDC",
"amount": 10.50,
"metadata": {
"receiptId": "ORDER-123",
"description": "Product purchase"
}
}{
"ok": true,
"x402Id": "402-ORDER-123-abc",
"expires_in": 300,
"signature": "0x...",
"status": "pending"
}Real-world examples for common integration scenarios
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 };
}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');
});Everything you need to build with KolayMiles
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ı.