Fawry
Last updated: February 8, 2023
Start accepting payments using Fawry, the dominant payment method in Egypt.
Information
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.
Information
To start accepting Fawry payments, please contact your Account Manager.
Model | Collecting |
---|---|
Payment flow | Redirect |
Payment method type | Voucher |
One-step payment | |
Authorization | |
Capture | |
Refund | |
Partial refund | |
Chargeback | |
Recurring payment |
Use the details below to set up your request.
You can find the full list, as well as complete request and response examples, in our API reference.
post
https://api.checkout.com/payments
1{2"amount": 1000,3"currency": "EGP",4"source": {5"type": "fawry",6"description": "Fawry Demo Payment",7"customer_mobile": "01058375055",8"customer_email": "[email protected]",9"products": [10{11"product_id": "0123456789",12"quantity": 1,13"price": 1000,14"description": "Fawry Demo Product"15}16]17}18}
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.
1{2"id": "pay_xksrrfuzksge5gyyqubpgbn7gy",3"status": "Pending",4"customer": {5"id": "cus_v65kd7q5tojehd23eftbaiktru"6},7"_links": {8"self": {9"href": "https://api.sandbox.checkout.com/payments/pay_xksrrfuzksge5gyyqubpgbn7gy"10}11}12}
Information
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.
You can retrieve details about an existing Fawry payment with the following endpoint.
You can find the full list, as well as complete request and response examples, in our API reference.
get
https://api.checkout.com/payments/{payment_id}
1{2"id": "pay_xksrrfuzksge5gyyqubpgbn7gy",3"requested_on": "2019-05-27T14:10:32Z",4"source": {5"type": "fawry",6"description": "Fawry Demo Payment",7"reference_number": "1019734277"8},9"amount": 1000,10"currency": "EGP",11"payment_type": "Regular",12"status": "Pending",13"risk": {14"flagged": false15},16"customer": {17"id": "cus_v65kd7q5tojehd23eftbaiktru"18},19"_links": {20"self": {21"href": "https://api.sandbox.checkout.com/payments/pay_xksrrfuzksge5gyyqubpgbn7gy"22}23}24}
Fawry supports both partial (see note below for details) and full refunds. You can refund a payment through the hub or by using the Refund API.
Note
Only one refund action may be taken on a Fawry payment, meaning that if you carry out a partial refund, you cannot then refund any more, even 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).
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. |
Information
To start testing, you'll need to:
- create a test account, and
- contact your Account Manager or Integrations engineer to activate Fawry payments in the sandbox environment.
Note
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.
First, you will need to get the details of payment (as above) and make a note of the reference_number
in the response.
Use the reference_number
from the above response to test capturing a payment.
put
https://api.sandbox.checkout.com/apms/fawry/payments/{reference_number}/approval
Header | Value |
---|---|
required |
Use the valid secret key of your Checkout.com account. You can find this in the Hub. |
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.
Use the reference_number
from the response to your get payment details request to test canceling a payment.
put
https://api.sandbox.checkout.com/apms/fawry/payments/{reference_number}/cancellation
Header | Value |
---|---|
required |
Use the valid secret key of your Checkout.com account. You can find this in the Hub. |
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.