Public API
REST API
Base path /api/v1. Authenticate with a store API key (wjh_…). All responses use the same JSON envelope: status, message, and data.
Base URL & envelope
Call the API on your Wijha API host under /api/v1. Successful and error responses share this shape:
{
"status": 200,
"message": "ok",
"data": { }
}HTTP status matches the status field (e.g. 201 for creates, 401/403/429 for auth and rate limits).
Authentication
Create an API key in Merchant Portal → Store settings → Developers → API keys. Send it with either header:
Authorization: Bearer wjh_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
# or
x-api-key: wjh_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxKeys are shown once at creation. Prefix format is always wjh_.
Rate limits
Limits are enforced per authenticated API key (and a separate IP pre-cap before auth):
- 120 requests per minute per API key
- 300 requests per minute per IP (pre-auth)
{
"status": 429,
"message": "Too many requests",
"data": null,
"code": "RATE_LIMITED"
}Scopes
Each key is granted one or more scopes. Missing scope → 403.
- orders.crud — create, read, update, cancel orders
- products.crud — create, read, update, delete products
- collections.crud — create, read, update, delete collections
- expenses.crud — create, read, update, delete expenses
- store.read — read store profile
- customers.read — read customers (customers.crud also grants read)
- analytics.read — read analytics hub
- discounts.read — read discount codes
- reviews.read — read product reviews
- shipping_fees.read — read client shipping fees by zone
- webhooks.read — list webhook endpoints, events and deliveries
- webhooks.write — create webhook endpoints, rotate secrets, send test events, redeliver
Enums reference
String enums returned and accepted by /api/v1. Use exact values (case-sensitive). Order status codes are the same ones Wijha operations use.
Order status (order.status)
| Value | Meaning |
|---|---|
| NEW | New — booked, not released for pickup yet |
| READY | Ready for pickup — released by the merchant (packing is recorded in packedAt; status stays READY) |
| PICKUP_ASSIGNED | Pickup assigned — a courier is on the way to collect |
| PICKED_UP | Picked up from the merchant |
| AT_HUB | At hub |
| IN_TRANSFER | In transfer between hubs |
| OUT_FOR_DELIVERY | Out for delivery |
| DELIVERED | Delivered — see outcome for full / partial / exchanged |
| EXCEPTION | Delivery failed — see exceptionReason |
| ON_HOLD | On hold — waiting for a merchant decision |
| RESCHEDULED | Rescheduled to a new delivery date |
| RETURNING | Returning to merchant |
| RETURN_OUT | Out for return — on the way to the merchant |
| RETURNED | Returned to merchant |
| CANCELLED | Cancelled (DELETE /orders/:id, allowed before pickup) |
| LOST | Lost |
| DAMAGED | Damaged |
| HANDED_TO_PARTNER | With partner carrier |
Status filter groups (GET /orders?status=)
| Value | Statuses |
|---|---|
| new | NEW |
| ready_for_pickup | READY, PICKUP_ASSIGNED |
| in_transit | PICKED_UP, AT_HUB, IN_TRANSFER, HANDED_TO_PARTNER |
| out_for_delivery | OUT_FOR_DELIVERY |
| needs_action | ON_HOLD, EXCEPTION |
| rescheduled | RESCHEDULED |
| delivered | DELIVERED |
| returning | RETURNING, RETURN_OUT |
| returned | RETURNED |
| cancelled | CANCELLED |
| lost_damaged | LOST, DAMAGED |
Order type (order.orderType)
| Value | Meaning |
|---|---|
| DLV_COD | Delivery, cash on delivery (default when payment.method is cod) |
| DLV_PRE | Delivery, prepaid — nothing to collect |
| EXC | Exchange — deliver a replacement and collect the original back |
| RET | Return pickup from the customer (requires parentOrderId) |
| RETURN_LEG | Return leg created by Wijha after a partial delivery or exchange — read-only |
Outcome (order.outcome)
| Value | Meaning |
|---|---|
| FULL | Everything delivered |
| PARTIAL | Customer kept part of the order (see lineItems[].deliveredQty) |
| EXCHANGED | Exchange completed |
| REFUSED | Customer refused the parcel |
| NOT_COLLECTED | Not collected from the customer (return pickups) |
Payment status (order.paymentStatus)
| Value | Meaning |
|---|---|
| UNPAID | Nothing collected yet |
| COLLECTED_CASH | COD cash collected by the courier |
| PAID_ONLINE | Paid before delivery |
| REFUNDED | Refunded to the customer |
Price type (order.priceType)
| Value | Meaning |
|---|---|
| INCLD | COD amount includes the shipping fee |
| EXCLD | Courier collects the goods amount plus the shipping fee |
Order channel (order.channel)
| Value | Meaning |
|---|---|
| manual | Created outside automation (API / ops) |
| portal | Created in Merchant Portal |
| storefront | Created from the live storefront checkout |
| shopify | Synced from Shopify (when connected) |
Payment method (order.payment.method)
| Value | Meaning |
|---|---|
| cod | Cash on delivery — typically set payment.codAmount |
| prepaid | Paid before ship (card / wallet / link) |
| other | Fallback for uncommon methods |
Delivery timing (order.deliveryTiming)
| Value | Meaning |
|---|---|
| pending | ETA not evaluated yet (usually before pickup) |
| on_time | Within estimated arrival window |
| early | Delivered / progressing earlier than ETA |
| late | Past estimated arrival |
Product / collection status
| Value | Meaning |
|---|---|
| active | Live / visible as configured |
| draft | Not published |
| archived | Hidden; kept for history (product delete may archive) |
Review status
| Value | Meaning |
|---|---|
| pending | Awaiting merchant moderation |
| approved | Visible on storefront |
| rejected | Rejected by merchant |
| hidden | Hidden from storefront |
Webhook events (subscribe via events[])
| Value | Meaning |
|---|---|
| order.created | New order |
| order.updated | Order fields changed |
| order.status_changed | Every order status event (engine code + label, from, to, reasonCode, outcome, attempts, waybillRef) |
| order.delivered | Delivered |
| order.delivery_failed | Delivery attempt failed |
| order.returned | Returned to the merchant |
| order.cancelled | Cancelled before pickup |
| order.return_leg_created | Return leg created |
| product.updated | Product created, updated, or deleted |
| collection.updated | Collection created, updated, or deleted |
| customer.created | New customer |
| customer.updated | Customer fields changed |
| inventory.adjusted | Stock level adjusted |
| stock.received | Inbound stock received |
Older lower-case status names (pending, waiting_for_pickup, ready, packed, shipped, delivered, returned, cancelled) are still accepted as filters and transition targets, but responses always use the codes above.
Order fields
Important properties on order objects from GET/POST/PATCH /orders. An order is its own shipment — the waybill, custody and delivery result live on the order itself.
Core
| Field | Meaning |
|---|---|
| id | Stable Wijha order id (use in paths) |
| number | Human-facing order number |
| status | Order status code — see enums |
| orderType | DLV_COD | DLV_PRE | EXC | RET | RETURN_LEG — see enums |
| channel | Where the order originated |
| customerId | Linked CRM customer id when matched |
| customerName | Buyer name snapshot |
| customerPhone | Buyer phone (prefer E.164 / local EG formats your store uses) |
| shippingAddress | Delivery address (line1, phone, zoneId, governorateCode, cityCode, state, city, area, …) |
| lineItems[] | Order lines — see Line items |
| payment | method + codAmount (EGP) + currency |
| paymentStatus | UNPAID | COLLECTED_CASH | PAID_ONLINE | REFUNDED |
| totals | subtotal, shipping, discount, total, currency |
| notes | Merchant / customer notes |
| tags | Order tags |
| version | Increases on every status change |
Waybill & delivery
| Field | Meaning |
|---|---|
| waybill | Wijha waybill number (shared by an order and its return legs) |
| waybillRef | Printed reference — the waybill, or WJ…-R1, -R2 on a return leg |
| legNo | 0 for the original order, 1.. for return legs |
| parentOrderId | Original order for EXC / RET / RETURN_LEG |
| fulfilmentSource | merchant | wijha (packed by the Wijha warehouse) |
| zoneId / hubId | Delivery zone and the hub handling the parcel |
| custodyType | Who holds the parcel: merchant, fulfilment, courier, hub, partner, customer, none |
| attempts | Doorstep delivery attempts so far |
| outcome | FULL | PARTIAL | EXCHANGED | REFUSED | NOT_COLLECTED (after delivery) |
| exceptionReason | Why delivery failed (status EXCEPTION) |
| serviceType | standard | express | same_day |
| priceType | INCLD | EXCLD — whether the COD amount includes shipping |
| allowOpen | Customer may open the parcel before paying |
| otpRequired | Customer must confirm delivery with a one-time code |
| partialAllowed | Customer may keep only part of the order |
| weightGrams / dimensionsCm | Parcel weight and size when given |
| labelUrl | Waybill label URL when available |
| awbPrintedAt | When the waybill was marked printed |
| feeSnapshot | Shipping fee quote at booking (breakdown); null when not quoted |
| estimatedDeliveryAt / deliveryTiming | ETA after pickup; on_time / early / late / pending |
Money in piasters (1 EGP = 100)
| Field | Meaning |
|---|---|
| codAmountPiasters | Cash the courier collects (EGP × 100) |
| codDuePiasters | Cash still due after a partial delivery |
| declaredValuePiasters | Declared goods value for insurance |
Timestamps (ISO)
| Field | Meaning |
|---|---|
| createdAt / updatedAt | Created / last changed |
| statusChangedAt | Last status change |
| packedAt | Packing recorded |
| pickedUpAt | Picked up from the merchant |
| firstAtHubAt / lastAtHubAt | First and latest hub scan |
| deliveredAt | Delivered |
| returnedAt | Returned to the merchant |
| cancelledAt | Cancelled |
Line items
| Field | Meaning |
|---|---|
| id | Line id (returned on read) |
| lineNo | Line position (1, 2, …) |
| variantId | Catalog variant id (required on create) |
| productId | Parent product id |
| sku | Stock-keeping unit — used for fulfill / warehouse match |
| qty | Ordered quantity |
| price | Unit sell price snapshot |
| deliveredQty | Quantity the customer accepted at delivery |
| fulfilledQty / returnedQty | Packed and returned quantities |
| unitCost | COGS snapshot at create (for profit) |
| costSource | variant | stock | missing |
| imageUrl | Line thumb snapshot when available |
Deprecated (still returned — move off them)
| Field | Use instead |
|---|---|
| shipmentServiceType | orderType |
| fulfilledByWijha | fulfilmentSource === "wijha" |
| shipping.trackingNumber / shipping.waybill | waybillRef |
| shipping.status | status (same value) |
| shipping.failureReason | exceptionReason |
| shipping.deliveryAttempts | attempts |
| shipping.courierCost | feeSnapshot |
Removed: shipmentIds, shipping.shipmentId, shipping.error and failureReasonId. DELETE /orders/:id cancels (allowed before pickup) — it does not hard-delete history.
Create & update fields
POST /orders accepts these on top of customer, shippingAddress, lineItems, payment, totals, notes and tags. All are optional unless noted.
POST /orders
| Field | Meaning |
|---|---|
| orderType | DLV_COD | DLV_PRE | EXC | RET. Default: DLV_COD when payment.method is cod, else DLV_PRE |
| shippingAddress.zoneId | Delivery zone id from GET /zones (recommended). Without it, send state (governorate) + city / area and Wijha matches the zone; an address that doesn't match still books and waits in the address-fix queue |
| shippingAddress.state / city / area | Governorate, city and zone names (filled from the zone when you send zoneId) |
| shippingAddress.sectorId | Deprecated — read as zoneId for one release (mega areas are retired) |
| waybill | Pre-printed waybill (flyer) number; otherwise Wijha assigns one |
| weightGrams | Parcel weight in grams |
| dimensionsCm | { lengthCm, widthCm, heightCm } |
| declaredValue | Declared goods value in EGP (returned as declaredValuePiasters) |
| serviceType | standard | express | same_day |
| priceType | INCLD | EXCLD — overrides your contract default |
| allowOpen / otpRequired / partialAllowed | Booleans — override your contract defaults |
| parentOrderId | Original order — required for RET, optional for EXC |
| exchangeReturnItems[] / exchangeReturnNote | EXC only: what the courier collects back ({ sku, qty }) |
PATCH /orders/:id
| Field | Meaning |
|---|---|
| customerName / customerPhone | Buyer details |
| shippingAddress | Delivery address |
| payment | method / codAmount / currency |
| notes / tags | Notes and tags |
Orders are locked for edits once picked up (PICKED_UP onwards) or cancelled. If Wijha cannot book the delivery yet (no zone, quote or waybill), the order is still created with status NEW and shows as a booking issue in Merchant Portal. An order that breaks the order-type rules (COD on a prepaid order, a return without a delivered parent, more units than were delivered, partial delivery not in your contract, COD over your cap, a cash refund at the door) is refused with 400 VALIDATION_ERROR and details { code: "BOOKING_INVALID", fieldErrors: [{ field, code, message }] }, field names as in this request (lineItems[0].qty, payment.codAmount, parentOrderId …).
Product fields
Important properties on product objects from /products.
Product
| Field | Meaning |
|---|---|
| id | Stable product id |
| title | Display name |
| sku | Product-level SKU when used |
| status | active | draft | archived |
| description / descriptionHtml | Long copy (plain / HTML) |
| tags | String tags (e.g. import markers) |
| collectionIds | Membership in merchant collections |
| variants[] | Sellable variants (price, sku, inventory, options) |
| media / mediaUrls | Image paths or absolute CDN URLs |
| trackInventory | Whether stock is enforced |
| inventoryPolicy | e.g. deny — block oversell when tracking |
| storeQuantity | Aggregated sellable qty across variants |
| categoryId / subcategoryId | Catalog taxonomy ids when set |
| brand | Brand label when set |
| price / currency | Display price helpers when present |
| importSource | Import channel when product was imported (e.g. vondera) |
| importExternalId | External id from the import source (sync / idempotency) |
| warehouseQuantity | Wijha warehouse on-hand when store is warehouse-enrolled |
| shopifyProductId | Linked Shopify product id when connected |
Variant
| Field | Meaning |
|---|---|
| id | Variant id (use on order lineItems.variantId) |
| sku | Unique per-store SKU |
| title | Variant title (e.g. size label) |
| price | Sell price |
| compareAtPrice | Compare-at / was price |
| attributes | Option map e.g. { Size: "M", Color: "Black" } |
| inventoryQuantity | On-hand / sellable qty for this variant |
| cost | Unit COGS when set (finance / profit) |
| barcode | Barcode when set |
| weightGrams | Variant weight when set |
| hsCode / taxCode | Customs / tax codes when set |
Shipping fee fields
Delivery zones and the client shipping fee charged per zone. GET /zones (scope orders.read, orders.write or shipping_fees.read) lists the zones Wijha delivers to, as governorate → city → zone with Arabic and English names; filter with q (name, code or alias), governorateCode and cityId. The default client fee for a zone is Wijha's quoted fee for your store (standard parcel, incl. VAT); your override wins.
Shipping fee zone (GET /shipping-fees)
| Field | Meaning |
|---|---|
| zoneId / zoneCode | Delivery zone (pass zoneId to /shipping-fees/resolve and in shippingAddress.zoneId) |
| zoneName / cityName / governorateCode / governorateName | Zone, city and governorate |
| defaultFee | Wijha's quoted fee for your store to this zone, incl. VAT (null when the zone isn't priced) |
| overrideFee | Store override fee (null when using the default) |
| effectiveFee | overrideFee ?? defaultFee — the fee charged to the customer |
| currency | Fee currency (usually EGP) |
| isOverride | True when the store overrode the Wijha default |
| source | default | override | none |
| slaDays / estimatedArrivalHours | Zone delivery SLA in days (and hours) from the parcel's first arrival at a Wijha hub |
| sectorId / sectorName / govId / govName | Deprecated aliases of zoneId / zoneName / governorateCode / governorateName (one release) |
Resolved fee (GET /shipping-fees/resolve)
| Field | Meaning |
|---|---|
| zoneId | Delivery zone id |
| amount | Effective fee for the zone (0 when source is none) |
| currency | Fee currency |
| source | default | override | none |
| defaultFee / overrideFee | Underlying default and store override values |
GET /shipping-fees accepts optional q (search), governorateCode, cityId, limit and overriddenOnly=1 query params. GET /shipping-fees/resolve takes zoneId (sectorId is accepted as its old name for one release).
Orders
Scope: orders.crud. Filter the list with status (a code or a filter group, comma-separated) and orderType. DELETE cancels the order (status transition) — there is no hard delete.
GET /api/v1/orders?pageSize=20&status=in_transit,out_for_delivery
Authorization: Bearer wjh_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Accept: application/json{
"status": 200,
"message": "ok",
"data": {
"items": [
{
"id": "ord_01JABC",
"number": "10042",
"status": "OUT_FOR_DELIVERY",
"orderType": "DLV_COD",
"waybill": "WJ473124829",
"waybillRef": "WJ473124829",
"attempts": 0,
"paymentStatus": "UNPAID",
"customerName": "Ahmed Hassan",
"customerPhone": "+201012345678",
"payment": { "method": "cod", "codAmount": 495, "currency": "EGP" },
"codAmountPiasters": 49500,
"totals": { "subtotal": 450, "shipping": 45, "total": 495, "currency": "EGP" },
"createdAt": "2026-10-08T17:12:04.000Z"
}
],
"nextPageToken": null
}
}POST /api/v1/orders
Authorization: Bearer wjh_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Content-Type: application/json
{
"orderType": "DLV_COD",
"customerName": "Ahmed Hassan",
"customerPhone": "+201012345678",
"shippingAddress": {
"line1": "12 Nile St",
"phone": "+201012345678",
"zoneId": "zon_01JNASR7"
},
"lineItems": [
{
"productId": "prd_01J",
"variantId": "var_01J",
"sku": "TEE-BLK-M",
"title": "Cotton tee",
"qty": 2,
"price": 225
}
],
"payment": { "method": "cod", "codAmount": 495, "currency": "EGP" },
"weightGrams": 600,
"allowOpen": true
}{
"status": 201,
"message": "created",
"data": {
"id": "ord_01JABC",
"number": "10042",
"status": "NEW",
"orderType": "DLV_COD",
"channel": "portal",
"waybill": "WJ473124829",
"waybillRef": "WJ473124829",
"legNo": 0,
"fulfilmentSource": "merchant",
"zoneId": "zon_cai_nasr",
"custodyType": "merchant",
"attempts": 0,
"paymentStatus": "UNPAID",
"priceType": "INCLD",
"allowOpen": true,
"otpRequired": false,
"partialAllowed": false,
"serviceType": "standard",
"codAmountPiasters": 49500,
"codDuePiasters": 49500,
"declaredValuePiasters": 0,
"weightGrams": 600,
"customerName": "Ahmed Hassan",
"customerPhone": "+201012345678",
"lineItems": [
{
"id": "itm_01J",
"lineNo": 1,
"variantId": "var_01J",
"productId": "prd_01J",
"sku": "TEE-BLK-M",
"title": "Cotton tee",
"qty": 2,
"price": 225,
"unitCost": 80,
"costSource": "variant"
}
],
"payment": { "method": "cod", "codAmount": 495, "currency": "EGP" },
"totals": { "subtotal": 450, "shipping": 45, "total": 495, "currency": "EGP" },
"labelUrl": "https://labels.example.com/WJ473124829.pdf",
"version": 1,
"createdAt": "2026-10-08T17:12:04.000Z",
"updatedAt": "2026-10-08T17:12:04.000Z"
}
}POST /api/v1/orders/ord_01JABC/transition
Authorization: Bearer wjh_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Content-Type: application/json
{ "status": "READY" }{
"status": 200,
"message": "ok",
"data": {
"id": "ord_01JABC",
"number": "10042",
"status": "READY",
"statusChangedAt": "2026-10-08T17:30:00.000Z",
"version": 2
}
}DELETE /api/v1/orders/ord_01JABC
Authorization: Bearer wjh_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx{
"status": 200,
"message": "cancelled",
"data": {
"id": "ord_01JABC",
"status": "CANCELLED",
"cancelledAt": "2026-10-08T18:00:00.000Z"
}
}Also: GET /api/v1/orders/:id and PATCH /api/v1/orders/:id. POST /orders/:id/transition takes { status }: you can move NEW ↔ READY and cancel before pickup; every later status is set by Wijha operations (403 otherwise).
Products
Scope: products.crud.
GET /api/v1/products?pageSize=20
Authorization: Bearer wjh_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Accept: application/json{
"status": 200,
"message": "ok",
"data": {
"items": [
{
"id": "prd_01J",
"title": "Cotton tee",
"status": "active",
"sku": "TEE-BLK",
"slug": "cotton-tee",
"brand": "Demo",
"categoryId": "apparel",
"subcategoryId": "tshirts",
"description": "Soft cotton tee",
"descriptionHtml": "<p>Soft cotton tee</p>",
"tags": ["basics"],
"collectionIds": ["col_01J"],
"seo": { "title": "Cotton tee", "description": "Soft cotton tee" },
"media": ["media/tee.jpg"],
"mediaUrls": ["https://cdn.example.com/media/tee.jpg"],
"trackInventory": true,
"inventoryPolicy": "deny",
"storeQuantity": 24,
"warehouseQuantity": 10,
"importSource": "vondera",
"importExternalId": "43254206",
"variants": [
{
"id": "var_01J",
"sku": "TEE-BLK-M",
"title": "M",
"price": 225,
"compareAtPrice": 275,
"cost": 80,
"barcode": "6220000000000",
"attributes": { "Color": "Black", "Size": "M" },
"inventoryQuantity": 12,
"weightGrams": 180
}
]
}
],
"nextPageToken": null,
"warehouseEnrolled": true
}
}POST /api/v1/products
Authorization: Bearer wjh_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Content-Type: application/json
{
"title": "Cotton tee",
"sku": "TEE-BLK",
"status": "active",
"description": "Soft cotton tee",
"variants": [
{
"sku": "TEE-BLK-M",
"price": 225,
"compareAtPrice": 275,
"cost": 80,
"attributes": { "Color": "Black", "Size": "M" },
"inventoryQuantity": 12
}
]
}{
"status": 201,
"message": "created",
"data": {
"id": "prd_01J",
"title": "Cotton tee",
"sku": "TEE-BLK",
"status": "active",
"storeQuantity": 12,
"variants": [
{
"id": "var_01J",
"sku": "TEE-BLK-M",
"price": 225,
"compareAtPrice": 275,
"cost": 80,
"attributes": { "Color": "Black", "Size": "M" },
"inventoryQuantity": 12
}
]
}
}Also: GET / PATCH / DELETE /api/v1/products/:id.
Collections
Scope: collections.crud. Merchant product groupings (not catalog taxonomy categories).
GET /api/v1/collections
Authorization: Bearer wjh_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Accept: application/json{
"status": 200,
"message": "ok",
"data": {
"items": [
{ "id": "col_01J", "title": "Summer", "slug": "summer", "status": "active" }
],
"nextPageToken": null
}
}POST /api/v1/collections
Authorization: Bearer wjh_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Content-Type: application/json
{
"title": "Summer",
"slug": "summer",
"status": "active",
"productIds": ["prd_01J"]
}{
"status": 201,
"message": "created",
"data": {
"id": "col_01J",
"title": "Summer",
"slug": "summer",
"status": "active",
"productIds": ["prd_01J"]
}
}Expenses
Scope: expenses.crud.
GET /api/v1/expenses?from=2026-10-01&to=2026-10-31
Authorization: Bearer wjh_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Accept: application/json{
"status": 200,
"message": "ok",
"data": {
"items": [
{
"id": "exp_01J",
"categoryName": "Rent",
"amount": 5000,
"currency": "EGP",
"expenseDate": "2026-10-01"
}
]
}
}POST /api/v1/expenses
Authorization: Bearer wjh_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Content-Type: application/json
{
"categoryId": "cat_rent",
"amount": 5000,
"currency": "EGP",
"expenseDate": "2026-10-01",
"vendor": "Landlord Co",
"notes": "October rent",
"recurringRule": "monthly"
}{
"status": 201,
"message": "created",
"data": {
"id": "exp_01J",
"categoryId": "cat_rent",
"categoryName": "Rent",
"amount": 5000,
"currency": "EGP",
"expenseDate": "2026-10-01",
"vendor": "Landlord Co",
"recurringRule": "monthly"
}
}Also: GET / PATCH / DELETE /api/v1/expenses/:id.
Analytics
Scope: analytics.read. Query from / to as YYYY-MM-DD.
GET /api/v1/analytics?from=2026-10-01&to=2026-10-17
Authorization: Bearer wjh_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Accept: application/json{
"status": 200,
"message": "ok",
"data": {
"from": "2026-10-01",
"to": "2026-10-17",
"summary": {
"orders": 128,
"revenue": 64250,
"currency": "EGP"
},
"series": [
{ "day": "2026-10-01", "orders": 8, "revenue": 4200 }
]
}
}Discount codes
Scope: discounts.read (read-only).
GET /api/v1/discounts
Authorization: Bearer wjh_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Accept: application/json{
"status": 200,
"message": "ok",
"data": {
"items": [
{
"id": "dsc_01J",
"code": "SUMMER10",
"type": "percent",
"value": 10,
"active": true
}
]
}
}Also: GET /api/v1/discounts/:id.
Customers
Scope: customers.read (or customers.crud). Read-only on /api/v1.
GET /api/v1/customers?pageSize=20
Authorization: Bearer wjh_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Accept: application/json{
"status": 200,
"message": "ok",
"data": {
"items": [
{
"id": "cus_01JDEF",
"name": "Ahmed Hassan",
"phone": "+201012345678",
"email": "ahmed@example.com"
}
],
"nextPageToken": null
}
}Also: GET /api/v1/customers/:id.
Reviews
Scope: reviews.read.
GET /api/v1/reviews?status=approved&limit=20
Authorization: Bearer wjh_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Accept: application/json{
"status": 200,
"message": "ok",
"data": {
"items": [
{
"id": "rev_01J",
"productId": "prd_01J",
"rating": 5,
"body": "Great quality",
"status": "approved",
"createdAt": "2026-10-08T10:00:00.000Z"
}
]
}
}Also: GET /api/v1/reviews/:id.
Delivery zones and client shipping fees
GET /zones (scope orders.read, orders.write or shipping_fees.read) lists the serviceable delivery zones, governorate → city → zone; send the chosen zoneId in shippingAddress.zoneId. Shipping fees (scope shipping_fees.read) are the per-zone fees charged to customers: Wijha's quote for your store, or your override. A refused booking answers 400 with details.code BOOKING_INVALID.
GET /api/v1/zones?governorateCode=EG-C&q=نصر
Authorization: Bearer wjh_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Accept: application/json{
"status": 200,
"message": "ok",
"data": {
"governorates": [{ "code": "EG-C", "nameAr": "القاهرة", "nameEn": "Cairo" }],
"tree": [
{
"code": "EG-C", "nameAr": "القاهرة", "nameEn": "Cairo",
"cities": [
{
"id": "cty_01JNASR", "code": "C-07", "nameAr": "مدينة نصر", "nameEn": "Nasr City",
"zones": [{ "id": "zon_01JNASR7", "code": "C-07-003", "nameAr": "الحي السابع", "nameEn": "7th District" }]
}
]
}
],
"items": [
{
"zoneId": "zon_01JNASR7", "zoneCode": "C-07-003", "nameAr": "الحي السابع", "nameEn": "7th District",
"cityId": "cty_01JNASR", "cityCode": "C-07", "cityNameAr": "مدينة نصر", "cityNameEn": "Nasr City",
"governorateCode": "EG-C", "governorateNameAr": "القاهرة", "governorateNameEn": "Cairo",
"slaDays": 2
}
],
"total": 1
}
}{
"status": 400,
"message": "Only 1 of Shirt can be collected",
"code": "VALIDATION_ERROR",
"details": {
"code": "BOOKING_INVALID",
"fieldErrors": [
{ "field": "lineItems[0].qty", "code": "QTY_OVER_LIMIT", "message": "Only 1 of Shirt can be collected" }
]
}
}GET /api/v1/shipping-fees?governorateCode=EG-C&limit=50
Authorization: Bearer wjh_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Accept: application/json{
"status": 200,
"message": "ok",
"data": {
"currency": "EGP",
"items": [
{
"zoneId": "zon_01JNASR7",
"zoneCode": "C-07-003",
"zoneName": "الحي السابع",
"cityName": "مدينة نصر",
"governorateCode": "EG-C",
"governorateName": "القاهرة",
"defaultFee": 45,
"overrideFee": null,
"effectiveFee": 45,
"currency": "EGP",
"isOverride": false,
"source": "default",
"slaDays": 2,
"estimatedArrivalHours": 48
}
]
}
}GET /api/v1/shipping-fees/resolve?zoneId=zon_01JNASR7
Authorization: Bearer wjh_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Accept: application/json{
"status": 200,
"message": "ok",
"data": {
"zoneId": "zon_01JNASR7",
"amount": 45,
"currency": "EGP",
"source": "default",
"defaultFee": 45,
"overrideFee": null
}
}Store info
Scope: store.read. Safe public profile only (no carrier secrets).
GET /api/v1/store
Authorization: Bearer wjh_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Accept: application/json{
"status": 200,
"message": "ok",
"data": {
"id": "str_01JSTORE",
"name": "Demo Store",
"slug": "demo-store",
"status": "active",
"country": "EG",
"timezone": "Africa/Cairo",
"currency": "EGP",
"contact": {
"supportEmail": "hello@example.com",
"supportPhone": "+201012345678",
"tagline": "Quality basics",
"logoUrl": "https://cdn.example.com/logo.png"
},
"createdAt": "2026-01-01T00:00:00.000Z",
"updatedAt": "2026-10-08T12:00:00.000Z"
}
}Webhooks (via API)
Scopes: webhooks.read to list endpoints and deliveries; webhooks.write to create, rotate secrets, send test events and redeliver. Same endpoints as the portal Developers → Webhooks UI.
GET /api/v1/webhooks/endpoints
Authorization: Bearer wjh_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Accept: application/json{
"status": 200,
"message": "ok",
"data": {
"items": [
{
"id": "wh_01J",
"nickname": "ERP sync",
"url": "https://example.com/wijha/hooks",
"events": ["order.created", "order.delivered", "order.delivery_failed"],
"active": true,
"hasSecret": true,
"secretHint": "whsec_…Q7xk"
}
],
"nextPageToken": null
}
}POST /api/v1/webhooks/endpoints
Authorization: Bearer wjh_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Content-Type: application/json
{
"url": "https://example.com/wijha/hooks",
"method": "POST",
"nickname": "ERP sync",
"events": ["order.created", "order.delivered", "order.delivery_failed"],
"active": true
}{
"status": 201,
"message": "created",
"data": {
"id": "wh_01J",
"url": "https://example.com/wijha/hooks",
"method": "POST",
"nickname": "ERP sync",
"events": ["order.created", "order.delivered", "order.delivery_failed"],
"hasSecret": true,
"secretHint": "whsec_…Q7xk",
"secret": "whsec_k2Vb…(shown once — store it now)…Q7xk",
"previousSecretExpiresAt": null,
"active": true,
"status": "active"
}
}Also: GET /api/v1/webhooks/events, GET /api/v1/webhooks/endpoints/:id, POST /api/v1/webhooks/endpoints/:id/rotate-secret, POST /api/v1/webhooks/endpoints/:id/test, GET /api/v1/webhooks/deliveries[/:id], POST /api/v1/webhooks/deliveries/:id/redeliver. See the Webhooks guide for signing.