Cancel Order API (cancel-order)
The cancel-order endpoint cancels an order created via send-sms with a sendDateTime in the future, before it is dispatched to the carrier. Only orders that have not started sending can be cancelled; once the order enters the send pipeline, the cancel window has closed and the request returns 455.
Prerequisite: enable API access in the panel
Before calling this endpoint, the Allow API access toggle must be on in your iletiMerkezi panel.
Location:
panel.iletimerkezi.com→ Settings → Security → Access PermissionsIf it is off, every request returns
401 — Üyelik bilgileri hatalı("Authentication failed"). See authentication.md.
Endpoint
| Field | Value | |---|---| | Method | POST | | URL | https://api.iletimerkezi.com/v1/cancel-order/json | | Content-Type | application/json | | Auth | API Key + Hash (request.authentication) |
Request
Schema
request
├─ authentication
│ ├─ key (string, required)
│ └─ hash (string, required)
└─ order
└─ id (string|integer, required) — orderId returned by send-smsFull example
{
"request": {
"authentication": {
"key": "API_KEY",
"hash": "API_HASH"
},
"order": {
"id": "312891245"
}
}
}Response
Success (200)
{
"response": {
"status": {
"code": 200,
"message": "İşlem başarılı"
}
}
}İşlem başarılı means "Request successful" in Turkish. On success the body contains only status — no echoed order data. If you call get-report afterwards on the same order.id, the order is typically in status: 115 (could not be delivered) or returns 455 — Sipariş bulunamadı.
Error responses
401 — Üyelik bilgileri hatalı ("Authentication failed")
API key/hash mismatch or the panel toggle is off. See authentication.md.
455 — Sipariş bulunamadı ("Order not found")
Three possible causes:
- The
order.iddoes not belong to this account or has been removed. - The order has already entered the carrier queue and can no longer be cancelled.
- The order has already finished.
Before attempting cancellation, check the order with get-report: if order.status is 113 (in progress) or 114 (completed), the cancel window is closed.
Other error codes
For 400, 404: see error-codes.md.
Code samples
cURL
curl -X POST 'https://api.iletimerkezi.com/v1/cancel-order/json' \
-H 'Content-Type: application/json' \
-d '{
"request": {
"authentication": {
"key": "'"$ILETIMERKEZI_API_KEY"'",
"hash": "'"$ILETIMERKEZI_API_HASH"'"
},
"order": { "id": "312891245" }
}
}'Common pitfalls
- The cancel window is narrow. A future-scheduled order moves into the carrier queue as the dispatch time approaches. Once handed to the carrier it cannot be recalled; cancellation returns
455. 455is overloaded. "Not found" covers both an invalid ID and a valid order that is no longer cancellable. To disambiguate, callget-reportfirst and inspectorder.status:113or114means the cancel window has closed.- The response is minimal. A successful cancel returns only
response.status; noresponse.order. To verify state, re-fetch the order viaget-report. - Not idempotent. Calling
cancel-ordertwice on the sameorder.idreturns455on the second call. Persist the cancel result on the client and short-circuit retries. - No "cancel an immediate send". Orders submitted without
sendDateTimeare queued instantly; in practice there is no cancel window. This endpoint is meaningful only for future-scheduled orders.
Related
- Send SMS (send-sms) — create an order, schedule with
sendDateTime - Order report (get-report) — verify state before/after cancel
- Authentication
- Error code table
Last updated: 2026-04-30 · Türkçe