Skip to main content

Paymob transaction inquiry (by AWB)

POST
/api/v1/integrations/paymob/transaction-inquiry

Looks up the current transaction status for a shipment identified by awb directly from Paymob's systems.

Behavior & Dynamic Logic

  • Order Resolution: Resolves the latest payment credentials (the numeric Paymob order_id and the UUID-based merchantOrderId) from the pg_paymob_payment_keys table using the provided awb.
  • Preconditions: A payment intention must have been created for the AWB first; otherwise, no Paymob order_id will be found, resulting in a 400 Bad Request.
  • Authentication Flow: Programmatically authenticates with Paymob using PAYMOB_API_KEY to obtain an authentication token (POST /api/auth/tokens), then calls Paymob's inquiry API (POST /api/ecommerce/orders/transaction_inquiry).

Request​

Responses​

200 OK

Inquiry result returned successfully.

400 Bad Request

Bad Request. Returned when:

  • request validation fails (e.g. missing awb);
  • no Paymob order_id exists for the AWB yet (No Paymob order_id found for AWB <awb>. Create intention first.);
  • Paymob returned an error, including a "transaction not found" response, which is surfaced as Paymob API error: <status> - <body>.
401 Unauthorized

Unauthorized - the provided API key is invalid or missing.

500 Internal Server Error

Internal Server Error - the Paymob auth token could not be resolved, or a required Paymob environment variable (e.g. PAYMOB_API_KEY) is missing.