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:

Response envelope
{
  "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:

Headers
Authorization: Bearer wjh_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

# or
x-api-key: wjh_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

Keys 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)
429 response
{
  "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)

ValueMeaning
NEWNew — booked, not released for pickup yet
READYReady for pickup — released by the merchant (packing is recorded in packedAt; status stays READY)
PICKUP_ASSIGNEDPickup assigned — a courier is on the way to collect
PICKED_UPPicked up from the merchant
AT_HUBAt hub
IN_TRANSFERIn transfer between hubs
OUT_FOR_DELIVERYOut for delivery
DELIVEREDDelivered — see outcome for full / partial / exchanged
EXCEPTIONDelivery failed — see exceptionReason
ON_HOLDOn hold — waiting for a merchant decision
RESCHEDULEDRescheduled to a new delivery date
RETURNINGReturning to merchant
RETURN_OUTOut for return — on the way to the merchant
RETURNEDReturned to merchant
CANCELLEDCancelled (DELETE /orders/:id, allowed before pickup)
LOSTLost
DAMAGEDDamaged
HANDED_TO_PARTNERWith partner carrier

Status filter groups (GET /orders?status=)

ValueStatuses
newNEW
ready_for_pickupREADY, PICKUP_ASSIGNED
in_transitPICKED_UP, AT_HUB, IN_TRANSFER, HANDED_TO_PARTNER
out_for_deliveryOUT_FOR_DELIVERY
needs_actionON_HOLD, EXCEPTION
rescheduledRESCHEDULED
deliveredDELIVERED
returningRETURNING, RETURN_OUT
returnedRETURNED
cancelledCANCELLED
lost_damagedLOST, DAMAGED

Order type (order.orderType)

ValueMeaning
DLV_CODDelivery, cash on delivery (default when payment.method is cod)
DLV_PREDelivery, prepaid — nothing to collect
EXCExchange — deliver a replacement and collect the original back
RETReturn pickup from the customer (requires parentOrderId)
RETURN_LEGReturn leg created by Wijha after a partial delivery or exchange — read-only

Outcome (order.outcome)

ValueMeaning
FULLEverything delivered
PARTIALCustomer kept part of the order (see lineItems[].deliveredQty)
EXCHANGEDExchange completed
REFUSEDCustomer refused the parcel
NOT_COLLECTEDNot collected from the customer (return pickups)

Payment status (order.paymentStatus)

ValueMeaning
UNPAIDNothing collected yet
COLLECTED_CASHCOD cash collected by the courier
PAID_ONLINEPaid before delivery
REFUNDEDRefunded to the customer

Price type (order.priceType)

ValueMeaning
INCLDCOD amount includes the shipping fee
EXCLDCourier collects the goods amount plus the shipping fee

Order channel (order.channel)

ValueMeaning
manualCreated outside automation (API / ops)
portalCreated in Merchant Portal
storefrontCreated from the live storefront checkout
shopifySynced from Shopify (when connected)

Payment method (order.payment.method)

ValueMeaning
codCash on delivery — typically set payment.codAmount
prepaidPaid before ship (card / wallet / link)
otherFallback for uncommon methods

Delivery timing (order.deliveryTiming)

ValueMeaning
pendingETA not evaluated yet (usually before pickup)
on_timeWithin estimated arrival window
earlyDelivered / progressing earlier than ETA
latePast estimated arrival

Product / collection status

ValueMeaning
activeLive / visible as configured
draftNot published
archivedHidden; kept for history (product delete may archive)

Review status

ValueMeaning
pendingAwaiting merchant moderation
approvedVisible on storefront
rejectedRejected by merchant
hiddenHidden from storefront

Webhook events (subscribe via events[])

ValueMeaning
order.createdNew order
order.updatedOrder fields changed
order.status_changedEvery order status event (engine code + label, from, to, reasonCode, outcome, attempts, waybillRef)
order.deliveredDelivered
order.delivery_failedDelivery attempt failed
order.returnedReturned to the merchant
order.cancelledCancelled before pickup
order.return_leg_createdReturn leg created
product.updatedProduct created, updated, or deleted
collection.updatedCollection created, updated, or deleted
customer.createdNew customer
customer.updatedCustomer fields changed
inventory.adjustedStock level adjusted
stock.receivedInbound 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

FieldMeaning
idStable Wijha order id (use in paths)
numberHuman-facing order number
statusOrder status code — see enums
orderTypeDLV_COD | DLV_PRE | EXC | RET | RETURN_LEG — see enums
channelWhere the order originated
customerIdLinked CRM customer id when matched
customerNameBuyer name snapshot
customerPhoneBuyer phone (prefer E.164 / local EG formats your store uses)
shippingAddressDelivery address (line1, phone, zoneId, governorateCode, cityCode, state, city, area, …)
lineItems[]Order lines — see Line items
paymentmethod + codAmount (EGP) + currency
paymentStatusUNPAID | COLLECTED_CASH | PAID_ONLINE | REFUNDED
totalssubtotal, shipping, discount, total, currency
notesMerchant / customer notes
tagsOrder tags
versionIncreases on every status change

Waybill & delivery

FieldMeaning
waybillWijha waybill number (shared by an order and its return legs)
waybillRefPrinted reference — the waybill, or WJ…-R1, -R2 on a return leg
legNo0 for the original order, 1.. for return legs
parentOrderIdOriginal order for EXC / RET / RETURN_LEG
fulfilmentSourcemerchant | wijha (packed by the Wijha warehouse)
zoneId / hubIdDelivery zone and the hub handling the parcel
custodyTypeWho holds the parcel: merchant, fulfilment, courier, hub, partner, customer, none
attemptsDoorstep delivery attempts so far
outcomeFULL | PARTIAL | EXCHANGED | REFUSED | NOT_COLLECTED (after delivery)
exceptionReasonWhy delivery failed (status EXCEPTION)
serviceTypestandard | express | same_day
priceTypeINCLD | EXCLD — whether the COD amount includes shipping
allowOpenCustomer may open the parcel before paying
otpRequiredCustomer must confirm delivery with a one-time code
partialAllowedCustomer may keep only part of the order
weightGrams / dimensionsCmParcel weight and size when given
labelUrlWaybill label URL when available
awbPrintedAtWhen the waybill was marked printed
feeSnapshotShipping fee quote at booking (breakdown); null when not quoted
estimatedDeliveryAt / deliveryTimingETA after pickup; on_time / early / late / pending

Money in piasters (1 EGP = 100)

FieldMeaning
codAmountPiastersCash the courier collects (EGP × 100)
codDuePiastersCash still due after a partial delivery
declaredValuePiastersDeclared goods value for insurance

Timestamps (ISO)

FieldMeaning
createdAt / updatedAtCreated / last changed
statusChangedAtLast status change
packedAtPacking recorded
pickedUpAtPicked up from the merchant
firstAtHubAt / lastAtHubAtFirst and latest hub scan
deliveredAtDelivered
returnedAtReturned to the merchant
cancelledAtCancelled

Line items

FieldMeaning
idLine id (returned on read)
lineNoLine position (1, 2, …)
variantIdCatalog variant id (required on create)
productIdParent product id
skuStock-keeping unit — used for fulfill / warehouse match
qtyOrdered quantity
priceUnit sell price snapshot
deliveredQtyQuantity the customer accepted at delivery
fulfilledQty / returnedQtyPacked and returned quantities
unitCostCOGS snapshot at create (for profit)
costSourcevariant | stock | missing
imageUrlLine thumb snapshot when available

Deprecated (still returned — move off them)

FieldUse instead
shipmentServiceTypeorderType
fulfilledByWijhafulfilmentSource === "wijha"
shipping.trackingNumber / shipping.waybillwaybillRef
shipping.statusstatus (same value)
shipping.failureReasonexceptionReason
shipping.deliveryAttemptsattempts
shipping.courierCostfeeSnapshot

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

FieldMeaning
orderTypeDLV_COD | DLV_PRE | EXC | RET. Default: DLV_COD when payment.method is cod, else DLV_PRE
shippingAddress.zoneIdDelivery 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 / areaGovernorate, city and zone names (filled from the zone when you send zoneId)
shippingAddress.sectorIdDeprecated — read as zoneId for one release (mega areas are retired)
waybillPre-printed waybill (flyer) number; otherwise Wijha assigns one
weightGramsParcel weight in grams
dimensionsCm{ lengthCm, widthCm, heightCm }
declaredValueDeclared goods value in EGP (returned as declaredValuePiasters)
serviceTypestandard | express | same_day
priceTypeINCLD | EXCLD — overrides your contract default
allowOpen / otpRequired / partialAllowedBooleans — override your contract defaults
parentOrderIdOriginal order — required for RET, optional for EXC
exchangeReturnItems[] / exchangeReturnNoteEXC only: what the courier collects back ({ sku, qty })

PATCH /orders/:id

FieldMeaning
customerName / customerPhoneBuyer details
shippingAddressDelivery address
paymentmethod / codAmount / currency
notes / tagsNotes 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

FieldMeaning
idStable product id
titleDisplay name
skuProduct-level SKU when used
statusactive | draft | archived
description / descriptionHtmlLong copy (plain / HTML)
tagsString tags (e.g. import markers)
collectionIdsMembership in merchant collections
variants[]Sellable variants (price, sku, inventory, options)
media / mediaUrlsImage paths or absolute CDN URLs
trackInventoryWhether stock is enforced
inventoryPolicye.g. deny — block oversell when tracking
storeQuantityAggregated sellable qty across variants
categoryId / subcategoryIdCatalog taxonomy ids when set
brandBrand label when set
price / currencyDisplay price helpers when present
importSourceImport channel when product was imported (e.g. vondera)
importExternalIdExternal id from the import source (sync / idempotency)
warehouseQuantityWijha warehouse on-hand when store is warehouse-enrolled
shopifyProductIdLinked Shopify product id when connected

Variant

FieldMeaning
idVariant id (use on order lineItems.variantId)
skuUnique per-store SKU
titleVariant title (e.g. size label)
priceSell price
compareAtPriceCompare-at / was price
attributesOption map e.g. { Size: "M", Color: "Black" }
inventoryQuantityOn-hand / sellable qty for this variant
costUnit COGS when set (finance / profit)
barcodeBarcode when set
weightGramsVariant weight when set
hsCode / taxCodeCustoms / 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)

FieldMeaning
zoneId / zoneCodeDelivery zone (pass zoneId to /shipping-fees/resolve and in shippingAddress.zoneId)
zoneName / cityName / governorateCode / governorateNameZone, city and governorate
defaultFeeWijha's quoted fee for your store to this zone, incl. VAT (null when the zone isn't priced)
overrideFeeStore override fee (null when using the default)
effectiveFeeoverrideFee ?? defaultFee — the fee charged to the customer
currencyFee currency (usually EGP)
isOverrideTrue when the store overrode the Wijha default
sourcedefault | override | none
slaDays / estimatedArrivalHoursZone delivery SLA in days (and hours) from the parcel's first arrival at a Wijha hub
sectorId / sectorName / govId / govNameDeprecated aliases of zoneId / zoneName / governorateCode / governorateName (one release)

Resolved fee (GET /shipping-fees/resolve)

FieldMeaning
zoneIdDelivery zone id
amountEffective fee for the zone (0 when source is none)
currencyFee currency
sourcedefault | override | none
defaultFee / overrideFeeUnderlying 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.

List — request
GET /api/v1/orders?pageSize=20&status=in_transit,out_for_delivery
Authorization: Bearer wjh_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Accept: application/json
List — response
{
  "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
  }
}
Create — request
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
}
Create — response
{
  "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"
  }
}
Mark ready — request
POST /api/v1/orders/ord_01JABC/transition
Authorization: Bearer wjh_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Content-Type: application/json

{ "status": "READY" }
Mark ready — response
{
  "status": 200,
  "message": "ok",
  "data": {
    "id": "ord_01JABC",
    "number": "10042",
    "status": "READY",
    "statusChangedAt": "2026-10-08T17:30:00.000Z",
    "version": 2
  }
}
Cancel — request
DELETE /api/v1/orders/ord_01JABC
Authorization: Bearer wjh_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Cancel — response
{
  "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.

List — request
GET /api/v1/products?pageSize=20
Authorization: Bearer wjh_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Accept: application/json
List — response
{
  "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
  }
}
Create — request
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
    }
  ]
}
Create — response
{
  "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).

List — request
GET /api/v1/collections
Authorization: Bearer wjh_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Accept: application/json
List — response
{
  "status": 200,
  "message": "ok",
  "data": {
    "items": [
      { "id": "col_01J", "title": "Summer", "slug": "summer", "status": "active" }
    ],
    "nextPageToken": null
  }
}
Create — request
POST /api/v1/collections
Authorization: Bearer wjh_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Content-Type: application/json

{
  "title": "Summer",
  "slug": "summer",
  "status": "active",
  "productIds": ["prd_01J"]
}
Create — response
{
  "status": 201,
  "message": "created",
  "data": {
    "id": "col_01J",
    "title": "Summer",
    "slug": "summer",
    "status": "active",
    "productIds": ["prd_01J"]
  }
}

Expenses

Scope: expenses.crud.

List — request
GET /api/v1/expenses?from=2026-10-01&to=2026-10-31
Authorization: Bearer wjh_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Accept: application/json
List — response
{
  "status": 200,
  "message": "ok",
  "data": {
    "items": [
      {
        "id": "exp_01J",
        "categoryName": "Rent",
        "amount": 5000,
        "currency": "EGP",
        "expenseDate": "2026-10-01"
      }
    ]
  }
}
Create — request
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"
}
Create — response
{
  "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.

Request
GET /api/v1/analytics?from=2026-10-01&to=2026-10-17
Authorization: Bearer wjh_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Accept: application/json
Response
{
  "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).

Request
GET /api/v1/discounts
Authorization: Bearer wjh_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Accept: application/json
Response
{
  "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.

Request
GET /api/v1/customers?pageSize=20
Authorization: Bearer wjh_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Accept: application/json
Response
{
  "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.

Request
GET /api/v1/reviews?status=approved&limit=20
Authorization: Bearer wjh_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Accept: application/json
Response
{
  "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.

Zones — request
GET /api/v1/zones?governorateCode=EG-C&q=نصر
Authorization: Bearer wjh_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Accept: application/json
Zones — response
{
  "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
  }
}
Refused booking — response
{
  "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" }
    ]
  }
}
List — request
GET /api/v1/shipping-fees?governorateCode=EG-C&limit=50
Authorization: Bearer wjh_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Accept: application/json
List — response
{
  "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
      }
    ]
  }
}
Resolve one zone — request
GET /api/v1/shipping-fees/resolve?zoneId=zon_01JNASR7
Authorization: Bearer wjh_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Accept: application/json
Resolve one zone — response
{
  "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).

Request
GET /api/v1/store
Authorization: Bearer wjh_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Accept: application/json
Response
{
  "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.

List — request
GET /api/v1/webhooks/endpoints
Authorization: Bearer wjh_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Accept: application/json
List — response
{
  "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
  }
}
Create — request
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
}
Create — response
{
  "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.