Orders
Record a customer confirmation
For WhatsApp and calling apps: report that the customer confirmed — or asked to cancel — an open order. It is written to the order's timeline and the merchant is notified; the order status itself is not changed (the merchant decides).
POST
https://elmatajer.com/api/v1/vendor/orders/{id}/customer-responsePermission:
orders.confirmPath parameters
| Name | Type | Required | Description |
|---|---|---|---|
id | integer | Yes | The order id. |
Request body
| Name | Type | Required | Description |
|---|---|---|---|
answer | string | Yes | confirmed or cancelled.
|
Request
curl -X POST "https://elmatajer.com/api/v1/vendor/orders/4904/customer-response" \
-H "Api-Key: YOUR_API_KEY" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-d '{"answer":"confirmed"}'
const res = await fetch("https://elmatajer.com/api/v1/vendor/orders/4904/customer-response", {
method: "POST",
headers: {
"Api-Key": process.env.ELMATAJER_API_KEY,
"Accept": "application/json",
"Content-Type": "application/json"
},
body: JSON.stringify({
"answer": "confirmed"
})
});
const data = await res.json();
$ch = curl_init("https://elmatajer.com/api/v1/vendor/orders/4904/customer-response");
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => ["Api-Key: " . getenv('ELMATAJER_API_KEY'), "Accept: application/json", "Content-Type: application/json"],
CURLOPT_POSTFIELDS => json_encode([
'answer' => 'confirmed'
]),
]);
$data = json_decode(curl_exec($ch), true);
Response 200
{
"status": "ok",
"data": {
"recorded": true,
"order_id": 4904,
"answer": "confirmed"
}
}
Once per answer per order: a repeat returns recorded: false, reason: already_recorded. A closed order returns 409 order_not_open.