Payer une Facture
curl --request POST \
--url https://api.oneclickdz.com/v3/bills/pay \
--header 'Content-Type: application/json' \
--header 'X-Access-Token: <api-key>' \
--data '
{
"transactionId": "<string>",
"billId": "<string>",
"billIds": [
"<string>"
],
"ref": "<string>"
}
'import requests
url = "https://api.oneclickdz.com/v3/bills/pay"
payload = {
"transactionId": "<string>",
"billId": "<string>",
"billIds": ["<string>"],
"ref": "<string>"
}
headers = {
"X-Access-Token": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-Access-Token': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
transactionId: '<string>',
billId: '<string>',
billIds: ['<string>'],
ref: '<string>'
})
};
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_POSTFIELDS => json_encode([
'transactionId' => '<string>',
'billId' => '<string>',
'billIds' => [
'<string>'
],
'ref' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"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"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.oneclickdz.com/v3/bills/pay"
payload := strings.NewReader("{\n \"transactionId\": \"<string>\",\n \"billId\": \"<string>\",\n \"billIds\": [\n \"<string>\"\n ],\n \"ref\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-Access-Token", "<api-key>")
req.Header.Add("Content-Type", "application/json")
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>")
.header("Content-Type", "application/json")
.body("{\n \"transactionId\": \"<string>\",\n \"billId\": \"<string>\",\n \"billIds\": [\n \"<string>\"\n ],\n \"ref\": \"<string>\"\n}")
.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>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"transactionId\": \"<string>\",\n \"billId\": \"<string>\",\n \"billIds\": [\n \"<string>\"\n ],\n \"ref\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"transactionId": "<string>",
"ref": "<string>",
"status": "<string>"
}
}Paiement de factures
Payer une Facture
Payez une ou plusieurs factures d’une découverte READY
POST
/
v3
/
bills
/
pay
Payer une Facture
curl --request POST \
--url https://api.oneclickdz.com/v3/bills/pay \
--header 'Content-Type: application/json' \
--header 'X-Access-Token: <api-key>' \
--data '
{
"transactionId": "<string>",
"billId": "<string>",
"billIds": [
"<string>"
],
"ref": "<string>"
}
'import requests
url = "https://api.oneclickdz.com/v3/bills/pay"
payload = {
"transactionId": "<string>",
"billId": "<string>",
"billIds": ["<string>"],
"ref": "<string>"
}
headers = {
"X-Access-Token": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-Access-Token': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
transactionId: '<string>',
billId: '<string>',
billIds: ['<string>'],
ref: '<string>'
})
};
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_POSTFIELDS => json_encode([
'transactionId' => '<string>',
'billId' => '<string>',
'billIds' => [
'<string>'
],
'ref' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"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"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.oneclickdz.com/v3/bills/pay"
payload := strings.NewReader("{\n \"transactionId\": \"<string>\",\n \"billId\": \"<string>\",\n \"billIds\": [\n \"<string>\"\n ],\n \"ref\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-Access-Token", "<api-key>")
req.Header.Add("Content-Type", "application/json")
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>")
.header("Content-Type", "application/json")
.body("{\n \"transactionId\": \"<string>\",\n \"billId\": \"<string>\",\n \"billIds\": [\n \"<string>\"\n ],\n \"ref\": \"<string>\"\n}")
.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>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"transactionId\": \"<string>\",\n \"billId\": \"<string>\",\n \"billIds\": [\n \"<string>\"\n ],\n \"ref\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"transactionId": "<string>",
"ref": "<string>",
"status": "<string>"
}
}Paie une facture, ou plusieurs factures en une seule commande, à partir d’une découverte dont le
En cas d’expiration réseau, lisez la transaction avant toute autre action :
status est READY. La réponse confirme que le paiement a été accepté ; le résultat se lit dans le status de la transaction (SUCCESS, FAILED ou REFUNDED).
Corps de la requête
string
requis
La découverte
READY, 24 caractères hexadécimaux.string
Un
billId issu de bills[] de cette transaction. Envoyez ce champ ou billIds.string[]
1 à 50
billId distincts issus de bills[], payés en une seule commande ; les frais sont la somme des fee des factures sélectionnées. Envoyez ce champ ou billId. Plusieurs identifiants ne sont acceptés que pour SEAAL ; tout autre partenaire répond 400 ERR_VALIDATION.string
requis
Une nouvelle référence pour ce paiement, jusqu’à 100 caractères. Elle doit différer de la
ref de découverte et de toute ref encore utilisée pour ce partenaire ; sinon 403 DUPLICATED_REF.Réponse
object
requis
Exemple
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
?>
Réponse
{
"success": true,
"data": {
"transactionId": "68cdf0a2b7c1e4d5f6a7b8c9",
"ref": "disc-20260920-0003",
"status": "PROCESSING"
},
"meta": { "timestamp": "2026-09-20T10:16:04.512Z" },
"requestId": "req_5f6g7h8i9j0k1l2m3n4o5p6q"
}
Montant débité
total sur la transaction = selectedBill.amount + selectedBill.fee. Pour une commande multi-factures, selectedBill.amount est la somme des factures sélectionnées et selectedBill.fee la somme de leurs frais ; selectedBills[] liste chaque facture. Les frais sont configurés par facturier et peuvent changer : affichez les valeurs renvoyées par l’API.
Erreurs
Renvoyées immédiatement ; rien n’est débité.| HTTP | Code | Signification |
|---|---|---|
| 400 | ERR_VALIDATION | transactionId invalide, billId/billIds tous deux présents ou tous deux absents, ref manquante |
| 401 | MISSING_ACCESS_TOKEN / INVALID_ACCESS_TOKEN | Clé manquante ou rejetée |
| 403 | DUPLICATED_REF | ref déjà utilisée pour ce partenaire, y compris la ref de découverte |
| 404 | NOT_FOUND | Transaction inconnue, ne vous appartenant pas, pas READY, ou un billId absent de ses bills[] |
| 409 | BILL_ALREADY_PAID | L’une des factures sélectionnées a déjà été payée via cette API |
| 409 | PAYMENT_IN_PROGRESS | Un paiement pour l’une des factures sélectionnées est déjà en cours |
| 503 | PARTNER_UNAVAILABLE | Le facturier est indisponible ; réessayez plus tard |
| 503 | AUTH_UNAVAILABLE | La clé n’a pas pu être vérifiée à temps ; réessayez après Retry-After |
PROCESSING ou un statut ultérieur signifie que le paiement a été accepté.

