Ingezha APIv1

Shipping API

Create shipments from your store or system, and read their status in real time. JSON over HTTPS.

المفتاح بيطلع من لوحة شركة الشحن ← «ربط المتاجر» ← «مفاتيح API» (أو من تطبيق التاجر ← إضافة ← ربط متجري). Shopify وWooCommerce وEasy Orders مش محتاجين برمجة — بيتربطوا من نفس الشاشة برابط webhook.

Authentication

Send your API key in the Authorization header (or X-Api-Key). Keys start with ingz_ and are shown only once when created. Base URL:

https://ingezha.com/api/v1
Authorization: Bearer ingz_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

A merchant key creates shipments for that merchant only. A company key (created by the shipping company's manager) must send merchant (merchant id, code or phone) with each shipment. Limit: 600 requests per 10 minutes per key.

Create a shipment

POST/api/v1/shipments
FieldType
receiver.namestringRequired
receiver.phonestringRequired — Egyptian mobile, any format (+20 10…, 010…)
receiver.addressstringRequired
receiver.citystringRequired — a city name from /cities. English governorate names (Cairo, Giza, Alexandria…) are matched automatically.
cod_amountnumberTotal the courier collects from the receiver (shipping fee included). The goods value is calculated as cod_amount − fee.
paymentcod | prepaidDefault cod. For prepaid send value instead of cod_amount — nothing is collected.
order_nostringYour order number. Sending the same order_no again returns the existing shipment (safe retries).
content, notesstringOptional
pieces, weightnumberOptional (weight in kg)
merchantstringCompany keys only
curl -X POST https://ingezha.com/api/v1/shipments \
  -H "Authorization: Bearer ingz_..." -H "Content-Type: application/json" \
  -d '{
    "order_no": "WEB-1001",
    "receiver": { "name": "Ahmed Ali", "phone": "01012345678", "address": "5 Tahrir St, Dokki", "city": "Giza" },
    "content": "2× T-shirt",
    "cod_amount": 350
  }'

Response 201:

{
  "ok": true,
  "shipment": {
    "code": "SH-242557", "orderNo": "WEB-1001", "status": "received", "statusLabel": "تم الاستلام",
    "city": "الجيزة", "fee": 45, "value": 305, "cod": 350, "collected": 0, "pay": "cod",
    "createdAt": "2026-10-10T14:54:40+00:00", "deliveredAt": null,
    "trackingUrl": "https://ingezha.com/your-company/track?c=SH-242557"
  }
}

Send trackingUrl to your customer — it is a public tracking page with the shipping company's branding.

Get a shipment

GET/api/v1/shipments/{code}

Returns the shipment plus history: [{ "status", "label", "note", "at" }].

List shipments

GET/api/v1/shipments?since=2026-10-01T00:00:00Z&status=delivered&order_no=WEB-1001

All filters are optional. Returns up to 100 shipments, most recently updated first. Poll with since = the time of your last sync to pick up status changes.

Cancel

POST/api/v1/shipments/{code}/cancel

Only while the status is received (not yet picked up). Otherwise returns 409.

Cities and fees

GET/api/v1/cities
{ "ok": true, "cities": [ { "name": "القاهرة", "fee": 45, "days": 1 }, { "name": "الجيزة", "fee": 45, "days": 1 } ] }

fee is the shipping price for your merchant account (special prices and discounts applied).

Statuses

statusMeaning
receivedRegistered, waiting for pickup
warehouseIn the shipping company's warehouse
outOut for delivery with a courier
postponedPostponed — see postponedTo and reason
deliveredDelivered — collected is the amount collected
returnedDelivery failed, returning — see reason
rtsReturned to the merchant
cancelledCancelled

Webhooks — status updates pushed to you

Instead of polling, add a webhook URL in the dashboard → Store connections → Webhooks (or from the merchant app → Add → Connect my store). You get a signing secret (whsec_…) once. We send a POST with a JSON body whenever one of your shipments is created or its status changes.

HeaderMeaning
X-Ingezha-Eventshipment.created, shipment.status or ping (test button)
X-Ingezha-DeliveryUnique delivery id — use it to ignore duplicates
X-Ingezha-Signaturesha256= + HMAC-SHA256 of the raw body with your secret
{
  "event": "shipment.status",
  "sentAt": "2026-10-11T13:05:00+00:00",
  "shipment": { "code": "SH-482910", "orderNo": "1042", "status": "delivered", "statusLabel": "تم التوصيل",
                "city": "الجيزة", "fee": 45, "value": 455, "cod": 500, "collected": 500, "pay": "cod",
                "trackingUrl": "https://ingezha.com/saree3/track?c=SH-482910", "...": "same fields as GET /shipments/{code}" }
}

Verify the signature

// PHP
$raw = file_get_contents('php://input');
$ok  = hash_equals('sha256=' . hash_hmac('sha256', $raw, 'whsec_...'), $_SERVER['HTTP_X_INGEZHA_SIGNATURE'] ?? '');

// Node.js (Express: use express.raw({type: 'application/json'}))
const sig = 'sha256=' + crypto.createHmac('sha256', 'whsec_...').update(req.body).digest('hex');
const ok = crypto.timingSafeEqual(Buffer.from(sig), Buffer.from(req.get('X-Ingezha-Signature') || ''));

Reply with any 2xx within 6 seconds. Anything else is retried after 1 min, 5 min, 30 min, 2 h, 6 h and 24 h. Webhooks for a merchant key only receive that merchant’s shipments; company-wide webhooks receive all.

Store webhooks (no code)

In the dashboard → Store connections → Connect a store, pick the platform. You get a unique webhook URL like https://ingezha.com/api/hooks/shopify/<token>. Every new order becomes a shipment automatically; orders with an unknown city wait in “Orders needing review”.

PlatformWhereEventSignature
ShopifySettings → Notifications → WebhooksOrder creation (JSON)The “signed with” key → paste as Secret
WooCommerceWooCommerce → Settings → Advanced → WebhooksOrder createdYour Secret → paste the same value
Easy OrdersPublic API → Webhooks → Create WebhookNew orderGenerated secret → paste as Secret

COD orders: the courier collects the order total. Paid orders (card / wallet) are shipped as prepaid.

Errors

{ "ok": false, "error": "invalid", "message": "رقم موبايل المستلم غير صحيح" }
HTTPerror
401authMissing or wrong key
402blockedThe shipping company's subscription is suspended
403lockedAPI is not on the company's plan
404not_foundShipment not found (or belongs to another merchant)
409stateAction not allowed in the current status
422invalid / merchantValidation error — message explains (Arabic)
429rateToo many requests