توثيق PayLink SY APIPayLink SY API reference
أنشئ فاتورة، اعرض للزبون المبلغ والعنوان، واستعلم عن الحالة أو استقبل Webhook حتى تصير paid. كل الطلبات والردود JSON بصيغة موحّدة.Create an invoice, show the customer the amount and address, then poll its status or receive a webhook until it becomes paid. All requests and responses use one JSON envelope.
https://paylinksy.com/api/index.phpالبدء السريعQuick start
service وamount وto_address، واعرض للزبون pay_amount وdisplay_to.Send service, amount and to_address, then show the customer pay_amount and display_to.paid، أو فعّل Webhook ليصلك الإشعار فوراً.Poll every 5 seconds until paid, or enable a webhook to be notified instantly.المصادقةAuthentication
أرسل مفتاحك في ترويسة X-Api-Key مع كل طلب. المفتاح يُقبل من الترويسة فقط ولا يُرسل في الرابط. استخدمه من خادمك فقط، ولا تضعه في كود الصفحة أو داخل تطبيق موبايل.Send your key in the X-Api-Key header with every request. It is accepted from the header only, never the URL. Use it from your server only — never in browser code or a mobile app.
X-Api-Key: YOUR_API_KEY
شكل الردResponse format
كل الردود بنفس الغلاف: نجاح فيه data، وفشل فيه error.code وerror.message. اعتمد على code في منطق برنامجك، وmessage للعرض فقط.Every reply uses the same envelope: success carries data, failure carries error.code and error.message. Branch on code; use message for display only.
{
"success": true,
"data": { ... }
}{
"success": false,
"error": {
"code": "amount_reserved",
"message": "...",
"reserved_minutes": 12
}
}رموز الأخطاءError codes
| code | HTTP | المعنىMeaning |
|---|---|---|
missing_key | 401 | المفتاح مفقود من الترويسةAPI key missing from the header |
invalid_key | 403 | مفتاح غير صالح أو ملغىUnknown or revoked key |
key_suspended | 403 | الـ API موقوف لهذا الحسابAPI access is suspended for this account |
payer_not_bound | 409 | شام كاش: هذا الزبون غير مربوط بحساب بعد — اربطه أولاً أو أرسل الفاتورة بدون customer_idSham Cash: this customer has no linked account yet — bind it first or omit customer_id |
payer_already_bound | 409 | شام كاش: الزبون مربوط بحساب آخر — فك الربط أولاًSham Cash: customer is bound to another account — unbind first |
address_not_found | 404 | شام كاش: لا يوجد حساب بهذا العنوانSham Cash: no account with this address |
api_not_approved | 403 | الـ API غير مفعّل لهذا الحساب بعد — تواصل مع الإدارةAPI not yet enabled for this account — contact support |
subscription_expired | 402 | انتهى اشتراك الحسابAccount subscription has expired |
subscription_suspended | 402 | اشتراك الوسيلة موقوف لنفاد الرصيدMethod suspended for insufficient balance |
subscription_stopped | 402 | الوسيلة غير مفعّلة أو انتهت مدتها/تجربتها — فعّلها أو جدّدها من اللوحةMethod not activated, or its period/trial ended — activate or renew it in the dashboard |
rate_limited | 429 | تجاوز حدّ الطلبات (مع retry_after)Too many requests (includes retry_after) |
invalid_service | 400 | خدمة غير مدعومةUnsupported service |
invalid_param | 400 | أُرسل باراميتر كمصفوفة بدل قيمة نصية (مثل amount[]=1)، أو metadata أكبر من 8 كيلوبايت، أو verify_mode غير صالح لهذه الوسيلةA parameter was sent as an array instead of a plain value (e.g. amount[]=1), metadata is larger than 8 KB, or verify_mode is invalid for this method |
invalid_amount | 400 | مبلغ غير صالح. أرسله رقماً أكبر من صفر بصيغة مثل 10 أو 10.50 — بلا فواصل آلاف أو رموز (1,500 مرفوض)Invalid amount. Send a number greater than zero such as 10 or 10.50 — no thousands separators or symbols (1,500 is rejected) |
invalid_network | 400 | شبكة أو عملة غير صالحةInvalid network or currency |
missing_param | 400 | باراميتر مطلوب ناقصA required parameter is missing |
address_not_registered | 403 | العنوان أو الحساب غير مضاف في حسابكAddress/account is not added to your account |
method_not_linked | 400 | لا يوجد حساب Binance بهذا الـ Pay IDNo Binance account with this Pay ID |
invalid_webhook_url | 400 | webhook_url غير مقبول (ليس https، أو يشير لعنوان داخلي، أو النطاق غير موجود)webhook_url rejected (not https, points to an internal address, or the domain does not resolve) |
relink_required | 409 | حساب سيريتل كاش يحتاج إعادة ربط من اللوحةThe Syriatel Cash account needs relinking from the panel |
pin_required | 409 | رقم سيريتل كاش يحتاج إعادة تأكيد PIN من اللوحةThe Syriatel Cash number needs its PIN re-confirmed in the panel |
provider_error | 502 | تعذّر إنشاء رابط الدفع من كذا واليتKazawallet could not create the payment link |
display_to_missing | 409 | عنوان الاستلام لحساب شام كاش غير متوفّر بعدSham Cash receiving address not available yet |
amount_reserved | 409 | كل المبالغ المميّزة القريبة مشغولة (نادر) — مع reserved_minutesAll nearby unique amounts are busy (rare) — includes reserved_minutes |
busy | 409 | طلب آخر قيد التنفيذ على نفس الحساب أو نفس order_id — أعد المحاولة بعد ثوانٍAnother request is in progress for the same account or order_id — retry in a few seconds |
invoice_paid | 409 | لا يمكن إلغاء فاتورة مدفوعة، أو أُرسل رقم عملية لفاتورة مدفوعة برقم آخرA paid invoice cannot be cancelled, or a number was submitted for an invoice already paid with another one |
tx_ref_required | 400 | رقم العملية فارغ أو غير صالح — إرسال رقم العمليةEmpty or invalid transaction number — submit |
tx_not_found | 404 | رقم العملية غير موجود في الحوالات الواردة (بعد)Transaction number not found among incoming transfers (yet) |
amount_mismatch | 422 | مبلغ العملية لا يطابق pay_amountTransfer amount differs from pay_amount |
currency_mismatch | 422 | عملة العملية لا تطابق عملة الطلبTransfer currency differs from the order currency |
tx_already_used | 409 | رقم العملية مستخدم لطلب آخرTransaction number already used for another order |
tx_before_invoice | 422 | العملية أقدم من إنشاء الطلبTransfer is older than the order |
tx_after_expiry | 422 | العملية بعد انتهاء مدة الطلبTransfer was made after the order expired |
payer_mismatch | 422 | شام كاش: العملية ليست من حساب الزبون المربوطSham Cash: transfer is not from the bound customer account |
invoice_expired | 410 | انتهت مدة الطلب (ومهلة السماح)The order (and its grace period) has expired |
invoice_cancelled | 410 | الطلب ملغىThe order was cancelled |
too_many_attempts | 429 | أرقام عمليات خاطئة كثيرة لهذه الفاتورةToo many wrong transaction numbers for this invoice |
provider_unavailable | 503 | مزوّد الدفع لا يستجيب الآن، أو (شام كاش مع customer_id) لم يكتمل التحقق من حساب المرسل بعد — أعد المحاولة بعد دقيقةThe payment provider is not responding right now, or (Sham Cash with customer_id) the sender account check has not finished yet — retry in a minute |
not_supported | 400 | التحقق برقم العملية غير متاح لهذه الفاتورةTransaction-number verification is not available for this invoice |
not_found | 404 | غير موجودNot found |
method_not_allowed | 405 | طريقة HTTP خاطئةWrong HTTP method |
maintenance | 503 | الموقع تحت الصيانةUnder maintenance |
service_unavailable | 503 | الخدمة متوقفة مؤقتاًService temporarily unavailable |
server_error | 500 | خطأ في الخادمInternal server error |
حدّ الطلباتRate limits
300 طلب في الدقيقة لكل مفتاح — يكفي للاستعلام عن عدّة فواتير كل 5 ثوانٍ. كل رد يحمل الترويسات التالية، وعند التجاوز يرجع 429 مع Retry-After.300 requests per minute per key — enough to poll several invoices every 5 seconds. Every reply carries these headers; when exceeded you get 429 with Retry-After.
X-RateLimit-Limit: 300 X-RateLimit-Remaining: 299 X-RateLimit-Reset: 42
ربط وسائل الدفعLinking payment methods
تربط كل وسيلة مرة واحدة من لوحتك، ثم تستخدمها في الـ API بإرسال service وto_address المناسبَين. تصل الأموال إلى حسابك أنت مباشرة — نحن نتحقّق من وصولها فقط.Link each method once from your dashboard, then use it in the API by sending the matching service and to_address. Funds go straight to your own account — we only verify that they arrived.
| الوسيلةMethod | الربط من اللوحةLinking in the dashboard | service · network | to_address | ما تعرضه للزبونShow the customer | المهلةWindow |
|---|---|---|---|---|---|
| USDT | الصق عنوان محفظتك (BEP20 يبدأ بـ 0x، TRC20 يبدأ بـ T).Paste your wallet address (BEP20 starts with 0x, TRC20 with T). | usdt · bep20/trc20 | عنوان المحفظةWallet address | pay_amount + display_to + الشبكةnetwork | 20 دقيقة20 min |
| Binance Pay | أدخل Pay ID وAPI Key وSecret Key من حسابك في Binance. المفتاح يجب أن يكون بصلاحية القراءة فقط (Enable Reading) — مفتاح يملك السحب أو التداول يُرفض.Enter your Pay ID, API Key and Secret Key from Binance. The key must be read-only (Enable Reading) — a key that can withdraw or trade is rejected. | binance | Pay ID | pay_amount + Pay ID | 20 دقيقة20 min |
| شام كاشSham Cash | اضغط «ربط حساب» وامسح رمز QR من تطبيق شام كاش (الأجهزة المرتبطة).Press “Link account” and scan the QR from the Sham Cash app (Linked devices). | shamcash · syp/usd | acc_… | pay_amount + display_to (عنوان الاستلام + QR)(receiving address + QR) | 20 دقيقة20 min |
| سيريتل كاشSyriatel Cash | رقم الدخول إلى «أقرب إليك» وكلمة سره، ثم رمز SMS، ثم فعّل كل رقم برمز PIN الخاص به.Your “Aqrab Elik” login number and password, then the SMS code, then enable each number with its PIN. | syriatel · syp | الرقم المفعّلThe enabled number | pay_amount + الرقم + pay_codenumber + pay_code | 30 دقيقة (+30 للدفعات المتأخرة)30 min (+30 for late payments) |
| كذا واليتKazawallet | إيميل حساب التاجر + API Key + API Secret من كذا واليت، ثم ضع رابط الإشعار الذي نعطيك إيّاه في إعداداتهم.Merchant account email + API Key + API Secret from Kazawallet, then paste the notification URL we give you into their settings. | kazawallet · أي عملةany currency | إيميل الحساب (اختياري)Account email (optional) | افتح له pay_urlOpen pay_url for them | 30 دقيقة30 min |
الاشتراك: لكل وسيلة مربوطة اشتراك شهري. في شام كاش وسيريتل كاش تختار بعد الربط: تجربة مجانية 24 ساعة (مرة واحدة لكل حساب أو رقم) أو تفعيل الاشتراك. الوسيلة غير المفعّلة أو المنتهية ترجع الخطأ subscription_stopped — فعّلها من اللوحة.Subscription: every linked method has a monthly subscription. For Sham Cash and Syriatel Cash you choose after linking: a 24-hour free trial (once per account or number) or activate the subscription. A method that is not activated or has ended returns subscription_stopped — activate it from the dashboard.
المبلغ المميّز (pay_amount)Unique amount (pay_amount)
pay_amount للزبون — وليس amountShow pay_amount to the customer — not amount
كل فاتورة فعّالة على نفس العنوان تأخذ مبلغاً فريداً حتى نعرف أيّ تحويل لأيّ طلب بدون رقم عملية. الطلب الأول = المبلغ نفسه، والثاني + خطوة، وهكذا. التحويل بمبلغ مختلف عن pay_amount لن يُطابَق.Every active invoice on the same address gets a unique amount so we can match each transfer to its order without a transaction ID. The first is the amount itself, the second + one step, and so on. A transfer that differs from pay_amount will not match.
| الوسيلةMethod | الخطوةStep | مثال لطلبات متزامنةConcurrent example |
|---|---|---|
| USDT · TRC20 / BEP20 | 0.01 | 100 → 100.01 → 100.02 |
| Binance Pay | 0.01 | 100 → 100.01 → 100.02 |
| شام كاش دولارSham Cash USD | 0.01 | 50 → 50.01 → 50.02 |
| شام كاش ليرة / سيريتل كاشSham Cash SYP / Syriatel Cash | 1 | 10000 → 10001 → 10002 |
ليس عمولة: الفرق للتمييز فقط ويصل لحسابك. أقصى فرق 99 خطوة (0.99$ أو 99 ل.س). أضِف للزبون amount (سعر الطلب)، واعرض له pay_amount للتحويل.Not a fee: the difference only distinguishes orders and lands in your account. Max 99 steps (0.99 USD or 99 SYP). Credit the customer amount (the order price) and ask them to transfer pay_amount.
طريقة التحقق: بلا رقم أو برقم العمليةVerification mode: automatic or transaction number
تختار عند إنشاء كل فاتورة عبر verify_mode:You choose per invoice with verify_mode:
| verify_mode | كيف تتأكد الفاتورةHow the invoice is confirmed |
|---|---|
auto (الافتراضي)(default) | بلا رقم عملية: نطابق المبلغ المميّز تلقائياً خلال ثوانٍ من وصول الحوالة. الزبون لا يُدخل شيئاً.No transaction number: we match the unique amount automatically within seconds of the transfer. The customer enters nothing. |
tx_ref | رقم العملية مطلوب: لا تتأكد الفاتورة إلا بعد أن يُدخل الزبون رقم عمليته (أو هاش التحويل لـ USDT) وترسله إلينا عبر إرسال رقم العملية، ونجده في الحوالات الواردة بالمبلغ الصحيح وبعد إنشاء الطلب. المبلغ يبقى كما هو في الغالب (يُضاف فرق صغير فقط إذا تصادف مع فاتورة تلقائية معلّقة على نفس الحساب).Transaction number required: the invoice is confirmed only after the customer enters their transaction number (or transfer hash for USDT), you send it to submit, and we find it among incoming transfers with the right amount, made after the order was created. The amount usually stays exact (a small offset is added only if it collides with a pending automatic invoice on the same account). |
متاح لـ usdt وbinance وshamcash وsyriatel. لا يُستخدم مع كذا واليت. حوالة أقدم من إنشاء الطلب بأكثر من دقيقة لا تُقبل أبداً.Available for usdt, binance, shamcash and syriatel. Not available for Kazawallet. A transfer made more than one minute before the order was created is never accepted.
مع customer_id (شام كاش): tx_ref يضيف الشرطين معاً — لا تتأكد الفاتورة إلا عندما يُرسل الزبون رقم العملية، وتكون الحوالة من حساب شام كاش الموثّق المربوط به. رقم صحيح من حساب آخر يُرفض بـ payer_mismatch. أما auto مع customer_id فيبقى تأكيداً تلقائياً من حساب الزبون بلا رقم.With customer_id (Sham Cash): tx_ref requires both — the invoice is confirmed only when the customer submits the transaction number and the transfer came from the verified Sham Cash account bound to them. A correct number from another account is rejected with payer_mismatch. auto with customer_id stays automatic confirmation from the customer's account, with no number.
في صفحة الدفع: اعرض خانة «رقم العملية» وزر تأكيد؛ وعند الخطأ اعرض error.message فوق الخانة كما هو — الرسالة مكتوبة للزبون وتختلف حسب السبب.On your checkout page: show a “transaction number” field and a confirm button; on error show error.message above the field as is — it is written for the customer and depends on the cause.
pay_to و display_topay_to vs display_to
| الحقلField | معناهMeaning | USDT | Binance | شام كاشSham Cash | سيريتل كاشSyriatel Cash | كذا واليتKazawallet |
|---|---|---|---|---|---|---|
to_address / pay_to | معرّف الربط البرمجي (ترسله لنا)Integration identifier (you send it) | عنوان المحفظةWallet address | Pay ID | acc_… | الرقم 09xxxxxxxxThe number 09xxxxxxxx | إيميل الحسابAccount email |
display_to | ما يحوّل عليه الزبونWhat the customer pays to | نفسهSame | نفسهSame | عنوان الاستلام (نص + باركود)Receiving address (text + QR) | الرقم + pay_codeNumber + pay_code | رابط الدفع pay_urlPayment link pay_url |
في USDT وBinance القيمتان متطابقتان. في شام كاش pay_to معرّف داخلي لا يعرفه التطبيق، فاعرض display_to دائماً (مع display_name للتطمين). في كذا واليت لا يحوّل الزبون إلى عنوان، بل تفتح له رابط الدفع.For USDT and Binance both values match. For Sham Cash pay_to is an internal ID the app does not know, so always display display_to (and display_name for reassurance). For Kazawallet the customer does not transfer to an address — you open the payment link for them.
سيريتل كاشSyriatel Cash
فعّل رقمك من صفحة سيريتل كاش في اللوحة، ثم أنشئ الفاتورة بـ service=syriatel وto_address = الرقم المفعّل. يحوّل الزبون pay_amount بالليرة إلى الرقم (display_to) أو إلى كود الدفع (pay_code) — الطريقتان تُؤكَّدان بالطريقة نفسها.Enable your number on the Syriatel Cash page in the panel, then create the invoice with service=syriatel and to_address = the enabled number. The customer sends pay_amount in SYP to the number (display_to) or to the payment code (pay_code) — both are confirmed the same way.
| الحقلField | القيمةValue |
|---|---|
service | syriatel |
to_address | رقم سيريتل كاش المفعّل (09xxxxxxxx)The enabled Syriatel Cash number (09xxxxxxxx) |
network / currency | syp / SYP (تلقائياً)(automatic) |
display_to · pay_code | الرقم وكود الدفع — اعرضهما للزبونThe number and payment code — show both to the customer |
| المهلةWindow | 30 دقيقة، وتُقبل الدفعة المتأخرة حتى 30 دقيقة بعد الانتهاء30 minutes; late payments are accepted up to 30 minutes after expiry |
سرعة التأكيد: عادةً 30 إلى 60 ثانية، وقد تتأخر أحياناً بسبب ضغط شبكة سيريتل (خاصةً مساءً). أبقِ الاستعلام أو الـ Webhook يعمل حتى نهاية المهلة، ولا تُلغِ الطلب فور انتهائها — قد تصل الدفعة متأخرة فتصبح الفاتورة paid ويصلك الـ Webhook.Confirmation speed: usually 30–60 seconds, occasionally longer when the Syriatel network is congested (especially evenings). Keep polling or rely on the webhook until the window ends, and do not cancel the order right at expiry — a late payment can still turn the invoice paid and fire your webhook.
كذا واليت — رابط دفعKazawallet — payment link
كذا واليت تعمل برابط دفع بدل التحويل على عنوان: أنشئ الفاتورة بـ service=kazawallet، ونرجّع لك pay_url — حوّل زبونك إليه، فيدفع من حسابه بكذا واليت وتصل الأموال لحسابك مباشرة. لا يوجد مبلغ مميّز هنا: pay_amount = amount.Kazawallet works with a payment link instead of a transfer address: create the invoice with service=kazawallet and we return a pay_url — redirect your customer to it; they pay from their Kazawallet account and the funds land in yours. No unique amount here: pay_amount = amount.
| الحقلField | القيمةValue |
|---|---|
service | kazawallet |
currency | أي رمز عملة من 3 أحرف (مثلAny 3-letter currency code (e.g. USD، SYP) — افتراضيdefault USD |
to_address | إيميل حساب التاجر المربوط (اختياري إن كان لديك حساب واحد)The linked merchant account email (optional with a single account) |
redirect_url | اختياري — أين يعود الزبون بعد الدفعOptional — where the customer returns after paying |
pay_url / display_to | رابط الدفع — افتحه للزبونThe payment link — open it for the customer |
التأكيد يصلنا من كذا واليت لحظة الدفع، فتصير الفاتورة paid ويصلك Webhook كالعادة. إذا دفع الزبون بعد expires_at تُقبل الدفعة وتتحوّل الفاتورة إلى paid.Kazawallet notifies us the moment the customer pays, the invoice becomes paid and your webhook fires as usual. A payment made after expires_at is still accepted and the invoice becomes paid.
curl -X POST "https://paylinksy.com/api/index.php?resource=invoice&action=create" \
-H "X-Api-Key: YOUR_API_KEY" \
-d "service=kazawallet" \
-d "currency=USD" \
-d "amount=25" \
-d 'metadata={"order_id":"1050"}' \
-d "redirect_url=https://store.com/thanks"<?php
$ch = curl_init("https://paylinksy.com/api/index.php?resource=invoice&action=create");
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => ["X-Api-Key: YOUR_API_KEY"],
CURLOPT_POST => true,
CURLOPT_POSTFIELDS => http_build_query([
'service' => 'kazawallet',
'currency' => 'USD',
'amount' => '25',
'metadata' => '{"order_id":"1050"}',
'redirect_url' => 'https://store.com/thanks',
]),
]);
$res = json_decode(curl_exec($ch), true);
curl_close($ch);
if (!$res['success']) {
echo $res['error']['code'];
}import requests
url = "https://paylinksy.com/api/index.php"
headers = {"X-Api-Key": "YOUR_API_KEY"}
params = {"resource": "invoice", "action": "create"}
data = {
"service": 'kazawallet',
"currency": 'USD',
"amount": '25',
"metadata": '{"order_id":"1050"}',
"redirect_url": 'https://store.com/thanks'
}
r = requests.post(url, params=params, data=data, headers=headers, timeout=30)
print(r.json())const res = await fetch("https://paylinksy.com/api/index.php?resource=invoice&action=create", {
method: "POST",
headers: { "X-Api-Key": process.env.PAYLINK_KEY },
body: new URLSearchParams({
"service": 'kazawallet',
"currency": 'USD',
"amount": '25',
"metadata": '{"order_id":"1050"}',
"redirect_url": 'https://store.com/thanks',
})
});
const data = await res.json();
console.log(data);دليل الربط الصحيحIntegration checklist
| الموضوعTopic | ماذا تفعلWhat to do |
|---|---|
| تأكيد الدفعConfirming payment | اعتمد فقط على status = paid من خادمك. paid نهائية — أضِف الطلب مرة واحدة بالاعتماد على public_ref.Trust only status = paid fetched by your server. paid is final — fulfil once per public_ref. |
| الاستعلامPolling | كل 5 ثوانٍ طالما pending، وتوقّف عندما يصبح is_final = true (paid أو cancelled، أو expired بعد مهلة السماح). أثناء مهلة السماح يكفي استعلام كل 30–60 ثانية، أو اعتمد على الـ Webhook.Every 5 s while pending; stop once is_final = true (paid, cancelled, or expired after the grace period). During the grace period polling every 30–60 s is enough — or rely on the webhook. |
| انتهاء المدّةExpiry | بعد expires_at أخفِ بيانات الدفع عن الزبون وأنشئ فاتورة جديدة إن أراد المحاولة. لكن دفعة أُرسلت قبل الانتهاء ووصلت متأخرة تُقبل حتى 30 دقيقة بعده (grace_until) فتتحوّل الفاتورة من expired إلى paid ويصلك إشعارها — لا تعتبر الطلب ملغى نهائياً قبل is_final = true.After expires_at hide the payment details and create a new invoice if the customer retries. A payment sent before expiry that arrives late is still accepted for 30 minutes (grace_until): the invoice moves from expired to paid and you get its webhook — do not treat the order as dead until is_final = true. |
| رسوم السحب (كريبتو)Withdrawal fees (crypto) | يجب أن يكون المبلغ المستلَم = pay_amount. نبّه زبونك أن بعض المنصّات تخصم الرسوم من المبلغ.The received amount must equal pay_amount. Warn customers that some exchanges deduct fees from the amount. |
| الشبكةNetwork | تحويل USDT على شبكة غير المحدّدة لن يُطابَق.USDT sent on a different network will not match. |
| عدّة مواقع بنفس المفتاحSeveral sites, one key | ضع بادئة مختلفة لكل موقع في order_id (site1-…).Prefix order_id per site (site1-…). |
| الأوقاتTimestamps | ISO-8601 مع المنطقة الزمنية، واستخدم expires_in للعدّاد.ISO-8601 with timezone; use expires_in for countdowns. |
نقاط النهايةEndpoints
POST?resource=invoice&action=createإنشاء فاتورةCreate an invoice⌄
ينشئ فاتورة بمبلغ مميّز ونافذة صلاحية (20 دقيقة افتراضياً). إرسال نفس metadata.order_id مرة ثانية يُرجع نفس الفاتورة.Creates an invoice with a unique amount and a validity window (20 min by default). Re-sending the same metadata.order_id returns the same invoice.
المعاملاتParameters
| المعاملParameter | النوعType | إلزاميRequired | الشرحDescription |
|---|---|---|---|
service | string | نعمYes | usdt · binance · shamcash · syriatel · kazawalletusdt · binance · shamcash · syriatel · kazawallet |
network | string | حسب الخدمةDepends | usdt: trc20/bep20 · shamcash: syp/usdusdt: trc20/bep20 · shamcash: syp/usd |
amount | number | نعمYes | سعر الطلب، رقماً بصيغة 10 أو 10.50 فقط (بلا فواصل آلاف أو رموز). المبلغ الواجب تحويله يرجع في pay_amount. يُقرَّب حسب الوسيلة: الليرة السورية (سيريتل كاش وشام كاش SYP) عدد صحيح، شام كاش USD وكذا واليت خانتان عشريتانOrder price, as a plain number such as 10 or 10.50 (no thousands separators or symbols). The exact amount to transfer is returned in pay_amount. Rounded per method: Syrian pounds (Syriatel Cash and Sham Cash SYP) are whole numbers; Sham Cash USD and Kazawallet use 2 decimals |
redirect_url | string | لاNo | كذا واليت فقط: أين يعود الزبون بعد الدفعKazawallet only: where the customer returns after paying |
to_address | string | نعمYes | محفظة USDT · أو Pay ID · أو معرّف شام كاش acc_… · أو رقم سيريتل كاش المفعّل · أو إيميل حساب كذا واليت (اختياري إن كان لديك حساب واحد) — التفاصيلUSDT wallet · Pay ID · or Sham Cash ID acc_… · or the enabled Syriatel Cash number · or the Kazawallet account email (optional with a single account) — details |
currency | string | لاNo | افتراضي USDT (يُضبط تلقائياً لشام كاش وسيريتل). كذا واليت: أي رمز عملة من 3 أحرفDefault USDT (set automatically for Sham Cash and Syriatel). Kazawallet: any 3-letter currency code |
metadata | JSON | لاNo | بيانات متجرك (JSON حتى 8 كيلوبايت). وجود order_id يفعّل منع التكرار. نص ليس JSON يُحفظ نصاً عادياً ولا يعمل معه منع التكرارYour data (JSON, up to 8 KB). An order_id enables idempotency. Text that is not valid JSON is stored as a plain string and idempotency does not apply to it |
customer_id | string | لاNo | شام كاش فقط (اختياري): رقم الزبون في موقعك بعد ربط حسابه — تُقبل الدفعة فقط إذا كانت من حسابه الموثّق (مع auto تتأكّد تلقائياً، ومع tx_ref يلزم أيضاً رقم العملية)Sham Cash only (optional): your customer ID after binding their account — payment is accepted only from that verified account (with auto it confirms automatically; with tx_ref the transaction number is also required) |
verify_mode | string | لاNo | auto (افتراضي، بلا رقم) أو tx_ref (رقم العملية مطلوب). التفاصيلauto (default, no number) or tx_ref (transaction number required). Details |
webhook_url | string | لاNo | رابط https يصله إشعار هذه الفاتورة بدل رابط الحساب — مفيد لعدّة متاجر على حساب واحد. التفاصيلAn https URL that receives this invoice's notification instead of the account URL — handy for several stores on one account. Details |
مثال الطلبRequest
curl -X POST "https://paylinksy.com/api/index.php?resource=invoice&action=create" \
-H "X-Api-Key: YOUR_API_KEY" \
-d "service=shamcash" \
-d "network=syp" \
-d "amount=25000" \
-d "to_address=acc_xxx" \
-d 'metadata={"order_id":"1043"}' \
-d "webhook_url=https://store-a.com/paylink-webhook.php"<?php
$ch = curl_init("https://paylinksy.com/api/index.php?resource=invoice&action=create");
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => ["X-Api-Key: YOUR_API_KEY"],
CURLOPT_POST => true,
CURLOPT_POSTFIELDS => http_build_query([
'service' => 'shamcash',
'network' => 'syp',
'amount' => '25000',
'to_address' => 'acc_xxx',
'metadata' => '{"order_id":"1043"}',
'webhook_url' => 'https://store-a.com/paylink-webhook.php',
]),
]);
$res = json_decode(curl_exec($ch), true);
curl_close($ch);
if (!$res['success']) {
echo $res['error']['code'];
}import requests
url = "https://paylinksy.com/api/index.php"
headers = {"X-Api-Key": "YOUR_API_KEY"}
params = {"resource": "invoice", "action": "create"}
data = {
"service": 'shamcash',
"network": 'syp',
"amount": '25000',
"to_address": 'acc_xxx',
"metadata": '{"order_id":"1043"}',
"webhook_url": 'https://store-a.com/paylink-webhook.php'
}
r = requests.post(url, params=params, data=data, headers=headers, timeout=30)
print(r.json())const res = await fetch("https://paylinksy.com/api/index.php?resource=invoice&action=create", {
method: "POST",
headers: { "X-Api-Key": process.env.PAYLINK_KEY },
body: new URLSearchParams({
"service": 'shamcash',
"network": 'syp',
"amount": '25000',
"to_address": 'acc_xxx',
"metadata": '{"order_id":"1043"}',
"webhook_url": 'https://store-a.com/paylink-webhook.php',
})
});
const data = await res.json();
console.log(data);الرد · 201Response · 201
{
"success": true,
"data": {
"public_ref": "952d3df5e9bbc3387fcce29c04c02cc9",
"service": "shamcash",
"network": "syp",
"amount": 25000,
"pay_amount": 25001,
"currency": "SYP",
"pay_to": "acc_xxx",
"display_to": "SC-XXXXXXXXXXXX",
"display_name": "Store Owner",
"status": "pending",
"is_final": false,
"grace_until": null,
"created_at": "2026-10-21T19:27:33+00:00",
"expires_at": "2026-10-21T19:47:33+00:00",
"expires_in": 1200,
"paid_at": null,
"metadata": { "order_id": "1043" },
"webhook_url": "https://store-a.com/paylink-webhook.php"
}
}| الحقلField | الشرحDescription |
|---|---|
public_ref | معرّف الفاتورة للاستعلام والإلغاءInvoice reference for status and cancel |
pay_amount | المبلغ الواجب تحويله بالضبط — اعرضه للزبونExact amount to transfer — show it to the customer |
display_to / display_name | العنوان واسم المستلم للعرضAddress and receiver name to display |
expires_in | الثواني المتبقّيةSeconds remaining |
verify_mode / tx_ref_required | طريقة التحقق؛ إذا tx_ref_required = true اطلب من الزبون رقم العمليةVerification mode; if tx_ref_required = true ask the customer for the transaction number |
is_final | true عندما لن تتغيّر الحالة بعد الآن — توقّف عن الاستعلامtrue once the status can no longer change — stop polling |
grace_until | لفاتورة expired فقط: الوقت الذي تبقى الدفعة المتأخرة مقبولة حتى حلولهFor an expired invoice only: until when a late payment is still accepted |
GET?resource=invoice&action=status&public_ref=…حالة الفاتورةInvoice status⌄
كل استعلام يشغّل التحقّق الحيّ أيضاً. استعلم كل 5 ثوانٍ ضمن النافذة.Each call also triggers a live check. Poll every 5 seconds within the window.
| المعاملParameter | النوعType | إلزاميRequired | الشرحDescription |
|---|---|---|---|
public_ref | string | نعمYes | معرّف الفاتورةInvoice reference |
curl "https://paylinksy.com/api/index.php?resource=invoice&action=status&public_ref=PUBLIC_REF" \ -H "X-Api-Key: YOUR_API_KEY"
<?php
$ch = curl_init("https://paylinksy.com/api/index.php?resource=invoice&action=status&public_ref=PUBLIC_REF");
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => ["X-Api-Key: YOUR_API_KEY"],
]);
$res = json_decode(curl_exec($ch), true);
curl_close($ch);
if (!$res['success']) {
echo $res['error']['code'];
}import requests
url = "https://paylinksy.com/api/index.php"
headers = {"X-Api-Key": "YOUR_API_KEY"}
params = {"resource": "invoice", "action": "status", "public_ref": "PUBLIC_REF"}
r = requests.get(url, params=params, headers=headers, timeout=30)
print(r.json())const res = await fetch("https://paylinksy.com/api/index.php?resource=invoice&action=status&public_ref=PUBLIC_REF", {
method: "GET",
headers: { "X-Api-Key": process.env.PAYLINK_KEY }
});
const data = await res.json();
console.log(data);| status | المعنىMeaning |
|---|---|
pending | بانتظار الدفعة — تابعWaiting for payment — keep polling |
paid | ✅ تأكّدت — حالة نهائية✅ Confirmed — final |
expired | انتهت المدّة. دفعة أُرسلت قبل الانتهاء ووصلت متأخرة تُقبل حتى 30 دقيقة بعده فتصبح الحالة paid — نهائية فقط عندما is_final = trueExpired. A payment sent before expiry that arrives late is accepted for 30 more minutes and the status becomes paid — final only when is_final = true |
cancelled | أُلغيتCancelled |
POST?resource=invoice&action=submitإرسال رقم العمليةSubmit the transaction number⌄
يتحقق من رقم العملية الذي أدخله الزبون. ضروري لفواتير tx_ref، ويمكن استخدامه مع auto لتسريع التأكيد. النجاح يرجّع الفاتورة بحالة paid ويُرسل الـ Webhook. يقبل الرقم مع مسافات أو رموز، وبالأرقام العربية، وهاش USDT مع 0x أو بدونها أو رابط المستكشف.Checks the transaction number the customer entered. Required for tx_ref invoices; can also be used with auto to confirm faster. Success returns the invoice as paid and sends the webhook. Spaces, symbols and Arabic digits are tolerated; a USDT hash works with or without 0x or as an explorer link.
| المعاملParameter | النوعType | إلزاميRequired | الشرحDescription |
|---|---|---|---|
public_ref | string | نعمYes | معرّف الفاتورةInvoice reference |
tx_ref | string | نعمYes | رقم العملية كما أدخله الزبون (USDT: هاش التحويل)The transaction number as entered by the customer (USDT: transfer hash) |
curl -X POST "https://paylinksy.com/api/index.php?resource=invoice&action=submit" \ -H "X-Api-Key: YOUR_API_KEY" \ -d "public_ref=PUBLIC_REF" \ -d "tx_ref=123456789"
<?php
$ch = curl_init("https://paylinksy.com/api/index.php?resource=invoice&action=submit");
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => ["X-Api-Key: YOUR_API_KEY"],
CURLOPT_POST => true,
CURLOPT_POSTFIELDS => http_build_query([
'public_ref' => 'PUBLIC_REF',
'tx_ref' => '123456789',
]),
]);
$res = json_decode(curl_exec($ch), true);
curl_close($ch);
if (!$res['success']) {
echo $res['error']['code'];
}import requests
url = "https://paylinksy.com/api/index.php"
headers = {"X-Api-Key": "YOUR_API_KEY"}
params = {"resource": "invoice", "action": "submit"}
data = {
"public_ref": 'PUBLIC_REF',
"tx_ref": '123456789'
}
r = requests.post(url, params=params, data=data, headers=headers, timeout=30)
print(r.json())const res = await fetch("https://paylinksy.com/api/index.php?resource=invoice&action=submit", {
method: "POST",
headers: { "X-Api-Key": process.env.PAYLINK_KEY },
body: new URLSearchParams({
"public_ref": 'PUBLIC_REF',
"tx_ref": '123456789',
})
});
const data = await res.json();
console.log(data);| code | HTTP | الرسالة للزبون (error.message)Message for the customer (error.message) |
|---|---|---|
tx_ref_required | 400 | يرجى إدخال رقم العملية.Please enter the transaction number. |
tx_not_found | 404 | رقم العملية غير صحيح، أو لم تصل الحوالة بعد. تأكد من الرقم وأعد المحاولة بعد دقيقة.Wrong transaction number, or the transfer has not arrived yet. Check it and retry in a minute. |
amount_mismatch | 422 | مبلغ هذه العملية لا يطابق المبلغ المطلوب (مع paid_amount وpay_amount).The transfer amount does not match the requested amount (includes paid_amount and pay_amount). |
currency_mismatch | 422 | عملة هذه العملية لا تطابق عملة الطلب.The transfer currency does not match the order currency. |
tx_already_used | 409 | رقم العملية مستخدم مسبقاً.This transaction number has already been used. |
tx_before_invoice | 422 | هذه العملية سابقة لإنشاء الطلب ولا يمكن احتسابها.This transfer was made before the order was created. |
tx_after_expiry | 422 | تمّت هذه العملية بعد انتهاء مدة الطلب.This transfer was made after the order expired. |
payer_mismatch | 422 | شام كاش: العملية ليست من حساب الزبون المربوط.Sham Cash: the transfer is not from the bound customer account. |
invoice_expired | 410 | انتهت مدة الطلب. يرجى إنشاء طلب جديد.The order has expired. Please create a new one. |
invoice_cancelled | 410 | تم إلغاء هذا الطلب.This order was cancelled. |
invoice_paid | 409 | تم دفع هذا الطلب مسبقاً (برقم آخر).This order was already paid (with another number). |
too_many_attempts | 429 | محاولات كثيرة (10 أرقام خاطئة خلال 10 دقائق لكل فاتورة).Too many attempts (10 wrong numbers within 10 minutes per invoice). |
provider_unavailable | 503 | تعذّر التحقق الآن. أعد المحاولة بعد قليل. (أو مع customer_id: «لم يكتمل التحقق من حساب المرسل بعد. أعد المحاولة بعد دقيقة.») — لا تُحتسب محاولة خاطئةVerification is unavailable right now. Retry shortly. (Or with customer_id: the sender account check has not finished yet — retry in a minute.) Not counted as a wrong attempt. |
كل رد خطأ يحوي error.invoice (الفاتورة بحالتها الحالية). إرسال رقم الفاتورة المدفوعة نفسه مرة ثانية يرجّع نجاحاً.Every error response includes error.invoice (the invoice as it is now). Re-submitting the number that already paid the invoice returns success.
POST?resource=invoice&action=cancelإلغاء فاتورةCancel an invoice⌄
يلغي فاتورة pending ويحرّر مبلغها المميّز. الفاتورة المدفوعة ترجع invoice_paid.Cancels a pending invoice and frees its unique amount. A paid invoice returns invoice_paid.
| المعاملParameter | النوعType | إلزاميRequired | الشرحDescription |
|---|---|---|---|
public_ref | string | نعمYes | معرّف الفاتورةInvoice reference |
curl -X POST "https://paylinksy.com/api/index.php?resource=invoice&action=cancel" \ -H "X-Api-Key: YOUR_API_KEY" \ -d "public_ref=PUBLIC_REF"
<?php
$ch = curl_init("https://paylinksy.com/api/index.php?resource=invoice&action=cancel");
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => ["X-Api-Key: YOUR_API_KEY"],
CURLOPT_POST => true,
CURLOPT_POSTFIELDS => http_build_query([
'public_ref' => 'PUBLIC_REF',
]),
]);
$res = json_decode(curl_exec($ch), true);
curl_close($ch);
if (!$res['success']) {
echo $res['error']['code'];
}import requests
url = "https://paylinksy.com/api/index.php"
headers = {"X-Api-Key": "YOUR_API_KEY"}
params = {"resource": "invoice", "action": "cancel"}
data = {
"public_ref": 'PUBLIC_REF'
}
r = requests.post(url, params=params, data=data, headers=headers, timeout=30)
print(r.json())const res = await fetch("https://paylinksy.com/api/index.php?resource=invoice&action=cancel", {
method: "POST",
headers: { "X-Api-Key": process.env.PAYLINK_KEY },
body: new URLSearchParams({
"public_ref": 'PUBLIC_REF',
})
});
const data = await res.json();
console.log(data);GET?resource=account&action=statusحالة الحسابAccount status⌄
رصيدك والوسائل المربوطة. identifier هو ما ترسله في to_address، وdisplay_to ما تعرضه للزبون.Your balance and linked methods. identifier is what you send as to_address; display_to is what you show.
curl "https://paylinksy.com/api/index.php?resource=account&action=status" \ -H "X-Api-Key: YOUR_API_KEY"
<?php
$ch = curl_init("https://paylinksy.com/api/index.php?resource=account&action=status");
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => ["X-Api-Key: YOUR_API_KEY"],
]);
$res = json_decode(curl_exec($ch), true);
curl_close($ch);
if (!$res['success']) {
echo $res['error']['code'];
}import requests
url = "https://paylinksy.com/api/index.php"
headers = {"X-Api-Key": "YOUR_API_KEY"}
params = {"resource": "account", "action": "status"}
r = requests.get(url, params=params, headers=headers, timeout=30)
print(r.json())const res = await fetch("https://paylinksy.com/api/index.php?resource=account&action=status", {
method: "GET",
headers: { "X-Api-Key": process.env.PAYLINK_KEY }
});
const data = await res.json();
console.log(data);{
"success": true,
"data": {
"balance": 100.00,
"api_enabled": true,
"trial_ends_at": null,
"methods": [
{ "service": "usdt", "network": "bep20", "identifier": "0x...", "display_to": "0x...", "billing_status": "active" },
{ "service": "shamcash", "network": "syp,usd", "identifier": "acc_xxx", "display_to": "SC-XXXX", "billing_status": "active" }
]
}
}GET?resource=usdt&action=balanceرصيد عنوان USDTUSDT address balance⌄
يعمل فقط لعناوين المحافظ المضافة في حسابك؛ غير ذلك يرجّع address_not_registered (403).Works only for wallet addresses added to your account; otherwise returns address_not_registered (403).
| المعاملParameter | النوعType | إلزاميRequired | الشرحDescription |
|---|---|---|---|
network | string | نعمYes | trc20 أو bep20trc20 or bep20 |
address | string | نعمYes | عنوان محفظة مضافة في حسابكA wallet address added to your account |
curl "https://paylinksy.com/api/index.php?resource=usdt&action=balance&network=trc20&address=TXXXXXXXX" \ -H "X-Api-Key: YOUR_API_KEY"
<?php
$ch = curl_init("https://paylinksy.com/api/index.php?resource=usdt&action=balance&network=trc20&address=TXXXXXXXX");
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => ["X-Api-Key: YOUR_API_KEY"],
]);
$res = json_decode(curl_exec($ch), true);
curl_close($ch);
if (!$res['success']) {
echo $res['error']['code'];
}import requests
url = "https://paylinksy.com/api/index.php"
headers = {"X-Api-Key": "YOUR_API_KEY"}
params = {"resource": "usdt", "action": "balance", "network": "trc20", "address": "TXXXXXXXX"}
r = requests.get(url, params=params, headers=headers, timeout=30)
print(r.json())const res = await fetch("https://paylinksy.com/api/index.php?resource=usdt&action=balance&network=trc20&address=TXXXXXXXX", {
method: "GET",
headers: { "X-Api-Key": process.env.PAYLINK_KEY }
});
const data = await res.json();
console.log(data);GET?resource=statusفحص المفتاحPing⌄
للتأكّد أن مفتاحك يعمل.Check that your key works.
curl "https://paylinksy.com/api/index.php?resource=status" \ -H "X-Api-Key: YOUR_API_KEY"
<?php
$ch = curl_init("https://paylinksy.com/api/index.php?resource=status");
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => ["X-Api-Key: YOUR_API_KEY"],
]);
$res = json_decode(curl_exec($ch), true);
curl_close($ch);
if (!$res['success']) {
echo $res['error']['code'];
}import requests
url = "https://paylinksy.com/api/index.php"
headers = {"X-Api-Key": "YOUR_API_KEY"}
params = {"resource": "status"}
r = requests.get(url, params=params, headers=headers, timeout=30)
print(r.json())const res = await fetch("https://paylinksy.com/api/index.php?resource=status", {
method: "GET",
headers: { "X-Api-Key": process.env.PAYLINK_KEY }
});
const data = await res.json();
console.log(data);{ "success": true, "data": { "message": "API يعمل.", "user_id": 1 } }توثيق حساب الزبون — شام كاش (اختياري)Verified customer account — Sham Cash (optional)
ميزة اختيارية لموقعك: كل زبون يربط حساب شام كاش الشخصي الذي سيحوّل منه مرة واحدة، وبعدها تتأكّد فواتيره تلقائياً فقط إذا حوّل من هذا الحساب. إذا حوّل من حساب آخر لا تتأكّد الفاتورة تلقائياً، وتظهر في لوحتك «تحتاج مراجعة» لتؤكّدها يدوياً إن أردت. إن لم تستخدم الميزة يبقى كل شيء كما هو.An optional feature for your site: each customer binds, once, the personal Sham Cash account they will pay from. After that their invoices auto-confirm only when paid from that account. A transfer from any other account is not auto-confirmed and shows as “needs review” in your dashboard, where you can confirm it manually. If you do not use this feature nothing changes.
- اطلب من الزبون عنوان حسابهAsk the customer for their account addressعنوان شام كاش من 32 حرفاً يظهر في تطبيقه (يبدأ عادةً بأحرف وأرقام مثل
81ddc070…).The 32-character Sham Cash address shown in their app (letters and digits, e.g.81ddc070…). - اعرض له معلومات الحسابShow them the account detailsاستدعِ
lookupواعرض الاسم ورقم الحساب المخفي وعمر الحساب، واطلب منه التأكيد.Calllookup, show the name, masked number and account age, and ask them to confirm. - اربط الحساب بالزبونBind the account to the customerعند التأكيد استدعِ
bindبرقم الزبون في موقعك. الربط خاص بحساب الاستقبال (to_address) — فكل موقع وزبائنه منفصلون حتى لو تكرّر رقم الزبون.On confirm, callbindwith your customer ID. The binding belongs to the receiving account (to_address), so each site and its customers stay separate even if customer IDs repeat. - أرسل customer_id مع كل فاتورةSend customer_id with each invoiceأضِف
customer_idإلى إنشاء الفاتورة. يحتوي الرد علىpayer. وإن أردت أن يُدخل الزبون رقم العملية أيضاً أضِفverify_mode=tx_ref(التفاصيل).Addcustomer_idto invoice creation. The response includespayer. If you also want the customer to enter the transaction number, addverify_mode=tx_ref(details).
GET?resource=shamcash&action=lookupمعلومات حساب من عنوانهLook up an account by address⌄
| المعاملParameter | النوعType | إلزاميRequired | الشرحDescription |
|---|---|---|---|
to_address | string | نعمYes | حساب الاستقبال acc_…Receiving account acc_… |
address | string | نعمYes | عنوان حساب الزبون (32 حرفاً)Customer account address (32 characters) |
curl "https://paylinksy.com/api/index.php?resource=shamcash&action=lookup&to_address=acc_xxx&address=81ddc070df9c1c2922d4af01b73369d0" \ -H "X-Api-Key: YOUR_API_KEY"
<?php
$ch = curl_init("https://paylinksy.com/api/index.php?resource=shamcash&action=lookup&to_address=acc_xxx&address=81ddc070df9c1c2922d4af01b73369d0");
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => ["X-Api-Key: YOUR_API_KEY"],
]);
$res = json_decode(curl_exec($ch), true);
curl_close($ch);
if (!$res['success']) {
echo $res['error']['code'];
}import requests
url = "https://paylinksy.com/api/index.php"
headers = {"X-Api-Key": "YOUR_API_KEY"}
params = {"resource": "shamcash", "action": "lookup", "to_address": "acc_xxx", "address": "81ddc070df9c1c2922d4af01b73369d0"}
r = requests.get(url, params=params, headers=headers, timeout=30)
print(r.json())const res = await fetch("https://paylinksy.com/api/index.php?resource=shamcash&action=lookup&to_address=acc_xxx&address=81ddc070df9c1c2922d4af01b73369d0", {
method: "GET",
headers: { "X-Api-Key": process.env.PAYLINK_KEY }
});
const data = await res.json();
console.log(data);{
"success": true,
"data": {
"address": "81ddc070df9c1c2922d4af01b73369d0",
"owner_name": "علي صلاح حسين",
"masked_account_number": "************0109",
"account_created_at": "2025-08-09",
"account_age_days": 455,
"is_verified": true
}
}POST?resource=shamcash&action=bindربط حساب بزبونBind an account to a customer⌄
| المعاملParameter | النوعType | إلزاميRequired | الشرحDescription |
|---|---|---|---|
to_address | string | نعمYes | حساب الاستقبال acc_…Receiving account acc_… |
customer_id | string | نعمYes | رقم الزبون في موقعك (حتى 64 حرفاً: أحرف وأرقام و. : @ - _)Your customer ID (up to 64 chars: letters, digits and . : @ - _) |
address | string | نعمYes | عنوان حساب الزبونCustomer account address |
curl -X POST "https://paylinksy.com/api/index.php?resource=shamcash&action=bind" \ -H "X-Api-Key: YOUR_API_KEY" \ -d "to_address=acc_xxx" \ -d "customer_id=user_57" \ -d "address=81ddc070df9c1c2922d4af01b73369d0"
<?php
$ch = curl_init("https://paylinksy.com/api/index.php?resource=shamcash&action=bind");
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => ["X-Api-Key: YOUR_API_KEY"],
CURLOPT_POST => true,
CURLOPT_POSTFIELDS => http_build_query([
'to_address' => 'acc_xxx',
'customer_id' => 'user_57',
'address' => '81ddc070df9c1c2922d4af01b73369d0',
]),
]);
$res = json_decode(curl_exec($ch), true);
curl_close($ch);
if (!$res['success']) {
echo $res['error']['code'];
}import requests
url = "https://paylinksy.com/api/index.php"
headers = {"X-Api-Key": "YOUR_API_KEY"}
params = {"resource": "shamcash", "action": "bind"}
data = {
"to_address": 'acc_xxx',
"customer_id": 'user_57',
"address": '81ddc070df9c1c2922d4af01b73369d0'
}
r = requests.post(url, params=params, data=data, headers=headers, timeout=30)
print(r.json())const res = await fetch("https://paylinksy.com/api/index.php?resource=shamcash&action=bind", {
method: "POST",
headers: { "X-Api-Key": process.env.PAYLINK_KEY },
body: new URLSearchParams({
"to_address": 'acc_xxx',
"customer_id": 'user_57',
"address": '81ddc070df9c1c2922d4af01b73369d0',
})
});
const data = await res.json();
console.log(data);يرجع بيانات الحساب نفسها مع customer_id وbound_at وshared_with_others (عدد الزبائن الآخرين المربوطين بنفس الحساب — قيمة أكبر من 0 تستحق الانتباه). إذا كان الزبون مربوطاً بحساب آخر يرجع payer_already_bound.Returns the same account data plus customer_id, bound_at and shared_with_others (how many other customers use the same account — above 0 deserves attention). If the customer is bound to another account you get payer_already_bound.
GET?resource=shamcash&action=payerالحساب المربوط بزبونGet a customer's bound account⌄
| المعاملParameter | النوعType | إلزاميRequired | الشرحDescription |
|---|---|---|---|
to_address | string | نعمYes | حساب الاستقبالReceiving account |
customer_id | string | نعمYes | رقم الزبونCustomer ID |
curl "https://paylinksy.com/api/index.php?resource=shamcash&action=payer&to_address=acc_xxx&customer_id=user_57" \ -H "X-Api-Key: YOUR_API_KEY"
<?php
$ch = curl_init("https://paylinksy.com/api/index.php?resource=shamcash&action=payer&to_address=acc_xxx&customer_id=user_57");
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => ["X-Api-Key: YOUR_API_KEY"],
]);
$res = json_decode(curl_exec($ch), true);
curl_close($ch);
if (!$res['success']) {
echo $res['error']['code'];
}import requests
url = "https://paylinksy.com/api/index.php"
headers = {"X-Api-Key": "YOUR_API_KEY"}
params = {"resource": "shamcash", "action": "payer", "to_address": "acc_xxx", "customer_id": "user_57"}
r = requests.get(url, params=params, headers=headers, timeout=30)
print(r.json())const res = await fetch("https://paylinksy.com/api/index.php?resource=shamcash&action=payer&to_address=acc_xxx&customer_id=user_57", {
method: "GET",
headers: { "X-Api-Key": process.env.PAYLINK_KEY }
});
const data = await res.json();
console.log(data);POST?resource=shamcash&action=unbindفك الربطUnbind⌄
عندما يغيّر الزبون حسابه. يمكنك أيضاً فك الربط من لوحتك (صفحة شام كاش › الزبائن الموثّقون).When the customer changes their account. You can also unbind from your dashboard (Sham Cash › Verified customers).
| المعاملParameter | النوعType | إلزاميRequired | الشرحDescription |
|---|---|---|---|
to_address | string | نعمYes | حساب الاستقبالReceiving account |
customer_id | string | نعمYes | رقم الزبونCustomer ID |
curl -X POST "https://paylinksy.com/api/index.php?resource=shamcash&action=unbind" \ -H "X-Api-Key: YOUR_API_KEY" \ -d "to_address=acc_xxx" \ -d "customer_id=user_57"
<?php
$ch = curl_init("https://paylinksy.com/api/index.php?resource=shamcash&action=unbind");
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => ["X-Api-Key: YOUR_API_KEY"],
CURLOPT_POST => true,
CURLOPT_POSTFIELDS => http_build_query([
'to_address' => 'acc_xxx',
'customer_id' => 'user_57',
]),
]);
$res = json_decode(curl_exec($ch), true);
curl_close($ch);
if (!$res['success']) {
echo $res['error']['code'];
}import requests
url = "https://paylinksy.com/api/index.php"
headers = {"X-Api-Key": "YOUR_API_KEY"}
params = {"resource": "shamcash", "action": "unbind"}
data = {
"to_address": 'acc_xxx',
"customer_id": 'user_57'
}
r = requests.post(url, params=params, data=data, headers=headers, timeout=30)
print(r.json())const res = await fetch("https://paylinksy.com/api/index.php?resource=shamcash&action=unbind", {
method: "POST",
headers: { "X-Api-Key": process.env.PAYLINK_KEY },
body: new URLSearchParams({
"to_address": 'acc_xxx',
"customer_id": 'user_57',
})
});
const data = await res.json();
console.log(data);فاتورة لزبون موثّقInvoice for a verified customer
curl -X POST "https://paylinksy.com/api/index.php?resource=invoice&action=create" \
-H "X-Api-Key: YOUR_API_KEY" \
-d "service=shamcash" \
-d "network=syp" \
-d "amount=25000" \
-d "to_address=acc_xxx" \
-d "customer_id=user_57" \
-d 'metadata={"order_id":"1044"}'<?php
$ch = curl_init("https://paylinksy.com/api/index.php?resource=invoice&action=create");
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => ["X-Api-Key: YOUR_API_KEY"],
CURLOPT_POST => true,
CURLOPT_POSTFIELDS => http_build_query([
'service' => 'shamcash',
'network' => 'syp',
'amount' => '25000',
'to_address' => 'acc_xxx',
'customer_id' => 'user_57',
'metadata' => '{"order_id":"1044"}',
]),
]);
$res = json_decode(curl_exec($ch), true);
curl_close($ch);
if (!$res['success']) {
echo $res['error']['code'];
}import requests
url = "https://paylinksy.com/api/index.php"
headers = {"X-Api-Key": "YOUR_API_KEY"}
params = {"resource": "invoice", "action": "create"}
data = {
"service": 'shamcash',
"network": 'syp',
"amount": '25000',
"to_address": 'acc_xxx',
"customer_id": 'user_57',
"metadata": '{"order_id":"1044"}'
}
r = requests.post(url, params=params, data=data, headers=headers, timeout=30)
print(r.json())const res = await fetch("https://paylinksy.com/api/index.php?resource=invoice&action=create", {
method: "POST",
headers: { "X-Api-Key": process.env.PAYLINK_KEY },
body: new URLSearchParams({
"service": 'shamcash',
"network": 'syp',
"amount": '25000',
"to_address": 'acc_xxx',
"customer_id": 'user_57',
"metadata": '{"order_id":"1044"}',
})
});
const data = await res.json();
console.log(data);"payer": {
"customer_id": "user_57",
"owner_name": "علي صلاح حسين",
"masked_account_number": "************0109",
"match": "sender_address"
}match: sender_address = مطابقة دقيقة بعنوان حساب المرسل؛ sender_name = مطابقة باسم صاحب الحساب (تُستخدم عندما لا تتوفّر المطابقة بالعنوان لهذا الحساب). إذا وصلت دفعة من حساب آخر تبقى الفاتورة pending ويظهر في status_note أنها «تحتاج مراجعة». لا يمكن أن يكون للزبون الواحد أكثر من فاتورة نشطة على نفس حساب الاستقبال بالمطابقة الدقيقة؛ الفاتورة الثانية تعمل بمطابقة الاسم.
مع verify_mode=tx_ref: لا تتأكّد الفاتورة تلقائياً حتى لو وصلت الدفعة من حسابه؛ يجب أن يُرسل الزبون رقم العملية عبر submit، ورقم صحيح من حساب آخر يُرفض بـ payer_mismatch.match: sender_address = exact match on the sender's account address; sender_name = match on the account holder's name (used when address matching is not available for this account). If a payment arrives from another account the invoice stays pending and status_note says it “needs review”. A customer can have only one active exact-match invoice per receiving account; a second one uses name matching.
With verify_mode=tx_ref: the invoice is never auto-confirmed, even if the payment comes from their account; the customer must submit the transaction number via submit, and a correct number from another account is rejected with payer_mismatch.
Webhook
ضع رابط استقبال من إعدادات الحساب › Webhook، وسنرسل POST بصيغة JSON لحظة ما تصير الفاتورة paid. ردّ بـ 2xx خلال 10 ثوانٍ؛ وإلا نعيد المحاولة حتى 8 مرات خلال ~11 ساعة.Set a receiving URL in Account settings › Webhook and we will POST JSON the moment an invoice becomes paid. Reply 2xx within 10 s; otherwise we retry up to 8 times over ~11 hours.
Content-Type: application/json X-PayLink-Event: invoice.paid X-PayLink-Signature: sha256=HMAC_SHA256(secret, raw_body) X-PayLink-Timestamp: 1761075541 X-PayLink-Signature-V2: t=1761075541,v1=HMAC_SHA256(secret, "1761075541." + raw_body)
ننصح بالتوقيع v2: يشمل وقت الإرسال، فارفض أي إشعار يزيد عمره عن 5 دقائق (حماية من إعادة إرسال إشعار قديم)، وعالج كل id مرة واحدة فقط. التوقيع القديم X-PayLink-Signature يبقى مرسلاً للتوافق.We recommend the v2 signature: it covers the send time, so reject any notification older than 5 minutes (protects against replaying an old one), and process each id only once. The old X-PayLink-Signature header is still sent for compatibility.
{
"id": "evt_3f9a1c…",
"event": "invoice.paid",
"sent_at": "2026-10-22T19:39:05+00:00",
"data": {
"public_ref": "952d3df5…",
"service": "shamcash",
"amount": 25000,
"pay_amount": 25001,
"currency": "SYP",
"status": "paid",
"paid_at": "2026-10-22T19:39:01+00:00",
"metadata": { "order_id": "1043" }
}
}أكثر من متجر على نفس الحسابSeveral stores on one account
أرسل webhook_url مع كل فاتورة عند إنشائها، فيصل إشعارها إلى ذلك الرابط بدل الرابط العام في إعدادات الحساب. إن لم ترسله يُستخدم الرابط العام كالمعتاد.Send webhook_url with each invoice when creating it and its notification goes to that URL instead of the general one in account settings. If omitted, the general URL is used as usual.
| الحالةCase | أين يصل الإشعارWhere the notification goes |
|---|---|
الفاتورة فيها webhook_urlInvoice has webhook_url | رابط الفاتورةThe invoice URL |
بدون webhook_urlNo webhook_url | رابط الحساب العام (إن وُجد)The account URL (if set) |
| لا هذا ولا ذاكNeither | لا إشعار — استخدم الاستعلامNo notification — use polling |
- روابط
httpsفقط، والمنافذ المسموحة 443 و8443. لا تُقبل الروابط التي تشير إلى عناوين داخلية أو محجوزة.httpsURLs only, on ports 443 or 8443. URLs pointing to internal or reserved addresses are rejected. - التوقيع بنفس سر الحساب (
whsec_…) لكل الروابط، فتتحقّق في كل متاجرك بنفس الطريقة. يُولَّد السر تلقائياً عند أول استخدام ويظهر في إعدادات الحساب.Every URL is signed with the same account secret (whsec_…), so all your stores verify the same way. The secret is created on first use and shown in account settings. - بديل بدون هذا الحقل: رابط واحد يستقبل كل الإشعارات ويوزّعها حسب
metadata(مثلاً{"store":"A","order_id":"1043"}).Alternative without this field: one URL receives every notification and routes it bymetadata(e.g.{"store":"A","order_id":"1043"}).
التحقّق من التوقيعVerifying the signature
<?php
$secret = 'whsec_xxx';
$body = file_get_contents('php://input');
// v2: t=<ts>,v1=<hex>
parse_str(str_replace(',', '&', $_SERVER['HTTP_X_PAYLINK_SIGNATURE_V2'] ?? ''), $p);
$ts = (int)($p['t'] ?? 0);
$calc = hash_hmac('sha256', $ts . '.' . $body, $secret);
if (abs(time() - $ts) > 300 || !hash_equals($calc, (string)($p['v1'] ?? ''))) { http_response_code(401); exit; }
$ev = json_decode($body, true);
if ($ev['event'] === 'invoice.paid') {
// fulfil once per $ev['id'] / $ev['data']['public_ref']
}
http_response_code(200);
import hmac, hashlib
from flask import Flask, request, abort
app = Flask(__name__); SECRET = b"whsec_xxx"
@app.post("/paylink-webhook")
def hook():
body = request.get_data()
calc = "sha256=" + hmac.new(SECRET, body, hashlib.sha256).hexdigest()
if not hmac.compare_digest(calc, request.headers.get("X-PayLink-Signature", "")):
abort(401)
ev = request.get_json()
# fulfil once per ev["data"]["public_ref"]
return "", 200
const crypto = require('crypto');
const express = require('express');
const app = express(); const SECRET = 'whsec_xxx';
app.post('/paylink-webhook', express.raw({ type: '*/*' }), (req, res) => {
const sig = req.get('X-PayLink-Signature') || '';
const calc = 'sha256=' + crypto.createHmac('sha256', SECRET).update(req.body).digest('hex');
if (sig.length !== calc.length || !crypto.timingSafeEqual(Buffer.from(sig), Buffer.from(calc)))
return res.sendStatus(401);
const ev = JSON.parse(req.body);
// fulfil once per ev.data.public_ref
res.sendStatus(200);
});اختبار APIAPI tester
جرّب أي نقطة نهاية مباشرة من المتصفح بمفتاحك. المفتاح يبقى في متصفحك ولا يُحفظ.Try any endpoint right from the browser with your key. The key stays in your browser and is not stored.
⚠️ طلب invoice create ينشئ فاتورة حقيقية في حسابك.invoice create creates a real invoice in your account.
لم يُرسل أي طلب بعد.No request sent yet.