Fawry
Start accepting payments using Fawry, the dominant payment method in Egypt.
Shoppers can now make Fawry payments via the myFawry app (App Store and Google Play), rather than having to take their payment reference to a shop or ATM, meaning a better payment experience for both you and your customers.
To start accepting Fawry payments, please contact your Customer Success Manager.
Model | Collecting |
Payment flow | Redirect |
Payment method type | Voucher |
One-step payment | |
Authorization | |
Capture | |
Refund | |
Partial refund | |
Chargeback | |
Recurring payment |
Request a payment
Use the details below to set up your request.
Endpoints
You can find the full list, as well as complete request and response examples, in our API reference.
https://api.checkout.com/payments
Request example
{"amount": 1000,"currency": "EGP","source": {"type": "fawry","description": "Fawry Demo Payment","customer_mobile": "01058375055","customer_email": "bruce@wayne-enterprises.com","products": [{"product_id": "0123456789","quantity": 1,"price": 1000,"description": "Fawry Demo Product"}]}}
Response example
If you receive a 202 Success
response containing a status
field set to Pending
, your request was successful.
In addition, you will receive payment_pending
and payment_capture_pending
webhook notifications. And, when the customer completes the Fawry payment in a timely manner at a point of sale, you will get a payment_captured
webhook notification to confirm that the payment has completed.
{"id": "pay_xksrrfuzksge5gyyqubpgbn7gy","status": "Pending","customer": {"id": "cus_v65kd7q5tojehd23eftbaiktru"},"_links": {"self": {"href": "https://api.sandbox.checkout.com/payments/pay_xksrrfuzksge5gyyqubpgbn7gy"}}}
Payment capture, expiration and cancellation
The payment will remain pending for the duration that you agreed when you onboarded your business with Fawry, or until the date and time you set for expires_on
. If the customer fails to complete the transaction at a point of sale by then, the payment will expire and you will receive a payment_expired
webhook notification. If, for any reason, the payment gets canceled before being captured or expiring, you will receive the payment_canceled
webhook notification instead. Make sure that your products and/or services are not shipped and/or provided before receiving confirmation of the capture.
Get details about a payment
You can retrieve details about an existing Fawry payment with the following endpoint.
Endpoints
https://api.checkout.com/payments/{id}
Response example
{"id": "pay_xksrrfuzksge5gyyqubpgbn7gy","requested_on": "2019-05-27T14:10:32Z","source": {"type": "fawry","description": "Fawry Demo Payment","reference_number": "1019734277"},"amount": 1000,"currency": "EGP","payment_type": "Regular","status": "Pending","risk": {"flagged": false},"customer": {"id": "cus_v65kd7q5tojehd23eftbaiktru"},"_links": {"self": {"href": "https://api.sandbox.checkout.com/payments/pay_xksrrfuzksge5gyyqubpgbn7gy"}}}
Refund a payment
Fawry supports both partial (see note below for details) and full refunds. You can refund a payment through the Dashboard or by using the refund API.
Multiple partial refund actions may be taken on a Fawry payment if there is some amount left. In addition, Fawry refunds are always rounded down to the nearest whole number. For example, attempting to refund a payment amount of 10999 (EGP 109.99) will only refund 10900 (EGP 109.00).
Webhooks
When using Fawry, you may receive the following webhooks.
Webhook | Description |
---|---|
| Sent when a payment request has successfully initiated. |
| Sent when the payment has expired. (Fawry payments expire after two hours.) |
| Sent when a payment request has been rejected. |
| Sent when the customer has approved the payment by paying it with a voucher or by cash. |
| Sent when the payment has been successfully captured. |
| Sent when the customer has aborted the payment or the payment has failed. |
| Sent when the refund of the payment has been (fully or partially) accepted for refund. |
| Sent when the payment has been (fully or partially) refunded. |
| Sent when a refund has been declined. |
Testing Fawry
To start testing, you'll need to contact your Customer Success Manager or Integrations engineer to activate Fawry payments.
The following endpoints are for testing purposes only. They will not work in the live environment.
You can use the two following endpoints to test capturing and canceling a payment in our sandbox environment.
Get payment details
First, you will need to get the details of payment (as above) and make a note of the reference_number
in the response.
Capture a payment
Use the reference_number
from the above response to test capturing a payment.
Endpoint
https://api.sandbox.checkout.com/apms/fawry-external/payments/{reference_number}/approval
Header and path parameters
Header | Value |
---|---|
required |
|
required |
|
Path | Value |
---|---|
required | The reference number you received in the response to the 'get payment details' request. |
If successful, you will receive a payment_captured
webhook notification.
Cancel a payment
Use the reference_number
from the response to your get payment details request to test canceling a payment.
Endpoint
https://api.sandbox.checkout.com/apms/fawry-external/payments/{reference_number}/cancellation
Header and path parameters
Header | Value |
---|---|
required |
|
required |
|
Path | Value |
---|---|
required | The reference number you received in the response to the 'get payment details' request. |
If successful, you will receive a payment_canceled
webhook notification.
Fawry on mobile
You can offer the myFawry app for making payments. The app applies the same rules for both cash and credit card orders as kiosk and myFawry do not differ.
Refunds are made following the same steps as for cash orders:
- When Fawry receives a refund request it sends a notification informing you that the proper action has been taken.
- The customer receives an SMS with the reference code containing the OTP. The SMS is sent to the mobile number used in placing the order.
- If the customer has payed with a credit card, the refund amount is sent to their credit card.
- If the customer has payed with cash and request refund using the myFawry app, they receive a reference number they should use at a kiosk to obtain the refund.