Integrate SmartPay into your site in minutes with REST API, webhooks, and payment links.
All API calls (except invoice creation) require the header:
X-Api-Key: spk_your_api_key
Copy the API key from Dashboard → Settings.
Creates an invoice and returns the payment page URL.
| Parameter | Type | Required | Description |
|---|---|---|---|
| merchant_id | string | ✔ | Your merchant UUID |
| amount | float | ✔ | Charge amount |
| currency | string | ✔ | Currency code (UZS, USD, EUR...) |
| order_id | string | ✔ | Unique order identifier on your side |
| sign | string | ✔ | SHA256 signature (see below) |
| description | string | — | Payment description |
| success_url | string | — | Redirect URL on success |
| fail_url | string | — | Redirect URL on failure |
| webhook_url | string | — | Override webhook URL for this invoice |
| lang | string | — | Payment page language (ru/uz/en) |
| string | — | Customer email for notifications | |
| user_data | string | — | Vendor data visible in dashboard |
sign = SHA256(merchant_id:amount:currency:secret_key1:order_id)
// PHP example
$sign = hash('sha256',
$merchant_id.':'.$amount.':'.$currency.':'.$secret_key1.':'.$order_id
);
{
"type": "success",
"invoice_id": "SP3a7f...",
"url": "https://your-domain.com/pay/?id=SP3a7f...",
"amount": 50000,
"currency": "UZS",
"order_id": "ORD-123",
"expires_at": "2024-01-01 12:00:00"
}
Requires X-Api-Key and invoice_id parameters.
{
"type": "success",
"invoice_id": "SP3a7f...",
"order_id": "ORD-123",
"amount": 50000,
"currency": "UZS",
"status": "paid",
"paid_at": "2024-01-01 11:45:00"
}
Possible statuses: pending, awaiting, checking, paid, rejected, expired.
GET /api/methods returns all active cashiers for your merchant.
SmartPay will POST to your webhook URL every time a payment status changes.
POST https://yoursite.com/webhook Content-Type: application/x-www-form-urlencoded invoice_id=SP3a7f...&order_id=ORD-123&amount=50000¤cy=UZS&status=paid&sign=SHA256...
sign = SHA256(sorted_values_joined_colon + ":" + secret_key2).
$data = ['invoice_id'=>..., 'order_id'=>..., 'amount'=>..., 'currency'=>..., 'status'=>...];
ksort($data);
$sign = hash('sha256', implode(':', array_values($data)).':'.$secret_key2);