cURL
curl --request GET \ --url https://api.oneclickdz.com/v3/gift-cards/checkOrder/{orderId} \ --header 'X-Access-Token: <api-key>'
{ "data": { "status": "<string>", "quantity": 123, "fulfilled_quantity": 123, "fulfilled_amount": 123, "price_per_card": 123, "cards": [ { "value": "<string>", "serial": "<string>" } ] } }
Get order status and retrieve cards when fulfilled
/placeOrder
Show properties
Show card object
curl https://api.oneclickdz.com/v3/gift-cards/checkOrder/6901616fe9e88196b4eb64b3 \ -H "X-Access-Token: YOUR_API_KEY"
{ "success": true, "data": { "_id": "6901616fe9e88196b4eb64b3", "status": "HANDLING", "quantity": 2, "product": "507f1f77bcf86cd799439011", "type": "type_001", "time": "2025-10-29T01:00:00.000Z" } }
{ "success": true, "data": { "_id": "6901616fe9e88196b4eb64b3", "status": "FULFILLED", "quantity": 2, "fulfilled_quantity": 2, "fulfilled_amount": 980, "price_per_card": 490, "cards": [ { "value": "XXXX-XXXX-XXXX-XXXX", "serial": "123456789" }, { "value": "YYYY-YYYY-YYYY-YYYY", "serial": "987654321" } ], "time": "2025-10-29T01:00:00.000Z" } }
async function pollOrder(orderId) { const maxAttempts = 60; for (let i = 0; i < maxAttempts; i++) { const response = await fetch( `https://api.oneclickdz.com/v3/gift-cards/checkOrder/${orderId}`, { headers: { "X-Access-Token": process.env.API_KEY } } ); const { data } = await response.json(); if (["FULFILLED", "PARTIALLY_FILLED", "REFUNDED"].includes(data.status)) { return data; } await new Promise((resolve) => setTimeout(resolve, 5000)); } throw new Error("Timeout"); }
FULFILLED
fulfilled_quantity === quantity
cards
PARTIALLY_FILLED
fulfilled_quantity < quantity
REFUNDED
fulfilled_quantity === 0
// Good: Secure delivery async function deliverCards(userId, cards) { // Store encrypted await db.deliveredCards.insertMany( cards.map((c) => ({ userId, value: encrypt(c.value), serial: encrypt(c.serial), deliveredAt: new Date(), })) ); // Send via secure channel await sendSecureEmail(userId, cards); // Log without sensitive data logger.info("Cards delivered", { userId, count: cards.length }); }