Acknowledge Order
curl --request PUT \
--url https://www.xn--dkkango-n2a.com/api/integrations/orders/success/{order_id} \
--header 'Access-Token: <api-key>'import requests
url = "https://www.xn--dkkango-n2a.com/api/integrations/orders/success/{order_id}"
headers = {"Access-Token": "<api-key>"}
response = requests.put(url, headers=headers)
print(response.text)const options = {method: 'PUT', headers: {'Access-Token': '<api-key>'}};
fetch('https://www.xn--dkkango-n2a.com/api/integrations/orders/success/{order_id}', 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://www.xn--dkkango-n2a.com/api/integrations/orders/success/{order_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_HTTPHEADER => [
"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://www.xn--dkkango-n2a.com/api/integrations/orders/success/{order_id}"
req, _ := http.NewRequest("PUT", url, nil)
req.Header.Add("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.put("https://www.xn--dkkango-n2a.com/api/integrations/orders/success/{order_id}")
.header("Access-Token", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://www.xn--dkkango-n2a.com/api/integrations/orders/success/{order_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Access-Token"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"status": false,
"error": "yetkisiz erişim"
}
{
"status": false,
"error": "URL hatalı"
}
{
"status": false,
"error": "sipariş bulunamadı"
}
Orders
Acknowledge Order
Mark order as received/acknowledged
PUT
/
orders
/
success
/
{order_id}
Acknowledge Order
curl --request PUT \
--url https://www.xn--dkkango-n2a.com/api/integrations/orders/success/{order_id} \
--header 'Access-Token: <api-key>'import requests
url = "https://www.xn--dkkango-n2a.com/api/integrations/orders/success/{order_id}"
headers = {"Access-Token": "<api-key>"}
response = requests.put(url, headers=headers)
print(response.text)const options = {method: 'PUT', headers: {'Access-Token': '<api-key>'}};
fetch('https://www.xn--dkkango-n2a.com/api/integrations/orders/success/{order_id}', 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://www.xn--dkkango-n2a.com/api/integrations/orders/success/{order_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_HTTPHEADER => [
"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://www.xn--dkkango-n2a.com/api/integrations/orders/success/{order_id}"
req, _ := http.NewRequest("PUT", url, nil)
req.Header.Add("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.put("https://www.xn--dkkango-n2a.com/api/integrations/orders/success/{order_id}")
.header("Access-Token", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://www.xn--dkkango-n2a.com/api/integrations/orders/success/{order_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Access-Token"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"status": false,
"error": "yetkisiz erişim"
}
{
"status": false,
"error": "URL hatalı"
}
{
"status": false,
"error": "sipariş bulunamadı"
}
Overview
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 responseHeaders
string
required
Your API access token
Response
boolean
true if successfulstring
"OK" on successExamples
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 requests
order = 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 CONFIRMED
10: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
Prevents Duplicate Processing
Without acknowledgment, the same order appears in every
/get-current call, risking duplicate imports into your POS.Ensures Reliability
Ensures Reliability
If your POS crashes after receiving an order but before acknowledging it, the order will reappear when you restart.
Status Change Tracking
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-current2
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 importDo 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 seconds
setInterval(processOrders, 30000);
Best Practices
- ✅ Good
- ❌ Bad
// Acknowledge immediately after import
async 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);
}
Error Handling
async function acknowledgeWithRetry(paymentKey, maxRetries = 3) {
for (let attempt = 1; attempt <= maxRetries; attempt++) {
try {
await acknowledgeOrder(paymentKey);
return true;
} catch (error) {
console.error(`Acknowledge attempt ${attempt} failed:`, error);
if (attempt < maxRetries) {
// Wait before retry
await sleep(1000 * attempt);
} else {
// Log for manual intervention
await logFailedAcknowledgment(paymentKey, error);
return false;
}
}
}
}
Common Issues
Order keeps appearing in get-current
Order keeps appearing in get-current
Cause: Order hasn’t been acknowledged.Solution:
- Verify you’re calling
/successafter importing - Check for errors in the API response
- Ensure you’re using
payment_key(UUID), notid(integer)
Using wrong order ID
Using wrong order ID
Cause: Using
id (integer) instead of payment_key (UUID).Solution:// ❌ Wrong
await acknowledgeOrder(order.id); // 1031
// ✅ Correct
await acknowledgeOrder(order.payment_key); // "3e9caf87-..."
Order disappeared after acknowledge
Order disappeared after acknowledge
Cause: Order was acknowledged and status didn’t change yet.Solution: This is expected behavior! Order will reappear when status changes.
Related Endpoints
Get Current Orders
Fetch orders to acknowledge
Accept Order
Accept order after acknowledging
Order Lifecycle
Complete order flow guide