code

Code Examples

Quick integration examples in multiple languages to get you started.

Create & check payment
JavaScript
// Create a payment
const response = await fetch('https://api.paycrypt.io/payment/create', {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    'Authorization': 'Bearer sk_live_YOUR_KEY',
  },
  body: JSON.stringify({
    network: 'ethereum',
    coin: 'USDT',
    amount: 25.00,
    currency: 'USD',
    customer_email: 'buyer@example.com',
  }),
});

const payment = await response.json();
console.log('Deposit address:', payment.deposit_address);
console.log('Payment ID:', payment.payment_id);
console.log('Expires at:', payment.expires_at);

// Check payment status
const status = await fetch(
  `https://api.paycrypt.io/payment/status?payment_id=${payment.payment_id}`,
  { headers: { 'Authorization': 'Bearer sk_live_YOUR_KEY' } }
).then(r => r.json());

console.log('Status:', status.status);

Ready to integrate?

Create your account, get an API key, and start accepting crypto payments in minutes.