دفع فاتورة
curl --request POST \
--url https://api.oneclickdz.com/v3/bills/pay \
--header 'X-Access-Token: <api-key>'import requests
url = "https://api.oneclickdz.com/v3/bills/pay"
headers = {"X-Access-Token": "<api-key>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {'X-Access-Token': '<api-key>'}};
fetch('https://api.oneclickdz.com/v3/bills/pay', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.oneclickdz.com/v3/bills/pay",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"X-Access-Token: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.oneclickdz.com/v3/bills/pay"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("X-Access-Token", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.oneclickdz.com/v3/bills/pay")
.header("X-Access-Token", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.oneclickdz.com/v3/bills/pay")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-Access-Token"] = '<api-key>'
response = http.request(request)
puts response.read_bodyدفع الفواتير
دفع فاتورة
دفع فاتورة واحدة أو عدة فواتير من اكتشاف بالحالة READY
POST
/
v3
/
bills
/
pay
دفع فاتورة
curl --request POST \
--url https://api.oneclickdz.com/v3/bills/pay \
--header 'X-Access-Token: <api-key>'import requests
url = "https://api.oneclickdz.com/v3/bills/pay"
headers = {"X-Access-Token": "<api-key>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {'X-Access-Token': '<api-key>'}};
fetch('https://api.oneclickdz.com/v3/bills/pay', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.oneclickdz.com/v3/bills/pay",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"X-Access-Token: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.oneclickdz.com/v3/bills/pay"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("X-Access-Token", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.oneclickdz.com/v3/bills/pay")
.header("X-Access-Token", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.oneclickdz.com/v3/bills/pay")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-Access-Token"] = '<api-key>'
response = http.request(request)
puts response.read_bodyتدفع فاتورة واحدة، أو عدة فواتير في طلب واحد، من اكتشاف تكون قيمة
عند انتهاء مهلة الشبكة، اقرأ المعاملة قبل القيام بأي شيء آخر: تعني
status الخاصة به READY. تؤكّد الاستجابة أن الدفعة قُبلت؛ أما النتيجة فتُقرأ من status الخاصة بالمعاملة (SUCCESS أو FAILED أو REFUNDED).جسم الطلب
string
مطلوب
الاكتشاف بالحالة
READY، من 24 حرفًا ست عشريًا.string
billId واحد من bills[] الخاصة بتلك المعاملة. أرسل هذا الحقل أو billIds.string[]
من 1 إلى 50 قيمة
billId مختلفة من bills[]، تُدفع في طلب واحد، ورسومها هي مجموع قيم fee للفواتير المختارة. أرسل هذا الحقل أو billId. لا يُقبل أكثر من معرّف واحد إلا لدى SEAAL؛ وأي شريك آخر يجيب بـ 400 ERR_VALIDATION.string
مطلوب
مرجع جديد لهذه الدفعة، حتى 100 حرف. يجب أن يختلف عن
ref الاكتشاف وعن أي ref لا يزال مستخدمًا لدى هذا الشريك؛ وإلا فالخطأ 403 DUPLICATED_REF.الاستجابة
object
مطلوب
مثال
curl -X POST https://api.oneclickdz.com/v3/bills/pay \
-H "X-Access-Token: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"transactionId": "68cdf0a2b7c1e4d5f6a7b8c9",
"billIds": ["F061612640", "F060286499"],
"ref": "disc-20260920-0003-pay"
}'
const response = await fetch("https://api.oneclickdz.com/v3/bills/pay", {
method: "POST",
headers: {
"X-Access-Token": process.env.ONECLICKDZ_API_KEY,
"Content-Type": "application/json",
},
body: JSON.stringify({
transactionId: "68cdf0a2b7c1e4d5f6a7b8c9",
billIds: ["F061612640", "F060286499"],
ref: "disc-20260920-0003-pay",
}),
});
const body = await response.json();
if (!body.success) throw new Error(`${body.error.code}: ${body.error.message}`);
// body.data.status === "PROCESSING" — poll the transaction for the outcome
import os, requests
response = requests.post(
"https://api.oneclickdz.com/v3/bills/pay",
headers={"X-Access-Token": os.environ["ONECLICKDZ_API_KEY"]},
json={
"transactionId": "68cdf0a2b7c1e4d5f6a7b8c9",
"billIds": ["F061612640", "F060286499"],
"ref": "disc-20260920-0003-pay",
},
)
body = response.json()
if not body["success"]:
raise RuntimeError(f'{body["error"]["code"]}: {body["error"]["message"]}')
# body["data"]["status"] == "PROCESSING" — poll the transaction for the outcome
<?php
$ch = curl_init("https://api.oneclickdz.com/v3/bills/pay");
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_POST => true,
CURLOPT_HTTPHEADER => [
"X-Access-Token: " . getenv("ONECLICKDZ_API_KEY"),
"Content-Type: application/json",
],
CURLOPT_POSTFIELDS => json_encode([
"transactionId" => "68cdf0a2b7c1e4d5f6a7b8c9",
"billIds" => ["F061612640", "F060286499"],
"ref" => "disc-20260920-0003-pay",
]),
]);
$body = json_decode(curl_exec($ch), true);
curl_close($ch);
if (!$body["success"]) {
throw new Exception($body["error"]["code"] . ": " . $body["error"]["message"]);
}
// $body["data"]["status"] === "PROCESSING" — poll the transaction for the outcome
?>
Response
{
"success": true,
"data": {
"transactionId": "68cdf0a2b7c1e4d5f6a7b8c9",
"ref": "disc-20260920-0003",
"status": "PROCESSING"
},
"meta": { "timestamp": "2026-09-20T10:16:04.512Z" },
"requestId": "req_5f6g7h8i9j0k1l2m3n4o5p6q"
}
ما يُخصم
قيمةtotal في المعاملة = selectedBill.amount + selectedBill.fee. في الطلب متعدد الفواتير، selectedBill.amount هو مجموع الفواتير المختارة وselectedBill.fee هي مجموع رسومها؛ وتسرد selectedBills[] كل فاتورة. تُضبط رسوم الخدمة لكل مُصدِر فاتورة وقد تتغيّر: اعرض القيم التي تُعيدها الواجهة.الأخطاء
تُعاد فورًا؛ ولا يُخصم أي مبلغ.| HTTP | الرمز | المعنى |
|---|---|---|
| 400 | ERR_VALIDATION | قيمة transactionId غير صالحة، أو إرسال billId/billIds معًا أو عدم إرسال أيّ منهما، أو غياب ref |
| 401 | MISSING_ACCESS_TOKEN / INVALID_ACCESS_TOKEN | المفتاح مفقود أو مرفوض |
| 403 | DUPLICATED_REF | قيمة ref مستخدمة مسبقًا لهذا الشريك، بما في ذلك ref الاكتشاف |
| 404 | NOT_FOUND | المعاملة غير معروفة، أو ليست لك، أو ليست بالحالة READY، أو أن billId غير موجود في bills[] الخاصة بها |
| 409 | BILL_ALREADY_PAID | إحدى الفواتير المختارة دُفعت مسبقًا عبر هذه الواجهة |
| 409 | PAYMENT_IN_PROGRESS | دفعة لإحدى الفواتير المختارة قيد التنفيذ مسبقًا |
| 503 | PARTNER_UNAVAILABLE | مُصدِر الفاتورة غير متاح؛ أعد المحاولة لاحقًا |
| 503 | AUTH_UNAVAILABLE | تعذّر التحقّق من المفتاح في الوقت المحدّد؛ أعد المحاولة بعد Retry-After |
PROCESSING أو ما بعدها أن الدفعة قُبلت.
