API Documentation
Welcome to the Smart CloudPay API. Our RESTful API allows you to accept crypto payments, manage invoices, and automate payouts directly from your application.
Base URL
https://pay.easysoftech.com/api
Authentication
Authenticate your requests by including your API Key and Merchant ID in the headers. You can generate keys in the Merchant Dashboard under Settings > API Keys.
curl -X POST https://pay.easysoftech.com/api/invoice \
-H "x-api-key: sk_123456789" \
-H "merchant_id: MERCHANT_ID_123"
Create Invoice
Generates a new payment invoice with a unique address and QR code.
Body Parameters
| Field | Type | Required | Description |
|---|---|---|---|
| amount | Number | Yes* | Amount of crypto. Required unless `totalusd` is set. |
| totalusd | Number | No | USD Value. If set, `amount` is auto-calculated. |
| currency | String | Yes | Symbol (USDT, BTC, ETH, TRX) |
| network | String | No | Network code (evm, bsc, tron). Default: evm |
| customer_name | String | Yes | For identification |
| notification_emails | String | Yes | Comma-separated ID/emails for notifications. |
| callback_url | String | No | Webhook URL for status updates |
| priority | String | No | Transaction priority (low, medium, high) |
Example Request
{
"amount": "50.00",
"currency": "USDT",
"network": "TRON",
"customer_name": "John Doe",
"notification_emails": "[email protected]",
"callback_url": "https://mysite.com/hook",
"priority": "high"
}
Get Invoice Details
Retrieve the status using the Invoice ID.
GET /api/invoice/{id}
Bulk Payout
Process multiple payouts in a single batch. Requires sufficient balance.
Example Payload
{
"auto_confirm": true,
"items": [
{
"address": "TR7NHq...",
"amount": "100",
"id": "REF_001"
},
{
"address": "0x123...",
"amount": "0.5",
"id": "REF_002"
}
]
}
{
"auto_confirm": true,
"items": [
{
"address": "TR7NHq...",
"amount": "100",
"id": "REF_001"
},
{
"address": "0x123...",
"amount": "0.5",
"id": "REF_002"
}
]
}
POST /api/user/payouts/bulk/api
Payout History
Retrieve a paginated list of your past payouts.
GET /api/payout/history?page=1&limit=20
Get Wallet Balance
Check the balance of your configured Master Wallet for a specific network.
Query Parameters
| Field | Required | Description |
|---|---|---|
| network | Yes | Network code (evm, bsc, polygon, tron) |
| token_address | No | Contract address (Leave empty for Native Coin) |
GET /api/user/balance?network=evm
Webhook Integration
We send a POST request to your `callback_url` whenever an invoice status changes (e.g. from `pending` to `paid` or `expired`).
Payload Structure
{
"status": "paid",
"invoice_id": "INV-123",
"amount": "10.00",
"currency": "USDT",
"tx_hash": "0xabc...",
"address_in": "0xwallet...",
"received_amount": "10.00"
}
PHP Example
<?php
// Read JSON Payload
$json = file_get_contents('php://input');
$data = json_decode($json, true);
if ($data['status'] == 'paid') {
$invoiceId = $data['invoice_id'];
// TODO: Mark order as complete in your DB
file_put_contents('payment_logs.txt', "Paid: $invoiceId\n", FILE_APPEND);
}
http_response_code(200);
?>