Vérifier les Détails du Produit
curl --request GET \
--url https://api.oneclickdz.com/v3/gift-cards/checkProduct/{productId} \
--header 'X-Access-Token: <api-key>'import requests
url = "https://api.oneclickdz.com/v3/gift-cards/checkProduct/{productId}"
headers = {"X-Access-Token": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'X-Access-Token': '<api-key>'}};
fetch('https://api.oneclickdz.com/v3/gift-cards/checkProduct/{productId}', 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/gift-cards/checkProduct/{productId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
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/gift-cards/checkProduct/{productId}"
req, _ := http.NewRequest("GET", 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.get("https://api.oneclickdz.com/v3/gift-cards/checkProduct/{productId}")
.header("X-Access-Token", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.oneclickdz.com/v3/gift-cards/checkProduct/{productId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-Access-Token"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"data": {
"types": [
{
"id": "<string>",
"name": "<string>",
"price": 123,
"quantity": 123
}
]
}
}Cartes cadeaux
Vérifier les Détails du Produit
Obtenez les tarifs détaillés, les dénominations et le stock pour un produit spécifique
GET
/
v3
/
gift-cards
/
checkProduct
/
{productId}
Vérifier les Détails du Produit
curl --request GET \
--url https://api.oneclickdz.com/v3/gift-cards/checkProduct/{productId} \
--header 'X-Access-Token: <api-key>'import requests
url = "https://api.oneclickdz.com/v3/gift-cards/checkProduct/{productId}"
headers = {"X-Access-Token": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'X-Access-Token': '<api-key>'}};
fetch('https://api.oneclickdz.com/v3/gift-cards/checkProduct/{productId}', 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/gift-cards/checkProduct/{productId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
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/gift-cards/checkProduct/{productId}"
req, _ := http.NewRequest("GET", 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.get("https://api.oneclickdz.com/v3/gift-cards/checkProduct/{productId}")
.header("X-Access-Token", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.oneclickdz.com/v3/gift-cards/checkProduct/{productId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-Access-Token"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"data": {
"types": [
{
"id": "<string>",
"name": "<string>",
"price": 123,
"quantity": 123
}
]
}
}Vue d’ensemble
Retourne les types/dénominations de produit avec les tarifs en temps réel et la disponibilité du stock.Les prix sont personnalisés selon votre compte. Supprimez
cost avant de l’afficher aux utilisateurs.Paramètres de chemin
string
requis
ID du produit depuis l’endpoint
/catalogRéponse
object
Exemples
curl https://api.oneclickdz.com/v3/gift-cards/checkProduct/507f1f77bcf86cd799439011 \
-H "X-Access-Token: YOUR_API_KEY"
const productId = "507f1f77bcf86cd799439011";
const response = await fetch(
`https://api.oneclickdz.com/v3/gift-cards/checkProduct/${productId}`,
{ headers: { "X-Access-Token": "YOUR_API_KEY" } }
);
const { data } = await response.json();
// Filter in-stock items
const available = data.types.filter((t) => t.quantity > 0);
product_id = '507f1f77bcf86cd799439011'
response = requests.get(
f'https://api.oneclickdz.com/v3/gift-cards/checkProduct/{product_id}',
headers={'X-Access-Token': 'YOUR_API_KEY'}
)
types = response.json()['data']['types']
# Filter available
available = [t for t in types if t['quantity'] > 0]
<?php
$productId = '507f1f77bcf86cd799439011';
$ch = curl_init("https://api.oneclickdz.com/v3/gift-cards/checkProduct/{$productId}");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, ['X-Access-Token: YOUR_API_KEY']);
$response = curl_exec($ch);
$data = json_decode($response, true);
$types = $data['data']['types'];
// Filter available
$available = array_filter($types, function($t) {
return $t['quantity'] > 0;
});
?>
Exemple de réponse
{
"success": true,
"data": {
"productId": "507f1f77bcf86cd799439011",
"productTitle": "PlayStation Network",
"types": [
{
"id": "type_001",
"name": "PSN 500 DA",
"price": 490,
"quantity": 150
},
{
"id": "type_002",
"name": "PSN 1000 DA",
"price": 980,
"quantity": 87
},
{
"id": "type_003",
"name": "PSN 2000 DA",
"price": 1960,
"quantity": 0
}
]
},
"meta": {
"timestamp": "2025-10-29T01:00:00.000Z"
},
"requestId": "req_1730163600_xyz789"
}
Appliquer votre marge bénéficiaire
function applyMarkup(types, markupPercent = 5) {
return types
.filter((t) => t.quantity > 0)
.map((t) => ({
id: t.id,
name: t.name,
price: Math.ceil(t.price * (1 + markupPercent / 100)),
available: true,
}));
}
// Usage
const customerPrices = applyMarkup(data.types, 5); // 5% markup
Bonnes pratiques
Vérifier le stock
Vérifiez
quantity > 0 avant d’afficherAppliquer une marge
Ajoutez votre marge bénéficiaire au
priceMasquer le prix
N’affichez jamais le
price en gros aux clientsMettre à jour régulièrement
Rafraîchissez le stock périodiquement
Liens utiles
Obtenir le Catalogue
Parcourir tous les produits
Passer une Commande
Acheter un produit
⌘I

