Marks an order as successfully received and acknowledged by your POS system. This prevents the order from repeating in subsequent /get-current calls.
Critical: Always call this endpoint immediately after importing an order into your POS to prevent duplicate processing!
Path Parameters
string
required
Order’s payment_key (UUID) from the /get-current response
Headers
string
required
Your API access token
Response
boolean
true if successful
string
"OK" on success
Examples
curl -X PUT https://www.xn--dkkango-n2a.com/api/integrations/orders/success/3e9caf87-5cb7-4c4e-adcb-fc2ec54cf24e \ -H 'Access-Token: your-access-token'
const order = await getOrders();const paymentKey = order.payment_key; // Use payment_key, not id!const response = await fetch( `https://www.xn--dkkango-n2a.com/api/integrations/orders/success/${paymentKey}`, { method: 'PUT', headers: { 'Access-Token': 'your-access-token' } });const data = await response.json();// Order is now acknowledged
import requestsorder = await get_orders()payment_key = order['payment_key'] # Use payment_key, not id!response = requests.put( f'https://www.xn--dkkango-n2a.com/api/integrations/orders/success/{payment_key}', headers={'Access-Token': 'your-access-token'})data = response.json()# Order is now acknowledged
<?php$order = getOrders();$paymentKey = $order['payment_key']; // Use payment_key, not id!$url = "https://www.xn--dkkango-n2a.com/api/integrations/orders/success/{$paymentKey}";$ch = curl_init();curl_setopt($ch, CURLOPT_URL, $url);curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "PUT");curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);curl_setopt($ch, CURLOPT_HTTPHEADER, array( 'Access-Token: your-access-token'));$response = curl_exec($ch);curl_close($ch);// Order is now acknowledged?>
Success Response (200)
{ "status": true, "data": "OK"}
Error Responses
{ "status": false, "error": "yetkisiz erişim"}
{ "status": false, "error": "URL hatalı"}
{ "status": false, "error": "sipariş bulunamadı"}
Order Repetition Behavior
Key Concept: Orders repeat in /get-current responses until acknowledged with this endpoint.
Example Timeline
10:00:00 - Order 1031 created (RECEIVED)10:00:15 - GET /get-current → Returns order 1031 ✅10:00:45 - GET /get-current → Returns order 1031 ✅ (repeated!)10:01:00 - PUT /success/1031 → Acknowledged ✅10:01:30 - GET /get-current → Empty [] ✅10:02:00 - PUT /accept/1031 → Status changes to CONFIRMED10:02:15 - GET /get-current → Returns order 1031 ✅ (new status!)10:02:30 - PUT /success/1031 → Acknowledged for new status ✅
Why This Matters
Prevents Duplicate Processing
Without acknowledgment, the same order appears in every /get-current call, risking duplicate imports into your POS.
Ensures Reliability
If your POS crashes after receiving an order but before acknowledging it, the order will reappear when you restart.
Status Change Tracking
When an order’s status changes (RECEIVED → CONFIRMED → IN_DELIVERY), it appears again so you can track the progression.
When to Call
1
Fetch Order
Get order from /orders/get-current
2
Validate Data
Ensure order data is complete and valid
3
Import to POS
Save order in your local database/system
4
Acknowledge Immediately
Call /orders/success/{payment_key} right after successful import
Do NOT wait! Acknowledge immediately after importing. Don’t wait for staff to review or accept the order.
Integration Pattern
async function processOrders() { try { // 1. Fetch orders const response = await getOrders(); const orders = response.data; for (const order of orders) { try { // 2. Validate order if (!validateOrder(order)) { console.error('Invalid order:', order.id); continue; } // 3. Import to local database await importOrderToPOS(order); // 4. Acknowledge IMMEDIATELY await acknowledgeOrder(order.payment_key); console.log(`✅ Order ${order.id} imported and acknowledged`); // 5. Notify staff (after acknowledgment) notifyStaff('New order received', order); } catch (error) { console.error(`Failed to process order ${order.id}:`, error); // Don't acknowledge if import failed! } } } catch (error) { console.error('Error fetching orders:', error); }}// Poll every 30 secondssetInterval(processOrders, 30000);
Best Practices
✅ Good
❌ Bad
// Acknowledge immediately after importasync function handleOrder(order) { // Import await database.saveOrder(order); // Acknowledge right away await acknowledgeOrder(order.payment_key); // Then notify staff notifyStaff(order);}
// DON'T wait for staff action!async function handleOrder(order) { await database.saveOrder(order); // ❌ Don't do this! // Wait for staff to click "accept" button... await waitForStaffApproval(); // Too late - order might appear multiple times! await acknowledgeOrder(order.payment_key);}