Starex Pay is a payment page. You redirect the customer to it with an order number and an amount, and they pick a payment method and pay. Starex Pay handles everything related to payment systems — all you have to do is build one link and implement two endpoints.
PAY_URL and SECRET_KEY are issued by Starex; you give
Starex your prepare and complete URLs.
| Item | Description |
|---|---|
PAY_URL | Base URL of the payment page |
SECRET_KEY | Secret key for signatures — used only on the server side |
prepare URL | Order validation endpoint |
complete URL | Payment confirmation endpoint |
requests in green go to your endpoints; everything else is handled by Starex Pay.
GET
{PAY_URL}/checkout
| Parameter | Type | Description |
|---|---|---|
order_id | string | Order number in your system |
amount | integer | Payment amount (in tiyin) |
sign | string | Verification string (SHA-256):sha256(order_id + amount + SECRET_KEY) |
From this link the customer picks a payment method, pays in the payment system and returns to the result page.
$sign = hash('sha256', $orderId . $amount . $secretKey);
$link = $payUrl . '/checkout?' . http_build_query([
'order_id' => $orderId,
'amount' => $amount,
'sign' => $sign,
]);
header('Location: ' . $link);
const sign = crypto.createHash('sha256')
.update(`${orderId}${amount}${secretKey}`).digest('hex');
const link = `${payUrl}/checkout?` + new URLSearchParams({
order_id: orderId, amount: String(amount), sign,
});
res.redirect(link);
sign = hashlib.sha256(f"{order_id}{amount}{secret_key}".encode()).hexdigest()
link = f"{pay_url}/checkout?" + urlencode({
"order_id": order_id, "amount": amount, "sign": sign,
})
order_id for every payment.
Both requests are sent with POST and a JSON body. The response must
return HTTP 200 within 10 seconds.
POST
{YOUR_PREPARE_URL}
{
"ext_trans_id": 1042,
"ext_payment_id": 3311,
"order_id": "A-10245",
"amount": 4500000,
"action": 0,
"sign_time": "2026-07-28 14:05:21",
"sign_string": "9c2f...b81d"
}
| Field | Type | Description |
|---|---|---|
ext_trans_id | integer | Payment number in the Starex Pay system |
ext_payment_id | integer | Transaction number in the Starex Pay system |
order_id | string | Order number in your system |
amount | integer | Payment amount (in tiyin) |
action | integer | Action being performed. 0 — Prepare |
sign_time | string | Request time. Format YYYY-MM-DD HH:MM:SS |
sign_string | string | Verification string (SHA-256):sha256(ext_trans_id + SECRET_KEY + order_id + amount + action + sign_time) |
{
"error": 0,
"error_note": "OK",
"prepare_id": "778812"
}
| Field | Type | Description |
|---|---|---|
error | integer | Operation result. 0 — success |
error_note | string | Result description |
prepare_id | string | Payment identifier in your system |
POST
{YOUR_COMPLETE_URL}
{
"ext_trans_id": 1042,
"ext_payment_id": 3311,
"order_id": "A-10245",
"prepare_id": "778812",
"amount": 4500000,
"action": 1,
"sign_time": "2026-07-28 14:07:03",
"sign_string": "1ae4...7c02"
}
| Field | Type | Description |
|---|---|---|
ext_trans_id | integer | Payment number in the Starex Pay system |
ext_payment_id | integer | Transaction number in the Starex Pay system |
order_id | string | Order number in your system |
prepare_id | string | Payment identifier in your system, returned in the response to the prepare request |
amount | integer | Payment amount (in tiyin) |
action | integer | Action being performed. 1 — Complete |
sign_time | string | Request time. Format YYYY-MM-DD HH:MM:SS |
sign_string | string | Verification string (SHA-256):sha256(ext_trans_id + SECRET_KEY + order_id + prepare_id + amount + action + sign_time) |
{
"error": 0,
"error_note": "OK",
"confirm_id": "990145"
}
| Field | Type | Description |
|---|---|---|
error | integer | Operation result. 0 — success |
error_note | string | Result description |
confirm_id | string | Confirmation identifier in your system |
An error returned in the complete response marks the payment as
failed.
| Code | Message shown to the customer | When to return it |
|---|---|---|
0 | Operation completed successfully | Everything is fine |
-1 | Payment verification failed | sign_string did not match |
-2 | Payment amount is incorrect | amount does not equal the order amount |
-3 | Requested operation is not available | Unknown action value |
-4 | This order has already been paid | Repeated payment attempt |
-5 | Order not found | No order for this order_id |
-6 | Transaction not found | No payment for this prepare_id |
-7 | Failed to update the order, please try again | Internal failure |
-8 | Invalid payment request | A required field is missing |
-9 | This transaction has already been cancelled | Attempt to continue a cancelled payment |
A code that is not in this list is treated as a failed payment.