PayKLY SDK Documentation

Integrate PayKLY into your platform with our simple API

Quick Start
Get started with PayKLY in minutes

Installation

npm install @paykly/sdk

# or

yarn add @paykly/sdk

Basic Usage

import { PayKLY } from '@paykly/sdk';

const payKLY = new PayKLY({
  apiKey: 'your-api-key',
  network: 'bsc' // or 'polygon'
});

// Initialize payment
const payment = await payKLY.createPayment({
  amount: '100.00',
  currency: 'USD',
  description: 'Product purchase'
});

API Endpoints

DEPRECATED
POST
/api/payments/create
⚠️ This endpoint is deprecated. Use POST /api/x402/charge instead.

Deprecated Endpoint

This endpoint is no longer available. For creating payments, use the x402 protocol endpoint:

POST /api/x402/charge
{
  "payer": "0x...",
  "merchant": "0x...",
  "asset": "USDT",
  "amount": 100.00,
  "metadata": {
    "description": "Product purchase"
  }
}
GET
/api/payments/{paymentId}
Check the status of a payment from the database

Path Parameters

paymentId can be:

  • Transaction hash (blockchain transaction ID)
  • Purchase UUID (database record ID)
  • Wallet address (returns latest purchase for that wallet)

Response

{
  "paymentId": "uuid-here",
  "transactionHash": "0x...",
  "walletAddress": "0x...",
  "amount": 100.00,
  "currency": "USD",
  "status": "completed",
  "tokensPurchased": "1000.00",
  "paymentMethod": "BNB",
  "phase": 1,
  "bonusPercentage": 10,
  "completedAt": "2024-01-01T12:00:00Z",
  "email": "user@example.com"
}

Note: This endpoint queries the purchases table. For x402 payments not yet recorded in the database, check the x402 service or blockchain directly.

Features
Instant Settlement
Payments settle in seconds on the blockchain
Low Fees
Only 0.1% x402 protocol fee
Webhook Support
Real-time payment notifications
Multiple Networks
Support for BSC and Polygon

Full documentation and SDK packages coming soon. For now, contact us at dev@klycoin.io for integration support.

WhatsApp: +905447693163

Cookie Preferences

We use cookies to improve your experience. Strictly necessary cookies are always on. Others require your consent.

See our Cookie Policy for details.