⚡ API v1 · تحقّق تلقائي بدون هاشHash-free auto-verification

توثيق 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.

BASEhttps://paylinksy.com/api/index.php
JSONردود موحّدةUnified replies
300طلب/دقيقةreq / minute
~5sتأكيد الدفعةConfirmation
4وسائل دفعPayment methods

البدء السريعQuick start

1
خذ مفتاحكGet your keyمن لوحتك › «مفتاح API». في الحسابات الجديدة يُفعَّل الـ API من الإدارة أولاً — اضغط «طلب تفعيل» وتواصل معنا. إذا تسرّب المفتاح، ولّد مفتاحاً جديداً فيتوقّف القديم فوراً.Dashboard › “API key”. New accounts need API access enabled by support first — press “Request activation” and contact us. If the key leaks, generate a new one and the old key stops immediately.
2
اربط وسيلة دفعLink a payment methodمحفظة USDT، أو Binance Pay، أو شام كاش، أو سيريتل كاش، أو كذا واليت — طريقة ربط كل وسيلة.A USDT wallet, Binance Pay, Sham Cash, Syriatel Cash or Kazawallet — how to link each one.
3
أنشئ فاتورةCreate an invoiceأرسل service وamount وto_address، واعرض للزبون pay_amount وdisplay_to.Send service, amount and to_address, then show the customer pay_amount and display_to.
4
استلم التأكيدReceive confirmationاستعلم كل 5 ثوانٍ حتى 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.

HTTP
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.

200 · success
{
  "success": true,
  "data": { ... }
}
4xx / 5xx · error
{
  "success": false,
  "error": {
    "code": "amount_reserved",
    "message": "...",
    "reserved_minutes": 12
  }
}

رموز الأخطاءError codes

codeHTTPالمعنىMeaning
missing_key401المفتاح مفقود من الترويسةAPI key missing from the header
invalid_key403مفتاح غير صالح أو ملغىUnknown or revoked key
key_suspended403الـ API موقوف لهذا الحسابAPI access is suspended for this account
payer_not_bound409شام كاش: هذا الزبون غير مربوط بحساب بعد — اربطه أولاً أو أرسل الفاتورة بدون customer_idSham Cash: this customer has no linked account yet — bind it first or omit customer_id
payer_already_bound409شام كاش: الزبون مربوط بحساب آخر — فك الربط أولاًSham Cash: customer is bound to another account — unbind first
address_not_found404شام كاش: لا يوجد حساب بهذا العنوانSham Cash: no account with this address
api_not_approved403الـ API غير مفعّل لهذا الحساب بعد — تواصل مع الإدارةAPI not yet enabled for this account — contact support
subscription_expired402انتهى اشتراك الحسابAccount subscription has expired
subscription_suspended402اشتراك الوسيلة موقوف لنفاد الرصيدMethod suspended for insufficient balance
subscription_stopped402الوسيلة غير مفعّلة أو انتهت مدتها/تجربتها — فعّلها أو جدّدها من اللوحةMethod not activated, or its period/trial ended — activate or renew it in the dashboard
rate_limited429تجاوز حدّ الطلبات (مع retry_after)Too many requests (includes retry_after)
invalid_service400خدمة غير مدعومةUnsupported service
invalid_param400أُرسل باراميتر كمصفوفة بدل قيمة نصية (مثل 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_amount400مبلغ غير صالح. أرسله رقماً أكبر من صفر بصيغة مثل 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_network400شبكة أو عملة غير صالحةInvalid network or currency
missing_param400باراميتر مطلوب ناقصA required parameter is missing
address_not_registered403العنوان أو الحساب غير مضاف في حسابكAddress/account is not added to your account
method_not_linked400لا يوجد حساب Binance بهذا الـ Pay IDNo Binance account with this Pay ID
invalid_webhook_url400webhook_url غير مقبول (ليس https، أو يشير لعنوان داخلي، أو النطاق غير موجود)webhook_url rejected (not https, points to an internal address, or the domain does not resolve)
relink_required409حساب سيريتل كاش يحتاج إعادة ربط من اللوحةThe Syriatel Cash account needs relinking from the panel
pin_required409رقم سيريتل كاش يحتاج إعادة تأكيد PIN من اللوحةThe Syriatel Cash number needs its PIN re-confirmed in the panel
provider_error502تعذّر إنشاء رابط الدفع من كذا واليتKazawallet could not create the payment link
display_to_missing409عنوان الاستلام لحساب شام كاش غير متوفّر بعدSham Cash receiving address not available yet
amount_reserved409كل المبالغ المميّزة القريبة مشغولة (نادر) — مع reserved_minutesAll nearby unique amounts are busy (rare) — includes reserved_minutes
busy409طلب آخر قيد التنفيذ على نفس الحساب أو نفس order_id — أعد المحاولة بعد ثوانٍAnother request is in progress for the same account or order_id — retry in a few seconds
invoice_paid409لا يمكن إلغاء فاتورة مدفوعة، أو أُرسل رقم عملية لفاتورة مدفوعة برقم آخرA paid invoice cannot be cancelled, or a number was submitted for an invoice already paid with another one
tx_ref_required400رقم العملية فارغ أو غير صالح — إرسال رقم العمليةEmpty or invalid transaction number — submit
tx_not_found404رقم العملية غير موجود في الحوالات الواردة (بعد)Transaction number not found among incoming transfers (yet)
amount_mismatch422مبلغ العملية لا يطابق pay_amountTransfer amount differs from pay_amount
currency_mismatch422عملة العملية لا تطابق عملة الطلبTransfer currency differs from the order currency
tx_already_used409رقم العملية مستخدم لطلب آخرTransaction number already used for another order
tx_before_invoice422العملية أقدم من إنشاء الطلبTransfer is older than the order
tx_after_expiry422العملية بعد انتهاء مدة الطلبTransfer was made after the order expired
payer_mismatch422شام كاش: العملية ليست من حساب الزبون المربوطSham Cash: transfer is not from the bound customer account
invoice_expired410انتهت مدة الطلب (ومهلة السماح)The order (and its grace period) has expired
invoice_cancelled410الطلب ملغىThe order was cancelled
too_many_attempts429أرقام عمليات خاطئة كثيرة لهذه الفاتورةToo many wrong transaction numbers for this invoice
provider_unavailable503مزوّد الدفع لا يستجيب الآن، أو (شام كاش مع 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_supported400التحقق برقم العملية غير متاح لهذه الفاتورةTransaction-number verification is not available for this invoice
not_found404غير موجودNot found
method_not_allowed405طريقة HTTP خاطئةWrong HTTP method
maintenance503الموقع تحت الصيانةUnder maintenance
service_unavailable503الخدمة متوقفة مؤقتاًService temporarily unavailable
server_error500خطأ في الخادم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.

Headers
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 dashboardservice · networkto_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 addresspay_amount + display_to + الشبكةnetwork20 دقيقة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.binancePay IDpay_amount + Pay ID20 دقيقة20 min
شام كاشSham Cashاضغط «ربط حساب» وامسح رمز QR من تطبيق شام كاش (الأجهزة المرتبطة).Press “Link account” and scan the QR from the Sham Cash app (Linked devices).shamcash · syp/usdacc_…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 numberpay_amount + الرقم + pay_codenumber + pay_code30 دقيقة (+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 them30 دقيقة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 / BEP200.01100 → 100.01 → 100.02
Binance Pay0.01100 → 100.01 → 100.02
شام كاش دولارSham Cash USD0.0150 → 50.01 → 50.02
شام كاش ليرة / سيريتل كاشSham Cash SYP / Syriatel Cash110000 → 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معناهMeaningUSDTBinanceشام كاشSham Cashسيريتل كاشSyriatel Cashكذا واليتKazawallet
to_address / pay_toمعرّف الربط البرمجي (ترسله لنا)Integration identifier (you send it)عنوان المحفظةWallet addressPay IDacc_…الرقم 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
servicesyriatel
to_addressرقم سيريتل كاش المفعّل (09xxxxxxxx)The enabled Syriatel Cash number (09xxxxxxxx)
network / currencysyp / SYP (تلقائياً)(automatic)
display_to · pay_codeالرقم وكود الدفع — اعرضهما للزبونThe number and payment code — show both to the customer
المهلةWindow30 دقيقة، وتُقبل الدفعة المتأخرة حتى 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
servicekazawallet
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-…).
الأوقاتTimestampsISO-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
servicestringنعمYesusdt · binance · shamcash · syriatel · kazawalletusdt · binance · shamcash · syriatel · kazawallet
networkstringحسب الخدمةDependsusdt: trc20/bep20 · shamcash: syp/usdusdt: trc20/bep20 · shamcash: syp/usd
amountnumberنعم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_urlstringلاNoكذا واليت فقط: أين يعود الزبون بعد الدفعKazawallet only: where the customer returns after paying
to_addressstringنعم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
currencystringلاNoافتراضي USDT (يُضبط تلقائياً لشام كاش وسيريتل). كذا واليت: أي رمز عملة من 3 أحرفDefault USDT (set automatically for Sham Cash and Syriatel). Kazawallet: any 3-letter currency code
metadataJSONلا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_idstringلا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_modestringلاNoauto (افتراضي، بلا رقم) أو tx_ref (رقم العملية مطلوب). التفاصيلauto (default, no number) or tx_ref (transaction number required). Details
webhook_urlstringلا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

JSON
{
  "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_finaltrue عندما لن تتغيّر الحالة بعد الآن — توقّف عن الاستعلام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_refstringنعم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_refstringنعمYesمعرّف الفاتورةInvoice reference
tx_refstringنعم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);
codeHTTPالرسالة للزبون (error.message)Message for the customer (error.message)
tx_ref_required400يرجى إدخال رقم العملية.Please enter the transaction number.
tx_not_found404رقم العملية غير صحيح، أو لم تصل الحوالة بعد. تأكد من الرقم وأعد المحاولة بعد دقيقة.Wrong transaction number, or the transfer has not arrived yet. Check it and retry in a minute.
amount_mismatch422مبلغ هذه العملية لا يطابق المبلغ المطلوب (مع paid_amount وpay_amount).The transfer amount does not match the requested amount (includes paid_amount and pay_amount).
currency_mismatch422عملة هذه العملية لا تطابق عملة الطلب.The transfer currency does not match the order currency.
tx_already_used409رقم العملية مستخدم مسبقاً.This transaction number has already been used.
tx_before_invoice422هذه العملية سابقة لإنشاء الطلب ولا يمكن احتسابها.This transfer was made before the order was created.
tx_after_expiry422تمّت هذه العملية بعد انتهاء مدة الطلب.This transfer was made after the order expired.
payer_mismatch422شام كاش: العملية ليست من حساب الزبون المربوط.Sham Cash: the transfer is not from the bound customer account.
invoice_expired410انتهت مدة الطلب. يرجى إنشاء طلب جديد.The order has expired. Please create a new one.
invoice_cancelled410تم إلغاء هذا الطلب.This order was cancelled.
invoice_paid409تم دفع هذا الطلب مسبقاً (برقم آخر).This order was already paid (with another number).
too_many_attempts429محاولات كثيرة (10 أرقام خاطئة خلال 10 دقائق لكل فاتورة).Too many attempts (10 wrong numbers within 10 minutes per invoice).
provider_unavailable503تعذّر التحقق الآن. أعد المحاولة بعد قليل. (أو مع 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_refstringنعم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);
JSON
{
  "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
networkstringنعمYestrc20 أو bep20trc20 or bep20
addressstringنعم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);
JSON
{ "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.

  1. اطلب من الزبون عنوان حسابه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…).
  2. اعرض له معلومات الحسابShow them the account detailsاستدعِ lookup واعرض الاسم ورقم الحساب المخفي وعمر الحساب، واطلب منه التأكيد.Call lookup, show the name, masked number and account age, and ask them to confirm.
  3. اربط الحساب بالزبونBind the account to the customerعند التأكيد استدعِ bind برقم الزبون في موقعك. الربط خاص بحساب الاستقبال (to_address) — فكل موقع وزبائنه منفصلون حتى لو تكرّر رقم الزبون.On confirm, call bind with 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.
  4. أرسل customer_id مع كل فاتورةSend customer_id with each invoiceأضِف customer_id إلى إنشاء الفاتورة. يحتوي الرد على payer. وإن أردت أن يُدخل الزبون رقم العملية أيضاً أضِف verify_mode=tx_ref (التفاصيل).Add customer_id to invoice creation. The response includes payer. If you also want the customer to enter the transaction number, add verify_mode=tx_ref (details).
GET?resource=shamcash&action=lookupمعلومات حساب من عنوانهLook up an account by address⌄
المعاملParameterالنوعTypeإلزاميRequiredالشرحDescription
to_addressstringنعمYesحساب الاستقبال acc_…Receiving account acc_…
addressstringنعم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);
JSON
{
  "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_addressstringنعمYesحساب الاستقبال acc_…Receiving account acc_…
customer_idstringنعمYesرقم الزبون في موقعك (حتى 64 حرفاً: أحرف وأرقام و. : @ - _)Your customer ID (up to 64 chars: letters, digits and . : @ - _)
addressstringنعم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_addressstringنعمYesحساب الاستقبالReceiving account
customer_idstringنعم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_addressstringنعمYesحساب الاستقبالReceiving account
customer_idstringنعم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);
JSON
"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.

Headers
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.

Body
{
  "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. لا تُقبل الروابط التي تشير إلى عناوين داخلية أو محجوزة.https URLs 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 by metadata (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.

cURL
الردResponse
لم يُرسل أي طلب بعد.No request sent yet.