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_idand the UUID-basedmerchantOrderId) from thepg_paymob_payment_keystable using the providedawb. - Preconditions: A payment intention must have been created for the AWB first; otherwise, no Paymob
order_idwill be found, resulting in a400 Bad Request. - Authentication Flow: Programmatically authenticates with Paymob using
PAYMOB_API_KEYto 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_idexists 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.