Server To Server Notification V2
Throughout its entire roadmap, Your FawryPay transactions shall experience several status updates. Depending on the specific nature of your core business, the status of your clients’ transactions can range from created, paid, cancelled, expired, shipped to delivered. Whenever the status of one of your transactions has been altered, FawryPay will send an informative HTTP POST request to your preconfigured endpoint on your own application server with the current detailed status of your transaction. Note that your endpoint need to be set during your registration process as a merchant with FawryPay (Register as a merchant). You can optionally implement a service to receive this request so that you can avail the service to the customer or update your stock automatically. You will need to provide your endpoints (callback notification URL) for both development and production environments.
FawryPay Example HTTP POST request to the merchant callback URL
Assuming you have providedhttp://MerchantURL/merchatCallbakPage as your callback URL, FawryPay server to serve API V2 will send the follwoing HTTP POST request with the following body parameters whenever the status of your transaction has been altered:
HTTP POST Request Parameters
Detailed description of the parameters associated with FawryPay server to server notification API V2 are given in the table below.
Parameter | type | Description | example |
---|---|---|---|
requestId | String |
UUID generated Request id | c72827d084ea4b88949d91dd2db4996e |
fawryRefNumber | String |
The reference number of this order in atFawry system which is displayed to the customer and used during the payment | 9990076204 |
merchantRefNumber | String |
The reference number of this order at merchant's system. | 9990076204 |
customerName | String |
Customer Name. | FirstName LastName |
customerMobile | Integer |
Customer Cell Phone | 01xxxxxxxxx |
customerMail | Email String |
Customer email to which payment confirmation will be sent. | example@domain.com |
customerMerchantId | String |
The Profile id for the customer in the merchant system | ACD23658 |
paymentAmount | Decimal |
The amount value received from merchant to be paid by the customer, merchant can use it to verify that the customer pay the required amount to enable the service to the customer | 350.50 |
orderAmount | Decimal |
The payment Amount without the fees. | 780.75 |
fawryFees | Decimal |
The fees added by fawry for the order amount. | 10.00 |
shippingFees | Decimal |
Shipping fees amount if applicable | 5.50 |
orderStatus | String |
The updated status of your transaction. | New, PAID, CANCELED DELIVERED, REFUNDED, EXPIRED PARTIAL_REFUNDED, FAILED |
paymentMethod | String |
The configured payment method for the merchant | PAYATFAWRY, CARD |
paymentTime | Date-Time |
The actual time for the payment if the Order Status is PAID | 19-05-2020 11:45:23 |
authNumber | Integer |
The transaction number in the bank | 96322541122558 |
paymentRefrenceNumber | String |
Unique number registered in FawryPay system to keep track of the payment | 369552233 |
orderExpiryDate | Decimal |
The order expiry in hours for this order if the merchant need to set specific expiry for this order if not set we will use the configured expiry hour per merchant | 3.5 |
orderItems | String |
A list of order items associated to the order | 123456 |
failureErrorCode | Integer |
Contains the error code in case of failure. | 9965 |
failureReason | String |
Contains an error message describing the failure reason. | Wrong Signature |
messageSignature | String |
The SHA-256 digested for the following concatenated string fawryRefNumber + merchantRefNum + Payment amount(in two decimal format 10.00)+Order amount(in two decimal format 10.00)+Order Status + Payment method + Payment reference number ( if exist as in case of notification for order creation this element will be empty) + secureKey | ab34dcddfab34dcddfab34dcddfab34 dcddfab34dcddfab34dcddfab34dcddf |
Expected Body Response
FawryPay check on the http response status so return empty response and in case of http response status 200 the call back will be marked as delivered else FawryPay will keep sending the HTTP request for a preconfigured number of retries.
Was this page helpful?
Thank you for helping improve FawryPay's documentation. If you need help or have any questions, please consider contacting support.